View | Details | Raw Unified | Return to bug 2505
Collapse All | Expand All

(-)a/opac/opac-userupdate.pl (-5 / +26 lines)
Lines 18-23 Link Here
18
# Suite 330, Boston, MA  02111-1307 USA
18
# Suite 330, Boston, MA  02111-1307 USA
19
19
20
use strict;
20
use strict;
21
use warnings;
21
22
22
use CGI;
23
use CGI;
23
use Mail::Sendmail;
24
use Mail::Sendmail;
Lines 52-59 my $lib = GetBranchDetail($borr->{'branchcode'}); Link Here
52
# handle the new information....
53
# handle the new information....
53
# collect the form values and send an email.
54
# collect the form values and send an email.
54
my @fields = (
55
my @fields = (
55
    'surname',       'firstname',    'phone',
56
    'surname',       'firstname', 
56
    'fax', 'address','address2','city','zipcode','phone','mobile','fax','phonepro', 'emailaddress','B_streetaddress','B_city','B_zipcode','dateofbirth','sex'
57
    'address','address2','city','zipcode','phone','mobile','fax','phonepro', 'emailaddress','B_streetaddress','B_city','B_zipcode','dateofbirth','sex'
57
);
58
);
58
my $update;
59
my $update;
59
my $updateemailaddress = $lib->{'branchemail'};
60
my $updateemailaddress = $lib->{'branchemail'};
Lines 89-97 Borrower $borr->{'cardnumber'} Link Here
89
has requested to change her/his personal details.
90
has requested to change her/his personal details.
90
Please check these new details and make the changes:
91
Please check these new details and make the changes:
91
EOF
92
EOF
93
94
    my $B_streetnumber = $borr->{'B_streetnumber'} || '';
95
    my $B_address = $borr->{'B_address'} || '';
96
92
    foreach my $field (@fields) {
97
    foreach my $field (@fields) {
93
        my $newfield = $query->param($field);
98
        my $newfield = $query->param($field) || '';
94
        $message .= "$field : $borr->{$field}  -->  $newfield\n";
99
        my $borrowerfield = '';
100
        if($borr->{$field}) {
101
            $borrowerfield = $borr->{$field};
102
        }
103
        # reconstruct the alternate address
104
        if($field eq "B_streetaddress") {
105
            $borrowerfield = "$B_streetnumber $B_address";
106
        }
107
108
        if($field eq "dateofbirth") {
109
           $borrowerfield  = format_date( $borr->{'dateofbirth'} ) || '';
110
        }
111
112
        if($borrowerfield eq $newfield) {
113
            $message .= "$field : $borrowerfield  -->  $newfield\n";
114
        } else {
115
            $message .= uc($field) . " : $borrowerfield  -->  $newfield\n";
116
        }
95
    }
117
    }
96
    $message .= "\n\nThanks,\nKoha\n\n";
118
    $message .= "\n\nThanks,\nKoha\n\n";
97
    my %mail = (
119
    my %mail = (
98
- 

Return to bug 2505