<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
-<title>Koha -- Reports</title>
-
+<title>Koha › Reports › Guided Reports Wizard
+<!-- TMPL_IF NAME="saved1" -->› Saved Reports
+<!-- TMPL_ELSIF NAME="create" -->› Create from SQL
+<!-- TMPL_ELSIF NAME="showsql" -->› Saved Reports › SQL View
+<!-- TMPL_ELSIF NAME="execute" -->› Saved Reports › <!-- TMPL_VAR NAME="name" --> Report
+<!-- TMPL_ELSIF NAME="buildx" -->› Build A Report, Step <!-- TMPL_VAR NAME="buildx" --> of 6:
+ <!-- TMPL_IF NAME="build1" -->Choose a Module
+ <!-- TMPL_ELSIF NAME="build2" -->Pick a Report Type
+ <!-- TMPL_ELSIF NAME="build3" -->Select Columns for Display
+ <!-- TMPL_ELSIF NAME="build4" -->Select Criteria to Limit on
+ <!-- TMPL_ELSIF NAME="build5" -->Pick which columns to total
+ <!-- TMPL_ELSIF NAME="build6" -->Select how you want the report ordered
+ <!-- /TMPL_IF -->
+<!-- /TMPL_IF -->
+</title>
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
<!-- TMPL_INCLUDE NAME="calendar.inc" -->
+<style type="text/css">
+ #sql { width: 90%; height: 9em; border: 1px solid #EEE; }
+</style>
+<script type="text/javascript">
+//<![CDATA[
+$(document).ready(function(){
+<!-- TMPL_IF NAME="showsql" -->
+ $("#sql").focus(function() {
+ $(this).select();
+ });
+<!-- /TMPL_IF -->
+<!-- TMPL_IF NAME="saved1" -->
+ $(".confirmdelete").click(function(){
+ $(this).parents('tr').attr("class","warn");
+ if(confirm("Are you sure you want to "+$(this).attr("title")+"?")){
+ return true;
+ } else {
+ $(this).parents('tr').attr("class","");
+ return false;
+ }
+ });
+<!-- /TMPL_IF -->
+});
+//]]>
+ </script>
</head>
<body>
<!-- TMPL_INCLUDE NAME="header.inc" -->
<!-- TMPL_INCLUDE NAME="circ-search.inc" -->
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/circ/circulation.pl">Reports</a> › <strong>Guided Reports Wizard </strong></div>
-
-<div id="doc3" class="yui-t2">
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a>
+› <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a>
+› <a href="/cgi-bin/koha/reports/guided_reports.pl">Guided Reports Wizard</a>
+›
+ <!-- TMPL_IF NAME="saved1" --><strong>Saved Reports</strong>
+ <!-- TMPL_ELSIF NAME="create" --><strong>Create from SQL</strong>
+ <!-- TMPL_ELSIF NAME="showsql" --><a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Saved Reports</a> › <strong>SQL View</strong>
+ <!-- TMPL_ELSIF NAME="execute" --><a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Saved Reports</a> › <em><!-- TMPL_VAR NAME="name" --></em> Report
+ <!-- TMPL_ELSIF NAME="buildx" --><a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Build%20new">Build A Report</a> › Step <!-- TMPL_VAR NAME="buildx" --> of 6:
+ <!-- TMPL_IF NAME="build1" -->Choose a Module
+ <!-- TMPL_ELSIF NAME="build2" -->Pick a Report Type
+ <!-- TMPL_ELSIF NAME="build3" -->Select Columns for Display
+ <!-- TMPL_ELSIF NAME="build4" -->Select Criteria to Limit on
+ <!-- TMPL_ELSIF NAME="build5" -->Pick which columns to total
+ <!-- TMPL_ELSIF NAME="build6" -->Select how you want the report ordered
+ <!-- /TMPL_IF -->
+ <!-- /TMPL_IF -->
+</div>
- <div id="bd">
- <div id="yui-main">
+<div id="doc3" class="yui-t1">
+ <div id="bd">
+ <div id="yui-main">
<div class="yui-b">
-
- <div class="details">
+ <div class="details">
<!-- TMPL_IF NAME="start" -->
<h2>Guided Reports</h2>
<p>Use the guided reports engine to create non standard reports.
This feature aims to provide some middle ground between the built in
-canned reports and requiring a DBA to write the SQL code for you.</p>
- <form action="/cgi-bin/koha/reports/guided_reports.pl">
- <h3>Build and Run existing Reports</h3>
- <input type="submit" name="phase" value="Build new"/>
- <input type="submit" name="phase" value="Used saved"/>
- <input type="submit" name="phase" value="Create report from SQL"/>
-<!-- <input type="submit" name="phase" value="Create Compound Report"/> -->
-<h3>Define Custom Criteria</h3>
-<p>Use the reports dictionary to define custom criteria to use in your
-reports</p>
-<input type="submit" name="phase" value="View Dictionary"/>
- </form>
+canned reports and writing custom SQL reports.</p>
+
+ <h3>Build And Run Reports</h3>
+ <form action="/cgi-bin/koha/reports/guided_reports.pl">
+ <input type="hidden" name="phase" value="Build new" />
+ <input type="submit" name="submit" value="Build new"/>
+ </form>
+ <form action="/cgi-bin/koha/reports/guided_reports.pl">
+ <input type="hidden" name="phase" value="Use saved"/>
+ <input type="submit" name="submit" value="Use saved"/>
+ </form>
+ <form action="/cgi-bin/koha/reports/guided_reports.pl">
+ <input type="hidden" name="phase" value="Create report from SQL"/>
+ <input type="submit" name="submit" value="Create report from SQL"/>
+ </form>
+<h3>Reports Dictionary</h3>
+<p>Use the reports dictionary to define custom criteria to use in your reports</p>
+<form action="/cgi-bin/koha/reports/dictionary.pl">
+<input type="hidden" name="phase" value="View Dictionary"/>
+<input type="submit" name="submit" value="View Dictionary"/>
+</form>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="saved1" -->
-<h1>Load Saved Reports<h1>
-Choose the report from the list
+<!-- TMPL_IF NAME="savedreports" --><h1>Saved Reports</h1>
+<p>Choose the report to run from the list</p>
<form action="/cgi-bin/koha/reports/guided_reports.pl">
-<select name="reports">
+<table>
+<tr><th>Report Name</th><th>Type</th><th>Notes</th><th>Saved Results</th><th>Saved SQL</th><th colspan="3"> </th></tr>
<!-- TMPL_LOOP NAME="savedreports" -->
-<option value="<!-- TMPL_VAR NAME="id" -->"><!-- TMPL_VAR NAME="report_name"--></option>
+<tr><td><!-- TMPL_VAR NAME="report_name" --></td>
+<td><!-- TMPL_VAR NAME="type" --></td>
+<td><!-- TMPL_VAR NAME="notes" --></td>
+<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 -->
+</td>
+<td><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=<!-- TMPL_VAR NAME="id" -->&phase=Show%20SQL">Show SQL</a>
+ <a href="/cgi-bin/koha/reports/guided_reports.pl?reports=<!-- TMPL_VAR NAME="id" -->&phase=Edit%20SQL">Edit SQL</a></td>
+<td><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=<!-- TMPL_VAR NAME="id" -->&phase=Run%20this%20report">Run</a></td>
+<td><a href="/cgi-bin/koha/tools/scheduler.pl?id=<!-- TMPL_VAR NAME="id" -->">Schedule</a></td>
+<td><a class="confirmdelete" title="Delete this saved report" href="/cgi-bin/koha/reports/guided_reports.pl?reports=<!-- TMPL_VAR NAME="id" -->&phase=Delete%20Saved">Delete</a></td></tr>
<!-- /TMPL_LOOP -->
-</select>
-<input type="submit" name="phase" value="Run this report">
+</table>
</form>
+<!-- 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 -->
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="build1" -->
<h1>Build A Report</h1>
-<h3>Step 1 of 6: Choose a Module to Report on</h3>
<form action="/cgi-bin/koha/reports/guided_reports.pl">
-<select name="areas">
+<fieldset class="rows">
+<legend>Step 1 of 6: Choose a Module to Report on</legend>
+<ol><li><label for="areas">Choose: </label><select name="areas" id="areas">
<!-- TMPL_LOOP NAME="areas" -->
<option value="<!-- TMPL_VAR NAME="id" -->"><!-- TMPL_VAR NAME="name"--></option>
<!-- /TMPL_LOOP -->
-</select>
-<br />
-<input type="submit" name="phase" value="Report on this Area">
+</select></li></ol>
+</fieldset>
+<fieldset class="action">
+<input type="hidden" name="phase" value="Report on this Area" />
+<input type="submit" name="submit" value="Next >>" />
+
+</fieldset>
</form>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="build2" -->
<h1>Build A Report</h1>
-<h3>Step 2 of 6: Pick a Report Type</h3>
<form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
-<input type="hidden" name="area" value="<!-- TMPL_VAR NAME="area" -->">
-<select name="types">
-<!-- TMPL_LOOP NAME="types" -->
-<option value="<!-- TMPL_VAR NAME="id" -->"><!-- TMPL_VAR NAME="name"--></option>
-<!-- /TMPL_LOOP -->
-</select>
-<br />
-<input type="submit" name="phase" value="Choose this type">
-<br />
+<input type="hidden" name="area" value="<!-- TMPL_VAR NAME="area" -->" />
+<fieldset class="rows"><legend>Step 2 of 6: Pick a Report Type</legend>
+<ol><li><label for="types">Choose: </label>
+ <select id="types" name="types">
+ <option value="1">Tabular</option>
+ <option value="2" disabled="disabled">Summary</option>
+ <option value="3" disabled="disabled">Matrix</option>
+ </select>
+</li></ol></fieldset>
+
+<fieldset class="action">
+<input type="hidden" name="phase" value="Choose this type" />
+<input type="submit" name="submit" value="Next >>" /></fieldset>
</form>
-Tabular:
-<img src="http://staff-crc.dev.kohalibrary.com/intranet-tmpl/prog/img/reports-tabular-graphic.gif" />
-Summary:
-<img src="http://staff-crc.dev.kohalibrary.com/intranet-tmpl/prog/img/reports-summary-graphic.gif" />
-Matrix:
-<img src="http://staff-crc.dev.kohalibrary.com/intranet-tmpl/prog/img/reports-matrix-graphic.gif" />
+</div>
+<div class="yui-gb"><div class="yui-u first"></div>
+
+<!--- Summary and Matrix reports have not yet been implemented-->
+<!--<div class="yui-u">Summary:
+<img src="/intranet-tmpl/prog/img/reports-summary-graphic.gif" /></div>
+<div class="yui-u">Matrix:
+<img src="/intranet-tmpl/prog/img/reports-matrix-graphic.gif" /></div>-->
+
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="build3" -->
<h3>Step 3 of 6: Select Columns for Display</h3>
+<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>
+
<form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
- <input type="hidden" name="area" value="<!-- TMPL_VAR NAME="area" -->">
- <input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->">
- <select id="availableColumns" name="oldcolumns2" multiple size="25" style="width:200px;height:300px;">
+ <input type="hidden" name="area" value="<!-- TMPL_VAR NAME="area" -->" />
+ <input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->" />
+ <fieldset>
+<div class="yui-g">
+<div class="yui-u first"> <div style="float: left;"><select id="availableColumns" name="oldcolumns2" multiple="multiple" size="25" style="min-width: 200px;height:300px;">
<!-- TMPL_LOOP NAME="columns" -->
<!-- TMPL_IF NAME="table" -->
<!-- TMPL_ELSE -->
<!-- TMPL_VAR NAME="name" -->
<!-- /TMPL_IF -->
-<!-- /TMPL_IF -->
</option>
+<!-- /TMPL_IF -->
<!-- /TMPL_LOOP -->
-</select>
-<input type="button" name="Add" value="Add" class="button" onClick="addColumn()"/>
-<select id="selectedColumns" name="columns" multiple size="25" style="width:200px;height:300px;"></select>
-<input type="button" name="delete" value="delete" class="button" onClick="delColumn()"/>
+</optgroup>
+</select></div>
+<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 />
+<input type="button" name="delete" value="<< Delete" class="button" style="width: 6em; margin: 1em 0;" onclick="delColumn()" /></div>
+</div>
-<input type="submit" name="phase" value="Choose these columns">
+<div class="yui-u">
+<select id="selectedColumns" name="columns" multiple="multiple" size="25" style="min-width:200px;height:300px;"></select>
+</div>
+</div>
+</fieldset>
+<div class="yui-g">
+<fieldset class="action">
+<input type="hidden" name="phase" value="Choose these columns" />
+<input type="submit" name="submit" value="Next >>" />
+</fieldset>
+</div>
</form>
+
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="build4" -->
-<h3>Step 4 of 6: Select Criteria to Limit on </h3>
-
<form action="/cgi-bin/koha/reports/guided_reports.pl" method="post" >
-<input type="hidden" name="area" value="<!-- TMPL_VAR NAME="area" -->">
-<input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->">
-<input type="hidden" name="column" value="<!-- TMPL_VAR NAME="column" -->">
-<table>
-<tr><td><!-- TMPL_LOOP NAME="criteria" -->
-<input type=checkbox name="criteria_column" value="<!-- TMPL_VAR
-NAME="name" -->"> <!-- TMPL_VAR NAME="description" --> =
-</td><td>
+<input type="hidden" name="area" value="<!-- TMPL_VAR NAME="area" -->" />
+<input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->" />
+<input type="hidden" name="column" value="<!-- TMPL_VAR NAME="column" -->" />
+<fieldset><legend>Step 4 of 6: Select Criteria to Limit on</legend><table>
+<!-- TMPL_LOOP NAME="criteria" -->
+<tr><td><input type="checkbox" name="criteria_column" id="<!-- TMPL_VAR
+NAME="name" -->" value="<!-- TMPL_VAR
+NAME="name" -->" /> <label for="<!-- TMPL_VAR
+NAME="name" -->"><!-- TMPL_VAR NAME="description" --> </label>
+</td>
<!-- TMPL_IF NAME="date" -->
-<input type="text" size="10" id="<!-- TMPL_VAR NAME="name" -->_value" name="<!-- TMPL_VAR NAME="name" -->_value" value="" >
-<img src="<!-- TMPL_VAR Name="themelang" -->/includes/calendar/cal.gif" id="buttonfrom1" style="cursor: pointer;" />
+<td><input type="text" size="10" id="<!-- TMPL_VAR NAME="name"
+-->_value" name="<!-- TMPL_VAR NAME="name" -->_value" value=""
+/><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" />
<script type="text/javascript">
Calendar.setup({
-inputField : "<!-- TMPL_VAR NAME="name" -->_value",
-ifFormat : "%Y-%m-%d",
-button : "buttonfrom1",
+inputField : "<!-- TMPL_VAR NAME="name" -->_value",
+ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
+button : "buttonfrom<!-- TMPL_VAR NAME="name" -->",
align : "Tl"
});
</script>
-</td>
+</td></tr>
<!-- TMPL_ELSE -->
<td><select name="<!-- TMPL_VAR NAME="name" -->_value">
<!-- TMPL_LOOP NAME="values" -->
<option value="<!-- TMPL_VAR NAME="availablevalues"-->"><!-- TMPL_VAR NAME="availablevalues" --></option>
<!-- /TMPL_LOOP -->
</select>
-</td><tr></table>
+</td></tr>
<!-- /TMPL_IF -->
-<br />
<!-- /TMPL_LOOP -->
-<br />
+</table></fieldset>
+
<!-- TMPL_IF NAME="definitions" -->
-Dictionary Definitions <br />
+<fieldset><legend>Dictionary Definitions</legend><table>
<!-- TMPL_LOOP NAME="definitions" -->
-<input type=checkbox name="definition" value="<!-- TMPL_VAR NAME="id" -->"><!-- TMPL_VAR NAME="name" --><br />
+ <tr><td><input type="checkbox" name="definition" value="<!--
+TMPL_VAR NAME="id" -->" /> <!-- TMPL_VAR NAME="name" --></td></tr>
<!-- /TMPL_LOOP -->
+</table>
<!-- /TMPL_IF -->
-<input type="submit" name="phase" value="Choose these criteria">
+
+<fieldset class="action"><input type="hidden" name="phase" value="Choose these criteria" />
+<input type="submit" name="submit" value="Next >>" /> </fieldset>
</form>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="build5" -->
<h3>Step 5 of 6: Pick which columns to total</h3>
<form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
-<input type="hidden" name="area" value="<!-- TMPL_VAR NAME="area" -->">
-<input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->">
-<input type="hidden" name="column" value="<!-- TMPL_VAR NAME="column" -->">
-<input type="hidden" name="definition" value="<!-- TMPL_VAR NAME="definition" -->">
-<input type="hidden" name="criteria" value="<!-- TMPL_VAR NAME="criteriastring" -->">
+<input type="hidden" name="area" value="<!-- TMPL_VAR NAME="area" -->" />
+<input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->" />
+<input type="hidden" name="column" value="<!-- TMPL_VAR NAME="column" -->" />
+<input type="hidden" name="definition" value="<!-- TMPL_VAR NAME="definition" -->" />
+<input type="hidden" name="criteria" value="<!-- TMPL_VAR NAME="criteriastring" -->" />
+<fieldset><table>
<!-- TMPL_LOOP NAME="total_by" -->
-<input type=checkbox name="total_by" value="<!-- TMPL_VAR NAME="name" -->"><!-- TMPL_VAR NAME="name"-->
-<select name="<!-- TMPL_VAR NAME="name" -->_tvalue">
+<tr><td><input type="checkbox" name="total_by" id="<!-- TMPL_VAR
+NAME="name" -->" value="<!-- TMPL_VAR
+NAME="name" -->" /> <label for="<!-- TMPL_VAR
+NAME="name" -->"><!-- TMPL_VAR NAME="name" --></label></td>
+<td><select name="<!-- TMPL_VAR NAME="name" -->_tvalue">
<!-- TMPL_LOOP NAME="select" -->
<option value="<!-- TMPL_VAR NAME="value"-->"><!-- TMPL_VAR NAME="value" --></option>
<!-- /TMPL_LOOP -->
</select>
-<br />
+</td></tr>
<!-- /TMPL_LOOP -->
-<br />
-<input type="submit" name="phase" value="Choose Totals">
+</table></fieldset>
+
+<fieldset class="action"><input type="hidden" name="phase" value="Choose These Operations" />
+<input type="submit" name="submit" value="Next >>" /></fieldset>
</form>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="build6" -->
-<h3>Step 6 of 6: Select the ordering</h3>
+<h3>Step 6 of 6: Choose how you want the report ordered</h3>
<form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
-<input type="hidden" name="area" value="<!-- TMPL_VAR NAME="area" -->">
-<input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->">
-<input type="hidden" name="column" value="<!-- TMPL_VAR NAME="column" -->">
-<input type="hidden" name="criteria" value="<!-- TMPL_VAR NAME="criteriastring" -->">
-<input type="hidden" name="definition" value="<!-- TMPL_VAR NAME="definition" -->">
-<input type="hidden" name="totals" value="<!-- TMPL_VAR NAME="totals" -->">
-<!-- TMPL_LOOP NAME="order_by" -->
-<input type=checkbox name="order_by" value="<!-- TMPL_VAR NAME="name" -->"><!-- TMPL_VAR NAME="name"-->
+<input type="hidden" name="area" value="<!-- TMPL_VAR NAME="area" -->" />
+<input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->" />
+<input type="hidden" name="column" value="<!-- TMPL_VAR NAME="column" -->" />
+<input type="hidden" name="criteria" value="<!-- TMPL_VAR NAME="criteriastring" -->" />
+<input type="hidden" name="definition" value="<!-- TMPL_VAR NAME="definition" -->" />
+<input type="hidden" name="totals" value="<!-- TMPL_VAR NAME="totals" -->" />
+<fieldset><table><!-- TMPL_LOOP NAME="order_by" -->
+<tr><td><input type="checkbox" id="<!-- TMPL_VAR
+NAME="name" -->" name="order_by" value="<!-- TMPL_VAR
+NAME="name" -->" /> <label for="<!-- TMPL_VAR
+NAME="name" -->"><!-- TMPL_VAR NAME="name"--></label></td><td>
<select name="<!-- TMPL_VAR NAME="name" -->_ovalue">
<!-- TMPL_LOOP NAME="select" -->
<option value="<!-- TMPL_VAR NAME="value"-->"><!-- TMPL_VAR NAME="value" --></option>
<!-- /TMPL_LOOP -->
</select>
+</td></tr>
-<br />
<!-- /TMPL_LOOP -->
-<br />
-<input type="submit" name="phase" value="Build Report">
+</table></fieldset>
+
+<fieldset class="action">
+<input type="hidden" name="phase" value="Build Report" />
+<input type="submit" name="submit" value="Finish" /></fieldset>
</form>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="showreport" -->
+<h1>Confirm Custom Report</h1>
+<p>Your report will be generated with the following SQL statement.</p>
+<p>
<!-- TMPL_VAR NAME="sql" -->
+</p>
-<p>
<form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
-<input type="hidden" name="sql" value="<!-- TMPL_VAR NAME="sql" -->">
-<input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->">
-<input type="submit" name="phase" value="Save"> <input type="submit" name="phase" value="Execute">
+<input type="hidden" name="sql" value="<!-- TMPL_VAR NAME="sql" ESCAPE="html" -->" />
+<input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->" />
+<p>You will need to save the report before you can execute it</p>
+<fieldset class="action"><input type="hidden" name="phase" value="Save" />
+<input type="submit" name="submit" value="Save" /> </fieldset>
</form>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="save" -->
<form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
-<input type="hidden" name="sql" value="<!-- TMPL_VAR NAME="sql" -->">
-<input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->">
-Report Name: <input type="text" name="reportname"> <br />
-Notes: <textarea name="notes"></textarea><br />
-<input type="submit" name="phase" value="Save Report">
+<input type="hidden" name="sql" value="<!-- TMPL_VAR NAME="sql" ESCAPE="html" -->" />
+<input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->" />
+<fieldset class="rows">
+<legend>Save Your Custom Report</legend>
+<ol>
+ <li><label for="reportname">Report Name: </label><input type="text" id="reportname" name="reportname" /></li>
+ <li><label for="notes">Notes:</label> <textarea name="notes" id="notes"></textarea></li>
+</ol></fieldset>
+<fieldset class="action"><input type="hidden" name="phase" value="Save Report" />
+<input type="submit" name="submit" value="Save Report" /></fieldset>
</form>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="execute" -->
-Show results
+<h1><!-- TMPL_VAR NAME="name" --></h1>
+<!-- TMPL_IF NAME="notes" --><p><!-- TMPL_VAR NAME="notes" --></p><!-- /TMPL_IF -->
+<!-- TMPL_IF NAME="unlimited_total" --><p>Total number of rows matching the (unlimited) query is <!-- TMPL_VAR NAME="unlimited_total" -->.</p><!-- /TMPL_IF -->
+<!-- TMPL_VAR NAME='pagination_bar' DEFAULT="" -->
+<!-- TMPL_UNLESS name="errors" -->
<table>
+<tr><!-- TMPL_LOOP NAME="header_row" --><th><!-- TMPL_VAR NAME="cell" --></th><!-- /TMPL_LOOP --></tr>
<!-- TMPL_LOOP NAME="results" -->
-<!-- TMPL_VAR NAME="row" -->
+<tr>
+ <!-- TMPL_LOOP NAME="cells" --><td><!-- TMPL_VAR NAME="cell" --></td><!-- /TMPL_LOOP -->
+</tr>
<!-- /TMPL_LOOP -->
</table>
<form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
-<select name="format">
+<fieldset class="action">
+<label for="format">Download the report: </label>
+<select name="format" id="format">
<option value="csv">Comma Separated Text</option>
<option value="tab">Tab Separated Text</option>
</select>
-<input type="submit" name="phase" value="Export">
-<input type="hidden" name="sql" value="<!-- TMPL_VAR NAME="sql" -->">
+<input type="hidden" name="sql" value="<!-- TMPL_VAR NAME="sql" ESCAPE="html" -->" />
+<input type="hidden" name="phase" value="Export" />
+<input type="submit" name="submit" value="Download" /></fieldset>
</form>
+<!-- /TMPL_UNLESS -->
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="create" -->
<form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
-Report Name: <input type="text" name="reportname"> <br />
-Type:
-<select name="types">
-<!-- TMPL_LOOP NAME="types" -->
-<option value="<!-- TMPL_VAR NAME="id" -->"><!-- TMPL_VAR NAME="name"--></option>
-<!-- /TMPL_LOOP -->
-</select>
-<br />
-SQl: <textarea name="sql" cols=30 rows=10></textarea><br />
-<input type="submit" name="phase" value="Save Report">
+<fieldset class="rows">
+<legend>Create Report From SQL</legend>
+<ol>
+ <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>
+ <li><label for="notes">Notes:</label> <textarea id="notes" name="notes" cols="50" rows="2"><!-- TMPL_VAR NAME="notes" DEFAULT="" --></textarea></li>
+ <li><label for="types">Type:</label>
+ <select id="types" name="types">
+ <option value="1">Tabular</option>
+ <option value="2" disabled="disabled">Summary</option>
+ <option value="3" disabled="disabled">Matrix</option>
+ </select>
+ </li>
+ <li><label for="sql">SQL: </label><textarea id="sql" name="sql" cols="50" rows="10"><!-- TMPL_VAR NAME="sql" DEFAULT="" --></textarea></li>
+</ol>
+</fieldset>
+
+<fieldset class="action"><input type="hidden" name="phase" value="Save Report" />
+<input type="submit" name="submit" value="Save Report" /></fieldset>
</form>
<!-- /TMPL_IF -->
<!-- /TMPL_LOOP -->
</select>
<br />
-<input type="submit" name="phase" value="Save Compound">
+<input type="hidden" name="phase" value="Save Compound" />
+<input type="submit" name="submit" value="Save Compound" />
</form>
<!-- /TMPL_IF -->
<!-- TMPL_VAR NAME="master" --> <br />
<!-- TMPL_VAR NAME="subsql" -->
<!-- /TMPL_IF -->
+
+
+<!-- TMPL_IF NAME="retresults" -->
+<h1>Saved Report Results</h1>
+<h2><!-- TMPL_VAR NAME="name" --></h2>
+<p><!-- TMPL_VAR NAME="notes" --></p>
+<table>
+<!-- TMPL_LOOP NAME="results" -->
+<!-- TMPL_VAR NAME="row" -->
+<!-- /TMPL_LOOP -->
+</table>
+<!-- /TMPL_IF -->
+
+<!-- TMPL_IF NAME="showsql" -->
+<textarea id="sql"><!-- TMPL_VAR NAME="sql" --></textarea>
+<!-- /TMPL_IF -->
+
+<!-- TMPL_IF NAME="editsql" -->
+<form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
+<input type="hidden" name="phase" value="Update SQL" />
+<input type="hidden" name="id" value="<!-- TMPL_VAR NAME="id" -->">
+<fieldset class="rows">
+<legend>Edit SQL</legend>
+<ol>
+<li><label for="reportname">Report Name:</label><input type="text" id="reportname" name="reportname" value="<!-- TMPL_VAR NAME="reportname" -->" ></li>
+<li><textarea id="sql" name="sql"><!-- TMPL_VAR NAME="sql" --></textarea></li>
+</ol>
+</fieldset>
+
+<fieldset class="action">
+<input type="submit" name="submit" value="Update SQL" /></fieldset>
+</form>
+
+
+<!-- /TMPL_IF -->
+
+<!-- TMPL_IF NAME="save_successful" -->
+<!-- TMPL_UNLESS NAME="errors" -->
+<h2>Your report has been saved</h2>
+<p>The report you have created has now been saved. You can now</p>
+<ul>
+ <li>Access this report from the: <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Saved Reports Page</a></li>
+ <li>Schedule this report to run using the: <a href="/cgi-bin/koha/tools/scheduler.pl">Scheduler Tool</a></li>
+ <li>Return to: <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Guided Reports</a></li>
+</ul>
+<!-- /TMPL_UNLESS -->
+<!-- /TMPL_IF -->
+
+<!-- TMPL_IF NAME="errors" -->
+<form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
+<div class="dialog alert">
+<b>The following error was encountered:</b><br />
+<!-- TMPL_LOOP name="errors" -->
+ <!-- TMPL_IF NAME="sqlerr" -->This report contains the SQL keyword <b><!-- TMPL_VAR name="sqlerr" --></b>.
+ <br />Use of this keyword is not allowed in Koha reports due to security and data integrity risks. Only SELECT queries are allowed.
+ <br />Please return to the "Saved Reports" screen and delete this report or retry creating a new one.
+ <!-- TMPL_ELSIF NAME="queryerr" -->The database returned the following error: <br /><!-- TMPL_VAR NAME="queryerr" --><br />Please check the log for further details.
+ <!-- TMPL_ELSE -->
+ <!-- /TMPL_IF -->
+<!-- /TMPL_LOOP -->
+</div>
+<fieldset class="action"><input type="hidden" name="phase" value="Use saved" />
+<input type="submit" name="submit" value="Saved Reports" /></fieldset>
+</form>
+<!-- /TMPL_IF -->
+
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
+//<![CDATA[
function setObjects() {
selectedColumnsObj=document.getElementById('selectedColumns');
availableColumnsObj=document.getElementById('availableColumns');
selectedColumnsObj.remove(selectedColumnsObj.options.selectedIndex)
}
}
+//]]>
</script>
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->