Bug 26032: Add 'is new' filter in items search
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / catalogue / itemsearch.tt
blob06c1ed8723a7c8996029ba8ab1236cb46fa7aa20
1 [% USE raw %]
2 [% USE To %]
3 [% USE Asset %]
4 [% USE AuthorisedValues %]
6 [%- BLOCK form_label -%]
7   [%- SWITCH label -%]
8     [%- CASE 'barcode' %]<span>Barcode</span>
9     [%- CASE 'itemcallnumber' %]<span>Call number</span>
10     [%- CASE 'stocknumber' %]<span>Inventory number</span>
11     [%- CASE 'title' %]<span>Title</span>
12     [%- CASE 'author' %]<span>Author</span>
13     [%- CASE 'publishercode' %]<span>Publisher</span>
14     [%- CASE 'publicationyear' %]<span>Publication date</span>
15     [%- CASE 'collectiontitle' %]<span>Collection title</span>
16     [%- CASE 'isbn' %]<span>ISBN</span>
17     [%- CASE 'issn' %]<span>ISSN</span>
18     [%- CASE 'homebranch' %]<span>Home library</span>
19     [%- CASE 'holdingbranch' %]<span>Current library</span>
20     [%- CASE 'All libraries' %]<span>All libraries</span>
21     [%- CASE 'location' %]<span>Shelving location</span>
22     [%- CASE 'All locations' %]<span>All locations</span>
23     [%- CASE 'itype' %]<span>Item type</span>
24     [%- CASE 'All item types' %]<span>All item types</span>
25     [%- CASE 'ccode' %]<span>Collection</span>
26     [%- CASE 'All collection codes' %]<span>All collections</span>
27     [%- CASE 'notforloan' %]<span>Status</span>
28     [%- CASE 'All statuses' %]<span>All statuses</span>
29     [%- CASE 'damaged' %]<span>Damaged</span>
30     [%- CASE 'itemlost' %]<span>Lost</span>
31     [%- CASE 'withdrawn' %]<span>Withdrawn</span>
32     [%- CASE 'new_status' %]<span>Is new</span>
33   [%- END -%]
34 [%- END -%]
36 [% BLOCK form_field_select %]
37   <div class="form-field form-field-select">
38     <label class="form-field-label" for="[% name | html %]">[% INCLUDE form_label label=name %]</label>
39     <select id="[% name | html %]_op" name="[% name | html %]_op">
40       <option value="=">is</option>
41       <option value="!=" >is not</option>
42     </select>
43     <select id="[% name | html %]" name="[% name | html %]" multiple="multiple" size="[% options.size < 4 ? options.size + 1 : 4 | html %]">
44       <option value="" selected="selected">
45         [% IF (empty_option) %][% INCLUDE form_label label=empty_option %][% ELSE %]<span>All</span>[% END %]
46       </option>
47       [% FOREACH option IN options %]
48         <option value="[% option.value | html %]">[% option.label | html %]</option>
49       [% END %]
50     </select>
51   </div>
52 [% END %]
54 [% BLOCK form_field_select_option %]
55   <option value="[% value | html %]">[% INCLUDE form_label label=value %]</option>
56 [% END %]
58 [% BLOCK form_field_select_text %]
59   <div class="form-field form-field-select-text">
60     <select name="c" class="form-field-conjunction" disabled="disabled">
61       <option value="and">AND</option>
62       <option value="or">OR</option>
63     </select>
64     <select name="f" class="form-field-column">
65       [% INCLUDE form_field_select_option value='barcode' %]
66       [% INCLUDE form_field_select_option value='itemcallnumber' %]
67       [% INCLUDE form_field_select_option value='stocknumber' %]
68       [% INCLUDE form_field_select_option value='title' %]
69       [% INCLUDE form_field_select_option value='author' %]
70       [% INCLUDE form_field_select_option value='publishercode' %]
71       [% INCLUDE form_field_select_option value='publicationyear' %]
72       [% INCLUDE form_field_select_option value='collectiontitle' %]
73       [% INCLUDE form_field_select_option value='isbn' %]
74       [% INCLUDE form_field_select_option value='issn' %]
75       [% IF items_search_fields.size %]
76         <optgroup label="Custom search fields">
77           [% FOREACH field IN items_search_fields %]
78             [% marcfield = field.tagfield %]
79             [% IF field.tagsubfield.defined AND field.tagsubfield != "" %]
80               [% marcfield = marcfield _ '$' _ field.tagsubfield %]
81             [% END %]
82             <option value="marc:[% marcfield | html %]" data-authorised-values-category="[% field.authorised_values_category | html %]">[% field.label | html %] ([% marcfield | html %])</option>
83           [% END %]
84         </optgroup>
85       [% END %]
86     </select>
87     <input type="text" name="q" class="form-field-value" value="" />
88     <input type="hidden" name="op" value="like" />
89   </div>
90 [% END %]
92 [% BLOCK form_field_radio_yes_no %]
93   <div class="form-field">
94     <label class="form-field-label">[% INCLUDE form_label label=name %]:</label>
95     <input type="radio" name="[% name | html %]" id="[% name | html %]_indifferent" value="" checked="checked"/>
96     <label for="[% name | html %]_indifferent">Ignore</label>
97     <input type="radio" name="[% name | html %]" id="[% name | html %]_yes" value="yes" />
98     <label for="[% name | html %]_yes">Yes</label>
99     <input type="radio" name="[% name | html %]" id="[% name | html %]_no" value="no" />
100     <label for="[% name | html %]_no">No</label>
101   </div>
102 [% END %]
104 [%# We need to escape html characters for 'value' and 'label' %]
105 [%- BLOCK escape_html_value_label -%]
106     [%- SET escaped = [] -%]
107     [%- FOR e IN elts -%]
108         [%- value = BLOCK %][% e.value | html %][% END -%]
109         [%- label = BLOCK %][% e.label | html %][% END -%]
110         [%- escaped.push({ 'value' => value, 'label' => label }) -%]
111     [%- END -%]
112     [%- To.json(escaped) | $raw -%]
113 [%- END -%]
115 [% notforloans = AuthorisedValues.GetDescriptionsByKohaField({ kohafield = 'items.notforloan' }) %]
116 [% FOREACH nfl IN notforloans %]
117     [% nfl.value = nfl.authorised_value %]
118     [% nfl.label = nfl.lib %]
119 [% END %]
121 [% locations = AuthorisedValues.GetDescriptionsByKohaField({ kohafield = 'items.location' }) %]
122 [% FOREACH loc IN locations %]
123     [% loc.value = loc.authorised_value %]
124     [% loc.label = loc.lib %]
125 [% END %]
127 [%# Page starts here %]
129 [% SET footerjs = 1 %]
130 [% INCLUDE 'doc-head-open.inc' %]
131   <title>Koha &rsaquo; Catalog &rsaquo; Item search</title>
132   [% INCLUDE 'doc-head-close.inc' %]
133   [% Asset.css("css/itemsearchform.css") | $raw %]
134 </head>
136 <body id="catalog_itemsearch" class="catalog">
137   [% INCLUDE 'header.inc' %]
138   [% INCLUDE 'home-search.inc' %]
139   <div id="breadcrumbs">
140     <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a> &rsaquo; Item search
141   </div>
143 <div class="main container-fluid">
144     <div class="row">
145         <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
147     <div id="item-search-block">
148       <h1>Item search</h1>
149       <p><a href="/cgi-bin/koha/catalogue/search.pl">Go to advanced search</a></p>
150       <form action="/cgi-bin/koha/catalogue/itemsearch.pl" method="get" id="itemsearchform">
151           <div id="toolbar" class="btn-toolbar">
152               <fieldset class="action">
153                   <div class="btn-group">
154                       <button class="btn btn-default"><i class="fa fa-search"></i> Search</button>
155                   </div>
156               </fieldset>
157           </div>
158           <fieldset>
159             [% INCLUDE form_field_select name="homebranch" options = branches empty_option = "All libraries" %]
160             [% INCLUDE form_field_select name="holdingbranch" options = branches empty_option = "All libraries" %]
161             [% IF locations.size %]
162                 [% INCLUDE form_field_select name="location" options = locations empty_option = "All locations" %]
163             [% END %]
164           </fieldset>
165           <fieldset>
166             [% INCLUDE form_field_select name="itype" options = itemtypes empty_option = "All item types" %]
167             [% IF ccodes.size %]
168                 [% INCLUDE form_field_select name="ccode" options = ccodes empty_option = "All collection codes" %]
169             [% END %]
170             [% IF notforloans.size %]
171                 [% INCLUDE form_field_select name="notforloan" options = notforloans empty_option = "All statuses" %]
172             [% END %]
173             [% IF itemlosts.size %]
174                 [% INCLUDE form_field_select name="itemlost" options = itemlosts empty_option = "All statuses" %]
175             [% END %]
176             [% IF withdrawns.size %]
177                 [% INCLUDE form_field_select name="withdrawn" options = withdrawns empty_option = "All statuses" %]
178             [% END %]
179           </fieldset>
180           <fieldset>
181             [% INCLUDE form_field_select_text %]
182             <p class="hint">You can use the following wildcard characters: % _</p>
183             <p class="hint">% matches any number of characters</p>
184             <p class="hint">_ matches only a single character</p>
185           </fieldset>
186           <fieldset>
187             <div class="form-field">
188               <label class="form-field-label" for="itemcallnumber_from">From call number:</label>
189               <input type="text" id="itemcallnumber_from" name="itemcallnumber_from" value="" />
190               <span class="hint">(inclusive)</span>
191             </div>
192             <div class="form-field">
193               <label class="form-field-label" for="itemcallnumber_to">To call number:</label>
194               <input type="text" id="itemcallnumber_to" name="itemcallnumber_to" value="" />
195               <span class="hint">(inclusive)</span>
196             </div>
197             [% INCLUDE form_field_radio_yes_no name="damaged" %]
198             [% INCLUDE form_field_radio_yes_no name="new_status" %]
199             <div class="form-field">
200               <label class="form-field-label" for="issues_op">Checkout count:</label>
201               <select id="issues_op" name="issues_op">
202                 <option value=">">&gt;</option>
203                 <option value="<">&lt;</option>
204                 <option value="=">=</option>
205                 <option value="!=">!=</option>
206               </select>
207               <input type="text" name="issues" />
208             </div>
209             <div class="form-field">
210               <label class="form-field-label" for="datelastborrowed_op">Last checkout date:</label>
211               <select id="datelastborrowed_op" name="datelastborrowed_op">
212                 <option value=">">After</option>
213                 <option value="<">Before</option>
214                 <option value="=">On</option>
215               </select>
216               <input type="text" name="datelastborrowed" />
217               <span class="hint">ISO Format (YYYY-MM-DD)</span>
218             </div>
219           </fieldset>
220           <fieldset>
221             <div class="form-field-radio">
222               <label>Output:</label>
223               <input type="radio" id="format-html" name="format" value="html" checked="checked" /> <label for="format-html">Screen</label>
224               <input type="radio" id="format-csv" name="format" value="csv" /> <label for="format-csv">CSV</label>
225               <input type="radio" id="format-barcodes" name="format" value="barcodes"/> <label for="format-barcodes">Barcodes file</label>
226             </div>
227           </fieldset>
228       </form>
229     </div>
230     </div>
231   </div>
232     <div class="row">
233         <div class="col-md-12">
234       <div id="results-wrapper"></div>
235         </div>
236       </div>
238 [% MACRO jsinclude BLOCK %]
239     [% INCLUDE 'datatables.inc' %]
240     [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
241     [% Asset.js("lib/hc-sticky.js") | $raw %]
242     <script>
243         var authorised_values = [% authorised_values_json | $raw %];
245         function loadAuthorisedValuesSelect(select) {
246             var selected = select.find('option:selected');
247             var category = selected.data('authorised-values-category');
248             var form_field_value = select.siblings('.form-field-value');
249             if (category && category in authorised_values) {
250                 var values = authorised_values[category];
251                 var html = '<select name="q" class="form-field-value">\n';
252                 for (i in values) {
253                     var value = values[i];
254                     html += '<option value="' + value.authorised_value + '">' + value.lib + '</option>\n';
255                 }
256                 html += '</select>\n';
257                 var new_form_field_value = $(html);
258                 new_form_field_value.val(form_field_value.val());
259                 form_field_value.replaceWith(new_form_field_value);
260             } else {
261                 if (form_field_value.prop('tagName').toLowerCase() == 'select') {
262                     html = '<input name="q" type="text" class="form-field-value" />';
263                     var new_form_field_value = $(html);
264                     form_field_value.replaceWith(new_form_field_value);
265                 }
266             }
267         }
269     function addNewField( link ) {
270             var form_field = $('div.form-field-select-text').last();
271             var copy = form_field.clone(true);
272             copy.find('input,select').not('[type="hidden"]').each(function() {
273                 $(this).val('');
274             });
275             copy.find('.form-field-conjunction').prop('disabled', false).val('and');
276             form_field.after(copy);
277       link.remove();
278             copy.find('select.form-field-column').change();
279         }
281         function submitForm($form) {
282             var tr = ''
283                 + '    <tr>'
284                 + '      <th id="items_checkbox"></th>'
285                 + '      <th id="items_title">' + _("Title") + '</th>'
286                 + '      <th id="items_pubdate">' + _("Publication date") + '</th>'
287                 + '      <th id="items_publisher">' + _("Publisher") + '</th>'
288                 + '      <th id="items_collection">' + _("Collection") + '</th>'
289                 + '      <th id="items_barcode">' + _("Barcode") + '</th>'
290                 + '      <th id="items_callno">' + _("Call number") + '</th>'
291                 + '      <th id="items_homebranch">' + _("Home library") + '</th>'
292                 + '      <th id="items_holdingbranch">' + _("Current library") + '</th>'
293                 + '      <th id="items_location">' + _("Shelving location") + '</th>'
294                 + '      <th id="items_itype">' + _("Itemtype") + '</th>'
295                 + '      <th id="item_inventoryno">' + _("Inventory number") + '</th>'
296                 + '      <th id="items_status">' + _("Not for loan status") + '</th>'
297                 + '      <th id="items_itemlost">' + _("Lost status") + '</th>'
298                 + '      <th id="items_widthdrawn">' + _("Withdrawn status") + '</th>'
299                 + '      <th id="items_checkouts">' + _("Checkouts") + '</th>'
300                 + '      <th id=""></th>'
301                 + '    </tr>'
302             var table = ''
303                 + '<table id="results">'
304                 + '  <thead>' + tr + tr + '</thead>'
305                 + '  <tbody></tbody>'
306                 + '</table>';
308             var advSearchLink = $('<a>')
309                 .attr('href', '/cgi-bin/koha/catalogue/search.pl')
310                 .html(_("Go to advanced search"));
311             var editSearchLink = $('<a>')
312                 .attr('href', '#')
313                 .html(_("Edit search"))
314                 .addClass('btn btn-default btn-xs')
315                 .on('click', function(e) {
316                     e.preventDefault();
317                     $('#item-search-block').show();
318                 });
320             function getCheckedItemnumbers () {
321                 var itemnumbers;
322                 try {
323                     itemnumbers = JSON.parse(sessionStorage.getItem('itemsearch_itemnumbers') || '[]');
324                 } catch (e) {
325                     itemnumbers = [];
326                 }
328                 return new Set(itemnumbers);
329             }
331             function exportItems(format) {
332               var itemnumbers = getCheckedItemnumbers();
333               if (itemnumbers.size > 0) {
334                 var href = '/cgi-bin/koha/catalogue/item-export.pl?format=' + format;
335                 href += '&itemnumber=' + Array.from(itemnumbers).join('&itemnumber=');
336                 location = href;
337               } else {
338                 $('#format-' + format).prop('checked', true);
339                 $('#itemsearchform').submit();
340                 $('#format-html').prop('checked', true);
341               }
342             }
344             var csvExportLink = $('<a>')
345                 .attr('href', '#')
346                 .html("CSV")
347                 .on('click', function(e) {
348                     e.preventDefault();
349                     exportItems('csv');
350                 });
351             var barcodesExportLink = $('<a>')
352                 .attr('href', '#')
353                 .html(_("Barcodes file"))
354                 .on('click', function(e) {
355                     e.preventDefault();
356                     exportItems('barcodes');
357               });
359             var exportButton = $('<div>')
360               .addClass('btn-group')
361               .append($('<button>')
362                   .addClass('btn btn-default btn-xs dropdown-toggle')
363                   .attr('id', 'export-button')
364                   .attr('data-toggle', 'dropdown')
365                   .attr('aria-haspopup', 'true')
366                   .attr('aria-expanded', 'false')
367                   .html(_("Export all results to") + ' <span class="caret"></span>'))
368               .append($('<ul>')
369                   .addClass('dropdown-menu')
370                   .append($('<li>').append(csvExportLink))
371                   .append($('<li>').append(barcodesExportLink)));
373             var selectVisibleRows = $('<a>')
374               .attr('href', '#')
375               .append('<i class="fa fa-check"></i> ')
376               .append(_("Select visible rows"))
377               .on('click', function(e) {
378                   e.preventDefault();
379                   $('#results input[type="checkbox"]').prop('checked', true).change();
380               });
381             var clearSelection = $('<a>')
382               .attr('href', '#')
383               .append('<i class="fa fa-remove"></i> ')
384               .append(_("Clear selection"))
385               .on('click', function(e) {
386                   e.preventDefault();
387                   sessionStorage.setItem('itemsearch_itemnumbers', '[]');
388                   $('#results input[type="checkbox"]').prop('checked', false).change();
389               });
390             var exportLinks = $('<p>')
391               .append(selectVisibleRows)
392               .append(' ')
393               .append(clearSelection)
394               .append(' | ')
395               .append(exportButton);
397             var results_heading = $('<div>').addClass('results-heading')
398                 .append("<h1>" + _("Item search results") + "</h1>")
399                 .append($('<p>').append(advSearchLink))
400                 .append($('<p>').append(editSearchLink))
401                 .append(exportLinks);
402             $('#results-wrapper').empty()
403                 .append(results_heading)
404                 .append(table);
406             var params = [];
407             $form.find('select:not(:disabled) option:selected,input[type="text"]:not(:disabled),input[type="hidden"]:not(:disabled),input[type="radio"]:checked').each(function() {
408                 if ( $(this).prop('tagName').toLowerCase() == 'option' ) {
409                     var name = $(this).parents('select').first().attr('name');
410                     var value = $(this).val();
411                     params.push({ 'name': name, 'value': value });
412                 } else {
413                     params.push({ 'name': $(this).attr('name'), 'value': $(this).val() });
414                 }
415             });
417             $('#results').dataTable($.extend(true, {}, dataTablesDefaults, {
418                 'bDestroy': true,
419                 'bServerSide': true,
420                 'bProcessing': true,
421                 'sAjaxSource': '/cgi-bin/koha/catalogue/itemsearch.pl',
422                 'fnServerData': function(sSource, aoData, fnCallback) {
423                     aoData.push( { 'name': 'format', 'value': 'json' } );
424                     for (i in params) {
425                         aoData.push(params[i]);
426                     }
427                     $.ajax({
428                         'dataType': 'json',
429                         'type': 'POST',
430                         'url': sSource,
431                         'data': aoData,
432                         'success': function(json){
433                             fnCallback(json);
434                         }
435                     });
436                 },
437                 'sDom': '<"top pager"ilp>t<"bottom pager"ip>r',
438                 'aaSorting': [[1, 'asc']],
439                 'aoColumns': [
440                     { 'sName': 'checkbox', 'bSortable': false },
441                     { 'sName': 'title' },
442                     { 'sName': 'publicationyear' },
443                     { 'sName': 'publishercode' },
444                     { 'sName': 'ccode' },
445                     { 'sName': 'barcode' },
446                     { 'sName': 'itemcallnumber' },
447                     { 'sName': 'homebranch' },
448                     { 'sName': 'holdingbranch' },
449                     { 'sName': 'location' },
450                     { 'sName': 'itype'},
451                     { 'sName': 'stocknumber' },
452                     { 'sName': 'notforloan' },
453                     { 'sName': 'itemlost' },
454                     { 'sName': 'withdrawn' },
455                     { 'sName': 'issues' },
456                     { 'sName': 'actions', 'bSortable': false }
457                 ],
458                 "sPaginationType": "full_numbers"
459             })).columnFilter({
460                 'sPlaceHolder': 'head:after',
461                 'aoColumns': [
462                     null,
463                     { 'type': 'text' },
464                     { 'type': 'text' },
465                     { 'type': 'text' },
466                     [% IF ccodes.size %]
467                         { 'type': 'select', 'values': [% INCLUDE escape_html_value_label elts => ccodes %] },
468                     [% ELSE %]
469                         null,
470                     [% END %]
471                     { 'type': 'text' },
472                     { 'type': 'text' },
473                     { 'type': 'select', 'values': [% INCLUDE escape_html_value_label elts => branches %] },
474                     { 'type': 'select', 'values': [% INCLUDE escape_html_value_label elts => branches %] },
475                     [% IF locations.size %]
476                         { 'type': 'select', 'values': [% INCLUDE escape_html_value_label elts => locations %] },
477                     [% ELSE %]
478                         null,
479                     [% END %]
480                     [% IF itemtypes.size %]
481                         { 'type': 'select', 'values': [% INCLUDE escape_html_value_label elts => itemtypes %] },
482                     [% ELSE %]
483                         null,
484                     [% END %]
485                     { 'type': 'text' },
486                     [% IF notforloans.size %]
487                         { 'type': 'select', 'values': [% INCLUDE escape_html_value_label elts => notforloans %] },
488                     [% ELSE %]
489                         null,
490                     [% END %]
491                     [% IF itemlosts.size %]
492                         { 'type': 'select', 'values': [% INCLUDE escape_html_value_label elts => itemlosts %] },
493                     [% ELSE %]
494                         null,
495                     [% END %]
496                     [% IF withdrawns.size %]
497                         { 'type': 'select', 'values': [% INCLUDE escape_html_value_label elts => withdrawns %] },
498                     [% ELSE %]
499                         null,
500                     [% END %]
501                     { 'type': 'text' },
502                     null
503                 ]
504             });
505             $('#results').on('draw.dt', function (e, settings) {
506                 var itemnumbers = getCheckedItemnumbers();
507                 $(this).find('input[type="checkbox"][name="itemnumber"]').each(function () {
508                     var itemnumber = this.value;
509                     if (itemnumbers.has(itemnumber)) {
510                         this.checked = true;
511                     }
512                 });
513             });
515             sessionStorage.setItem('itemsearch_itemnumbers', '[]');
517             $('#results').on('change', 'input[type="checkbox"]', function() {
518               var itemnumber = this.value;
519               var itemnumbers = getCheckedItemnumbers();
520               if (this.checked) {
521                   itemnumbers.add(itemnumber);
522               } else {
523                   itemnumbers.delete(itemnumber);
524               }
525               sessionStorage.setItem('itemsearch_itemnumbers', JSON.stringify(Array.from(itemnumbers)));
527               var caret = ' <span class="caret">';
528               if (itemnumbers.size > 0) {
529                 $('#export-button').html(_("Export selected results (%s) to").format(itemnumbers.size) + caret);
530               } else {
531                 $('#export-button').html(_("Export all results to") + caret);
532               }
533             });
534         }
535         var Sticky;
536         $(document).ready(function () {
537             Sticky = $("#toolbar");
538             Sticky.hcSticky({
539                 stickTo: "#item-search-block",
540                 stickyClass: "floating"
541             });
542             // Add the "New field" link.
543             var form_field = $('div.form-field-select-text').last()
544             var NEW_FIELD = _("New field");
545       var button_field_new = $('<a href="#" class="button-field-new" title="Add a new field"><i class="fa fa-plus"></i> ' + NEW_FIELD + '</a>');
546       button_field_new.click(function(e) {
547           e.preventDefault();
548           addNewField( $(this) );
549             });
550       form_field.append(button_field_new);
552             // If a field is linked to an authorised values list, display the list.
553             $('div.form-field-select-text select[name="f"]').change(function() {
554                 loadAuthorisedValuesSelect($(this));
555             }).change();
557             // Prevent user to select the 'All ...' option with other options.
558             $('div.form-field-select').each(function() {
559                 $(this).find('select').filter(':last').change(function() {
560                     values = $(this).val();
561                     if (values.length > 1) {
562                         var idx = $.inArray('', values);
563                         if (idx != -1) {
564                             values.splice(idx, 1);
565                             $(this).val(values);
566                         }
567                     }
568                 });
569             });
571             $('#itemsearchform').submit(function() {
572                 var searchform = $(this);
573                 var format = searchform.find('input[name="format"]:checked').val();
574                 if (format == 'html') {
575                     submitForm(searchform);
576                     $("#item-search-block").hide();
577                     return false;
578                 }
579             });
580         });
581     </script>
582 [% END %]
584 [% INCLUDE 'intranet-bottom.inc' %]