Bug 13618: Remove html filters at the intranet
[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 [%- BLOCK area_name -%]
12     [%- SWITCH area -%]
13         [%- CASE 'CIRC' -%]Circulation
14         [%- CASE 'CAT'  -%]Catalog
15         [%- CASE 'PAT'  -%]Patrons
16         [%- CASE 'ACQ'  -%]Acquisitions
17         [%- CASE 'ACC'  -%]Accounts
18     [%- END -%]
19 [%- END -%]
20
21 <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>
22 [% IF ( new_dictionary ) %] &rsaquo; <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a> &rsaquo; <strong>Name the new definition</strong>
23 [% ELSIF ( step_2 ) %] &rsaquo; <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a> &rsaquo; <strong>Step 2: Choose the area </strong> 
24 [% ELSIF ( step_3 ) %] &rsaquo; <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a> &rsaquo; <strong>Step 3: Choose a column </strong>
25 [% ELSIF ( step_4 ) %] &rsaquo; <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a> &rsaquo; <strong>Step 4: Specify a value </strong> 
26 [% ELSIF ( step_5 ) %] &rsaquo; <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a> &rsaquo; <strong>Step 5: Confirm definition</strong> 
27 [% ELSE %] &rsaquo; <strong> Dictionary </strong>[% END %]</div>
28
29 <div id="doc3" class="yui-t2">
30
31 <div id="bd">
32 <div id="yui-main">
33 <div class="yui-b">
34 [% IF ( start_dictionary ) %]
35     <div id="toolbar">
36         <ul class="toolbar">
37             <li><a id="newdictionary" class="btn btn-small" href="/cgi-bin/koha/reports/dictionary.pl?phase=Add%20New%20Definition"><i class="fa fa-plus"></i> New definition</a></li>
38         </ul>
39     </div>
40 [% END %]
41 <h1>Dictionary</h1>
42 [% IF ( start_dictionary ) %]
43         <p>Use the dictionary to define custom criteria for reporting.</p>
44
45                 [% IF ( definitions ) %]
46         <h2>Current terms</h2>
47                 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
48         <input type="hidden" name="phase" value="View Dictionary" />
49   [% IF ( areas ) %]
50         Filter by area
51         <select name="area">
52           <option value="">All</option>
53         [% FOREACH area IN areas %]
54           [%- IF ( area.selected ) -%]
55           <option value="[% area.id %]" selected="selected">[%- PROCESS area_name area=area.id -%]</option>
56           [%- ELSE -%]
57           <option value="[% area.id %]">[%- PROCESS area_name area=area.id -%]</option>
58           [%- END -%]
59         [% END %]
60         </select>
61       <input name="submit" value="Go" type="submit" />
62   [% END %]
63       </form>
64       <br />
65                 <table border="1" cellspacing="0" cellpadding="5">
66                 <tr>
67                 <th>Name</th>
68                 <th>Description</th>
69                 <th>Area</th>
70                 <th>Definition</th>
71                 <th>&nbsp;</th>
72                 </tr>
73                 [% FOREACH definition IN definitions %]
74                         [% UNLESS ( loop.odd ) %]
75                                 <tr class="highlight" valign="top">
76                         [% ELSE %]
77                                 <tr valign="top">
78                         [% END %]
79                         <td>[% definition.name %]</td>
80                         <td>[% definition.description %]</td>
81                         <td>[% definition.areaname %]</td>
82                         <td>[% definition.saved_sql %]</td>
83                         <td><form method="post" action="/cgi-bin/koha/reports/dictionary.pl">
84                         <input type="hidden" name="id" value="[% definition.id %]" />
85                         <input type="hidden" name="phase" value="Delete Definition" />
86                         <input type="submit" name="submit" value="Delete Definition" />
87                         </form></td>
88                         </tr>
89                 [% END %]
90                 </table>
91                 [% END %]
92 [% END %]
93
94 [% IF ( new_dictionary ) %]
95 <h3>Add new definition</h3>
96 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
97 <fieldset class="rows"><legend>Step 1 of 5: Name the new definition</legend><ol>
98 <li>
99 <label for="definition_name">Definition name:</label>
100 <input type="text" id="definition_name" name="definition_name" />
101 </li>
102 <li>
103 <label for="definition_description">Definition description:</label>
104 <textarea name="definition_description" id="definition_description" rows="3" cols="20"></textarea>
105 </li>
106 </ol></fieldset>
107
108 <fieldset class="action"><input type="hidden" name="phase" value="New Term step 2" />
109 <input name="submit" value="Next" type="submit" /></fieldset>
110 </form>
111 [% END %]
112
113 [%- IF ( step_2 ) -%]
114 <h3>Add new definition</h3>
115 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
116   <fieldset class="rows">
117     <legend>Step 2 of 5: Choose the area</legend>
118     <ol>
119       <li>
120         <input type="hidden" name="phase" value="New Term step 3" />
121         <input type="hidden" name="definition_name" value="[% definition_name %]" />
122         <input type="hidden" name="definition_description" value="[% definition_description %]" />
123         <label for="area">Select table </label><select name="area" id="area">
124       [%- FOREACH area IN areas -%]
125         <option value="[%- area.id -%]">[%- PROCESS area_name area=area.id -%]</option>
126       [%- END -%]
127         </select>
128       </li>
129     </ol>
130   </fieldset>
131   <fieldset class="action"><input name="submit" value="Next" type="submit" /></fieldset>
132 </form>
133 [%- END -%]
134
135 [% IF ( step_3 ) %]
136 <h3>Add new definition</h3>
137 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">      
138 <fieldset class="rows">
139 <legend>Step 3 of 5: Choose a column</legend>
140 <input type="hidden" name="area" value="[% area %]" />
141 <input type="hidden" name="definition_name" value="[% definition_name %]" />
142 <input type="hidden" name="definition_description" value="[% definition_description %]" />
143
144 <select id="availableColumns" name="columns" size="25" style="width:200px;height:300px;margin:1em;">
145 [% FOREACH column IN columns %]
146 [% IF ( column.table ) %]
147 [% IF ( loop.first ) %]                              
148 [% ELSE %]               
149 </optgroup>        
150 [% END %]                                                         
151
152 <optgroup label="[% column.table %]">              
153 [% ELSE %]               
154 <option value="[% column.name %]">          
155 [% IF ( column.description ) %][% column.description %]    
156 [% ELSE %]               
157 [% column.name %]                          
158 [% END %]              
159 </option>      
160 [% END %]              
161 [% END %]                
162 </optgroup>
163 </select>
164
165 <input type="hidden" name="phase" value="New Term step 4" />
166 </fieldset>
167 <fieldset class="action"><input type="submit" name="submit" value="Next" /></fieldset>
168 </form>
169 [% END %]
170
171 [% IF ( step_4 ) %]
172 <h3>Add new definition</h3>
173 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
174 <fieldset class="rows">
175 <legend>Step 4 of 5: Specify a value</legend>
176 <input type="hidden" name="area" value="[% area %]" />
177 <input type="hidden" name="definition_name" value="[% definition_name %]" />
178 <input type="hidden" name="definition_description" value="[% definition_description %]" />
179 <input type="hidden" name="columnstring" value="[% columnstring %]" />
180
181 [% FOREACH column IN columns %]
182 <input type="hidden" name="criteria_column" value="[% column.name %]" />
183 <ol><li><span class="label">Column: </span> [% column.name %]</li>
184 [% IF ( column.distinct ) %]
185         <li><label for="[% column.name %]_value">Choose: </label> <select id="[% column.name %]_value" name="[% column.name %]_value"> 
186                 [% FOREACH value IN column.values %]
187                         <option value="[% value.availablevalues %]">[% value.availablevalues %]</option>
188                 [% END %]
189         </select></li>
190 [% END %]
191 [% IF ( column.date ) %]
192     <li class="radio">
193         <label for="all_dates">All dates</label>
194         <input type="radio" id="all_dates" name="[% column.name %]_date_type_value" value="all" checked="checked" />
195         <label for="date_range">Date range</label>
196         <input type="radio" id="date_range" name="[% column.name %]_date_type_value" value="range" />
197     </li>
198     <li class="radio">
199         Start of date range
200         <input type="text" size="10" id="from" name="[% column.name %]_start_value" value="" class="datepickerfrom" />
201         <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
202         End of date range
203         <input type="text" size="10" id="to" name="[% column.name %]_end_value" value="" class="datepickerto" />
204         <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
205     </li>
206 [% END %]
207 [% IF ( column.text ) %]
208         <li><label for="[% column.name %]_value">Search string matches: </label> <input type="text" size="13" name="[% column.name %]_value" /></li>
209 [% END %]
210
211 [% END %]
212 </ol>
213 <input type="hidden" name="phase" value="New Term step 5" />
214 </fieldset>
215 <fieldset class="action">
216 <input type="submit" name="submit" value="Next" />
217 </fieldset>
218 </form>
219 [% END %]
220
221 [% IF ( step_5 ) %]
222 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
223 <input type="hidden" name="area" value="[% area %]" />    
224 <input type="hidden" name="definition_name" value="[% definition_name %]" />           
225 <input type="hidden" name="definition_description" value="[% definition_description %]" />
226 <input type="hidden" name="columnstring" value="[% columnstring %]" />
227
228 <h3>Add new definition</h3>
229
230 <fieldset class="rows">
231   <legend>Step 5 of 5: Confirm details</legend>
232   <ol>
233     <li>
234       <span class="label">Name:</span>[%- definition_name -%]
235     </li>
236     <li>
237       <span class="label">Description:</span>[%- definition_description -%]
238     </li>
239     <li>
240       <span class="label">Area:</span>[%- PROCESS area_name area=area -%]
241     </li>
242     <li>
243       <span class="label">Data:</span>
244       <table>
245         <tr>
246           <th>Columns</th>
247           <th>Values</th>
248         </tr>
249       [%- FOREACH criteria_loo IN criteria_loop -%]
250         <tr>
251           <td>[%- criteria_loo.name -%]</td>
252           <td>[%- criteria_loo.value -%]</td>
253         </tr>
254       [%- END -%]
255       </table>
256     </li>
257   </ol>
258 </fieldset>
259
260 <fieldset class="action"><input type="hidden" name="sql" value="[% query %]" />
261 <input type="hidden" name="phase" value="New Term step 6" />
262 <input type="submit" name="submit" value="Save" />         </fieldset>
263
264 </form>
265 [% END %]
266 </div>
267 </div>
268 <div class="yui-b">
269 [% INCLUDE 'guided-reports-view.inc' %]
270 </div>
271 </div>
272 [% INCLUDE 'intranet-bottom.inc' %]