From 9e5cbdc7c041c3aea36532c64b8ed29182c034b9 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 24 Apr 2018 13:45:03 -0300 Subject: [PATCH] Bug 11879: Remove unecessary code in controller - adds the field required is defined in BorrowerMandatoryField (staff only) - removes code from controller (not needed, we can follow existing pattern) - does not send patron's attribute separately (we have the 'patron' variable already) Need to be done: - same changes for the OPAC - remove extra changes made to moremember-brief.tt (if bugfix it needs to be moved on a separate bug report) - deal with PatronSelfModificationBorrowerUnwantedField and PatronSelfRegistrationBorrowerUnwantedField I first thought it would have replaced AutoEmailPrimaryAddress, but it actually only needed for display purpose, how/where can we explain that? Are release notes enough? Signed-off-by: Hayley Mapley Signed-off-by: Bin Wen --- .../prog/en/modules/members/memberentrygen.tt | 91 ++++++++++--------- members/memberentry.pl | 11 --- members/moremember.pl | 1 - 3 files changed, 49 insertions(+), 54 deletions(-) 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 48f50c0fdd..5108bb82b5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -602,54 +602,61 @@ [% END %]
  • - - + + [% UNLESS nophone %] + [% IF ( primary_contact_method == 'phone' ) %] + + [% ELSE %] + [% END %] - [% IF ( contactprincipalloo.currentis_phonepro ) %] - [% IF ( primary_contact_method == 'phonepro' ) %] - - [% ELSE %] - - [% END %] + [% END %] + [% UNLESS nophonepro %] + [% IF ( primary_contact_method == 'phonepro' ) %] + + [% ELSE %] + [% END %] - [% IF ( contactprincipalloo.currentis_mobile ) %] - [% IF ( primary_contact_method == 'mobile' ) %] - - [% ELSE %] - - [% END %] + [% END %] + [% UNLESS nomobile %] + [% IF ( primary_contact_method == 'mobile' ) %] + + [% ELSE %] + [% END %] - [% IF ( contactprincipalloo.currentis_email ) %] - [% IF ( primary_contact_method == 'email' ) %] - - [% ELSE %] - - [% END %] + [% END %] + [% UNLESS noemail %] + [% IF ( primary_contact_method == 'email' ) %] + + [% ELSE %] + [% END %] - [% IF ( contactprincipalloo.currentis_emailpro ) %] - [% IF ( primary_contact_method == 'emailpro' ) %] - - [% ELSE %] - - [% END %] + [% END %] + [% UNLESS noemailpro %] + [% IF ( primary_contact_method == 'emailpro' ) %] + + [% ELSE %] + [% END %] - [% IF ( contactprincipalloo.currentis_fax ) %] - [% IF ( primary_contact_method == 'fax' ) %] - - [% ELSE %] - - [% END %] + [% END %] + [% UNLESS nofax %] + [% IF ( primary_contact_method == 'fax' ) %] + + [% ELSE %] + [% END %] - [% END %] - + [% END %] + + [% IF mandatoryprimary_contact_method %] + Required + [% END %]
  • diff --git a/members/memberentry.pl b/members/memberentry.pl index ca80356342..c7323662ff 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -640,17 +640,6 @@ $template->param( ); if($no_categories){ $no_add = 1; } -my @contactprincipalloop; -my @fieldArray = qw(phone phonepro mobile email emailpro fax); -foreach my $field (@fieldArray) { - if ( !(grep { $field eq $_ } @field_check)){ - push @contactprincipalloop,{ - 'currentis_' . $field => 1 - }; - } -} -$template->param('contactprincipalloop' => \@contactprincipalloop); - my $cities = Koha::Cities->search( {}, { order_by => 'city_name' } ); my $roadtypes = C4::Koha::GetAuthorisedValues( 'ROADTYPE' ); $template->param( diff --git a/members/moremember.pl b/members/moremember.pl index b40c80c30c..593b0d1156 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -204,7 +204,6 @@ $template->param( fines => $patron->account->balance, translated_language => $translated_language, detailview => 1, - primary_contact_method => $data->{'primary_contact_method'}, was_renewed => scalar $input->param('was_renewed') ? 1 : 0, $category_type => 1, # [% IF ( I ) %] = institutional/organisation housebound_role => scalar $patron->housebound_role, -- 2.17.1