Bugzilla – Attachment 53086 Details for
Bug 16847
Remove C4::Members::GetTitles
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16847: Remove C4::Members::GetTitles
Bug-16847-Remove-C4MembersGetTitles.patch (text/plain), 6.32 KB, created by
Jonathan Druart
on 2016-07-04 14:21:38 UTC
(
hide
)
Description:
Bug 16847: Remove C4::Members::GetTitles
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-07-04 14:21:38 UTC
Size:
6.32 KB
patch
obsolete
>From 8319fc22987c0a9f6293348e6ce7e5afb5174c96 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 4 Jul 2016 15:03:18 +0100 >Subject: [PATCH] Bug 16847: Remove C4::Members::GetTitles > >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. >--- > C4/Members.pm | 20 -------------------- > .../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(+), 34 deletions(-) > >diff --git a/C4/Members.pm b/C4/Members.pm >index 383799d..d667b03 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -1744,26 +1744,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 17eeb5b..463ef61 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -199,7 +199,7 @@ $(document).ready(function() { > <ol> > [% UNLESS ( I ) %] > [% UNLESS notitle %] >- [% IF ( title_cgipopup ) %] >+ [% IF Koha.Preference('BorrowersTitles') %] > <li> > [% IF ( mandatorytitle ) %] > <label for="btitle" class="required"> >@@ -207,7 +207,16 @@ $(document).ready(function() { > <label for="btitle"> > [% END %] > Salutation: </label> >- [% borrotitlepopup %] >+ <select id="btitle" name="title"> >+ <option value=""></option> >+ [% FOREACH t IN Koha.Preference('BorrowersTitles').split('\|') %] >+ [% IF btitle == t %] >+ <option value="[% t %]" selected="selected">[% t %]</option> >+ [% ELSE %] >+ <option value="[% t %]">[% t %]</option> >+ [% END %] >+ [% END %] >+ </select> > [% IF ( mandatorytitle ) %]<span class="required">Required</span>[% END %] > </li> > [% 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 b70ab9e..ca0358d 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 @@ > <legend id="identity_legend">Identity</legend> > > <ol> >- [% UNLESS hidden.defined('title') || !member_titles %] >+ [% UNLESS hidden.defined('title') || !Koha.Preference('BorrowersTitles') %] > <li> > [% IF mandatory.defined('title') %] > <label for="borrower_title" class="required"> >@@ -213,7 +213,7 @@ > Salutation:</label> > > <select id="borrower_title" name="borrower_title"> >- [% FOREACH mt IN member_titles %] >+ [% FOREACH mt IN Koha.Preference('BorrowersTitles').split('\|') %] > [% IF mt == borrower.title %] > <option value="[% mt %]" selected="selected">[% mt %]</option> > [% ELSE %] >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 597c68d..a34c260 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -547,14 +547,6 @@ $template->param( > > my $default_borrowertitle = ''; > unless ( $op eq 'duplicate' ) { $default_borrowertitle=$data{'title'} } >-my($borrowertitle)=GetTitles(); >-$template->param( title_cgipopup => 1) if ($borrowertitle); >-my $borrotitlepopup = CGI::popup_menu(-name=>'title', >- -id => 'btitle', >- -values=>$borrowertitle, >- -override => 1, >- -default=>$default_borrowertitle >- ); > > my @relationships = split /,|\|/, C4::Context->preference('borrowerRelationship'); > my @relshipdata; >@@ -682,7 +674,7 @@ $template->param( > borrowernumber => $borrowernumber, #register number > guarantorid => ($borrower_data->{'guarantorid'} || $guarantorid), > relshiploop => \@relshipdata, >- borrotitlepopup => $borrotitlepopup, >+ btitle=> $default_borrowertitle, > guarantorinfo => $guarantorinfo, > flagloop => \@flagdata, > category_type =>$category_type, >diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl >index de157ef..b73ee1b 100755 >--- a/opac/opac-memberentry.pl >+++ b/opac/opac-memberentry.pl >@@ -68,7 +68,6 @@ $template->param( > action => $action, > hidden => GetHiddenFields( $mandatory, 'registration' ), > mandatory => $mandatory, >- member_titles => GetTitles() || undef, > branches => GetBranchesLoop(), > OPACPatronDetails => C4::Context->preference('OPACPatronDetails'), > ); >-- >2.8.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16847
:
53086
|
53087
|
53088
|
53089
|
53091
|
53092
|
53527
|
53528