Getting stored results working
[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 -- Guided Reports</title>
3
4 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
5 <!-- TMPL_INCLUDE NAME="calendar.inc" -->
6 </head>
7 <body>
8 <!-- TMPL_INCLUDE NAME="header.inc" -->
9 <!-- TMPL_INCLUDE NAME="circ-search.inc" -->
10
11 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a>
12 &rsaquo; <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a> &rsaquo; <strong>Guided Reports Wizard </strong></div>
13
14 <div id="doc3" class="yui-t2">
15
16     <div id="bd">
17     <div id="yui-main">
18     <div class="yui-b">
19
20         <div class="details">
21
22 <!-- TMPL_IF NAME="start" -->
23      <h2>Guided Reports</h2>
24      <p>Use the guided reports engine to create non standard reports.
25 This feature aims to provide some middle ground between the built in
26 canned reports and writing custom SQL reports.</p>
27      <form action="/cgi-bin/koha/reports/guided_reports.pl">
28      <h3>Build And Run Reports</h3>                                                                                           
29                 <input type="submit" name="phase" value="Build new"/>
30                 <input type="submit" name="phase" value="Used saved"/>
31                 <input type="submit" name="phase" value="Create report from SQL"/>
32 <!--            <input type="submit" name="phase" value="Create Compound Report"/> -->
33 </form>
34 <h3>Reports Dictionary</h3>
35 <p>Use the reports dictionary to define custom criteria to use in your
36 reports</p>
37 <form action="/cgi-bin/koha/reports/dictionary.pl">
38 <input type="submit" name="phase" value="View Dictionary"/>
39 </form>
40 <!-- /TMPL_IF -->
41
42 <!-- TMPL_IF NAME="saved1" -->
43 <h1>Load Saved Reports</h1>
44 <p>Choose the report to run from the list</p>
45 <table>
46 <form action="/cgi-bin/koha/reports/guided_reports.pl">
47 <th>Report Name</th><th>Type</th><th>Notes</th><th>Saved Results</th><th>Delete</th>
48 <!-- TMPL_LOOP NAME="savedreports" -->
49 <tr><td><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=<!-- TMPL_VAR NAME="id" -->&phase=Run%20this%20report"><!-- TMPL_VAR NAME="report_name" --></td>
50 <td><!-- TMPL_VAR NAME="type" --></td>
51 <td><!-- TMPL_VAR NAME="notes" --></td>
52 <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 -->
53 </td>
54 <td><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=<!-- TMPL_VAR NAME="id" -->&phase=Delete%20Saved">Delete</a></td></tr>
55 <!-- /TMPL_LOOP -->
56 </form>
57 </table>
58 <!-- /TMPL_IF -->
59
60
61 <!-- TMPL_IF NAME="build1" -->
62 <h1>Build A Report</h1>
63 <h3>Step 1 of 6: Choose a Module to Report on</h3>
64 <form action="/cgi-bin/koha/reports/guided_reports.pl">
65 <select name="areas">
66 <!-- TMPL_LOOP NAME="areas" -->
67 <option value="<!-- TMPL_VAR NAME="id" -->"><!-- TMPL_VAR NAME="name"--></option>
68 <!-- /TMPL_LOOP -->
69 </select>
70 <br />
71 <input type=button value="Back" onClick="history.go(-1)">
72  <input type="submit" name="phase" value="Report on this Area">
73 </form>
74 <!-- /TMPL_IF -->
75
76
77 <!-- TMPL_IF NAME="build2" -->
78 <h1>Build A Report</h1>
79 <h3>Step 2 of 6: Pick a Report Type</h3>
80 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
81 <input type="hidden" name="area" value="<!-- TMPL_VAR NAME="area" -->">
82 <select name="types">
83 <!-- TMPL_LOOP NAME="types" -->
84 <option value="<!-- TMPL_VAR NAME="id" -->"><!-- TMPL_VAR NAME="name"--></option>
85 <!-- /TMPL_LOOP -->
86 </select>
87 <br />
88 <input type=button value="Back" onClick="history.go(-1)">
89  <input type="submit" name="phase" value="Choose this type">
90 <br />
91 </form>
92 Tabular:
93 <img src="/intranet-tmpl/prog/img/reports-tabular-graphic.gif" />
94 <!--- Summary and Matrix reports have not yet been implemented-->
95 <!--Summary:
96 <img src="/intranet-tmpl/prog/img/reports-summary-graphic.gif" />
97 Matrix:
98 <img src="/intranet-tmpl/prog/img/reports-matrix-graphic.gif" />-->
99
100 <!-- /TMPL_IF -->
101
102 <!-- TMPL_IF NAME="build3" -->
103 <h3>Step 3 of 6: Select Columns for Display</h3>
104 <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>
105 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
106         <input type="hidden" name="area" value="<!-- TMPL_VAR NAME="area" -->">
107         <input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->">
108         <select id="availableColumns" name="oldcolumns2" multiple size="25" style="width:200px;height:300px;">
109 <!-- TMPL_LOOP NAME="columns" -->
110 <!-- TMPL_IF NAME="table" -->
111
112 <!-- TMPL_IF NAME="__first__" -->
113 <!-- TMPL_ELSE -->
114 </optgroup>
115 <!-- /TMPL_IF -->
116
117 <optgroup label="<!-- TMPL_VAR NAME="table"-->">
118 <!-- TMPL_ELSE -->
119 <option value="<!-- TMPL_VAR NAME="name" -->">
120 <!-- TMPL_IF NAME="description" --><!-- TMPL_VAR NAME="description" -->
121 <!-- TMPL_ELSE -->
122 <!-- TMPL_VAR NAME="name" -->
123 <!-- /TMPL_IF -->
124 <!-- /TMPL_IF -->
125 </option>
126 <!-- /TMPL_LOOP -->
127 </select>
128 <input type="button" name="Add" value="Add" class="button" onClick="addColumn()"/>
129 <select id="selectedColumns" name="columns" multiple size="25" style="width:200px;height:300px;"></select>
130 <input type="button" name="delete" value="delete" class="button" onClick="delColumn()"/>
131
132 <input type=button value="Back" onClick="history.go(-1)">
133 <input type="submit" name="phase" value="Choose these columns">
134 </form>
135 <!-- /TMPL_IF -->
136
137 <!-- TMPL_IF NAME="build4" -->
138 <h3>Step 4 of 6: Select Criteria to Limit on </h3>
139
140 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post" >
141 <input type="hidden" name="area" value="<!-- TMPL_VAR NAME="area" -->">
142 <input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->">
143 <input type="hidden" name="column" value="<!-- TMPL_VAR NAME="column" -->">
144 <table>
145 <!-- TMPL_LOOP NAME="criteria" -->
146 <tr><td><input type=checkbox name="criteria_column" value="<!-- TMPL_VAR
147 NAME="name" -->"> <!-- TMPL_VAR NAME="description" --> 
148 </td>
149 <!-- TMPL_IF NAME="date" -->
150 <td><input type="text" size="10" id="<!-- TMPL_VAR NAME="name"
151 -->_value" name="<!-- TMPL_VAR NAME="name" -->_value" value=""
152 ><img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="buttonfrom1" style="cursor: pointer;"  />                 
153 <script type="text/javascript">   
154 Calendar.setup({  
155 inputField     : "<!-- TMPL_VAR NAME="name" -->_value",                               
156 ifFormat       : "%Y-%m-%d",                               
157 button         : "buttonfrom1",                               
158 align          : "Tl" 
159 });     
160 </script>          
161 </td></tr>
162 <!-- TMPL_ELSE -->
163 <td><select name="<!-- TMPL_VAR NAME="name" -->_value">
164 <!-- TMPL_LOOP NAME="values" -->
165 <option value="<!-- TMPL_VAR NAME="availablevalues"-->"><!-- TMPL_VAR NAME="availablevalues" --></option>
166 <!-- /TMPL_LOOP -->
167 </select>
168 </td></tr>
169 <!-- /TMPL_IF -->
170 <!-- /TMPL_LOOP -->
171 </table><br />
172 <!-- TMPL_IF NAME="definitions" -->
173 <h4>Dictionary Definitions</h4> <br />
174 <table>
175 <!-- TMPL_LOOP NAME="definitions" -->
176
177        <tr><td><input type=checkbox name="definition" value="<!--
178 TMPL_VAR NAME="id" -->"> <!-- TMPL_VAR NAME="name" --></td></tr>
179
180 <!-- /TMPL_LOOP -->
181 </table>
182 <!-- /TMPL_IF -->
183 <input type=button value="Back" onClick="history.go(-1)">
184  <input type="submit" name="phase" value="Choose these criteria">
185 </form>
186 <!-- /TMPL_IF -->
187
188
189 <!-- TMPL_IF NAME="build5" -->
190 <h3>Step 5 of 6: Pick which columns to total</h3>
191 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
192 <input type="hidden" name="area" value="<!-- TMPL_VAR NAME="area" -->">
193 <input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->">
194 <input type="hidden" name="column" value="<!-- TMPL_VAR NAME="column" -->">
195 <input type="hidden" name="definition" value="<!-- TMPL_VAR NAME="definition" -->">
196 <input type="hidden" name="criteria" value="<!-- TMPL_VAR NAME="criteriastring" -->">
197 <table>
198 <!-- TMPL_LOOP NAME="total_by" -->
199 <tr><td><input type=checkbox name="total_by" value="<!-- TMPL_VAR
200 NAME="name" -->"> <!-- TMPL_VAR NAME="name"--></td>
201 <td><select name="<!-- TMPL_VAR NAME="name" -->_tvalue">
202
203 <!-- TMPL_LOOP NAME="select" -->
204 <option value="<!-- TMPL_VAR NAME="value"-->"><!-- TMPL_VAR NAME="value" --></option>
205 <!-- /TMPL_LOOP -->
206 </select>
207
208 </td></tr>
209 <!-- /TMPL_LOOP -->
210 </table>
211 <input type=button value="Back" onClick="history.go(-1)">
212  <input type="submit" name="phase" value="Choose These Operations">
213 </form>
214 <!-- /TMPL_IF -->
215
216
217 <!-- TMPL_IF NAME="build6" -->
218 <h3>Step 6 of 6: Select how you want the report ordered</h3>
219 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
220 <input type="hidden" name="area" value="<!-- TMPL_VAR NAME="area" -->">
221 <input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->">
222 <input type="hidden" name="column" value="<!-- TMPL_VAR NAME="column" -->">
223 <input type="hidden" name="criteria" value="<!-- TMPL_VAR NAME="criteriastring" -->">
224 <input type="hidden" name="definition" value="<!-- TMPL_VAR NAME="definition" -->">
225 <input type="hidden" name="totals" value="<!-- TMPL_VAR NAME="totals" -->">
226 <table><!-- TMPL_LOOP NAME="order_by" -->
227 <tr><td><input type=checkbox name="order_by" value="<!-- TMPL_VAR
228 NAME="name" -->"> <!-- TMPL_VAR NAME="name"--></td><td>
229 <select name="<!-- TMPL_VAR NAME="name" -->_ovalue">
230
231 <!-- TMPL_LOOP NAME="select" -->
232 <option value="<!-- TMPL_VAR NAME="value"-->"><!-- TMPL_VAR NAME="value" --></option>
233 <!-- /TMPL_LOOP -->
234 </select>
235 </td></tr>
236
237 <!-- /TMPL_LOOP -->
238 </table>
239 <br />
240 <input type=button value="Back" onClick="history.go(-1)">
241  <input type="submit" name="phase" value="Build Report">
242 </form>
243 <!-- /TMPL_IF -->
244
245
246 <!-- TMPL_IF NAME="showreport" -->
247 <!-- TMPL_VAR NAME="sql" -->
248
249 <p>
250 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
251 <input type="hidden" name="sql" value="<!-- TMPL_VAR NAME="sql" -->">
252 <input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->">
253 <input type="submit" name="phase" value="Save">  <input type="submit" name="phase" value="Execute">
254 </form>
255 <!-- /TMPL_IF -->
256
257 <!-- TMPL_IF NAME="save" -->
258 <h1>Save Your Custom Report</h1>
259 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
260 <input type="hidden" name="sql" value="<!-- TMPL_VAR NAME="sql" -->">
261 <input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->">
262 Report Name: <input type="text" name="reportname"> <br />
263 Notes: <textarea name="notes"></textarea><br />
264 <input type="submit" name="phase" value="Save Report">
265 </form>
266 <!-- /TMPL_IF -->
267
268 <!-- TMPL_IF NAME="execute" -->
269 <h1>Show results</h1>
270 <h2>Report Name</h2>
271 <p>Report description</p>
272 <table>
273 <!-- TMPL_LOOP NAME="results" -->
274 <!-- TMPL_VAR NAME="row" -->
275 <!-- /TMPL_LOOP -->
276 <p>Download the report</p>
277 </table>
278 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
279 <select name="format">
280 <option value="csv">Comma Separated Text</option>
281 <option value="tab">Tab Separated Text</option>
282 </select>
283 <input type="submit" name="phase" value="Export">
284 <input type="hidden" name="sql" value="<!-- TMPL_VAR NAME="sql" -->">
285 </form>
286 <!-- /TMPL_IF -->
287
288 <!-- TMPL_IF NAME="create" -->
289 <h1>Create Report From SQL</h1>
290 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
291 Report Name: <input type="text" name="reportname"> <br />
292 Type:
293 <select name="types">
294 <!-- TMPL_LOOP NAME="types" -->
295 <option value="<!-- TMPL_VAR NAME="id" -->"><!-- TMPL_VAR NAME="name"--></option>
296 <!-- /TMPL_LOOP -->
297 </select>
298 <br />
299 SQl: <textarea name="sql" cols=30 rows=10></textarea><br />
300 <input type="submit" name="phase" value="Save Report">
301 </form>
302 <!-- /TMPL_IF -->
303
304 <!-- TMPL_IF NAME="compound" -->
305 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
306 Master: <select name="master">
307 <!-- TMPL_LOOP NAME="savedreports" -->
308 <option value="<!-- TMPL_VAR NAME="id" -->"><!-- TMPL_VAR NAME="report_name"--></option>
309 <!-- /TMPL_LOOP -->
310 </select>
311  &nbsp;
312 Sub report:<select name="subreport">
313 <!-- TMPL_LOOP NAME="savedreports" -->
314 <option value="<!-- TMPL_VAR NAME="id" -->"><!-- TMPL_VAR NAME="report_name"--></option>
315 <!-- /TMPL_LOOP -->
316 </select>
317 <br />
318 <input type="submit" name="phase" value="Save Compound">
319 </form>
320 <!-- /TMPL_IF -->
321
322 <!-- TMPL_IF NAME="save_compound" -->
323 <!-- TMPL_VAR NAME="master" --> <br />
324 <!-- TMPL_VAR NAME="subsql" -->
325 <!-- /TMPL_IF -->
326
327
328 <!-- TMPL_IF NAME="retresults" -->
329 <table>
330 <!-- TMPL_LOOP NAME="results" -->
331 <!-- TMPL_VAR NAME = "row" -->
332 <!-- /TMPL_LOOP -->
333 </table>
334 <!-- /TMPL_IF -->
335
336 </div>
337 </div>
338 </div>
339 <div class="yui-b">
340 <!-- TMPL_INCLUDE NAME="guided-reports-view.inc" -->
341 </div>
342 </div>
343 <script type="text/javascript">
344 function setObjects() {
345         selectedColumnsObj=document.getElementById('selectedColumns');
346         availableColumnsObj=document.getElementById('availableColumns');
347 }
348 setObjects();
349
350 function addColumn() {
351         for (i=0;i<availableColumnsObj.length;i++) {
352                 if (availableColumnsObj.options[i].selected==true) {
353                         var newColumnObj=document.createElement("OPTION");
354                         newColumnObj.value=availableColumnsObj.options[i].value;
355                         newColumnObj.text=availableColumnsObj.options[i].text;
356                         selectedColumnsObj.appendChild(newColumnObj);
357                         newColumnObj.selected=true;
358                 }
359         }
360 }
361
362 function delColumn() {
363         for (i=0;i<=selectedColumnsObj.options.length;i++) {
364                 if (selectedColumnsObj.options.selectedIndex>=0)
365                 selectedColumnsObj.remove(selectedColumnsObj.options.selectedIndex)
366         }
367 }
368 </script>
369 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->