Merge remote branch 'kc/new/for-3.4/enh_bulkmarcimport' into kcmaster
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / reports / guided_reports_start.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha &rsaquo; Reports &rsaquo; Guided Reports Wizard 
3 <!-- TMPL_IF    NAME="saved1"  -->&rsaquo; Saved Reports
4 <!-- TMPL_ELSIF NAME="create"  -->&rsaquo; Create from SQL
5 <!-- TMPL_ELSIF NAME="showsql" -->&rsaquo; Saved Reports &rsaquo; SQL View
6 <!-- TMPL_ELSIF NAME="execute" -->&rsaquo; Saved Reports &rsaquo; <!-- TMPL_VAR NAME="name" --> Report
7 <!-- TMPL_ELSIF NAME="buildx"  -->&rsaquo; Build A Report, Step <!-- TMPL_VAR NAME="buildx" --> of 6:
8 <!-- TMPL_IF    NAME="build1" -->Choose a Module
9 <!-- TMPL_ELSIF NAME="build2" -->Pick a Report Type
10 <!-- TMPL_ELSIF NAME="build3" -->Select Columns for Display
11 <!-- TMPL_ELSIF NAME="build4" -->Select Criteria to Limit on
12 <!-- TMPL_ELSIF NAME="build5" -->Pick which columns to total
13 <!-- TMPL_ELSIF NAME="build6" -->Select how you want the report ordered
14 <!-- /TMPL_IF -->
15 <!-- /TMPL_IF -->
16 </title>
17 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
18 <!-- TMPL_INCLUDE NAME="calendar.inc" -->
19 <style type="text/css">
20     #sql { width: 90%; height: 9em;}
21 </style>
22 <script type="text/javascript">
23 //<![CDATA[
24 $(document).ready(function(){
25 <!-- TMPL_IF NAME="showsql" -->
26     $("#sql").focus(function() {
27         $(this).select();
28     });
29 <!-- /TMPL_IF -->
30 <!-- TMPL_IF NAME="saved1" -->
31     $(".confirmdelete").click(function(){
32         $(this).parents('tr').attr("class","warn");
33         if(confirm("Are you sure you want to "+$(this).attr("title")+"?")){
34             return true;
35         } else {
36             $(this).parents('tr').attr("class","");
37             return false;
38         }
39     });
40 <!-- /TMPL_IF -->
41 });
42 //]]>
43 </script>
44 </head>
45 <body>
46 <!-- TMPL_INCLUDE NAME="header.inc" -->
47 <!-- TMPL_INCLUDE NAME="circ-search.inc" -->
48
49 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a>
50 &rsaquo; <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a>
51 &rsaquo; <a href="/cgi-bin/koha/reports/guided_reports.pl">Guided Reports Wizard</a>
52 &rsaquo; 
53 <!-- TMPL_IF NAME="saved1"  -->Saved Reports
54 <!-- TMPL_ELSIF NAME="create"  -->Create from SQL
55 <!-- TMPL_ELSIF NAME="showsql" --><a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Saved Reports</a> &rsaquo; SQL View
56 <!-- TMPL_ELSIF NAME="execute" --><a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Saved Reports</a> &rsaquo; <em><!-- TMPL_VAR NAME="name" --></em> Report
57 <!-- TMPL_ELSIF NAME="buildx"  --><a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Build%20new">Build A Report</a> &rsaquo; Step <!-- TMPL_VAR NAME="buildx" --> of 6:
58     <!-- TMPL_IF    NAME="build1" -->Choose a Module
59     <!-- TMPL_ELSIF NAME="build2" -->Pick a Report Type
60     <!-- TMPL_ELSIF NAME="build3" -->Select Columns for Display
61     <!-- TMPL_ELSIF NAME="build4" -->Select Criteria to Limit on
62     <!-- TMPL_ELSIF NAME="build5" -->Pick which columns to total
63     <!-- TMPL_ELSIF NAME="build6" -->Select how you want the report ordered
64     <!-- /TMPL_IF -->
65 <!-- /TMPL_IF -->
66 </div>
67
68 <div id="doc3" class="yui-t1">
69 <div id="bd">
70 <div id="yui-main">
71     <div class="yui-b">
72
73 <!-- TMPL_IF NAME="start" -->
74     <h2>Guided Reports</h2>
75     <p>Use the guided reports engine to create non standard reports.
76 This feature aims to provide some middle ground between the built in
77 canned reports and writing custom SQL reports.</p>
78
79     <h3>Build And Run Reports</h3>
80         <!-- TMPL_IF NAME="CAN_user_reports_create_reports" -->
81         <form action="/cgi-bin/koha/reports/guided_reports.pl">
82             <input type="hidden" name="phase" value="Build new" />
83             <input type="submit" name="submit" value="Build new"/>
84         </form>
85         <!-- /TMPL_IF -->
86         <!-- TMPL_IF NAME="CAN_user_reports_execute_reports" -->
87         <form action="/cgi-bin/koha/reports/guided_reports.pl">
88             <input type="hidden" name="phase" value="Use saved"/>
89             <input type="submit" name="submit" value="Use saved"/>
90         </form>
91         <!-- /TMPL_IF -->
92         <!-- TMPL_IF NAME="CAN_user_reports_create_reports" -->
93         <form action="/cgi-bin/koha/reports/guided_reports.pl">
94             <input type="hidden" name="phase" value="Create report from SQL"/>
95             <input type="submit" name="submit" value="Create report from SQL"/>
96         </form>
97         <!-- /TMPL_IF -->
98 <h3>Reports Dictionary</h3>
99 <p>Use the reports dictionary to define custom criteria to use in your reports</p>
100 <form action="/cgi-bin/koha/reports/dictionary.pl">
101 <input type="hidden" name="phase" value="View Dictionary"/>
102 <input type="submit" name="submit" value="View Dictionary"/>
103 </form>
104 <!-- /TMPL_IF -->
105
106 <!-- TMPL_IF NAME="saved1" -->
107 <!-- TMPL_IF NAME="savedreports" --><h1>Saved Reports</h1>
108 <p>Choose the report to run from the list</p>
109 <form action="/cgi-bin/koha/reports/guided_reports.pl">
110 <table>
111 <tr><th>ID</th><th>Report Name</th><th>Type</th><th>Notes</th><th>Author</th><th>Creation Date</th><th>Saved Results</th><th>Saved SQL</th><th colspan="3">&nbsp;</th></tr>
112 <!-- TMPL_LOOP NAME="savedreports" -->
113 <!-- TMPL_UNLESS NAME="__odd__" --><tr class="highlight"><!-- TMPL_ELSE --><tr><!-- /TMPL_UNLESS -->
114 <td><!-- TMPL_VAR NAME="id" --></td>
115 <td><!-- TMPL_VAR NAME="report_name" --></td>
116 <td><!-- TMPL_VAR NAME="type" --></td>
117 <td><!-- TMPL_VAR NAME="notes" --></td>
118 <td><!-- TMPL_VAR NAME="borrowersurname" --><!-- TMPL_IF NAME="borrowerfirstname" -->, <!-- TMPL_VAR NAME="borrowerfirstname" --><!-- /TMPL_IF --> (<!-- TMPL_VAR NAME="borrowernumber" -->)</td>
119 <td><!-- TMPL_VAR NAME="date_created" --></td>
120 <td><!-- TMPL_IF NAME="date_run" --><a href="/cgi-bin/koha/reports/guided_reports.pl?phase=retrieve%20results&id=<!-- TMPL_VAR NAME="id" -->"><!-- TMPL_VAR NAME="date_run" --></a><!-- /TMPL_IF -->
121 </td>
122 <td><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=<!-- TMPL_VAR NAME="id" -->&amp;phase=Show%20SQL">Show SQL</a> 
123 &nbsp; <a href="/cgi-bin/koha/reports/guided_reports.pl?reports=<!-- TMPL_VAR NAME="id" -->&amp;phase=Edit%20SQL">Edit SQL</a></td>
124 <td><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=<!-- TMPL_VAR NAME="id" -->&amp;phase=Run%20this%20report">Run</a></td>
125 <td><a href="/cgi-bin/koha/tools/scheduler.pl?id=<!-- TMPL_VAR NAME="id" -->">Schedule</a></td>
126 <td><a class="confirmdelete" title="Delete this saved report" href="/cgi-bin/koha/reports/guided_reports.pl?reports=<!-- TMPL_VAR NAME="id" -->&amp;phase=Delete%20Saved">Delete</a></td></tr>
127 <!-- /TMPL_LOOP -->
128 </table>
129 </form>
130 <!-- TMPL_ELSE --><h4>There are no saved reports. <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Build%20new">Build new?</a></h4><!-- /TMPL_IF -->
131 <!-- /TMPL_IF -->
132
133
134 <!-- TMPL_IF NAME="build1" -->
135 <h1>Build A Report</h1>
136 <form action="/cgi-bin/koha/reports/guided_reports.pl">
137 <fieldset class="rows">
138 <legend>Step 1 of 6: Choose a Module to Report on</legend>
139 <ol><li><label for="areas">Choose: </label><select name="areas" id="areas">
140 <!-- TMPL_LOOP NAME="areas" -->
141 <option value="<!-- TMPL_VAR NAME="id" -->"><!-- TMPL_VAR NAME="name"--></option>
142 <!-- /TMPL_LOOP -->
143 </select></li></ol>
144 </fieldset>
145 <fieldset class="action">
146 <input type="hidden" name="phase" value="Report on this Area" />
147 <input type="submit" name="submit" value="Next &gt;&gt;" />
148
149 </fieldset>
150 </form>
151 <!-- /TMPL_IF -->
152
153
154 <!-- TMPL_IF NAME="build2" -->
155 <h1>Build A Report</h1>
156 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
157 <input type="hidden" name="area" value="<!-- TMPL_VAR NAME="area" -->" />
158 <fieldset class="rows"><legend>Step 2 of 6: Pick a Report Type</legend>
159 <ol><li><label for="types">Choose: </label>
160     <select id="types" name="types">
161         <option value="1">Tabular</option>
162         <option value="2" disabled="disabled">Summary</option>
163         <option value="3" disabled="disabled">Matrix</option>
164     </select>
165 </li></ol></fieldset>
166
167 <fieldset class="action">
168     <input type="hidden" name="phase" value="Choose this type" />
169     <input type="button" name="back" value="&lt;&lt; Back" onclick="javascript:history.back()" />
170     <input type="submit" name="submit" value="Next &gt;&gt;" />
171 </fieldset>
172 </form>
173 </div>
174 <div class="yui-gb"><div class="yui-u first"></div>
175
176 <!--- Summary and Matrix reports have not yet been implemented-->
177 <!--<div class="yui-u">Summary:
178 <img src="/intranet-tmpl/prog/img/reports-summary-graphic.gif" /></div>
179 <div class="yui-u">Matrix:
180 <img src="/intranet-tmpl/prog/img/reports-matrix-graphic.gif" /></div>-->
181
182 <!-- /TMPL_IF -->
183
184 <!-- TMPL_IF NAME="build3" -->
185 <h3>Step 3 of 6: Select Columns for Display</h3>
186 <p>Note: Be careful selecting when selecting columns. If your choice is too broad it could result in a very large report that will either not complete, or slow your system down.</p>
187
188 <form id="column_submit" action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
189     <input type="hidden" name="area" value="<!-- TMPL_VAR NAME="area" -->" />
190     <input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->" />
191     <fieldset>
192 <div class="yui-g">
193 <div class="yui-u first">       <div style="float: left;"><select id="availableColumns" name="oldcolumns2" multiple="multiple" size="25" style="min-width: 200px;height:300px;">
194 <!-- TMPL_LOOP NAME="columns" -->
195 <!-- TMPL_IF NAME="table" -->
196
197 <!-- TMPL_IF NAME="__first__" -->
198 <!-- TMPL_ELSE -->
199 </optgroup>
200 <!-- /TMPL_IF -->
201
202 <optgroup label="<!-- TMPL_VAR NAME="table"-->">
203 <!-- TMPL_ELSE -->
204 <option value="<!-- TMPL_VAR NAME="name" -->">
205 <!-- TMPL_IF NAME="description" --><!-- TMPL_VAR NAME="description" -->
206 <!-- TMPL_ELSE -->
207 <!-- TMPL_VAR NAME="name" -->
208 <!-- /TMPL_IF -->
209 </option>
210 <!-- /TMPL_IF -->
211 <!-- /TMPL_LOOP -->
212 </optgroup>
213 </select></div>
214 <div style="width: 6.3em; float: right; margin-top: 100px"><input type="button" name="Add" value="Add" class="button" style="width:6em;" onclick="addColumn()" /><br />
215 <input type="button" name="delete" value="&lt;&lt; Delete" class="button" style="width: 6em; margin: 1em 0;" onclick="delColumn()" /></div>
216 </div>
217
218 <div class="yui-u">
219 <select id="selectedColumns" name="columns" multiple="multiple" size="25" style="width:200px; height:300px;"></select>
220 </div>
221 </div>
222 </fieldset>
223 <div class="yui-g">
224 <fieldset class="action">
225     <input type="hidden" name="phase" value="Choose these columns" />
226     <input type="button" name="back" value="&lt;&lt; Back" onclick="javascript:history.back()" />
227     <input type="submit" name="submit" value="Next &gt;&gt;" />
228 </fieldset>
229 </div>
230 </form>
231
232 <!-- /TMPL_IF -->
233
234 <!-- TMPL_IF NAME="build4" -->
235 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post" >
236     <input type="hidden" name="area" value="<!-- TMPL_VAR NAME="area" -->" />
237     <input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->" />
238     <input type="hidden" name="column" value="<!-- TMPL_VAR NAME="column" -->" />
239     <fieldset><legend>Step 4 of 6: Select Criteria to Limit on</legend>
240     <table>
241         <!-- TMPL_LOOP NAME="criteria" -->
242         <tr>
243         <td>
244             <input type="checkbox" name="criteria_column" id="<!-- TMPL_VAR NAME="name" -->" value="<!-- TMPL_VAR NAME="name" -->" /> 
245             <label for="<!-- TMPL_VAR NAME="name" -->"><!-- TMPL_VAR NAME="description" --> </label>
246         </td>
247         <!-- TMPL_IF NAME="date" -->
248         <td>
249             <input type="text" size="10" id="<!-- TMPL_VAR NAME="name" -->_value" name="<!-- TMPL_VAR NAME="name" -->_value" value="" />
250             <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="buttonfrom<!-- TMPL_VAR NAME="name" -->" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" />                 
251             <script type="text/javascript">   
252             Calendar.setup({  
253             inputField     : "<!-- TMPL_VAR NAME="name" -->_value",
254             ifFormat       : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
255             button         : "buttonfrom<!-- TMPL_VAR NAME="name" -->",
256             align          : "Tl" 
257             });     
258             </script>          
259                 <span class="hint"><!-- TMPL_INCLUDE NAME="date-format.inc" --></span>
260         </td>
261         </tr>
262         <!-- TMPL_ELSE -->
263         <!-- TMPL_IF NAME="textrange" -->
264             <td>from
265             <input type="text" size="10" id="<!-- TMPL_VAR NAME="from" -->_value" name="<!-- TMPL_VAR NAME="from" -->_value" value="" /> to 
266             <input type="text" size="10" id="<!-- TMPL_VAR NAME="to" -->_value" name="<!-- TMPL_VAR NAME="to" -->_value" value="" />
267             </td>
268             </tr>
269         <!-- TMPL_ELSE -->
270             <!-- TMPL_IF NAME="daterange" -->
271             <td>from 
272             <input type="text" size="10" id="from_<!-- TMPL_VAR NAME="name" -->_value" name="from_<!-- TMPL_VAR NAME="name" -->_value" value="" />
273             <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="buttonfromfrom_<!-- TMPL_VAR NAME="name" -->" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" />                 
274             <script type="text/javascript">   
275                 Calendar.setup({  
276                 inputField     : "from_<!-- TMPL_VAR NAME="name" -->_value",
277                 ifFormat       : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
278                 button         : "buttonfromfrom_<!-- TMPL_VAR NAME="name" -->",
279                 align          : "Tl" 
280                 });     
281             </script>         
282             to
283             <input type="text" size="10" id="to_<!-- TMPL_VAR NAME="name" -->_value" name="to_<!-- TMPL_VAR NAME="name" -->_value" value="" />
284             <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="buttonfromto_<!-- TMPL_VAR NAME="name" -->" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" />                 
285             <script type="text/javascript">   
286                 Calendar.setup({  
287                 inputField     : "to_<!-- TMPL_VAR NAME="name" -->_value",
288                 ifFormat       : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
289                 button         : "buttonfromto_<!-- TMPL_VAR NAME="name" -->",
290                 align          : "Tl" 
291                 });     
292             </script>        
293                         <span class="hint"><!-- TMPL_INCLUDE NAME="date-format.inc" --></span>
294             </td>
295         </tr>
296             <!-- TMPL_ELSE -->
297             <td>
298                 <select name="<!-- TMPL_VAR NAME="name" -->_value">
299                 <!-- TMPL_LOOP NAME="values" -->
300                 <option value="<!-- TMPL_VAR NAME="availablevalues"-->"><!-- TMPL_IF name="default" -->Default<!-- TMPL_ELSE --><!-- TMPL_VAR NAME="availablevalues" ESCAPE="HTML"--><!-- /TMPL_IF --></option>
301                 <!-- /TMPL_LOOP -->
302                 </select>
303             </td>
304             </tr>
305             <!-- /TMPL_IF -->
306         <!-- /TMPL_IF -->
307         <!-- /TMPL_IF -->
308     <!-- /TMPL_LOOP -->
309     </table>
310     </fieldset>
311
312 <!-- TMPL_IF NAME="definitions" -->
313 <fieldset><legend>Dictionary Definitions</legend><table>
314 <!-- TMPL_LOOP NAME="definitions" -->
315     <tr><td><input type="checkbox" name="definition" value="<!--
316 TMPL_VAR NAME="id" -->" /> <!-- TMPL_VAR NAME="name" --></td></tr>
317 <!-- /TMPL_LOOP -->
318 </table>
319 <!-- /TMPL_IF -->
320
321 <fieldset class="action"><input type="hidden" name="phase" value="Choose these criteria" />
322     <input type="button" name="back" value="&lt;&lt; Back" onclick="javascript:history.back()" />
323     <input type="submit" name="submit" value="Next &gt;&gt;" /> </fieldset>
324 </form>
325 <!-- /TMPL_IF -->
326
327
328 <!-- TMPL_IF NAME="build5" -->
329 <h3>Step 5 of 6: Pick which columns to total</h3>
330 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
331 <input type="hidden" name="area" value="<!-- TMPL_VAR NAME="area" -->" />
332 <input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->" />
333 <input type="hidden" name="column" value="<!-- TMPL_VAR NAME="column" -->" />
334 <input type="hidden" name="definition" value="<!-- TMPL_VAR NAME="definition" -->" />
335 <input type="hidden" name="criteria" value="<!-- TMPL_VAR NAME="criteriastring" -->" />
336 <fieldset><table>
337 <!-- TMPL_LOOP NAME="total_by" -->
338 <tr><td><input type="checkbox" name="total_by" id="<!-- TMPL_VAR
339 NAME="name" -->" value="<!-- TMPL_VAR
340 NAME="name" -->" /> <label for="<!-- TMPL_VAR
341 NAME="name" -->"><!-- TMPL_VAR NAME="name" --></label></td>
342 <td><select name="<!-- TMPL_VAR NAME="name" -->_tvalue">
343
344 <!-- TMPL_LOOP NAME="select" -->
345 <option value="<!-- TMPL_VAR NAME="value"-->"><!-- TMPL_VAR NAME="value" --></option>
346 <!-- /TMPL_LOOP -->
347 </select>
348
349 </td></tr>
350 <!-- /TMPL_LOOP -->
351 </table></fieldset>
352
353 <fieldset class="action"><input type="hidden" name="phase" value="Choose These Operations" />
354     <input type="button" name="back" value="&lt;&lt; Back" onclick="javascript:history.back()" />
355     <input type="submit" name="submit" value="Next &gt;&gt;" /></fieldset>
356 </form>
357 <!-- /TMPL_IF -->
358
359
360 <!-- TMPL_IF NAME="build6" -->
361 <h3>Step 6 of 6: Choose how you want the report ordered</h3>
362 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
363 <input type="hidden" name="area" value="<!-- TMPL_VAR NAME="area" -->" />
364 <input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->" />
365 <input type="hidden" name="column" value="<!-- TMPL_VAR NAME="column" -->" />
366 <input type="hidden" name="criteria" value="<!-- TMPL_VAR NAME="criteriastring" -->" />
367 <input type="hidden" name="definition" value="<!-- TMPL_VAR NAME="definition" -->" />
368 <input type="hidden" name="totals" value="<!-- TMPL_VAR NAME="totals" -->" />
369 <fieldset><table><!-- TMPL_LOOP NAME="order_by" -->
370 <tr><td><input type="checkbox" id="<!-- TMPL_VAR
371 NAME="name" -->" name="order_by" value="<!-- TMPL_VAR
372 NAME="name" -->" /> <label for="<!-- TMPL_VAR
373 NAME="name" -->"><!-- TMPL_VAR NAME="name"--></label></td><td>
374 <select name="<!-- TMPL_VAR NAME="name" -->_ovalue">
375
376 <!-- TMPL_LOOP NAME="select" -->
377 <option value="<!-- TMPL_VAR NAME="value"-->"><!-- TMPL_VAR NAME="value" --></option>
378 <!-- /TMPL_LOOP -->
379 </select>
380 </td></tr>
381
382 <!-- /TMPL_LOOP -->
383 </table></fieldset>
384
385 <fieldset class="action">
386 <input type="hidden" name="phase" value="Build Report" />
387 <input type="submit" name="submit" value="Finish" /></fieldset>
388 </form>
389 <!-- /TMPL_IF -->
390
391
392 <!-- TMPL_IF NAME="showreport" -->
393 <h1>Confirm Custom Report</h1>
394 <p>Your report will be generated with the following SQL statement.</p>
395 <p> 
396 <!-- TMPL_VAR NAME="sql" ESCAPE="HTML" -->
397 </p>
398
399 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
400 <input type="hidden" name="sql" value="<!-- TMPL_VAR NAME="sql" -->" />
401 <input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->" />
402 <p>You will need to save the report before you can execute it</p>
403 <fieldset class="action"><input type="hidden" name="phase" value="Save" />  
404 <input type="submit" name="submit" value="Save" />  </fieldset>
405 </form>
406 <!-- /TMPL_IF -->
407
408 <!-- TMPL_IF NAME="save" -->
409 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
410 <input type="hidden" name="sql" value="<!-- TMPL_VAR NAME="sql" ESCAPE="html" -->" />
411 <input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->" />
412 <fieldset class="rows">
413 <legend>Save Your Custom Report</legend>
414 <ol>
415     <li><label for="reportname">Report Name: </label><input type="text" id="reportname" name="reportname" /></li>
416     <li><label for="notes">Notes:</label> <textarea name="notes" id="notes"></textarea></li>
417 </ol></fieldset>
418 <fieldset class="action"><input type="hidden" name="phase" value="Save Report" />
419 <input type="submit" name="submit" value="Save Report" /></fieldset>
420 </form>
421 <!-- /TMPL_IF -->
422
423 <!-- TMPL_IF name="enter_params" -->
424     <form action='/cgi-bin/koha/reports/guided_reports.pl'>
425         <input type='hidden' name='phase' value='Run this report' />
426         <input type='hidden' name='reports' value="<!--TMPL_VAR name='reports' -->" />
427         <h1>Enter parameters for report <!-- TMPL_VAR name="name" -->:</h1>
428         <!-- TMPL_IF NAME="notes" --><p><!-- TMPL_VAR NAME="notes" --></p><!-- /TMPL_IF -->
429         <!-- TMPL_LOOP name="sql_params" -->
430             <p><!-- TMPL_VAR name="entry" -->: <!-- TMPL_VAR name='input' --></p>
431         <!-- /TMPL_LOOP -->
432         <input type='submit' value='Run the report'/>
433     </form>
434 <!-- /TMPL_IF -->
435
436 <!-- TMPL_IF NAME="execute" -->
437 <h1><!-- TMPL_VAR NAME="name" --></h1>
438 <!-- TMPL_IF NAME="notes" --><p><!-- TMPL_VAR NAME="notes" --></p><!-- /TMPL_IF -->
439 <!-- TMPL_IF NAME="unlimited_total" --><p>Total number of rows matching the (unlimited) query is <!-- TMPL_VAR NAME="unlimited_total" -->.</p><!-- /TMPL_IF -->
440 <!-- TMPL_VAR name="sql" -->
441 <!-- TMPL_VAR NAME='pagination_bar' DEFAULT="" -->
442 <!-- TMPL_UNLESS name="errors" -->
443 <table>
444 <tr><!-- TMPL_LOOP NAME="header_row" --><th><!-- TMPL_VAR NAME="cell" --></th><!-- /TMPL_LOOP --></tr>
445 <!-- TMPL_LOOP NAME="results" -->
446 <tr>
447     <!-- TMPL_LOOP NAME="cells" --><td><!-- TMPL_VAR NAME="cell" --></td><!-- /TMPL_LOOP -->
448 </tr>
449 <!-- /TMPL_LOOP -->
450 </table>
451 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
452 <fieldset class="action">
453 <label for="format">Download the report: </label>
454 <select name="format" id="format">
455 <option value="csv">Comma Separated Text</option>
456 <option value="tab">Tab Separated Text</option>
457 </select>
458 <input type="hidden" name="sql" value="<!-- TMPL_VAR NAME="sql" ESCAPE="html" -->" />
459 <input type="hidden" name="phase" value="Export" />
460 <input type="submit" name="submit" value="Download" /></fieldset>
461 </form>
462 <!-- /TMPL_UNLESS -->
463 <!-- /TMPL_IF -->
464
465 <!-- TMPL_IF NAME="create" -->
466 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
467 <fieldset class="rows">
468 <legend>Create Report From SQL</legend>
469 <ol>
470     <li><label for="reportname">Report Name:</label> <input type="text" id="reportname" name="reportname" <!-- TMPL_IF NAME="reportname" --> value="<!-- TMPL_VAR NAME="reportname" -->"<!-- /TMPL_IF --> /> </li>
471     <li><label for="notes">Notes:</label> <textarea id="notes" name="notes" cols="50" rows="2"><!-- TMPL_VAR NAME="notes" DEFAULT="" --></textarea></li>
472     <li><label for="types">Type:</label>
473         <select id="types" name="types">
474             <option value="1">Tabular</option>
475             <option value="2" disabled="disabled">Summary</option>
476             <option value="3" disabled="disabled">Matrix</option>
477         </select>
478     </li>
479 </ol>
480 </fieldset>
481 <fieldset class="rows">
482 <legend>SQL:</legend>
483 <div style="margin:1em;">
484 <textarea  id="sql" name="sql" cols="50" rows="10"><!-- TMPL_VAR NAME="sql" DEFAULT="" --></textarea>
485 </div>
486 </fieldset>
487
488 <fieldset class="action"><input type="hidden" name="phase" value="Save Report" />
489 <input type="submit" name="submit" value="Save Report" /></fieldset>
490 </form>
491 <!-- /TMPL_IF -->
492
493 <!-- TMPL_IF NAME="compound" -->
494 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
495 Master: <select name="master">
496 <!-- TMPL_LOOP NAME="savedreports" -->
497 <option value="<!-- TMPL_VAR NAME="id" -->"><!-- TMPL_VAR NAME="report_name"--></option>
498 <!-- /TMPL_LOOP -->
499 </select>
500 &nbsp;
501 Sub report:<select name="subreport">
502 <!-- TMPL_LOOP NAME="savedreports" -->
503 <option value="<!-- TMPL_VAR NAME="id" -->"><!-- TMPL_VAR NAME="report_name"--></option>
504 <!-- /TMPL_LOOP -->
505 </select>
506 <br />
507 <input type="hidden" name="phase" value="Save Compound" />
508 <input type="submit" name="submit" value="Save Compound" />
509 </form>
510 <!-- /TMPL_IF -->
511
512 <!-- TMPL_IF NAME="save_compound" -->
513 <!-- TMPL_VAR NAME="master" --> <br />
514 <!-- TMPL_VAR NAME="subsql" -->
515 <!-- /TMPL_IF -->
516
517
518 <!-- TMPL_IF NAME="retresults" -->
519 <h1>Saved Report Results</h1>
520 <h2><!-- TMPL_VAR NAME="name" --></h2>
521 <p><!-- TMPL_VAR NAME="notes" --></p>
522 <table>
523 <!-- TMPL_LOOP NAME="results" -->
524 <!-- TMPL_VAR NAME="row" -->
525 <!-- /TMPL_LOOP -->
526 </table>
527 <!-- /TMPL_IF -->
528
529 <!-- TMPL_IF NAME="showsql" -->
530 <textarea id="sql"><!-- TMPL_VAR NAME="sql" --></textarea>
531 <!-- /TMPL_IF -->
532
533 <!-- TMPL_IF NAME="editsql" -->
534 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
535 <input type="hidden" name="phase" value="Update SQL" />
536 <input type="hidden" name="id" value="<!-- TMPL_VAR NAME="id" -->"/>
537 <fieldset class="rows">
538 <legend>Edit SQL</legend>
539 <ol>
540 <li><label for="reportname">Report Name:</label><input type="text" id="reportname" name="reportname" value="<!-- TMPL_VAR NAME="reportname" -->" /></li>
541 <li><label for="notes">Notes:</label><textarea id="notes" name="notes" cols="50" rows="2"><!-- TMPL_VAR NAME="notes" --></textarea></li>
542 <li><textarea id="sql" name="sql" rows="10" cols="60"><!-- TMPL_VAR NAME="sql" --></textarea></li>
543 </ol>
544 </fieldset>
545
546 <fieldset class="action">
547 <input type="submit" name="submit" value="Update SQL" /></fieldset>
548 </form>
549
550
551 <!-- /TMPL_IF -->
552
553 <!-- TMPL_IF NAME="save_successful" -->
554 <!-- TMPL_UNLESS NAME="errors" -->
555 <h2>Your report has been saved</h2>
556 <p>The report you have created has now been saved. You can now</p>
557 <ul>
558     <li>Access this report from the: <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Saved Reports Page</a></li>
559     <li>Schedule this report to run using the: <a href="/cgi-bin/koha/tools/scheduler.pl">Scheduler Tool</a></li>
560     <li>Return to: <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Guided Reports</a></li>
561 </ul>
562 <!-- /TMPL_UNLESS -->
563 <!-- /TMPL_IF -->
564
565 <!-- TMPL_IF NAME="errors" -->
566 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
567 <div class="dialog alert">
568 <b>The following error was encountered:</b><br />
569 <!-- TMPL_LOOP name="errors" -->
570     <!-- TMPL_IF NAME="sqlerr" -->This report contains the SQL keyword <b><!-- TMPL_VAR name="sqlerr" --></b>.
571     <br />Use of this keyword is not allowed in Koha reports due to security and data integrity risks. Only SELECT queries are allowed.
572     <br />Please return to the &quot;Saved Reports&quot; screen and delete this report or retry creating a new one.
573     <!-- TMPL_ELSIF NAME="queryerr" -->The database returned the following error: <br /><!-- TMPL_VAR NAME="queryerr" --><br />Please check the log for further details.
574     <!-- TMPL_ELSE -->
575     <!-- /TMPL_IF -->
576 <!-- /TMPL_LOOP -->
577 </div>
578 <fieldset class="action"><input type="hidden" name="phase" value="Use saved" />
579 <input type="submit" name="submit" value="Saved Reports" /></fieldset>
580 </form>
581 <!-- /TMPL_IF -->
582
583 </div>
584 </div>
585 <div class="yui-b">
586 <!-- TMPL_INCLUDE NAME="guided-reports-view.inc" -->
587 </div>
588 </div>
589 <script type="text/javascript">
590 //<![CDATA[
591 function addColumn() {
592     $("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected");
593 }
594 function delColumn() {
595     $("#selectedColumns option:selected").remove();
596 }
597 $("#column_submit").submit(function() {
598     if ($("#selectedColumns option").size() < 1) {
599         alert(_("No columns selected!"));
600         return false;
601     }
602     $("#selectedColumns option").attr("selected", "selected");  // Select everything still in #selectedColumns
603     return true;
604 });
605 //]]>
606 </script>
607 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->