@@ -, +, @@
- Display the value in the patron detail page
- Adds support for BorrowerUnwantedField (staff)
- Removes unecessary code in opac/opac-memberentry.pl
---
.../borrowers_primary_contact_method.perl | 6 +-
.../en/modules/admin/preferences/borrowers.json | 3 +-
.../prog/en/modules/members/memberentrygen.tt | 100 +++++++++++----------
.../prog/en/modules/members/moremember.tt | 4 +-
.../bootstrap/en/modules/opac-memberentry.tt | 72 ++++++---------
opac/opac-memberentry.pl | 14 ---
6 files changed, 87 insertions(+), 112 deletions(-)
--- a/installer/data/mysql/atomicupdate/borrowers_primary_contact_method.perl
+++ a/installer/data/mysql/atomicupdate/borrowers_primary_contact_method.perl
@@ -1,15 +1,15 @@
$DBversion = 'XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
if( !column_exists( 'borrowers', 'primary_contact_method' ) ) {
- $dbh->do( "ALTER TABLE `borrowers` ADD COLUMN `primary_contact_method` VARCHAR(45) NULL DEFAULT NULL AFTER `anonymized`" );
+ $dbh->do( "ALTER TABLE `borrowers` ADD COLUMN `primary_contact_method` VARCHAR(45) DEFAULT NULL AFTER `autorenew_checkouts`" );
}
if( !column_exists( 'deletedborrowers', 'primary_contact_method' ) ) {
- $dbh->do( "ALTER TABLE `deletedborrowers` ADD COLUMN `primary_contact_method` VARCHAR(45) NULL DEFAULT NULL AFTER `anonymized`" );
+ $dbh->do( "ALTER TABLE `deletedborrowers` ADD COLUMN `primary_contact_method` VARCHAR(45) DEFAULT NULL AFTER `autorenew_checkouts`" );
}
if( !column_exists( 'borrower_modifications', 'primary_contact_method' ) ) {
- $dbh->do( "ALTER TABLE `borrower_modifications` ADD COLUMN `primary_contact_method` VARCHAR(45) NULL DEFAULT NULL AFTER `gdpr_proc_consent`" );
+ $dbh->do( "ALTER TABLE `borrower_modifications` ADD COLUMN `primary_contact_method` VARCHAR(45) DEFAULT NULL AFTER `gdpr_proc_consent`" );
}
SetVersion( $DBversion );
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/borrowers.json
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/borrowers.json
@@ -51,5 +51,6 @@
"altcontactzipcode": "altcontactzipcode",
"altcontactcountry": "altcontactcountry",
"altcontactphone": "altcontactphone",
- "smsalertnumber": "smsalertnumber"
+ "smsalertnumber": "smsalertnumber",
+ "primary_contact_method": "primary_contact_method"
}
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt
@@ -741,63 +741,65 @@ legend:hover {
[% END #/UNLESS nofax %]
-
- [% IF mandatoryprimary_contact_method %]
-
+ [% END %]
[% END # hide fieldset %]
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
@@ -308,10 +308,10 @@
[% 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' %]
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt
+++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt
@@ -565,49 +565,35 @@
[% IF ( mandatory.defined('primary_contact_method') ) %]Required[% END %]
--- a/opac/opac-memberentry.pl
+++ a/opac/opac-memberentry.pl
@@ -102,20 +102,6 @@ $template->param(
defaultCategory => $defaultCategory,
);
-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
- };
- }
-}
-
-$template->param('contactprincipalloop' => \@contactprincipalloop);
-
my $attributes = ParsePatronAttributes($borrowernumber,$cgi);
my $conflicting_attribute = 0;
--