From d34e8c2ac8fc864315e044059fbf3f290d1a1652 Mon Sep 17 00:00:00 2001 From: Charles Farmer Date: Mon, 19 Feb 2018 10:21:23 -0500 Subject: [PATCH] Bug 11879: (QA follow-up) Fix problems found in code review Signed-off-by: Lucie Gay Signed-off-by: Katrin Fischer --- .../borrowers_primary_contact_method.sql | 2 +- .../prog/en/modules/members/memberentrygen.tt | 5 ++--- .../prog/en/modules/members/moremember-brief.tt | 8 ++++---- .../prog/en/modules/members/moremember.tt | 9 --------- members/moremember.pl | 3 --- opac/opac-memberentry.pl | 22 +++++++++++----------- 6 files changed, 18 insertions(+), 31 deletions(-) diff --git a/installer/data/mysql/atomicupdate/borrowers_primary_contact_method.sql b/installer/data/mysql/atomicupdate/borrowers_primary_contact_method.sql index 000791d..65b6b58 100644 --- a/installer/data/mysql/atomicupdate/borrowers_primary_contact_method.sql +++ b/installer/data/mysql/atomicupdate/borrowers_primary_contact_method.sql @@ -1,3 +1,3 @@ -ALTER TABLE `borrowers` ADD COLUMN `primary_contact_method` VARCHAR(45) NULL DEFAULT NULL AFTER `lastseen`; +ALTER TABLE `borrowers` ADD COLUMN `primary_contact_method` VARCHAR(45) NULL DEFAULT NULL AFTER `overdrive_auth_token`; ALTER TABLE `deletedborrowers` ADD COLUMN `primary_contact_method` VARCHAR(45) NULL DEFAULT NULL AFTER `overdrive_auth_token`; ALTER TABLE `borrower_modifications` ADD COLUMN `primary_contact_method` VARCHAR(45) NULL DEFAULT NULL AFTER `extended_attributes`; 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 b6104a5..a1a55c0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -432,8 +432,7 @@ [% UNLESS nophone && nophonepro && nomobile && noemail && noemailpro && nofax %]
- Contact -
    + Contact
      [% UNLESS nophone %]
    1. [% IF ( mandatoryphone ) %] @@ -496,7 +495,7 @@ [% IF ( mandatoryemailpro ) %]Required[% END %]
    2. [% END %] - [% UNLESS nofax %] + [% UNLESS nofax %]
    3. [% IF ( mandatoryfax ) %]
    4. - [% ELSIF guarantor %] -
    5. - Guarantor: - [% IF guarantor.borrowernumber AND logged_in_user.can_see_patron_infos( guarantor ) %] - [% guarantor.firstname | html %] [% guarantor.surname | html %] - [% ELSE %] - [% guarantor.firstname | html %] [% guarantor.surname | html %] - [% END %] -
    6. [% END %] [% IF ( primary_contact_method ) %] diff --git a/members/moremember.pl b/members/moremember.pl index c97d144..4974c62 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -319,9 +319,6 @@ $template->param( patron => $patron, translated_language => $translated_language, detailview => 1, - borrowernumber => $borrowernumber, - othernames => $data->{'othernames'}, - categoryname => $patron->category->description, 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 }), diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl index 5eef076..4afbd1b 100755 --- a/opac/opac-memberentry.pl +++ b/opac/opac-memberentry.pl @@ -95,18 +95,18 @@ $template->param( OPACPatronDetails => C4::Context->preference('OPACPatronDetails'), ); my $check_BorrowerMandatoryField=C4::Context->preference("BorrowerMandatoryField"); - my @field_check=split(/\|/,$check_BorrowerMandatoryField); - 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 - }; - } - } +my @field_check=split(/\|/,$check_BorrowerMandatoryField); +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); +$template->param('contactprincipalloop' => \@contactprincipalloop); my $attributes = ParsePatronAttributes($borrowernumber,$cgi); my $conflicting_attribute = 0; -- 2.7.4