[Koha-patches] [PATCH] Bug 2365 : Inner counter not properly set for serials subscriptions not starting on first issue.

Ryan Higgins rch at liblime.com
Tue Sep 16 13:05:33 CEST 2008


---
 .../prog/en/modules/serials/subscription-add.tmpl  |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tmpl
index 3242215..81e7ddd 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tmpl
@@ -805,9 +805,13 @@ function moreoptionsupdate(inputfield,rollover){
     basefield = document.getElementById(fieldname.slice(0,-4));
     var fieldnumber = fieldname.slice(-5,-4);
 
-//    fieldnametemp = fieldname.slice(0,-1)+"temp"+fieldnametempnumber;
-//    eval("document.f."+fieldname+".value = document.f."+fieldnametemp+".value");
     basefield.value = inputfield.value;
+    if(basefield.name.slice(0,-1) == 'lastvalue') {
+        // lastvalue seems to mean 'begins with', tracking the first received issue so
+        // we can recreate the whole historeven after receiving.  innerloop is the var that
+        // actually tracks which issue we're on, though.
+        document.getElementById('innerloop'+fieldnumber).value = inputfield.value;
+    }
     var patternchoice = document.getElementById("numberpattern").value;
     switch(patternchoice){
     case "2":
@@ -818,16 +822,14 @@ function moreoptionsupdate(inputfield,rollover){
       break;   
     }  
     if(rollover){
-//        eval("document.f.every"+(fieldnametempnumber-1)+".value = document.f."+fieldnametemp+".value");
        // calculate rollover  for higher level of periodicity.
-       // FIXME: This calculation only works if addN = 1 , that is, the X,Y,and Z each only increment by zero or one on each issue.
-
        // if there are two levels of periodicity, (e.g. vol{X},num{Y},issue{Z}, then every1=every2*whenmorethan2 
        // otherwise, every2 == 1.
        var addN = (document.getElementById('add'+fieldnumber)) ? document.getElementById('add'+fieldnumber).value : 1 ;
        var everyN = (document.getElementById('every'+fieldnumber)) ? document.getElementById('every'+fieldnumber).value : 1 ;
        document.getElementById('every'+(fieldnumber-1)).value = basefield.value * everyN / addN ;
      }
+     //FIXME : add checks for innerloop || lastvalue  > rollover  
 }
 
 
-- 
1.5.5.GIT




More information about the Koha-patches mailing list