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