koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha/koha-tmpl/intranet-tmpl/npl/en/acqui acqui... [dev_week]


From: Ryan Higgins
Subject: [Koha-cvs] koha/koha-tmpl/intranet-tmpl/npl/en/acqui acqui... [dev_week]
Date: Mon, 01 Jan 2007 00:35:47 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         dev_week
Changes by:     Ryan Higgins <rych>     07/01/01 00:35:47

Modified files:
        koha-tmpl/intranet-tmpl/npl/en/acqui: acquire.tmpl 

Log message:
        add jmf's javascript for multiple additem divs

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/npl/en/acqui/acquire.tmpl?cvsroot=koha&only_with_tag=dev_week&r1=1.1.2.3.2.3&r2=1.1.2.3.2.4

Patches:
Index: acquire.tmpl
===================================================================
RCS file: 
/sources/koha/koha/koha-tmpl/intranet-tmpl/npl/en/acqui/Attic/acquire.tmpl,v
retrieving revision 1.1.2.3.2.3
retrieving revision 1.1.2.3.2.4
diff -u -b -r1.1.2.3.2.3 -r1.1.2.3.2.4
--- acquire.tmpl        12 Dec 2006 17:19:31 -0000      1.1.2.3.2.3
+++ acquire.tmpl        1 Jan 2007 00:35:47 -0000       1.1.2.3.2.4
@@ -1,6 +1,48 @@
-<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->Koha -- Receipt Summary for : 
<!-- TMPL_VAR NAME="name" --> <!-- TMPL_IF NAME="invoice" -->Invoice, <!-- 
TMPL_VAR NAME="invoice" --><!-- /TMPL_IF --><!-- TMPL_INCLUDE 
NAME="doc-head-close.inc" -->
+<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->Koha -- Receipt Summary for : 
<!-- TMPL_VAR NAME="name" --> <!-- TMPL_IF NAME="invoice" -->Invoice, <!-- 
TMPL_VAR NAME="invoice" --><!-- /TMPL_IF -->
+<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
 <!-- TMPL_INCLUDE name="masthead.inc" -->
 <!-- TMPL_INCLUDE name="intranet-nav.inc" -->
+<script type="text/javascript" >
+
+function countItemBlocks() {
+       var outeritemblock = document.getElementById('outeritemblock');
+       var quantityrec = document.getElementById('quantityrec');
+       var origquantityrec = document.getElementById('origquantityrec');
+       var itemblockcount = outeritemblock.getElementsByTagName('div');
+       var num = parseFloat(origquantityrec.value) + itemblockcount.length;
+       quantityrec.setAttribute('value',num);
+}
+function deleteItemBlock(index) {
+       var aDiv = document.getElementById(index);
+       aDiv.parentNode.removeChild(aDiv);
+       countItemBlocks();
+}
+function cloneItemBlock(index) {    
+    var original = document.getElementById(index); //original <div>
+    var clone = original.cloneNode(true);
+    // set the attribute for the new 'div' subfields
+    clone.setAttribute('id',index + index);//set another id.
+    var NumTabIndex;
+    NumTabIndex = parseInt(original.getAttribute('tabindex'));
+    if(isNaN(NumTabIndex)) NumTabIndex = 0;
+    clone.setAttribute('tabindex',NumTabIndex+1);
+    var CloneButtonPlus;
+    var CloneButtonMinus;
+  //  try{
+        CloneButtonPlus = clone.getElementsByTagName('a')[0];
+        CloneButtonPlus.setAttribute('onclick',"cloneItemBlock('" + index + 
index + "')");
+       CloneButtonMinus = clone.getElementsByTagName('a')[1];
+       CloneButtonMinus.setAttribute('onclick',"deleteItemBlock('" + index + 
index + "')");
+       CloneButtonMinus.setAttribute('style',"display:inline");
+   // }
+    //catch(e){        // do nothig if ButtonPlus & CloneButtonPlus don't 
exist.
+    //}
+    // insert this line on the page    
+       original.parentNode.insertBefore(clone,original.nextSibling);
+       countItemBlocks();
+}
+
+</script>
 
 <div id="main">
 
@@ -37,16 +79,37 @@
                                <td><strong>Series:</strong></td><td>
                                <!-- TMPL_VAR NAME="seriestitle" -->
                        </td></tr></table>
+                       
                        <p>Enter barcode(s) and branch if you want to add 
item(s) immediatly</p>
-                       <table><tr>
+                       <div id="outeritemblock">
+                       <div id="itemblock">
+                       <table>
+                       <tr>
                                <td><label for="">Branch:</label></td>
                                <td><!-- TMPL_VAR NAME="CGIbranch" --></td>
                        </tr>
                        <tr>
+                               <td><label for="">Item type:</label></td>
+                               <td><!-- TMPL_VAR NAME="CGIitype" --></td>
+                       </tr>
+                       <tr>
+                               <td><label for="">Location:</label></td>
+                               <td><!-- TMPL_VAR NAME="CGIlocation" --></td>
+                       </tr>
+               <tr>
+                <td><label for="">Item CallNumber: </label></td>
+                <td><input type="text" size="20" name="itemcallnumber" 
value="<!-- TMPL_VAR name="itemcallnumber" -->" /></td>
+            </tr>
+               <tr>
                                <td><label for="">Item Barcode: *</label></td>
                                <td><input type="text" size="20" name="barcode" 
value="<!-- TMPL_VAR name="barcode" -->" /></td>
                        </tr></table>
+ <a style="cursor: crosshair; color: grey; font-size: 180%;" 
onclick="cloneItemBlock('itemblock<!-- TMPL_VAR name="itemBlockIndex" 
-->')">+</a>
+ <a style="display:none; cursor: crosshair; color: grey; font-size: 180%;" 
onclick="deleteItemBlock('itemblock<!-- TMPL_VAR name="itemBlockIndex" 
-->')">-</a>
                </div>
+               </div>
+               </div>
+               
                <div class="box">
                        <h2>Accounting details</h2>
                        <table><tr>
@@ -59,8 +122,9 @@
                                <input type="hidden" name="quantity" 
value="<!-- TMPL_VAR NAME="quantity" -->" />
                        </td></tr>
                        <tr>
-                               <td><label for="">Quantity Received: 
*</label></td>
-                               <td><input type="text" size="20" 
name="quantityrec" value="<!-- TMPL_VAR NAME="quantityreceived" -->" />
+                               <td><label for="">Total Items Received: 
(including previous parcels)</label></td>
+                               <td><input id="quantityrec" READONLY 
type="text" size="20" name="quantityrec" value="<!-- TMPL_IF 
NAME="quantityreceived" --><!-- TMPL_VAR NAME="quantityreceivedplus1" --><!-- 
TMPL_ELSE -->1<!-- /TMPL_IF -->" />
+                               <input id="origquantityrec" READONLY 
type="hidden" name="origquantityrec" value="<!-- TMPL_IF 
NAME="quantityreceived" --><!-- TMPL_VAR NAME="quantityreceived" --><!-- 
TMPL_ELSE -->0<!-- /TMPL_IF -->" />
                        </td></tr>
                        <tr>
                                <td><label for="">Replacement Cost:</label></td>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]