From 25ee63591185ca732d7a04b34a83398254f2b677 Mon Sep 17 00:00:00 2001 From: rangi Date: Thu, 1 Jun 2006 23:18:57 +0000 Subject: [PATCH] Modifying members is now working, well mostly anyway. --- C4/Members.pm | 29 ++++++++++++++--------------- members/memberentry.pl | 12 +++++++++++- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index 0685791d26..8552601797 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -304,11 +304,11 @@ sub modmember { my $query = "UPDATE borrowers SET title=?,dateexpiry=?,cardnumber=?,sex=?,ethnotes=?,address=?,fax=?, - firstname=?,contactnote=?,dateofbirth=?,contactname=?,emailaddress=?, - streetcity=?,altrelationship=?,othernames=?,phoneday=?,categorycode=?, - city=?,area=?,phone=?,borrowernotes=?,altphone=?,surname=?,initials=?, - physstreet=?,ethnicity=?,gonenoaddress=?,lost=?,debarred=?,textmessaging=?, - branchcode=?,zipcode=?,homezipcode=?,sort1=?,sort2=? + firstname=?,contactnote=?,dateofbirth=?,contactname=?,email=?, + address2=?,relationship=?,othernames=?,phonepro=?,categorycode=?, + city=?,phone=?,borrowernotes=?,B_phone=?,surname=?,initials=?, + B_address=?,ethnicity=?,gonenoaddress=?,lost=?,debarred=?,opacnote=?, + branchcode=?,zipcode=?,B_zipcode=?,sort1=?,sort2=? WHERE borrowernumber=?"; my $sth = $dbh->prepare($query); @@ -318,22 +318,21 @@ sub modmember { $data{'ehtnotes'}, $data{'address'}, $data{'fax'}, $data{'firstname'}, $data{'contactnote'}, $data{'dateofbirth'}, - $data{'contactname'}, $data{'emailaddress'}, - $data{'streetcity'}, $data{'altrelationship'}, - $data{'othernames'}, $data{'phoneday'}, + $data{'contactname'}, $data{'email'}, + $data{'address2'}, $data{'relationship'}, + $data{'othernames'}, $data{'phonepro'}, $data{'categorycode'}, $data{'city'}, - $data{'area'}, $data{'phone'}, - $data{'borrowernotes'}, $data{'altphone'}, + $data{'phone'}, + $data{'borrowernotes'}, $data{'b_phone'}, $data{'surname'}, $data{'initials'}, - $data{'physstreet'}, $data{'ethnicity'}, + $data{'b_address'}, $data{'ethnicity'}, $data{'gna'}, $data{'lost'}, - $data{'debarred'}, $data{'textmessaging'}, + $data{'debarred'}, $data{'opacnotes'}, $data{'branchcode'}, $data{'zipcode'}, - $data{'homezipcode'}, $data{'sort1'}, - $data{'sort2'}, $data{'borrowernumber'} + $data{'b_zipcode'}, $data{'sort1'}, + $data{'sort2'}, $data{'borrowerid'} ); $sth->finish; - # ok if its an adult (type) it may have borrowers that depend on it as a guarantor # so when we update information for an adult we should check for guarantees and update the relevant part # of their records, ie addresses and phone numbers diff --git a/members/memberentry.pl b/members/memberentry.pl index a9784eafb8..67e12a2ee5 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -89,8 +89,18 @@ $template->param( "mandatory$_" => 1); $template->param( "checked" => 1) if ($nodouble eq 1); - +my $borrower_data=borrdata('',$borrowernumber); # if a add or modify is requested => check validity of data. +if ($step eq 0){ + foreach my $column (keys %$borrower_data){ + $data{$column}=$borrower_data->{$column}; + } + $data{'borrowerid'}=$borrowernumber; + if (!$borrowerid){ + $borrowerid=$borrowernumber; + } +} + if ($op eq 'add' or $op eq 'modify') { my @names=$input->param; foreach my $key (@names){ -- 2.39.5