From 07c6ef6cb6d4a4d1c70fa0fe6a4c239f3cf825df Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 7 Mar 2014 12:02:34 -0500 Subject: [PATCH] Bug 11879 [QA Followup] - Fix patch to follow modern coding guidelines --- installer/data/mysql/updatedatabase.pl | 4 +- .../prog/en/modules/members/memberentrygen.tt | 49 +++++++++++++------- members/memberentry.pl | 11 ---- 3 files changed, 34 insertions(+), 30 deletions(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 4384db1..024665b 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -8014,8 +8014,8 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { $DBversion = "XXX"; if ( CheckVersion($DBversion) ) { - $dbh->do("ALTER TABLE `borrowers` ADD COLUMN `contactprincipal` VARCHAR(45) NULL DEFAULT NULL;"); - print "Upgrade to $DBversion done (Add the contactprincipal column to the borrowers table)\n"; + $dbh->do("ALTER TABLE `borrowers` ADD COLUMN `primary_contact_method` VARCHAR(45) NULL DEFAULT NULL;"); + print "Upgrade to $DBversion done (Add the primary_contact_method column to the borrowers table)\n"; SetVersion($DBversion); } 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 edf103d..cb25c27 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -643,35 +643,50 @@ [% IF ( mandatoryfax ) %]Required[% END %]
  • - - - [% FOREACH contactprincipalloo IN contactprincipalloop %] - [% IF ( contactprincipalloo.currentis_phone ) %] - + [% IF ( primary_contact_method == 'phone' ) %] + + [% ELSE %] + [% END %] - [% IF ( contactprincipalloo.currentis_phonepro ) %] - + + [% IF ( primary_contact_method == 'phonepro' ) %] + + [% ELSE %] + [% END %] - [% IF ( contactprincipalloo.currentis_mobile ) %] - + + [% IF ( primary_contact_method == 'mobile' ) %] + + [% ELSE %] + [% END %] - [% IF ( contactprincipalloo.currentis_email ) %] - + + [% IF ( primary_contact_method == 'email' ) %] + + [% ELSE %] + [% END %] - [% IF ( contactprincipalloo.currentis_emailpro ) %] - + + [% IF ( primary_contact_method == 'emailpro' ) %] + + [% ELSE %] + [% END %] - [% IF ( contactprincipalloo.currentis_fax ) %] - + + [% IF ( primary_contact_method == 'fax' ) %] + + [% ELSE %] + [% END %] - [% END %]
  • [% END %] -[%END # hide fieldset %] +[% END # hide fieldset %] [% END %] diff --git a/members/memberentry.pl b/members/memberentry.pl index 35e2936..50738f2 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -526,17 +526,6 @@ $template->param('typeloop' => \@typeloop, no_categories => $no_categories); if($no_categories){ $no_add = 1; } -my @contactprincipalloop; -foreach (qw(phone phonepro mobile email emailpro fax)) { - push @contactprincipalloop,{ - 'code' => $_, - 'selected' => (defined($borrower_data->{'contactprincipal'}) && - $_ eq $borrower_data->{'contactprincipal'}), - 'currentis_' . $_ => 1 - }; -} -$template->param('contactprincipalloop' => \@contactprincipalloop); - # test in city if ( $guarantorid ) { $select_city = getidcity($data{city}); -- 1.7.2.5