[19/40] Various tweaks to the interface cosmetics, form validation scripts, css, etc.

This commit is contained in:
Chris Nighswonger 2009-08-05 11:31:06 -04:00
parent c9e6962fd4
commit a339f5f94a
7 changed files with 156 additions and 87 deletions

View file

@ -1,38 +1,66 @@
<div id="header" class="clearfix">
<div id="toplevelnav">
<ul id="toplevelmenu">
<!-- TMPL_IF NAME="CAN_user_circulate" --><li><a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a></li><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="CAN_user_borrowers" --><li><a href="/cgi-bin/koha/members/members-home.pl">Patrons</a></li><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="CAN_user_catalogue" --><li><a href="/cgi-bin/koha/catalogue/search.pl">Search</a></li><!-- /TMPL_IF -->
<!-- TMPL_VAR name="IntranetNav" -->
<li class="more"><a id="showmore" href="/cgi-bin/koha/mainpage.pl">More</a><div id="moremenu"><div class="bd"><ul>
<li><a href="/cgi-bin/koha/virtualshelves/shelves.pl">Lists</a></li>
<!-- TMPL_IF NAME="CAN_user_editcatalogue" --><li><a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a></li>
<!-- TMPL_IF NAME="CAN_user_acquisition" -->
<li><a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a></li>
<!-- /TMPL_IF -->
<li><a href="/cgi-bin/koha/authorities/authorities-home.pl">Authorities</a></li>
<!-- TMPL_IF NAME="CAN_user_serials" -->
<li><a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a></li><!-- /TMPL_IF -->
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="CAN_user_reports" --><li><a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a></li><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="CAN_user_tools" --><li><a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a></li><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="CAN_user_parameters" --><li><a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a></li><!-- /TMPL_IF -->
<li><a href="/cgi-bin/koha/about.pl">About Koha</a></li></ul></div></div></li>
</ul>
</div>
<div id="login">
<!-- TMPL_IF NAME="AutoLocation" --><strong><!-- TMPL_VAR NAME="LoginBranchname" --></strong>
<!-- TMPL_ELSE -->
<strong><!-- TMPL_VAR NAME="LoginBranchname" --></strong>
<!-- TMPL_IF NAME="IndependantBranches" -->
<!-- TMPL_IF NAME="CAN_user_management" --> (<a href="/cgi-bin/koha/circ/selectbranchprinter.pl">Set</a>)<!-- /TMPL_IF -->
<!-- TMPL_ELSE -->
(<a href="/cgi-bin/koha/circ/selectbranchprinter.pl">Set</a>)
<!-- /TMPL_IF -->
| <!-- /TMPL_IF -->
<!-- TMPL_IF NAME="loggedinusername" --><span class="loggedinusername"><!-- TMPL_VAR NAME="loggedinusername" --></span> (<a href="/cgi-bin/koha/mainpage.pl?logout.x=1">Log Out</a>) |
<!-- TMPL_ELSE -->You are not logged in |
<!-- /TMPL_IF -->
<a href="/cgi-bin/koha/help.pl" id="helper" onclick="window.open('/cgi-bin/koha/help.pl','Koha_Help','width=600,height=600,toolbar=false,scrollbars=yes'); return false;">[ ? ]</a></div></div>
<div id="header" class="clearfix">
<div id="toplevelnav">
<ul id="toplevelmenu">
<!-- TMPL_IF NAME="CAN_user_circulate" --><li><a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a></li><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="CAN_user_borrowers" --><li><a href="/cgi-bin/koha/members/members-home.pl">Patrons</a></li><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="CAN_user_catalogue" --><li><a href="/cgi-bin/koha/catalogue/search.pl">Search</a></li><!-- /TMPL_IF -->
<!-- TMPL_VAR name="IntranetNav" -->
<li class="more">
<a id="showmore" href="/cgi-bin/koha/mainpage.pl">More</a>
<div id="moremenu">
<div class="bd">
<ul>
<li><a href="/cgi-bin/koha/virtualshelves/shelves.pl">Lists</a></li>
<!-- TMPL_IF NAME="CAN_user_editcatalogue" -->
<li><a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a></li>
<!-- TMPL_IF NAME="CAN_user_acquisition" -->
<li><a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a></li>
<!-- /TMPL_IF -->
<li><a href="/cgi-bin/koha/authorities/authorities-home.pl">Authorities</a></li>
<!-- TMPL_IF NAME="CAN_user_serials" -->
<li><a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a></li>
<!-- /TMPL_IF -->
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="CAN_user_reports" -->
<li><a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a></li>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="CAN_user_tools" -->
<li><a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a></li>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="CAN_user_parameters" -->
<li><a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a></li>
<!-- /TMPL_IF -->
<li><a href="/cgi-bin/koha/about.pl">About Koha</a></li>
</ul>
</div>
</div>
</li>
</ul>
</div>
<div id="login">
<!-- TMPL_IF NAME="AutoLocation" -->
<strong>
<!-- TMPL_VAR NAME="LoginBranchname" -->
</strong>
<!-- TMPL_ELSE -->
<strong><!-- TMPL_VAR NAME="LoginBranchname" --></strong>
<!-- TMPL_IF NAME="IndependantBranches" -->
<!-- TMPL_IF NAME="CAN_user_management" -->
(<a href="/cgi-bin/koha/circ/selectbranchprinter.pl">Set</a>)
<!-- /TMPL_IF -->
<!-- TMPL_ELSE -->
(<a href="/cgi-bin/koha/circ/selectbranchprinter.pl">Set</a>)
<!-- /TMPL_IF -->
|
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="loggedinusername" -->
<span class="loggedinusername">
<!-- TMPL_VAR NAME="loggedinusername" -->
</span>
(<a href="/cgi-bin/koha/mainpage.pl?logout.x=1">Log Out</a>) |
<!-- TMPL_ELSE -->
You are not logged in |
<!-- /TMPL_IF -->
<a href="/cgi-bin/koha/help.pl" id="helper" onclick="window.open('/cgi-bin/koha/help.pl','Koha_Help','width=600,height=600,toolbar=false,scrollbars=yes'); return false;">[ ? ]</a>
</div>
</div>

