2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha › Reports › Guided reports › Dictionary</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 <style type="text/css">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
22 <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>
23 [% IF ( new_dictionary ) %] › <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a> › <strong>Name the new definition</strong>
24 [% ELSIF ( step_2 ) %] › <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a> › <strong>Step 2: Choose the area </strong>
25 [% ELSIF ( step_3 ) %] › <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a> › <strong>Step 3: Choose a column </strong>
26 [% ELSIF ( step_4 ) %] › <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a> › <strong>Step 4: Specify a value </strong>
27 [% ELSIF ( step_5 ) %] › <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a> › <strong>Step 5: Confirm definition</strong>
28 [% ELSE %] › <strong> Dictionary </strong>[% END %]</div>
30 <div id="doc3" class="yui-t2">
35 [% IF ( start_dictionary ) %]
38 <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>
43 [% IF ( start_dictionary ) %]
44 <p>Use the dictionary to define custom criteria for reporting.</p>
46 [% IF ( definitions ) %]
47 <h2>Current terms</h2>
48 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
49 <input type="hidden" name="phase" value="View Dictionary" />
53 <option value="">All</option>
54 [% FOREACH area IN areas %]
55 [%- IF ( area.selected ) -%]
56 <option value="[% area.id %]" selected="selected">[%- PROCESS area_name area=area.id -%]</option>
58 <option value="[% area.id %]">[%- PROCESS area_name area=area.id -%]</option>
62 <input name="submit" value="Go" type="submit" />
74 [% FOREACH definition IN definitions %]
76 <td>[% definition.name | html %]</td>
77 <td>[% definition.description | html %]</td>
78 <td>[% definition.areaname %]</td>
79 <td>[% definition.saved_sql %]</td>
80 <td class="actions"><form method="post" action="/cgi-bin/koha/reports/dictionary.pl">
81 <input type="hidden" name="id" value="[% definition.id %]" />
82 <input type="hidden" name="phase" value="Delete Definition" />
83 <button type="submit" name="submit" class="btn btn-default btn-xs" id="delete"><i class="fa fa-trash"></i> Delete</button>
89 <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>
93 [% IF ( new_dictionary ) %]
94 <h3>Add new definition</h3>
95 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
96 <fieldset class="rows"><legend>Step 1 of 5: Name the new definition</legend><ol>
98 <label for="definition_name">Definition name:</label>
99 <input type="text" id="definition_name" name="definition_name" />
102 <label for="definition_description">Definition description:</label>
103 <textarea name="definition_description" id="definition_description" rows="3" cols="20"></textarea>
107 <fieldset class="action"><input type="hidden" name="phase" value="New Term step 2" />
108 <input name="submit" value="Next" type="submit" /></fieldset>
112 [%- IF ( step_2 ) -%]
113 <h3>Add new definition</h3>
114 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
115 <fieldset class="rows">
116 <legend>Step 2 of 5: Choose the area</legend>
119 <input type="hidden" name="phase" value="New Term step 3" />
120 <input type="hidden" name="definition_name" value="[% definition_name | html %]" />
121 <input type="hidden" name="definition_description" value="[% definition_description | html %]" />
122 <label for="area">Select table:</label><select name="area" id="area">
123 [%- FOREACH area IN areas -%]
124 <option value="[%- area.id -%]">[%- PROCESS area_name area=area.id -%]</option>
130 <fieldset class="action"><input name="submit" value="Next" type="submit" /></fieldset>
135 <h3>Add new definition</h3>
136 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
137 <fieldset class="rows">
138 <legend>Step 3 of 5: Choose a column</legend>
139 <input type="hidden" name="area" value="[% area %]" />
140 <input type="hidden" name="definition_name" value="[% definition_name | html %]" />
141 <input type="hidden" name="definition_description" value="[% definition_description | html %]" />
143 <select id="availableColumns" name="columns" size="25" style="width:200px;height:300px;margin:1em;">
144 [% FOREACH column IN columns %]
145 [% IF ( column.table ) %]
146 [% IF ( loop.first ) %]
151 <optgroup label="[% column.table %]">
153 <option value="[% column.name %]">
154 [% IF ( column.description ) %][% column.description %]
164 <input type="hidden" name="phase" value="New Term step 4" />
166 <fieldset class="action"><input type="submit" name="submit" value="Next" /></fieldset>
171 <h3>Add new definition</h3>
172 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
173 <fieldset class="rows">
174 <legend>Step 4 of 5: Specify a value</legend>
175 <input type="hidden" name="area" value="[% area %]" />
176 <input type="hidden" name="definition_name" value="[% definition_name | html %]" />
177 <input type="hidden" name="definition_description" value="[% definition_description | html %]" />
178 <input type="hidden" name="columnstring" value="[% columnstring %]" />
180 [% FOREACH column IN columns %]
181 <input type="hidden" name="criteria_column" value="[% column.name %]" />
182 <ol><li><span class="label">Column: </span> [% column.name %]</li>
183 [% IF ( column.distinct ) %]
184 <li><label for="[% column.name %]_value">Choose: </label> <select id="[% column.name %]_value" name="[% column.name %]_value">
185 [% FOREACH value IN column.values %]
186 <option value="[% value.availablevalues %]">[% value.availablevalues %]</option>
190 [% IF ( column.date ) %]
192 <label for="all_dates">All dates</label>
193 <input type="radio" id="all_dates" name="[% column.name %]_date_type_value" value="all" checked="checked" />
194 <label for="date_range">Date range</label>
195 <input type="radio" id="date_range" name="[% column.name %]_date_type_value" value="range" />
199 <input type="text" size="10" id="from" name="[% column.name %]_start_value" value="" class="datepickerfrom" />
200 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
202 <input type="text" size="10" id="to" name="[% column.name %]_end_value" value="" class="datepickerto" />
203 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
206 [% IF ( column.text ) %]
207 <li><label for="[% column.name %]_value">Search string matches: </label> <input type="text" size="13" name="[% column.name %]_value" /></li>
212 <input type="hidden" name="phase" value="New Term step 5" />
214 <fieldset class="action">
215 <input type="submit" name="submit" value="Next" />
221 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
222 <input type="hidden" name="area" value="[% area %]" />
223 <input type="hidden" name="definition_name" value="[% definition_name | html %]" />
224 <input type="hidden" name="definition_description" value="[% definition_description | html %]" />
225 <input type="hidden" name="columnstring" value="[% columnstring %]" />
227 <h3>Add new definition</h3>
229 <fieldset class="rows">
230 <legend>Step 5 of 5: Confirm details</legend>
233 <span class="label">Name:</span>[%- definition_name | html -%]
236 <span class="label">Description:</span>[%- definition_description | html -%]
239 <span class="label">Area:</span>[%- PROCESS area_name area=area -%]
242 <span class="label">Data:</span>
248 [%- FOREACH criteria_loo IN criteria_loop -%]
250 <td>[%- criteria_loo.name -%]</td>
251 <td>[%- criteria_loo.value -%]</td>
259 <fieldset class="action"><input type="hidden" name="sql" value="[% query %]" />
260 <input type="hidden" name="phase" value="New Term step 6" />
261 <input type="submit" name="submit" value="Save" /> </fieldset>
268 [% INCLUDE 'guided-reports-view.inc' %]
272 [% MACRO jsinclude BLOCK %]
273 [% INCLUDE 'calendar.inc' %]
274 <script type="text/javascript">
275 var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this dictionary definition? This cannot be undone.");
277 $(document).ready(function() {
278 $("#delete").on("click",function(){
279 return confirmDelete(MSG_CONFIRM_DELETE);
282 $("#date_range").change(function(){
283 $("input#from").parents('li').show();
285 $("#all_dates").change(function(){
286 $("input#from").parents('li').hide();
288 $("#all_dates").click().change();
293 [% INCLUDE 'intranet-bottom.inc' %]