big commit, still breaking things...
[koha.git] / koha-tmpl / intranet-tmpl / default / en / search.marc / search.tmpl
1 <!-- TMPL_IF NAME="opac" -->
2     <!-- TMPL_INCLUDE NAME="opac-top.inc" -->
3 <!-- TMPL_ELSE -->
4     <!-- TMPL_INCLUDE NAME="cat-top.inc" -->
5 <!-- /TMPL_IF -->
6 <div id="mainbloc">
7
8 <h1 class="catalogue">Catalogue search</h1>
9
10 <form name="f" method="post" action="/cgi-bin/koha/search.marc/search.pl">
11         <input type="hidden" name="op" value="do_search">
12         <input type="hidden" name="type" value="intranet">
13         <input type="hidden" name="nbstatements" value="<!-- TMPL_VAR NAME="nbstatements" -->">
14         <div class="bloc25">
15                 <h2 class="catalogue">Search on</h2>
16                 <p>
17                         <input type="hidden" name="op" value="do_search">
18                         <input type="hidden" name="nbstatements" value="<!-- TMPL_VAR NAME="nbstatements" -->">
19                         <label for="keyword">Any word</label>
20                         <input type="hidden" name="marclist" value="">
21                         <input type="hidden" name="and_or" value="and">
22                         <input type="hidden" name="excluding" value="">
23                         <input type="hidden" name="operator" value="contains">
24                         <input type="text" name="value" id="keyword" onchange="sql_update()" size="35">
25                 </p>
26                 <p>
27                         <label for="title">Title</label>
28                         <input type="hidden" name="marclist" value="biblio.title">
29                         <input type="hidden" name="and_or" value="and">
30                         <input type="hidden" name="excluding" value="">
31                         <input type="hidden" name="operator" value="contains">
32                         <input type="text" name="value" id="title" onchange="sql_update()" size="35">
33                         <!-- TMPL_UNLESS Name="Disable_Dictionary" -->
34                                 <a href="javascript:Dopop('dictionary.pl?marclist=biblio.title&amp;type=intranet&amp;index=1',1)" class="button catalogue">
35                                         ...
36                                 </a>
37                         <!-- /TMPL_UNLESS -->
38                 </p>
39                 <p>
40                         <label for="author">Author</label> <input type="hidden" name="marclist" value="biblio.author">
41                         <input type="hidden" name="and_or" value="and">
42                         <input type="hidden" name="excluding" value="">
43                         <input type="hidden" name="operator" value="contains">
44                         <input type="text" name="value" id="author" onchange="sql_update()" size="35">
45                         <!-- TMPL_UNLESS Name="Disable_Dictionary" -->
46                                 <a href="javascript:Dopop('dictionary.pl?marclist=biblio.author&amp;type=intranet&amp;index=2',2)" class="button catalogue">
47                                         ...
48                                 </a>
49                         <!-- /TMPL_UNLESS -->
50                 </p>
51                 <p>
52                         <label for="subject">Subject</label>
53                         <input type="hidden" name="marclist" value="bibliosubject.subject">
54                         <input type="hidden" name="and_or" value="and">
55                         <input type="hidden" name="excluding" value="">
56                         <input type="hidden" name="operator" value="contains">  
57                         <input type="text" name="value" id="subject" onchange="sql_update()" size="35">
58                         <!-- TMPL_UNLESS Name="Disable_Dictionary" -->
59                                 <a href="javascript:Dopop('dictionary.pl?marclist=bibliosubject.subject&amp;type=intranet&amp;index=3',3)" class="button catalogue">
60                                         ...
61                                 </a>
62                         <!-- /TMPL_UNLESS -->
63                 </p>
64                 <p>
65                         <label for="itemtype">Item Type</label>
66                         <input type="hidden" name="marclist" value="biblioitems.itemtype">
67                         <input type="hidden" name="and_or" value="and">
68                         <input type="hidden" name="excluding" value="">
69                         <input type="hidden" name="operator" value="=">
70                         <!-- TMPL_VAR name="CGIitemtype" -->
71                 </p>
72                 <p>
73                                 <label for="branch">Branch</label>
74                                 <input type="hidden" name="marclist" value="items.holdingbranch">
75                                 <input type="hidden" name="and_or" value="and">
76                                 <input type="hidden" name="excluding" value="">
77                                 <input type="hidden" name="operator" value="=">  
78                                 <select name="branch">
79                                         <option value="">Default</option>
80                                 <!-- TMPL_LOOP name="branchloop" -->
81                                         <option value="<!-- TMPL_VAR name="value" -->" <!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR name="branchname" --></option>
82                                 <!-- /TMPL_LOOP -->
83                                 </select>
84                 </p>
85         </div>
86         <div class="bloc25">
87                 <h2 class="catalogue">Other options</h2>
88                 <p>
89                                 <label for="barcode">Item barcode</label>
90                                 <input type="hidden" name="marclist" value="items.barcode">
91                                 <input type="hidden" name="and_or" value="and">
92                                 <input type="hidden" name="excluding" value="">
93                                 <input type="hidden" name="operator" value="contains">
94                                 <input type="text" name="value" id="barcode" onchange="sql_update()"> 
95                 </p>
96                 <p>
97                         <label for="callno">Call Number</label>
98                         <input type="hidden" name="marclist" value="items.itemcallnumber">
99                         <input type="hidden" name="and_or" value="and">
100                         <input type="hidden" name="excluding" value="">
101                         <input type="hidden" name="operator" value="start">
102                         <input type="text" name="value" id="callno" onchange="sql_update()">
103                 </p>
104                 <p>
105                         <label for="isbn">ISBN</label>
106                         <input type="hidden" name="marclist" value="biblioitems.isbn">
107                         <input type="hidden" name="and_or" value="and">
108                         <input type="hidden" name="excluding" value="">
109                         <input type="hidden" name="operator" value="=">
110                         <input type="text" name="value" id="isbn" onchange="sql_update()">
111                 </p>
112                 <p>
113                         <label for="publisher">Publisher</label>
114                         <input type="hidden" name="marclist" value="biblioitems.publishercode">
115                         <input type="hidden" name="and_or" value="and">
116                         <input type="hidden" name="excluding" value="">
117                         <input type="hidden" name="operator" value="contains">
118                         <input type="text" name="value" id="publisher" onchange="sql_update()">
119                 </p>
120         </div>
121         <div id="bloc100">
122                 <h2 class="catalogue">More fields</h2>
123                 <!-- TMPL_LOOP NAME="statements" -->
124                         <p>
125                                 <select name="and_or" size="1" onchange="sql_update()">
126                                         <option value="and">and</option>
127                                         <option <!-- TMPL_IF NAME="or" -->selected <!-- /TMPL_IF -->value="or">or</option>
128                                 </select>
129                                 <!-- TMPL_VAR NAME="marclist" -->
130                                 <select name="excluding" size="1" onchange="sql_update()">
131                                         <option value="0"> </option>
132                                         <option <!-- TMPL_IF NAME="not" -->selected <!-- /TMPL_IF -->value="1">not</option>
133                                 </select>
134                                 <select name="operator" size="1" onchange="sql_update()">
135                                         <option <!-- TMPL_IF NAME="contains" -->selected<!-- /TMPL_IF --> value="contains">Contains</option>
136                                         <option <!-- TMPL_IF NAME="eq" -->selected<!-- /TMPL_IF --> value="=">Is equal to</option>
137                                         <option <!-- TMPL_IF NAME="start" -->selected<!-- /TMPL_IF --> value="start">Starts with</option>
138                                         <option <!-- TMPL_IF NAME="gt" -->selected<!-- /TMPL_IF --> value=">">Is greater than</option>
139                                         <option <!-- TMPL_IF NAME="ge" -->selected<!-- /TMPL_IF --> value=">=">Is greater or equal to</option>
140                                         <option <!-- TMPL_IF NAME="lt" -->selected<!-- /TMPL_IF --> value="<">Is lower than</option>
141                                         <option <!-- TMPL_IF NAME="le" -->selected<!-- /TMPL_IF --> value="<=">Is lower or equal to</option>
142                                 </select>
143                                 <input type="text" name="value" onChange="sql_update()" <!-- TMPL_IF NAME="value" -->value="<!-- TMPL_VAR NAME="value" -->"<!-- /TMPL_IF -->>
144                         </p>
145                 <!-- /TMPL_LOOP -->
146                 <p>
147                 <input type="button" value="Add criteria" onClick="AddStatement()" class="button catalogue">
148                 Warning : the "contains" statement does NOT work if you enter 2 or less letters</p>
149         </div>
150         <div class="bloc25">
151                 <p><textarea name="sql" rows="3" cols="70" disabled readonly></textarea></p>
152                 <p>Results per page :
153                         <select name="resultsperpage" size="1">
154                                 <option value="20">20</option>
155                                 <option value="50">50</option>
156                                 <option value="100">100</option>
157                         </select>
158                 Ordered by
159                         <select name="orderby" size="1">
160                                 <option value="biblio.title">Title</option>
161                                 <option value="biblio.author">Author</option>
162                                 <option value="biblioitems.dewey">Dewey</option>
163                                 <option value="biblioitems.publicationyear">Publication Year</option>
164                                 <option value="biblioitems.publishercode">Publisher</option>
165                         </select>
166                         <select name="desc_or_asc" size="1">
167                                 <option value="ASC">Ascending</option>
168                                 <option value="DESC">Descending</option>
169                         </select>
170                 </p>
171                 <p>
172                         <input type="submit" value="Start search" class="button catalogue">
173                         <a href="/cgi-bin/koha/search.marc/suggest.pl" onclick="PopupSuggestion(); return false;" class="button catalogue">Spelling suggestion</a>
174                 </p>
175         </div>
176 </form>
177
178 <script language="javascript" type="text/javascript">
179 function sql_update() {
180 document.f.sql.value="";
181         for (i=0 ; i<document.f.marclist.length ; i++) {
182                 if (document.f.value[i].value.length>0) {
183                         document.f.sql.value = document.f.sql.value+
184                                                                                 document.f.and_or[i].value + ' (' +
185                                                                                 document.f.excluding[i].value + ' ' +
186                                                                                 document.f.marclist[i].value + ' ' +
187                                                                                 document.f.operator[i].value + ' ' +
188                                                                                 '\''+document.f.value[i].value + '\') ';
189                 }
190         }
191 }
192
193 function AddStatement() {
194
195         document.forms['f'].op.value="AddStatement";
196         document.f.submit();
197 }
198
199 function Dopop(link,i) {
200         var searchstring=document.forms['f'].value[i].value;
201         newin=window.open(link+'&amp;search='+searchstring,"popup",'width=700,height=550,toolbar=false,scrollbars=yes');
202 }
203
204
205 function PopupSuggestion() {
206     var strQuery="";
207         for (i=0 ; i<document.f.marclist.length ; i++) {
208                 if (document.f.value[i].value.length>0) {
209                     strQuery += " "+document.f.value[i].value;
210                 }
211         }
212         newin=window.open("suggest.pl?Q="+strQuery,"Suggestions",'width=500,height=400,toolbar=false,scrollbars=yes');
213 }
214
215 </script>
216 </div>
217 <!-- TMPL_IF NAME="opac" -->
218     <!-- TMPL_INCLUDE NAME="opac-bottom.inc" -->
219 <!-- TMPL_ELSE -->
220     <!-- TMPL_INCLUDE NAME="cat-bottom.inc" -->
221 <!-- /TMPL_IF -->
222