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

(-)a/C4/Serials.pm (-7 / +46 lines)
Lines 76-81 BEGIN { Link Here
76
      &ReNewSubscription  &GetLateOrMissingIssues
76
      &ReNewSubscription  &GetLateOrMissingIssues
77
      &GetSerialInformation                   &AddItem2Serial
77
      &GetSerialInformation                   &AddItem2Serial
78
      &PrepareSerialsData &GetNextExpected    &ModNextExpected
78
      &PrepareSerialsData &GetNextExpected    &ModNextExpected
79
      &GetPreviousSerialid
79
80
80
      &GetSuppliersWithLateIssues             &getsupplierbyserialid
81
      &GetSuppliersWithLateIssues             &getsupplierbyserialid
81
      &GetDistributedTo   &SetDistributedTo
82
      &GetDistributedTo   &SetDistributedTo
Lines 805-810 sub GetLatestSerials { Link Here
805
    return \@serials;
806
    return \@serials;
806
}
807
}
807
808
809
=head2 GetPreviousSerialid
810
811
$serialid = GetPreviousSerialid($subscriptionid, $nth)
812
get the $nth's previous serial for the given subscriptionid
813
return :
814
the serialid
815
816
=cut
817
818
sub GetPreviousSerialid {
819
    my ( $subscriptionid, $nth ) = @_;
820
    $nth ||= 1;
821
    my $dbh = C4::Context->dbh;
822
    my $return = undef;
823
824
    # Status 2: Arrived
825
    my $strsth = "SELECT   serialid
826
                        FROM     serial
827
                        WHERE    subscriptionid = ?
828
                        AND      status = 2
829
                        ORDER BY serialid DESC LIMIT $nth,1
830
                ";
831
    my $sth = $dbh->prepare($strsth);
832
    $sth->execute($subscriptionid);
833
    my @serials;
834
    my $line = $sth->fetchrow_hashref;
835
    $return = $line->{'serialid'} if ($line);
836
837
    return $return;
838
}
839
840
841
808
=head2 GetDistributedTo
842
=head2 GetDistributedTo
809
843
810
$distributedto=GetDistributedTo($subscriptionid)
844
$distributedto=GetDistributedTo($subscriptionid)
Lines 1306-1312 sub ModSubscription { Link Here
1306
    $lastvalue2, $innerloop2, $lastvalue3, $innerloop3, $status,
1340
    $lastvalue2, $innerloop2, $lastvalue3, $innerloop3, $status,
1307
    $biblionumber, $callnumber, $notes, $letter, $manualhistory,
1341
    $biblionumber, $callnumber, $notes, $letter, $manualhistory,
1308
    $internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount,
1342
    $internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount,
1309
    $graceperiod, $location, $enddate, $subscriptionid, $skip_serialseq
1343
    $graceperiod, $location, $enddate, $subscriptionid, $skip_serialseq,
1344
    $itemtype, $previousitemtype
1310
    ) = @_;
1345
    ) = @_;
1311
1346
1312
    my $dbh   = C4::Context->dbh;
1347
    my $dbh   = C4::Context->dbh;
Lines 1319-1325 sub ModSubscription { Link Here
1319
            callnumber=?, notes=?, letter=?, manualhistory=?,
1354
            callnumber=?, notes=?, letter=?, manualhistory=?,
1320
            internalnotes=?, serialsadditems=?, staffdisplaycount=?,
1355
            internalnotes=?, serialsadditems=?, staffdisplaycount=?,
1321
            opacdisplaycount=?, graceperiod=?, location = ?, enddate=?,
1356
            opacdisplaycount=?, graceperiod=?, location = ?, enddate=?,
1322
            skip_serialseq=?
1357
            skip_serialseq=?, itemtype=?, previousitemtype=?
1323
        WHERE subscriptionid = ?";
1358
        WHERE subscriptionid = ?";
1324
1359
1325
    my $sth = $dbh->prepare($query);
1360
    my $sth = $dbh->prepare($query);
Lines 1333-1338 sub ModSubscription { Link Here
1333
        $letter,          ($manualhistory ? $manualhistory : 0),
1368
        $letter,          ($manualhistory ? $manualhistory : 0),
1334
        $internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount,
1369
        $internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount,
1335
        $graceperiod,     $location,       $enddate,        $skip_serialseq,
1370
        $graceperiod,     $location,       $enddate,        $skip_serialseq,
1371
        $itemtype,        $previousitemtype,
1336
        $subscriptionid
1372
        $subscriptionid
1337
    );
1373
    );
