From 131002e6230f2b69f0d6007b75fbc90444745b68 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 4 Jul 2016 15:03:18 +0100 Subject: [PATCH] Bug 16847: Remove C4::Members::GetTitles MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This subroutine just reads the content of a pref, split it, add an empty string and returns. It is not really useful and the code in the script (memberentry.pl) uses the only occurrence of CGI::popup_menu Let's remove it and build the dropdown list in the template. Test plan: 1/ Empty BorrowersTitles, edit a patron and confirm that the "Salutation" does not appear 2/ Fill BorrowersTitles with "Mr|Mrs|Miss|Ms", edit a patron and confirm that the "Salutation" dropdown list is correctly filled. The default option should be selected if you are editing a patron with a title defined. This should also be tested at the OPAC. Followed test pan, works as expected in Staff and OPAC Signed-off-by: Marc Véron Signed-off-by: Tomas Cohen Arazi Signed-off-by: Kyle M Hall --- C4/Members.pm | 21 ------------------- .../prog/en/modules/members/memberentrygen.tt | 13 ++++++++++-- .../bootstrap/en/modules/opac-memberentry.tt | 4 ++-- members/memberentry.pl | 10 +-------- opac/opac-memberentry.pl | 1 - 5 files changed, 14 insertions(+), 35 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index 53ca664248..061172fee9 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -71,7 +71,6 @@ BEGIN { &GetAge &GetSortDetails - &GetTitles &GetHideLostItemsPreference @@ -1640,26 +1639,6 @@ EOF return 0; } -=head2 GetTitles (OUEST-PROVENCE) - - ($borrowertitle)= &GetTitles(); - -Looks up the different title . Returns array with all borrowers title - -=cut - -sub GetTitles { - my @borrowerTitle = split (/,|\|/,C4::Context->preference('BorrowersTitles')); - unshift( @borrowerTitle, "" ); - my $count=@borrowerTitle; - if ($count == 1){ - return (); - } - else { - return ( \@borrowerTitle); - } -} - =head2 GetHideLostItemsPreference $hidelostitemspref = &GetHideLostItemsPreference($borrowernumber); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index 5dfd5a2745..20725bd8c8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -254,7 +254,7 @@ $(document).ready(function() {
    [% UNLESS ( I ) %] [% UNLESS notitle %] - [% IF ( title_cgipopup ) %] + [% IF Koha.Preference('BorrowersTitles') %]
  1. [% IF ( mandatorytitle ) %]
  2. [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt index b70ab9e75c..ca0358dfb5 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt @@ -203,7 +203,7 @@ Identity
      - [% UNLESS hidden.defined('title') || !member_titles %] + [% UNLESS hidden.defined('title') || !Koha.Preference('BorrowersTitles') %]
    1. [% IF mandatory.defined('title') %]