Owen Leonard
a46b3b4de0
Some scripts pass a template variable to facilitate an alternate table row class for styling. Other use the 'IF (loop.odd)' construction. I think we're at the point where the CSS3 :nth-child() selector is widely-supported enough that we can do without template-based solutions: http://caniuse.com/#feat=css-sel3 This patch adds such a selector to the staff client CSS and removes the corresponding template markup from Administration pages. The last in this series of patches will remove the redundant CSS. Also in this patch: a few minor markup corrections. To test, apply the patch and clear your browser cache if necessary. View the following pages and confirm that alternate table row highlighting works as before: - Administration -> Budgets - Acquisitions -> Vendor -> Contracts - Administration -> Budgets -> Budget -> Planning - Administration -> Authority types - Administration -> Authority types -> MARC structure - Administration -> Authority types -> MARC structure -> subfields - Administration -> MARC bibliographic framework - Administration -> MARC bibliographic framework -> MARC structure - Administration -> MARC bibliographic framework -> MARC structure -> Subfields - Administration -> Libraries and groups - Administration -> Cities and towns - Administration -> Classification sources - Administration -> Circulation and fines rules - Administration -> Currencies and exchange rates - Administration -> Item types - Administration -> Koha to MARC mapping - Administration -> System preferences -> Local use - Administration -> Z39.50 client targets Signed-off-by: Nick Clemens <nick@quecheelibrary.org> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
388 lines
20 KiB
Text
388 lines
20 KiB
Text
[% INCLUDE 'doc-head-open.inc' %]
|
|
<title>Koha › Administration › [% IF ( add_form ) %] System preferences › [% IF ( modify ) %]Modify system preference '[% searchfield %]'[% ELSE %]Add a system preference[% END %][% END %][% IF ( add_validate ) %] System preferences › Data added[% END %]
|
|
[% IF ( delete_confirm ) %] System preferences › [% searchfield %] › Confirm deletion of parameter '[% searchfield %]'[% END %][% IF ( delete_confirmed ) %] System preferences › Parameter deleted[% END %][% IF ( else ) %]System preferences[% END %]</title>
|
|
[% INCLUDE 'doc-head-close.inc' %]
|
|
[% IF ( else ) %]
|
|
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
|
|
[% INCLUDE 'datatables.inc' %]
|
|
<script type="text/javascript">
|
|
//<![CDATA[
|
|
$(document).ready(function() {
|
|
[% IF ( loop ) %]$("#sysprefst").dataTable($.extend(true, {}, dataTablesDefaults, {
|
|
"sDom": 't',
|
|
"aoColumnDefs": [
|
|
{ "aTargets": [ -1, -2, -3, -4 ], "bSortable": false, "bSearchable": false }
|
|
],
|
|
"bPaginate": false
|
|
}));[% END %]
|
|
});
|
|
</script>
|
|
[% END %]
|
|
<script type="text/javascript">
|
|
//<![CDATA[
|
|
[% IF ( add_form ) %]
|
|
$(document).ready(function() {
|
|
$('.variabletype').css({ color: "#0000CC", cursor: "pointer" });
|
|
$('.variabletype').click(function() {
|
|
$('#preftype').attr("value",$(this).attr("id"));
|
|
});
|
|
});
|
|
[% END %]
|
|
// FIXME: many of these js functions appear unused
|
|
function isNotNull(f,noalert) {
|
|
if (f.value.length ==0) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
//
|
|
function isNum(v,maybenull) {
|
|
var n = new Number(v.value);
|
|
if (isNaN(n)) {
|
|
return false;
|
|
}
|
|
if (maybenull==0 && v.value=='') {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
//
|
|
function Check(f) {
|
|
var ok=1;
|
|
var _alertString="";
|
|
var alertString2;
|
|
if (f.variable.value.length==0) {
|
|
_alertString += "\n- " + _("variable missing");
|
|
}
|
|
if (f.value.value.length==0) {
|
|
_alertString += "\n- " + _("value 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() {
|
|
$( '#sysprefst .expand-textarea' ).show().click( function () {
|
|
$( this ).hide().nextAll( 'textarea, input[type=submit]' ).show( 'slow' );
|
|
|
|
return false;
|
|
} ).nextAll( 'textarea, input[type=submit]' ).hide();
|
|
} );
|
|
|
|
//]]>
|
|
</script>
|
|
</head>
|
|
<body id="admin_systempreferences" class="admin">
|
|
[% INCLUDE 'header.inc' %]
|
|
[% INCLUDE 'prefs-admin-search.inc' %]
|
|
|
|
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › [% IF ( add_form ) %] <a href="/cgi-bin/koha/admin/systempreferences.pl">System preferences</a> › [% IF ( modify ) %]Modify system preference '[% searchfield %]'[% ELSE %]Add a system preference[% END %][% END %][% IF ( add_validate ) %] <a href="/cgi-bin/koha/admin/systempreferences.pl">System preferences</a> › Data added[% END %]
|
|
[% IF ( delete_confirm ) %] <a href="/cgi-bin/koha/admin/systempreferences.pl">System Preferences</a> › <a href="/cgi-bin/koha/admin/systempreferences.pl?op=add_form&searchfield=[% searchfield %]">[% searchfield %]</a> › Confirm deletion of parameter '[% searchfield %]'[% END %][% IF ( delete_confirmed ) %] <a href="/cgi-bin/koha/admin/systempreferences.pl">System preferences</a> › Parameter deleted[% END %][% IF ( else ) %]System preferences[% END %]</div>
|
|
|
|
<div id="doc3" class="yui-t2">
|
|
|
|
<div id="bd">
|
|
<div id="yui-main">
|
|
<div class="yui-b">
|
|
|
|
[% IF ( add_form ) %]
|
|
[% IF ( type_upload ) %]
|
|
<form action="[% script_name %]" name="Aform" method="post" enctype="multipart/form-data">
|
|
[% ELSE %]
|
|
<form action="[% script_name %]" name="Aform" method="post">
|
|
[% END %]
|
|
<fieldset class="rows"><legend>
|
|
[% IF ( modify ) %]Modify
|
|
[% ELSE %]Add
|
|
[% END %] a system preference</legend><ol>
|
|
<li><label for="explanation">Explanation: </label><input type="text" name="explanation" id="explanation" size="60" value="[% explanation |html %]" /><input type="hidden" name="op" value="add_validate" /></li>
|
|
<li>[% IF ( searchfield ) %]<span class="label">Variable: </span>[% searchfield %]<input type="hidden" name="variable" value="[% searchfield %]" />
|
|
[% ELSE %]<label for="variable">Variable: </label><input type="text" name="variable" id="variable" size="60" />[% END %]</li>
|
|
<li><label for="value">Value: </label>
|
|
[% IF ( type_free ) %]
|
|
<textarea id="value" name="value" cols="[% fieldlength %]">[% value |html %]</textarea>
|
|
[% ELSIF ( type_upload ) %]
|
|
<input type="file" name="value" />
|
|
[% ELSIF ( type_textarea ) %]
|
|
<textarea name="value" id="value" rows="[% rows %]" cols="[% cols %]">[% value |html %]</textarea>
|
|
[% ELSIF ( type_choice ) %]
|
|
<select name="value" id="value">
|
|
[% FOREACH option IN options %]
|
|
[% IF ( option.selected ) %]
|
|
<option value="[% option.option %]" selected="selected">
|
|
[% ELSE %]
|
|
<option value="[% option.option %]">
|
|
[% END %][% option.option %]</option>
|
|
[% END %]
|
|
</select>
|
|
[% END %]
|
|
[% IF ( type_langselector ) %]
|
|
[% IF ( languages_loop ) %]
|
|
<table>
|
|
[% FOREACH languages_loo IN languages_loop %]
|
|
<tr><td>
|
|
[% IF ( languages_loo.plural ) %]
|
|
[% IF ( languages_loo.native_description ) %][% languages_loo.native_description %][% ELSE %][% languages_loo.rfc4646_subtag %][% END %]
|
|
[% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %]<table><tr><td>
|
|
[% IF ( sublanguages_loo.sublanguage_current ) %]
|
|
<label for="[% sublanguages_loo.rfc4646_subtag %]">[% sublanguages_loo.native_description %] [% sublanguages_loo.script_description %] [% sublanguages_loo.region_description %] [% sublanguages_loo.variant_description %]([% sublanguages_loo.rfc4646_subtag %])
|
|
[% IF ( sublanguages_loo.enabled ) %]
|
|
<input value="[% sublanguages_loo.rfc4646_subtag %]" name="value" id="[% sublanguages_loo.rfc4646_subtag %]" type="checkbox" checked="checked" />
|
|
[% ELSE %]
|
|
<input value="[% sublanguages_loo.rfc4646_subtag %]" name="value" id="[% sublanguages_loo.rfc4646_subtag %]" type="checkbox" />
|
|
[% END %]
|
|
</label>
|
|
|
|
[% ELSE %]
|
|
<label for="[% sublanguages_loo.rfc4646_subtag %]">[% sublanguages_loo.native_description %] [% sublanguages_loo.script_description %] [% sublanguages_loo.region_description %] [% sublanguages_loo.variant_description %]([% sublanguages_loo.rfc4646_subtag %])
|
|
[% IF ( sublanguages_loo.enabled ) %]
|
|
<input value="[% sublanguages_loo.rfc4646_subtag %]" name="value" id="[% sublanguages_loo.rfc4646_subtag %]" type="checkbox" checked="checked" />
|
|
[% ELSE %]
|
|
<input value="[% sublanguages_loo.rfc4646_subtag %]" name="value" id="[% sublanguages_loo.rfc4646_subtag %]" type="checkbox" />
|
|
[% END %]
|
|
</label>
|
|
[% END %]</td></tr></table>
|
|
[% END %]
|
|
|
|
[% ELSE %]
|
|
[% IF ( languages_loo.current ) %]
|
|
<label for="[% languages_loo.rfc4646_subtag %]">[% languages_loo.native_description %]([% languages_loo.rfc4646_subtag %])
|
|
[% IF ( languages_loo.group_enabled ) %]
|
|
<input value="[% languages_loo.rfc4646_subtag %]" name="value" id="[% languages_loo.rfc4646_subtag %]" type="checkbox" checked="checked" />
|
|
[% ELSE %]
|
|
<input value="[% languages_loo.rfc4646_subtag %]" name="value" id="[% languages_loo.rfc4646_subtag %]" type="checkbox" />
|
|
[% END %]
|
|
</label>
|
|
[% ELSE %]
|
|
<label for="[% languages_loo.rfc4646_subtag %]">[% languages_loo.native_description %]([% languages_loo.rfc4646_subtag %])
|
|
[% IF ( languages_loo.group_enabled ) %]
|
|
<input value="[% languages_loo.rfc4646_subtag %]" name="value" id="[% languages_loo.rfc4646_subtag %]" type="checkbox" checked="checked" />
|
|
[% ELSE %]
|
|
<input value="[% languages_loo.rfc4646_subtag %]" name="value" id="[% languages_loo.rfc4646_subtag %]" type="checkbox" />
|
|
[% END %]
|
|
</label>
|
|
[% END %]
|
|
[% END %]
|
|
</td></tr>
|
|
[% END %]
|
|
</table>
|
|
[% END %]
|
|
|
|
[% END %]
|
|
|
|
[% IF ( type_yesno ) %]
|
|
[% IF ( value_yes ) %]
|
|
<input type="radio" name="value" id="value" value="1" checked="checked" />[% ELSE %]<input type="radio" name="value" id="value" value="1" />
|
|
[% END %]
|
|
<label for="value" class="yesno">ON</label>
|
|
[% IF ( value_no ) %]
|
|
<input type="radio" name="value" id="value-no" value="0" checked="checked" />[% ELSE %]<input type="radio" name="value" id="value-no" value="0" />
|
|
[% END %]
|
|
<label for="value-no" class="yesno">OFF</label>
|
|
[% END %]
|
|
</li>
|
|
</ol></fieldset>
|
|
<fieldset class="action"><input type="submit" value="Save" />
|
|
[% IF ( return_tab ) %]
|
|
<a class="cancel" href="/cgi-bin/koha/admin/systempreferences.pl?tab=[% return_tab %]">Cancel</a>
|
|
[% ELSE %]
|
|
<a class="cancel" href="/cgi-bin/koha/admin/systempreferences.pl">Cancel</a>
|
|
[% END %]
|
|
</fieldset>
|
|
|
|
<fieldset class="brief">
|
|
<legend>Koha internal</legend>
|
|
<div class="hint">Note: you should have no reasons to modify the following default values</div>
|
|
<ol>
|
|
<li><label for="preftype">Variable type:</label>
|
|
<div class="hint"> (<span class="variabletype" id="Choice">Choice</span>, <span class="variabletype" id="YesNo">YesNo</span>, <span class="variabletype" id="Integer">Integer</span>, <span class="variabletype" id="Textarea">Textarea</span>, <span class="variabletype" id="Float">Float</span>, <span class="variabletype" id="Themes">Themes</span>, <span class="variabletype" id="Languages">Languages</span>, <span class="variabletype" id="Upload">Upload</span> or <span class="variabletype" id="ClassSources">ClassSources</span>)</div>
|
|
<input type="text" name="preftype" id="preftype" value="[% preftype %]" size="40" maxlength="40" /></li>
|
|
<li><label for="prefoptions">Variable options:</label>
|
|
<div class="hint">(a choice list for choice (separated by |) or cols|rows for texarea)</div>
|
|
<input type="text" name="prefoptions" id="prefoptions" value="[% prefoptions %]" size="60" maxlength="80" /></li>
|
|
</ol>
|
|
</fieldset>
|
|
</form>
|
|
[% END %]
|
|
|
|
[% IF ( add_validate ) %]
|
|
<h3>Data recorded</h3>
|
|
|
|
<form action="[% script_name %]" method="post">
|
|
<input type="submit" value="OK" />
|
|
</form>
|
|
[% END %]
|
|
|
|
[% IF ( delete_confirm ) %]
|
|
<table>
|
|
<caption>Confirm deletion of [% searchfield %]?</caption>
|
|
<tr>
|
|
<th>Variable name:</th>
|
|
<td>[% searchfield %]</td>
|
|
</tr>
|
|
<tr><th>Value: </th><td>
|
|
[% Tvalue %]
|
|
</td></tr></table>
|
|
<form class="inline" action="[% script_name %]" method="post">
|
|
<input type="hidden" name="op" value="delete_confirmed" />
|
|
<input type="hidden" name="searchfield" value="[% searchfield %]" />
|
|
<input type="hidden" name="Tvalue" value="[% Tvalue %]" />
|
|
<input type="submit" value="Yes, delete" /></form>
|
|
<form class="inline" action="[% script_name %]" method="post"><input type="submit" value="No, do not delete" /></form>
|
|
[% END %]
|
|
|
|
[% IF ( delete_confirmed ) %]
|
|
<h3>Data deleted</h3>
|
|
<form action="[% script_name %]" method="post">
|
|
<input type="submit" value="Back to System Preferences" />
|
|
</form>
|
|
[% END %]
|
|
|
|
[% IF ( else ) %]
|
|
|
|
<div id="toolbar" class="btn-toolbar">
|
|
<a class="btn btn-small" id="newstopword" href="[% script_name %]?op=add_form"><i class="icon-plus"></i> New preference</a>
|
|
</div>
|
|
|
|
[% IF ( tab != 'local_use' ) %]
|
|
<p>Please click on one of the tabs at the left side of this form.</p>
|
|
<table>
|
|
[% ELSE %]
|
|
<h1>Local use preferences</h1>
|
|
<table width="80%" id="sysprefst">
|
|
<thead><tr>
|
|
<th>Preference</th>
|
|
<th>Explanation</th>
|
|
<th>Value</th>
|
|
<th>Edit</th>
|
|
<th>Delete</th>
|
|
</tr></thead>
|
|
[% END %]
|
|
<tbody>[% FOREACH loo IN loop %]
|
|
<tr>
|
|
|
|
<td><strong><a href="[% loo.edit %]">[% loo.variable %]</a></strong></td><td> [% loo.explanation |html %]</td>
|
|
[% IF ( loo.oneline ) %]
|
|
<td class="single-line">
|
|
[% ELSE %]
|
|
<td>
|
|
[% END %]
|
|
[% IF ( loo.type_upload ) %]
|
|
<form action="/cgi-bin/koha/admin/systempreferences.pl" method="post" enctype="multipart/form-data">
|
|
[% ELSE %]
|
|
<form action="/cgi-bin/koha/admin/systempreferences.pl" method="post">
|
|
[% END %]
|
|
[% IF ( loo.type_free ) %]
|
|
<input type="text" name="value" size="[% loo.fieldlength %]" value="[% loo.value |html %]" />
|
|
[% END %]
|
|
[% IF ( loo.type_upload ) %]
|
|
<input type="file" name="value" value="[% loo.value |html %]" />
|
|
[% END %]
|
|
[% IF ( loo.type_textarea ) %]
|
|
<a class="expand-textarea" style="display: none" href="#">Click to edit</a>
|
|
<textarea name="value" rows="[% loo.rows %]" cols="[% loo.cols %]">[% loo.value |html %]</textarea>
|
|
[% END %]
|
|
[% IF ( loo.type_choice ) %]
|
|
<select name="value">
|
|
[% FOREACH option IN loo.options %]
|
|
[% IF ( option.selected ) %]
|
|
<option value="[% option.option %]" selected="selected">
|
|
[% ELSE %]
|
|
<option value="[% option.option %]">
|
|
[% END %][% option.option %]</option>
|
|
[% END %]
|
|
</select>
|
|
[% END %]
|
|
[% IF ( loo.type_langselector ) %]
|
|
[% IF ( loo.languages_loop ) %]
|
|
<table>
|
|
[% FOREACH languages_loo IN loo.languages_loop %]
|
|
<tr><td>
|
|
[% IF ( languages_loo.plural ) %]
|
|
[% IF ( languages_loo.native_description ) %][% languages_loo.native_description %][% ELSE %][% languages_loo.rfc4646_subtag %][% END %]
|
|
[% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %]<table><tr><td>
|
|
[% IF ( sublanguages_loo.sublanguage_current ) %]
|
|
<label for="[% sublanguages_loo.rfc4646_subtag %]">[% sublanguages_loo.native_description %] [% sublanguages_loo.script_description %] [% sublanguages_loo.region_description %] [% sublanguages_loo.variant_description %]([% sublanguages_loo.rfc4646_subtag %])
|
|
[% IF ( sublanguages_loo.enabled ) %]
|
|
<input value="[% sublanguages_loo.rfc4646_subtag %]" name="value" id="[% sublanguages_loo.rfc4646_subtag %]" type="checkbox" checked="checked" />
|
|
[% ELSE %]
|
|
<input value="[% sublanguages_loo.rfc4646_subtag %]" name="value" id="[% sublanguages_loo.rfc4646_subtag %]" type="checkbox" />
|
|
[% END %]
|
|
</label>
|
|
|
|
[% ELSE %]
|
|
<label for="[% sublanguages_loo.rfc4646_subtag %]">[% sublanguages_loo.native_description %] [% sublanguages_loo.script_description %] [% sublanguages_loo.region_description %] [% sublanguages_loo.variant_description %]([% sublanguages_loo.rfc4646_subtag %])
|
|
[% IF ( sublanguages_loo.enabled ) %]
|
|
<input value="[% sublanguages_loo.rfc4646_subtag %]" name="value" id="[% sublanguages_loo.rfc4646_subtag %]" type="checkbox" checked="checked" />
|
|
[% ELSE %]
|
|
<input value="[% sublanguages_loo.rfc4646_subtag %]" name="value" id="[% sublanguages_loo.rfc4646_subtag %]" type="checkbox" />
|
|
[% END %]
|
|
</label>
|
|
[% END %]</td></tr></table>
|
|
[% END %]
|
|
|
|
[% ELSE %]
|
|
[% IF ( languages_loo.current ) %]
|
|
<label for="[% languages_loo.rfc4646_subtag %]">[% languages_loo.native_description %]([% languages_loo.rfc4646_subtag %])
|
|
[% IF ( languages_loo.group_enabled ) %]
|
|
<input value="[% languages_loo.rfc4646_subtag %]" name="value" id="opac[% languages_loo.rfc4646_subtag %]" type="checkbox" checked="checked" />
|
|
[% ELSE %]
|
|
<input value="[% languages_loo.rfc4646_subtag %]" name="value" id="opac[% languages_loo.rfc4646_subtag %]" type="checkbox" />
|
|
[% END %]
|
|
</label>
|
|
[% ELSE %]
|
|
<label for="[% languages_loo.rfc4646_subtag %]">[% languages_loo.native_description %]([% languages_loo.rfc4646_subtag %])
|
|
[% IF ( languages_loo.group_enabled ) %]
|
|
<input value="[% languages_loo.rfc4646_subtag %]" name="value" id="opac[% languages_loo.rfc4646_subtag %]" type="checkbox" checked="checked" />
|
|
[% ELSE %]
|
|
<input value="[% languages_loo.rfc4646_subtag %]" name="value" id="opac[% languages_loo.rfc4646_subtag %]" type="checkbox" />
|
|
[% END %]
|
|
</label>
|
|
[% END %]
|
|
[% END %]
|
|
</td></tr>
|
|
[% END %]
|
|
</table>
|
|
[% END %]
|
|
|
|
[% END %]
|
|
|
|
[% IF ( loo.type_yesno ) %]
|
|
[% IF ( loo.value_yes ) %]
|
|
<input type="radio" name="value" value="1" checked="checked" />[% ELSE %]<input type="radio" name="value" value="1" />
|
|
[% END %]
|
|
<label for="value" class="yesno">ON</label>
|
|
[% IF ( loo.value_no ) %]
|
|
<input type="radio" name="value" value="0" checked="checked" />[% ELSE %]<input type="radio" name="value" value="0" />
|
|
[% END %]
|
|
<label for="value-no" class="yesno">OFF</label>
|
|
[% END %]
|
|
<input type="hidden" name="op" value="add_validate" />
|
|
<input type="hidden" name="variable" value="[% loo.variable %]" />
|
|
<input type="hidden" name="prefoptions" value="[% loo.prefoptions |html %]" />
|
|
<input type="hidden" name="preftype" value="[% loo.type %]" />
|
|
<input type="hidden" name="explanation" value="[% loo.explanation |html %]" />
|
|
<input type="submit" value="Save" />
|
|
</form>
|
|
</td>
|
|
|
|
<td><a href="[% loo.edit %]">Edit </a></td>
|
|
<td><a href="[% loo.delete %]">Delete</a></td>
|
|
</tr>
|
|
[% END %]</tbody>
|
|
</table>
|
|
|
|
[% END %]
|
|
|
|
</div>
|
|
</div>
|
|
<div class="yui-b">
|
|
[% INCLUDE 'prefs-menu.inc' %]
|
|
</div>
|
|
</div>
|
|
[% INCLUDE 'intranet-bottom.inc' %]
|