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