Bug 34160: Hyperlink item barcode to the item more details editor from the holds...
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / view_holdsqueue.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE KohaDates %]
5 [% USE ItemTypes %]
6 [% USE Branches %]
7 [% USE AuthorisedValues %]
8 [% USE TablesSettings %]
9 [% USE Koha %]
10 [% PROCESS 'i18n.inc' %]
11 [% SET footerjs = 1 %]
12 [% INCLUDE 'doc-head-open.inc' %]
13 <title>[% FILTER collapse %]
14     [% t("Holds queue") | html %] &rsaquo;
15     [% t("Circulation") | html %] &rsaquo;
16     [% t("Koha") | html %]
17 [% END %]</title>
18 [% INCLUDE 'doc-head-close.inc' %]
19 <style> p { margin-top: 0; }</style>
20 </head>
21
22 <body id="circ_view_holdsqueue" class="circ">
23 [% WRAPPER 'header.inc' %]
24     [% INCLUDE 'circ-search.inc' %]
25 [% END %]
26
27 [% WRAPPER 'sub-header.inc' %]
28     [% WRAPPER breadcrumbs %]
29         [% WRAPPER breadcrumb_item %]
30             <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>
31         [% END %]
32         [% IF ( run_report ) %]
33             [% WRAPPER breadcrumb_item %]
34                 <a href="/cgi-bin/koha/circ/view_holdsqueue.pl">Holds queue</a>
35             [% END %]
36             [% WRAPPER breadcrumb_item bc_active= 1 %]
37                 <span>Results</span>
38             [% END %]
39
40         [% ELSE %]
41             [% WRAPPER breadcrumb_item bc_active= 1 %]
42                 <span>Holds queue</span>
43             [% END %]
44         [% END %]
45     [% END #/ WRAPPER breadcrumbs %]
46 [% END #/ WRAPPER sub-header.inc %]
47
48 <div class="main container-fluid">
49     <div class="row">
50         <div class="col-sm-12">
51             <main>
52                 <div class="row">
53
54                 [% IF ( total || Koha.Preference('CircSidebar') ) %]
55                     <div class="col-sm-10 col-sm-push-2">
56                 [% ELSE %]
57                     <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
58                 [% END %]
59
60 <h1>Holds queue</h1>
61
62 [% IF ( run_report ) %]
63     [% IF ( total ) %]
64         <div class="results">[% total | html %] <span>items found for</span>
65             [% IF ( branchlimit ) %][% Branches.GetName( branchlimit ) | html %][% ELSE %]<span>All libraries</span>[% END %]
66             [% IF ( itemtypeslimit ) %] <span>and item type: [% ItemTypes.GetDescription( itemtypeslimit ) | html %]</span>[% END %]
67             [% IF ( ccodeslimit ) %] <span>and collection: [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode' authorised_value = ccodeslimit ) | html %]</span>[% END %]
68             [% IF ( locationslimit ) %] <span>and shelving location: [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location' authorised_value = locationslimit ) | html %]</span>[% END %]
69         </div>
70     [% ELSE %]
71         <div class="dialog message">No items found.</div>
72     [% END %]
73     [% IF ( itemsloop ) %]
74         <div class="page-section">
75             <table id="holdst">
76                 <thead>
77                 <tr>
78                     <th class="hq-title anti-the">Title</th>
79                     <th class="hq-holdingbranch">Current library</th>
80                     <th class="hq-collection">Collection</th>
81                     <th class="hq-itemtype">Item type</th>
82                     <th class="hq-callnumber">Call number</th>
83                     <th class="hq-copynumber">Copy number</th>
84                     <th class="hq-enumchron">Enumeration</th>
85                     <th class="hq-barcode">Barcode</th>
86                     <th class="hq-patron">Patron</th>
87                     <th class="hq-patroncategory">Patron category</th>
88                     <th class="hq-sendto">Send to</th>
89                     <th class="hq-date">Date</th>
90                     <th class="hq-notes">Notes</th>
91                 </tr>
92                 <tr>
93                     <td class="hq-title">
94                         <span class="filter_column filter_text">
95                             <input class="text_filter" type="text" placeholder="Title">
96                         </span>
97                     </td>
98                     <td class="hq-holdingbranch">
99                         <span class="filter_column filter_text">
100                             <input class="text_filter" type="text" placeholder="Current library">
101                         </span>
102                     </td>
103                     <td class="hq-collection">
104                         <span class="filter_column filter_text">
105                             <input type="text" placeholder="Collection">
106                         </span>
107                     </td>
108                     <td class="hq-itemtype">
109                         <span class="filter_column filter_text">
110                             <input type="text" placeholder="Item type">
111                         </span>
112                     </td>
113                     <td class="hq-callnumber">
114                         <span class="filter_column filter_text">
115                             <input type="text" placeholder="Call number">
116                         </span>
117                     </td>
118                     <td class="hq-copynumber">
119                         <span class="filter_column filter_text">
120                             <input type="text" placeholder="Copy number">
121                         </span>
122                     </td>
123                     <td class="hq-enumchron">
124                         <span class="filter_column filter_text">
125                             <input type="text" placeholder="Enumeration">
126                         </span>
127                     </td>
128                     <td class="hq-barcode">
129                         <span class="filter_column filter_text">
130                             <input type="text" placeholder="Barcode">
131                         </span>
132                     </td>
133                     <td class="hq-patron">
134                         <span class="filter_column filter_text">
135                             <input type="text" placeholder="Patron">
136                         </span>
137                     </td>
138                     <td class="hq-patroncategory">
139                         <span class="filter_column filter_text">
140                             <input type="text" placeholder="Patron category">
141                         </span>
142                     </td>
143                     <td class="hq-sendto">
144                         <span class="filter_column filter_text">
145                             <input type="text" placeholder="Send to">
146                         </span>
147                     </td>
148                     <td class="hq-date">
149                         <span class="filter_column filter_text">
150                             <input type="text" placeholder="Date">
151                         </span>
152                     </td>
153                     <td class="hq-notes">
154                         <span class="filter_column filter_text">
155                             <input type="text" placeholder="Notes">
156                         </span>
157                     </td>
158                 </tr>
159                 </thead>
160                 <tbody>[% FOREACH itemsloo IN itemsloop %]
161                     <tr>
162                         <td class="hq-title">
163                             <p>
164                                 [% INCLUDE 'biblio-title.inc' biblio=itemsloo.biblio link = 1 %]
165                             </p>
166                             <p>
167                                 <div class="hq-biblionumber content_hidden">[% itemsloo.biblionumber | html %]</div>
168                                 <div class="hq-author">[% itemsloo.biblio.author | html %]</div>
169                                 [% IF ( itemsloo.biblio.biblioitem.editionstatement ) %]<div class="hq-editionstatement">[% itemsloo.biblio.biblioitem.editionstatement | html %]</div>[% END %]
170                                 <div class="hq-pubdata">
171                                     [% IF ( itemsloo.biblio.biblioitem.publishercode ) %][% itemsloo.biblio.biblioitem.publishercode | html %][% END %]
172
173                                     [% IF ( itemsloo.biblio.biblioitem.publicationyear ) %]
174                                         , [% itemsloo.biblio.biblioitem.publicationyear | html %]
175                                     [% ELSIF ( itemsloo.biblio.copyrightdate ) %]
176                                         , [% itemsloo.biblio.copyrightdate | html %]
177                                     [% END %]
178
179                                     [% IF ( itemsloo.biblio.biblioitem.pages ) %]: [% itemsloo.biblio.biblioitem.pages | html %] [% END %]
180
181                                     [% IF ( itemsloo.biblio.biblioitem.size ) %][% itemsloo.biblio.biblioitem.size | html %][% END %]
182
183                                     [% IF ( itemsloo.biblio.biblioitem.isbn ) %]<span>ISBN: [% itemsloo.biblio.biblioitem.isbn | html %]</span>[% END %]
184                                 </div>
185                             </p>
186                         </td>
187                         <td class="hq-holdingbranch">[% Branches.GetName( itemsloo.holdingbranch ) | html %]</td>
188                         <td class="hq-collection">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemsloo.item.ccode ) | html %]</td>
189                         <td class="hq-itemtype">[% ItemTypes.GetDescription( itemsloo.item.effective_itemtype ) | html %]</td>
190                         <td class="hq-callnumber">[% IF ( itemsloo.item.location ) %]<em>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => itemsloo.item.location ) | html %]</em> [% END %][% itemsloo.item.itemcallnumber | html %]</td>
191                         <td class="hq-copynumber">[% itemsloo.item.copynumber | html %]</td>
192                         <td class="hq-enumchron">[% itemsloo.item.enumchron | html %]</td>
193                         <td class="hq-barcode">
194                             [% IF ( itemsloo.item_level_request ) %]
195                                 <em>Only item:</em> <strong><a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% itemsloo.itemnumber | uri %]&biblionumber=[% itemsloo.biblionumber | uri %]#item[% itemsloo.itemnumber | uri %]">[% itemsloo.barcode | html %]</a></strong>
196                             [% ELSIF itemsloo.item.item_group %]
197                                 <strong><a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% itemsloo.itemnumber | uri %]&biblionumber=[% itemsloo.biblionumber | uri %]#item[% itemsloo.itemnumber | uri %]">[% itemsloo.barcode | html %]<</a>/strong> <em>or any item from item group <strong>[% itemsloo.item.item_group.description | html %]</strong></em>
198                             [% ELSE %]
199                                 <strong><a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% itemsloo.itemnumber | uri %]&biblionumber=[% itemsloo.biblionumber | uri %]#item[% itemsloo.itemnumber | uri %]">[% itemsloo.barcode | uri %]</a></strong> <em>or any available</em>
200                             [% END %]
201                         </td>
202                         <td class="hq-patron">
203                           <p>
204                               [% INCLUDE 'patron-title.inc' invert_name=1 patron=itemsloo.patron hide_patron_infos_if_needed=1 link_to="circulation_reserves" %]
205                           </p>
206                           [% UNLESS Koha.Preference('HidePatronName') %]
207                              <p>[% itemsloo.patron.phone | html %]</p>
208                           [% END %]
209                         </td>
210                         <td class="hq-patroncategory">[% itemsloo.patron.category.description | html %] ([% itemsloo.patron.categorycode | html %])</td>
211                         <td class="hq-sendto">[% Branches.GetName( itemsloo.pickbranch ) | html %]</td>
212                         <td class="hq-date" data-order="[% itemsloo.reservedate | html %]">[% itemsloo.reservedate | $KohaDates %]</td>
213                         <td class="hq-notes">[% itemsloo.notes | html %]</td>
214                     </tr>
215                 [% END %]
216                 </tbody>
217             </table>
218         </div> <!-- /.page-section -->
219         [% END %]
220         [% END %]
221
222                         [% UNLESS ( total ) %]
223                             [% branchlimit = Branches.GetLoggedInBranchcode %]
224                             [% PROCESS filter_form %]
225                         [% END %]
226
227                     </div> <!-- /.col-sm-10.col-sm-push-2 -->
228                     [% IF ( total || Koha.Preference('CircSidebar') ) %]
229                         <div class="col-sm-2 col-sm-pull-10">
230                             <aside>
231                                 [% IF ( total ) %]
232                                     [% PROCESS filter_form %]
233                                 [% END %]
234                                 [% IF Koha.Preference('CircSidebar') %]
235                                     [% INCLUDE 'circ-nav.inc' %]
236                                 [% END %]
237                             </aside>
238                         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
239                     [% END %]
240                 </div> <!-- /.row -->
241
242             </main>
243         </div> <!-- /.col-sm-12 -->
244     </div> <!-- /.row -->
245
246 [% BLOCK filter_form %]
247     <form name="f" action="/cgi-bin/koha/circ/view_holdsqueue.pl">
248         [% IF ( total ) %]
249             <fieldset class="brief">
250         [% ELSE -%]
251             <fieldset class="rows">
252         [% END %]
253             <ol>
254                 <li>
255                     <label for="branchlimit">Library: </label>
256                     <select name="branchlimit" id="branchlimit">
257                         [% IF CAN_user_superlibrarian || !Koha.Preference('IndependentBranches') %]
258                             <option value="">All</option>
259                         [% END %]
260                         [% PROCESS options_for_libraries libraries => Branches.all( selected => branchlimit, only_from_group => 1 ) %]
261                     </select>
262                 </li>
263                 <li>
264                     <label for="itemtypeslimit">Item type: </label>
265                     <select name="itemtypeslimit" id="itemtypeslimit">
266                         <option value="">All</option>
267                         [% PROCESS options_for_item_types itemtypes => ItemTypes.Get(), selected_itemtype => itemtypeslimit %]
268                     </select>
269                 </li>
270                 <li>
271                     <label for="ccodeslimit">Collection: </label>
272                     <select name="ccodeslimit" id="ccodeslimit">
273                         <option value="">All</option>
274                         [% PROCESS options_for_authorised_values authorised_values => AuthorisedValues.GetAuthValueDropbox( 'CCODE' ), selected_av => ccodeslimit %]
275                     </select>
276                 </li>
277                 <li>
278                     <label for="locationsslimit">Shelving location: </label>
279                     <select name="locationslimit" id="locationslimit">
280                         <option value="">All</option>
281                         [% PROCESS options_for_authorised_values authorised_values => AuthorisedValues.GetAuthValueDropbox( 'LOC' ), selected_av => locationslimit %]
282                     </select>
283                 </li>
284             </ol>
285             <fieldset class="action">
286                 <input type="submit" class="btn btn-primary" value="Submit" />
287                 <input type="hidden" name="run_report" value="1" />
288             </fieldset>
289         </fieldset>
290     </form>
291 [% END %]
292
293 [% MACRO jsinclude BLOCK %]
294     [% INCLUDE 'datatables.inc' %]
295     [% INCLUDE 'columns_settings.inc' %]
296     <script>
297         $(document).ready(function() {
298             var holdst;
299
300             // Setup filters before DataTables initialisation, in case some columns are
301             // hidden by default
302             var filterColumnTimeoutId;
303             var filterColumn = function(e) {
304                 clearTimeout(filterColumnTimeoutId);
305                 filterColumnTimeoutId = setTimeout(function() {
306                     var input = $(e.target);
307                     var idx = input.parents('td').index();
308                     holdst.api().column(idx + ':visible').search(input.val()).draw();
309                 }, 200);
310             };
311             $('#holdst thead input').on('change keyup keydown', filterColumn);
312
313             var table_settings = [% TablesSettings.GetTableSettings('circ', 'view_holdsqueue', 'holds-table', 'json') | $raw %];
314             var holdst = KohaTable("holdst", {
315                 "sDom": 'B<"clearfix">t',
316                 "bSortCellsTop": true,
317                 "bPaginate": false
318             }, table_settings);
319
320         });
321     </script>
322 [% END %]
323
324 [% INCLUDE 'intranet-bottom.inc' %]