X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=koha-tmpl%2Fintranet-tmpl%2Fprog%2Fen%2Fjs%2Fmembers.js;h=cdc14429809b9f929350b70e4f4cbad2f07c08ed;hb=8a53d284907bbbe9d3ee2552e964af9f5dfbd0ac;hp=d9358c05bece15ef2c0f4472bd44be5c01dc787a;hpb=f4811762d0638bf1393529528896b780465eb1e6;p=koha.git diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/members.js b/koha-tmpl/intranet-tmpl/prog/en/js/members.js index d9358c05be..cdc1442980 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/members.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/members.js @@ -8,7 +8,7 @@ if (d!="") { var ok=1; var msg; if ( (date.length < 2) && (ok==1) ) { - msg = _("Separator must be /"); + msg = MSG_SEPARATOR+field.name; alert(msg); ok=0; field.focus(); return; } @@ -17,21 +17,21 @@ if (d!="") { var yyyy = date[2]; // checking days if ( ((isNaN(dd))||(dd<1)||(dd>31)) && (ok==1) ) { - msg = _("day not correct."); + msg = MSG_INCORRECT_DAY+field.name; alert(msg); ok=0; field.focus(); - return; + return false; } // checking months if ( ((isNaN(mm))||(mm<1)||(mm>12)) && (ok==1) ) { - msg = _("month not correct."); + msg = MSG_INCORRECT_MONTH+field.name; alert(msg); ok=0; field.focus(); - return; + return false; } // checking years if ( ((isNaN(yyyy))||(yyyyamax)) && (ok==1) ) { - msg = _("years not correct."); + msg = MSG_INCORRECT_YEAR+field.name; alert(msg); ok=0; field.focus(); - return; + return false; } } } @@ -43,13 +43,13 @@ var msg2; if ( document.form.check_member.value==1){ if (document.form.categorycode.value != "I"){ - msg1 += ("Warning !!!! Duplicate patron!!!!"); + msg1 += MSG_DUPLICATE_PATRON; alert(msg1); check_form_borrowers(0); document.form.submit(); }else{ - msg2 += ("Warning !!!! Duplicate organisation!!!!"); + msg2 += MSG_DUPLICATE_ORGANIZATION; alert(msg2); check_form_borrowers(0); } @@ -73,7 +73,7 @@ var myDate2=document.form.dateexpiry.value.split ('/'); { document.form.dateenrolled.focus(); - var msg = ("Warning !!! check date expiry >= date enrolment"); + var msg = MSG_LATE_EXPIRY; alert(msg); } } @@ -83,17 +83,17 @@ var myDate2=document.form.dateexpiry.value.split ('/'); // function to test all fields in forms and nav in different forms(1 ,2 or 3) - function check_form_borrowers(nav){ -var statut=0; +function check_form_borrowers(nav){ + var statut=0; + var message = ""; + var message_champ=""; if (document.form.check_member.value == 1 ) { - - if (document.form_double.answernodouble) { + if (document.form_double.answernodouble) { if( (!(document.form_double.answernodouble.checked))){ document.form.nodouble.value=0; - } - else { - document.form.nodouble.value=1; + } else { + document.form.nodouble.value=1; } } } @@ -103,55 +103,58 @@ var statut=0; else { var champ_verif = document.form.BorrowerMandatoryField.value.split ('|'); - var message ="The following fields are mandatory :\n"; - var message_champ=""; - for (var i=0; i 0 ) - { - - - if (!(document.form_double.answernodouble.checked)){ - - message =""; - message_champ+=("Please confirm suspicious duplicate patron !!! "); - statut=1; - document.form.nodouble.value=0; + + if ( document.form.password.value != document.form.password2.value ){ + if ( message_champ != '' ){ + message_champ += "\n"; } - else { + message_champ+= MSG_PASSWORD_MISMATCH; + statut=1; + } + + //patrons form to test if you checked no to the question of double + if (statut!=1 && document.form.check_member.value > 0 ) { + if (!(document.form_double.answernodouble.checked)){ + message_champ+= MSG_DUPLICATE_SUSPICION; + statut=1; + document.form.nodouble.value=0; + } else { document.form.nodouble.value=1; - } + } } if (statut==1){ - //alert if at least 1 error - alert(message+"\n"+message_champ); - return false; - } - else - { - document.form.submit(); + //alert if at least 1 error + alert(message+"\n"+message_champ); + return false; + } else { + document.form.submit(); } } @@ -164,3 +167,19 @@ function Dopopguarantor(link) { var newin=window.open(link,'popup','width=600,height=400,resizable=no,toolbar=false,scrollbars=yes,top'); } + +$(document).ready(function(){ + if($("#yesdebarred").is(":checked")){ + $("#debarreduntil").show(); + } else { + $("#debarreduntil").hide(); + } + $("#yesdebarred,#nodebarred").change(function(){ + if($("#yesdebarred").is(":checked")){ + $("#debarreduntil").show(); + $("#datedebarred").focus(); + } else { + $("#debarreduntil").hide(); + } + }); +}); \ No newline at end of file