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