From 46278bc289abd9f0dd55ce25b4a3bb6ac4b5e102 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 ++++++++++++---------- 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 a1a55c0..e8daa82 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -509,54 +509,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 24b882a..141f08c 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -645,17 +645,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 4974c62..be365a3 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -319,7 +319,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.7.4