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