Bug 22630: Allow to change homebranch in course reserves
[srvgit] / koha-tmpl / intranet-tmpl / prog / en / modules / course_reserves / add_items-step2.tt
index 78dd023..3b3a89d 100644 (file)
                     </li>
 
                     <li>
+                        <label class="required" for="homebranch">Home library:</label>
+
+                        [% IF course_item.homebranch_enabled %]
+                            <input type="checkbox" value="1" class="field-toggle" data-pulldown="homebranch" name="homebranch_enabled" id="homebranch_enabled" checked />
+                        [% ELSE %]
+                            <input type="checkbox" value="1" class="field-toggle" data-pulldown="homebranch" name="homebranch_enabled" id="homebranch_enabled" />
+                        [% END %]
+
+                        [% IF course_item.homebranch_enabled %]
+                            <select id="homebranch" name="homebranch">
+                        [% ELSE %]
+                            <select id="homebranch" name="homebranch" disabled="disabled">
+                        [% END %]
+
+                            <option value=""></option>
+                            [% FOREACH b IN Branches.all() %]
+                                [% IF course_item.homebranch.defined && ( ( course.enabled == 'yes' && b.branchcode == item.homebranch ) || ( course.enabled == 'no' && b.branchcode == course_item.homebranch ) ) %]
+                                    <option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option>
+                                [% ELSE %]
+                                    <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
+                                [% END %]
+                            [% END %]
+                        </select>
+                    </li>
+
+                    <li>
                         <label class="required" for="holdingbranch">Holding library:</label>
 
                         [% IF course_item.holdingbranch_enabled %]