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