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