synch'ing 2.0.0 branch (RC4 tag) 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
7 <span style="font-size:2em; text-align:left;">MARC search</span>
8
9 <center>
10 <form name="f" method="post">
11
12 <input type="hidden" name="op" value="do_search">
13 <input type="hidden" name="type" value="intranet">
14 <input type="hidden" name="nbstatements" value="<!-- TMPL_VAR NAME="nbstatements" -->">
15
16         <table border=0 cellspacing=0 cellpadding=2 width="100%">
17                 <tr align="center">
18                         <td>
19                                 <div name="sql">
20                                 <textarea name="sql" rows=5 cols=60 disabled readonly></textarea>
21                                 </div>
22                         </td>
23                         <td bgcolor="#ad11ad" valign="top" align="left">
24                                 <span style="color:#FFFFFF;">
25                                         <b>HELP :</b><br/>
26                                         Build your request using MARC fields and subfields. Add criteria lets you add another criteria to your search. Search commits the request and displays the results.
27                                 </span>
28                         </td>
29                 </tr>
30         </table>
31         <table border=0 cellspacing=0 cellpadding=2 width="100%">
32                 <!-- TMPL_LOOP NAME="statements" -->
33                 <tr>
34                         <td>
35                                 <!-- TMPL_IF NAME="first" -->
36                                         <input type="hidden" name="and_or" value="">&nbsp;
37                                 <!-- TMPL_ELSE -->
38                                         <select name="and_or" size="1" onchange="sql_update()">
39                                                 <option value="and">and</option>
40                                                 <option <!-- TMPL_IF NAME="or" -->selected <!-- /TMPL_IF -->value="or">or</option>
41                                         </select>
42                                 <!-- /TMPL_IF -->
43                         </td>
44                         <td><!-- TMPL_VAR name="marclist" --></td>
45                         <td>
46                                 <select name="excluding" size="1" onchange="sql_update()">
47                                         <option value="0"> </option>
48                                         <option <!-- TMPL_IF NAME="not" -->selected <!-- /TMPL_IF -->value="1">not</option>
49                                 </select>
50                         </td>
51                         <td>
52                                 <select name="operator" size="1" onchange="sql_update()">
53                                         <option <!-- TMPL_IF NAME="contains" -->selected<!-- /TMPL_IF --> value="contains">Contains</option>
54                                         <option <!-- TMPL_IF NAME="eq" -->selected<!-- /TMPL_IF --> value="=">Is equal to</option>
55                                         <option <!-- TMPL_IF NAME="start" -->selected<!-- /TMPL_IF --> value="start">Starts with</option>
56                                         <option <!-- TMPL_IF NAME="gt" -->selected<!-- /TMPL_IF --> value=">">Is greater than</option>
57                                         <option <!-- TMPL_IF NAME="ge" -->selected<!-- /TMPL_IF --> value=">=">Is greater or equal to</option>
58                                         <option <!-- TMPL_IF NAME="lt" -->selected<!-- /TMPL_IF --> value="<">Is lower than</option>
59                                         <option <!-- TMPL_IF NAME="le" -->selected<!-- /TMPL_IF --> value="<=">Is lower or equal to</option>
60                                 </select>
61                         </td>
62                         <td><input type="text" name="value" onChange="sql_update()" <!-- TMPL_IF NAME="value" -->value="<!-- TMPL_VAR NAME="value" -->"<!-- /TMPL_IF -->></td>
63                 </tr>
64                 <!-- /TMPL_LOOP -->
65         </table>
66         <br>
67
68         <table width="90%">
69         <tr>
70         <td align="left" width="33%"><input type="button" value="Add criteria" onClick="AddStatement()" class="button"></td>
71         <td align="middle" width="33%"><input type="submit" value="Start search" class="button"></td>
72         <td align="right" width="33%">Results per page :
73                 <select align="right" name="resultsperpage" size="1">
74                         <option value="20">20</option>
75                         <option value="50">50</option>
76                         <option value="100">100</option>
77                 </select>
78         </td>
79         </tr>
80         </table>
81 </form>
82 </center>
83
84 <script>
85 function sql_update() {
86 document.f.sql.value="";
87         for (i=0 ; i<document.f.marclist.length ; i++) {
88                 if (document.f.marclist[i].value != '') {
89                         document.f.sql.value = document.f.sql.value+
90                                                                                 document.f.and_or[i].value + ' (' +
91                                                                                 document.f.excluding[i].value + ' ' +
92                                                                                 document.f.marclist[i].value + ' ' +
93                                                                                 document.f.operator[i].value + ' ' +
94                                                                                 '\''+document.f.value[i].value + '\') ';
95                 }
96         }
97 }
98
99 function AddStatement() {
100
101         document.forms[0].op.value="AddStatement";
102         document.f.submit();
103 }
104
105 </script>
106 <!-- TMPL_IF NAME="opac" -->
107     <!-- TMPL_INCLUDE NAME="opac-bottom.inc" -->
108 <!-- TMPL_ELSE -->
109     <!-- TMPL_INCLUDE NAME="cat-bottom.inc" -->
110 <!-- /TMPL_IF -->
111