Bug 17698: (QA follow-up) few more things
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / view_holdsqueue.tt
1 [% USE Asset %]
2 [% USE Koha %]
3 [% USE KohaDates %]
4 [% USE ItemTypes %]
5 [% USE Branches %]
6 [% USE AuthorisedValues %]
7 [% USE ColumnsSettings %]
8 [% USE Koha %]
9 [% SET footerjs = 1 %]
10 [% INCLUDE 'doc-head-open.inc' %]
11 <title>Koha &rsaquo; Circulation &rsaquo; Holds queue</title>
12 [% INCLUDE 'doc-head-close.inc' %]
13 <style type="text/css"> p { margin-top: 0; }</style>
14 [% Asset.css("css/datatables.css") %]
15 </head>
16
17 <body id="circ_view_holdsqueue" class="circ">
18 [% INCLUDE 'header.inc' %]
19 [% INCLUDE 'cat-search.inc' %]
20
21 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a>
22 &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>
23 &rsaquo; <a href="/cgi-bin/koha/circ/view_holdsqueue.pl">Holds queue</a>
24 [% IF ( run_report ) %] &rsaquo; Results[% END %]
25 </div>
26
27 [% IF Koha.Preference('CircSidebar') %]<div id="doc3" class="yui-t2">[% ELSE %]<div id="doc2" class="yui-t7">[% END %]
28
29    <div id="bd">
30         <div id="yui-main">
31         [% IF Koha.Preference('CircSidebar') %]<div class="yui-b">[% END %]
32         <div class="yui-g">
33
34 <h1>Holds queue</h1>
35
36 [% IF ( run_report ) %]
37     [% IF ( total ) %]
38         <div class="results">[% total %] items found for
39             [% IF ( branchlimit ) %][% Branches.GetName( branchlimit ) %][% ELSE %]All libraries[% END %]
40         </div>
41     [% ELSE %]
42         <div class="dialog message">No items found.</div>
43     [% END %]
44     [% IF ( itemsloop ) %]
45 <table id="holdst">
46         <thead>
47     <tr>
48         <th class="hq-title">Title</th>
49         <th class="hq-collection">Collection</th>
50         <th class="hq-itemtype">Item type</th>
51         <th class="hq-callnumber">Call number</th>
52         <th class="hq-copynumber">Copy number</th>
53         <th class="hq-enumchron">Enumeration</th>
54         <th class="hq-barcode">Barcode</th>
55         <th class="hq-patron">Patron</th>
56         <th class="hq-sendto">Send to</th>
57         <th class="hq-date">Date</th>
58         <th class="hq-notes">Notes</th>
59     </tr>
60     <tr>
61         <td class="hq-title">
62             <span class="filter_column filter_text">
63                 <input class="text_filter" type="text" placeholder="Title">
64             </span>
65         </td>
66         <td class="hq-collection">
67             <span class="filter_column filter_text">
68                 <input type="text" placeholder="Collection">
69             </span>
70         </td>
71         <td class="hq-itemtype">
72             <span class="filter_column filter_text">
73                 <input type="text" placeholder="Item type">
74             </span>
75         </td>
76         <td class="hq-callnumber">
77             <span class="filter_column filter_text">
78                 <input type="text" placeholder="Call number">
79             </span>
80         </td>
81         <td class="hq-copynumber">
82             <span class="filter_column filter_text">
83                 <input type="text" placeholder="Copy number">
84             </span>
85         </td>
86         <td class="hq-enumchron">
87             <span class="filter_column filter_text">
88                 <input type="text" placeholder="Enumeration">
89             </span>
90         </td>
91         <td class="hq-barcode">
92             <span class="filter_column filter_text">
93                 <input type="text" placeholder="Barcode">
94             </span>
95         </td>
96         <td class="hq-patron">
97             <span class="filter_column filter_text">
98                 <input type="text" placeholder="Patron">
99             </span>
100         </td>
101         <td class="hq-sendto">
102             <span class="filter_column filter_text">
103                 <input type="text" placeholder="Send to">
104             </span>
105         </td>
106         <td class="hq-date">
107             <span class="filter_column filter_text">
108                 <input type="text" placeholder="Date">
109             </span>
110         </td>
111         <td class="hq-notes">
112             <span class="filter_column filter_text">
113                 <input type="text" placeholder="Notes">
114             </span>
115         </td>
116     </tr>
117         </thead>
118      <tbody>[% FOREACH itemsloo IN itemsloop %]
119         <tr>
120             <td class="hq-title">
121                 <p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% itemsloo.biblionumber %]"><strong>[% itemsloo.title | html %]</strong> [% FOREACH s IN itemsloo.subtitle %] [% s %][% END %]</a></p>
122                 <p>
123                     <div class="hq-biblionumber content_hidden">[% itemsloo.biblionumber %]</div>
124                     <div class="hq-author">[% itemsloo.author %]</div>
125                     <div class="hq-pubdata">
126                         [% IF ( itemsloo.publishercode ) %][% itemsloo.publishercode %][% END %]
127
128                         [% IF ( itemsloo.publicationyear ) %]
129                             , [% itemsloo.publicationyear %]
130                         [% ELSIF ( itemsloo.copyrightdate ) %]
131                             , [% itemsloo.copyrightdate %]
132                         [% END %]
133
134                         [% IF ( itemsloo.pages ) %]: [% itemsloo.pages %] [% END %]
135
136                         [% IF ( itemsloo.item('size') ) %][% itemsloo.item('size') %][% END %]
137
138                         [% IF ( itemsloo.isbn ) %]ISBN: [% itemsloo.isbn %][% END %]
139                     </div>
140                 </p>
141             </td>
142             <td class="hq-collection">[% AuthorisedValues.GetByCode( 'CCODE', itemsloo.ccode ) %]</td>
143             <td class="hq-itemtype">[% ItemTypes.GetDescription( itemsloo.itype ) %]</td>
144             <td class="hq-callnumber">[% IF ( itemsloo.location ) %]<em>[% AuthorisedValues.GetByCode( 'LOC', itemsloo.location ) %]</em> [% END %][% itemsloo.itemcallnumber %]</td>
145             <td class="hq-copynumber">[% itemsloo.copynumber %]</td>
146             <td class="hq-enumchron">[% itemsloo.enumchron %]</td>
147             <td class="hq-barcode">
148                 [% IF ( itemsloo.item_level_request ) %]
149                     <em>Only item:</em> <strong>[% itemsloo.barcode %]</strong>
150                 [% ELSE %]
151                     <strong>[% itemsloo.barcode %]</strong> <em>or any available</em>
152                 [% END %]
153             </td>
154             <td class="hq-patron">
155               <p>
156                   [% INCLUDE 'patron-title.inc' patron=itemsloo.patron hide_patron_infos_if_needed=1 link_to="circulation_reserves" %]
157               </p>
158               [% UNLESS Koha.Preference('HidePatronName') %]
159                  <p>[% itemsloo.patron.phone %]</p>
160               [% END %]
161             </td>
162             <td class="hq-sendto">[% Branches.GetName( itemsloo.pickbranch ) %]</td>
163             <td class="hq-date"><span title="[% itemsloo.reservedate %]">[% itemsloo.reservedate | $KohaDates %]</span></td>
164             <td class="hq-notes">[% itemsloo.notes %]</td>
165         </tr>
166     [% END %]</tbody>
167     </table>
168         [% END %] 
169         [% END %]
170
171 [% UNLESS ( total ) %]
172 <form name="f" action="/cgi-bin/koha/circ/view_holdsqueue.pl" method="post">
173         <fieldset class="rows">
174         <ol>
175         <li>
176             <label for="branchlimit">Library: </label>
177             <select name="branchlimit" id="branchlimit">
178                 <option value="">All</option>
179                 [% PROCESS options_for_libraries libraries => Branches.all( only_from_group => 1 ) %]
180             </select>
181         </li>
182     </ol></fieldset>
183     <fieldset class="action">    <input type="submit" value="Submit" />
184         <input type="hidden" name="run_report" value="1" /></fieldset>
185 </form>
186 [% END %]
187
188 </div>
189 </div>
190 [% IF Koha.Preference('CircSidebar') %]
191 </div>
192 <div class="yui-b noprint">
193     [% INCLUDE 'circ-nav.inc' %]
194 </div>
195 [% END %]
196 </div>
197
198 [% MACRO jsinclude BLOCK %]
199     [% INCLUDE 'datatables.inc' %]
200     [% INCLUDE 'columns_settings.inc' %]
201     <script type="text/javascript">
202         $(document).ready(function() {
203             var holdst;
204
205             // Setup filters before DataTables initialisation, in case some columns are
206             // hidden by default
207             var filterColumnTimeoutId;
208             var filterColumn = function(e) {
209                 clearTimeout(filterColumnTimeoutId);
210                 filterColumnTimeoutId = setTimeout(function() {
211                     var input = $(e.target);
212                     var idx = input.parents('td').index();
213                     holdst.api().column(idx + ':visible').search(input.val()).draw();
214                 }, 200);
215             };
216             $('#holdst thead input').on('change keyup keydown', filterColumn);
217
218             var columns_settings = [% ColumnsSettings.GetColumns('circ', 'view_holdsqueue', 'holds-table', 'json') %];
219             var holdst = KohaTable("holdst", {
220                 "aaSorting": [[ 3, "asc" ]],
221                 "aoColumns": [
222                     { "sType": "anti-the" },null,null,null,null,null,null,null,null,{ "sType": "title-string" },null
223                 ],
224                 "sDom": 'B<"clearfix">t',
225                 "bSortCellsTop": true,
226                 "bPaginate": false
227             }, columns_settings);
228
229         });
230     </script>
231 [% END %]
232
233 [% INCLUDE 'intranet-bottom.inc' %]