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