From 290e3943bfcf99032b7a44616890112a8de479ae 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? --- .../prog/en/modules/members/memberentrygen.tt | 91 ++++++++++++---------- .../prog/en/modules/members/moremember.tt | 4 +- members/memberentry.pl | 11 --- members/moremember.pl | 1 - 4 files changed, 51 insertions(+), 56 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 543d752f2a..c3affcd9b4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -483,54 +483,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/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index e797e8890c..62ff7d5f48 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -172,10 +172,10 @@ [% END %] [% END %] - [% IF ( primary_contact_method ) %] + [% IF patron.primary_contact_method %]
  • Main contact method: - [% SWITCH primary_contact_method %] + [% SWITCH patron.primary_contact_method %] [% CASE 'phone' %] Primary phone [% CASE 'phonepro' %] diff --git a/members/memberentry.pl b/members/memberentry.pl index fdf07faa1d..3dd1d0168f 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -632,17 +632,6 @@ $template->param('typeloop' => \@typeloop, no_categories => $no_categories); 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 668b0b7819..dbe9896377 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -333,7 +333,6 @@ $template->param( patron => $patron, translated_language => $translated_language, detailview => 1, - primary_contact_method => $data->{'primary_contact_method'}, was_renewed => scalar $input->param('was_renewed') ? 1 : 0, todaysdate => output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }), totalprice => sprintf("%.2f", $totalprice), -- 2.11.0