Added support for aqui management
authortgarip1957 <tgarip1957>
Fri, 22 Sep 2006 00:11:37 +0000 (00:11 +0000)
committertgarip1957 <tgarip1957>
Fri, 22 Sep 2006 00:11:37 +0000 (00:11 +0000)
koha-tmpl/intranet-tmpl/prog/en/cataloguing/addbiblio.tmpl
koha-tmpl/intranet-tmpl/prog/en/cataloguing/additem.tmpl

index 6020ec0..633c793 100644 (file)
@@ -62,7 +62,7 @@
     <!-- show duplicate warning on tab 0 only -->
         <!-- TMPL_IF name="duplicatebiblionumber" -->
                     <div class="error">
-                        <p>Is this a duplicate of <a href="../catalogue/MARCdetail.pl?biblionumber=<!-- TMPL_VAR name="duplicatebiblionumber" -->" onclick="openWindow('../catalogue/MARCdetail.pl?biblionumber=<!-- TMPL_VAR name="duplicatebiblionumber" -->&popup=1', 'Duplicate biblio'; return false;)"><!-- TMPL_VAR name="duplicatetitle" --></a>?</p>
+                        <p>Is this a duplicate of <a href="../catalogue/MARCdetail.pl?biblionumber=<!-- TMPL_VAR name="duplicatebiblionumber" -->" onclick="openWindow('../catalogue/MARCdetail.pl?biblionumber=<!-- TMPL_VAR name="duplicatebiblionumber" -->&popup=1', 'Duplicate_biblio'; return false;)"><!-- TMPL_VAR name="duplicatetitle" --></a>?</p>
                         <p>You must either :</p>
                         <ul>
                             <li>If it <em>is</em> a duplicate, <a href="additem.pl?biblionumber=<!-- TMPL_VAR name="duplicatebiblionumber" -->">Edit Items</a> of the existing record.</li>
                        <input type="hidden" name="subfield" id="subfield<!--TMPL_VAR NAME="id"-->" value="<!-- TMPL_VAR NAME="oldbiblionumtagsubfield" -->">
                        <input type="hidden" name="field_value" value="<!-- TMPL_VAR NAME="oldbiblionumber" -->">
                        <input type="hidden" name="mandatory" value="0">
-                       <input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="oldbiblioitemnumtagfield" -->">
-                       <input type="hidden" id="subfield<!--TMPL_VAR NAME="id"-->" name="subfield" value="<!-- TMPL_VAR NAME="oldbiblioitemnumtagsubfield" -->">
-                               <input type="hidden" name="mandatory" value="0">
                                <input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->">
                <!-- /TMPL_IF -->
        </form>
 
 
 <script language="JavaScript" type="text/javascript">
+       <!--TMPL_IF name="exit"-->
+
+var    finished=CloseMe(<!--TMPL_VAR NAME="biblionumber"-->,'<!--TMPL_VAR NAME="title"-->');
+
+       <!--/TMPL_IF-->
+
 function loading(){
        document.getElementById("loading").style.display = "none";
 }
 function _(s) { return s } // dummy function for gettext
-       <!--TMPL_IF name="exit"-->
-var    finished=CloseMe(<!--TMPL_VAR NAME="biblionumber"-->,'<!--TMPL_VAR NAME="title"-->');
-       <!--/TMPL_IF-->
 function confirmnotdup(){
        document.getElementById("confirm_not_duplicate").value = 1;
        var checkform = document.getElementById("f");
index 8b99dec..769a9e2 100644 (file)
@@ -133,6 +133,22 @@ function confirm_deletion(biblionumber,itemnumber) {
        }
 }
 function CloseMe(serialid,itemnumber,holdingbranch) {
+       if( serialid==000){
+        itemcount = opener.document.getElementsByName('itemcount');
+       bibliocount=opener.document.getElementsByName('bibliocount');
+       addcount=opener.document.getElementById(<!--TMPL_VAR NAME="biblionumber"-->);
+             for (var s=0; s<itemcount.length; s++){
+                if  (bibliocount.item(s).value==<!--TMPL_VAR NAME="biblionumber"-->){
+                itemcount.item(s).value=itemcount.item(s).value -1;
+                       if ( itemcount.item(s).value==0){
+                       addcount.style.display= "none";
+                       self.close();
+                       return false;
+                       }
+               }
+            }
+       return true;
+       }
        var myfield = opener.document.getElementById('serial'+serialid);
         myfield.value = itemnumber;
        var myfield = opener.document.getElementById('holdingbranch'+serialid);