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