From 448ad31007360e94c40e6150d7ac05f27a885175 Mon Sep 17 00:00:00 2001 From: Nicole Engard Date: Thu, 10 Sep 2009 19:46:50 -0400 Subject: [PATCH] Bugs: 1172 3579 3596 fixes to patron detail in opac This patch makes it so that the patron can see their details even if the OPACPatronDetails sys pref is OFF. It also removed the messaging options from the patron details and leaves them on the messaging tab. Finally it adds in address fields that were missing previously on the update patron form. Signed-off-by: Galen Charlton --- .../opac-tmpl/prog/en/includes/usermenu.inc | 2 - .../prog/en/modules/opac-messaging.tmpl | 2 +- .../prog/en/modules/opac-userupdate.tmpl | 143 +++++++++++------- opac/opac-userupdate.pl | 19 ++- 4 files changed, 102 insertions(+), 64 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc b/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc index a8fc320fcd..d4df7c22ad 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc @@ -5,9 +5,7 @@
  • my fines
  • -
  • my personal details
  • -
  • my tags
  • diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tmpl index 53df177be4..f1532e2a90 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tmpl @@ -100,11 +100,11 @@ -
    Cancel
    + diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tmpl index 4ae620c1cf..62ec6be1b6 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tmpl @@ -9,24 +9,25 @@
    -
    +

    's account ../../images/caret.gif" width="16" height="16" alt=">" border="0" /> Your Personal Details

    +
    -
    Name
    1. " name="firstname" />
    2. +
    3. " name="othernames" />
    4. " name="surname" />
    Contact Information
      -
    1. - +
    2. + " name="streetnumber" /> " id="address" /> " id="address2" />
    3. " name="city" />
    4. @@ -34,71 +35,30 @@
    5. " name="country" />
    6. " name="phone" />
    7. " name="mobile" />
    8. -
    9. " name="fax" />
    10. -
    11. " name="phonepro" />
    12. - +
    13. " name="fax" />
    14. " name="emailaddress" />
    15. -
    -
    - -
    -Items Borrowed Notifications -
      -
    1. - - - - - - -
    2. -
    3. - - - - - - -
    4. -
    -
    - -
    -Items Returned Notifications -
      -
    1. - - - - - - -
    2. -
    3. - - - - - - -
    4. +
    5. " name="emailpro" />
    -Permanent Address +Alternate Contact Information
    1. - - + + " name="B_streetnumber" /> + " name="B_address" /> + " name="B_address2" />
    2. " name="B_city" />
    3. -
    4. " name="B_zipcode" />
    5. -
    6. " name="B_country" />
    7. +
    8. " name="B_zipcode" />
    9. +
    10. " name="B_country" />
    11. +
    12. " name="B_phone" />
    13. +
    14. " name="B_email" />
    @@ -136,6 +96,77 @@
    + +

    To make changes to your record please contact the library.

    +
    +
    +Contact Information +
      +
    1. Name:
    2. +
    3. Other Name:
    4. +
    5. Address:
    6. +
    7.  
    8. +
    9. City, State:
    10. +
    11. Zip Code:
    12. +
    13. Country:
    14. +
    15. Home Phone:
    16. +
    17. Mobile Phone:
    18. +
    19. Work phone:
    20. +
    21. Fax:
    22. +
    23. Email:
    24. +
    25. Work Email:
    26. +
    +
    + +
    +Personal Information +
      +
    1. Date of Birth:
    2. +
    3. Sex: +Female +Male +
    4. +
    +
    +
    + +
    +
    +Alternate Contact Information +
      +
    1. Alternate Address:
    2. +
    3.  
    4. +
    5. City, State:
    6. +
    7. Zip Code:
    8. +
    9. Country:
    10. +
    11. Phone:
    12. +
    13. Email:
    14. +
    +
    + +
    +Library Use: +
      +
    1. Card number:
    2. +
    3. Patron Number:
    4. +
    5. Patron Category: ()
    6. +
    7. Joined:
    8. +
    9. Expires:
    10. + + +
    11. + + + + + +
    12. + + +
    +
    +
    +
    diff --git a/opac/opac-userupdate.pl b/opac/opac-userupdate.pl index 866431601a..b083779258 100755 --- a/opac/opac-userupdate.pl +++ b/opac/opac-userupdate.pl @@ -53,13 +53,12 @@ my $lib = GetBranchDetail($borr->{'branchcode'}); # handle the new information.... # collect the form values and send an email. my @fields = ( - 'surname', 'firstname', - 'address','address2','city','zipcode','phone','mobile','fax','phonepro', 'emailaddress','B_streetaddress','B_city','B_zipcode','dateofbirth','sex' + 'surname','firstname','othernames','streetaddress','city','zipcode','country','phone','mobile','fax','phonepro', 'emailaddress','emailpro','B_streetnumber','B_streetaddress','B_city','B_zipcode','B_country','B_phone','B_email','dateofbirth','sex' ); my $update; my $updateemailaddress = $lib->{'branchemail'}; $updateemailaddress = C4::Context->preference('KohaAdminEmailAddress') unless( $updateemailaddress =~ /\w+@\w+/); -if ( $updateemailaddress eq '' ) { +if ( !$updateemailaddress || $updateemailaddress eq '' ) { warn "KohaAdminEmailAddress system preference not set. Couldn't send patron update information for $borr->{'firstname'} $borr->{'surname'} (#$borrowernumber)\n"; my ($template) = get_template_and_user( @@ -91,8 +90,12 @@ has requested to change her/his personal details. Please check these new details and make the changes: EOF + my $streetnumber = $borr->{'streetnumber'} || ''; + my $address = $borr->{'address'} || ''; + my $address2 = $borr->{'address2'} || ''; my $B_streetnumber = $borr->{'B_streetnumber'} || ''; my $B_address = $borr->{'B_address'} || ''; + my $B_address2 = $borr->{'B_address2'} || ''; foreach my $field (@fields) { my $newfield = $query->param($field) || ''; @@ -100,11 +103,17 @@ EOF if($borr->{$field}) { $borrowerfield = $borr->{$field}; } + + # reconstruct the address + if($field eq "streetaddress") { + $borrowerfield = "$streetnumber $address, $address2"; + } + # reconstruct the alternate address if($field eq "B_streetaddress") { - $borrowerfield = "$B_streetnumber $B_address"; + $borrowerfield = "$B_streetnumber $B_address, $B_address2"; } - + if($field eq "dateofbirth") { $borrowerfield = format_date( $borr->{'dateofbirth'} ) || ''; } -- 2.39.5