[Koha-cvs] koha C4Members.pm members/memberentry.pl

Bruno Toumi btoumi at ouestprovence.fr
Mon Jun 12 17:12:11 CEST 2006


CVSROOT:	/sources/koha
Module name:	koha
Changes by:	Bruno Toumi <btoumi>	06/06/12 15:12:11

Modified files:
	C4             : Members.pm 
	members        : memberentry.pl 

Log message:
	members.pm: add field  fax  in getguarantordata function 
	memberentry.pl : move getgarantordata use before step1
	and add default_city value from guarantor  data (if exist) 

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Members.pm?cvsroot=koha&r1=1.25&r2=1.26
http://cvs.savannah.gnu.org/viewcvs/koha/members/memberentry.pl?cvsroot=koha&r1=1.29&r2=1.30

Patches:
Index: C4/Members.pm
===================================================================
RCS file: /sources/koha/koha/C4/Members.pm,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- C4/Members.pm	12 Jun 2006 13:00:40 -0000	1.25
+++ C4/Members.pm	12 Jun 2006 15:12:11 -0000	1.26
@@ -19,7 +19,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: Members.pm,v 1.25 2006/06/12 13:00:40 btoumi Exp $
+# $Id: Members.pm,v 1.26 2006/06/12 15:12:11 btoumi Exp $
 
 use strict;
 require Exporter;
@@ -31,7 +31,7 @@
 
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
 
-$VERSION = do { my @v = '$Revision: 1.25 $' =~ /\d+/g; shift(@v) . "." . join( "_", map { sprintf "%03d", $_ } @v ); };
+$VERSION = do { my @v = '$Revision: 1.26 $' =~ /\d+/g; shift(@v) . "." . join( "_", map { sprintf "%03d", $_ } @v ); };
 
 =head1 NAME
 
@@ -1054,7 +1054,7 @@
     my $dbh          = C4::Context->dbh;
     my $sth          =
       $dbh->prepare(
-"Select title,firstname,surname,streetnumber,address,streettype,address2,zipcode,city,phone,phonepro,mobile,email,emailpro  from borrowers where borrowernumber =? "
+"Select title,firstname,surname,streetnumber,address,streettype,address2,zipcode,city,phone,phonepro,mobile,email,emailpro,fax  from borrowers where borrowernumber =? "
       );
     $sth->execute($borrowerid);
     my $guarantor_data = $sth->fetchrow_hashref;

Index: members/memberentry.pl
===================================================================
RCS file: /sources/koha/koha/members/memberentry.pl,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- members/memberentry.pl	12 Jun 2006 13:00:40 -0000	1.29
+++ members/memberentry.pl	12 Jun 2006 15:12:11 -0000	1.30
@@ -1,5 +1,5 @@
 #!/usr/bin/perl
-# $Id: memberentry.pl,v 1.29 2006/06/12 13:00:40 btoumi Exp $
+# $Id: memberentry.pl,v 1.30 2006/06/12 15:12:11 btoumi Exp $
 
 # Copyright 2006 SAN OUEST PROVENCE et Paul POULAIN
 #
@@ -73,7 +73,7 @@
 my $nok=$input->param('nok');
 
 my @errors;
-
+my $default_city;
 # $check_categorytype contains the value of duplicate borrowers category type to redirect in good template in step =2
 my $check_categorytype=$input->param('check_categorytype');
 # NOTE: Alert for ethnicity and ethnotes fields, they are unvalided in all borrowers form
@@ -118,16 +118,10 @@
 # 	recover the category type if the borrowers is a doublon	
 	($check_categorytype,undef)=getcategorytype($check_category);
 	}
-	# CHECKS step by step
-# STEP 1
-	if ($step eq 1) {
-		###############test to take the right zipcode and city name ##############
-		if ($category_type ne 'I' and $guarantorid eq ''){
-			my ($borrower_city,$borrower_zipcode)=&getzipnamecity($select_city);
-			$data{'city'}= $borrower_city;
-			$data{'zipcode'}=$borrower_zipcode;
-		}
-		if ($category_type eq 'C' and $guarantorid ne ''){
+
+
+#recover all data from guarantor address phone ,fax... 
+if ($category_type eq 'C' and $guarantorid ne '' and $data{'contactname'} eq ''){
 			my $guarantordata=getguarantordata($guarantorid);
 			if (($data{'contactname'} eq '' or $data{'contactname'} ne $guarantordata->{'surname'})) {
 				$data{'contactfirstname'}=$guarantordata->{'firstname'};	
@@ -145,8 +139,19 @@
 				$data{'fax'}=$guarantordata->{'fax'};
 				$data{'email'}=$guarantordata->{'email'};
 				$data{'emailpro'}=$guarantordata->{'emailpro'};
+			$default_city=getidcity($data{'city'});
 			}
                     }
+
+	# CHECKS step by step
+# STEP 1
+	if ($step eq 1) {
+		###############test to take the right zipcode and city name ##############
+		if ($category_type ne 'I' and $guarantorid eq ''){
+			my ($borrower_city,$borrower_zipcode)=&getzipnamecity($select_city);
+			$data{'city'}= $borrower_city;
+			$data{'zipcode'}=$borrower_zipcode;
+		}
                 if ($categorycode ne 'I') {
                 my $age = get_age(format_date_in_iso($data{dateofbirth}));
                 my (undef,$agelimitmin,$agelimitmax)=getborrowercategory($data{'categorycode'});   
@@ -284,7 +289,7 @@
   					-default=>$default_category,
  					-labels=>$labels);
 	#test in city
-	my $default_city;
+	
  	if ($op eq ''){
 	(my $selectcity=&getidcity($data{'city'})) if ($select_city eq '');
 	$default_city=$selectcity;





More information about the Koha-cvs mailing list