2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Dictionary › Guided reports › Reports › Koha</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 <style>fieldset.rows table { clear: none; margin: 0;}</style>
8 <body id="rep_dictionary" class="rep">
9 [% INCLUDE 'header.inc' %]
10 [% INCLUDE 'circ-search.inc' %]
12 [%- BLOCK area_name -%]
14 [%- CASE 'CIRC' -%]Circulation
15 [%- CASE 'CAT' -%]Catalog
16 [%- CASE 'PAT' -%]Patrons
17 [%- CASE 'ACQ' -%]Acquisitions
18 [%- CASE 'ACC' -%]Accounts
19 [%- CASE 'SER' -%]Serials
23 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
26 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
29 <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a>
32 <a href="/cgi-bin/koha/reports/guided_reports.pl">Guided reports wizard</a>
35 [% IF ( new_dictionary ) %]
37 <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a>
40 <a href="#" aria-current="page">
41 Name the new definition
45 [% ELSIF ( step_2 ) %]
47 <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a>
50 <a href="#" aria-current="page">
51 Step 2: Choose the area
55 [% ELSIF ( step_3 ) %]
57 <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a>
60 <a href="#" aria-current="page">
61 Step 3: Choose a column
65 [% ELSIF ( step_4 ) %]
67 <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a>
70 <a href="#" aria-current="page">
71 Step 4: Specify a value
75 [% ELSIF ( step_5 ) %]
77 <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a>
80 <a href="#" aria-current="page">
81 Step 5: Confirm definition
87 <a href="#" aria-current="page">
95 <div class="main container-fluid">
97 <div class="col-sm-10 col-sm-push-2">
100 [% IF ( start_dictionary ) %]
102 <a id="newdictionary" class="btn btn-default" href="/cgi-bin/koha/reports/dictionary.pl?phase=Add%20New%20Definition"><i class="fa fa-plus"></i> New definition</a>
106 [% IF ( start_dictionary ) %]
107 <p>Use the dictionary to define custom criteria for reporting.</p>
109 [% IF ( definitions ) %]
110 <h2>Current terms</h2>
111 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
112 <input type="hidden" name="phase" value="View Dictionary" />
116 <option value="">All</option>
117 [% FOREACH area IN areas %]
118 [%- IF ( area.selected ) -%]
119 <option value="[% area.id | html %]" selected="selected">[%- PROCESS area_name area=area.id -%]</option>
121 <option value="[% area.id | html %]">[%- PROCESS area_name area=area.id -%]</option>
125 <input name="submit" value="Go" type="submit" />
137 [% FOREACH definition IN definitions %]
139 <td>[% definition.name | html %]</td>
140 <td>[% definition.description | html %]</td>
141 <td>[% definition.areaname | html %]</td>
142 <td>[% definition.saved_sql | html %]</td>
143 <td class="actions"><form method="post" action="/cgi-bin/koha/reports/dictionary.pl">
144 <input type="hidden" name="id" value="[% definition.id | html %]" />
145 <input type="hidden" name="phase" value="Delete Definition" />
146 <button type="submit" name="submit" class="btn btn-default btn-xs" id="delete"><i class="fa fa-trash"></i> Delete</button>
152 <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>
156 [% IF ( new_dictionary ) %]
157 <h3>Add new definition</h3>
158 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
159 <fieldset class="rows"><legend>Step 1 of 5: Name the new definition</legend><ol>
161 <label for="definition_name">Definition name:</label>
162 <input type="text" id="definition_name" name="definition_name" />
165 <label for="definition_description">Definition description:</label>
166 <textarea name="definition_description" id="definition_description" rows="3" cols="20"></textarea>
170 <fieldset class="action"><input type="hidden" name="phase" value="New Term step 2" />
171 <input name="submit" value="Next" type="submit" /></fieldset>
175 [%- IF ( step_2 ) -%]
176 <h3>Add new definition</h3>
177 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
178 <fieldset class="rows">
179 <legend>Step 2 of 5: Choose the area</legend>
182 <input type="hidden" name="phase" value="New Term step 3" />
183 <input type="hidden" name="definition_name" value="[% definition_name | html %]" />
184 <input type="hidden" name="definition_description" value="[% definition_description | html %]" />
185 <label for="area">Select table:</label><select name="area" id="area">
186 [%- FOREACH area IN areas -%]
187 <option value="[%- area.id | html -%]">[%- PROCESS area_name area=area.id -%]</option>
193 <fieldset class="action"><input name="submit" value="Next" type="submit" /></fieldset>
198 <h3>Add new definition</h3>
199 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
200 <fieldset class="rows">
201 <legend>Step 3 of 5: Choose a column</legend>
202 <input type="hidden" name="area" value="[% area | html %]" />
203 <input type="hidden" name="definition_name" value="[% definition_name | html %]" />
204 <input type="hidden" name="definition_description" value="[% definition_description | html %]" />
206 <select id="availableColumns" name="columns" size="25" style="width:200px;height:300px;margin:1em;">
207 [% FOREACH column IN columns %]
208 [% IF ( column.table ) %]
209 [% IF ( loop.first ) %]
214 <optgroup label="[% column.table | html %]">
216 <option value="[% column.name | html %]">
217 [% IF ( column.description ) %][% column.description | html %]
219 [% column.name | html %]
227 <input type="hidden" name="phase" value="New Term step 4" />
229 <fieldset class="action"><input type="submit" name="submit" value="Next" /></fieldset>
234 <h3>Add new definition</h3>
235 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
236 <fieldset class="rows">
237 <legend>Step 4 of 5: Specify a value</legend>
238 <input type="hidden" name="area" value="[% area | html %]" />
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 | html %]" />
243 [% FOREACH column IN columns %]
244 <input type="hidden" name="criteria_column" value="[% column.name | html %]" />
245 <ol><li><span class="label">Column: </span> [% column.name | html %]</li>
246 [% IF ( column.distinct ) %]
247 <li><label for="[% column.name | html %]_value">Choose: </label> <select id="[% column.name | html %]_value" name="[% column.name | html %]_value">
248 [% FOREACH value IN column.values %]
249 <option value="[% value.availablevalues | html %]">[% value.availablevalues | html %]</option>
253 [% IF ( column.date ) %]
255 <label for="all_dates">All dates</label>
256 <input type="radio" id="all_dates" name="[% column.name | html %]_date_type_value" value="all" checked="checked" />
257 <label for="date_range">Date range</label>
258 <input type="radio" id="date_range" name="[% column.name | html %]_date_type_value" value="range" />
262 <input type="text" size="10" id="from" name="[% column.name | html %]_start_value" value="" class="flatpickr" data-date_to="to" />
263 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
265 <input type="text" size="10" id="to" name="[% column.name | html %]_end_value" value="" class="flatpickr" />
266 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
269 [% IF ( column.text ) %]
270 <li><label for="[% column.name | html %]_value">Search string matches: </label> <input type="text" size="13" name="[% column.name | html %]_value" /></li>
275 <input type="hidden" name="phase" value="New Term step 5" />
277 <fieldset class="action">
278 <input type="submit" name="submit" value="Next" />
284 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
285 <input type="hidden" name="area" value="[% area | html %]" />
286 <input type="hidden" name="definition_name" value="[% definition_name | html %]" />
287 <input type="hidden" name="definition_description" value="[% definition_description | html %]" />
288 <input type="hidden" name="columnstring" value="[% columnstring | html %]" />
290 <h3>Add new definition</h3>
292 <fieldset class="rows">
293 <legend>Step 5 of 5: Confirm details</legend>
296 <span class="label">Name:</span>[%- definition_name | html -%]
299 <span class="label">Description:</span>[%- definition_description | html -%]
302 <span class="label">Area:</span>[%- PROCESS area_name area=area -%]
305 <span class="label">Data:</span>
311 [%- FOREACH criteria_loo IN criteria_loop -%]
313 <td>[%- criteria_loo.name | html -%]</td>
314 <td>[%- criteria_loo.value | html -%]</td>
322 <fieldset class="action"><input type="hidden" name="sql" value="[% query | html %]" />
323 <input type="hidden" name="phase" value="New Term step 6" />
324 <input type="submit" name="submit" value="Save" /> </fieldset>
330 </div> <!-- /.col-sm-10.col-sm-push-2 -->
332 <div class="col-sm-2 col-sm-pull-10">
334 [% INCLUDE 'guided-reports-view.inc' %]
336 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
337 </div> <!-- /.row -->
339 [% MACRO jsinclude BLOCK %]
340 [% INCLUDE 'calendar.inc' %]
342 var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this dictionary definition? This cannot be undone.");
344 $(document).ready(function() {
345 $("#delete").on("click",function(){
346 return confirmDelete(MSG_CONFIRM_DELETE);
349 $("#date_range").change(function(){
350 $("input#from").parents('li').show();
352 $("#all_dates").change(function(){
353 $("input#from").parents('li').hide();
355 $("#all_dates").click().change();
360 [% INCLUDE 'intranet-bottom.inc' %]