From db0841646c2b76932096042f47e7205337eb2652 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 +- installer/data/mysql/updatedatabase.pl | 1 - .../prog/en/modules/members/memberentrygen.tt | 5 +- .../prog/en/modules/members/moremember-brief.tt | 8 ++-- .../prog/en/modules/members/moremember.tt | 54 +++++++++------------- members/moremember.pl | 3 -- opac/opac-memberentry.pl | 22 ++++----- 7 files changed, 40 insertions(+), 55 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/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index fa636f0..3d1327f 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -15754,7 +15754,6 @@ foreach my $file ( sort readdir $dirh ) { } } - =head1 FUNCTIONS =head2 TableExists($table) 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 a784d08..44a6ebc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -405,8 +405,7 @@ [% UNLESS nophone && nophonepro && nomobile && noemail && noemailpro && nofax %]
- Contact -
    + Contact
      [% UNLESS nophone %]
    1. [% IF ( mandatoryphone ) %] @@ -469,7 +468,7 @@ [% IF ( mandatoryemailpro ) %]Required[% END %]
    2. [% END %] - [% UNLESS nofax %] + [% UNLESS nofax %]
    3. [% IF ( mandatoryfax ) %]
    4. - [% ELSIF guarantor %] -
    5. - Guarantor: - [% IF guarantor.borrowernumber %] - [% guarantor.firstname | html %] [% guarantor.surname | html %] - [% ELSE %] - [% guarantor.firstname | html %] [% guarantor.surname | html %] - [% END %] -
    6. - [% END %] - [% IF ( primary_contact_method ) %] -
    7. - Main contact method: - [% SWITCH primary_contact_method %] - [% CASE 'phone' %] - Primary phone - [% CASE 'phonepro' %] - Secondary phone - [% CASE 'mobile' %] - Other phone - [% CASE 'email' %] - Primary email - [% CASE 'emailpro' %] - Secondary email - [% CASE 'fax' %] - Fax - [% END %] -
    8. - [% END %] -
    + + [% END %] + [% IF ( primary_contact_method ) %] +
  1. + Main contact method: + [% SWITCH primary_contact_method %] + [% CASE 'phone' %] + Primary phone + [% CASE 'phonepro' %] + Secondary phone + [% CASE 'mobile' %] + Other phone + [% CASE 'email' %] + Primary email + [% CASE 'emailpro' %] + Secondary email + [% CASE 'fax' %] + Fax + [% END %] +
  2. + [% END %] +
[% IF ( guarantor.borrowernumber ) %] diff --git a/members/moremember.pl b/members/moremember.pl index 8f37343..97b6254 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -339,9 +339,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 034b9b1..081dd43 100755 --- a/opac/opac-memberentry.pl +++ b/opac/opac-memberentry.pl @@ -94,18 +94,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.1.4