Bug 27846: (follow-up) Add id back to breadcrumbs container
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / course_reserves / add_items-step2.tt
1 [% USE Branches %]
2 [% SET footerjs = 1 %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha &rsaquo; Course reserves &rsaquo;[% IF is_edit || course_reserve %] Edit item[% ELSE %] Add items[% END %]</title>
5 [% INCLUDE 'doc-head-close.inc' %]
6 </head>
7
8 <body id="courses_add_items_step2" class="course">
9
10 [% INCLUDE 'header.inc' %]
11 [% INCLUDE 'cat-search.inc' %]
12
13 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
14     <ol>
15         <li>
16             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
17         </li>
18         <li>
19             <a href="/cgi-bin/koha/course_reserves/course-reserves.pl">Course reserves</a>
20         </li>
21         <li>
22             <a href="#" aria-current="page">
23                 [% IF is_edit || course_reserve %] Edit [% ELSE %] Reserve [% END %]
24                 <em>[% biblio.title | html %]</em> for <em>[% course.course_name | html %]</em>
25             </a>
26         </li>
27     </ol>
28 </nav>
29
30 <div class="main container-fluid">
31     <div class="row">
32         <div class="col-md-8 col-md-offset-2">
33
34         [% IF course_reserve && !is_edit%]<div class="dialog message" id="already_on_reserve_this">This course already has this item on reserve.</div>[% END %]
35         [% IF course_item %]<div class="dialog message" id="already_on_reserve">Number of courses reserving this item: [% course_item.course_reserves.count | html %]</div>[% END %]
36
37         <form method="post" action="/cgi-bin/koha/course_reserves/add_items.pl">
38             <input type="hidden" name="course_id" value="[% course.course_id | html %]" />
39             <input type="hidden" name="return" value="[% return | html %]" />
40             <input type="hidden" name="action" value="add" />
41
42             <fieldset class="rows">
43                 [% IF is_edit || course_reserve %]
44                     <legend>Edit <em>[% biblio.title | html %]</em> in <em>[% course.course_name | html %]</em></legend>
45                 [% ELSE %]
46                     <legend>Add <em>[% biblio.title | html %]</em> to <em>[% course.course_name | html %]</em></legend>
47                 [% END %]
48                 <ol>
49                     <li>
50                         <span class="label">Barcode:</span>
51                         <span id="barcode">[% item.barcode | html %]</span>
52                         <input type="hidden" name="itemnumber" value="[% item.itemnumber | html %]" />
53                     </li>
54
55                     [% IF item_level_itypes %]
56                     <li>
57                         <label class="required" for="itype">Item type:</label>
58
59                         [% IF course_item.itype_enabled %]
60                             <input type="checkbox" class="field-toggle" data-pulldown="itype" value="1" name="itype_enabled" id="itype_enabled" checked="checked" />
61                         [% ELSE %]
62                             <input type="checkbox" class="field-toggle" data-pulldown="itype" value="1" name="itype_enabled" id="itype_enabled" />
63                         [% END %]
64
65                         [% IF course_item.itype_enabled %]
66                             <select id="itype" name="itype">
67                         [% ELSE %]
68                             <select id="itype" name="itype" disabled="disabled">
69                         [% END %]
70
71                             <option value=""></option>
72                             [% FOREACH it IN itypes %]
73                                 [% IF it.itemtype == course_item.itype %]
74                                     <option value="[% it.itemtype | html %]" selected="selected">[% it.description | html %]</option>
75                                 [% ELSE %]
76                                     <option value="[% it.itemtype | html %]">[% it.description | html %]</option>
77                                 [% END %]
78                             [% END %]
79                         </select>
80                     </li>
81                     [% END %]
82
83                     <li>
84                         <label class="required" for="ccode">Collection:</label>
85
86                         [% IF course_item.ccode_enabled %]
87                             <input type="checkbox" class="field-toggle" data-pulldown="ccode" value="1" name="ccode_enabled" id="ccode_enabled" checked="checked" />
88                         [% ELSE %]
89                             <input type="checkbox" class="field-toggle" data-pulldown="ccode" value="1" name="ccode_enabled" id="ccode_enabled" />
90                         [% END %]
91
92                         [% IF course_item.ccode_enabled %]
93                             <select id="ccode" name="ccode">
94                         [% ELSE %]
95                             <select id="ccode" name="ccode" disabled="disabled">
96                         [% END %]
97
98                             <option value=""></option>
99                             [% FOREACH c IN ccodes %]
100                                 [% IF c.authorised_value == course_item.ccode %]
101                                     <option value="[% c.authorised_value | html %]" selected="selected">[% c.lib | html %]</option>
102                                 [% ELSE %]
103                                     <option value="[% c.authorised_value | html %]">[% c.lib | html %]</option>
104                                 [% END %]
105                             [% END %]
106                         </select>
107                     </li>
108
109                     <li>
110                         <label class="required" for="location">Shelving location:</label>
111
112                         [% IF course_item.location_enabled %]
113                             <input type="checkbox" class="field-toggle" data-pulldown="location" value="1" name="location_enabled" id="location_enabled" checked="checked" />
114                         [% ELSE %]
115                             <input type="checkbox" class="field-toggle" data-pulldown="location"  value="1" name="location_enabled" id="location_enabled" />
116                         [% END %]
117
118                         [% IF course_item.location_enabled %]
119                             <select id="location" name="location">
120                         [% ELSE %]
121                             <select id="location" name="location" disabled="disabled">
122                         [% END %]
123
124                             <option value=""></option>
125                             [% FOREACH s IN locations %]
126                                 [% IF s.authorised_value == course_item.location %]
127                                     <option value="[% s.authorised_value | html %]" selected="selected">[% s.lib | html %]</option>
128                                 [% ELSE %]
129                                     <option value="[% s.authorised_value | html %]">[% s.lib | html %]</option>
130                                 [% END %]
131                             [% END %]
132                         </select>
133                     </li>
134
135                     <li>
136                         <label class="required" for="homebranch">Home library:</label>
137
138                         [% IF course_item.homebranch_enabled %]
139                             <input type="checkbox" value="1" class="field-toggle" data-pulldown="homebranch" name="homebranch_enabled" id="homebranch_enabled" checked />
140                         [% ELSE %]
141                             <input type="checkbox" value="1" class="field-toggle" data-pulldown="homebranch" name="homebranch_enabled" id="homebranch_enabled" />
142                         [% END %]
143
144                         [% IF course_item.homebranch_enabled %]
145                             <select id="homebranch" name="homebranch">
146                         [% ELSE %]
147                             <select id="homebranch" name="homebranch" disabled="disabled">
148                         [% END %]
149
150                             <option value=""></option>
151                             [% FOREACH b IN Branches.all() %]
152                                 [% IF course_item.homebranch.defined && ( ( course.enabled == 'yes' && b.branchcode == item.homebranch ) || ( course.enabled == 'no' && b.branchcode == course_item.homebranch ) ) %]
153                                     <option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option>
154                                 [% ELSE %]
155                                     <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
156                                 [% END %]
157                             [% END %]
158                         </select>
159                     </li>
160
161                     <li>
162                         <label class="required" for="holdingbranch">Holding library:</label>
163
164                         [% IF course_item.holdingbranch_enabled %]
165                             <input type="checkbox" value="1" class="field-toggle" data-pulldown="holdingbranch" name="holdingbranch_enabled" id="holdingbranch_enabled" checked="checked" />
166                         [% ELSE %]
167                             <input type="checkbox" value="1" class="field-toggle" data-pulldown="holdingbranch" name="holdingbranch_enabled" id="holdingbranch_enabled" />
168                         [% END %]
169
170                         [% IF course_item.holdingbranch_enabled %]
171                             <select id="holdingbranch" name="holdingbranch">
172                         [% ELSE %]
173                             <select id="holdingbranch" name="holdingbranch" disabled="disabled">
174                         [% END %]
175
176                             <option value=""></option>
177                             [% FOREACH b IN Branches.all() %]
178                                 [% IF b.branchcode == course_item.holdingbranch %]
179                                     <option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option>
180                                 [% ELSE %]
181                                     <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
182                                 [% END %]
183                             [% END %]
184                         </select>
185                     </li>
186
187                     <li>
188                         <label for="staff_note">Staff note:</label>
189                         <textarea name="staff_note" id="staff_note">[% course_reserve.staff_note | html %]</textarea>
190                     </li>
191
192                     <li>
193                         <label for="public_note">Public note:</label>
194                         <textarea name="public_note" id="public_note">[% course_reserve.public_note | html %]</textarea>
195                     </li>
196
197                 </ol>
198             </fieldset>
199                  <p>
200                     Checking the box next to the field label will enable changes to that field. Leave boxes unchecked to make no change.<br>
201                     Any items with existing course reserves will have their <em>on reserve</em> values updated.
202                 </p>
203             <fieldset class="action">
204                 <input type="submit" id="submit" value="Save" class="submit focus" />
205
206                 <a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% course.course_id | uri %]" class="cancel">Cancel</a>
207             </fieldset>
208         </form>
209     </div>
210 </div>
211
212 [% MACRO jsinclude BLOCK %]
213     <script>
214     //<![CDATA[
215         $(document).ready(function(){
216             $('.field-toggle').change(function() {
217                 if( this.checked ) {
218                     $('#' + $(this).data('pulldown') ).removeAttr('disabled');
219                 } else {
220                     $('#' + $(this).data('pulldown') ).val('');
221                     $('#' + $(this).data('pulldown') ).attr('disabled', 'disabled');
222                 }
223             });
224         });
225     //]]>
226     </script>
227 [% END %]
228
229 [% INCLUDE 'intranet-bottom.inc' %]