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