---
 members/memberentry.pl |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/members/memberentry.pl b/members/memberentry.pl
index f6ca2c1..63ee154 100755
--- a/members/memberentry.pl
+++ b/members/memberentry.pl
@@ -211,13 +211,14 @@ if ( ( $op eq 'insert' ) and !$nodouble ) {
 if ( $guarantorid and ( $category_type eq 'C' || $category_type eq 'P' )) {
     if (my $guarantordata=GetMember(borrowernumber => $guarantorid)) {
         $guarantorinfo=$guarantordata->{'surname'}." , 
".$guarantordata->{'firstname'};
-        if ( !defined($data{'contactname'}) or $data{'contactname'} eq '' or
-             $data{'contactname'} ne $guarantordata->{'surname'} ) {
-            $newdata{'contactfirstname'}= $guarantordata->{'firstname'};
-            $newdata{'contactname'}     = $guarantordata->{'surname'};
-            $newdata{'contacttitle'}    = $guarantordata->{'title'};
+        $newdata{'contactfirstname'}= $guarantordata->{'firstname'};
+        $newdata{'contactname'}     = $guarantordata->{'surname'};
+        $newdata{'contacttitle'}    = $guarantordata->{'title'};
+        if ( $op eq 'add' ) {
                foreach (qw(streetnumber address streettype address2
-                        zipcode country city phone phonepro mobile fax email 
emailpro branchcode)) {
+                        zipcode country city state phone phonepro mobile fax 
email emailpro branchcode
+                        B_streetnumber B_streettype B_address B_address2
+                        B_city B_state B_zipcode B_country B_email B_phone)) {
                        $newdata{$_} = $guarantordata->{$_};
                }
         }
@@ -225,12 +226,10 @@ if ( $guarantorid and ( $category_type eq 'C' || 
$category_type eq 'P' )) {
 }
 
 ###############test to take the right zipcode, country and city name 
##############
-if (!defined($guarantorid) or $guarantorid eq '' or $guarantorid eq '0') {
-    # set only if parameter was passed from the form
-    $newdata{'city'}    = $input->param('city')    if 
defined($input->param('city'));
-    $newdata{'zipcode'} = $input->param('zipcode') if 
defined($input->param('zipcode'));
-    $newdata{'country'} = $input->param('country') if 
defined($input->param('country'));
-}
+# set only if parameter was passed from the form
+$newdata{'city'}    = $input->param('city')    if 
defined($input->param('city'));
+$newdata{'zipcode'} = $input->param('zipcode') if 
defined($input->param('zipcode'));
+$newdata{'country'} = $input->param('country') if 
defined($input->param('country'));
 
 #builds default userid
 if ( (defined $newdata{'userid'}) && ($newdata{'userid'} eq '')){
@@ -677,7 +676,7 @@ $template->param(CGIbranch=>$CGIbranch) if ($CGIbranch);
 $template->param(
   nodouble  => $nodouble,
   borrowernumber  => $borrowernumber, #register number
-  guarantorid => (($borrower_data->{'guarantorid'})) ? 
$borrower_data->{'guarantorid'} : $guarantorid,
+  guarantorid => ($borrower_data->{'guarantorid'} || $guarantorid),
   ethcatpopup => $ethcatpopup,
   relshiploop => \@relshipdata,
   city_loop => $city_arrayref,
-- 
1.6.5

_______________________________________________
Koha-patches mailing list
Koha-patches@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to