XHTML corrections: guided reports

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Galen Charlton 2008-02-13 13:03:15 -06:00 committed by Joshua Ferraro
parent b01eb81b7a
commit ad5161d2dc
4 changed files with 34 additions and 22 deletions

View File

@ -174,15 +174,17 @@ sub get_columns {
my ($area,$cgi) = @_;
my $tables = $table_areas{$area};
my @allcolumns;
my $first = 1;
foreach my $table (@$tables) {
my @columns = _get_columns($table,$cgi);
my @columns = _get_columns($table,$cgi, $first);
$first = 0;
push @allcolumns, @columns;
}
return ( \@allcolumns );
}
sub _get_columns {
my ($tablename,$cgi) = @_;
my ($tablename,$cgi, $first) = @_;
my $dbh = C4::Context->dbh();
my $sth = $dbh->prepare("show columns from $tablename");
$sth->execute();
@ -190,6 +192,7 @@ sub _get_columns {
my $column_defs = _get_column_defs($cgi);
my %tablehash;
$tablehash{'table'}=$tablename;
$tablehash{'__first__'} = $first;
push @columns, \%tablehash;
while ( my $data = $sth->fetchrow_arrayref() ) {
my %temphash;

View File

@ -30,7 +30,7 @@ Filter by area <select name="areas">
<option value="<!-- TMPL_VAR NAME="id" -->"><!-- TMPL_VAR NAME="name"--></option>
<!-- /TMPL_LOOP -->
</select>
<input name="phase" value="Go" type="submit">
<input name="phase" value="Go" type="submit" />
</form>
<br />
<table border="1" cellspacing="0" cellpadding="5">
@ -72,19 +72,19 @@ Filter by area <select name="areas">
<fieldset class="rows"><legend>Add New Definition</legend><ol>
<li>
<label for="definition_name">Definition Name:</label>
<input type="text" id="definition_name" name="definition_name">
<input type="text" id="definition_name" name="definition_name" />
</li>
<li>
<label for="definition_description">Definition Description:</label>
<textarea name="definition_description" id="definition_description"></textarea>
<textarea name="definition_description" id="definition_description" rows="3" cols="20"></textarea>
</li>
</ol></fieldset>
<fieldset class="action"><input type="hidden" name="phase" value="New Term step 2" />
<input name="submit" value="Next" type="submit" /></fieldset>
</div>
</div>
</form>
</div>
</div>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="step_2" -->
@ -145,9 +145,10 @@ Filter by area <select name="areas">
<!-- TMPL_ELSE -->
<!-- TMPL_VAR NAME="name" -->
<!-- /TMPL_IF -->
<!-- /TMPL_IF -->
</option>
<!-- /TMPL_IF -->
<!-- /TMPL_LOOP -->
</optgroup>
</select></td>
<td><input type="button" name="Add" value="Add" class="button" style="width : 6em; margin-bottom : .5em;" onclick="addColumn()" /><br /><input type="button" name="delete" value="&lt;&lt; Delete" class="button" style="width : 6em;" onclick="delColumn()" /> </td>
@ -261,10 +262,11 @@ align : "Tl"
</li>
<li>
<span class="label">Area:</span>
<!-- TMPL_VAR NAME="area" -->
<!-- TMPL_VAR NAME="areaname" -->
</li></ol>
<li><table>
<ol><li>
<table>
<tr>
<th>Columns</th>
<th>Values</th>
@ -275,7 +277,7 @@ align : "Tl"
<td><!-- TMPL_VAR NAME="value" --></td>
</tr>
<!-- /TMPL_LOOP -->
</table></li> </fieldset>
</table></li></ol> </fieldset>
<fieldset class="action"><input type="hidden" name="sql" value="<!-- TMPL_VAR NAME="query" -->" />
<input type="hidden" name="phase" value="New Term step 6" />
@ -290,6 +292,7 @@ align : "Tl"
</div>
</div>
<script type="text/javascript">
//<![CDATA[
function setObjects() {
selectedColumnsObj=document.getElementById('selectedColumns');
availableColumnsObj=document.getElementById('availableColumns');
@ -315,6 +318,7 @@ function delColumn() {
}
}
}
//]]>
</script>
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->

View File

@ -80,22 +80,23 @@ reports</p>
<!-- TMPL_IF NAME="saved1" -->
<!-- TMPL_IF NAME="savedreports" --><h1>Saved Reports</h1>
<p>Choose the report to run from the list</p>
<table>
<form action="/cgi-bin/koha/reports/guided_reports.pl">
<th>Report Name</th><th>Type</th><th>Notes</th><th>Saved Results</th><th>Saved SQL</th><th colspan="3">&nbsp;</th>
<table>
<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>
<!-- TMPL_LOOP NAME="savedreports" -->
<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></td>
<td><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=<!-- TMPL_VAR NAME="id" -->&phase=Run%20this%20report">Run this Report</a></td>
<td><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=<!-- TMPL_VAR NAME="id" -->&amp;phase=Show%20SQL">Show SQL</a></td>
<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>
<td><a href="/cgi-bin/koha/tools/scheduler.pl?id=<!-- TMPL_VAR NAME="id" -->">Schedule this Report</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>
<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>
<!-- /TMPL_LOOP -->
</table>
</form>
</table><!-- 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_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 -->
@ -149,7 +150,6 @@ reports</p>
<!-- 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>
</div>
<form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
<input type="hidden" name="area" value="<!-- TMPL_VAR NAME="area" -->" />
@ -172,9 +172,10 @@ reports</p>
<!-- TMPL_ELSE -->
<!-- TMPL_VAR NAME="name" -->
<!-- /TMPL_IF -->
<!-- /TMPL_IF -->
</option>
<!-- /TMPL_IF -->
<!-- /TMPL_LOOP -->
</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="&lt;&lt; Delete" class="button" style="width: 6em; margin: 1em 0;" onclick="delColumn()" /></div>
@ -190,6 +191,7 @@ reports</p>
<input type="hidden" name="phase" value="Choose these columns" />
<input type="submit" name="submit" value="Next &gt;&gt;" />
</fieldset>
</div>
</form>
<!-- /TMPL_IF -->
@ -209,12 +211,12 @@ NAME="name" -->"><!-- TMPL_VAR NAME="description" --> </label>
<!-- TMPL_IF NAME="date" -->
<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="buttonfrom1" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" />
/><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",
button : "buttonfrom<!-- TMPL_VAR NAME="name" -->",
align : "Tl"
});
</script>
@ -241,7 +243,7 @@ TMPL_VAR NAME="id" -->" /> <!-- TMPL_VAR NAME="name" --></td></tr>
<fieldset class="action"><input type="hidden" name="phase" value="Choose these criteria" />
<input type="submit" name="submit" value="Next &gt;&gt;" /> </fieldset>
</form></fieldset>
</form>
<!-- /TMPL_IF -->

View File

@ -133,7 +133,9 @@ elsif ($phase eq 'New Term step 4'){
elsif ($phase eq 'New Term step 5'){
# Confirmation screen
my $areas = C4::Reports::get_report_areas();
my $area = $input->param('area');
my $areaname = $areas->[$area - 1]->{'name'};
my $columnstring = $input->param('columnstring');
my $definition_name=$input->param('definition_name');
my $definition_description=$input->param('definition_description');
@ -169,6 +171,7 @@ elsif ($phase eq 'New Term step 5'){
}
$template->param( 'step_5' => 1,
'area' => $area,
'areaname' => $areaname,
'definition_name' => $definition_name,
'definition_description' => $definition_description,
'query' => $query_criteria,