Bug 20538: Remove the need of writing [% KOHA_VERSION %] everywhere
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / labels / result.tt
1 [% USE Asset %]
2     [% INCLUDE 'doc-head-open.inc' %]
3     <title>Koha &rsaquo; Barcodes and labels &rsaquo; Search results</title>
4     [% INCLUDE 'doc-head-close.inc' %]
5     <style type="text/css">#custom-doc { width:46.23em;*width:45.04em;min-width:700px; margin:auto;margin-top: .4em; text-align:left; }</style>
6     [% Asset.js("lib/jquery/plugins/jquery.fixFloat.js") %]
7     <script type="text/javascript">
8         //<![CDATA[
9             $(document).ready(function(){
10                 $("#toolbar").fixFloat();
11                 $("#CheckAll").click(function(e){
12                     e.preventDefault();
13                     $("input[type='checkbox']").prop("checked",true);
14                 });
15                 $("#CheckNone").click(function(e){
16                     e.preventDefault();
17                     $("input[type='checkbox']").prop("checked",false);
18                 });
19                 $("#add_items").on("click",function(){
20                     add_item('checked',[% batch_id %],'[% type %]');
21                 });
22                 $(".select_item").on("click",function(e){
23                     e.preventDefault();
24                     var batch_id = $(this).data("batch-id");
25                     var itemnumber = $(this).data("item-number");
26                     var type = $(this).data("field-type");
27                     add_item(itemnumber, batch_id, type);
28                 });
29             });
30             function add_item(item_number,batch_id,type_id){
31                 var p = window.opener;
32                 if (item_number == 'checked') {
33                     items= new Array;
34                     if(document.resultform.action.length > 0) {
35                         for (var i=0; i < document.resultform.action.length; i++) {
36                             if (document.resultform.action[i].checked) {
37                                 p.add_item(document.resultform.action[i].value);
38                             }
39                         }
40                     } else {
41                         p.add_item(document.resultform.action.value);
42                     }
43                 }
44                 else {
45                     p.add_item(item_number);
46                 }
47             }
48             //]]>
49     </script>
50 </head>
51 <body id="labels_result" class="tools labels">
52     <div id="custom-doc" class="yui-t7">
53         <div id="bd">
54             <h1>Search results</h1>
55         <div class="results">
56                 [% IF ( displayprev || displaynext ) %]
57             <p>
58                     [% IF ( displayprev ) %]
59                     <a href="label-item-search.pl?startfrom=[% startfromprev %]&amp;ccl_query=[% ccl_query %]&amp;resultsperpage=[% resultsperpage %]&amp;op=do_search&amp;batch_id=[% batch_id %]">&lt;&lt;</a>
60                     [% END %]
61                     [% FOREACH number IN numbers %]
62                     <a href="label-item-search.pl?startfrom=[% number.startfrom %]&amp;ccl_query=[% ccl_query %]&amp;resultsperpage=[% resultsperpage %]&amp;op=do_search&amp;batch_id=[% batch_id %]">[% number.number %]</a>
63                     [% END %]
64                     [% IF ( displaynext ) %]
65                     <a href="label-item-search.pl?startfrom=[% startfromnext %]&amp;ccl_query=[% ccl_query %]&amp;resultsperpage=[% resultsperpage %]&amp;op=do_search&amp;batch_id=[% batch_id %]">&gt;&gt;</a>
66                     [% END %]
67         </p>
68                 [% END %]
69                 [% IF ( results ) %]
70                 <strong>Results [% from %] through [% to %] [% IF ( total ) %] of [% total %][% END %]</strong>
71                 [% ELSE %]
72                 No results found
73                 [% END %]
74
75             <form name="resultform" action="">
76             <div id="toolbar" class="btn-toolbar">
77                 <div class="btn-group"><button type="button" class="btn btn-default btn-sm" id="add_items"><i class="fa fa-plus"></i> Add checked</button></div>
78                 <div class="btn-group"><a href="#" class="btn btn-default btn-sm close"><i class="fa fa-times-circle"></i> Done</a></div>
79             </div>
80                 <div><a id="CheckAll" href="#"><i class="fa fa-check"></i> Select all</a> <a id="CheckNone" href="#"><i class="fa fa-remove"></i> Clear all</a></div>
81
82                 <div id="label-search-results">
83                 <input type="hidden" name="ccl_query" value="[% ccl_query %]" />
84             [% FOREACH result_se IN result_set %]
85             <div style="border-bottom:1px solid #CCC;padding:1em 0;">
86                     <h4>[% result_se.title |html %]</h4>
87                             <p>[% IF ( result_se.author ) %]by [% result_se.author %][% END %]
88                             [[% result_se.itemtype %]], [% IF ( result_se.publishercode ) %][% result_se.publishercode %] [% END %][% IF ( result_se.place ) %][% result_se.place %] [% END %][% IF ( result_se.copyrightdate ) %][% result_se.copyrightdate %], [% END %][% IF ( result_se.pages ) %][% result_se.pages %][% END %][% IF ( result_se.isbn ) %], <b>ISBN: </b>[% result_se.isbn %][% END %][% IF ( result_se.notes ) %],<br />[% result_se.notes %][% END %]</p>
89
90                     <table>
91                     [% FOREACH item_tabl IN result_se.item_table %]
92                     [% IF ( item_tabl.header_fields ) %]
93                         <thead>
94                             <tr>
95                                 [% FOREACH header_field IN item_tabl.header_fields %]
96                                     [% SWITCH header_field.field_label -%]
97                                         [% CASE "Add Item" -%]
98                                             <th>Add item</th>
99                                         [% CASE "Call Number" -%]
100                                             <th>Call number</th>
101                                         [% CASE "Accession Date" %]
102                                             <th>Accession date</th>
103                                         [% CASE "Barcode" %]
104                                             <th>Barcode</th>
105                                         [% CASE "Select" -%]
106                                             <th>Select</th>
107                                         [% CASE %]
108                                             <th>[% header_field.field_label %]</th>
109 z                                    [% END -%]
110                                 [% END %]
111                             </tr>
112                         </thead>
113                     [% ELSE %]
114                     <tr>
115                     [% FOREACH text_field IN item_tabl.text_fields %]
116                     [% IF ( text_field.select_field ) %]
117                         <td><input type="checkbox" name="action" value="[% text_field.field_value %]"></td>
118                     [% ELSIF ( text_field.link_field ) %]
119                         <td>
120                             <a class="btn btn-default btn-xs select_item" data-item-number="[% text_field.field_value %]" data-batch-id="[% batch_id %]" data-field-type="[% text_field.type %]"><i class="fa fa-plus"></i> Add</a>
121                         </td>
122                     [% ELSE %]
123                         <td>[% text_field.field_value %]</td>
124                     [% END %]
125                     [% END %]
126                     </tr>
127                     [% END %]
128                     [% END %]
129                     </table>
130                     </div>
131             [% END %]
132                 </div>
133             </form>
134         </div>
135         [% IF ( displayprev || displaynext ) %]
136             <p>
137                 [% IF ( displayprev ) %]
138                 <a href="label-item-search.pl?startfrom=[% startfromnext %]&amp;ccl_query=[% ccl_query %]&amp;resultsperpage=[% resultsperpage %]&amp;op=do_search&amp;batch_id=[% batch_id %]">&lt;&lt;</a>
139                 [% END %]
140                 [% FOREACH number IN numbers %]
141                 [% IF ( number.highlight ) %]
142                 <span class="current">[% number.number %]</span>
143                 [% ELSE %]
144                 <a href="label-item-search.pl?startfrom=[% number.startfrom %]&amp;ccl_query=[% number.ccl_query %]&amp;resultsperpage=[% number.resultsperpage %]&amp;op=do_search&amp;batch_id=[% number.batch_id %]">[% number.number %]</a>
145                 [% END %]
146         [% END %]
147                 [% IF ( displaynext ) %]
148                 <a href="label-item-search.pl?startfrom=[% startfromnext %]&amp;ccl_query=[% ccl_query %]&amp;resultsperpage=[% resultsperpage %]&amp;op=do_search&amp;batch_id=[% batch_id %]">&gt;&gt;</a>
149                 [% END %]
150         </p>
151         <div id="closewindow"><a href="#" class="btn btn-default btn-default close">Close</a></div>
152             [% END %]
153     </div>
154     [% INCLUDE 'popup-bottom.inc' %]