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