View | Details | Raw Unified | Return to bug 8587
Collapse All | Expand All

(-)a/C4/Serials.pm (-7 / +10 lines)
Lines 1385-1391 sub ModSubscription { Link Here
1385
    $lastvalue2, $innerloop2, $lastvalue3, $innerloop3, $status,
1385
    $lastvalue2, $innerloop2, $lastvalue3, $innerloop3, $status,
1386
    $biblionumber, $callnumber, $notes, $letter, $manualhistory,
1386
    $biblionumber, $callnumber, $notes, $letter, $manualhistory,
1387
    $internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount,
1387
    $internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount,
1388
    $graceperiod, $location, $enddate, $subscriptionid, $skip_serialseq
1388
    $graceperiod, $location, $enddate, $subscriptionid, $skip_serialseq, $seriallifespan
1389
    ) = @_;
1389
    ) = @_;
1390
1390
1391
    my $dbh   = C4::Context->dbh;
1391
    my $dbh   = C4::Context->dbh;
Lines 1398-1404 sub ModSubscription { Link Here
1398
            callnumber=?, notes=?, letter=?, manualhistory=?,
1398
            callnumber=?, notes=?, letter=?, manualhistory=?,
1399
            internalnotes=?, serialsadditems=?, staffdisplaycount=?,
1399
            internalnotes=?, serialsadditems=?, staffdisplaycount=?,
1400
            opacdisplaycount=?, graceperiod=?, location = ?, enddate=?,
1400
            opacdisplaycount=?, graceperiod=?, location = ?, enddate=?,
1401
            skip_serialseq=?
1401
            skip_serialseq=?,
1402
            seriallifespan=?
1402
        WHERE subscriptionid = ?";
1403
        WHERE subscriptionid = ?";
1403
1404
1404
    my $sth = $dbh->prepare($query);
1405
    my $sth = $dbh->prepare($query);
Lines 1412-1418 sub ModSubscription { Link Here
1412
        $letter,          ($manualhistory ? $manualhistory : 0),
1413
        $letter,          ($manualhistory ? $manualhistory : 0),
1413
        $internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount,
1414
        $internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount,
1414
        $graceperiod,     $location,       $enddate,        $skip_serialseq,
1415
        $graceperiod,     $location,       $enddate,        $skip_serialseq,
1415
        $subscriptionid
1416
        $seriallifespan, $subscriptionid
1416
    );
1417
    );
1417
    my $rows = $sth->rows;
1418
    my $rows = $sth->rows;
1418
1419
Lines 1444-1450 sub NewSubscription { Link Here
1444
    $innerloop3, $status, $notes, $letter, $firstacquidate, $irregularity,
1445
    $innerloop3, $status, $notes, $letter, $firstacquidate, $irregularity,
1445
    $numberpattern, $locale, $callnumber, $manualhistory, $internalnotes,
1446
    $numberpattern, $locale, $callnumber, $manualhistory, $internalnotes,
1446
    $serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod,
1447
    $serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod,
1447
    $location, $enddate, $skip_serialseq
1448
    $location, $enddate, $skip_serialseq, $seriallifespan
1448
    ) = @_;
1449
    ) = @_;
1449
    my $dbh = C4::Context->dbh;
1450
    my $dbh = C4::Context->dbh;
1450
1451
Lines 1457-1464 sub NewSubscription { Link Here
1457
            lastvalue3, innerloop3, status, notes, letter, firstacquidate,
1458
            lastvalue3, innerloop3, status, notes, letter, firstacquidate,
1458
            irregularity, numberpattern, locale, callnumber,
1459
            irregularity, numberpattern, locale, callnumber,
1459
            manualhistory, internalnotes, serialsadditems, staffdisplaycount,
1460
            manualhistory, internalnotes, serialsadditems, staffdisplaycount,
1460
            opacdisplaycount, graceperiod, location, enddate, skip_serialseq)
1461
            opacdisplaycount, graceperiod, location, enddate, skip_serialseq,
1461
        VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
1462
            seriallifespan)
1463
        VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
1462
        |;
1464
        |;
1463
    my $sth = $dbh->prepare($query);
1465
    my $sth = $dbh->prepare($query);
