[19/40] Various tweaks to the interface cosmetics, form validation scripts, css,...
authorChris Nighswonger <cnighswonger@foundations.edu>
Wed, 5 Aug 2009 15:31:06 +0000 (11:31 -0400)
committerChris Nighswonger <cnighswonger@foundations.edu>
Tue, 1 Sep 2009 19:51:03 +0000 (15:51 -0400)
koha-tmpl/intranet-tmpl/prog/en/includes/header.inc
koha-tmpl/intranet-tmpl/prog/en/lib/greybox/gb_styles.css
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/labels/result.tmpl
labels/label-edit-batch.pl

index fd28c3e..4c034e9 100644 (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> 
index 52fdc17..3fad900 100644 (file)
 .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 {
index fe256a6..b599622 100644 (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>
index 4914d21..514176c 100644 (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" -->";
                 };
             };
            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" -->
                                 <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 -->
                             </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>
index 7ca155e..609b32f 100644 (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;
                 }
                     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){
                                 <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 -->
index ac2ea7d..92bc2e5 100644 (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[
                 }
                 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>
                 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">
                     <!-- /TMPL_LOOP -->
                </table>
                <!-- /TMPL_LOOP -->
+                </div>
             </form>
         </div>
        <div class="results">
index 1b9d2d3..0a9877b 100755 (executable)
@@ -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);