[Koha-patches] [PATCH] bug 3170 followup

Galen Charlton galen.charlton at liblime.com
Tue Jun 2 22:05:05 CEST 2009


* tags >= 010, not just > 010, can have subfields
* fixed so that mandatory fields are checked
  regardless of whether a new one is created
  or an existing one modified
---
 .../prog/en/modules/authorities/authorities.tmpl   |    6 +++---
 .../prog/en/modules/cataloguing/addbiblio.tmpl     |    6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tmpl
index d07bd46..31b73c4 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tmpl
@@ -41,7 +41,7 @@ function AreMandatoriesNotOk(){
     <!-- TMPL_LOOP NAME='BIG_LOOP' -->
     	<!-- TMPL_LOOP NAME='innerloop' -->
 			<!-- TMPL_IF NAME="mandatory" -->
-        		mandatoriesfields.push(new Array("<!-- TMPL_VAR NAME="tag" -->","<!-- TMPL_VAR NAME="index" -->"));
+        		mandatoriesfields.push(new Array("<!-- TMPL_VAR NAME="tag" -->","<!-- TMPL_VAR NAME="index" --><!-- TMPL_VAR NAME="random" -->","<!-- TMPL_VAR NAME="index" -->"));
             <!-- /TMPL_IF -->
     		<!-- TMPL_LOOP NAME='subfield_loop'-->
     			<!-- TMPL_IF NAME='mandatory'-->mandatories.push("<!-- TMPL_VAR NAME='id' -->");
@@ -68,7 +68,7 @@ function AreMandatoriesNotOk(){
     	divid    = "tag_" + arr[0] + "_" + arr[1];
     	varegexp = new RegExp("^tag_" + arr[0] + "_code_");
 
-		if(parseInt(arr[0]) > 10){
+		if(parseInt(arr[0]) >= 10){
 	    	elem = document.getElementById(divid);
 	    	eleminputs = elem.getElementsByTagName('input');
 	    	
@@ -76,7 +76,7 @@ function AreMandatoriesNotOk(){
 	
 	    		if(eleminputs[j].name.match(varegexp) && eleminputs[j].value){
 					/* tag_801_subfield_c_841304_545657 */
-					inputregexp = new RegExp("^tag_" + arr[0] + "_subfield_" + eleminputs[j].value + "_" + arr[1]);
+					inputregexp = new RegExp("^tag_" + arr[0] + "_subfield_" + eleminputs[j].value + "_" + arr[2]);
 					
 					for( var k=0; k<len2; k++){
 						if(eleminputs[k].id.match(inputregexp) && eleminputs[k].value){
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl
index 6d976d1..3557cc2 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl
@@ -80,7 +80,7 @@ function AreMandatoriesNotOk(){
     <!-- TMPL_LOOP NAME='BIG_LOOP' -->
     	<!-- TMPL_LOOP NAME='innerloop' -->
 	        <!-- TMPL_IF NAME="mandatory" -->
-    	    	mandatoriesfields.push(new Array("<!-- TMPL_VAR NAME="tag" -->","<!-- TMPL_VAR NAME="index" -->"));
+    	    	mandatoriesfields.push(new Array("<!-- TMPL_VAR NAME="tag" -->","<!-- TMPL_VAR NAME="index" --><!-- TMPL_VAR NAME="random" -->","<!-- TMPL_VAR NAME="index" -->"));
         	<!-- /TMPL_IF -->
     		<!-- TMPL_LOOP NAME='subfield_loop'-->
     			<!-- TMPL_IF NAME='mandatory'-->mandatories.push("<!-- TMPL_VAR NAME='id' -->");
@@ -124,7 +124,7 @@ function AreMandatoriesNotOk(){
     	divid    = "tag_" + arr[0] + "_" + arr[1];
     	varegexp = new RegExp("^tag_" + arr[0] + "_code_");
     	
-		if(parseInt(arr[0]) > 10){
+		if(parseInt(arr[0]) >= 10){
 	    	elem = document.getElementById(divid);
 	    	eleminputs = elem.getElementsByTagName('input');
 	    	
@@ -132,7 +132,7 @@ function AreMandatoriesNotOk(){
 	
 	    		if(eleminputs[j].name.match(varegexp) && eleminputs[j].value){
 					/* tag_801_subfield_c_841304_545657 */
-					inputregexp = new RegExp("^tag_" + arr[0] + "_subfield_" + eleminputs[j].value + "_" + arr[1]);
+					inputregexp = new RegExp("^tag_" + arr[0] + "_subfield_" + eleminputs[j].value + "_" + arr[2]);
 					
 					for( var k=0; k<len2; k++){
 						if(eleminputs[k].id.match(inputregexp) && eleminputs[k].value){
-- 
1.5.6.5




More information about the Koha-patches mailing list