Koha/koha-tmpl/intranet-tmpl/prog/en/modules/admin/classsources.tmpl
Joe Atzberger 8db0cc330b Cleanup classsources.pl and .tmpl
Relatively minor cleaning.
Remove unused javascript.  Add row highlighting to both tables.  Remove conditionals where the
behavior is the same for both possibilities.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-06-12 09:58:52 -05:00

323 lines
13 KiB
Cheetah

<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
<title>Koha &rsaquo; Administration &rsaquo; Classification Sources
<!-- TMPL_IF name="class_source_form" -->
&rsaquo;
<!-- TMPL_IF name="edit_class_source" -->Modify classification source<!-- TMPL_ELSE -->Add classification source<!-- /TMPL_IF -->
<!-- /TMPL_IF -->
<!-- TMPL_IF name="sort_rule_form" -->
&rsaquo;
<!-- TMPL_IF name="edit_sort_rule" -->Modify filing rule<!-- TMPL_ELSE -->Add filing rule<!-- /TMPL_IF -->
<!-- /TMPL_IF -->
<!-- TMPL_IF name="delete_class_source_form" -->
&rsaquo; Confirm deletion of classification source <!-- TMPL_VAR name="class_source" -->
<!-- TMPL_ELSIF name="delete_sort_rule_form" -->
&rsaquo; Confirm deletion of filing rule <!-- TMPL_VAR name="sort_rule" -->
<!-- TMPL_ELSIF name="delete_sort_rule_impossible" -->
&rsaquo; Cannot delete filing rule <!-- TMPL_VAR name="sort_rule" -->
<!-- /TMPL_IF -->
</title>
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
<script type="text/javascript">
//<![CDATA[
function CheckSourceForm(f) {
var _alertString="";
var alertString2;
if (f.class_source.value.length==0) {
_alertString += "\n- " + _("Classification source code missing");
}
if (f.sort_rule.value.length==0) {
_alertString += "\n- " + _("Filing rule code missing");
}
if (f.description.value.length==0) {
_alertString += "\n- " + _("Description missing");
}
if (_alertString.length==0) {
document.Aform.submit();
} else {
alertString2 = _("Form not submitted because of the following problem(s)");
alertString2 += "\n------------------------------------------------------------------------------------\n";
alertString2 += _alertString;
alert(alertString2);
}
}
function CheckRuleForm(f) {
var _alertString="";
var alertString2;
if (f.sort_rule.value.length==0) {
_alertString += "\n- " + _("Filing rule code missing");
}
if (f.description.value.length==0) {
_alertString += "\n- " + _("Description missing");
}
if (f.sort_routine.value.length==0) {
_alertString += "\n- " + _("Sort routine missing");
}
if (_alertString.length==0) {
document.Aform.submit();
} else {
alertString2 = _("Form not submitted because of the following problem(s)");
alertString2 += "\n------------------------------------------------------------------------------------\n";
alertString2 += _alertString;
alert(alertString2);
}
}
$(document).ready(function() {
new YAHOO.widget.Button("newsource");
new YAHOO.widget.Button("newrule");
});
//]]>
</script>
</head>
<body>
<!-- TMPL_INCLUDE NAME="header.inc" -->
<!-- TMPL_INCLUDE NAME="cat-search.inc" -->
<div id="breadcrumbs">
<a href="/cgi-bin/koha/mainpage.pl">Home</a>
&rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
&rsaquo; <a href="/cgi-bin/koha/admin/classsources.pl">Classification Sources</a>
<!-- TMPL_IF name="class_source_form" -->
&rsaquo; <!-- TMPL_IF name="edit_class_source" -->Modify classification source<!-- TMPL_ELSE -->Add classification source<!-- /TMPL_IF -->
<!-- /TMPL_IF -->
<!-- TMPL_IF name="sort_rule_form" -->
&rsaquo; <!-- TMPL_IF name="edit_sort_rule" -->Modify filing rule<!-- TMPL_ELSE -->Add filing rule<!-- /TMPL_IF -->
<!-- /TMPL_IF -->
<!-- TMPL_IF name="delete_class_source_form" -->
&rsaquo; Confirm deletion of classification source <span class="ex">'<!-- TMPL_VAR name="class_source" -->'</span>
<!-- TMPL_ELSIF name="delete_sort_rule_form" -->
&rsaquo; Confirm deletion of filing rule <span class="ex">'<!-- TMPL_VAR name="sort_rule" -->'</span>
<!-- TMPL_ELSIF name="delete_sort_rule_impossible" -->
&rsaquo; Cannot delete filing rule <span class="ex">'<!-- TMPL_VAR name="sort_rule" -->'</span>
<!-- /TMPL_IF -->
</div>
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<!-- TMPL_IF name="class_source_form" -->
<!-- TMPL_IF name="edit_class_source" -->
<h2>Modify classification source</h2>
<!-- TMPL_ELSE -->
<h2>Add classification source</h2>
<!-- /TMPL_IF -->
<form action="<!-- TMPL_VAR name="script_name" -->" name="Aform" method="post">
<input type="hidden" name="op" value="<!-- TMPL_VAR name="confirm_op"-->" />
<fieldset class="rows">
<ol>
<li>
<!-- TMPL_IF name="edit_class_source" -->
<span class="label">Classification source code: </span>
<input type="hidden" name="class_source" value="<!-- TMPL_VAR name="class_source" -->" />
<!-- TMPL_VAR name="class_source" -->
<!-- TMPL_ELSE -->
<label for="class_source">Classification source code: </label>
<input type="text" id="class_source" name="class_source" size="10" maxlength="10" />
<!-- /TMPL_IF -->
</li>
<li><label for="description">Description: </label>
<input type="text" id="description" name="description" size="50" maxlength="250"
value="<!-- TMPL_VAR name="description" escape="HTML" -->" />
</li>
<li><label for="used">Source in use?</label>
<!-- TMPL_IF NAME="used" --><input type="checkbox" id="used" name="used" value="used" checked="checked" /><!-- TMPL_ELSE -->
<input type="checkbox" id="used" name="used" value="used" /><!-- /TMPL_IF -->
</li>
<li><label for="sort_rule">Filing Rule: </label>
<select id="sort_rule" name="sort_rule">
<!-- TMPL_LOOP name="rules_dropdown" -->
<!-- TMPL_IF name="selected" -->
<option value="<!-- TMPL_VAR name="rule" -->" selected="selected"><!-- TMPL_VAR name="description" --> (<!-- TMPL_VAR name="rule" -->)</option>
<!-- TMPL_ELSE -->
<option value="<!-- TMPL_VAR name="rule" -->"><!-- TMPL_VAR name="description" --> (<!-- TMPL_VAR name="rule" -->)</option>
<!-- /TMPL_IF -->
<!-- /TMPL_LOOP -->
</select>
</li>
</ol>
</fieldset>
<fieldset class="action">
<input type="button" value="Save" onclick="CheckSourceForm(this.form)" />
<a class="cancel" href="/cgi-bin/koha/admin/classsources.pl">Cancel</a>
</fieldset>
</form>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="sort_rule_form" -->
<!-- TMPL_IF name="edit_sort_rule" -->
<h2>Modify filing rule</h2>
<!-- TMPL_ELSE -->
<h2>Add filing rule</h2>
<!-- /TMPL_IF -->
<form action="<!-- TMPL_VAR name="script_name" -->" name="Aform" method="post">
<input type="hidden" name="op" value="<!-- TMPL_VAR name="confirm_op"-->" />
<fieldset class="rows">
<ol>
<li>
<!-- TMPL_IF name="edit_sort_rule" -->
<span class="label">Filing rule code: </span>
<input type="hidden" name="sort_rule" value="<!-- TMPL_VAR name="sort_rule" -->" />
<!-- TMPL_VAR name="sort_rule" -->
<!-- TMPL_ELSE -->
<label for="sort_rule">Filing rule code: </label>
<input type="text" id="sort_rule" name="sort_rule" size="10" maxlength="10" />
<!-- /TMPL_IF -->
</li>
<li><label for="description">Description: </label>
<input type="text" id="description" name="description" size="50" maxlength="250"
value="<!-- TMPL_VAR name="description" escape="HTML" -->" />
</li>
<li><label for="sort_routine">Filing Routine: </label>
<select id="sort_routine" name="sort_routine">
<!-- TMPL_LOOP name="routines_dropdown" -->
<!-- TMPL_IF name="selected" -->
<option value="<!-- TMPL_VAR name="routine" -->" selected="selected"><!-- TMPL_VAR name="routine" --></option>
<!-- TMPL_ELSE -->
<option value="<!-- TMPL_VAR name="routine" -->"><!-- TMPL_VAR name="routine" --></option>
<!-- /TMPL_IF -->
<!-- /TMPL_LOOP -->
</select>
</li>
</ol>
</fieldset>
<fieldset class="action">
<input type="button" value="Save" onclick="CheckRuleForm(this.form)" />
<a class="cancel" href="/cgi-bin/koha/admin/classsources.pl">Cancel</a>
</fieldset>
</form>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="delete_class_source_form" -->
<div class="dialog alert"><h3>Confirm deletion of classification source <span class="ex">'<!-- TMPL_VAR name="class_source" -->'</span>?</h3>
<form action="<!-- TMPL_VAR name="script_name" -->" name="Aform" method="post">
<input type="hidden" name="op" value="<!-- TMPL_VAR name="confirm_op"-->" />
<input type="hidden" name="class_source" value="<!-- TMPL_VAR name="class_source" -->" />
<input type="submit" value="Delete classification source" class="approve" />
</form>
<form action="<!-- TMPL_VAR name="script_name" -->" method="get">
<input type="submit" value="No, Do Not Delete" class="deny" />
</form>
</div>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="delete_sort_rule_form" -->
<div class="dialog alert"><h3>Confirm deletion of filing rule <span class="ex">'<!-- TMPL_VAR name="sort_rule" -->'</span>?</h3>
<form action="<!-- TMPL_VAR name="script_name" -->" name="Aform" method="post">
<input type="hidden" name="op" value="<!-- TMPL_VAR name="confirm_op"-->" />
<input type="hidden" name="sort_rule" value="<!-- TMPL_VAR name="sort_rule" -->" />
<input type="submit" value="Delete filing rule" class="approve" />
</form>
<form action="<!-- TMPL_VAR name="script_name" -->" method="get">
<input type="submit" value="No, Do Not Delete" class="deny" />
</form>
</div>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="delete_sort_rule_impossible" -->
<div class="dialog message"><h3>Cannot delete filing rule <span class="ex">'<!-- TMPL_VAR name="sort_rule" -->'</span></h3>
<p>The filing rule <!-- TMPL_VAR name="sort_rule" --> is used by at least one classification source. Please
remove it from all classification source definitions before trying again.
</p>
<form action="<!-- TMPL_VAR name="script_name" -->" method="get">
<input type="button" value="OK" class="approve" />
</form>
</div>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="display_lists" -->
<div id="toolbar">
<ul class="toolbar">
<li><a id="newsource" href="<!-- TMPL_VAR name="script_name" -->?op=add_source">New Classification Source</a></li>
<li><a id="newrule" href="<!-- TMPL_VAR name="script_name" -->?op=add_sort_rule">New Filing Rules</a></li>
</ul></div>
<h2>Classification Sources</h2>
<!-- TMPL_IF name="added_source" -->
<span class="problem">Added classification source <!-- TMPL_VAR name="added_source" --></span>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="edited_source" -->
<span class="problem">Modified classification source <!-- TMPL_VAR name="edited_source" --></span>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="deleted_source" -->
<span class="problem">Deleted classification source <!-- TMPL_VAR name="deleted_source" --></span>
<!-- /TMPL_IF -->
<table>
<tr>
<th>Code</th>
<th>Description</th>
<th>In Use</th>
<th>Filing Rule</th>
<th>Actions</th>
</tr>
<!-- TMPL_LOOP name="class_sources" -->
<!-- TMPL_IF name="__odd__" -->
<tr>
<!-- TMPL_ELSE -->
<tr class="highlight">
<!-- /TMPL_IF -->
<td><!-- TMPL_VAR name="code" --></td>
<td><!-- TMPL_VAR name="description" --></td>
<td><!-- TMPL_IF name="used" -->Yes<!-- TMPL_ELSE -->No<!-- /TMPL_IF --></td>
<td><!-- TMPL_VAR name="sortrule" --></td>
<td>
<a href="<!-- TMPL_VAR name="script_name" -->?op=edit_source&amp;class_source=<!-- TMPL_VAR name="code" escape="HTML" -->">Edit</a>
<a href="<!-- TMPL_VAR name="script_name" -->?op=delete_source&amp;class_source=<!-- TMPL_VAR name="code" escape="HTML" -->">Delete</a>
</td>
</tr>
<!-- /TMPL_LOOP -->
</table>
<div class="paginationBar"><!-- TMPL_VAR NAME="pagination_bar" --></div>
<div class="paginationBar"><!-- TMPL_VAR NAME="pagination_bar" --></div>
<h2>Classification Filing Rules</h2>
<!-- TMPL_IF name="added_rule" -->
<span class="problem">Added filing rule <!-- TMPL_VAR name="added_rule" --></span>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="edited_rule" -->
<span class="problem">Modified filing rule <!-- TMPL_VAR name="edited_rule" --></span>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="deleted_rule" -->
<span class="problem">Deleted filing rule <!-- TMPL_VAR name="deleted_rule" --></span>
<!-- /TMPL_IF -->
<table>
<tr>
<th>Code</th>
<th>Description</th>
<th>Sorting Routine</th>
<th>Actions</th>
</tr>
<!-- TMPL_LOOP name="class_sort_rules" -->
<!-- TMPL_IF name="__odd__" -->
<tr>
<!-- TMPL_ELSE -->
<tr class="highlight">
<!-- /TMPL_IF -->
<td><!-- TMPL_VAR name="rule" --></td>
<td><!-- TMPL_VAR name="description" --></td>
<td><!-- TMPL_VAR name="sort_routine" --></td>
<td>
<a href="<!-- TMPL_VAR name="script_name" -->?op=edit_sort_rule&amp;sort_rule=<!-- TMPL_VAR name="rule" escape="HTML" -->">Edit</a>
<a href="<!-- TMPL_VAR name="script_name" -->?op=delete_sort_rule&amp;sort_rule=<!-- TMPL_VAR name="rule" escape="HTML" -->">Delete</a>
</td>
</tr>
<!-- /TMPL_LOOP -->
</table>
<div class="paginationBar"><!-- TMPL_VAR NAME="pagination_bar" --></div>
<!-- /TMPL_IF -->
</div>
</div>
<div class="yui-b">
<!-- TMPL_INCLUDE NAME="admin-menu.inc" -->
</div>
</div>
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->