Koha/koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tt
Owen Leonard 6ba210af18 Fix for Bug 6609, Clean up guided reports dictionary entry process
Some general interface cleanup tasks with the guided reports dictionary entry
process:

- Improving the breadcrumb links
- Eliminating the tabs in favor of more descriptive <legend> labels
- Clarifying some labels
- Correcting form markup according to established patterns

(Undertaken primarily because the tabs translated poorly when trying to
re-implement them for Bug 5481, Replace YUI JS libraries with Jquery UI)

Signed-off-by: Nicole Engard <nengard@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-09-13 10:27:16 +12:00

314 lines
11 KiB
Text

[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Reports &rsaquo; Guided Reports &rsaquo; Dictionary</title>
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'calendar.inc' %]
<style type="text/css">fieldset.rows table { clear: none; margin: 0;}</style>
</head>
<body>
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a> &rsaquo; <a href="/cgi-bin/koha/reports/guided_reports.pl">Guided Reports Wizard</a>
[% IF ( new_dictionary ) %] &rsaquo; <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a> &rsaquo; <strong>Name the new definition</strong>
[% ELSIF ( step_2 ) %] &rsaquo; <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a> &rsaquo; <strong>Step 2: Choose the area </strong>
[% ELSIF ( step_3 ) %] &rsaquo; <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a> &rsaquo; <strong>Step 3: Choose columns </strong>
[% ELSIF ( step_4 ) %] &rsaquo; <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a> &rsaquo; <strong>Step 4: Specify a value </strong>
[% ELSIF ( step_5 ) %] &rsaquo; <a href="/cgi-bin/koha/reports/dictionary.pl">Dictionary</a> &rsaquo; <strong>Step 5: Confirm definition</strong>
[% ELSE %]<strong> Dictionary </strong>[% END %]</div>
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
[% IF ( start_dictionary ) %]
[% INCLUDE 'dictionary-toolbar.inc' %]
[% END %]
<h1>Dictionary</h1>
[% IF ( start_dictionary ) %]
<p>Use the dictionary to define custom criteria for reporting.</p>
[% IF ( definitions ) %]
<h2>Current Terms</h2>
<form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
<input type="hidden" name="phase" value="View Dictionary" />
[% IF ( areas ) %]
Filter by area <select name="areas">
<option value="">All</option>
[% FOREACH area IN areas %]
[% IF ( area.selected ) %]
<option value="[% area.id %]" selected="selected" >[% area.name %]</option>
[% ELSE %]
<option value="[% area.id %]">[% area.name %]</option>
[% END %]
[% END %]
</select>
<input name="submit" value="Go" type="submit" />
</form>
<br />
[% END %]
<table border="1" cellspacing="0" cellpadding="5">
<tr>
<th>Name</th>
<th>Description</th>
<th>Area</th>
<th>Definition</th>
<th>&nbsp;</th>
</tr>
[% FOREACH definition IN definitions %]
[% UNLESS ( loop.odd ) %]
<tr class="highlight" valign="top">
[% ELSE %]
<tr valign="top">
[% END %]
<td>[% definition.name %]</td>
<td>[% definition.description %]</td>
<td>[% definition.areaname %]</td>
<td>[% definition.saved_sql %]</td>
<td><form method="post" action="/cgi-bin/koha/reports/dictionary.pl">
<input type="hidden" name="id" value="[% definition.id %]" />
<input type="hidden" name="phase" value="Delete Definition" />
<input type="submit" name="submit" value="Delete Definition" />
</form></td>
</tr>
[% END %]
</table>
[% END %]
[% END %]
[% IF ( new_dictionary ) %]
<h3>Add New Definition</h3>
<form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
<fieldset class="rows"><legend>Step 1 of 5: Name the new definition</legend><ol>
<li>
<label for="definition_name">Definition Name:</label>
<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" 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>
</form>
[% END %]
[% IF ( step_2 ) %]
<h3>Add New Definition</h3>
<form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
<fieldset class="rows">
<legend>Step 2 of 5: Choose the area</legend>
<ol><li><input type="hidden" name="phase" value="New Term step 3" />
<input type="hidden" name="definition_name" value="[% definition_name %]" />
<input type="hidden" name="definition_description" value="[% definition_description %]" />
<label for="areas">Select table </label><select name="areas" id="areas">
[% FOREACH area IN areas %]
<option value="[% area.id %]">[% area.name %]</option>
[% END %]
</select></li>
</ol>
</fieldset>
<fieldset class="action"><input name="submit" value="Next" type="submit" /></fieldset>
</form>
[% END %]
[% IF ( step_3 ) %]
<h3>Add New Definition</h3>
<form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
<fieldset class="rows">
<legend>Step 3 of 5: Choose columns</legend>
<input type="hidden" name="area" value="[% area %]" />
<input type="hidden" name="definition_name" value="[% definition_name %]" />
<input type="hidden" name="definition_description" value="[% definition_description %]" />
<table style="border: 0;margin:1em;"><tr>
<td style="border: 0;"><select id="availableColumns" name="oldcolumns2" size="25" style="width:200px;height:300px;">
[% FOREACH column IN columns %]
[% IF ( column.table ) %]
[% IF ( loop.first ) %]
[% ELSE %]
</optgroup>
[% END %]
<optgroup label="[% column.table %]">
[% ELSE %]
<option value="[% column.name %]">
[% IF ( column.description ) %][% column.description %]
[% ELSE %]
[% column.name %]
[% END %]
</option>
[% END %]
[% END %]
</optgroup>
</select></td>
<td style="border: 0;"><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>
<td style="border: 0;"><select id="selectedColumns" name="columns" size="25" style="width:200px;height:300px;"></select> </td> </tr></table>
<input type="hidden" name="phase" value="New Term step 4" />
</fieldset>
<fieldset class="action"><input type="submit" name="submit" value="Next" /></fieldset>
</form>
[% END %]
[% IF ( step_4 ) %]
<h3>Add New Definition</h3>
<form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
<fieldset class="rows">
<legend>Step 4 of 5: Specify a value</legend>
<input type="hidden" name="area" value="[% area %]" />
<input type="hidden" name="definition_name" value="[% definition_name %]" />
<input type="hidden" name="definition_description" value="[% definition_description %]" />
<input type="hidden" name="columnstring" value="[% columnstring %]" />
[% FOREACH column IN columns %]
<input type="hidden" name="criteria_column" value="[% column.name %]" />
<ol><li><span class="label">Column: </span> [% column.name %]</li>
[% IF ( column.distinct ) %]
<li><label for="[% column.name %]_value">Choose: </label> <select id="[% column.name %]_value" name="[% column.name %]_value">
[% FOREACH value IN column.values %]
<option value="[% value.availablevalues %]">[% value.availablevalues %]</option>
[% END %]
</select></li>
[% END %]
[% IF ( column.date ) %]
<li><span class="label">Choose: </span><table>
<tr valign="top">
<td><input type="radio" name="[% column.name %]_all" value="all" />All dates</td>
<td>OR</td>
<td><input type="radio" name="dates" value="range" />Date range<br />
<table>
<tr>
<td>Start of date range</td>
<td><input type="text" size="10" id="[% column.name %]_start_value" name="[% column.name %]_start_value" value="" />
<img src="[% themelang %]/lib/calendar/cal.gif" id="buttonfrom1" style="cursor: pointer;" />
<script type="text/javascript">
Calendar.setup({
inputField : "[% column.name %]_start_value",
ifFormat : "[% DHTMLcalendar_dateformat %]",
button : "buttonfrom1",
align : "Tl"
});
</script>
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
</td>
</tr>
<tr>
<td>End of date range</td>
<td>
<input type="text" size="10" id="[% column.name %]_end_value" name="[% column.name %]_end_value" value="" />
<img src="[% themelang %]/lib/calendar/cal.gif" id="buttonfrom2" style="cursor: pointer;" />
<script type="text/javascript">
Calendar.setup({
inputField : "[% column.name %]_end_value",
ifFormat : "[% DHTMLcalendar_dateformat %]",
button : "buttonfrom2",
align : "Tl"
});
</script>
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
</td>
</tr>
</table></td>
</tr>
</table></li>
[% END %]
[% IF ( column.text ) %]
<li><label for="[% column.name %]_value">Search string matches: </label> <input type="text" size="13" name="[% column.name %]_value" /></li>
[% END %]
[% END %]
</ol>
<input type="hidden" name="phase" value="New Term step 5" />
</fieldset>
<fieldset class="action">
<input type="submit" name="submit" value="Next" />
</fieldset>
</form>
[% END %]
[% IF ( step_5 ) %]
<form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
<input type="hidden" name="area" value="[% area %]" />
<input type="hidden" name="definition_name" value="[% definition_name %]" />
<input type="hidden" name="definition_description" value="[% definition_description %]" />
<input type="hidden" name="columnstring" value="[% columnstring %]" />
<h3>Add New Definition</h3>
<fieldset class="rows">
<legend>Step 5 of 5: Confirm details</legend>
<ol><li>
<span class="label">Name:</span>
[% definition_name %]
</li>
<li>
<span class="label">Description:</span>
[% definition_description %]
</li>
<li>
<span class="label">Area:</span>
[% areaname %]
</li>
<li>
<span class="label">Data:</span>
<table>
<tr>
<th>Columns</th>
<th>Values</th>
</tr>
[% FOREACH criteria_loo IN criteria_loop %]
<tr>
<td>[% criteria_loo.name %]</td>
<td>[% criteria_loo.value %]</td>
</tr>
[% END %]
</table></li></ol> </fieldset>
<fieldset class="action"><input type="hidden" name="sql" value="[% query %]" />
<input type="hidden" name="phase" value="New Term step 6" />
<input type="submit" name="submit" value="Save" /> </fieldset>
</form>
[% END %]
</div>
</div>
<div class="yui-b">
[% INCLUDE 'guided-reports-view.inc' %]
</div>
</div>
<script type="text/javascript">
//<![CDATA[
function setObjects() {
selectedColumnsObj=document.getElementById('selectedColumns');
availableColumnsObj=document.getElementById('availableColumns');
}
setObjects();
function addColumn() {
for (i=0;i<availableColumnsObj.length;i++) {
if (availableColumnsObj.options[i].selected==true) {
var newColumnObj=document.createElement("OPTION");
newColumnObj.value=availableColumnsObj.options[i].value;
newColumnObj.text=availableColumnsObj.options[i].text;
selectedColumnsObj.appendChild(newColumnObj);
newColumnObj.selected=true;
}
}
}
function delColumn() {
for (i=0;i<=selectedColumnsObj.options.length;i++) {
if (selectedColumnsObj.options.selectedIndex>=0) {
selectedColumnsObj.remove(selectedColumnsObj.options.selectedIndex)
}
}
}
//]]>
</script>
[% INCLUDE 'intranet-bottom.inc' %]