1464
    $sth->execute(
1466
    $sth->execute(
Lines 1468-1474 sub NewSubscription { Link Here
1468
        $lastvalue3, $innerloop3, $status, $notes, $letter,
1470
        $lastvalue3, $innerloop3, $status, $notes, $letter,
1469
        $firstacquidate, $irregularity, $numberpattern, $locale, $callnumber,
1471
        $firstacquidate, $irregularity, $numberpattern, $locale, $callnumber,
1470
        $manualhistory, $internalnotes, $serialsadditems, $staffdisplaycount,
1472
        $manualhistory, $internalnotes, $serialsadditems, $staffdisplaycount,
1471
        $opacdisplaycount, $graceperiod, $location, $enddate, $skip_serialseq
1473
        $opacdisplaycount, $graceperiod, $location, $enddate, $skip_serialseq,
1474
        $seriallifespan
1472
    );
1475
    );
1473
1476
1474
    my $subscriptionid = $dbh->{'mysql_insertid'};
1477
    my $subscriptionid = $dbh->{'mysql_insertid'};
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 2099-2104 CREATE TABLE `subscription` ( Link Here
2099
  `enddate` date default NULL,
2099
  `enddate` date default NULL,
2100
  `closed` INT(1) NOT NULL DEFAULT 0,
2100
  `closed` INT(1) NOT NULL DEFAULT 0,
2101
  `reneweddate` date default NULL,
2101
  `reneweddate` date default NULL,
2102
  `seriallifespan` TINYINT(1) DEFAULT -1,
2102
  PRIMARY KEY  (`subscriptionid`),
2103
  PRIMARY KEY  (`subscriptionid`),
2103
  CONSTRAINT subscription_ibfk_1 FOREIGN KEY (periodicity) REFERENCES subscription_frequencies (id) ON DELETE SET NULL ON UPDATE CASCADE,
2104
  CONSTRAINT subscription_ibfk_1 FOREIGN KEY (periodicity) REFERENCES subscription_frequencies (id) ON DELETE SET NULL ON UPDATE CASCADE,
2104
  CONSTRAINT subscription_ibfk_2 FOREIGN KEY (numberpattern) REFERENCES subscription_numberpatterns (id) ON DELETE SET NULL ON UPDATE CASCADE
2105
  CONSTRAINT subscription_ibfk_2 FOREIGN KEY (numberpattern) REFERENCES subscription_numberpatterns (id) ON DELETE SET NULL ON UPDATE CASCADE
(-)a/installer/data/mysql/updatedatabase.pl (+7 lines)
Lines 8603-8608 if ( CheckVersion($DBversion) ) { Link Here
8603
    SetVersion($DBversion);
8603
    SetVersion($DBversion);
8604
}
8604
}
8605
8605
8606
$DBversion = 'XXX';
8607
if ( CheckVersion($DBversion) ) {
8608
   $dbh->do("ALTER TABLE subscription ADD `seriallifespan` TINYINT(1) DEFAULT -1");
8609
   print "Upgrade to $DBversion done (Add seriallifespan to subscription)\n";
8610
   SetVersion ($DBversion);
8611
}
8612
8606
=head1 FUNCTIONS
8613
=head1 FUNCTIONS
8607
8614
8608
=head2 TableExists($table)
8615
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt (-3 / +255 lines)
Lines 460-468 $(document).ready(function() { Link Here
460
        <div class="yui-g">
460
        <div class="yui-g">
461
            <h1>[% IF ( modify ) %] Modify subscription for <i>[% bibliotitle |html %]</i>[% ELSE %]Add a new subscription[% END %] (<span id="page_number">1/2</span>)</h1>
461
            <h1>[% IF ( modify ) %] Modify subscription for <i>[% bibliotitle |html %]</i>[% ELSE %]Add a new subscription[% END %] (<span id="page_number">1/2</span>)</h1>
462
            <form method="post" name="f" action="/cgi-bin/koha/serials/subscription-add.pl" class="validated" onsubmit="return Check_page2();" >
462
            <form method="post" name="f" action="/cgi-bin/koha/serials/subscription-add.pl" class="validated" onsubmit="return Check_page2();" >
463
                [% IF ( modify ) %]
463
   
464
                    <input type="hidden" name="op" value="modsubscription" />
464
[% IF ( modify ) %]
465
                    <input type="hidden" name="subscriptionid" value="[% subscriptionid %]" />
465
        <input type="hidden" name="op" value="modsubscription" />
466
        <input type="hidden" name="subscriptionid" value="[% subscriptionid %]" />
467
[% ELSE %]
468
        <input type="hidden" name="op" value="addsubscription" />
469
[% END %]
470
<input type="hidden" name="user" value="[% loggedinusername %]" />
471
<input type="hidden" name="irreg_check" value="0" />
472
<input type="hidden" name="issuesexpected1" id="issuesexpected1" value="0" />
473
474
	<div class="yui-u first">
475
    <fieldset id="subscription_add_information" class="rows">
476
	<legend>Subscription details</legend>
477
	<ol>
478
	    [% IF ( subscriptionid ) %]
479
        <li><span class="label">Subscription #</span> [% subscriptionid %]</li>
480
        [% END %]
481
        <li>
482
            <label for="aqbooksellerid">Vendor: </label>
483
            <input type="text" name="aqbooksellerid" id="aqbooksellerid" value="[% aqbooksellerid %]" size="8" /> (<input type="text" name="aqbooksellername" value="[% aqbooksellername %]" disabled="disabled" readonly="readonly" />) <a href="#" onclick="FindAcqui(f)">Search for a vendor</a>
484
        </li>
485
        <li>
486
            <label for="biblionumber" class="required" title="Subscriptions must be associated with a bibliographic record">Biblio:</label>
487
            
488
                <input type="text" name="biblionumber" id="biblionumber" value="[% bibnum %]" size="8" /> 
489
                (<input type="text" name="title" value="[% bibliotitle %]" disabled="disabled" readonly="readonly" />) <span class="required" title="Subscriptions must be associated with a bibliographic record">Required</span>
490
               <div class="inputnote"> <a href="#" onclick="Plugin(f)">Search for Biblio</a>
491
		    [% IF ( CAN_user_editcatalogue ) %] 
492
		       [% IF ( modify ) %]
493
		       | <a href="#" onclick="addbiblioPopup([% bibnum %]); return false;">Edit biblio</a>
494
		       [% ELSE %]
495
		       | <a href="#" onclick="addbiblioPopup(); return false;">Create Biblio</a>
496
		       [% END %]
497
		    [% END %]
498
	       </div>
499
            
500
        </li>
501
        <li class="radio">
502
            [% IF ( serialsadditems ) %]
503
                <p><input type="radio" id="serialsadditems-yes" name="serialsadditems" value="1" checked="checked" /><label class="widelabel" for="serialsadditems-yes">create an item record when receiving this serial</label></p>
504
                <p><input type="radio" id="serialsadditems-no" name="serialsadditems" value="0" /><label class="widelabel" for="serialsadditems-no">do not create an item record when receiving this serial </label></p>
505
            [% ELSE %]
506
                <p><input type="radio" id="serialsadditems-yes" name="serialsadditems" value="1"/><label class="widelabel" for="serialsadditems-yes">create an item record when receiving this serial</label></p>
507
                <p><input type="radio" id="serialsadditems-no" name="serialsadditems" value="0" checked="checked" /><label class="widelabel" for="serialsadditems-no">do not create an item record when receiving this serial</label></p>
508
            [% END %]
509
        </li>
510
        <li>
511
            <label for="seriallifespan">Serial lifespan:</label>
512
            <select name="seriallifespan" id="seriallifespan">
513
            [% IF ( seriallifespan == -1 ) %]
514
                <option value="-1" selected="selected">Permanent</option>
515
            [% ELSE %]
516
                <option value="-1">Permanent</option>
517
            [% END %]
518
            [% IF ( seriallifespan == 1 ) %]
519
                <option value="1" selected="selected">1 year</option>
520
            [% ELSE %]
521
                <option value="1">1 year</option>
522
            [% END %]
523
            [% IF ( seriallifespan == 2 ) %]
524
                <option value="2" selected="selected">2 years</option>
525
            [% ELSE %]
526
                <option value="2">2 years</option>
527
            [% END %]
528
            [% IF ( seriallifespan == 3 ) %]
529
                <option value="3" selected="selected">3 years</option>
530
            [% ELSE %]
531
                <option value="3">3 years</option>
532
            [% END %]
533
            [% IF ( seriallifespan == 4 ) %]
534
                <option value="4" selected="selected">4 years</option>
535
            [% ELSE %]
536
                <option value="4">4 years</option>
537
            [% END %]
538
            [% IF ( seriallifespan == 5 ) %]
539
                <option value="5" selected="selected">5 years</option>
540
            [% ELSE %]
541
                <option value="5">5 years</option>
542
            [% END %]
543
            [% IF ( seriallifespan == 6 ) %]
544
                <option value="6" selected="selected">6 years</option>
545
            [% ELSE %]
546
                <option value="6">6 years</option>
547
            [% END %]
548
            [% IF ( seriallifespan == 7 ) %]
549
                <option value="7" selected="selected">7 years</option>
550
            [% ELSE %]
551
                <option value="7">7 years</option>
552
            [% END %]
553
            [% IF ( seriallifespan == 8 ) %]
554
                <option value="8" selected="selected">8 years</option>
555
            [% ELSE %]
556
                <option value="8">8 years</option>
557
            [% END %]
558
            [% IF ( seriallifespan == 9 ) %]
559
                <option value="9" selected="selected">9 years</option>
560
            [% ELSE %]
561
                <option value="9">9 years</option>
562
            [% END %]
563
            [% IF ( seriallifespan == 10 ) %]
564
                <option value="10" selected="selected">10 years</option>
565
            [% ELSE %]
566
                <option value="10">10 years</option>
567
            [% END %]
568
            </select>
569
            <div class="hint">Set the subscription's serial lifespan. A serial will be considered "out of date" after the chosen time period.</div>
570
        </li>
571
        <li>
572
            <label for="branchcode">Library:</label>
573
            
574
                <select name="branchcode" id="branchcode" style="width: 20em;">
575
                    [% UNLESS ( IndependentBranches ) %]<option value="">None</option>[% END %]
576
                    [% FOREACH branchloo IN branchloop %][% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
577
				[% ELSE %]
578
				<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
579
				[% END %]
580
                    [% END %]
581
                </select> (select a library)
582
            
583
        </li>
584
        <li>
585
            <label for="location">Location:</label>
586
            <select name="location" id="location">
587
                <option value="">None</option>
588
                [% FOREACH locations_loo IN locations_loop %][% IF ( locations_loo.selected ) %]<option value="[% locations_loo.authorised_value %]" selected="selected">[% locations_loo.lib %]</option>[% ELSE %]<option value="[% locations_loo.authorised_value %]">[% locations_loo.lib %]</option>[% END %][% END %]
589
            </select>
590
        </li>
591
         <li>
592
            <label for="callnumber">Call number:</label>
593
            <input type="text" name="callnumber" id="callnumber" value="[% callnumber %]" size="20" />
594
        </li>
595
        <li>
596
            <label for="graceperiod">Grace period:</label> <input type="text" name="graceperiod" id="graceperiod" value="[% graceperiod %]" size="5"/> day(s)
597
        </li>
598
        <li>
599
            <label for="notes">OPAC note:</label>
600
            <textarea name="notes" id="notes" cols="30" rows="2">[% notes %]</textarea>
601
        </li>
602
        <li>
603
            <label for="internalnotes">Nonpublic note:</label>
604
            <textarea name="internalnotes" id="internalnotes" cols="30" rows="2">[% internalnotes %]</textarea>
605
        </li>
606
        <li>
607
            
608
               [% IF ( letterloop ) %]
609
            <label for="letter">Patron notification: </label>
610
			   <select name="letter" id="letter">
611
                    <option value="">None</option>
612
                [% FOREACH letterloo IN letterloop %]
613
				[% IF ( letterloo.selected ) %]
614
                    <option value="[% letterloo.value %]" selected="selected">[% letterloo.lettername %]</option>
615
[% ELSE %]
616
                    <option value="[% letterloo.value %]">[% letterloo.lettername %]</option>
617
[% END %]
618
                [% END %]
619
                </select> 
620
                <div class="hint">Select a notice and subscribers will be notified when new issues are received.</div>
621
            	[% ELSE %]
622
            <span class="label">Patron notification: </span>
623
				<div class="hint">To notify patrons of new serial issues, you must <a href="/cgi-bin/koha/tools/letter.pl">define a notice</a>.</div>
624
				[% END %]
625
        </li>
626
		<li>
627
			 <label class="widelabel" for="staffdisplaycount">Number of issues to display to staff: </label>
628
			 <input type="text" name="staffdisplaycount" id="staffdisplaycount" value="[% staffdisplaycount %]" size="4"/>
629
		 </li>
630
		 <li>
631
            <label class="widelabel" for="opacdisplaycount">Number of issues to display in OPAC: </label>
632
			<input type="text" name="opacdisplaycount" id="opacdisplaycount" value="[% opacdisplaycount %]" size="4"/>
633
		</li>
634
	</ol>
635
	</fieldset>
636
	</div>
637
	
638
<div class="yui-u">
639
<div id="subscription_form_history" style="display:none"><h3 style="display:inline">Subscription history</h3> <a href="#" id="cancel_manual_history">[cancel manual history]</a>
640
        <p>Hint: you can update the serial history manually. This can be useful for an old subscription or to clean the existing history. Modify these fields with care, as future serial receive will continue to update them automatically.</p>
641
        <fieldset class="rows">
642
            <ol>
643
                <li>
644
                <label for="histstartdate">Subscription start date: </label>
645
                <input type="text" name="histstartdate" id="histstartdate" value="[% histstartdate %]" /><div class="hint"> (start date of the 1st subscription)</div>
646
                </li>
647
                <li>
648
                <label for="histenddate">Subscription end date: </label>
649
                <input type="text" name="histenddate" id="histenddate" value="[% histenddate %]" /> <div class="hint">(if empty, subscription is still active)</div>
650
                </li>
651
                <li>
652
                <label for="recievedlist">Received issues: </label>
653
                <textarea name="recievedlist" id="recievedlist" cols="60" rows="5">[% recievedlist %]</textarea>
654
                </li>
655
                <li>
656
                <label for="missinglist">Missing issues: </label>
657
                <textarea name="missinglist" id="missinglist" cols="60" rows="5">[% missinglist %]</textarea>
658
                </li>
659
                <li>
660
                <label for="opacnote">Note for OPAC: </label>
661
                <textarea name="opacnote" id="opacnote" cols="60" rows="5">[% opacnote %]</textarea>
662
                </li>
663
                <li>
664
                <label for="librariannote">Note for staff: </label>
665
                <textarea name="librariannote" id="librariannote" cols="60" rows="5">[% librariannote %]</textarea>
666
                </li>
667
            </ol>
668
        </fieldset>
669
    <fieldset class="action"><input type="submit" value="Save subscription history"  /></fieldset>
670
</div>
671
672
<div id="subscription_form_planning">
673
	<fieldset class="rows">
674
	<legend>Serials planning</legend>
675
    <ol>
676
        <li>
677
           <label for="acqui_date"> First issue publication date:</label>
678
                [% IF ( modify ) %]<input type="text" name="firstacquidate" value="[% firstacquidate %]"  size="13" maxlength="10" id="acqui_date" disabled="disabled" />
679
                [% ELSE %]<input type="text" name="firstacquidate" value="[% firstacquidate %]"  size="13" maxlength="10" id="acqui_date" class="datepicker" />[% END %]
680
        </li>
681
           [% IF ( modify ) %]<li><label for="next_acqui_date"> Next issue publication date:</label>
682
                <input type="text" name="nextacquidate" value="[% nextacquidate %]" size="13" maxlength="10" id="next_acqui_date" class="datepicker" />
683
                </li>[% END %]
684
                
685
        <li>
686
            <label for="periodicity" class="required">Frequency:</label>
687
                <select name="periodicity" size="1" id="periodicity" onchange="javascript:document.getElementsByName('manualhist')[0].checked=(this.value==1); reset_num_pattern();">
688
                <option value="" selected="selected">-- please choose --</option>
689
                [% IF ( periodicity16 ) %]
690
                <option value="16" selected="selected">Without periodicity</option>
691
                [% ELSE %]
692
                    <option value="16">Without periodicity</option>
693
                [% END %]
694
                [% IF ( periodicity48 ) %]
695
                <option value="48" selected="selected">Unknown</option>
696
                [% ELSE %]
697
                <option value="48">Unknown</option>
698
                [% END %]
699
                [% IF ( periodicity32 ) %]
700
                <option value="32" selected="selected">Irregular</option>
701
                [% ELSE %]
702
                    <option value="32">Irregular</option>
703
                [% END %]
704
705
                [% IF ( periodicity12 ) %]
706
                    <option value="12" selected="selected">2/day</option>
707
                [% ELSE %]
708
                    <option value="12">2/day</option>
709
                [% END %]
710
                [% IF ( periodicity1 ) %]
711
                    <option value="1" selected="selected">daily (n/week)</option>
712
                [% ELSE %]
713
                    <option value="1">daily (n/week)</option>
714
                [% END %]
715
                [% IF ( periodicity2 ) %]
716
                    <option value="2" selected="selected">1/week</option>
717
>>>>>>> Bug 8587 - Add a serial lifespan field to serial subscriptions
466
                [% ELSE %]
718
                [% ELSE %]
467
                        <input type="hidden" name="op" value="addsubscription" />
719
                        <input type="hidden" name="op" value="addsubscription" />
468
                [% END %]
720
                [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt (+52 lines)
Lines 180-185 $(document).ready(function() { Link Here
180
        [% IF ( numberlength ) %]<li><span class="label">Number of issues:</span> [% numberlength %]</li>[% END %]
180
        [% IF ( numberlength ) %]<li><span class="label">Number of issues:</span> [% numberlength %]</li>[% END %]
181
        [% IF ( weeklength ) %]<li><span class="label">Number of weeks:</span> [% weeklength %]</li>[% END %]
181
        [% IF ( weeklength ) %]<li><span class="label">Number of weeks:</span> [% weeklength %]</li>[% END %]
182
        [% IF ( monthlength ) %]<li><span class="label">Number of months:</span> [% monthlength %]</li>[% END %]
182
        [% IF ( monthlength ) %]<li><span class="label">Number of months:</span> [% monthlength %]</li>[% END %]
183
                <li><span class="label">Serial lifespan:</span>
184
                [% IF seriallifespan == -1 %]
185
                    <span>Permanent</span>
186
                [% ELSIF ( seriallifespan == 1 ) %]
187
                    <span>1 year</span>
188
                [% ELSIF ( seriallifespan == 2 ) %]
189
                    <span>2 years</span>
190
                [% ELSIF ( seriallifespan == 3 ) %]
191
                    <span>3 years</span>
192
                [% ELSIF ( seriallifespan == 4 ) %]
193
                    <span>4 years</span>
194
                [% ELSIF ( seriallifespan == 5 ) %]
195
                    <span>5 years</span>
196
                [% ELSIF ( seriallifespan == 6 ) %]
197
                    <span>6 years</span>
198
                [% ELSIF ( seriallifespan == 7 ) %]
199
                    <span>7 years</span>
200
                [% ELSIF ( seriallifespan == 8 ) %]
201
                    <span>8 years</span>
202
                [% ELSIF ( seriallifespan == 9 ) %]
203
                    <span>9 years</span>
204
                [% ELSIF ( seriallifespan == 10 ) %]
205
                    <span>10 years</span>
206
                [% END %]
207
            </li>
183
        </ol>
208
        </ol>
184
    </div>
209
    </div>
185
    </div>
210
    </div>
Lines 246-251 $(document).ready(function() { Link Here
246
            </table>
271
            </table>
247
    </div>
272
    </div>
248
    <div id="subscription_issues">
273
    <div id="subscription_issues">
274
        <h2>Serial issues</h2>
275
        <p>
276
            <label>Serial lifespan :</label>
277
            [% IF seriallifespan == -1 %]
278
                <span>Permanent</span>
279
            [% ELSIF ( seriallifespan == 1 ) %]
280
                <span>1 year</span>
281
            [% ELSIF ( seriallifespan == 2 ) %]
282
                <span>2 years</span>
283
            [% ELSIF ( seriallifespan == 3 ) %]
284
                <span>3 years</span>
285
            [% ELSIF ( seriallifespan == 4 ) %]
286
                <span>4 years</span>
287
            [% ELSIF ( seriallifespan == 5 ) %]
288
                <span>5 years</span>
289
            [% ELSIF ( seriallifespan == 6 ) %]
290
                <span>6 years</span>
291
            [% ELSIF ( seriallifespan == 7 ) %]
292
                <span>7 years</span>
293
            [% ELSIF ( seriallifespan == 8 ) %]
294
                <span>8 years</span>
295
            [% ELSIF ( seriallifespan == 9 ) %]
296
                <span>9 years</span>
297
            [% ELSIF ( seriallifespan == 10 ) %]
298
                <span>10 years</span>
299
            [% END %]
300
        </p>
249
        <table>
301
        <table>
250
        <tr>
302
        <tr>
251
            <th>Issue number</th>
303
            <th>Issue number</th>
(-)a/serials/subscription-add.pl (-2 / +8 lines)
Lines 106-111 if ($op eq 'modify' || $op eq 'dup' || $op eq 'modsubscription') { Link Here
106
                    "subtype_$sub_on" => 1,
106
                    "subtype_$sub_on" => 1,
107
                    sublength =>$sub_length,
107
                    sublength =>$sub_length,
108
                    history => ($op eq 'modify'),
108
                    history => ($op eq 'modify'),
109
                    "periodicity".$subs->{'periodicity'} => 1,
110
                    "numberpattern".$subs->{'numberpattern'} => 1,
111
                    "seriallifespan" => $subs->{'seriallifespan'},
109
                    firstacquiyear => substr($firstissuedate,0,4),
112
                    firstacquiyear => substr($firstissuedate,0,4),
110
                    );
113
                    );
111
114
Lines 322-327 sub redirect_add_subscription { Link Here
322
    my $startdate = format_date_in_iso( $query->param('startdate') );
325
    my $startdate = format_date_in_iso( $query->param('startdate') );
323
    my $enddate = format_date_in_iso( $query->param('enddate') );
326
    my $enddate = format_date_in_iso( $query->param('enddate') );
324
    my $firstacquidate  = format_date_in_iso($query->param('firstacquidate'));
327
    my $firstacquidate  = format_date_in_iso($query->param('firstacquidate'));
328
    my $seriallifespan = $query->param('seriallifespan');
325
    if(!defined $enddate || $enddate eq '') {
329
    if(!defined $enddate || $enddate eq '') {
326
        if($subtype eq "issues") {
330
        if($subtype eq "issues") {
327
            $enddate = _guess_enddate($firstacquidate, $periodicity, $numberlength, $weeklength, $monthlength);
331
            $enddate = _guess_enddate($firstacquidate, $periodicity, $numberlength, $weeklength, $monthlength);
Lines 338-345 sub redirect_add_subscription { Link Here
338
        join(";",@irregularity), $numberpattern, $locale, $callnumber,
342
        join(";",@irregularity), $numberpattern, $locale, $callnumber,
339
        $manualhistory, $internalnotes, $serialsadditems,
343
        $manualhistory, $internalnotes, $serialsadditems,
340
        $staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate,
344
        $staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate,
341
        $skip_serialseq
345
        $skip_serialseq, $seriallifespan
342
    );
346
    );
347
    ModSubscriptionHistory ($subscriptionid,$histstartdate,$histenddate,$recievedlist,$missinglist,$opacnote,$librariannote);
343
348
344
    print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid");
349
    print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid");
345
    return;
350
    return;
Lines 413-421 sub redirect_mod_subscription { Link Here
413
        $status, $biblionumber, $callnumber, $notes, $letter,
418
        $status, $biblionumber, $callnumber, $notes, $letter,
414
        $manualhistory, $internalnotes, $serialsadditems, $staffdisplaycount,
419
        $manualhistory, $internalnotes, $serialsadditems, $staffdisplaycount,
415
        $opacdisplaycount, $graceperiod, $location, $enddate, $subscriptionid,
420
        $opacdisplaycount, $graceperiod, $location, $enddate, $subscriptionid,
416
        $skip_serialseq
421
        $skip_serialseq, $seiallifespan
417
    );
422
    );
418
423
424
        ModSubscriptionHistory ($subscriptionid,$histstartdate,$histenddate,$recievedlist,$missinglist,$opacnote,$librariannote);
419
    print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid");
425
    print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid");
420
    return;
426
    return;
421
}
427
}
(-)a/serials/subscription-detail.pl (-1 / +1 lines)
Lines 157-162 $template->param( Link Here
157
    show_acquisition_details => defined $tmpl_infos->{ordered_exists} || defined $tmpl_infos->{spent_exists} ? 1 : 0,
157
    show_acquisition_details => defined $tmpl_infos->{ordered_exists} || defined $tmpl_infos->{spent_exists} ? 1 : 0,
158
    basketno => $order->{basketno},
158
    basketno => $order->{basketno},
159
    %$tmpl_infos,
159
    %$tmpl_infos,
160
    seriallifespan => $subs->{'seriallifespan'},
160
);
161
);
161
162
162
output_html_with_http_headers $query, $cookie, $template->output;
163
output_html_with_http_headers $query, $cookie, $template->output;
163
- 

Return to bug 8587