1338
    my $rows = $sth->rows;
1374
    my $rows = $sth->rows;
Lines 1348-1354 $subscriptionid = &NewSubscription($auser,branchcode,$aqbooksellerid,$cost,$aqbu Link Here
1348
    $lastvalue1,$innerloop1,$lastvalue2,$innerloop2,$lastvalue3,$innerloop3,
1384
    $lastvalue1,$innerloop1,$lastvalue2,$innerloop2,$lastvalue3,$innerloop3,
1349
    $status, $notes, $letter, $firstacquidate, $irregularity, $numberpattern,
1385
    $status, $notes, $letter, $firstacquidate, $irregularity, $numberpattern,
1350
    $locale, $callnumber, $manualhistory, $internalnotes, $serialsadditems,
1386
    $locale, $callnumber, $manualhistory, $internalnotes, $serialsadditems,
1351
    $staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate, $skip_serialseq);
1387
    $staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate,
1388
    $skip_serialseq, $itemtype, $previousitemtype);
1352
1389
1353
Create a new subscription with value given on input args.
1390
Create a new subscription with value given on input args.
1354
1391
Lines 1365-1371 sub NewSubscription { Link Here
1365
    $innerloop3, $status, $notes, $letter, $firstacquidate, $irregularity,
1402
    $innerloop3, $status, $notes, $letter, $firstacquidate, $irregularity,
1366
    $numberpattern, $locale, $callnumber, $manualhistory, $internalnotes,
1403
    $numberpattern, $locale, $callnumber, $manualhistory, $internalnotes,
1367
    $serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod,
1404
    $serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod,
1368
    $location, $enddate, $skip_serialseq
1405
    $location, $enddate, $skip_serialseq, $itemtype, $previousitemtype
1369
    ) = @_;
1406
    ) = @_;
1370
    my $dbh = C4::Context->dbh;
1407
    my $dbh = C4::Context->dbh;
1371
1408
Lines 1378-1385 sub NewSubscription { Link Here
1378
            lastvalue3, innerloop3, status, notes, letter, firstacquidate,
1415
            lastvalue3, innerloop3, status, notes, letter, firstacquidate,
1379
            irregularity, numberpattern, locale, callnumber,
1416
            irregularity, numberpattern, locale, callnumber,
1380
            manualhistory, internalnotes, serialsadditems, staffdisplaycount,
1417
            manualhistory, internalnotes, serialsadditems, staffdisplaycount,
1381
            opacdisplaycount, graceperiod, location, enddate, skip_serialseq)
1418
            opacdisplaycount, graceperiod, location, enddate, skip_serialseq,
1382
        VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
1419
            itemtype, previousitemtype)
1420
        VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
1383
        |;
1421
        |;
1384
    my $sth = $dbh->prepare($query);
1422
    my $sth = $dbh->prepare($query);
