2 [% PROCESS 'i18n.inc' %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>[% FILTER collapse %]
6 [% t("Dictionary") | html %] ›
7 [% t("Guided reports wizard") | html %] ›
8 [% t("Reports") | html %] ›
11 [% INCLUDE 'doc-head-close.inc' %]
12 <style>fieldset.rows table { clear: none; margin: 0;}</style>
15 <body id="rep_dictionary" class="rep">
16 [% WRAPPER 'header.inc' %]
17 [% INCLUDE 'circ-search.inc' %]
20 [%- BLOCK area_name -%]
22 [%- CASE 'CIRC' -%]<span>Circulation</span>
23 [%- CASE 'CAT' -%]<span>Catalog</span>
24 [%- CASE 'PAT' -%]<span>Patrons</span>
25 [%- CASE 'ACQ' -%]<span>Acquisitions</span>
26 [%- CASE 'ACC' -%]<span>Accounts</span>
27 [%- CASE 'SER' -%]<span>Serials</span>
31 [% WRAPPER 'sub-header.inc' %]
32 [% WRAPPER breadcrumbs %]
33 [% WRAPPER breadcrumb_item %]
34 <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a>
36 [% WRAPPER breadcrumb_item %]
37 <a href="/cgi-bin/koha/reports/guided_reports.pl">Guided reports wizard</a>
39 [% IF ( new_dictionary || step_2 || step_3 || step_4 || step_5 ) %]
40 [% WRAPPER breadcrumb_item %]
41 <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a>
44 [% IF ( new_dictionary ) %]
45 [% WRAPPER breadcrumb_item bc_active= 1 %]
46 <span>Name the new definition</span>
48 [% ELSIF ( step_2 ) %]
49 [% WRAPPER breadcrumb_item bc_active= 1 %]
50 <span>Step 2: Choose the area</span>
52 [% ELSIF ( step_3 ) %]
53 [% WRAPPER breadcrumb_item bc_active= 1 %]
54 <span>Step 3: Choose a column</span>
56 [% ELSIF ( step_4 ) %]
57 [% WRAPPER breadcrumb_item bc_active= 1 %]
58 <span>Step 4: Specify a value</span>
60 [% ELSIF ( step_5 ) %]
61 [% WRAPPER breadcrumb_item bc_active= 1 %]
62 <span>Step 5: Confirm definition</span>
65 [% WRAPPER breadcrumb_item bc_active= 1 %]
66 <span>Dictionary</span>
69 [% END #/ WRAPPER breadcrumbs %]
70 [% END #/ WRAPPER sub-header.inc %]
72 <div class="main container-fluid">
74 <div class="col-sm-10 col-sm-push-2">
77 [% IF ( start_dictionary ) %]
79 <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>
83 [% IF ( start_dictionary ) %]
84 <p>Use the dictionary to define custom criteria for reporting.</p>
86 [% IF ( definitions ) %]
87 <div class="page-section">
88 <h2>Current terms</h2>
89 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
90 <input type="hidden" name="phase" value="View Dictionary" />
94 <option value="">All</option>
95 [% FOREACH area IN areas %]
96 [%- IF ( area.selected ) -%]
97 <option value="[% area.id | html %]" selected="selected">[%- PROCESS area_name area=area.id -%]</option>
99 <option value="[% area.id | html %]">[%- PROCESS area_name area=area.id -%]</option>
103 <input type="submit" name="submit" class="btn btn-primary" value="Go" />
115 [% FOREACH definition IN definitions %]
117 <td>[% definition.name | html %]</td>
118 <td>[% definition.description | html %]</td>
119 <td>[% definition.areaname | html %]</td>
120 <td>[% definition.saved_sql | html %]</td>
121 <td class="actions"><form method="post" action="/cgi-bin/koha/reports/dictionary.pl">
122 <input type="hidden" name="id" value="[% definition.id | html %]" />
123 <input type="hidden" name="phase" value="Delete Definition" />
124 <button type="submit" name="submit" class="btn btn-default btn-xs" id="delete"><i class="fa fa-trash-can"></i> Delete</button>
129 </div> <!-- /.page-section -->
131 <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>
135 [% IF ( new_dictionary ) %]
136 <h3>Add new definition</h3>
137 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
138 <fieldset class="rows"><legend>Step 1 of 5: Name the new definition</legend><ol>
140 <label for="definition_name">Definition name:</label>
141 <input type="text" id="definition_name" name="definition_name" />
144 <label for="definition_description">Definition description:</label>
145 <textarea name="definition_description" id="definition_description" rows="3" cols="20"></textarea>
149 <fieldset class="action"><input type="hidden" name="phase" value="New Term step 2" />
150 <input type="submit" name="submit" class="btn btn-primary" value="Next" /></fieldset>
154 [%- IF ( step_2 ) -%]
155 <h3>Add new definition</h3>
156 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
157 <fieldset class="rows">
158 <legend>Step 2 of 5: Choose the area</legend>
161 <input type="hidden" name="phase" value="New Term step 3" />
162 <input type="hidden" name="definition_name" value="[% definition_name | html %]" />
163 <input type="hidden" name="definition_description" value="[% definition_description | html %]" />
164 <label for="area">Select table:</label><select name="area" id="area">
165 [%- FOREACH area IN areas -%]
166 <option value="[%- area.id | html -%]">[%- PROCESS area_name area=area.id -%]</option>
172 <fieldset class="action"><input type="submit" name="submit" class="btn btn-primary" value="Next" /></fieldset>
177 <h3>Add new definition</h3>
178 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
179 <fieldset class="rows">
180 <legend>Step 3 of 5: Choose a column</legend>
181 <input type="hidden" name="area" value="[% area | html %]" />
182 <input type="hidden" name="definition_name" value="[% definition_name | html %]" />
183 <input type="hidden" name="definition_description" value="[% definition_description | html %]" />
185 <select id="availableColumns" name="columns" size="25" style="width:200px;height:300px;margin:1em;">
186 [% FOREACH column IN columns %]
187 [% IF ( column.table ) %]
188 [% IF ( loop.first ) %]
193 <optgroup label="[% column.table | html %]">
195 <option value="[% column.name | html %]">
196 [% IF ( column.description ) %][% column.description | html %]
198 [% column.name | html %]
206 <input type="hidden" name="phase" value="New Term step 4" />
208 <fieldset class="action"><input type="submit" name="submit" class="btn btn-primary" value="Next" /></fieldset>
213 <h3>Add new definition</h3>
214 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
215 <fieldset class="rows">
216 <legend>Step 4 of 5: Specify a value</legend>
217 <input type="hidden" name="area" value="[% area | html %]" />
218 <input type="hidden" name="definition_name" value="[% definition_name | html %]" />
219 <input type="hidden" name="definition_description" value="[% definition_description | html %]" />
220 <input type="hidden" name="columnstring" value="[% columnstring | html %]" />
222 [% FOREACH column IN columns %]
223 <input type="hidden" name="criteria_column" value="[% column.name | html %]" />
224 <ol><li><span class="label">Column: </span> [% column.name | html %]</li>
225 [% IF ( column.distinct ) %]
226 <li><label for="[% column.name | html %]_value">Choose: </label> <select id="[% column.name | html %]_value" name="[% column.name | html %]_value">
227 [% FOREACH value IN column.values %]
228 <option value="[% value.availablevalues | html %]">[% value.availablevalues | html %]</option>
232 [% IF ( column.date ) %]
234 <label for="all_dates">All dates</label>
235 <input type="radio" id="all_dates" name="[% column.name | html %]_date_type_value" value="all" checked="checked" />
236 <label for="date_range">Date range</label>
237 <input type="radio" id="date_range" name="[% column.name | html %]_date_type_value" value="range" />
241 <input type="text" size="10" id="from" name="[% column.name | html %]_start_value" value="" class="flatpickr" data-date_to="to" />
242 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
244 <input type="text" size="10" id="to" name="[% column.name | html %]_end_value" value="" class="flatpickr" />
245 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
248 [% IF ( column.text ) %]
249 <li><label for="[% column.name | html %]_value">Search string matches: </label> <input type="text" size="13" name="[% column.name | html %]_value" /></li>
254 <input type="hidden" name="phase" value="New Term step 5" />
256 <fieldset class="action">
257 <input type="submit" name="submit" class="btn btn-primary" value="Next" />
263 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
264 <input type="hidden" name="area" value="[% area | html %]" />
265 <input type="hidden" name="definition_name" value="[% definition_name | html %]" />
266 <input type="hidden" name="definition_description" value="[% definition_description | html %]" />
267 <input type="hidden" name="columnstring" value="[% columnstring | html %]" />
269 <h3>Add new definition</h3>
271 <fieldset class="rows">
272 <legend>Step 5 of 5: Confirm details</legend>
275 <span class="label">Name:</span>[%- definition_name | html -%]
278 <span class="label">Description:</span>[%- definition_description | html -%]
281 <span class="label">Area:</span>[%- PROCESS area_name area=area -%]
284 <span class="label">Data:</span>
290 [%- FOREACH criteria_loo IN criteria_loop -%]
292 <td>[%- criteria_loo.name | html -%]</td>
293 <td>[%- criteria_loo.value | html -%]</td>
301 <fieldset class="action"><input type="hidden" name="sql" value="[% query | html %]" />
302 <input type="hidden" name="phase" value="New Term step 6" />
303 <input type="submit" name="submit" class="btn btn-primary" value="Save" /> </fieldset>
309 </div> <!-- /.col-sm-10.col-sm-push-2 -->
311 <div class="col-sm-2 col-sm-pull-10">
313 [% INCLUDE 'guided-reports-view.inc' %]
315 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
316 </div> <!-- /.row -->
318 [% MACRO jsinclude BLOCK %]
319 [% INCLUDE 'calendar.inc' %]
321 var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this dictionary definition? This cannot be undone.");
323 $(document).ready(function() {
324 $("#delete").on("click",function(){
325 return confirmDelete(MSG_CONFIRM_DELETE);
328 $("#date_range").change(function(){
329 $("input#from").parents('li').show();
331 $("#all_dates").change(function(){
332 $("input#from").parents('li').hide();
334 $("#all_dates").click().change();
339 [% INCLUDE 'intranet-bottom.inc' %]