[SIGNED-OFF]Bug 2780 - Capitalize strings consistently (reports)
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / reports / dictionary.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Reports &rsaquo; Guided reports &rsaquo; Dictionary</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 [% INCLUDE 'calendar.inc' %]
5 <style type="text/css">fieldset.rows table { clear: none; margin: 0;}</style>
6 </head>
7 <body id="rep_dictionary" class="rep">
8 [% INCLUDE 'header.inc' %]
9 [% INCLUDE 'circ-search.inc' %]
10
11 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a> &rsaquo; <a href="/cgi-bin/koha/reports/guided_reports.pl">Guided reports wizard</a>
12 [% IF ( new_dictionary ) %] &rsaquo; <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a> &rsaquo; <strong>Name the new definition</strong>
13 [% ELSIF ( step_2 ) %] &rsaquo; <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a> &rsaquo; <strong>Step 2: Choose the area </strong> 
14 [% ELSIF ( step_3 ) %] &rsaquo; <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a> &rsaquo; <strong>Step 3: Choose columns </strong> 
15 [% ELSIF ( step_4 ) %] &rsaquo; <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a> &rsaquo; <strong>Step 4: Specify a value </strong> 
16 [% ELSIF ( step_5 ) %] &rsaquo; <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a> &rsaquo; <strong>Step 5: Confirm definition</strong> 
17 [% ELSE %]<strong> Dictionary </strong>[% END %]</div>
18
19 <div id="doc3" class="yui-t2">
20
21 <div id="bd">
22 <div id="yui-main">
23 <div class="yui-b">
24 [% IF ( start_dictionary ) %]
25 [% INCLUDE 'dictionary-toolbar.inc' %]
26 [% END %]
27 <h1>Dictionary</h1>
28 [% IF ( start_dictionary ) %]
29         <p>Use the dictionary to define custom criteria for reporting.</p>
30
31                 [% IF ( definitions ) %]
32         <h2>Current terms</h2>
33                 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
34         <input type="hidden" name="phase" value="View dictionary" />
35                 [% IF ( areas ) %]
36                         Filter by area <select name="areas">
37                         <option value="">All</option>
38                         [% FOREACH area IN areas %]
39                             [% IF ( area.selected ) %]
40                                 <option value="[% area.id %]" selected="selected" >[% area.name %]</option>
41                             [% ELSE %]
42                                 <option value="[% area.id %]">[% area.name %]</option>
43                             [% END %]
44                         [% END %]
45                         </select>
46                         <input name="submit" value="Go" type="submit" />
47                         </form>
48                         <br />
49                 [% END %]
50                 <table border="1" cellspacing="0" cellpadding="5">
51                 <tr>
52                 <th>Name</th>
53                 <th>Description</th>
54                 <th>Area</th>
55                 <th>Definition</th>
56                 <th>&nbsp;</th>
57                 </tr>
58                 [% FOREACH definition IN definitions %]
59                         [% UNLESS ( loop.odd ) %]
60                                 <tr class="highlight" valign="top">
61                         [% ELSE %]
62                                 <tr valign="top">
63                         [% END %]
64                         <td>[% definition.name %]</td>
65                         <td>[% definition.description %]</td>
66                         <td>[% definition.areaname %]</td>
67                         <td>[% definition.saved_sql %]</td>
68                         <td><form method="post" action="/cgi-bin/koha/reports/dictionary.pl">
69                         <input type="hidden" name="id" value="[% definition.id %]" />
70                         <input type="hidden" name="phase" value="Delete Definition" />
71                         <input type="submit" name="submit" value="Delete Definition" />
72                         </form></td>
73                         </tr>
74                 [% END %]
75                 </table>
76                 [% END %]
77 [% END %]
78
79 [% IF ( new_dictionary ) %]
80 <h3>Add new definition</h3>
81 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
82 <fieldset class="rows"><legend>Step 1 of 5: Name the new definition</legend><ol>
83 <li>
84 <label for="definition_name">Definition name:</label>
85 <input type="text" id="definition_name" name="definition_name" />
86 </li>
87 <li>
88 <label for="definition_description">Definition description:</label>
89 <textarea name="definition_description" id="definition_description" rows="3" cols="20"></textarea>
90 </li>
91 </ol></fieldset>
92
93 <fieldset class="action"><input type="hidden" name="phase" value="New Term step 2" />
94 <input name="submit" value="Next" type="submit" /></fieldset>
95 </form>
96 [% END %]
97
98 [% IF ( step_2 ) %]
99 <h3>Add new definition</h3>
100 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
101 <fieldset class="rows">
102 <legend>Step 2 of 5: Choose the area</legend>
103 <ol><li><input type="hidden" name="phase" value="New term step 3" />
104 <input type="hidden" name="definition_name" value="[% definition_name %]" />
105 <input type="hidden" name="definition_description" value="[% definition_description %]" />
106 <label for="areas">Select table </label><select name="areas" id="areas">
107 [% FOREACH area IN areas %]     
108 <option value="[% area.id %]">[% area.name %]</option>                  
109 [% END %]                
110 </select></li>
111 </ol>
112 </fieldset>                                                                            
113 <fieldset class="action"><input name="submit" value="Next" type="submit" /></fieldset>
114 </form>
115 [% END %]
116
117 [% IF ( step_3 ) %]
118 <h3>Add new definition</h3>
119 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">      
120 <fieldset class="rows">
121 <legend>Step 3 of 5: Choose columns</legend>
122 <input type="hidden" name="area" value="[% area %]" />
123 <input type="hidden" name="definition_name" value="[% definition_name %]" />
124 <input type="hidden" name="definition_description" value="[% definition_description %]" />
125
126 <table style="border: 0;margin:1em;"><tr>
127 <td style="border: 0;"><select id="availableColumns" name="oldcolumns2" size="25" style="width:200px;height:300px;">    
128 [% FOREACH column IN columns %]
129 [% IF ( column.table ) %]
130 [% IF ( loop.first ) %]                              
131 [% ELSE %]               
132 </optgroup>        
133 [% END %]                                                         
134
135 <optgroup label="[% column.table %]">              
136 [% ELSE %]               
137 <option value="[% column.name %]">          
138 [% IF ( column.description ) %][% column.description %]    
139 [% ELSE %]               
140 [% column.name %]                          
141 [% END %]              
142 </option>      
143 [% END %]              
144 [% END %]                
145 </optgroup>
146 </select></td>
147
148 <td style="border: 0;"><input type="button" name="Add" value="Add" class="button"  style="width : 6em; margin-bottom : .5em;" onclick="addColumn()" /><br /><input type="button" name="delete" value="&lt;&lt; Delete" class="button" style="width : 6em;"  onclick="delColumn()" />  </td>
149
150 <td style="border: 0;"><select id="selectedColumns" name="columns" size="25" style="width:200px;height:300px;"></select>     </td>   </tr></table>     
151
152 <input type="hidden" name="phase" value="New term step 4" />
153 </fieldset>
154 <fieldset class="action"><input type="submit" name="submit" value="Next" /></fieldset>
155 </form>
156 [% END %]
157
158 [% IF ( step_4 ) %]
159 <h3>Add new definition</h3>
160 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
161 <fieldset class="rows">
162 <legend>Step 4 of 5: Specify a value</legend>
163 <input type="hidden" name="area" value="[% area %]" />
164 <input type="hidden" name="definition_name" value="[% definition_name %]" />
165 <input type="hidden" name="definition_description" value="[% definition_description %]" />
166 <input type="hidden" name="columnstring" value="[% columnstring %]" />
167
168 [% FOREACH column IN columns %]
169 <input type="hidden" name="criteria_column" value="[% column.name %]" />
170 <ol><li><span class="label">Column: </span> [% column.name %]</li>
171 [% IF ( column.distinct ) %]
172         <li><label for="[% column.name %]_value">Choose: </label> <select id="[% column.name %]_value" name="[% column.name %]_value"> 
173                 [% FOREACH value IN column.values %]
174                         <option value="[% value.availablevalues %]">[% value.availablevalues %]</option>
175                 [% END %]
176         </select></li>
177 [% END %]
178 [% IF ( column.date ) %]
179         <li><span class="label">Choose: </span><table>
180         <tr valign="top">
181         <td><input type="radio" name="[% column.name %]_all" value="all" />All dates</td>
182         <td>OR</td>
183         <td><input type="radio" name="dates" value="range" />Date range<br />
184         <table>
185         <tr>
186         <td>Start of date range</td>
187         <td><input type="text" size="10" id="[% column.name %]_start_value" name="[% column.name %]_start_value" value="" />      
188         <img src="[% themelang %]/lib/calendar/cal.gif" id="buttonfrom1" style="cursor: pointer;"  />
189         <script type="text/javascript">
190         Calendar.setup({
191         inputField     : "[% column.name %]_start_value",
192         ifFormat       : "[% DHTMLcalendar_dateformat %]",
193         button         : "buttonfrom1",
194         align          : "Tl"
195         });
196         </script>
197         <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
198         </td>
199         </tr>
200         <tr>
201         <td>End of date range</td>
202         <td>
203         <input type="text" size="10" id="[% column.name %]_end_value" name="[% column.name %]_end_value" value="" />      
204         <img src="[% themelang %]/lib/calendar/cal.gif" id="buttonfrom2" style="cursor: pointer;"  />
205         <script type="text/javascript">
206         Calendar.setup({
207         inputField     : "[% column.name %]_end_value",
208         ifFormat       : "[% DHTMLcalendar_dateformat %]",
209         button         : "buttonfrom2",
210         align          : "Tl"
211         });
212         </script>
213         <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
214         </td>
215         </tr>
216         </table></td>
217         </tr>
218 </table></li>
219 [% END %]
220 [% IF ( column.text ) %]
221         <li><label for="[% column.name %]_value">Search string matches: </label> <input type="text" size="13" name="[% column.name %]_value" /></li>
222 [% END %]
223
224 [% END %]
225 </ol>
226 <input type="hidden" name="phase" value="New term step 5" />
227 </fieldset>
228 <fieldset class="action">
229 <input type="submit" name="submit" value="Next" />
230 </fieldset>
231 </form>
232 [% END %]
233
234 [% IF ( step_5 ) %]
235 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
236 <input type="hidden" name="area" value="[% area %]" />    
237 <input type="hidden" name="definition_name" value="[% definition_name %]" />           
238 <input type="hidden" name="definition_description" value="[% definition_description %]" />
239 <input type="hidden" name="columnstring" value="[% columnstring %]" />
240
241 <h3>Add new definition</h3>
242
243 <fieldset class="rows">
244 <legend>Step 5 of 5: Confirm details</legend>
245 <ol><li>
246 <span class="label">Name:</span>
247 [% definition_name %]
248 </li>
249 <li>
250 <span class="label">Description:</span>
251 [% definition_description %]
252 </li>
253 <li>
254 <span class="label">Area:</span>
255 [% areaname %]
256 </li>
257 <li>
258 <span class="label">Data:</span>
259 <table>
260 <tr>
261 <th>Columns</th>
262 <th>Values</th>
263 </tr>
264 [% FOREACH criteria_loo IN criteria_loop %]
265 <tr>
266 <td>[% criteria_loo.name %]</td>
267 <td>[% criteria_loo.value %]</td>
268 </tr>
269 [% END %]
270 </table></li></ol> </fieldset>  
271
272 <fieldset class="action"><input type="hidden" name="sql" value="[% query %]" />
273 <input type="hidden" name="phase" value="New Term step 6" />
274 <input type="submit" name="submit" value="Save" />         </fieldset>
275
276 </form>
277 [% END %]
278 </div>
279 </div>
280 <div class="yui-b">
281 [% INCLUDE 'guided-reports-view.inc' %]
282 </div>
283 </div>
284 <script type="text/javascript">                            
285 //<![CDATA[
286 function setObjects() {                    
287     selectedColumnsObj=document.getElementById('selectedColumns');           
288         availableColumnsObj=document.getElementById('availableColumns');   
289 }              
290 setObjects();                          
291
292 function addColumn() {                             
293   for (i=0;i<availableColumnsObj.length;i++) {   
294     if (availableColumnsObj.options[i].selected==true) {     
295           var newColumnObj=document.createElement("OPTION");                           
296           newColumnObj.value=availableColumnsObj.options[i].value;          
297           newColumnObj.text=availableColumnsObj.options[i].text;              
298           selectedColumnsObj.appendChild(newColumnObj);          
299           newColumnObj.selected=true;    
300         }        
301   }                        
302 }   
303
304 function delColumn() {                   
305   for (i=0;i<=selectedColumnsObj.options.length;i++) {       
306     if (selectedColumnsObj.options.selectedIndex>=0) {    
307           selectedColumnsObj.remove(selectedColumnsObj.options.selectedIndex)        
308     }  
309   }
310 }
311 //]]>
312 </script>
313
314 [% INCLUDE 'intranet-bottom.inc' %]