Galen Charlton
0bbcfeda0e
As discussed with Chris Nighswonger on #koha, this patch removes the calls to syslog and replaces them with warns so that error messages generated by the labels code are sent to the Apache error log. This avoids splitting this sort of logging across multiple files and is consistent with current practice in most of the rest of Koha. Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
152 lines
8 KiB
Cheetah
152 lines
8 KiB
Cheetah
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
|
|
<title>Koha › Tools › Labels › Manage Label Elements</title>
|
|
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
|
|
<!-- TMPL_INCLUDE NAME="greybox.inc" -->
|
|
<!-- Uncomment the following script line to enable firebug lite for use on IE -->
|
|
<!-- <script type='text/javascript' src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script> -->
|
|
<script type="text/JavaScript" language="JavaScript">
|
|
//<![CDATA[
|
|
function DeleteConfirm() {
|
|
var element_id = selected_layout("delete");
|
|
if (element_id>-1) {
|
|
var msg = "Are you sure you want to delete <!-- TMPL_VAR NAME="label_element" --> " + element_id + "?"
|
|
var answer = confirm(msg);
|
|
if (answer) {
|
|
window.location = "/cgi-bin/koha/labels/label-manage.pl?op=delete&label_element=<!-- TMPL_VAR NAME="label_element" -->&element_id=" + element_id;
|
|
}
|
|
else {
|
|
return; // abort delete
|
|
}
|
|
}
|
|
else {
|
|
return; // no layout selected
|
|
};
|
|
};
|
|
function Edit() {
|
|
var element_id = selected_layout("edit");
|
|
if (element_id>-1) {
|
|
window.location = "/cgi-bin/koha/labels/label-edit-<!-- TMPL_VAR NAME="label_element" -->.pl?op=edit&element_id=" + element_id;
|
|
}
|
|
else {
|
|
return; // no layout selected
|
|
};
|
|
};
|
|
function Xport() {
|
|
batches= new Array;
|
|
if(document.layouts.action.length > 0) {
|
|
for (var i=0; i < document.layouts.action.length; i++) {
|
|
if (document.layouts.action[i].checked) {
|
|
batches.push("batch_id=" + document.layouts.action[i].value);
|
|
}
|
|
}
|
|
if (batches.length < 1) {
|
|
alert("Please select at least one batch to export.");
|
|
return; // no batch selected
|
|
}
|
|
getstr = batches.join("&");
|
|
}
|
|
else if (document.layouts.action.checked) {
|
|
getstr = "batch_id="+document.layouts.action.value;
|
|
}
|
|
else {
|
|
alert("Please select at least one batch to export.");
|
|
return; // no batch selected
|
|
}
|
|
return GB_showCenter('Export Labels', "/cgi-bin/koha/labels/label-print.pl?" + getstr, 700, 800);
|
|
};
|
|
function selected_layout(op) {
|
|
var selected = new Array;
|
|
if (document.layouts.action.length) {
|
|
for (i=0;i<document.layouts.action.length;i++){
|
|
if (document.layouts.action[i].checked){
|
|
selected.push(i);
|
|
}
|
|
};
|
|
if (selected.length == 1) {
|
|
return(document.layouts.action[selected[0]].value);
|
|
}
|
|
else {
|
|
alert("Please select only one <!-- TMPL_VAR NAME="label_element" --> to " + op + ".");
|
|
return (-1);
|
|
}
|
|
}
|
|
else {
|
|
if (document.layouts.action.checked){
|
|
return(document.layouts.action.value);
|
|
}
|
|
};
|
|
alert("Please select a <!-- TMPL_VAR NAME="label_element" -->.");
|
|
return (-1);
|
|
};
|
|
//]]>
|
|
</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> ›
|
|
<a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
|
|
<a href="/cgi-bin/koha/labels/label-home.pl">Labels Home</a> ›
|
|
Manage Label <!-- TMPL_VAR NAME="label_element_title" -->
|
|
</div>
|
|
<div id="doc3" class="yui-t2">
|
|
<div id="bd">
|
|
<div id="yui-main">
|
|
<div class="yui-b">
|
|
<!-- TMPL_INCLUDE NAME="labels-toolbar.inc" -->
|
|
<div class="yui-gc">
|
|
<div class="yui-u first" id="manage-label-layouts">
|
|
<div class="hint">Current Branch: <!-- TMPL_VAR NAME="LoginBranchname" --></div>
|
|
<!-- TMPL_IF NAME="table_loop" -->
|
|
<form name="layouts">
|
|
<h2>Currently Available <!-- TMPL_VAR NAME="label_element_title" --></h2>
|
|
<table>
|
|
<!-- TMPL_LOOP NAME="table_loop" -->
|
|
<!-- TMPL_IF NAME="header_fields" -->
|
|
<tr>
|
|
<!-- TMPL_LOOP NAME="header_fields" -->
|
|
<th><!-- TMPL_VAR NAME="field_label" --></th>
|
|
<!-- /TMPL_LOOP -->
|
|
</tr>
|
|
<!-- TMPL_ELSE -->
|
|
<tr>
|
|
<!-- TMPL_LOOP NAME="text_fields" -->
|
|
<!-- TMPL_IF NAME="select_field" -->
|
|
<td align="center"><input type="checkbox" name="action" value="<!-- TMPL_VAR NAME="field_value" -->"></td>
|
|
<!-- TMPL_ELSIF NAME="field_value" -->
|
|
<td><!-- TMPL_VAR NAME="field_value" --></td>
|
|
<!-- TMPL_ELSE -->
|
|
<td> </td>
|
|
<!-- /TMPL_IF -->
|
|
<!-- /TMPL_LOOP -->
|
|
</tr>
|
|
<!-- /TMPL_IF -->
|
|
<!-- /TMPL_LOOP -->
|
|
</table>
|
|
<div style="margin: 10px 10px 10px 0px;">
|
|
<span class="yui-button yui-link-button"><span class="first-child"><input type="button" id="edit" onclick="Edit()" value="Edit"></span></span>
|
|
<span class="yui-button yui-link-button"><span class="first-child"><input type="button" id="delete" onclick="DeleteConfirm()" value="Delete"></span></span>
|
|
<!-- TMPL_IF NAME="print" --><span class="yui-button yui-link-button"><span class="first-child"><input type="button" id="print" onclick="Xport()" value="Export"></span></span><!-- /TMPL_IF -->
|
|
</div>
|
|
</form>
|
|
<!-- TMPL_ELSE -->
|
|
<h2>There Are No <!-- TMPL_VAR NAME="label_element_title" --> Currently Available.</h2>
|
|
<div class="hint"><h3>Use the toolbar above to create a new <!-- TMPL_VAR NAME="label_element" -->.</h3></div>
|
|
<!-- /TMPL_IF -->
|
|
</div>
|
|
<!-- TMPL_IF NAME="error" -->
|
|
<div class="yui-u">
|
|
<div class="alert">
|
|
<strong>WARNING: An error was encountered and <!-- TMPL_VAR NAME="label_element" --> <!-- TMPL_VAR NAME="element_id" --> was not deleted. Please have your system administrator check the error log for details.</strong>
|
|
</div>
|
|
</div>
|
|
<!-- /TMPL_IF -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="yui-b">
|
|
<!-- TMPL_INCLUDE NAME="labels-menu.inc" -->
|
|
</div>
|
|
</div>
|
|
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
|