Bug 26922: Regression tests
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / course_reserves / batch_add_items.tt
blob1da830054d73bd8e3486efe8c9086d255c36614c
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 <em><a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% course.course_id | html %]">[% course.course_name | html %]</a></em></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                     Checking the box next to the field label will enable changes to that field. Leave boxes unchecked to make no change.<br>
109                     Any items with existing course reserves will have their <em>on reserve</em> values updated.
110                 </p>
112                 <fieldset class="action">
113                     <input type="submit" value="Submit" class="submit" />
115                     <a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% course.course_id | uri %]" class="cancel">Cancel</a>
116                 </fieldset>
117             </form>
118         [% END %]
120         [% IF action == 'display_results' %]
121             <h1>Results</h1>
123             <h3>Items added</h3>
124             [% IF items_added.size > 0 %]
125                 <p>The following items were added or updated:</p>
126                 <ul>
127                     [% FOREACH i IN items_added %]
128                         <li>[% i.biblio.title | html %] ( [% i.barcode | html %] )</li>
129                     [% END %]
130                 </ul>
131             [% ELSE %]
132                 No valid item barcodes found.
133             [% END %]
136             [% IF invalid_barcodes.size > 0 %]
137                 <h3>Invalid barcodes</h3>
138                 <p>The following invalid barcodes were skipped:</p>
139                 <ul>
140                     [% FOREACH b IN invalid_barcodes %]
141                         <li>[% b | html %]</li>
142                     [% END %]
143                 </ul>
144             [% END %]
146             <p>
147                 <a class='btn btn-default' href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% course_id | html %]">View course</a>
148             </p>
149         [% END %]
150     </div>
151 </div>
153 [% MACRO jsinclude BLOCK %]
154     <script>
155     //<![CDATA[
156         $(document).ready(function(){
157             $('.field-toggle').change(function() {
158                 if( this.checked ) {
159                     $('#' + $(this).data('pulldown') ).removeAttr('disabled');
160                 } else {
161                     $('#' + $(this).data('pulldown') ).val('');
162                     $('#' + $(this).data('pulldown') ).attr('disabled', 'disabled');
163                 }
164             });
165         });
166     //]]>
167     </script>
168 [% END %]
170 [% INCLUDE 'intranet-bottom.inc' %]