MT 1443 : better reports on items
[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="button" name="back" value="&lt;&lt; Back" onclick="javascript:history.back()" />
163     <input type="submit" name="submit" value="Next &gt;&gt;" />
164 </fieldset>
165 </form>
166 </div>
167 <div class="yui-gb"><div class="yui-u first"></div>
168
169 <!--- Summary and Matrix reports have not yet been implemented-->
170 <!--<div class="yui-u">Summary:
171 <img src="/intranet-tmpl/prog/img/reports-summary-graphic.gif" /></div>
172 <div class="yui-u">Matrix:
173 <img src="/intranet-tmpl/prog/img/reports-matrix-graphic.gif" /></div>-->
174
175 <!-- /TMPL_IF -->
176
177 <!-- TMPL_IF NAME="build3" -->
178 <h3>Step 3 of 6: Select Columns for Display</h3>
179 <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>
180
181 <form id="column_submit" action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
182         <input type="hidden" name="area" value="<!-- TMPL_VAR NAME="area" -->" />
183         <input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->" />
184         <fieldset>
185 <div class="yui-g">
186 <div class="yui-u first">       <div style="float: left;"><select id="availableColumns" name="oldcolumns2" multiple="multiple" size="25" style="min-width: 200px;height:300px;">
187 <!-- TMPL_LOOP NAME="columns" -->
188 <!-- TMPL_IF NAME="table" -->
189
190 <!-- TMPL_IF NAME="__first__" -->
191 <!-- TMPL_ELSE -->
192 </optgroup>
193 <!-- /TMPL_IF -->
194
195 <optgroup label="<!-- TMPL_VAR NAME="table"-->">
196 <!-- TMPL_ELSE -->
197 <option value="<!-- TMPL_VAR NAME="name" -->">
198 <!-- TMPL_IF NAME="description" --><!-- TMPL_VAR NAME="description" -->
199 <!-- TMPL_ELSE -->
200 <!-- TMPL_VAR NAME="name" -->
201 <!-- /TMPL_IF -->
202 </option>
203 <!-- /TMPL_IF -->
204 <!-- /TMPL_LOOP -->
205 </optgroup>
206 </select></div>
207 <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 />
208 <input type="button" name="delete" value="&lt;&lt; Delete" class="button" style="width: 6em; margin: 1em 0;" onclick="delColumn()" /></div>
209 </div>
210
211 <div class="yui-u">
212 <select id="selectedColumns" name="columns" multiple="multiple" size="25" style="width:200px; height:300px;"></select>
213 </div>
214 </div>
215 </fieldset>
216 <div class="yui-g">
217 <fieldset class="action">
218     <input type="hidden" name="phase" value="Choose these columns" />
219     <input type="button" name="back" value="&lt;&lt; Back" onclick="javascript:history.back()" />
220     <input type="submit" name="submit" value="Next &gt;&gt;" />
221 </fieldset>
222 </div>
223 </form>
224
225 <!-- /TMPL_IF -->
226
227 <!-- TMPL_IF NAME="build4" -->
228 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post" >
229     <input type="hidden" name="area" value="<!-- TMPL_VAR NAME="area" -->" />
230     <input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->" />
231     <input type="hidden" name="column" value="<!-- TMPL_VAR NAME="column" -->" />
232     <fieldset><legend>Step 4 of 6: Select Criteria to Limit on</legend>
233         <table>
234             <!-- TMPL_LOOP NAME="criteria" -->
235             <tr>
236                 <td>
237                     <input type="checkbox" name="criteria_column" id="<!-- TMPL_VAR NAME="name" -->" value="<!-- TMPL_VAR NAME="name" -->" /> 
238                     <label for="<!-- TMPL_VAR NAME="name" -->"><!-- TMPL_VAR NAME="description" --> </label>
239                 </td>
240                 <!-- TMPL_IF NAME="date" -->
241                 <td>
242                     <input type="text" size="10" id="<!-- TMPL_VAR NAME="name" -->_value" name="<!-- TMPL_VAR NAME="name" -->_value" value="" />
243                     <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" />                 
244                     <script type="text/javascript">   
245                         Calendar.setup({  
246                         inputField     : "<!-- TMPL_VAR NAME="name" -->_value",
247                         ifFormat       : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
248                         button         : "buttonfrom<!-- TMPL_VAR NAME="name" -->",
249                         align          : "Tl" 
250                         });     
251                     </script>          
252                 </td>
253             </tr>
254             <!-- TMPL_ELSE -->
255                 <!-- TMPL_IF NAME="textrange" -->
256                     <td>from
257                         <input type="text" size="10" id="<!-- TMPL_VAR NAME="from" -->_value" name="<!-- TMPL_VAR NAME="from" -->_value" value="" /> to 
258                         <input type="text" size="10" id="<!-- TMPL_VAR NAME="to" -->_value" name="<!-- TMPL_VAR NAME="to" -->_value" value="" />
259                     </td>
260                     </tr>
261                 <!-- TMPL_ELSE -->
262                     <!-- TMPL_IF NAME="daterange" -->
263                     <td>from 
264                         <input type="text" size="10" id="from_<!-- TMPL_VAR NAME="name" -->_value" name="from_<!-- TMPL_VAR NAME="name" -->_value" value="" />
265                         <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" />                 
266                         <script type="text/javascript">   
267                             Calendar.setup({  
268                             inputField     : "from_<!-- TMPL_VAR NAME="name" -->_value",
269                             ifFormat       : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
270                             button         : "buttonfromfrom_<!-- TMPL_VAR NAME="name" -->",
271                             align          : "Tl" 
272                             });     
273                         </script>         
274                         to
275                         <input type="text" size="10" id="to_<!-- TMPL_VAR NAME="name" -->_value" name="to_<!-- TMPL_VAR NAME="name" -->_value" value="" />
276                         <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" />                 
277                         <script type="text/javascript">   
278                             Calendar.setup({  
279                             inputField     : "to_<!-- TMPL_VAR NAME="name" -->_value",
280                             ifFormat       : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
281                             button         : "buttonfromto_<!-- TMPL_VAR NAME="name" -->",
282                             align          : "Tl" 
283                             });     
284                         </script>        
285                     </td>
286                 </tr>
287                     <!-- TMPL_ELSE -->
288                         <td>
289                             <select name="<!-- TMPL_VAR NAME="name" -->_value">
290                                 <!-- TMPL_LOOP NAME="values" -->
291                                 <option value="<!-- TMPL_VAR NAME="availablevalues"-->"><!-- TMPL_VAR NAME="availablevalues" --></option>
292                                 <!-- /TMPL_LOOP -->
293                             </select>
294                        </td>
295                        </tr>
296                     <!-- /TMPL_IF -->
297                 <!-- /TMPL_IF -->
298             <!-- /TMPL_IF -->
299         <!-- /TMPL_LOOP -->
300         </table>
301     </fieldset>
302
303 <!-- TMPL_IF NAME="definitions" -->
304 <fieldset><legend>Dictionary Definitions</legend><table>
305 <!-- TMPL_LOOP NAME="definitions" -->
306        <tr><td><input type="checkbox" name="definition" value="<!--
307 TMPL_VAR NAME="id" -->" /> <!-- TMPL_VAR NAME="name" --></td></tr>
308 <!-- /TMPL_LOOP -->
309 </table>
310 <!-- /TMPL_IF -->
311
312 <fieldset class="action"><input type="hidden" name="phase" value="Choose these criteria" />
313     <input type="button" name="back" value="&lt;&lt; Back" onclick="javascript:history.back()" />
314     <input type="submit" name="submit" value="Next &gt;&gt;" /> </fieldset>
315 </form>
316 <!-- /TMPL_IF -->
317
318
319 <!-- TMPL_IF NAME="build5" -->
320 <h3>Step 5 of 6: Pick which columns to total</h3>
321 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
322 <input type="hidden" name="area" value="<!-- TMPL_VAR NAME="area" -->" />
323 <input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->" />
324 <input type="hidden" name="column" value="<!-- TMPL_VAR NAME="column" -->" />
325 <input type="hidden" name="definition" value="<!-- TMPL_VAR NAME="definition" -->" />
326 <input type="hidden" name="criteria" value="<!-- TMPL_VAR NAME="criteriastring" -->" />
327 <fieldset><table>
328 <!-- TMPL_LOOP NAME="total_by" -->
329 <tr><td><input type="checkbox" name="total_by" id="<!-- TMPL_VAR
330 NAME="name" -->" value="<!-- TMPL_VAR
331 NAME="name" -->" /> <label for="<!-- TMPL_VAR
332 NAME="name" -->"><!-- TMPL_VAR NAME="name" --></label></td>
333 <td><select name="<!-- TMPL_VAR NAME="name" -->_tvalue">
334
335 <!-- TMPL_LOOP NAME="select" -->
336 <option value="<!-- TMPL_VAR NAME="value"-->"><!-- TMPL_VAR NAME="value" --></option>
337 <!-- /TMPL_LOOP -->
338 </select>
339
340 </td></tr>
341 <!-- /TMPL_LOOP -->
342 </table></fieldset>
343
344 <fieldset class="action"><input type="hidden" name="phase" value="Choose These Operations" />
345     <input type="button" name="back" value="&lt;&lt; Back" onclick="javascript:history.back()" />
346     <input type="submit" name="submit" value="Next &gt;&gt;" /></fieldset>
347 </form>
348 <!-- /TMPL_IF -->
349
350
351 <!-- TMPL_IF NAME="build6" -->
352 <h3>Step 6 of 6: Choose how you want the report ordered</h3>
353 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
354 <input type="hidden" name="area" value="<!-- TMPL_VAR NAME="area" -->" />
355 <input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->" />
356 <input type="hidden" name="column" value="<!-- TMPL_VAR NAME="column" -->" />
357 <input type="hidden" name="criteria" value="<!-- TMPL_VAR NAME="criteriastring" -->" />
358 <input type="hidden" name="definition" value="<!-- TMPL_VAR NAME="definition" -->" />
359 <input type="hidden" name="totals" value="<!-- TMPL_VAR NAME="totals" -->" />
360 <fieldset><table><!-- TMPL_LOOP NAME="order_by" -->
361 <tr><td><input type="checkbox" id="<!-- TMPL_VAR
362 NAME="name" -->" name="order_by" value="<!-- TMPL_VAR
363 NAME="name" -->" /> <label for="<!-- TMPL_VAR
364 NAME="name" -->"><!-- TMPL_VAR NAME="name"--></label></td><td>
365 <select name="<!-- TMPL_VAR NAME="name" -->_ovalue">
366
367 <!-- TMPL_LOOP NAME="select" -->
368 <option value="<!-- TMPL_VAR NAME="value"-->"><!-- TMPL_VAR NAME="value" --></option>
369 <!-- /TMPL_LOOP -->
370 </select>
371 </td></tr>
372
373 <!-- /TMPL_LOOP -->
374 </table></fieldset>
375
376 <fieldset class="action">
377 <input type="hidden" name="phase" value="Build Report" />
378 <input type="submit" name="submit" value="Finish" /></fieldset>
379 </form>
380 <!-- /TMPL_IF -->
381
382
383 <!-- TMPL_IF NAME="showreport" -->
384 <h1>Confirm Custom Report</h1>
385 <p>Your report will be generated with the following SQL statement.</p>
386 <p> 
387 <!-- TMPL_VAR NAME="sql" -->
388 </p>
389
390 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
391 <input type="hidden" name="sql" value="<!-- TMPL_VAR NAME="sql" ESCAPE="html" -->" />
392 <input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->" />
393 <p>You will need to save the report before you can execute it</p>
394 <fieldset class="action"><input type="hidden" name="phase" value="Save" />  
395 <input type="submit" name="submit" value="Save" />  </fieldset>
396 </form>
397 <!-- /TMPL_IF -->
398
399 <!-- TMPL_IF NAME="save" -->
400 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
401 <input type="hidden" name="sql" value="<!-- TMPL_VAR NAME="sql" ESCAPE="html" -->" />
402 <input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->" />
403 <fieldset class="rows">
404 <legend>Save Your Custom Report</legend>
405 <ol>
406         <li><label for="reportname">Report Name: </label><input type="text" id="reportname" name="reportname" /></li>
407         <li><label for="notes">Notes:</label> <textarea name="notes" id="notes"></textarea></li>
408 </ol></fieldset>
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="execute" -->
415 <h1><!-- TMPL_VAR NAME="name" --></h1>
416 <!-- TMPL_IF NAME="notes" --><p><!-- TMPL_VAR NAME="notes" --></p><!-- /TMPL_IF -->
417 <!-- TMPL_IF NAME="unlimited_total" --><p>Total number of rows matching the (unlimited) query is <!-- TMPL_VAR NAME="unlimited_total" -->.</p><!-- /TMPL_IF -->
418 <!-- TMPL_VAR NAME='pagination_bar' DEFAULT="" -->
419 <!-- TMPL_UNLESS name="errors" -->
420 <table>
421 <tr><!-- TMPL_LOOP NAME="header_row" --><th><!-- TMPL_VAR NAME="cell" --></th><!-- /TMPL_LOOP --></tr>
422 <!-- TMPL_LOOP NAME="results" -->
423 <tr>
424     <!-- TMPL_LOOP NAME="cells" --><td><!-- TMPL_VAR NAME="cell" --></td><!-- /TMPL_LOOP -->
425 </tr>
426 <!-- /TMPL_LOOP -->
427 </table>
428 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
429 <fieldset class="action">
430 <label for="format">Download the report: </label>
431 <select name="format" id="format">
432 <option value="csv">Comma Separated Text</option>
433 <option value="tab">Tab Separated Text</option>
434 </select>
435 <input type="hidden" name="sql" value="<!-- TMPL_VAR NAME="sql" ESCAPE="html" -->" />
436 <input type="hidden" name="phase" value="Export" />
437 <input type="submit" name="submit" value="Download" /></fieldset>
438 </form>
439 <!-- /TMPL_UNLESS -->
440 <!-- /TMPL_IF -->
441
442 <!-- TMPL_IF NAME="create" -->
443 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
444 <fieldset class="rows">
445 <legend>Create Report From SQL</legend>
446 <ol>
447         <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>
448         <li><label for="notes">Notes:</label> <textarea id="notes" name="notes" cols="50" rows="2"><!-- TMPL_VAR NAME="notes" DEFAULT="" --></textarea></li>
449         <li><label for="types">Type:</label>
450         <select id="types" name="types">
451             <option value="1">Tabular</option>
452             <option value="2" disabled="disabled">Summary</option>
453             <option value="3" disabled="disabled">Matrix</option>
454         </select>
455     </li>
456         <li><label for="sql">SQL: </label><textarea  id="sql" name="sql" cols="50" rows="10"><!-- TMPL_VAR NAME="sql" DEFAULT="" --></textarea></li>
457 </ol>
458 </fieldset>
459
460 <fieldset class="action"><input type="hidden" name="phase" value="Save Report" />
461 <input type="submit" name="submit" value="Save Report" /></fieldset>
462 </form>
463 <!-- /TMPL_IF -->
464
465 <!-- TMPL_IF NAME="compound" -->
466 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
467 Master: <select name="master">
468 <!-- TMPL_LOOP NAME="savedreports" -->
469 <option value="<!-- TMPL_VAR NAME="id" -->"><!-- TMPL_VAR NAME="report_name"--></option>
470 <!-- /TMPL_LOOP -->
471 </select>
472  &nbsp;
473 Sub report:<select name="subreport">
474 <!-- TMPL_LOOP NAME="savedreports" -->
475 <option value="<!-- TMPL_VAR NAME="id" -->"><!-- TMPL_VAR NAME="report_name"--></option>
476 <!-- /TMPL_LOOP -->
477 </select>
478 <br />
479 <input type="hidden" name="phase" value="Save Compound" />
480 <input type="submit" name="submit" value="Save Compound" />
481 </form>
482 <!-- /TMPL_IF -->
483
484 <!-- TMPL_IF NAME="save_compound" -->
485 <!-- TMPL_VAR NAME="master" --> <br />
486 <!-- TMPL_VAR NAME="subsql" -->
487 <!-- /TMPL_IF -->
488
489
490 <!-- TMPL_IF NAME="retresults" -->
491 <h1>Saved Report Results</h1>
492 <h2><!-- TMPL_VAR NAME="name" --></h2>
493 <p><!-- TMPL_VAR NAME="notes" --></p>
494 <table>
495 <!-- TMPL_LOOP NAME="results" -->
496 <!-- TMPL_VAR NAME="row" -->
497 <!-- /TMPL_LOOP -->
498 </table>
499 <!-- /TMPL_IF -->
500
501 <!-- TMPL_IF NAME="showsql" -->
502 <textarea id="sql"><!-- TMPL_VAR NAME="sql" --></textarea>
503 <!-- /TMPL_IF -->
504
505 <!-- TMPL_IF NAME="editsql" -->
506 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
507 <input type="hidden" name="phase" value="Update SQL" />
508 <input type="hidden" name="id" value="<!-- TMPL_VAR NAME="id" -->"/>
509 <fieldset class="rows">
510 <legend>Edit SQL</legend>
511 <ol>
512 <li><label for="reportname">Report Name:</label><input type="text" id="reportname" name="reportname" value="<!-- TMPL_VAR NAME="reportname" -->" /></li>
513 <li><label for="notes">Notes:</label><textarea id="notes" name="notes" cols="50" rows="2"><!-- TMPL_VAR NAME="notes" --></textarea></li>
514 <li><textarea id="sql" name="sql" rows="10" cols="60"><!-- TMPL_VAR NAME="sql" --></textarea></li>
515 </ol>
516 </fieldset>
517
518 <fieldset class="action">
519 <input type="submit" name="submit" value="Update SQL" /></fieldset>
520 </form>
521
522
523 <!-- /TMPL_IF -->
524
525 <!-- TMPL_IF NAME="save_successful" -->
526 <!-- TMPL_UNLESS NAME="errors" -->
527 <h2>Your report has been saved</h2>
528 <p>The report you have created has now been saved. You can now</p>
529 <ul>
530         <li>Access this report from the: <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Saved Reports Page</a></li>
531         <li>Schedule this report to run using the: <a href="/cgi-bin/koha/tools/scheduler.pl">Scheduler Tool</a></li>
532         <li>Return to: <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Guided Reports</a></li>
533 </ul>
534 <!-- /TMPL_UNLESS -->
535 <!-- /TMPL_IF -->
536
537 <!-- TMPL_IF NAME="errors" -->
538 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
539 <div class="dialog alert">
540 <b>The following error was encountered:</b><br />
541 <!-- TMPL_LOOP name="errors" -->
542     <!-- TMPL_IF NAME="sqlerr" -->This report contains the SQL keyword <b><!-- TMPL_VAR name="sqlerr" --></b>.
543     <br />Use of this keyword is not allowed in Koha reports due to security and data integrity risks. Only SELECT queries are allowed.
544     <br />Please return to the &quot;Saved Reports&quot; screen and delete this report or retry creating a new one.
545     <!-- TMPL_ELSIF NAME="queryerr" -->The database returned the following error: <br /><!-- TMPL_VAR NAME="queryerr" --><br />Please check the log for further details.
546     <!-- TMPL_ELSE -->
547     <!-- /TMPL_IF -->
548 <!-- /TMPL_LOOP -->
549 </div>
550 <fieldset class="action"><input type="hidden" name="phase" value="Use saved" />
551 <input type="submit" name="submit" value="Saved Reports" /></fieldset>
552 </form>
553 <!-- /TMPL_IF -->
554
555 </div>
556 </div>
557 </div>
558 <div class="yui-b">
559 <!-- TMPL_INCLUDE NAME="guided-reports-view.inc" -->
560 </div>
561 </div>
562 <script type="text/javascript">
563 //<![CDATA[
564 function addColumn() {
565     $("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected");
566 }
567 function delColumn() {
568     $("#selectedColumns option:selected").remove();
569 }
570 $("#column_submit").submit(function() {
571     if ($("#selectedColumns option").size() < 1) {
572         alert(_("No columns selected!"));
573         return false;
574     }
575     $("#selectedColumns option").attr("selected", "selected");  // Select everything still in #selectedColumns
576     return true;
577 });
578 //]]>
579 </script>
580 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->