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 [% WRAPPER 'header.inc' %]
10 [% INCLUDE 'circ-search.inc' %]
13 [%- BLOCK area_name -%]
15 [%- CASE 'CIRC' -%]<span>Circulation</span>
16 [%- CASE 'CAT' -%]<span>Catalog</span>
17 [%- CASE 'PAT' -%]<span>Patrons</span>
18 [%- CASE 'ACQ' -%]<span>Acquisitions</span>
19 [%- CASE 'ACC' -%]<span>Accounts</span>
20 [%- CASE 'SER' -%]<span>Serials</span>
24 [% WRAPPER 'sub-header.inc' %]
25 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
28 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
31 <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a>
34 <a href="/cgi-bin/koha/reports/guided_reports.pl">Guided reports wizard</a>
37 [% IF ( new_dictionary ) %]
39 <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a>
42 <a href="#" aria-current="page">
43 Name the new definition
47 [% ELSIF ( step_2 ) %]
49 <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a>
52 <a href="#" aria-current="page">
53 Step 2: Choose the area
57 [% ELSIF ( step_3 ) %]
59 <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a>
62 <a href="#" aria-current="page">
63 Step 3: Choose a column
67 [% ELSIF ( step_4 ) %]
69 <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a>
72 <a href="#" aria-current="page">
73 Step 4: Specify a value
77 [% ELSIF ( step_5 ) %]
79 <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a>
82 <a href="#" aria-current="page">
83 Step 5: Confirm definition
89 <a href="#" aria-current="page">
98 <div class="main container-fluid">
100 <div class="col-sm-10 col-sm-push-2">
103 [% IF ( start_dictionary ) %]
105 <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>
109 [% IF ( start_dictionary ) %]
110 <p>Use the dictionary to define custom criteria for reporting.</p>
112 [% IF ( definitions ) %]
113 <h2>Current terms</h2>
114 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
115 <input type="hidden" name="phase" value="View Dictionary" />
119 <option value="">All</option>
120 [% FOREACH area IN areas %]
121 [%- IF ( area.selected ) -%]
122 <option value="[% area.id | html %]" selected="selected">[%- PROCESS area_name area=area.id -%]</option>
124 <option value="[% area.id | html %]">[%- PROCESS area_name area=area.id -%]</option>
128 <input type="submit" name="submit" class="btn btn-primary" value="Go" />
140 [% FOREACH definition IN definitions %]
142 <td>[% definition.name | html %]</td>
143 <td>[% definition.description | html %]</td>
144 <td>[% definition.areaname | html %]</td>
145 <td>[% definition.saved_sql | html %]</td>
146 <td class="actions"><form method="post" action="/cgi-bin/koha/reports/dictionary.pl">
147 <input type="hidden" name="id" value="[% definition.id | html %]" />
148 <input type="hidden" name="phase" value="Delete Definition" />
149 <button type="submit" name="submit" class="btn btn-default btn-xs" id="delete"><i class="fa fa-trash"></i> Delete</button>
155 <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>
159 [% IF ( new_dictionary ) %]
160 <h3>Add new definition</h3>
161 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
162 <fieldset class="rows"><legend>Step 1 of 5: Name the new definition</legend><ol>
164 <label for="definition_name">Definition name:</label>
165 <input type="text" id="definition_name" name="definition_name" />
168 <label for="definition_description">Definition description:</label>
169 <textarea name="definition_description" id="definition_description" rows="3" cols="20"></textarea>
173 <fieldset class="action"><input type="hidden" name="phase" value="New Term step 2" />
174 <input type="submit" name="submit" class="btn btn-primary" value="Next" /></fieldset>
178 [%- IF ( step_2 ) -%]
179 <h3>Add new definition</h3>
180 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
181 <fieldset class="rows">
182 <legend>Step 2 of 5: Choose the area</legend>
185 <input type="hidden" name="phase" value="New Term step 3" />
186 <input type="hidden" name="definition_name" value="[% definition_name | html %]" />
187 <input type="hidden" name="definition_description" value="[% definition_description | html %]" />
188 <label for="area">Select table:</label><select name="area" id="area">
189 [%- FOREACH area IN areas -%]
190 <option value="[%- area.id | html -%]">[%- PROCESS area_name area=area.id -%]</option>
196 <fieldset class="action"><input type="submit" name="submit" class="btn btn-primary" value="Next" /></fieldset>
201 <h3>Add new definition</h3>
202 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
203 <fieldset class="rows">
204 <legend>Step 3 of 5: Choose a column</legend>
205 <input type="hidden" name="area" value="[% area | html %]" />
206 <input type="hidden" name="definition_name" value="[% definition_name | html %]" />
207 <input type="hidden" name="definition_description" value="[% definition_description | html %]" />
209 <select id="availableColumns" name="columns" size="25" style="width:200px;height:300px;margin:1em;">
210 [% FOREACH column IN columns %]
211 [% IF ( column.table ) %]
212 [% IF ( loop.first ) %]
217 <optgroup label="[% column.table | html %]">
219 <option value="[% column.name | html %]">
220 [% IF ( column.description ) %][% column.description | html %]
222 [% column.name | html %]
230 <input type="hidden" name="phase" value="New Term step 4" />
232 <fieldset class="action"><input type="submit" name="submit" class="btn btn-primary" value="Next" /></fieldset>
237 <h3>Add new definition</h3>
238 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
239 <fieldset class="rows">
240 <legend>Step 4 of 5: Specify a value</legend>
241 <input type="hidden" name="area" value="[% area | html %]" />
242 <input type="hidden" name="definition_name" value="[% definition_name | html %]" />
243 <input type="hidden" name="definition_description" value="[% definition_description | html %]" />
244 <input type="hidden" name="columnstring" value="[% columnstring | html %]" />
246 [% FOREACH column IN columns %]
247 <input type="hidden" name="criteria_column" value="[% column.name | html %]" />
248 <ol><li><span class="label">Column: </span> [% column.name | html %]</li>
249 [% IF ( column.distinct ) %]
250 <li><label for="[% column.name | html %]_value">Choose: </label> <select id="[% column.name | html %]_value" name="[% column.name | html %]_value">
251 [% FOREACH value IN column.values %]
252 <option value="[% value.availablevalues | html %]">[% value.availablevalues | html %]</option>
256 [% IF ( column.date ) %]
258 <label for="all_dates">All dates</label>
259 <input type="radio" id="all_dates" name="[% column.name | html %]_date_type_value" value="all" checked="checked" />
260 <label for="date_range">Date range</label>
261 <input type="radio" id="date_range" name="[% column.name | html %]_date_type_value" value="range" />
265 <input type="text" size="10" id="from" name="[% column.name | html %]_start_value" value="" class="flatpickr" data-date_to="to" />
266 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
268 <input type="text" size="10" id="to" name="[% column.name | html %]_end_value" value="" class="flatpickr" />
269 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
272 [% IF ( column.text ) %]
273 <li><label for="[% column.name | html %]_value">Search string matches: </label> <input type="text" size="13" name="[% column.name | html %]_value" /></li>
278 <input type="hidden" name="phase" value="New Term step 5" />
280 <fieldset class="action">
281 <input type="submit" name="submit" class="btn btn-primary" value="Next" />
287 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
288 <input type="hidden" name="area" value="[% area | html %]" />
289 <input type="hidden" name="definition_name" value="[% definition_name | html %]" />
290 <input type="hidden" name="definition_description" value="[% definition_description | html %]" />
291 <input type="hidden" name="columnstring" value="[% columnstring | html %]" />
293 <h3>Add new definition</h3>
295 <fieldset class="rows">
296 <legend>Step 5 of 5: Confirm details</legend>
299 <span class="label">Name:</span>[%- definition_name | html -%]
302 <span class="label">Description:</span>[%- definition_description | html -%]
305 <span class="label">Area:</span>[%- PROCESS area_name area=area -%]
308 <span class="label">Data:</span>
314 [%- FOREACH criteria_loo IN criteria_loop -%]
316 <td>[%- criteria_loo.name | html -%]</td>
317 <td>[%- criteria_loo.value | html -%]</td>
325 <fieldset class="action"><input type="hidden" name="sql" value="[% query | html %]" />
326 <input type="hidden" name="phase" value="New Term step 6" />
327 <input type="submit" name="submit" class="btn btn-primary" value="Save" /> </fieldset>
333 </div> <!-- /.col-sm-10.col-sm-push-2 -->
335 <div class="col-sm-2 col-sm-pull-10">
337 [% INCLUDE 'guided-reports-view.inc' %]
339 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
340 </div> <!-- /.row -->
342 [% MACRO jsinclude BLOCK %]
343 [% INCLUDE 'calendar.inc' %]
345 var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this dictionary definition? This cannot be undone.");
347 $(document).ready(function() {
348 $("#delete").on("click",function(){
349 return confirmDelete(MSG_CONFIRM_DELETE);
352 $("#date_range").change(function(){
353 $("input#from").parents('li').show();
355 $("#all_dates").change(function(){
356 $("input#from").parents('li').hide();
358 $("#all_dates").click().change();
363 [% INCLUDE 'intranet-bottom.inc' %]