[Koha-cvs] CVS: koha/members newjmember.pl,1.3,1.4

Owen Leonard oleonard at users.sourceforge.net
Mon Dec 6 22:07:32 CET 2004


Update of /cvsroot/koha/koha/members
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24456/members

Modified Files:
	newjmember.pl 
Log Message:
Moving error messages out of script and into template, fix for Bug 538

Index: newjmember.pl
===================================================================
RCS file: /cvsroot/koha/koha/members/newjmember.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** newjmember.pl	21 Jun 2004 20:03:41 -0000	1.3
--- newjmember.pl	6 Dec 2004 21:07:30 -0000	1.4
***************
*** 59,64 ****
  my $missing=0;
  
- my $string="The following compulsary fields have been left blank. Please push the back button
- and try again<p>";
  for (my $i=0;$i<3;$i++){
    my $number=$data{"cardnumber_child_$i"};
--- 59,62 ----
***************
*** 69,103 ****
    if ($number eq ''){
      if ($i == 0){
!       $string.=" Cardnumber<br>";
!       $missing=1;
      }
    } else {
      if ($firstname eq ''){
!       $string.=" Given Names<br>";
!       $missing=1;
      }
      if ($surname eq ''){
!       $string.=" Surname<br>";
!       $missing=1;
      }
      if ($dob eq ''){
!       $string.=" Date Of Birth<br>";
!       $missing=1;
      }
      if ($sex eq ''){
!       $string.=" Gender <br>";
!       $missing=1;
      }
      #check cardnumber is valid
      my $nounique;
      if ( $data{'type'} ne "Add" )    {
! 	$nounique = 0;
      } else {
! 	$nounique = 1;
      }
      my $valid=checkdigit(\%env,$number, $nounique);
      if ($valid != 1){
!       $string.=" Invalid Cardnumber $number<br>";
!       $missing=1;
      }
    }
--- 67,118 ----
    if ($number eq ''){
      if ($i == 0){
! 		$template->param(cardnumber_missing => 1);
! 		$missing=1;
! 		    if ($firstname eq ''){
! 		$template->param(firstname_missing => 1);
! 		$missing=1;
!     }
!     if ($surname eq ''){
! 		$template->param(surname_missing => 1);
! 		$missing=1;
!     }
!     if ($dob eq ''){
! 		$template->param(dob_missing => 1);
! 		$missing=1;
!     }
!     if ($sex eq ''){
! 		$template->param(gender_missing => 1);
! 		$missing=1;
!     }
      }
    } else {
      if ($firstname eq ''){
! 		$template->param(firstname_missing => 1);
! 		$missing=1;
      }
      if ($surname eq ''){
! 		$template->param(surname_missing => 1);
! 		$missing=1;
      }
      if ($dob eq ''){
! 		$template->param(dob_missing => 1);
! 		$missing=1;
      }
      if ($sex eq ''){
! 		$template->param(gender_missing => 1);
! 		$missing=1;
      }
      #check cardnumber is valid
      my $nounique;
      if ( $data{'type'} ne "Add" )    {
! 		$nounique = 0;
      } else {
! 		$nounique = 1;
      }
      my $valid=checkdigit(\%env,$number, $nounique);
      if ($valid != 1){
! 		$template->param(missing =>1);
! 		$template->param(invalid_cardnumber => 1);
! 		$missing=1;
      }
    }
***************
*** 108,112 ****
  #		$ident{'main'}=$main;
  #		$ident{'image'}=$image;
! 		$ident{'cardchild'}=($data{"cardnumber_child_$i"} ne '');
  		if ($data{"cardnumber_child_$i"} ne ''){
  			my $name=$data{"firstname_child_$i"} . " " . $data{"surname_child_$i"};
--- 123,127 ----
  #		$ident{'main'}=$main;
  #		$ident{'image'}=$image;
! 		$ident{'cardchild'}=$data{"cardnumber_child_$i"};
  		if ($data{"cardnumber_child_$i"} ne ''){
  			my $name=$data{"firstname_child_$i"} . " " . $data{"surname_child_$i"};
***************
*** 133,137 ****
  								identsloop => \@identsloop,
  								inputsloop => \@inputsloop,
! 								string => $string);
  
  output_html_with_http_headers $input, $cookie, $template->output;
--- 148,152 ----
  								identsloop => \@identsloop,
  								inputsloop => \@inputsloop,
! 								);
  
  output_html_with_http_headers $input, $cookie, $template->output;





More information about the Koha-cvs mailing list