Bug 20941: (follow-up) Update N/A handling
[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                                 [% type = request.get_type %]
428                                 <li class="borrowernumber">
429                                     <label for="borrowernumber">Patron ID:</label>
430                                     [% request.borrowernumber | html %]
431                                 </li>
432                                 <li class="biblio_id">
433                                     <label for="biblio_id" class="biblio_id">Bibliographic record ID:</label>
434                                     <input name="biblio_id" id="biblio_id" type="text" value="[% request.biblio_id | html %]">
435                                 </li>
436                                 <li class="branchcode">
437                                     <label for="library" class="branchcode">Library:</label>
438                                     <select name="branchcode" id="library">
439                                         [% PROCESS options_for_libraries libraries => Branches.all( selected => request.branchcode ) %]
440                                     </select>
441                                 </li>
442                                 <li class="status">
443                                     <label class="status">Status:</label>
444                                     [% stat = request.status %]
445                                     [% request.capabilities.$stat.name | html %]
446                                 </li>
447                                 <li class="updated">
448                                     <label class="updated">Last updated:</label>
449                                     [% request.updated | $KohaDates with_hours => 1 | html %]
450                                 </li>
451                                 <li class="medium">
452                                     <label class="medium">Request type:</label>
453                                     [% IF type %][% type | html %][% ELSE %]<span>N/A</span>[% END %]
454                                 </li>
455                                 <li class="cost">
456                                     <label class="cost">Cost:</label>
457                                     [% IF request.cost %][% request.cost | html %][% ELSE %]<span>N/A</span>[% END %]
458                                 </li>
459                                 <li class="price_paid">
460                                     <label class="price_paid">Price paid:</label>
461                                     <input name="price_paid" id="price_paid" type="text" value="[% request.price_paid | html %]">
462                                 </li>
463                                 <li class="req_id">
464                                     <label class="req_id">Request number:</label>
465                                     [% request.id_prefix _ request.illrequest_id | html %]
466                                 </li>
467                                 <li class="notesstaff">
468                                     <label for="notesstaff" class="notesstaff">Staff notes:</label>
469                                     <textarea name="notesstaff" id="notesstaff" rows="5">[% request.notesstaff | html %]</textarea>
470                                 </li>
471                                 <li class="notesopac">
472                                     <label for="notesopac" class="notesopac">Opac notes:</label>
473                                     <textarea name="notesopac" id="notesopac" rows="5">[% request.notesopac | html %]</textarea>
474                                 </li>
475                             </ol>
476                         </fieldset>
477                         <fieldset class="action">
478                             <input type="hidden" value="edit_action" name="method">
479                             <input type="hidden" value="form" name="stage">
480                             <input type="hidden" value="[% request.illrequest_id | html %]" name="illrequest_id">
481                             <input type="hidden" value="[% request.borrowernumber | html %]" name="borrowernumber">
482                             <input type="submit" value="Submit">
483                             <a class="cancel" href="/cgi-bin/koha/ill/ill-requests.pl?method=illview&amp;illrequest_id=[% request.id | html %]">Cancel</a>
484                         </fieldset>
485                     </form>
486
487                 [% ELSIF query_type == 'delete_confirm' %]
488
489                     <div class="dialog alert">
490                         <h3>Are you sure you wish to delete this request?</h3>
491                         <form action="/cgi-bin/koha/ill/ill-requests.pl" method="post">
492                             <input type="hidden" name="method" value="delete" />
493                             <input type="hidden" name="confirmed" value="1" />
494                             <input type="hidden" name="illrequest_id" value="[% request.id | html %]" />
495                             <button type="submit" class="btn btn-default btn-sm approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
496                         </form>
497                         <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>
498                     </div>
499
500                 [% ELSIF query_type == 'illview' %]
501                     [% req_status = request.status %]
502                     <h1>Manage ILL request</h1>
503                     <div id="toolbar" class="btn-toolbar">
504                         <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 %]">
505                         <span class="fa fa-pencil"></span>
506                         Edit request
507                         </a>
508                         [% FOREACH action IN request.available_actions %]
509                             [% IF action.method != 0 %]
510                                 <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 %]">
511                                 <span class="fa [% action.ui_method_icon | html %]"></span>
512                                 [% action.ui_method_name | html %]
513                                 </a>
514                             [% END %]
515                         [% END %]
516                         <a title="Display supplier metadata" id="ill-request-display-metadata" class="btn btn-sm btn-default pull-right" href="#">
517                             <span class="fa fa-eye"></span>
518                             Display supplier metadata
519                         </a>
520                     </div>
521                     <div id="ill-view-panel" class="panel panel-default">
522                         <div class="panel-heading">
523                             <h3>Request details</h3>
524                         </div>
525                         <div class="panel-body">
526                             <h4>Details from library</h4>
527                             <div class="rows">
528                                 <div class="orderid">
529                                     <span class="label orderid">Order ID:</span>
530                                     [% IF request.orderid %][% request.orderid | html %][% ELSE %]<span>N/A</span>[% END %]
531                                 </div>
532                                 <div class="borrowernumber">
533                                     <span class="label borrowernumber">Patron:</span>
534                                     [% borrowerlink = "/cgi-bin/koha/members/moremember.pl" _ "?borrowernumber=" _ request.patron.borrowernumber %]
535                                     <a href="[% borrowerlink | uri %]" title="View borrower details">
536                                     [% request.patron.firstname _ " " _ request.patron.surname _ " [" _ request.patron.cardnumber _ "]" | html %]
537                                     </a>
538                                 </div>
539
540                                 <div class="biblio_id">
541                                     <span class="label biblio_id">Bibliographic record ID:</span>
542                                     [% IF request.biblio_id %]
543                                         <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% request.biblio_id | uri %]">[% request.biblio_id | html %]</a>
544                                     [% ELSE %]
545                                         <span>N/A</span>
546                                     [% END %]
547                                 </div>
548                                 <div class="branchcode">
549                                     <span class="label branchcode">Library:</span>
550                                     [% Branches.GetName(request.branchcode) | html %]
551                                 </div>
552                                 <div class="status">
553                                     <span class="label status">Status:</span>
554                                     [% request.capabilities.$req_status.name | html %]
555                                 </div>
556                                 <div class="updated">
557                                     <span class="label updated">Last updated:</span>
558                                     [% request.updated | $KohaDates with_hours => 1 | html %]
559                                 </div>
560                                 <div class="medium">
561                                     <span class="label medium">Request type:</span>
562                                     [% type = request.get_type %]
563                                     [% IF type %][% type | html %][% ELSE %]<span>N/A</span>[% END %]
564                                 </div>
565                                 <div class="cost">
566                                     <span class="label cost">Cost:</span>
567                                     [% IF request.cost %][% request.cost | html %][% ELSE %]<span>N/A</span>[% END %]
568                                 </div>
569                                 <div class="price_paid">
570                                     <span class="label price_paid">Price paid:</span>
571                                     [% IF request.price_paid %][% request.price_paid | html %][% ELSE %]<span>N/A</span>[% END %]
572                                 </div>
573                                 <div class="req_id">
574                                     <span class="label req_id">Request number:</span>
575                                     [% request.id_prefix _ request.illrequest_id | html %]
576                                 </div>
577                                 <div class="notesstaff">
578                                     <span class="label notes_staff">Staff notes:</span>
579                                     <pre>[% request.notesstaff | html %]</pre>
580                                 </div>
581                                 <div class="notesopac">
582                                     <span class="label notes_opac">Notes:</span>
583                                     <pre>[% request.notesopac | html %]</pre>
584                                 </div>
585                             </div>
586                             <div class="rows">
587                                 <h4>Details from supplier ([% request.backend | html %])</h4>
588                                 [% FOREACH meta IN request.metadata %]
589                                     <div class="requestmeta-[% meta.key.replace('\s','_') | html %]">
590                                         <span class="label">[% meta.key | html %]:</span>
591                                         [% meta.value | html %]
592                                     </div>
593                                 [% END %]
594                             </div>
595                         </div>
596                     </div>
597
598                     <div id="dataPreview" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="dataPreviewLabel" aria-hidden="true">
599                         <div class="modal-dialog">
600                             <div class="modal-content">
601                                 <div class="modal-header">
602                                     <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
603                                     <h3 id="dataPreviewLabel"> Supplier metadata</h3>
604                                 </div>
605                                 <div class="modal-body">
606                                     <div id="requestattributes">
607                                         [% FOREACH attr IN request.illrequestattributes %]
608                                         <div class="requestattr-[% attr.type | html %]">
609                                             <span class="label">[% attr.type | html %]:</span>
610                                             [% attr.value | html %]
611                                         </div>
612                                             [% END %]
613                                     </div>
614                                 </div>
615                                 <div class="modal-footer">
616                                     <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
617                                 </div>
618                             </div>
619                         </div>
620                     </div>
621
622                     <div id="ill-view-panel" class="panel panel-default">
623                         <div class="panel-heading">
624                             <h3>[% request.illcomments.count | html %] comments</h3>
625                         </div>
626                         <div class="panel-body">
627                             [% IF request.illcomments.count && request.illcomments.count > 0 %]
628                                 [% FOREACH comment IN request.illcomments %]
629                                     <div class="rows comment_[% comment.patron.categorycode | html %]">
630                                     <h5>Comment by:
631                                     <a href="[% borrowerlink | uri %]" title="View borrower details">
632                                     [% comment.patron.firstname _ " " _ comment.patron.surname _ " [" _ comment.patron.cardnumber _ "]" | html %]</a>
633                                     [% comment.timestamp | $KohaDates with_hours => 1 %]</h5>
634                                     <p>[% comment.comment | html %]</p>
635                                     </div>
636                                 [% END %]
637                             [% END %]
638                                 <div class="rows">
639                                     <h3><a id="toggle_addcomment" href="#">Add comment</a></h3>
640                                     <div id="addcomment" class="content_hidden">
641                                         <form class="validated" method="post" action="/cgi-bin/koha/ill/ill-requests.pl">
642                                             <input type="hidden" value="save_comment" name="method">
643                                             <input type="hidden" value="[% csrf_token | html %]" name="csrf_token">
644                                             <input type="hidden" value="[% request.illrequest_id | html %]" name="illrequest_id">
645                                             <fieldset class="rows">
646                                                 <ol>
647                                                     <li>
648                                                         <label class="required" for="comment">Comment: </label>
649                                                         <textarea type="text" class="required" required="required" value="" cols="80" rows="10" id="comment" name="comment"></textarea>
650                                                         <span class="required">Required</span>
651                                                     </li>
652                                                 </ol>
653                                             </fieldset>
654                                             <fieldset class="action">
655                                                 <input type="submit" value="Submit">
656                                             </fieldset>
657                                         </form>
658                                     </div>
659                                 </div>
660                             </div>
661                     </div>
662
663                 [% ELSIF query_type == 'illlist' %]
664                     <!-- illlist -->
665                     <h1>View ILL requests</h1>
666                     <div id="results">
667                         <h3>Details for all requests</h3>
668
669                         <table id="ill-requests">
670                             <thead>
671                                 <tr id="illview-header">
672                                     <th>Author</th>
673                                     <th>Title</th>
674                                     <th>Patron</th>
675                                     <th>Bibliographic record ID</th>
676                                     <th>Library</th>
677                                     <th>Status</th>
678                                     <th>Updated on</th>
679                                     <th>Request number</th>
680                                     <th>Comments</th>
681                                     <th class="actions"></th>
682                                 </tr>
683                             </thead>
684                             <tbody id="illview-body">
685                             </tbody>
686                         </table>
687                     </div>
688                 [% ELSE %]
689                 <!-- Custom Backend Action -->
690                 [% PROCESS $whole.template %]
691
692                 [% END %]
693         [% END %]
694             </div>
695         </div>
696     </div>
697 </div>
698
699 [% TRY %]
700 [% PROCESS backend_jsinclude %]
701 [% CATCH %]
702 [% END %]
703
704 [% INCLUDE 'intranet-bottom.inc' %]