Bug 18591: (RM follow-up) Fix filter
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / ill / ill-requests.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Branches %]
4 [% USE Koha %]
5 [% USE KohaDates %]
6
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Koha &rsaquo; ILL requests  &rsaquo;</title>
9 [% INCLUDE 'doc-head-close.inc' %]
10 [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
11 [% Asset.css("css/datatables.css") | $raw %]
12 [% INCLUDE 'datatables.inc' %]
13 <script type="text/javascript">
14     //<![CDATA[
15     $(document).ready(function() {
16
17         // Illview Datatable setup
18
19         // Fields we don't want to display
20         var ignore = [
21             'accessurl',
22             'backend',
23             'branchcode',
24             'completed',
25             'capabilities',
26             'cost',
27             'medium',
28             'notesopac',
29             'notesstaff',
30             'placed',
31             'replied'
32         ];
33
34         // Fields we need to expand (flatten)
35         var expand = [
36             'metadata',
37             'patron'
38         ];
39
40         // Expanded fields
41         // This is auto populated
42         var expanded = {};
43
44         // The core fields that should be displayed first
45         var core = [
46             'metadata_Author',
47             'metadata_Title',
48             'borrowername',
49             'biblio_id',
50             'library',
51             'status',
52             'updated',
53             'illrequest_id',
54             'comments',
55             'action' // Action should always be last
56         ];
57
58         // Remove any fields we're ignoring
59         var removeIgnore = function(dataObj) {
60             dataObj.forEach(function(thisRow) {
61                 ignore.forEach(function(thisIgnore) {
62                     if (thisRow.hasOwnProperty(thisIgnore)) {
63                         delete thisRow[thisIgnore];
64                     }
65                 });
66             });
67         };
68
69         // Expand any fields we're expanding
70         var expandExpand = function(row) {
71             expand.forEach(function(thisExpand) {
72                 if (row.hasOwnProperty(thisExpand)) {
73                     if (!expanded.hasOwnProperty(thisExpand)) {
74                         expanded[thisExpand] = [];
75                     }
76                     var expandObj = row[thisExpand];
77                     Object.keys(expandObj).forEach(
78                         function(thisExpandCol) {
79                             var expColName = thisExpand + '_' + thisExpandCol;
80                             // Keep a list of fields that have been expanded
81                             // so we can create toggle links for them
82                             if (expanded[thisExpand].indexOf(expColName) == -1) {
83                                 expanded[thisExpand].push(expColName);
84                             }
85                             expandObj[expColName] =
86                                 expandObj[thisExpandCol];
87                             delete expandObj[thisExpandCol];
88                         }
89                     );
90                     $.extend(true, row, expandObj);
91                     delete row[thisExpand];
92                 }
93             });
94         };
95
96         // Build a de-duped list of all column names
97         var allCols = {};
98         core.map(function(thisCore) {
99             allCols[thisCore] = 1;
100         });
101
102         // Strip the expand prefix if it exists, we do this for display
103         var stripPrefix = function(value) {
104             expand.forEach(function(thisExpand) {
105                 var regex = new RegExp(thisExpand + '_', 'g');
106                 value = value.replace(regex, '');
107             });
108             return value;
109         };
110
111         // Our 'render' function for borrowerlink
112         var createPatronLink = function(data, type, row) {
113             return '<a title="' + _("View borrower details") + '" ' +
114                 'href="/cgi-bin/koha/members/moremember.pl?' +
115                 'borrowernumber='+row.borrowernumber+'">' +
116                 row.patron_firstname + ' ' + row.patron_surname +
117                 '</a>';
118         };
119
120         // Our 'render' function for biblio_id
121         var createBiblioLink = function(data, type, row) {
122             return (row.biblio_id) ?
123                 '<a title="' + _("View biblio details") + '" ' +
124                 'href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=' +
125                 row.biblio_id + '">' +
126                 row.biblio_id +
127                 '</a>' : '';
128         };
129
130         // Our 'render' function for the library name
131         var createLibrary = function(data, type, row) {
132             return row.library.branchname;
133         };
134
135         // Render function for request ID
136         var createRequestId = function(data, type, row) {
137             return row.id_prefix + row.illrequest_id;
138         };
139
140         // Render function for request status
141         var createStatus = function(data, type, row, meta) {
142             var origData = meta.settings.oInit.originalData;
143             if (origData.length > 0) {
144                 var status_name = meta.settings.oInit.originalData[0].capabilities[
145                     row.status
146                 ].name;
147                 switch( status_name ) {
148                     case "New request":
149                         return _("New request");
150                     case "Requested":
151                         return _("Requested");
152                     case "Requested from partners":
153                         return _("Requested from partners");
154                     case "Request reverted":
155                         return _("Request reverted");
156                     case "Queued request":
157                         return _("Queued request");
158                     case "Cancellation requested":
159                         return _("Cancellation requested");
160                     case "Completed":
161                         return _("Completed");
162                     case "Delete request":
163                         return _("Delete request");
164                     default:
165                         return status_name;
166                 }
167             } else {
168                 return '';
169             }
170         };
171
172         // Render function for creating a row's action link
173         var createActionLink = function(data, type, row) {
174             return '<a class="btn btn-default btn-sm" ' +
175                 'href="/cgi-bin/koha/ill/ill-requests.pl?' +
176                 'method=illview&amp;illrequest_id=' +
177                 row.illrequest_id +
178                 '">' + _("Manage request") + '</a>';
179         };
180
181         // Columns that require special treatment
182         var specialCols = {
183             action: {
184                 name: '',
185                 func: createActionLink
186             },
187             borrowername: {
188                 name: _("Patron"),
189                 func: createPatronLink
190             },
191             illrequest_id: {
192                 name: _("Request number"),
193                 func: createRequestId
194             },
195             status: {
196                 name: _("Status"),
197                 func: createStatus
198             },
199             biblio_id: {
200                 name: _("Bibliograpic record ID"),
201                 func: createBiblioLink
202             },
203             library: {
204                 name: _("Library"),
205                 func: createLibrary
206             }
207         };
208
209         // Toggle request attributes in Illview
210         $('#toggle_requestattributes').on('click', function(e) {
211             e.preventDefault();
212             $('#requestattributes').toggleClass('content_hidden');
213         });
214
215         // Toggle new comment form in Illview
216         $('#toggle_addcomment').on('click', function(e) {
217             e.preventDefault();
218             $('#addcomment').toggleClass('content_hidden');
219         });
220
221         // Filter partner list
222         $('#partner_filter').keyup(function() {
223             var needle = $('#partner_filter').val();
224             $('#partners > option').each(function() {
225                 var regex = new RegExp(needle, 'i');
226                 if (
227                     needle.length == 0 ||
228                     $(this).is(':selected') ||
229                     $(this).text().match(regex)
230                 ) {
231                     $(this).show();
232                 } else {
233                     $(this).hide();
234                 }
235             });
236         });
237
238         // Display the modal containing request supplier metadata
239         $('#ill-request-display-metadata').on('click', function(e) {
240             e.preventDefault();
241             $('#dataPreview').modal({show:true});
242         });
243
244         // Get our data from the API and process it prior to passing
245         // it to datatables
246         var ajax = $.ajax(
247             '/api/v1/illrequests?embed=metadata,patron,capabilities,library,comments'
248             ).done(function() {
249                 var data = JSON.parse(ajax.responseText);
250                 // Make a copy, we'll be removing columns next and need
251                 // to be able to refer to data that has been removed
252                 var dataCopy = $.extend(true, [], data);
253                 // Remove all columns we're not interested in
254                 removeIgnore(dataCopy);
255                 // Expand columns that need it and create an array
256                 // of all column names
257                 $.each(dataCopy, function(k, row) {
258                     expandExpand(row);
259                 });
260
261                 // Assemble an array of column definitions for passing
262                 // to datatables
263                 var colData = [];
264                 Object.keys(allCols).forEach(function(thisCol) {
265                     // Create the base column object
266                     var colObj = {
267                         name: thisCol,
268                         className: thisCol
269                     };
270                     // We may need to process the data going in this
271                     // column, so do it if necessary
272                     if (
273                         specialCols.hasOwnProperty(thisCol) &&
274                         specialCols[thisCol].hasOwnProperty('func')
275                     ) {
276                         colObj.render = specialCols[thisCol].func;
277                     } else {
278                         colObj.data = thisCol;
279                     }
280                     colData.push(colObj);
281                 });
282
283                 // Initialise the datatable
284                 $('#ill-requests').DataTable($.extend(true, {}, dataTablesDefaults, {
285                     'aoColumnDefs': [  // Last column shouldn't be sortable or searchable
286                         {
287                             'aTargets': [ 'actions' ],
288                             'bSortable': false,
289                             'bSearchable': false
290                         },
291                     ],
292                     'aaSorting': [[ 6, 'desc' ]], // Default sort, updated descending
293                     'processing': true, // Display a message when manipulating
294                     'iDisplayLength': 10, // 10 results per page
295                     'sPaginationType': "full_numbers", // Pagination display
296                     'deferRender': true, // Improve performance on big datasets
297                     'data': dataCopy,
298                     'columns': colData,
299                     'originalData': data // Enable render functions to access
300                                        // our original data
301                 }));
302             }
303         );
304
305     });
306     //]]>
307 </script>
308 </head>
309
310 <body id="illrequests" class="ill">
311 [% INCLUDE 'header.inc' %]
312 [% INCLUDE 'cat-search.inc' %]
313
314 <div id="breadcrumbs">
315     <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
316     <a href="/cgi-bin/koha/ill/ill-requests.pl">ILL requests</a>
317     [% IF query_type == 'create' %]
318          &rsaquo; New request
319     [% ELSIF query_type == 'status' %]
320          &rsaquo; Status
321     [% END %]
322 </div>
323
324 <div id="doc3" class="yui-t2">
325     <div id="bd">
326         <div id="yui-main">
327             <div id="interlibraryloans" class="yui-b">
328         [% IF !backends_available %]
329             <div class="dialog message">ILL module configuration problem. Take a look at the <a href="/cgi-bin/koha/about.pl#sysinfo">about page</a></div>
330         [% ELSE %]
331                 [% INCLUDE 'ill-toolbar.inc' %]
332
333                 [% IF whole.error %]
334                     <h1>Error performing operation</h1>
335                     <!-- Dispatch on Status -->
336                     <p>We encountered an error:</p>
337                     <p>
338                       <pre>[% whole.message | html %] ([% whole.status | html %])</pre>
339                     </p>
340                 [% END %]
341
342                 [% IF query_type == 'create' %]
343                     <h1>New ILL request</h1>
344                     [% PROCESS $whole.template %]
345
346                 [% ELSIF query_type == 'confirm' %]
347                     <h1>Confirm ILL request</h1>
348                     [% PROCESS $whole.template %]
349
350                 [% ELSIF query_type == 'cancel' and !whole.error %]
351                     <h1>Cancel a confirmed request</h1>
352                     [% PROCESS $whole.template %]
353
354                 [% ELSIF query_type == 'generic_confirm' %]
355                     <h1>Place request with partner libraries</h1>
356                   [% IF error %]
357                     [% IF error == 'no_target_email' %]
358                         <div class="alert">
359                             No target email addresses found. Either select at least
360                             one partner or check your ILL partner library records.
361                         </div>
362                     [% ELSIF error == 'no_library_email' %]
363                         <div class="alert">
364                             Your library has no usable email address. Please set it.
365                         </div>
366                     [% ELSIF error == 'unkown_error' %]
367                         <div class="alert">
368                             Unknown error processing your request. Contact your administrator.
369                         </div>
370                     [% END %]
371                   [% END %]
372                     <!-- Start of GENERIC_EMAIL case -->
373                     [% IF whole.value.partners %]
374                        [% ill_url = "/cgi-bin/koha/ill/ill-requests.pl?method=illview&illrequest_id=" _ request.illrequest_id %]
375                         <form method="POST" action="/cgi-bin/koha/ill/ill-requests.pl">
376                             <fieldset class="rows">
377                                 <legend>Interlibrary loan request details</legend>
378                                 <ol>
379                                     <li>
380                                         <label for="partner_filter">Filter partner libraries:</label>
381                                         <input type="text" id="partner_filter">
382                                     </li>
383                                     <li>
384                                         <label for="partners" class="required">Select partner libraries:</label>
385                                         <select size="5" multiple="true" id="partners" name="partners" required="required">
386                                             [% FOREACH partner IN whole.value.partners %]
387                                                 <option value=[% partner.email | html %]>
388                                                     [% partner.branchcode _ " - " _ partner.surname %]
389                                                 </option>
390                                             [% END %]
391                                         </select>
392
393                                     </li>
394                                     <li>
395                                         <label for="subject" class="required">Subject Line</label>
396                                         <input type="text" name="subject" id="subject" type="text" value="[% whole.value.draft.subject | html %]" required="required" />
397                                     </li>
398                                     <li>
399                                         <label for="body" class="required">Email text:</label>
400                                         <textarea name="body" id="body" rows="20" cols="80" required="required">[% whole.value.draft.body | html %]</textarea>
401                                     </li>
402                                 </ol>
403                                 <input type="hidden" value="generic_confirm" name="method">
404                                 <input type="hidden" value="draft" name="stage">
405                                 <input type="hidden" value="[% request.illrequest_id | html %]" name="illrequest_id">
406                             </fieldset>
407                             <fieldset class="action">
408                                 <input type="submit" class="btn btn-default" value="Send email"/>
409                                 <span><a href="[% ill_url | uri %]" title="Return to request details">Cancel</a></span>
410                             </fieldset>
411                         </form>
412                     [% ELSE %]
413                         <fieldset class="rows">
414                             <legend>Interlibrary loan request details</legend>
415                             <p>No partners have been defined yet. Please create appropriate patron records (by default ILLLIBS category).</p>
416                             <p>Be sure to provide email addresses for these patrons.</p>
417                             <p><span><a href="[% ill_url | uri %]" title="Return to request details">Cancel</a></span></p>
418                         </fieldset>
419                     [% END %]
420                 <!-- generic_confirm ends here -->
421
422                 [% ELSIF query_type == 'edit_action' %]
423                     <form method="POST" action="/cgi-bin/koha/ill/ill-requests.pl">
424                         <fieldset class="rows">
425                             <legend>Request details</legend>
426                             <ol>
427                                 <li class="borrowernumber">
428                                     <label for="borrowernumber">Patron ID:</label>
429                                     [% request.borrowernumber | html %]
430                                 </li>
431                                 <li class="biblio_id">
432                                     <label for="biblio_id" class="biblio_id">Bibliographic record ID:</label>
433                                     <input name="biblio_id" id="biblio_id" type="text" value="[% request.biblio_id | html %]">
434                                 </li>
435                                 <li class="branchcode">
436                                     <label for="library" class="branchcode">Library:</label>
437                                     <select name="branchcode" id="library">
438                                         [% PROCESS options_for_libraries libraries => Branches.all( selected => request.branchcode ) %]
439                                     </select>
440                                 </li>
441                                 <li class="status">
442                                     <label class="status">Status:</label>
443                                     [% stat = request.status %]
444                                     [% request.capabilities.$stat.name | html %]
445                                 </li>
446                                 <li class="updated">
447                                     <label class="updated">Last updated:</label>
448                                     [% request.updated | $KohaDates with_hours => 1 | html %]
449                                 </li>
450                                 <li class="medium">
451                                     <label class="medium">Request type:</label>
452                                     [% request.medium | html %]
453                                 </li>
454                                 <li class="cost">
455                                     <label class="cost">Cost:</label>
456                                     [% IF request.cost %][% request.cost | html %][% ELSE %]<span>N/A</span>[% END %]
457                                 </li>
458                                 <li class="price_paid">
459                                     <label class="price_paid">Price paid:</label>
460                                     <input name="price_paid" id="price_paid" type="text" value="[% request.price_paid | html %]">
461                                 </li>
462                                 <li class="req_id">
463                                     <label class="req_id">Request number:</label>
464                                     [% request.id_prefix _ request.illrequest_id | html %]
465                                 </li>
466                                 <li class="notesstaff">
467                                     <label for="notesstaff" class="notesstaff">Staff notes:</label>
468                                     <textarea name="notesstaff" id="notesstaff" rows="5">[% request.notesstaff | html %]</textarea>
469                                 </li>
470                                 <li class="notesopac">
471                                     <label for="notesopac" class="notesopac">Opac notes:</label>
472                                     <textarea name="notesopac" id="notesopac" rows="5">[% request.notesopac | html %]</textarea>
473                                 </li>
474                             </ol>
475                         </fieldset>
476                         <fieldset class="action">
477                             <input type="hidden" value="edit_action" name="method">
478                             <input type="hidden" value="form" name="stage">
479                             <input type="hidden" value="[% request.illrequest_id | html %]" name="illrequest_id">
480                             <input type="hidden" value="[% request.borrowernumber | html %]" name="borrowernumber">
481                             <input type="submit" value="Submit">
482                             <a class="cancel" href="/cgi-bin/koha/ill/ill-requests.pl?method=illview&amp;illrequest_id=[% request.id | html %]">Cancel</a>
483                         </fieldset>
484                     </form>
485
486                 [% ELSIF query_type == 'delete_confirm' %]
487
488                     <div class="dialog alert">
489                         <h3>Are you sure you wish to delete this request?</h3>
490                         <form action="/cgi-bin/koha/ill/ill-requests.pl" method="post">
491                             <input type="hidden" name="method" value="delete" />
492                             <input type="hidden" name="confirmed" value="1" />
493                             <input type="hidden" name="illrequest_id" value="[% request.id | html %]" />
494                             <button type="submit" class="btn btn-default btn-sm approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
495                         </form>
496                         <a class="btn btn-default btn-sm deny" href="/cgi-bin/koha/ill/ill-requests.pl?method=illview&amp;illrequest_id=[% request.id | html %]"><i class="fa fa-fw fa-remove"></i>No, do not delete</a>
497                     </div>
498
499                 [% ELSIF query_type == 'illview' %]
500                     [% req_status = request.status %]
501                     <h1>Manage ILL request</h1>
502                     <div id="toolbar" class="btn-toolbar">
503                         <a title="Edit request" id="ill-toolbar-btn-edit-action" class="btn btn-sm btn-default" href="/cgi-bin/koha/ill/ill-requests.pl?method=edit_action&amp;illrequest_id=[% request.illrequest_id | html %]">
504                         <span class="fa fa-pencil"></span>
505                         Edit request
506                         </a>
507                         [% FOREACH action IN request.available_actions %]
508                             [% IF action.method != 0 %]
509                                 <a title="[% action.ui_method_name | html %]" id="ill-toolbar-btn-[% action.id | lower | html %]" class="btn btn-sm btn-default" href="/cgi-bin/koha/ill/ill-requests.pl?method=[% action.method | html %]&amp;illrequest_id=[% request.illrequest_id | html %]">
510                                 <span class="fa [% action.ui_method_icon | html %]"></span>
511                                 [% action.ui_method_name | html %]
512                                 </a>
513                             [% END %]
514                         [% END %]
515                         <a title="Display supplier metadata" id="ill-request-display-metadata" class="btn btn-sm btn-default pull-right" href="#">
516                             <span class="fa fa-eye"></span>
517                             Display supplier metadata
518                         </a>
519                     </div>
520                     <div id="ill-view-panel" class="panel panel-default">
521                         <div class="panel-heading">
522                             <h3>Request details</h3>
523                         </div>
524                         <div class="panel-body">
525                             <h4>Details from library</h4>
526                             <div class="rows">
527                                 <div class="orderid">
528                                     <span class="label orderid">Order ID:</span>
529                                     [% IF request.orderid %][% request.orderid | html %][% ELSE %]<span>N/A</span>[% END %]
530                                 </div>
531                                 <div class="borrowernumber">
532                                     <span class="label borrowernumber">Patron:</span>
533                                     [% borrowerlink = "/cgi-bin/koha/members/moremember.pl" _ "?borrowernumber=" _ request.patron.borrowernumber %]
534                                     <a href="[% borrowerlink | uri %]" title="View borrower details">
535                                     [% request.patron.firstname _ " " _ request.patron.surname _ " [" _ request.patron.cardnumber _ "]" | html %]
536                                     </a>
537                                 </div>
538
539                                 <div class="biblio_id">
540                                     <span class="label biblio_id">Bibliographic record ID:</span>
541                                     [% IF request.biblio_id %]
542                                         <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% request.biblio_id | uri %]">[% request.biblio_id | html %]</a>
543                                     [% ELSE %]
544                                         <span>N/A</span>
545                                     [% END %]
546                                 </div>
547                                 <div class="branchcode">
548                                     <span class="label branchcode">Library:</span>
549                                     [% Branches.GetName(request.branchcode) | html %]
550                                 </div>
551                                 <div class="status">
552                                     <span class="label status">Status:</span>
553                                     [% request.capabilities.$req_status.name | html %]
554                                 </div>
555                                 <div class="updated">
556                                     <span class="label updated">Last updated:</span>
557                                     [% request.updated | $KohaDates with_hours => 1 | html %]
558                                 </div>
559                                 <div class="medium">
560                                     <span class="label medium">Request type:</span>
561                                     [% request.medium | html %]
562                                 </div>
563                                 <div class="cost">
564                                     <span class="label cost">Cost:</span>
565                                     [% IF request.cost %][% request.cost | html %][% ELSE %]<span>N/A</span>[% END %]
566                                 </div>
567                                 <div class="price_paid">
568                                     <span class="label price_paid">Price paid:</span>
569                                     [% IF request.price_paid %][% request.price_paid | html %][% ELSE %]<span>N/A</span>[% END %]
570                                 </div>
571                                 <div class="req_id">
572                                     <span class="label req_id">Request number:</span>
573                                     [% request.id_prefix _ request.illrequest_id | html %]
574                                 </div>
575                                 <div class="notesstaff">
576                                     <span class="label notes_staff">Staff notes:</span>
577                                     <pre>[% request.notesstaff | html %]</pre>
578                                 </div>
579                                 <div class="notesopac">
580                                     <span class="label notes_opac">Notes:</span>
581                                     <pre>[% request.notesopac | html %]</pre>
582                                 </div>
583                             </div>
584                             <div class="rows">
585                                 <h4>Details from supplier ([% request.backend | html %])</h4>
586                                 [% FOREACH meta IN request.metadata %]
587                                     <div class="requestmeta-[% meta.key.replace('\s','_') | html %]">
588                                         <span class="label">[% meta.key | html %]:</span>
589                                         [% meta.value | html %]
590                                     </div>
591                                 [% END %]
592                             </div>
593                         </div>
594                     </div>
595
596                     <div id="dataPreview" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="dataPreviewLabel" aria-hidden="true">
597                         <div class="modal-dialog">
598                             <div class="modal-content">
599                                 <div class="modal-header">
600                                     <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
601                                     <h3 id="dataPreviewLabel"> Supplier metadata</h3>
602                                 </div>
603                                 <div class="modal-body">
604                                     <div id="requestattributes">
605                                         [% FOREACH attr IN request.illrequestattributes %]
606                                         <div class="requestattr-[% attr.type | html %]">
607                                             <span class="label">[% attr.type | html %]:</span>
608                                             [% attr.value | html %]
609                                         </div>
610                                             [% END %]
611                                     </div>
612                                 </div>
613                                 <div class="modal-footer">
614                                     <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
615                                 </div>
616                             </div>
617                         </div>
618                     </div>
619
620                     <div id="ill-view-panel" class="panel panel-default">
621                         <div class="panel-heading">
622                             <h3>[% request.illcomments.count | html %] comments</h3>
623                         </div>
624                         <div class="panel-body">
625                             [% IF request.illcomments.count && request.illcomments.count > 0 %]
626                                 [% FOREACH comment IN request.illcomments %]
627                                     <div class="rows comment_[% comment.patron.categorycode | html %]">
628                                     <h5>Comment by:
629                                     <a href="[% borrowerlink | uri %]" title="View borrower details">
630                                     [% comment.patron.firstname _ " " _ comment.patron.surname _ " [" _ comment.patron.cardnumber _ "]" | html %]</a>
631                                     [% comment.timestamp | $KohaDates with_hours => 1 %]</h5>
632                                     <p>[% comment.comment | html %]</p>
633                                     </div>
634                                 [% END %]
635                             [% END %]
636                                 <div class="rows">
637                                     <h3><a id="toggle_addcomment" href="#">Add comment</a></h3>
638                                     <div id="addcomment" class="content_hidden">
639                                         <form class="validated" method="post" action="/cgi-bin/koha/ill/ill-requests.pl">
640                                             <input type="hidden" value="save_comment" name="method">
641                                             <input type="hidden" value="[% csrf_token | html %]" name="csrf_token">
642                                             <input type="hidden" value="[% request.illrequest_id | html %]" name="illrequest_id">
643                                             <fieldset class="rows">
644                                                 <ol>
645                                                     <li>
646                                                         <label class="required" for="comment">Comment: </label>
647                                                         <textarea type="text" class="required" required="required" value="" cols="80" rows="10" id="comment" name="comment"></textarea>
648                                                         <span class="required">Required</span>
649                                                     </li>
650                                                 </ol>
651                                             </fieldset>
652                                             <fieldset class="action">
653                                                 <input type="submit" value="Submit">
654                                             </fieldset>
655                                         </form>
656                                     </div>
657                                 </div>
658                             </div>
659                     </div>
660
661                 [% ELSIF query_type == 'illlist' %]
662                     <!-- illlist -->
663                     <h1>View ILL requests</h1>
664                     <div id="results">
665                         <h3>Details for all requests</h3>
666
667                         <table id="ill-requests">
668                             <thead>
669                                 <tr id="illview-header">
670                                     <th>Author</th>
671                                     <th>Title</th>
672                                     <th>Patron</th>
673                                     <th>Bibliographic record ID</th>
674                                     <th>Library</th>
675                                     <th>Status</th>
676                                     <th>Updated on</th>
677                                     <th>Request number</th>
678                                     <th>Comments</th>
679                                     <th class="actions"></th>
680                                 </tr>
681                             </thead>
682                             <tbody id="illview-body">
683                             </tbody>
684                         </table>
685                     </div>
686                 [% ELSE %]
687                 <!-- Custom Backend Action -->
688                 [% PROCESS $whole.template %]
689
690                 [% END %]
691         [% END %]
692             </div>
693         </div>
694     </div>
695 </div>
696
697 [% TRY %]
698 [% PROCESS backend_jsinclude %]
699 [% CATCH %]
700 [% END %]
701
702 [% INCLUDE 'intranet-bottom.inc' %]