Bug 12150 - Use more javascript string formatting in intranet for translated strings.
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / auth-finder-search.inc
1 [% PROCESS 'form-blocks.inc' %]
2 <script type="text/javascript">
3 //<![CDATA[
4
5 $(document).ready(function(){
6     $("#clear").on("click",function(e){
7         e.preventDefault();
8         finderjumpfull('blinddetail-biblio-search.pl?authid=0&index=[% index %]');
9     });
10     $("#createnew").on("click",function(e){
11         e.preventDefault();
12         finderjumpfull('authorities.pl?index=[% index %]&authtypecode=[% authtypecode %]');
13     });
14     // marclist
15     $( "#value_any" ).autocomplete({
16         source: function(request, response) {
17             $.ajax({
18                 url: "/cgi-bin/koha/authorities/ysearch.pl",
19                 dataType: "json",
20                 data: {
21                     authtypecode : "[% authtypecode %]",
22                     term: request.term,
23                     op: "do_search",
24                     type: "intranet",
25                     and_or: "and",
26                     operator: "contains",
27                     orderby: "HeadingAsc",
28                     querytype: "marclist"
29                 },
30                 success: function(data) {
31                     response( $.map( data, function( item ) {
32                             return {
33                                 label: item.summary,
34                                 value: item.summary
35                             }
36                         }));
37                 }
38             });
39         },
40         minLength: 3,
41     });
42     // mainentry
43     $( "#value_main" ).autocomplete({
44         source: function(request, response) {
45             $.ajax({
46                 url: "/cgi-bin/koha/authorities/ysearch.pl",
47                 dataType: "json",
48                 data: {
49                     authtypecode : "[% authtypecode %]",
50                     term: request.term,
51                     op: "do_search",
52                     type: "intranet",
53                     and_or: "and",
54                     operator: "contains",
55                     orderby: "HeadingAsc",
56                     querytype: "mainentry"
57                 },
58                 success: function(data) {
59                     response( $.map( data, function( item ) {
60                             return {
61                                 label: item.summary,
62                                 value: item.summary
63                             }
64                         }));
65                 }
66             });
67         },
68         minLength: 3,
69     });
70     // mainmainentry
71     $( "#value_mainstr" ).autocomplete({
72         source: function(request, response) {
73             $.ajax({
74                 url: "/cgi-bin/koha/authorities/ysearch.pl",
75                 dataType: "json",
76                 data: {
77                     authtypecode : "[% authtypecode %]",
78                     term: request.term,
79                     op: "do_search",
80                     type: "intranet",
81                     and_or: "and",
82                     operator: "contains",
83                     orderby: "HeadingAsc",
84                     querytype: "mainmainentry"
85                 },
86                 success: function(data) {
87                     response( $.map( data, function( item ) {
88                             return {
89                                 label: item.summary,
90                                 value: item.summary
91                             }
92                         }));
93                 }
94             });
95         },
96         minLength: 3,
97     });
98 });
99
100 function finderjumpfull(page)
101 {
102     window.open(page,'','fullscreen,scrollbars');
103 }
104
105 //]]>
106 </script>
107
108 <div id="toolbar" class="btn-toolbar">
109     <div class="btn-group"><a href="#" id="clear" class="btn btn-small"><i class="icon-remove-sign"></i> Clear field</a></div>
110     <div class="btn-group"><a href="#" id="createnew" class="btn btn-small"><i class="icon-plus"></i> Create new authority</a></div>
111 </div>
112 <form name="f" method="get" action="auth_finder.pl">
113             <input type="hidden" name="source" value="[% source %]" />
114             <input type="hidden" name="op" value="do_search" />
115             <input type="hidden" name="type" value="intranet" />
116             <input type="hidden" name="index" value="[% index %]" />
117                 <fieldset class="rows"><legend>Search options</legend>
118                 <ol><li>
119                     <span class="label">Authority type: </span>
120                     [% authtypecode %]
121                     <input type="hidden" name="authtypecode" value="[% authtypecode %]" />
122                 </li>
123                 <li>
124                     <label for="mainmainentry">Main entry ($a only): </label>
125                     <input type="hidden" name="marclist" value="mainmainentry" />
126                     <input type="hidden" name="and_or" value="and" />
127                     <input type="hidden" name="excluding" value="" />
128                     <select name="operator" id="mainmainentry">
129                         [% IF ( operator_mainstr == 'contains' ) %]
130                         <option value="contains" selected="selected">contains</option>
131                         [% ELSE %]
132                         <option value="contains">contains</option>
133                         [% END %]
134                         [% IF ( operator_mainstr == 'start' ) %]
135                         <option value="start" selected="selected">starts with</option>
136                         [% ELSE %]
137                         <option value="start">starts with</option>
138                         [% END %]
139                         [% IF ( operator_mainstr == 'is' ) %]
140                         <option value="is" selected="selected">is exactly</option>
141                         [% ELSE %]
142                         <option value="is">is exactly</option>
143                         [% END %]
144                     </select>
145                     <input id="value_mainstr" style="width:400px;" type="text" name="value_mainstr" value="[% value_mainstr |html %]" />
146                     <div id="yvaluecontainermainmainentry"></div>
147                 </li>
148
149                 <li>
150                     <label for="mainentry">Main entry: </label>
151                     <input type="hidden" name="marclist" value="mainentry" />
152                     <input type="hidden" name="and_or" value="and" />
153                     <input type="hidden" name="excluding" value="" />
154                     <select name="operator" id="mainentry">
155                         [% IF ( operator_main == 'contains' ) %]
156                         <option value="contains" selected="selected">contains</option>
157                         [% ELSE %]
158                         <option value="contains">contains</option>
159                         [% END %]
160                         [% IF ( operator_main == 'start' ) %]
161                         <option value="start" selected="selected">starts with</option>
162                         [% ELSE %]
163                         <option value="start">starts with</option>
164                         [% END %]
165                         [% IF ( operator_main == 'is' ) %]
166                         <option value="is" selected="selected">is exactly</option>
167                         [% ELSE %]
168                         <option value="is">is exactly</option>
169                         [% END %]
170                     </select>
171                     <input id="value_main" style="width:400px;" type="text" name="value_main" value="[% value_main |html %]" />
172                     <div id="yvaluecontainermainentry"></div>
173                 </li>
174
175                 <li>
176                     <label for="marclistanywhere">Anywhere: </label>
177                     <input type="hidden" name="marclist" value="any" />
178                     <input type="hidden" name="and_or" value="and" />
179                     <input type="hidden" name="excluding" value="" />
180                     <select name="operator" id="marclistanywhere">
181                         [% IF ( operator_any == 'contains' ) %]
182                         <option value="contains" selected="selected">contains</option>
183                         [% ELSE %]
184                         <option value="contains">contains</option>
185                         [% END %]
186                         [% IF ( operator_any == 'start' ) %]
187                         <option value="start" selected="selected">starts with</option>
188                         [% ELSE %]
189                         <option value="start">starts with</option>
190                         [% END %]
191                         [% IF ( operator_any == 'is' ) %]
192                         <option value="is" selected="selected">is exactly</option>
193                         [% ELSE %]
194                         <option value="is">is exactly</option>
195                         [% END %]
196                     </select>
197                     <input id="value_any" style="width:400px;" type="text" name="value_any" value="[% value_any |html %]" />
198                     <div id="yvaluecontainermarclist"></div>
199                 </li>
200                 <li>
201                     <label for="marclistheading">Heading match: </label>
202                     <input type="hidden" name="marclist" value="match" />
203                     <input type="hidden" name="and_or" value="and" />
204                     <input type="hidden" name="excluding" value="" />
205                     <select name="operator" id="marclistheading">
206                         [% IF ( operator_match == 'contains' ) %]
207                         <option value="contains" selected="selected">contains</option>
208                         [% ELSE %]
209                         <option value="contains">contains</option>
210                         [% END %]
211                         [% IF ( operator_match == 'start' ) %]
212                         <option value="start" selected="selected">starts with</option>
213                         [% ELSE %]
214                         <option value="start">starts with</option>
215                         [% END %]
216                         [% IF ( operator_match == 'is' ) %]
217                         <option value="is" selected="selected">is exactly</option>
218                         [% ELSE %]
219                         <option value="is">is exactly</option>
220                         [% END %]
221                     </select>
222                     <input type="text" name="value_match" value="[% value_match |html %]" />
223                 </li>
224         <li>
225         <label for="orderby">Sort by: </label>
226         <select name="orderby" id="orderby">
227             [% IF ( orderby == 'HeadingAsc' ) %]
228             <option value="HeadingAsc" selected="selected">Heading A-Z</option>
229             [% ELSE %]
230             <option value="HeadingAsc">Heading A-Z</option>
231             [% END %]
232             [% IF ( orderby == 'HeadingDsc' ) %]
233             <option value="HeadingDsc" selected="selected">Heading Z-A</option>
234             [% ELSE %]
235             <option value="HeadingDsc">Heading Z-A</option>
236             [% END %]
237             [% IF ( orderby == '' && op ) %]
238             <option value="" selected="selected">None</option>
239             [% ELSE %]
240             <option value="">None</option>
241             [% END %]
242         </select>
243         </li></ol></fieldset>
244         [% IF source == 'auth' %]
245         <fieldset class="rows"><legend>Relationship information</legend>
246             <ol>
247             <li>
248                 <label for="relationship">Special relationship: </label>
249                 <select name="relationship" id="relationship">
250                     [% selected=relationship %]
251                     [% PROCESS selectoptionopen value='' %]None specified</option>
252                     [% PROCESS selectoptionopen value='a' %]a - Earlier heading</option>
253                     [% PROCESS selectoptionopen value='b' %]b - Later heading</option>
254                     [% PROCESS selectoptionopen value='d' %]d - Acronym</option>
255                     [% PROCESS selectoptionopen value='f' %]f - Musical composition</option>
256                     [% PROCESS selectoptionopen value='g' %]g - Broader term</option>
257                     [% PROCESS selectoptionopen value='h' %]h - Narrower term</option>
258                     [% PROCESS selectoptionopen value='i' %]i - Reference instruction phrase in subfield $i</option>
259                     [% PROCESS selectoptionopen value='n' %]n - Not applicable</option>
260                     [% PROCESS selectoptionopen value='r' %]r - Relationship designation in $i or $4</option>
261                     [% PROCESS selectoptionopen value='t' %]t - Immediate parent body</option>
262                 </select>
263             </li>
264             </ol>
265         </fieldset>
266         [% END %]
267         <fieldset class="action"> <input type="submit" value="Search" class="submit" id="search" /> <a id="cancel" class="cancel close" href="#">Cancel</a>
268         </fieldset>
269 </form>