From ee79c360702e5e3b9fbfd1486fdb970bd1db84ad Mon Sep 17 00:00:00 2001 From: tipaul Date: Thu, 4 Sep 2003 14:29:44 +0000 Subject: [PATCH] fix for 582 (Move error message contents out of newmember.pl) --- .../intranet-tmpl/default/en/newmember.tmpl | 26 +++++++++++++++++-- .../intranet-tmpl/default/fr/newmember.tmpl | 26 +++++++++++++++++-- newmember.pl | 23 ++++++++-------- 3 files changed, 60 insertions(+), 15 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/default/en/newmember.tmpl b/koha-tmpl/intranet-tmpl/default/en/newmember.tmpl index 22e2e9e0a6..bc1525816c 100644 --- a/koha-tmpl/intranet-tmpl/default/en/newmember.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/newmember.tmpl @@ -1,7 +1,7 @@ -

Confirm Record

+

Confirm Record

" >
/images/background-mem.gif"> @@ -222,7 +222,29 @@ - +

ERROR

+

The following fields have a forbidden value. Please push the back button and try again :

+ + Cardnumber
+
+ + Invalid_cardnumber
+
+ + Gender
+
+ + Given Names
+
+ + Surname
+
+ + Postal Street Address
+
+ + Postal city
+
diff --git a/koha-tmpl/intranet-tmpl/default/fr/newmember.tmpl b/koha-tmpl/intranet-tmpl/default/fr/newmember.tmpl index c353399478..42fbec8567 100644 --- a/koha-tmpl/intranet-tmpl/default/fr/newmember.tmpl +++ b/koha-tmpl/intranet-tmpl/default/fr/newmember.tmpl @@ -1,7 +1,7 @@ -

Confirmer l'enregistrement

+

Confirmer l'enregistrement

" >
/images/background-mem.gif"> @@ -222,7 +222,29 @@ - +

ERREUR

+

Les champs suivants sont erronés. Cliquer sur le bouton "retour" et corrigez.

+ + Numéro carte lecteur vide
+
+ + Numéro de carte invalide
+
+ + Zone sexe vide
+
+ + Zone nom vide
+
+ + Zone prénom vide
+
+ + Adresse vide
+
+ + Commune vide
+
diff --git a/newmember.pl b/newmember.pl index 81fd6267b7..578f4fee05 100755 --- a/newmember.pl +++ b/newmember.pl @@ -16,7 +16,6 @@ # error message to display # FIXME - What is the correct value of "flagsrequired"? -# FIXME - untranslatable strings here # Copyright 2000-2002 Katipo Communications # @@ -71,9 +70,9 @@ my $dbh = C4::Context->dbh; my $ok=0; my $string = "The following compulsary fields have been left blank. " . "Please push the back button and try again

"; - +my @errors; if ($data{'cardnumber'} eq ''){ - $string.=" Cardnumber
"; + push @errors,"cardnumber"; $ok=1; } else { #check cardnumber is valid @@ -89,33 +88,35 @@ if ($data{'cardnumber'} eq ''){ my $valid=checkdigit(\%env,$data{'cardnumber'}, $nounique); if ($valid != 1){ $ok=1; - $string.=" Invalid Cardnumber
"; + push @errors, "invalid_cardnumber"; } } if ($data{'sex'} eq ''){ - $string.=" Gender
"; + push @errors, "gender"; $ok=1; } if ($data{'firstname'} eq ''){ - $string.=" Given Names
"; + push @errors,"firstname"; $ok=1; } if ($data{'surname'} eq ''){ - $string.=" Surname
"; + push @errors,"surname"; $ok=1; } if ($data{'address'} eq ''){ - $string.=" Postal Street Address
"; + push @errors, "address"; $ok=1; } if ($data{'city'} eq ''){ - $string.=" Postal City
"; + push @errors, "city"; $ok=1; } # Pass the ok/not ok status and the error message to the template -$template->param( OK=> ($ok==0), - string=> $string); +$template->param( OK=> ($ok==0)); +foreach my $error (@errors) { + $template->param( $error => 1); +} # If things are ok, display the confirmation page if ($ok == 0) { -- 2.39.5