MARC authority management (1st draft. works really poorly)
[koha.git] / koha-tmpl / intranet-tmpl / default / en / authorities / authorities-home.tmpl
1     <!-- TMPL_INCLUDE NAME="auth-top.inc" -->
2 <div id="mainbloc">
3
4 <h1 class="authority">Authority search</h1>
5
6 <form name="f" method="post">
7         <input type="hidden" name="op" value="do_search">
8         <input type="hidden" name="type" value="intranet">
9         <input type="hidden" name="nbstatements" value="<!-- TMPL_VAR NAME="nbstatements" -->">
10         <div id="bloc25">
11                 <h2 class="authority">Search on</h2>
12                 <p>
13                         <label class="label20">Keyword</label>
14                         <input type="hidden" name="marclist" value="">
15                         <input type="hidden" name="and_or" value="and">
16                         <input type="hidden" name="excluding" value="">
17                         <input type="hidden" name="operator" value="contains">
18                         <input type="text" name="value" onchange="sql_update()">
19                 </p>
20                 <p>
21                         <label class="label20">Title</label>
22                         <input type="hidden" name="marclist" value="biblio.title">
23                         <input type="hidden" name="and_or" value="and">
24                         <input type="hidden" name="excluding" value="">
25                         <input type="hidden" name="operator" value="contains">
26                         <input type="text" name="value" onchange="sql_update()">
27                 </p>
28                 <p>
29                         <label class="label20">author</label> <input type="hidden" name="marclist" value="biblio.author">
30                         <input type="hidden" name="and_or" value="and">
31                         <input type="hidden" name="excluding" value="">
32                         <input type="hidden" name="operator" value="contains">
33                         <input type="text" name="value" onchange="sql_update()">
34                 </p>
35         <p>
36                                 <label class="label20">barcode</label>
37                                 <input type="hidden" name="marclist" value="items.barcode">
38                                 <input type="hidden" name="and_or" value="and">
39                                 <input type="hidden" name="excluding" value="">
40                                 <input type="hidden" name="operator" value="contains">
41                                 <input type="text" name="value" onchange="sql_update()">
42         </p>
43         </div>
44         <div id="bloc25">
45                 <h2 class="authority">Search on</h2>
46                 <p>
47                         <label class="label20">Illustrator</label>
48                         <input type="hidden" name="marclist" value="biblioitems.illus">
49                         <input type="hidden" name="and_or" value="and">
50                         <input type="hidden" name="excluding" value="">
51                         <input type="hidden" name="operator" value="contains">
52                         <input type="text" name="value" onchange="sql_update()">
53                 </p>
54                 <p>
55                         <label class="label20">Dewey</label><input type="hidden" name="marclist" value="biblioitems.dewey">
56                         <input type="hidden" name="and_or" value="and">
57                         <input type="hidden" name="excluding" value="">
58                         <input type="hidden" name="operator" value="contains">
59                         <input type="text" name="value" onchange="sql_update()">
60                 </p>
61                 <p>
62                         <label class="label20">Item Type</label> <input type="hidden" name="marclist" value="biblioitems.itemtype">
63                         <input type="hidden" name="and_or" value="and">
64                         <input type="hidden" name="excluding" value="">
65                         <input type="hidden" name="operator" value="=">
66                         <!-- TMPL_VAR name="CGIitemtype" -->
67                 </p>
68                                                 <p>
69                                 <label class="label20">branch</label>
70                                 <input type="hidden" name="marclist" value="items.holdingbranch">
71                                 <input type="hidden" name="and_or" value="and">
72                                 <input type="hidden" name="excluding" value="">
73                                 <input type="hidden" name="operator" value="=">
74                                 <!-- TMPL_VAR name="CGIbranch" -->
75         </p>
76
77         </div>
78         <div id="bloc100">
79                 <h2 class="authority">More fields</h2>
80                 <!-- TMPL_LOOP NAME="statements" -->
81                         <p>
82                                 <select name="and_or" size="1" onchange="sql_update()">
83                                         <option value="and">and</option>
84                                         <option <!-- TMPL_IF NAME="or" -->selected <!-- /TMPL_IF -->value="or">or</option>
85                                 </select>
86                                 <!-- TMPL_VAR name="marclist" -->
87                                 <select name="excluding" size="1" onchange="sql_update()">
88                                         <option value="0"> </option>
89                                         <option <!-- TMPL_IF NAME="not" -->selected <!-- /TMPL_IF -->value="1">not</option>
90                                 </select>
91                                 <select name="operator" size="1" onchange="sql_update()">
92                                         <option <!-- TMPL_IF NAME="contains" -->selected<!-- /TMPL_IF --> value="contains">Contains</option>
93                                         <option <!-- TMPL_IF NAME="eq" -->selected<!-- /TMPL_IF --> value="=">Is equal to</option>
94                                         <option <!-- TMPL_IF NAME="start" -->selected<!-- /TMPL_IF --> value="start">Starts with</option>
95                                         <option <!-- TMPL_IF NAME="gt" -->selected<!-- /TMPL_IF --> value=">">Is greater than</option>
96                                         <option <!-- TMPL_IF NAME="ge" -->selected<!-- /TMPL_IF --> value=">=">Is greater or equal to</option>
97                                         <option <!-- TMPL_IF NAME="lt" -->selected<!-- /TMPL_IF --> value="<">Is lower than</option>
98                                         <option <!-- TMPL_IF NAME="le" -->selected<!-- /TMPL_IF --> value="<=">Is lower or equal to</option>
99                                 </select>
100                                 <input type="text" name="value" onChange="sql_update()" <!-- TMPL_IF NAME="value" -->value="<!-- TMPL_VAR NAME="value" -->"<!-- /TMPL_IF -->>
101                         </p>
102                 <!-- /TMPL_LOOP -->
103                 <p>
104                 <input type="button authority" value="Add criteria" onClick="AddStatement()" class="button authority">
105                 </p>
106                 Warning : the "contains" statement does NOT work if you enter 2 or less letters
107         </div>
108         <div id="bloc25">
109                 <p>
110                         <div name="sql">
111                                 <textarea name="sql" rows=3 cols=70 disabled readonly></textarea>
112                         </div>
113                 </p>
114                 <p>Results per page :
115                         <select align="right" name="resultsperpage" size="1">
116                                 <option value="20">20</option>
117                                 <option value="50">50</option>
118                                 <option value="100">100</option>
119                         </select>
120                 Ordered by
121                         <select name="orderby" size="1">
122                                 <option value="biblio.title">Title</option>
123                                 <option value="biblio.author">Author</option>
124                                 <option value="biblioitems.dewey">Dewey</option>
125                                 <option value="biblioitems.publicationyear">Publication Year</option>
126                                 <option value="biblioitems.publishercode">Publisher</option>
127                         </select>
128                 </p>
129                 <p>
130                         <input type="submit" value="Start search" class="button authority">
131                         <a href="javascript:PopupSuggestion()" class="button authority">Suggestions</a>
132                 </p>
133         </div>
134 </form>
135
136 <script>
137 function sql_update() {
138 document.f.sql.value="";
139         for (i=0 ; i<document.f.marclist.length ; i++) {
140                 if (document.f.value[i].value.length>0) {
141                         document.f.sql.value = document.f.sql.value+
142                                                                                 document.f.and_or[i].value + ' (' +
143                                                                                 document.f.excluding[i].value + ' ' +
144                                                                                 document.f.marclist[i].value + ' ' +
145                                                                                 document.f.operator[i].value + ' ' +
146                                                                                 '\''+document.f.value[i].value + '\') ';
147                 }
148         }
149 }
150
151 function AddStatement() {
152
153         document.forms[0].op.value="AddStatement";
154         document.f.submit();
155 }
156
157 function PopupSuggestion() {
158     var strQuery="";
159         for (i=0 ; i<document.f.marclist.length ; i++) {
160                 if (document.f.value[i].value.length>0) {
161                     strQuery += " "+document.f.value[i].value;
162                 }
163         }
164         newin=window.open("suggest.pl?Q="+strQuery,"Suggestions",'width=500,height=400,toolbar=false,scrollbars=yes');
165 }
166
167 </script>
168 </div>
169 <!-- TMPL_INCLUDE NAME="auth-bottom.inc" -->
170