From 151f0de541c039083f498c066d0ad7cc4def5b69 Mon Sep 17 00:00:00 2001 From: Robin Sheat Date: Wed, 25 Aug 2010 14:29:35 +1200 Subject: [PATCH] Bug 5172 - prefer 'other name' over 'first name' if available. In all the places that the user is referred to by name in the OPAC, the 'other name' field is now used instead of the first name, if an 'other name' has been defined. --- C4/Members.pm | 5 +++++ koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc | 2 +- .../opac-tmpl/prog/en/modules/opac-account.tmpl | 6 +++--- .../opac-tmpl/prog/en/modules/opac-messaging.tmpl | 4 ++-- .../opac-tmpl/prog/en/modules/opac-passwd.tmpl | 4 ++-- .../prog/en/modules/opac-readingrecord.tmpl | 4 ++-- .../opac-tmpl/prog/en/modules/opac-reserve.tmpl | 4 ++-- .../opac-tmpl/prog/en/modules/opac-sendbasket.tmpl | 2 +- .../opac-tmpl/prog/en/modules/opac-sendshelf.tmpl | 2 +- koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl | 4 ++-- .../prog/en/modules/opac-userdetails.tmpl | 9 ++++++--- .../opac-tmpl/prog/en/modules/opac-userupdate.tmpl | 4 ++-- opac/opac-passwd.pl | 10 ++++++---- 13 files changed, 35 insertions(+), 25 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index cddbf41..d1723a2 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -367,6 +367,11 @@ sub GetMemberDetails { $sth->execute( $borrower->{'categorycode'} ); my $enrolment = $sth->fetchrow; $borrower->{'enrolmentperiod'} = $enrolment; + # For the purposes of making templates easier, we'll define a + # 'showname' which is the alternate form the user's first name if + # 'other name' is defined. + $borrower->{'showname'} = $borrower->{'othernames'} || $borrower->{'firstname'}; + return ($borrower); #, $flags, $accessflagshash); } diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc index 878a412..1b3212a 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc @@ -4,7 +4,7 @@
  • Log in to Your Account
  • -
  • Welcome,
  • +
  • Welcome,
  • diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tmpl index 0b7f220..eb2a20e 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tmpl @@ -1,4 +1,4 @@ -Koha Online Catalog › Account for +Koha Online Catalog › Account for @@ -11,7 +11,7 @@
    -

    's account ../../images/caret.gif" width="16" height="16" alt=">" border="0" /> Fines and Charges

    +

    's account ../../images/caret.gif" width="16" height="16" alt=">" border="0" /> Fines and Charges

    @@ -59,4 +59,4 @@
    - \ No newline at end of file + 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 0e0543c..3800d10 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tmpl @@ -1,4 +1,4 @@ -Koha OnlineKoha Online Catalog › Updating Details for +Koha OnlineKoha Online Catalog › Updating Details for @@ -93,7 +93,7 @@ $.tablesorter.addParser({ -

    Hello, (Click here if you're not )

    +

    Hello, (Click here if you're not )

    Thank you!

    Your corrections have been submitted to the library, and a staff member will update your record as soon as possible.

    diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-userdetails.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-userdetails.tmpl index 174b8bd..ec88242 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-userdetails.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-userdetails.tmpl @@ -1,4 +1,4 @@ -Koha Online Catalog › Personal Details for +Koha Online Catalog › Personal Details for @@ -9,10 +9,13 @@
    -

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

    +

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

    + + +
    Name:
    Other Name:
    Card Number:
    @@ -84,4 +87,4 @@ Card Number:
    - \ No newline at end of file + 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 bb0a473..1655c11 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tmpl @@ -1,4 +1,4 @@ -Koha OnlineKoha Online Catalog › Updating Details for +Koha OnlineKoha Online Catalog › Updating Details for @@ -11,7 +11,7 @@
    -

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

    +

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

    diff --git a/opac/opac-passwd.pl b/opac/opac-passwd.pl index ca502ab..cc518d5 100755 --- a/opac/opac-passwd.pl +++ b/opac/opac-passwd.pl @@ -97,10 +97,12 @@ else { } } -$template->param(firstname => $borr->{'firstname'}, - surname => $borr->{'surname'}, - minpasslen => $minpasslen, - passwdview => 1, +$template->param( + firstname => $borr->{'firstname'}, + surname => $borr->{'surname'}, + showname => $borr->{'showname'}, + minpasslen => $minpasslen, + passwdview => 1, ); output_html_with_http_headers $query, $cookie, $template->output; -- 1.7.0.4