View file

@ -60,7 +60,16 @@
.GB_header table {
margin: 0;
width: 100%;
border-collapse: collapse;
border-collapse: separate;
border-right: 0px;
border-top: 0px;
}
.GB_header td {
background-color: #333333;
border-bottom: 0px;
border-left: 0px;
padding: 0em 0em;
}
.GB_header .caption {
@ -68,6 +77,7 @@
color: #eee;
white-space: nowrap;
font-size: 20px;
border-collapse: separate;
}
.GB_header .close {

View file

@ -116,8 +116,9 @@ $(document).ready(function(){
<td><!-- TMPL_VAR NAME="edition" --></td>
<td><!-- TMPL_VAR NAME="isbn" --></td>
<td><!-- TMPL_VAR NAME="lccn" --></td>
<td><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=<!-- TMPL_VAR NAME="breedingid" -->" title="MARC" rel="gb_page_center[600,500]">MARC</a></td><td><a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;importid=<!-- TMPL_VAR NAME="breedingid" -->" title="MARC" rel="gb_page_center[600,500]">Card</a></td>
<td><a href="javascript:Import(<!-- TMPL_VAR NAME="breedingid" -->,<!-- TMPL_VAR NAME="biblionumber" -->)">Import</a></td>
<td><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=<!-- TMPL_VAR NAME="breedingid" -->" title="MARC" rel="gb_page_center[600,500]">MARC</a></td>
<td><a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&importid=<!-- TMPL_VAR NAME="breedingid" -->" title="MARC" rel="gb_page_center[600,500]">Card</a></td>
<td><a href="javascript:Import(<!-- TMPL_VAR NAME="breedingid" -->,<!-- TMPL_VAR NAME="biblionumber" -->)">Import</a></td>
</tr>
<!-- /TMPL_IF -->
<!-- /TMPL_LOOP --></tbody>

View file

@ -3,21 +3,35 @@
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
<script type="text/JavaScript" language="JavaScript">
//<![CDATA[
function RemoveConfirm() {
var label_id = selected_layout();
if (label_id>-1) {
var msg = "Are you sure you want to the selected item from this batch?"
var answer = confirm(msg);
if (answer) {
window.location = "/cgi-bin/koha/labels/label-edit-batch.pl?op=remove&amp;batch_id=<!-- TMPL_VAR NAME="batch_id" -->&amp;label_id=" + label_id;
function Remove() {
items= new Array;
if(document.items.action.length > 0) {
for (var i=0; i < document.items.action.length; i++) {
if (document.items.action[i].checked) {
items.push("label_id=" + document.items.action[i].value);
}
}
else {
return; // abort delete
if (items.length < 1) {
alert("Please select at least one item to delete.");
return; // no item selected
}
getstr = items.join("&");
}
else if (document.items.action.checked) {
getstr = "label_id="+document.items.action.value;
}
else {
return; // no layout selected
};
alert("Please select at least one item to delete.");
return; // no item selected
}
var msg = "Are you sure you want to the selected item(s) from this batch?"
var answer = confirm(msg);
if (answer) {
window.location = "/cgi-bin/koha/labels/label-edit-batch.pl?op=remove&amp;batch_id=<!-- TMPL_VAR NAME="batch_id" -->&amp;" + getstr;
}
else {
return; // abort delete
}
};
function Add() {
window.location = "/cgi-bin/koha/labels/label-edit-batch.pl?op=add&amp;batch_id=<!-- TMPL_VAR NAME="batch_id" -->";
@ -39,16 +53,16 @@
};
};
function selected_layout() {
if (document.layouts.action.length) {
for (i=0;i<document.layouts.action.length;i++){
if (document.layouts.action[i].checked==true){
return(document.layouts.action[i].value);
if (document.items.action.length) {
for (i=0;i<document.items.action.length;i++){
if (document.items.action[i].checked==true){
return(document.items.action[i].value);
}
};
}
else {
if (document.layouts.action.checked){
return(document.layouts.action.value);
if (document.items.action.checked){
return(document.items.action.value);
}
//var x=document.getElementsByName("action");
//if (x[0].checked) {
@ -56,7 +70,7 @@
// return(x[0].value);
//};
};
alert("Please select an item.");
alert("Please select at least one item.");
return (-1);
};
//]]>
@ -79,7 +93,7 @@
<div class="yui-gc">
<div class="yui-u first" id="manage-label-batches">
<div class="hint">Current Branch: <!-- TMPL_VAR NAME="LoginBranchname" --></div>
<form name="layouts">
<form name="items">
<h2>Items in batch number <!-- TMPL_VAR NAME="batch_id" --></h2>
<table>
<!-- TMPL_LOOP NAME="table_loop" -->
@ -93,7 +107,7 @@
<tr>
<!-- TMPL_LOOP NAME="text_fields" -->
<!-- TMPL_IF NAME="select_field" -->
<td align="center"><input type="radio" name="action" value="<!-- TMPL_VAR NAME="field_value" -->"></td>
<td align="center"><input type="checkbox" name="action" value="<!-- TMPL_VAR NAME="field_value" -->"></td>
<!-- TMPL_ELSE -->
<td><!-- TMPL_VAR NAME="field_value" --></td>
<!-- /TMPL_IF -->
@ -104,9 +118,9 @@
</table>
</form>
<div style="margin: 10px 10px 10px 0px;">
<span class="yui-button yui-link-button"><span class="first-child"><input type="button" id="add" onclick="Add()" value="Add Item"></span></span>
<span class="yui-button yui-link-button"><span class="first-child"><input type="button" id="remove" onclick="RemoveConfirm()" value="Remove Item"></span></span>
<span class="yui-button yui-link-button"><span class="first-child"><input type="button" id="print_item" onclick="Print(item)" value="Print Item"></span></span>
<span class="yui-button yui-link-button"><span class="first-child"><input type="button" id="add" onclick="Add()" value="Add Item(s)"></span></span>
<span class="yui-button yui-link-button"><span class="first-child"><input type="button" id="remove" onclick="Remove()" value="Remove Item(s)"></span></span>
<span class="yui-button yui-link-button"><span class="first-child"><input type="button" id="print_item" onclick="Print(item)" value="Print Item(s)"></span></span>
<span class="yui-button yui-link-button"><span class="first-child"><input type="button" id="print_batch" onclick="Print(batch)" value="Print Batch"></span></span>
</div>
</div>

View file

@ -4,7 +4,7 @@
<script type="text/JavaScript" language="JavaScript">
//<![CDATA[
function DeleteConfirm() {
var element_id = selected_layout();
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);
@ -20,7 +20,7 @@
};
};
function Edit() {
var element_id = selected_layout();
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&amp;element_id=" + element_id;
}
@ -29,7 +29,7 @@
};
};
function Print() {
var element_id = selected_layout();
var element_id = selected_layout("print");
if (element_id>-1) {
window.location = "/cgi-bin/koha/labels/label-edit-<!-- TMPL_VAR NAME="label_element" -->.pl?op=edit&amp;element_id=" + element_id;
}
@ -37,13 +37,21 @@
return; // no layout selected
};
};
function selected_layout() {
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==true){
return(document.layouts.action[i].value);
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){
@ -92,7 +100,7 @@
<tr>
<!-- TMPL_LOOP NAME="text_fields" -->
<!-- TMPL_IF NAME="select_field" -->
<td align="center"><input type="radio" name="action" value="<!-- TMPL_VAR NAME="field_value" -->"></td>
<td align="center"><input type="checkbox" name="action" value="<!-- TMPL_VAR NAME="field_value" -->"></td>
<!-- TMPL_ELSE -->
<td><!-- TMPL_VAR NAME="field_value" --></td>
<!-- /TMPL_IF -->

View file

@ -1,7 +1,7 @@
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
<title>Koha &rsaquo; Barcodes and Labels &rsaquo; Search Results</title>
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
<style type="text/css">#custom-doc { width:46.23em;*width:45.04em;min-width:610px; margin:auto;margin-top: .4em; text-align:left; }</style>
<style type="text/css">#custom-doc { width:46.23em;*width:45.04em;min-width:700px; margin:auto;margin-top: .4em; text-align:left; }</style>
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.checkboxes.pack.js"></script>
<script type="text/javascript">
//<![CDATA[
@ -35,9 +35,10 @@
}
var myurl = "label-edit-batch.pl?op=add&batch_id="+batch_id+
"&"+getstr;
window.opener.location.href = myurl;
window.opener.location.href = myurl;
//top.location.href=myurl;
}
]]>
//]]>
</script>
</head>
<body>
@ -69,16 +70,17 @@
Search results
</div>
<form name="resultform" class="checkboxed" action="">
<div style="float: right; margin-top: .5em; margin-left: .7em; margin-bottom: .7em">
<input type="submit" class="icon addchecked" value="Add checked" onclick="add_item('checked',<!-- TMPL_VAR NAME="batch_id" -->,'<!-- TMPL_VAR NAME="type" -->'); return false" />
<input type="button" class="close" value="Done" />
</div>
<div style="line-height: 2em; margin-left: .7em;">
<a id="CheckAll" href="/cgi-bin/koha/labels/label-item-search.pl">Select All</a>
<span class="clearall">
<a id="CheckNone" href="/cgi-bin/koha/labels/label-item-search.pl">Clear All</a>
</span>
<div style="float: right; margin-top: .5em; margin-left: .7em; margin-bottom: .7em">
<input type="submit" class="icon addchecked" value="Add checked" onclick="add_item('checked',<!-- TMPL_VAR NAME="batch_id" -->,'<!-- TMPL_VAR NAME="type" -->'); return false" />
<input type="button" class="close" value="Done" />
</div>
<div style="float: left; margin-top: .5em; margin-right: .7em; margin-bottom: .7em">
<input id="CheckAll" type="submit" class="icon checkall" value="Check All" onclick="return false" />
<!--<a id="CheckAll" href="/cgi-bin/koha/labels/label-item-search.pl">Select All</a>-->
<input id="CheckNone" type="submit" class="icon checknone" value="Clear All" onclick="return false" />
<!--<a id="CheckNone" href="/cgi-bin/koha/labels/label-item-search.pl">Clear All</a>-->
</div>
<div style="padding-top: 0.7em;">
<input type="hidden" name="ccl_query" value="<!-- TMPL_VAR name="ccl_query" -->" />
<!-- TMPL_LOOP name="result_set" -->
<table id="label-search-results" frame="border" border="2">
@ -114,6 +116,7 @@
<!-- /TMPL_LOOP -->
</table>
<!-- /TMPL_LOOP -->
</div>
</form>
</div>
<div class="results">

View file

@ -59,15 +59,20 @@ my $display_columns = [ {_label_number => {label => 'Label Number', link_field
{select => {label => 'Select', value => '_label_id'}},
];
my $op = $cgi->param('op') || undef;
my $label_id = $cgi->param('label_id') || undef;
my @label_ids = $cgi->param('label_id') if $cgi->param('label_id');
my $batch_id = $cgi->param('element_id') || $cgi->param('batch_id') || undef;
my @item_numbers = $cgi->param('item_number') if $cgi->param('item_number');
my $branch_code = get_branch_code_from_name($template->param('LoginBranchname'));
if ($op eq 'remove') {
$batch = C4::Labels::Batch->retrieve(batch_id => $batch_id);
foreach my $label_id (@label_ids) {
$err = $batch->remove_item($label_id);
$errstr = "item $label_id was not removed." if $err;
}
$errstr = "item(s) not removed from batch $batch_id." if $err;
# Something like this would be nice to avoid problems with the browser's 'refresh' button, but it needs an error handling mechanism...
# print $cgi->redirect("label-edit-batch.pl?op=edit&batch_id=$batch_id");
# exit;
}
elsif ($op eq 'delete') {
$err = C4::Labels::Batch::delete(batch_id => $batch_id, branch_code => $branch_code);