1385
    $sth->execute(
1423
    $sth->execute(
Lines 1389-1395 sub NewSubscription { Link Here
1389
        $lastvalue3, $innerloop3, $status, $notes, $letter,
1427
        $lastvalue3, $innerloop3, $status, $notes, $letter,
1390
        $firstacquidate, $irregularity, $numberpattern, $locale, $callnumber,
1428
        $firstacquidate, $irregularity, $numberpattern, $locale, $callnumber,
1391
        $manualhistory, $internalnotes, $serialsadditems, $staffdisplaycount,
1429
        $manualhistory, $internalnotes, $serialsadditems, $staffdisplaycount,
1392
        $opacdisplaycount, $graceperiod, $location, $enddate, $skip_serialseq
1430
        $opacdisplaycount, $graceperiod, $location, $enddate, $skip_serialseq,
1431
        $itemtype, $previousitemtype
1393
    );
1432
    );
1394
1433
1395
    my $subscriptionid = $dbh->{'mysql_insertid'};
1434
    my $subscriptionid = $dbh->{'mysql_insertid'};
(-)a/installer/data/mysql/atomicupdate/bug_7677_Adds_fields_to_subscription_table_and_makePreviousSerialAvailable_syspref.sql (+2 lines)
Line 0 Link Here
1
ALTER TABLE `subscription` ADD `itemtype` VARCHAR( 10 ) NULL AFTER reneweddate, ADD `previousitemtype` VARCHAR( 10 ) NULL AFTER itemtype;
2
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('makePreviousSerialAvailable','0','make previous serial automatically available when collecting a new serial. Please note that the item-level_itypes syspref must be set to specific item.','','YesNo');
(-)a/installer/data/mysql/kohastructure.sql (+51 lines)
Lines 2080-2085 CREATE TABLE `subscription` ( -- information related to the subscription Link Here
2080
  `enddate` date default NULL, -- subscription end date
2080
  `enddate` date default NULL, -- subscription end date
2081
  `closed` INT(1) NOT NULL DEFAULT 0, -- yes / no if the subscription is closed
2081
  `closed` INT(1) NOT NULL DEFAULT 0, -- yes / no if the subscription is closed
2082
  `reneweddate` date default NULL, -- date of last renewal for the subscription
2082
  `reneweddate` date default NULL, -- date of last renewal for the subscription
2083
  `itemtype` VARCHAR( 10 ) NULL,
2084
  `previousitemtype` VARCHAR( 10 ) NULL,
2083
  PRIMARY KEY  (`subscriptionid`),
2085
  PRIMARY KEY  (`subscriptionid`),
2084
  CONSTRAINT subscription_ibfk_1 FOREIGN KEY (periodicity) REFERENCES subscription_frequencies (id) ON DELETE SET NULL ON UPDATE CASCADE,
2086
  CONSTRAINT subscription_ibfk_1 FOREIGN KEY (periodicity) REFERENCES subscription_frequencies (id) ON DELETE SET NULL ON UPDATE CASCADE,
2085
  CONSTRAINT subscription_ibfk_2 FOREIGN KEY (numberpattern) REFERENCES subscription_numberpatterns (id) ON DELETE SET NULL ON UPDATE CASCADE
2087
  CONSTRAINT subscription_ibfk_2 FOREIGN KEY (numberpattern) REFERENCES subscription_numberpatterns (id) ON DELETE SET NULL ON UPDATE CASCADE
Lines 2119-2124 CREATE TABLE `subscriptionroutinglist` ( -- information related to the routing l Link Here
2119
    ON DELETE CASCADE ON UPDATE CASCADE,
2121
    ON DELETE CASCADE ON UPDATE CASCADE,
2120
  CONSTRAINT `subscriptionroutinglist_ibfk_2` FOREIGN KEY (`subscriptionid`) REFERENCES `subscription` (`subscriptionid`)
2122
  CONSTRAINT `subscriptionroutinglist_ibfk_2` FOREIGN KEY (`subscriptionid`) REFERENCES `subscription` (`subscriptionid`)
2121
    ON DELETE CASCADE ON UPDATE CASCADE
2123
    ON DELETE CASCADE ON UPDATE CASCADE
2124
<<<<<<< 85adee702147e7112ed41a440ad4f13d2ed9fd36
2125
=======
2126
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2127
2128
--
2129
-- Table structure for table `suggestions`
2130
--
2131
2132
DROP TABLE IF EXISTS `suggestions`;
2133
CREATE TABLE `suggestions` ( -- purchase suggestions
2134
  `suggestionid` int(8) NOT NULL auto_increment, -- unique identifier assigned automatically by Koha
2135
  `suggestedby` int(11) NOT NULL default 0, -- borrowernumber for the person making the suggestion, foreign key linking to the borrowers table
2136
  `suggesteddate` date NOT NULL, -- date the suggestion was submitted
2137
  `managedby` int(11) default NULL, -- borrowernumber for the librarian managing the suggestion, foreign key linking to the borrowers table
2138
  `manageddate` date default NULL, -- date the suggestion was updated
2139
   acceptedby INT(11) default NULL, -- borrowernumber for the librarian who accepted the suggestion, foreign key linking to the borrowers table
2140
   accepteddate date default NULL, -- date the suggestion was marked as accepted
2141
   rejectedby INT(11) default NULL, -- borrowernumber for the librarian who rejected the suggestion, foreign key linking to the borrowers table
2142
   rejecteddate date default NULL, -- date the suggestion was marked as rejected
2143
  `STATUS` varchar(10) NOT NULL default '', -- suggestion status (ASKED, CHECKED, ACCEPTED, or REJECTED)
2144
  `note` mediumtext, -- note entered on the suggestion
2145
  `author` varchar(80) default NULL, -- author of the suggested item
2146
  `title` varchar(255) default NULL, -- title of the suggested item
2147
  `copyrightdate` smallint(6) default NULL, -- copyright date of the suggested item
2148
  `publishercode` varchar(255) default NULL, -- publisher of the suggested item
2149
  `date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,  -- date and time the suggestion was updated
2150
  `volumedesc` varchar(255) default NULL,
2151
  `publicationyear` smallint(6) default 0,
2152
  `place` varchar(255) default NULL, -- publication place of the suggested item
2153
  `isbn` varchar(30) default NULL, -- isbn of the suggested item
2154
  `biblionumber` int(11) default NULL, -- foreign key linking the suggestion to the biblio table after the suggestion has been ordered
2155
  `reason` text, -- reason for accepting or rejecting the suggestion
2156
  `patronreason` text, -- reason for making the suggestion
2157
   budgetid INT(11), -- foreign key linking the suggested budget to the aqbudgets table
2158
   branchcode VARCHAR(10) default NULL, -- foreign key linking the suggested branch to the branches table
2159
   collectiontitle text default NULL, -- collection name for the suggested item
2160
   itemtype VARCHAR(30) default NULL, -- suggested item type 
2161
   quantity SMALLINT(6) default NULL, -- suggested quantity to be purchased
2162
   currency VARCHAR(3) default NULL, -- suggested currency for the suggested price
2163
   price DECIMAL(28,6) default NULL, -- suggested price
2164
   total DECIMAL(28,6) default NULL, -- suggested total cost (price*quantity updated for currency)
2165
  PRIMARY KEY  (`suggestionid`),
2166
  KEY `suggestedby` (`suggestedby`),
2167
  KEY `managedby` (`managedby`),
2168
  KEY `status` (`STATUS`),
2169
  KEY `biblionumber` (`biblionumber`),
2170
  KEY `branchcode` (`branchcode`),
2171
  CONSTRAINT `suggestions_budget_id_fk` FOREIGN KEY (`budgetid`) REFERENCES `aqbudgets` (`budget_id`) ON DELETE SET NULL ON UPDATE CASCADE
2172
>>>>>>> BZ7677: New areas in subscriptions and new functions when receiving.
2122
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2173
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2123
2174
2124
--
2175
--
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 229-234 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
229
('LocalHoldsPriority',  '0', NULL,  'Enables the LocalHoldsPriority feature',  'YesNo'),
229
('LocalHoldsPriority',  '0', NULL,  'Enables the LocalHoldsPriority feature',  'YesNo'),
230
('LocalHoldsPriorityItemControl',  'holdingbranch',  'holdingbranch|homebranch',  'decides if the feature operates using the item''s home or holding library.',  'Choice'),
230
('LocalHoldsPriorityItemControl',  'holdingbranch',  'holdingbranch|homebranch',  'decides if the feature operates using the item''s home or holding library.',  'Choice'),
231
('LocalHoldsPriorityPatronControl',  'PickupLibrary',  'HomeLibrary|PickupLibrary',  'decides if the feature operates using the library set as the patron''s home library, or the library set as the pickup library for the given hold.',  'Choice'),
231
('LocalHoldsPriorityPatronControl',  'PickupLibrary',  'HomeLibrary|PickupLibrary',  'decides if the feature operates using the library set as the patron''s home library, or the library set as the pickup library for the given hold.',  'Choice'),
232
('makePreviousSerialAvailable','0','','make previous serial automatically available when collecting a new serial. Please note that the item-level_itypes syspref must be set to specific item.','YesNo'),
232
('ManInvInNoissuesCharge','1',NULL,'MANUAL_INV charges block checkouts (added to noissuescharge).','YesNo'),
233
('ManInvInNoissuesCharge','1',NULL,'MANUAL_INV charges block checkouts (added to noissuescharge).','YesNo'),
233
('MARCAuthorityControlField008','|| aca||aabn           | a|a     d',NULL,'Define the contents of MARC21 authority control field 008 position 06-39','Textarea'),
234
('MARCAuthorityControlField008','|| aca||aabn           | a|a     d',NULL,'Define the contents of MARC21 authority control field 008 position 06-39','Textarea'),
234
('MarcFieldsToOrder','',NULL,'Set the mapping values for a new order line created from a MARC record in a staged file. In a YAML format.','textarea'),
235
('MarcFieldsToOrder','',NULL,'Set the mapping values for a new order line created from a MARC record in a staged file. In a YAML format.','textarea'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref (+6 lines)
Lines 50-52 Serials: Link Here
50
    -
50
    -
51
        - List of fields which must not be rewritten when a subscription is duplicated (Separated by pipe |)
51
        - List of fields which must not be rewritten when a subscription is duplicated (Separated by pipe |)
52
        - pref: SubscriptionDuplicateDroppedInput
52
        - pref: SubscriptionDuplicateDroppedInput
53
    -
54
        - pref: makePreviousSerialAvailable
55
          choices:
56
            yes: Make
57
            no: Do not make
58
        - previous serial automatically available when collecting a new serial. Please note that the item-level_itypes syspref must be set to specific item.
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt (-1 lines)
Lines 30-36 function unHideItems(index,labelindex, serialId) { Link Here
30
    subfield_div = $(item_div).find("input[name='kohafield'][value='items.enumchron']").parent();
30
    subfield_div = $(item_div).find("input[name='kohafield'][value='items.enumchron']").parent();
31
    // Setting text field
31
    // Setting text field
32
    $(subfield_div).children("input[type='text'][name='field_value']").val($("#serialseq" + serialId).val());
32
    $(subfield_div).children("input[type='text'][name='field_value']").val($("#serialseq" + serialId).val());
33
34
}
33
}
35
function HideItems(index,labelindex) {
34
function HideItems(index,labelindex) {
36
	subfield = document.getElementById(index);
35
	subfield = document.getElementById(index);
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt (+28 lines)
Lines 652-657 $(document).ready(function() { Link Here
652
                                    </select>
652
                                    </select>
653
                                </li>
653
                                </li>
654
                                <li>
654
                                <li>
655
                                    <label for="itemtype">Item type:</label>
656
                                    <select name="itemtype" id="itemtype">
657
                                        <option value=""></option>
658
                                        [% FOREACH type IN typeloop %]
659
                                            [% IF ( type.selected ) %]
660
                                                <option value="[% type.code %]" selected="selected">[% type.value %]</option>
661
                                            [% ELSE %]
662
                                                <option value="[% type.code %]">[% type.value %]</option>
663
                                            [% END %]
664
                                        [% END %]
665
                                    </select>
666
                                </li>
667
                                [%IF makePreviousSerialAvailable %]
668
                                <li>
669
                                    <label for="previousitemtype">Previous item type:</label>
670
                                    <select name="previousitemtype" id="previousitemtype">
671
                                            <option value=""></option>
672
                                        [% FOREACH previous IN previoustypeloop %]
673
                                            [% IF ( previous.selected ) %]
674
                                                <option value="[% previous.code %]" selected="selected">[% previous.value %]</option>
675
                                            [% ELSE %]
676
                                                <option value="[% previous.code %]">[% previous.value %]</option>
677
                                            [% END %]
678
                                        [% END %]
679
                                    </select>
680
                                </li>
681
                                [% END %]
682
                                    <li>
655
                                    <label for="graceperiod">Grace period:</label>
683
                                    <label for="graceperiod">Grace period:</label>
656
                                    <input type="text" name="graceperiod" id="graceperiod" value="[% graceperiod %]" size="5"/> day(s)
684
                                    <input type="text" name="graceperiod" id="graceperiod" value="[% graceperiod %]" size="5"/> day(s)
657
                                </li>
685
                                </li>
(-)a/serials/serials-edit.pl (+24 lines)
Lines 93-98 if ( scalar(@subscriptionids) == 1 && index( $subscriptionids[0], q|,| ) > 0 ) { Link Here
93
}
93
}
94
my @errors;
94
my @errors;
95
my @errseq;
95
my @errseq;
96
my $dbh   = C4::Context->dbh;
96
97
97
# If user comes from subscription details
98
# If user comes from subscription details
98
unless (@serialids) {
99
unless (@serialids) {
Lines 250-255 if ( $op and $op eq 'serialchangestatus' ) { Link Here
250
                $notes[$i]
251
                $notes[$i]
251
            );
252
            );
252
        }
253
        }
254
        my $makePreviousSerialAvailable = C4::Context->preference('makePreviousSerialAvailable');
255
        if ($makePreviousSerialAvailable && $serialids[$i] ne "NEW") {
256
            # We already have created the new expected serial at this point, so we get the second previous serial
257
            my $previous = GetPreviousSerialid($subscriptionids[$i]);
258
            if ($previous) {
259
260
                # Getting the itemnumber matching the serialid
261
                my $query = "SELECT itemnumber FROM serialitems WHERE serialid=?";
262
                my $sth = $dbh->prepare($query);
263
                $sth->execute($previous);
264
                my @row = $sth->fetchrow_array;
265
                if ($row[0]) {
266
                    my $itemnumber = $row[0];
267
268
                    # Getting the itemtype to set from the database
269
                    my $subscriptioninfos = GetSubscription($subscriptionids[$i]);
270
271
                    # Changing the status to "available" and the itemtype according to the previousitemtype db field
272
                    ModItem({notforloan => 0, itype => $subscriptioninfos->{'previousitemtype'} }, undef, $itemnumber);
273
                }
274
            }
275
        }
276
253
    }
277
    }
254
    my @moditems = $query->multi_param('moditem');
278
    my @moditems = $query->multi_param('moditem');
255
    if ( scalar(@moditems) ) {
279
    if ( scalar(@moditems) ) {
(-)a/serials/subscription-add.pl (-2 / +21 lines)
Lines 141-147 for my $field ( @$additional_fields ) { Link Here
141
}
141
}
142
$template->param( additional_fields_for_subscription => $additional_fields );
142
$template->param( additional_fields_for_subscription => $additional_fields );
143
143
144
my $typeloop = GetItemTypes();
145
146
my @typearg =
147
    map { { code => $_, value => $typeloop->{$_}{'description'}, selected => ( ( $subs->{itemtype} and $_ eq $subs->{itemtype} ) ? "selected=\"selected\"" : "" ), } } sort keys %{$typeloop};
148
my @previoustypearg =
149
    map { { code => $_, value => $typeloop->{$_}{'description'}, selected => ( ( $subs->{previousitemtype} and $_ eq $subs->{previousitemtype} ) ? "selected=\"selected\"" : "" ), } } sort keys %{$typeloop};
150
151
$template->param(
152
    branchloop               => $branchloop,
153
    typeloop                 => \@typearg,
154
    previoustypeloop         => \@previoustypearg,
155
    locations_loop=>$locations_loop,
156
);
157
144
# prepare template variables common to all $op conditions:
158
# prepare template variables common to all $op conditions:
159
$template->param('makePreviousSerialAvailable' => 1) if (C4::Context->preference('makePreviousSerialAvailable'));
160
145
if ($op!~/^mod/) {
161
if ($op!~/^mod/) {
146
    my $letters = get_letter_loop();
162
    my $letters = get_letter_loop();
147
    $template->param( letterloop => $letters );
163
    $template->param( letterloop => $letters );
Lines 301-306 sub redirect_add_subscription { Link Here
301
    my $staffdisplaycount = $query->param('staffdisplaycount');
317
    my $staffdisplaycount = $query->param('staffdisplaycount');
302
    my $opacdisplaycount  = $query->param('opacdisplaycount');
318
    my $opacdisplaycount  = $query->param('opacdisplaycount');
303
    my $location          = $query->param('location');
319
    my $location          = $query->param('location');
320
    my $itemtype          = $query->param('itemtype');
321
    my $previousitemtype  = $query->param('previousitemtype');
304
    my $skip_serialseq    = $query->param('skip_serialseq');
322
    my $skip_serialseq    = $query->param('skip_serialseq');
305
323
306
    my $startdate      = output_pref( { str => scalar $query->param('startdate'),      dateonly => 1, dateformat => 'iso' } );
324
    my $startdate      = output_pref( { str => scalar $query->param('startdate'),      dateonly => 1, dateformat => 'iso' } );
Lines 378-383 sub redirect_mod_subscription { Link Here
378
	my $opacdisplaycount = $query->param('opacdisplaycount');
396
	my $opacdisplaycount = $query->param('opacdisplaycount');
379
    my $graceperiod     = $query->param('graceperiod') || 0;
397
    my $graceperiod     = $query->param('graceperiod') || 0;
380
    my $location = $query->param('location');
398
    my $location = $query->param('location');
399
    my $itemtype          = $query->param('itemtype');
400
    my $previousitemtype  = $query->param('previousitemtype');
381
    my $skip_serialseq    = $query->param('skip_serialseq');
401
    my $skip_serialseq    = $query->param('skip_serialseq');
382
402
383
    # Guess end date
403
    # Guess end date
Lines 405-411 sub redirect_mod_subscription { Link Here
405
        $status, $biblionumber, $callnumber, $notes, $letter,
425
        $status, $biblionumber, $callnumber, $notes, $letter,
406
        $manualhistory, $internalnotes, $serialsadditems, $staffdisplaycount,
426
        $manualhistory, $internalnotes, $serialsadditems, $staffdisplaycount,
407
        $opacdisplaycount, $graceperiod, $location, $enddate, $subscriptionid,
427
        $opacdisplaycount, $graceperiod, $location, $enddate, $subscriptionid,
408
        $skip_serialseq
428
        $skip_serialseq, $itemtype, $previousitemtype
409
    );
429
    );
410
430
411
    my $additional_fields = Koha::AdditionalField->all( { tablename => 'subscription' } );
431
    my $additional_fields = Koha::AdditionalField->all( { tablename => 'subscription' } );
412
- 

Return to bug 7677