Seventh installment Patron card generation feature
authorChris Nighswonger <cnighswonger@foundations.edu>
Mon, 17 Mar 2008 14:43:57 +0000 (10:43 -0400)
committerJoshua Ferraro <jmf@liblime.com>
Tue, 18 Mar 2008 01:43:10 +0000 (20:43 -0500)
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
koha-tmpl/intranet-tmpl/prog/en/includes/tools-labels-batches-toolbar.inc
koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manager.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/labels/result.tmpl

index 08c8d7c..d8a218f 100644 (file)
@@ -1,7 +1,12 @@
+<!-- TMPL_IF EXPR="(batch_type eq 'labels')" -->
 <div id="toolbar">
        <script type="text/javascript">
        //<![CDATA[
 
+        function Plugin(batch_id) {
+               window.open("label-item-search.pl?batch_id="+batch_id+"",'FindABibIndex','width=640,height=400,toolbar=no,scrollbars=yes');
+        }
+
        // prepare DOM for YUI Toolbar
 
         $(document).ready(function() {
        <li><a id="dedup" href="/cgi-bin/koha/labels/label-manager.pl?op=deduplicate&amp;batch_id=<!-- TMPL_VAR NAME="batch_id" -->&amp;type=<!-- TMPL_VAR NAME="batch_type" -->">Remove duplicate barcodes</a></li>
        <li><a id="generate" href="/cgi-bin/koha/labels/label-print-pdf.pl?batch_id=<!-- TMPL_VAR NAME="batch_id" -->&amp;type=<!-- TMPL_VAR NAME="batch_type" -->">Generate PDF for Batch</a></li>
 </ul></div>
+<!-- TMPL_ELSIF EXPR="(batch_type eq 'patroncards')" -->
+<div id="toolbar">
+       <script type="text/javascript">
+       //<![CDATA[
+
+        function Plugin(batch_id) {
+               window.open("label-patron-search.pl?batch_id="+batch_id+"",'FindABibIndex','width=640,height=400,toolbar=no,scrollbars=yes');
+        }
+
+       // prepare DOM for YUI Toolbar
+
+        $(document).ready(function() {
+               $("#addpatronsc").empty();
+           yuiToolbar();
+        });
+
+       // YUI Toolbar Functions
+
+       function yuiToolbar() {
+               new YAHOO.widget.Button({
+                                            id: "addpatrons", 
+                                            type: "button", 
+                                            label: "Add patron(s) to batch", 
+                                            container: "addpatronsc",
+                                                                                       onclick: {fn:function(){Plugin(<!-- TMPL_VAR NAME="batch_id" -->)}}
+                                        });
+               new YAHOO.widget.Button("deletebatch");
+               new YAHOO.widget.Button("dedup");
+               new YAHOO.widget.Button("generate");
+       }
+
+       //]]>
+       </script>
+       <ul class="toolbar">
+       <li id="addpatronsc"><a id="addpatrons" href="#" onclick="Plugin(<!-- TMPL_VAR NAME="batch_id" -->); return false;">Add item(s) to batch</a></li>
+       <li><a id="deletebatch" href="/cgi-bin/koha/labels/label-manager.pl?op=delete_batch&amp;batch_id=<!-- TMPL_VAR NAME="batch_id" -->&amp;type=<!-- TMPL_VAR NAME="batch_type" -->">Delete current batch</a></li>
+                               <!-- FIXME: should use POST to change server state, not GET -->
+       <li><a id="dedup" href="/cgi-bin/koha/labels/label-manager.pl?op=deduplicate&amp;batch_id=<!-- TMPL_VAR NAME="batch_id" -->&amp;type=<!-- TMPL_VAR NAME="batch_type" -->">Remove duplicate barcodes</a></li>
+       <li><a id="generate" href="/cgi-bin/koha/labels/label-print-pdf.pl?batch_id=<!-- TMPL_VAR NAME="batch_id" -->&amp;type=<!-- TMPL_VAR NAME="batch_type" -->">Generate PDF for Batch</a></li>
+</ul></div>
+<!-- /TMPL_IF -->
index 91a4b6e..d154e56 100644 (file)
@@ -1,10 +1,5 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><title>Koha &rsaquo; <!-- TMPL_IF EXPR="(batch_type eq 'labels')" -->Labels<!-- TMPL_ELSIF EXPR="(batch_type eq 'patroncards')" -->Patron Cards<!-- /TMPL_IF --></title>
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
-<script type="text/javascript">
-function Plugin(batch_id) {
-       window.open("label-item-search.pl?batch_id="+batch_id+"",'FindABibIndex','width=640,height=400,toolbar=no,scrollbars=yes');
-}
-</script>
 </head>
 <body>
 <!-- TMPL_INCLUDE NAME="header.inc" -->
@@ -22,8 +17,8 @@ function Plugin(batch_id) {
        <!-- /TMPL_LOOP -->
 <!-- /TMPL_IF -->
 
-<!-- TMPL_INCLUDE NAME="tools-labels-toolbar.inc" -->
 <!-- TMPL_IF NAME="batch_id" -->
+<!-- TMPL_INCLUDE NAME="tools-labels-batches-toolbar.inc" -->
 <!-- TMPL_IF EXPR="(batch_type eq 'labels')" -->
     <h2>Items to be Printed for Batch <!-- TMPL_VAR NAME="batch_id" -->  (<!-- TMPL_VAR NAME="batch_count" -->  items)</h2>
     <table>
@@ -66,9 +61,9 @@ function Plugin(batch_id) {
         </tr>
         <!-- /TMPL_LOOP -->
     </table>
-<!-- TMPL_ELSIF EXPR="(batch_type eq 'patroncards')" -->
 <!-- /TMPL_IF --><!-- /batch_type -->
 <!-- TMPL_ELSE -->
+<!-- TMPL_INCLUDE NAME="tools-labels-toolbar.inc" -->
 <!-- TMPL_IF EXPR="(batch_type eq 'labels')" -->
 <!-- TMPL_IF NAME="batches" -->
     <div class="yui-g">
index 83ae48f..27ae15f 100644 (file)
@@ -100,9 +100,8 @@ function add_item3(itemnumber){
 <!-- /NEW -->
                                </td>
                        </tr>
-                       <!-- /TMPL_LOOP -->
+       <!-- /TMPL_LOOP -->
                </table>
-               <div style="float: right;"><input type="submit" class="icon addchecked" value="Add checked" onclick="add_item('checked',<!-- TMPL_VAR NAME="batch_id" -->); return false" /> <input type="button" class="close" value="Done" /></div>
 </form>
        <div class="results">
                <p>