Bug 22970: Allow to change homebranch in batch add course reserves
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / course_reserves / batch_add_items.tt
blobc6445185f7f130006da797158809c7c075f5af03
1 [% USE AuthorisedValues %]
2 [% USE Branches %]
3 [% USE ItemTypes %]
5 [% SET footerjs = 1 %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Koha &rsaquo; Course reserves &rsaquo; Add items</title>
9 [% INCLUDE 'doc-head-close.inc' %]
10 </head>
11 <body id="courses_add_items_step1" class="course">
13 [% INCLUDE 'header.inc' %]
14 [% INCLUDE 'cat-search.inc' %]
16 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/course_reserves/course-reserves.pl">Course reserves</a> &rsaquo; Add reserves for <i><a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% course.course_id | html %]">[% course.course_name | html %]</a></i></div>
18 <div class="main container-fluid">
19     <div class="row">
20         <div class="col-md-8 col-md-offset-2">
21         [% IF action == 'invalid_course' %]
22             <div id="invalid-course-error" class="dialog alert">Invalid course!</div>
23         [% END %]
25         [% IF action == 'display_form' %]
26             <form method="post" action="/cgi-bin/koha/course_reserves/batch_add_items.pl">
27                 <input type="hidden" name="course_id" value="[% course.course_id | html %]" />
28                 <input type="hidden" name="action" value="add" />
30                 <fieldset class="rows">
31                     <legend>Add items: scan barcodes</legend>
32                     <ol>
33                         <li>
34                             <label class="required" for="barcodes">Item barcodes:</label>
35                             <textarea rows="20" cols="50" id="barcodes" name="barcodes" class="focus"></textarea>
36                         </li>
37                         [% IF item_level_itypes %]
38                         <li>
39                             <label class="required" for="itype">Item type:</label>
40                             <input type="checkbox" class="field-toggle" data-pulldown="itype" value="1" name="itype_enabled" id="itype_enabled" />
41                             <select id="itype" name="itype" disabled="disabled">
42                                 <option value=""></option>
44                                 [% FOREACH it IN ItemTypes.Get() %]
45                                     <option value="[% it.itemtype | html %]">[% it.description | html %]</option>
46                                 [% END %]
47                             </select>
48                         </li>
49                         [% END %]
51                         <li>
52                             <label class="required" for="ccode">Collection:</label>
53                             <input type="checkbox" class="field-toggle" data-pulldown="ccode" value="1" name="ccode_enabled" id="ccode_enabled" />
54                             <select id="ccode" name="ccode" disabled="disabled">
55                                 <option value=""></option>
56                                 [% FOREACH c IN AuthorisedValues.Get('CCODE') %]
57                                     <option value="[% c.authorised_value | html %]">[% c.lib | html %]</option>
58                                 [% END %]
59                             </select>
60                         </li>
62                         <li>
63                             <label class="required" for="location">Shelving location:</label>
64                             <input type="checkbox" class="field-toggle" data-pulldown="location"  value="1" name="location_enabled" id="location_enabled" />
65                             <select id="location" name="location" disabled="disabled">
66                                 <option value=""></option>
67                                 [% FOREACH s IN AuthorisedValues.Get('LOC') %]
68                                     <option value="[% s.authorised_value | html %]">[% s.lib | html %]</option>
69                                 [% END %]
70                             </select>
71                         </li>
73                         <li>
74                             <label class="required" for="homebranch">Home library:</label>
75                             <input type="checkbox" value="1" class="field-toggle" data-pulldown="homebranch" name="homebranch_enabled" id="homebranch_enabled" />
76                             <select id="homebranch" name="homebranch" disabled="disabled">
77                                 <option value=""></option>
78                                 [% FOREACH b IN Branches.all() %]
79                                     <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
80                                 [% END %]
81                             </select>
82                         </li>
84                         <li>
85                             <label class="required" for="holdingbranch">Holding library:</label>
86                             <input type="checkbox" value="1" class="field-toggle" data-pulldown="holdingbranch" name="holdingbranch_enabled" id="holdingbranch_enabled" />
87                             <select id="holdingbranch" name="holdingbranch" disabled="disabled">
88                                 <option value=""></option>
89                                 [% FOREACH b IN Branches.all() %]
90                                     <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
91                                 [% END %]
92                             </select>
93                         </li>
95                         <li>
96                             <label for="staff_note">Staff note:</label>
97                             <textarea name="staff_note" id="staff_note">[% course_reserve.staff_note | html %]</textarea>
98                         </li>
100                         <li>
101                             <label for="public_note">Public note:</label>
102                             <textarea name="public_note" id="public_note">[% course_reserve.public_note | html %]</textarea>
103                         </li>
104                     </ol>
105                 </fieldset>
107                 <p>
108                     Any items with existing course reserves will have their <i>on reserve</i> values updated.
109                 </p>
111                 <fieldset class="action">
112                     <input type="submit" value="Submit" class="submit" />
114                     <a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% course.course_id | uri %]" class="cancel">Cancel</a>
115                 </fieldset>
116             </form>
117         [% END %]
119         [% IF action == 'display_results' %]
120             <h1>Results</h1>
122             <h3>Items added</h3>
123             [% IF items_added.size > 0 %]
124                 <p>The following items were added or updated:</p>
125                 <ul>
126                     [% FOREACH i IN items_added %]
127                         <li>[% i.biblio.title | html %] ( [% i.barcode | html %] )</li>
128                     [% END %]
129                 </ul>
130             [% ELSE %]
131                 No valid item barcodes found.
132             [% END %]
135             [% IF invalid_barcodes.size > 0 %]
136                 <h3>Invalid barcodes</h3>
137                 <p>The following invalid barcodes were skipped:</p>
138                 <ul>
139                     [% FOREACH b IN invalid_barcodes %]
140                         <li>[% b | html %]</li>
141                     [% END %]
142                 </ul>
143             [% END %]
145             <p>
146                 <a class='btn btn-default' href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% course_id | html %]">View course</a>
147             </p>
148         [% END %]
149     </div>
150 </div>
152 [% MACRO jsinclude BLOCK %]
153     <script>
154     //<![CDATA[
155         $(document).ready(function(){
156             $('.field-toggle').change(function() {
157                 if( this.checked ) {
158                     $('#' + $(this).data('pulldown') ).removeAttr('disabled');
159                 } else {
160                     $('#' + $(this).data('pulldown') ).val('');
161                     $('#' + $(this).data('pulldown') ).attr('disabled', 'disabled');
162                 }
163             });
164         });
165     //]]>
166     </script>
167 [% END %]
169 [% INCLUDE 'intranet-bottom.inc' %]