Bug 22970: Allow to change homebranch in batch add course reserves
authorJulian Maurice <julian.maurice@biblibre.com>
Fri, 24 May 2019 06:51:58 +0000 (08:51 +0200)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 12 May 2020 10:40:54 +0000 (11:40 +0100)
Test plan:
1. Create a course (disabled)
2. Add multiple reserves to this course using 'batch add' and set
   a homebranch different from the items homebranch
3. Enable the course
4. Verify that the items homebranch have changed
5. Disable the course
6. Verify that the items homebranch were reset to their initial value

Depends on bug 22630

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

course_reserves/batch_add_items.pl
koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/batch_add_items.tt

index 2a924b6..e97991b 100755 (executable)
@@ -37,6 +37,7 @@ my $barcodes  = $cgi->param('barcodes')  || q{};
 
 my $itype         = $cgi->param('itype');
 my $ccode         = $cgi->param('ccode');
+my $homebranch    = $cgi->param('homebranch');
 my $holdingbranch = $cgi->param('holdingbranch');
 my $location      = $cgi->param('location');
 my $staff_note    = $cgi->param('staff_note');
@@ -44,6 +45,7 @@ my $public_note   = $cgi->param('public_note');
 
 my $itype_enabled         = scalar $cgi->param('itype_enabled') ? 1 : 0;
 my $ccode_enabled         = scalar $cgi->param('ccode_enabled') ? 1 : 0;
+my $homebranch_enabled    = scalar $cgi->param('homebranch_enabled') ? 1 : 0;
 my $holdingbranch_enabled = scalar $cgi->param('holdingbranch_enabled') ? 1 : 0;
 my $location_enabled      = scalar $cgi->param('location_enabled') ? 1 : 0;
 
@@ -87,10 +89,12 @@ if ( $course_id && $course ) {
                 itype                 => $itype,
                 ccode                 => $ccode,
                 holdingbranch         => $holdingbranch,
+                homebranch            => $homebranch,
                 location              => $location,
                 itype_enabled         => $itype_enabled,
                 ccode_enabled         => $ccode_enabled,
                 holdingbranch_enabled => $holdingbranch_enabled,
+                homebranch_enabled    => $homebranch_enabled,
                 location_enabled      => $location_enabled,
             );
 
index aac67d1..c644518 100644 (file)
                         </li>
 
                         <li>
+                            <label class="required" for="homebranch">Home library:</label>
+                            <input type="checkbox" value="1" class="field-toggle" data-pulldown="homebranch" name="homebranch_enabled" id="homebranch_enabled" />
+                            <select id="homebranch" name="homebranch" disabled="disabled">
+                                <option value=""></option>
+                                [% FOREACH b IN Branches.all() %]
+                                    <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
+                                [% END %]
+                            </select>
+                        </li>
+
+                        <li>
                             <label class="required" for="holdingbranch">Holding library:</label>
                             <input type="checkbox" value="1" class="field-toggle" data-pulldown="holdingbranch" name="holdingbranch_enabled" id="holdingbranch_enabled" />
                             <select id="holdingbranch" name="holdingbranch" disabled="disabled">