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
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 class="main container-fluid">
32 <div class="col-sm-10 col-sm-push-2">
35 [% IF ( start_dictionary ) %]
37 <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>
41 [% IF ( start_dictionary ) %]
42 <p>Use the dictionary to define custom criteria for reporting.</p>
44 [% IF ( definitions ) %]
45 <h2>Current terms</h2>
46 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
47 <input type="hidden" name="phase" value="View Dictionary" />
51 <option value="">All</option>
52 [% FOREACH area IN areas %]
53 [%- IF ( area.selected ) -%]
54 <option value="[% area.id | html %]" selected="selected">[%- PROCESS area_name area=area.id -%]</option>
56 <option value="[% area.id | html %]">[%- PROCESS area_name area=area.id -%]</option>
60 <input name="submit" value="Go" type="submit" />
72 [% FOREACH definition IN definitions %]
74 <td>[% definition.name | html %]</td>
75 <td>[% definition.description | html %]</td>
76 <td>[% definition.areaname | html %]</td>
77 <td>[% definition.saved_sql | html %]</td>
78 <td class="actions"><form method="post" action="/cgi-bin/koha/reports/dictionary.pl">
79 <input type="hidden" name="id" value="[% definition.id | html %]" />
80 <input type="hidden" name="phase" value="Delete Definition" />
81 <button type="submit" name="submit" class="btn btn-default btn-xs" id="delete"><i class="fa fa-trash"></i> Delete</button>
87 <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>
91 [% IF ( new_dictionary ) %]
92 <h3>Add new definition</h3>
93 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
94 <fieldset class="rows"><legend>Step 1 of 5: Name the new definition</legend><ol>
96 <label for="definition_name">Definition name:</label>
97 <input type="text" id="definition_name" name="definition_name" />
100 <label for="definition_description">Definition description:</label>
101 <textarea name="definition_description" id="definition_description" rows="3" cols="20"></textarea>
105 <fieldset class="action"><input type="hidden" name="phase" value="New Term step 2" />
106 <input name="submit" value="Next" type="submit" /></fieldset>
110 [%- IF ( step_2 ) -%]
111 <h3>Add new definition</h3>
112 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
113 <fieldset class="rows">
114 <legend>Step 2 of 5: Choose the area</legend>
117 <input type="hidden" name="phase" value="New Term step 3" />
118 <input type="hidden" name="definition_name" value="[% definition_name | html %]" />
119 <input type="hidden" name="definition_description" value="[% definition_description | html %]" />
120 <label for="area">Select table:</label><select name="area" id="area">
121 [%- FOREACH area IN areas -%]
122 <option value="[%- area.id | html -%]">[%- PROCESS area_name area=area.id -%]</option>
128 <fieldset class="action"><input name="submit" value="Next" type="submit" /></fieldset>
133 <h3>Add new definition</h3>
134 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
135 <fieldset class="rows">
136 <legend>Step 3 of 5: Choose a column</legend>
137 <input type="hidden" name="area" value="[% area | html %]" />
138 <input type="hidden" name="definition_name" value="[% definition_name | html %]" />
139 <input type="hidden" name="definition_description" value="[% definition_description | html %]" />
141 <select id="availableColumns" name="columns" size="25" style="width:200px;height:300px;margin:1em;">
142 [% FOREACH column IN columns %]
143 [% IF ( column.table ) %]
144 [% IF ( loop.first ) %]
149 <optgroup label="[% column.table | html %]">
151 <option value="[% column.name | html %]">
152 [% IF ( column.description ) %][% column.description | html %]
154 [% column.name | html %]
162 <input type="hidden" name="phase" value="New Term step 4" />
164 <fieldset class="action"><input type="submit" name="submit" value="Next" /></fieldset>
169 <h3>Add new definition</h3>
170 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
171 <fieldset class="rows">
172 <legend>Step 4 of 5: Specify a value</legend>
173 <input type="hidden" name="area" value="[% area | html %]" />
174 <input type="hidden" name="definition_name" value="[% definition_name | html %]" />
175 <input type="hidden" name="definition_description" value="[% definition_description | html %]" />
176 <input type="hidden" name="columnstring" value="[% columnstring | html %]" />
178 [% FOREACH column IN columns %]
179 <input type="hidden" name="criteria_column" value="[% column.name | html %]" />
180 <ol><li><span class="label">Column: </span> [% column.name | html %]</li>
181 [% IF ( column.distinct ) %]
182 <li><label for="[% column.name | html %]_value">Choose: </label> <select id="[% column.name | html %]_value" name="[% column.name | html %]_value">
183 [% FOREACH value IN column.values %]
184 <option value="[% value.availablevalues | html %]">[% value.availablevalues | html %]</option>
188 [% IF ( column.date ) %]
190 <label for="all_dates">All dates</label>
191 <input type="radio" id="all_dates" name="[% column.name | html %]_date_type_value" value="all" checked="checked" />
192 <label for="date_range">Date range</label>
193 <input type="radio" id="date_range" name="[% column.name | html %]_date_type_value" value="range" />
197 <input type="text" size="10" id="from" name="[% column.name | html %]_start_value" value="" class="datepickerfrom" />
198 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
200 <input type="text" size="10" id="to" name="[% column.name | html %]_end_value" value="" class="datepickerto" />
201 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
204 [% IF ( column.text ) %]
205 <li><label for="[% column.name | html %]_value">Search string matches: </label> <input type="text" size="13" name="[% column.name | html %]_value" /></li>
210 <input type="hidden" name="phase" value="New Term step 5" />
212 <fieldset class="action">
213 <input type="submit" name="submit" value="Next" />
219 <form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
220 <input type="hidden" name="area" value="[% area | html %]" />
221 <input type="hidden" name="definition_name" value="[% definition_name | html %]" />
222 <input type="hidden" name="definition_description" value="[% definition_description | html %]" />
223 <input type="hidden" name="columnstring" value="[% columnstring | html %]" />
225 <h3>Add new definition</h3>
227 <fieldset class="rows">
228 <legend>Step 5 of 5: Confirm details</legend>
231 <span class="label">Name:</span>[%- definition_name | html -%]
234 <span class="label">Description:</span>[%- definition_description | html -%]
237 <span class="label">Area:</span>[%- PROCESS area_name area=area -%]
240 <span class="label">Data:</span>
246 [%- FOREACH criteria_loo IN criteria_loop -%]
248 <td>[%- criteria_loo.name | html -%]</td>
249 <td>[%- criteria_loo.value | html -%]</td>
257 <fieldset class="action"><input type="hidden" name="sql" value="[% query | html %]" />
258 <input type="hidden" name="phase" value="New Term step 6" />
259 <input type="submit" name="submit" value="Save" /> </fieldset>
265 </div> <!-- /.col-sm-10.col-sm-push-2 -->
267 <div class="col-sm-2 col-sm-pull-10">
269 [% INCLUDE 'guided-reports-view.inc' %]
271 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
272 </div> <!-- /.row -->
274 [% MACRO jsinclude BLOCK %]
275 [% INCLUDE 'calendar.inc' %]
277 var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this dictionary definition? This cannot be undone.");
279 $(document).ready(function() {
280 $("#delete").on("click",function(){
281 return confirmDelete(MSG_CONFIRM_DELETE);
284 $("#date_range").change(function(){
285 $("input#from").parents('li').show();
287 $("#all_dates").change(function(){
288 $("input#from").parents('li').hide();
290 $("#all_dates").click().change();
295 [% INCLUDE 'intranet-bottom.inc' %]