2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha › Reports › Guided reports › Dictionary</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 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a> › <a href="/cgi-bin/koha/reports/guided_reports.pl">Guided reports wizard</a>
24 [% IF ( new_dictionary ) %] › <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a> › <strong>Name the new definition</strong>
25 [% ELSIF ( step_2 ) %] › <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a> › <strong>Step 2: Choose the area </strong>
26 [% ELSIF ( step_3 ) %] › <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a> › <strong>Step 3: Choose a column </strong>
27 [% ELSIF ( step_4 ) %] › <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a> › <strong>Step 4: Specify a value </strong>
28 [% ELSIF ( step_5 ) %] › <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a> › <strong>Step 5: Confirm definition</strong>
29 [% ELSE %] › <strong> Dictionary </strong>[% END %]</div>
31 <div class="main container-fluid">
33 <div class="col-sm-10 col-sm-push-2">
36 [% IF ( start_dictionary ) %]
38 <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>
42 [% IF ( start_dictionary ) %]
43 <p>Use the dictionary to define custom criteria for reporting.</p>
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" />
52 <option value="">All</option>
53 [% FOREACH area IN areas %]
54 [%- IF ( area.selected ) -%]
55 <option value="[% area.id | html %]" selected="selected">[%- PROCESS area_name area=area.id -%]</option>
57 <option value="[% area.id | html %]">[%- PROCESS area_name area=area.id -%]</option>
61 <input name="submit" value="Go" type="submit" />
73 [% FOREACH definition IN definitions %]
75 <td>[% definition.name | html %]</td>
76 <td>[% definition.description | html %]</td>
77 <td>[% definition.areaname | html %]</td>
78 <td>[% definition.saved_sql | html %]</td>
79 <td class="actions"><form method="post" action="/cgi-bin/koha/reports/dictionary.pl">
80 <input type="hidden" name="id" value="[% definition.id | html %]" />
81 <input type="hidden" name="phase" value="Delete Definition" />
82 <button type="submit" name="submit" class="btn btn-default btn-xs" id="delete"><i class="fa fa-trash"></i> Delete</button>
88 <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>
92 [% IF ( new_dictionary ) %]
93 <h3>Add new definition</h3>
94 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
95 <fieldset class="rows"><legend>Step 1 of 5: Name the new definition</legend><ol>
97 <label for="definition_name">Definition name:</label>
98 <input type="text" id="definition_name" name="definition_name" />
101 <label for="definition_description">Definition description:</label>
102 <textarea name="definition_description" id="definition_description" rows="3" cols="20"></textarea>
106 <fieldset class="action"><input type="hidden" name="phase" value="New Term step 2" />
107 <input name="submit" value="Next" type="submit" /></fieldset>
111 [%- IF ( step_2 ) -%]
112 <h3>Add new definition</h3>
113 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
114 <fieldset class="rows">
115 <legend>Step 2 of 5: Choose the area</legend>
118 <input type="hidden" name="phase" value="New Term step 3" />
119 <input type="hidden" name="definition_name" value="[% definition_name | html %]" />
120 <input type="hidden" name="definition_description" value="[% definition_description | html %]" />
121 <label for="area">Select table:</label><select name="area" id="area">
122 [%- FOREACH area IN areas -%]
123 <option value="[%- area.id | html -%]">[%- PROCESS area_name area=area.id -%]</option>
129 <fieldset class="action"><input name="submit" value="Next" type="submit" /></fieldset>
134 <h3>Add new definition</h3>
135 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
136 <fieldset class="rows">
137 <legend>Step 3 of 5: Choose a column</legend>
138 <input type="hidden" name="area" value="[% area | html %]" />
139 <input type="hidden" name="definition_name" value="[% definition_name | html %]" />
140 <input type="hidden" name="definition_description" value="[% definition_description | html %]" />
142 <select id="availableColumns" name="columns" size="25" style="width:200px;height:300px;margin:1em;">
143 [% FOREACH column IN columns %]
144 [% IF ( column.table ) %]
145 [% IF ( loop.first ) %]
150 <optgroup label="[% column.table | html %]">
152 <option value="[% column.name | html %]">
153 [% IF ( column.description ) %][% column.description | html %]
155 [% column.name | html %]
163 <input type="hidden" name="phase" value="New Term step 4" />
165 <fieldset class="action"><input type="submit" name="submit" value="Next" /></fieldset>
170 <h3>Add new definition</h3>
171 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
172 <fieldset class="rows">
173 <legend>Step 4 of 5: Specify a value</legend>
174 <input type="hidden" name="area" value="[% area | html %]" />
175 <input type="hidden" name="definition_name" value="[% definition_name | html %]" />
176 <input type="hidden" name="definition_description" value="[% definition_description | html %]" />
177 <input type="hidden" name="columnstring" value="[% columnstring | html %]" />
179 [% FOREACH column IN columns %]
180 <input type="hidden" name="criteria_column" value="[% column.name | html %]" />
181 <ol><li><span class="label">Column: </span> [% column.name | html %]</li>
182 [% IF ( column.distinct ) %]
183 <li><label for="[% column.name | html %]_value">Choose: </label> <select id="[% column.name | html %]_value" name="[% column.name | html %]_value">
184 [% FOREACH value IN column.values %]
185 <option value="[% value.availablevalues | html %]">[% value.availablevalues | html %]</option>
189 [% IF ( column.date ) %]
191 <label for="all_dates">All dates</label>
192 <input type="radio" id="all_dates" name="[% column.name | html %]_date_type_value" value="all" checked="checked" />
193 <label for="date_range">Date range</label>
194 <input type="radio" id="date_range" name="[% column.name | html %]_date_type_value" value="range" />
198 <input type="text" size="10" id="from" name="[% column.name | html %]_start_value" value="" class="datepickerfrom" />
199 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
201 <input type="text" size="10" id="to" name="[% column.name | html %]_end_value" value="" class="datepickerto" />
202 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
205 [% IF ( column.text ) %]
206 <li><label for="[% column.name | html %]_value">Search string matches: </label> <input type="text" size="13" name="[% column.name | html %]_value" /></li>
211 <input type="hidden" name="phase" value="New Term step 5" />
213 <fieldset class="action">
214 <input type="submit" name="submit" value="Next" />
220 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
221 <input type="hidden" name="area" value="[% area | html %]" />
222 <input type="hidden" name="definition_name" value="[% definition_name | html %]" />
223 <input type="hidden" name="definition_description" value="[% definition_description | html %]" />
224 <input type="hidden" name="columnstring" value="[% columnstring | html %]" />
226 <h3>Add new definition</h3>
228 <fieldset class="rows">
229 <legend>Step 5 of 5: Confirm details</legend>
232 <span class="label">Name:</span>[%- definition_name | html -%]
235 <span class="label">Description:</span>[%- definition_description | html -%]
238 <span class="label">Area:</span>[%- PROCESS area_name area=area -%]
241 <span class="label">Data:</span>
247 [%- FOREACH criteria_loo IN criteria_loop -%]
249 <td>[%- criteria_loo.name | html -%]</td>
250 <td>[%- criteria_loo.value | html -%]</td>
258 <fieldset class="action"><input type="hidden" name="sql" value="[% query | html %]" />
259 <input type="hidden" name="phase" value="New Term step 6" />
260 <input type="submit" name="submit" value="Save" /> </fieldset>
266 </div> <!-- /.col-sm-10.col-sm-push-2 -->
268 <div class="col-sm-2 col-sm-pull-10">
270 [% INCLUDE 'guided-reports-view.inc' %]
272 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
273 </div> <!-- /.row -->
275 [% MACRO jsinclude BLOCK %]
276 [% INCLUDE 'calendar.inc' %]
278 var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this dictionary definition? This cannot be undone.");
280 $(document).ready(function() {
281 $("#delete").on("click",function(){
282 return confirmDelete(MSG_CONFIRM_DELETE);
285 $("#date_range").change(function(){
286 $("input#from").parents('li').show();
288 $("#all_dates").change(function(){
289 $("input#from").parents('li').hide();
291 $("#all_dates").click().change();
296 [% INCLUDE 'intranet-bottom.inc' %]