View | Details | Raw Unified | Return to bug 11879
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/borrowers_primary_contact_method.sql (+3 lines)
Line 0 Link Here
1
ALTER TABLE `borrowers` ADD COLUMN `primary_contact_method` VARCHAR(45) NULL DEFAULT NULL AFTER `lastseen`;
2
ALTER TABLE `deletedborrowers` ADD COLUMN `primary_contact_method` VARCHAR(45) NULL DEFAULT NULL AFTER `overdrive_auth_token`;
3
ALTER TABLE `borrower_modifications` ADD COLUMN `primary_contact_method` VARCHAR(45) NULL DEFAULT NULL AFTER `extended_attributes`;
(-)a/installer/data/mysql/kohastructure.sql (+3 lines)
Lines 610-615 CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrower Link Here
610
  `login_attempts` int(4) default 0, -- number of failed login attemps
610
  `login_attempts` int(4) default 0, -- number of failed login attemps
611
  `overdrive_auth_token` MEDIUMTEXT default NULL, -- persist OverDrive auth token
611
  `overdrive_auth_token` MEDIUMTEXT default NULL, -- persist OverDrive auth token
612
  `flgAnonymized` tinyint DEFAULT 0, -- flag for data anonymization
612
  `flgAnonymized` tinyint DEFAULT 0, -- flag for data anonymization
613
  `primary_contact_method` varchar(45) DEFAULT NULL, --  useful for reporting purposes
613
  KEY borrowernumber (borrowernumber),
614
  KEY borrowernumber (borrowernumber),
614
  KEY `cardnumber` (`cardnumber`),
615
  KEY `cardnumber` (`cardnumber`),
615
  KEY `sms_provider_id` (`sms_provider_id`)
616
  KEY `sms_provider_id` (`sms_provider_id`)
Lines 1644-1649 CREATE TABLE `borrowers` ( -- this table includes information about your patrons Link Here
1644
  `login_attempts` int(4) default 0, -- number of failed login attemps
1645
  `login_attempts` int(4) default 0, -- number of failed login attemps
1645
  `overdrive_auth_token` MEDIUMTEXT default NULL, -- persist OverDrive auth token
1646
  `overdrive_auth_token` MEDIUMTEXT default NULL, -- persist OverDrive auth token
1646
  `flgAnonymized` tinyint DEFAULT 0, -- flag for data anonymization
1647
  `flgAnonymized` tinyint DEFAULT 0, -- flag for data anonymization
1648
  `primary_contact_method` varchar(45) DEFAULT NULL, --  useful for reporting purposes
1647
  UNIQUE KEY `cardnumber` (`cardnumber`),
1649
  UNIQUE KEY `cardnumber` (`cardnumber`),
1648
  PRIMARY KEY `borrowernumber` (`borrowernumber`),
1650
  PRIMARY KEY `borrowernumber` (`borrowernumber`),
1649
  KEY `categorycode` (`categorycode`),
1651
  KEY `categorycode` (`categorycode`),
Lines 3461-3466 CREATE TABLE IF NOT EXISTS `borrower_modifications` ( Link Here
3461
  `privacy` int(11) DEFAULT NULL,
3463
  `privacy` int(11) DEFAULT NULL,
3462
  `extended_attributes` MEDIUMTEXT DEFAULT NULL,
3464
  `extended_attributes` MEDIUMTEXT DEFAULT NULL,
3463
  `gdpr_proc_consent` datetime, -- data processing consent
3465
  `gdpr_proc_consent` datetime, -- data processing consent
3466
  `primary_contact_method` varchar(45) DEFAULT NULL, --  useful for reporting purposes
3464
  PRIMARY KEY (`verification_token` (191),`borrowernumber`),
3467
  PRIMARY KEY (`verification_token` (191),`borrowernumber`),
3465
  KEY `verification_token` (`verification_token` (191)),
3468
  KEY `verification_token` (`verification_token` (191)),
3466
  KEY `borrowernumber` (`borrowernumber`)
3469
  KEY `borrowernumber` (`borrowernumber`)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-4 / +57 lines)
Lines 432-438 Link Here
432
432
433
[% UNLESS nophone && nophonepro && nomobile && noemail && noemailpro && nofax %]
433
[% UNLESS nophone && nophonepro && nomobile && noemail && noemailpro && nofax %]
434
  <fieldset class="rows" id="memberentry_contact">
434
  <fieldset class="rows" id="memberentry_contact">
435
    <legend id="contact_lgd">Contact</legend><ol>
435
    <legend id="contact_lgd">Contact</legend>
436
<ol>
436
        [% UNLESS nophone %]
437
        [% UNLESS nophone %]
437
      <li>
438
      <li>
438
      [% IF ( mandatoryphone ) %]
439
      [% IF ( mandatoryphone ) %]
Lines 495-501 Link Here
495
	  [% IF ( mandatoryemailpro ) %]<span class="required">Required</span>[% END %]
496
	  [% IF ( mandatoryemailpro ) %]<span class="required">Required</span>[% END %]
496
    </li>
497
    </li>
497
        [% END %]
498
        [% END %]
498
        [% UNLESS nofax %]
499
    [% UNLESS nofax %]
499
    <li>
500
    <li>
500
      [% IF ( mandatoryfax ) %]
501
      [% IF ( mandatoryfax ) %]
501
      <label for="fax" class="required">
502
      <label for="fax" class="required">
Lines 506-513 Link Here
506
        <input type="text" id="fax" name="fax" value="[% fax | html %]" />
507
        <input type="text" id="fax" name="fax" value="[% fax | html %]" />
507
	  [% IF ( mandatoryfax ) %]<span class="required">Required</span>[% END %]
508
	  [% IF ( mandatoryfax ) %]<span class="required">Required</span>[% END %]
508
    </li>
509
    </li>
509
        [% END %]
510
510
	</ol>
511
   [% END %]
512
    <li>
513
       <label for="primary_contact_method">Main contact method:</label>
514
       <select id="primary_contact_method" name="primary_contact_method">
515
       <option value=""></option>
516
         [% FOREACH contactprincipalloo IN contactprincipalloop %]
517
            [% IF ( contactprincipalloo.currentis_phone ) %]
518
               [% IF ( primary_contact_method == 'phone' ) %]
519
                 <option value="phone" selected="selected">Primary phone</option>
520
               [% ELSE %]
521
                 <option value="phone">Primary phone</option>
522
               [% END %]
523
            [% END %]
524
            [% IF ( contactprincipalloo.currentis_phonepro ) %]
525
               [% IF ( primary_contact_method == 'phonepro' ) %]
526
                 <option value="phonepro" selected="selected">Secondary phone</option>
527
               [% ELSE %]
528
                 <option value="phonepro">Secondary phone</option>
529
               [% END %]
530
            [% END %]
531
            [% IF ( contactprincipalloo.currentis_mobile ) %]
532
               [% IF ( primary_contact_method == 'mobile' ) %]
533
                 <option value="mobile" selected="selected">Other phone</option>
534
               [% ELSE %]
535
                 <option value="mobile">Other phone</option>
536
               [% END %]
537
            [% END %]
538
            [% IF ( contactprincipalloo.currentis_email ) %]
539
               [% IF ( primary_contact_method == 'email' ) %]
540
                 <option value="email" selected="selected">Primary email</option>
541
               [% ELSE %]
542
                 <option value="email">Primary email</option>
543
               [% END %]
544
            [% END %]
545
            [% IF ( contactprincipalloo.currentis_emailpro ) %]
546
               [% IF ( primary_contact_method == 'emailpro' ) %]
547
                 <option value="emailpro" selected="selected">Secondary email</option>
548
               [% ELSE %]
549
                 <option value="emailpro">Secondary email</option>
550
               [% END %]
551
            [% END %]
552
            [% IF ( contactprincipalloo.currentis_fax ) %]
553
               [% IF ( primary_contact_method == 'fax' ) %]
554
                 <option value="fax" selected="selected">Fax</option>
555
               [% ELSE %]
556
                 <option value="fax">Fax</option>
557
               [% END %]
558
            [% END %]
559
         [% END %]
560
       </select>
561
    </li>
562
    </ol>
563
511
  </fieldset>
564
  </fieldset>
512
[%END # hide fieldset %]
565
[%END # hide fieldset %]
513
566
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (+15 lines)
Lines 265-270 Link Here
265
                                                [% END %]
265
                                                [% END %]
266
                                            </li>
266
                                            </li>
267
                                        [% END %]
267
                                        [% END %]
268
269
                                        [% SWITCH primary_contact_method %]
270
                                        [% CASE 'phone' %]
271
                                        <li><span class="label">Main contact method: </span>Phone</li>
272
                                        [% CASE 'phonepro' %]
273
                                        <li><span class="label">Main contact method: </span>Secondary phone</li>
274
                                        [% CASE 'mobile' %]
275
                                        <li><span class="label">Main contact method: </span>Other Phone</li>
276
                                        [% CASE 'email' %]
277
                                        <li><span class="label">Main contact method: </span>Primary email</li>
278
                                        [% CASE 'emailpro' %]
279
                                        <li><span class="label">Main contact method: </span>Secondary email</li>
280
                                        [% CASE 'fax' %]
281
                                        <li><span class="label">Main contact method: </span>Fax</li>
282
                                        [% END %]
268
                                    </ol>
283
                                    </ol>
269
                                </div> [% # /div.rows %]
284
                                </div> [% # /div.rows %]
270
                            </div> [% # /div#patron-information %]
285
                            </div> [% # /div#patron-information %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt (+50 lines)
Lines 548-553 Link Here
548
                                    [% IF mandatory.defined('fax') %]<span class="required">Required</span>[% END %]
548
                                    [% IF mandatory.defined('fax') %]<span class="required">Required</span>[% END %]
549
                                </li>
549
                                </li>
550
                            [% END %]
550
                            [% END %]
551
                            <li>
552
                               <label for="borrower_primary_contact_method">Main contact method:</label>
553
                               <select id="borrower_primary_contact_method" name="borrower_primary_contact_method">
554
                               <option value=""></option>
555
                                 [% FOREACH contactprincipalloo IN contactprincipalloop %]
556
                                    [% IF ( contactprincipalloo.currentis_phone ) %]
557
                                       [% IF ( borrower.primary_contact_method == 'phone' ) %]
558
                                         <option value="phone" selected="selected">Primary phone</option>
559
                                       [% ELSE %]
560
                                         <option value="phone">Primary phone</option>
561
                                       [% END %]
562
                                    [% END %]
563
                                    [% IF ( contactprincipalloo.currentis_phonepro ) %]
564
                                       [% IF ( borrower.primary_contact_method == 'phonepro' ) %]
565
                                         <option value="phonepro" selected="selected">Secondary phone</option>
566
                                       [% ELSE %]
567
                                         <option value="phonepro">Secondary phone</option>
568
                                       [% END %]
569
                                    [% END %]
570
                                    [% IF ( contactprincipalloo.currentis_mobile ) %]
571
                                       [% IF ( borrower.primary_contact_method == 'mobile' ) %]
572
                                         <option value="mobile" selected="selected">Other phone</option>
573
                                       [% ELSE %]
574
                                         <option value="mobile">Other phone</option>
575
                                       [% END %]
576
                                    [% END %]
577
                                    [% IF ( contactprincipalloo.currentis_email ) %]
578
                                       [% IF ( borrower.primary_contact_method == 'email' ) %]
579
                                         <option value="email" selected="selected">Primary email</option>
580
                                       [% ELSE %]
581
                                         <option value="email">Primary email</option>
582
                                       [% END %]
583
                                    [% END %]
584
                                    [% IF ( contactprincipalloo.currentis_emailpro ) %]
585
                                       [% IF ( borrower.primary_contact_method == 'emailpro' ) %]
586
                                         <option value="emailpro" selected="selected">Secondary email</option>
587
                                       [% ELSE %]
588
                                         <option value="emailpro">Secondary email</option>
589
                                       [% END %]
590
                                    [% END %]
591
                                    [% IF ( contactprincipalloo.currentis_fax ) %]
592
                                       [% IF ( borrower.primary_contact_method == 'fax' ) %]
593
                                         <option value="fax" selected="selected">Fax</option>
594
                                       [% ELSE %]
595
                                         <option value="fax">Fax</option>
596
                                       [% END %]
597
                                    [% END %]
598
                                 [% END %]
599
                               </select>
600
                            </li>
551
                        </ol>
601
                        </ol>
552
                    </fieldset>
602
                    </fieldset>
553
                [% END %]
603
                [% END %]
(-)a/members/memberentry.pl (-1 / +10 lines)
Lines 645-650 $template->param('typeloop' => \@typeloop, Link Here
645
        no_categories => $no_categories);
645
        no_categories => $no_categories);
646
if($no_categories){ $no_add = 1; }
646
if($no_categories){ $no_add = 1; }
647
647
648
my @contactprincipalloop;
649
my @fieldArray = qw(phone phonepro mobile email emailpro fax);
650
foreach my $field (@fieldArray) {
651
   if ( !(grep { $field eq $_ } @field_check)){
652
        push @contactprincipalloop,{
653
            'currentis_' . $field => 1
654
        };
655
    }
656
}
657
$template->param('contactprincipalloop' => \@contactprincipalloop);
648
658
649
my $cities = Koha::Cities->search( {}, { order_by => 'city_name' } );
659
my $cities = Koha::Cities->search( {}, { order_by => 'city_name' } );
650
my $roadtypes = C4::Koha::GetAuthorisedValues( 'ROADTYPE' );
660
my $roadtypes = C4::Koha::GetAuthorisedValues( 'ROADTYPE' );
Lines 652-658 $template->param( Link Here
652
    roadtypes => $roadtypes,
662
    roadtypes => $roadtypes,
653
    cities    => $cities,
663
    cities    => $cities,
654
);
664
);
655
656
my $default_borrowertitle = '';
665
my $default_borrowertitle = '';
657
unless ( $op eq 'duplicate' ) { $default_borrowertitle=$data{'title'} }
666
unless ( $op eq 'duplicate' ) { $default_borrowertitle=$data{'title'} }
658
667
(-)a/members/moremember.pl (+4 lines)
Lines 319-324 $template->param( Link Here
319
    patron          => $patron,
319
    patron          => $patron,
320
    translated_language => $translated_language,
320
    translated_language => $translated_language,
321
    detailview      => 1,
321
    detailview      => 1,
322
    borrowernumber  => $borrowernumber,
323
    othernames      => $data->{'othernames'},
324
    categoryname    => $patron->category->description,
325
    primary_contact_method  => $data->{'primary_contact_method'},
322
    was_renewed     => scalar $input->param('was_renewed') ? 1 : 0,
326
    was_renewed     => scalar $input->param('was_renewed') ? 1 : 0,
323
    todaysdate      => output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }),
327
    todaysdate      => output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }),
324
    totalprice      => sprintf("%.2f", $totalprice),
328
    totalprice      => sprintf("%.2f", $totalprice),
(-)a/opac/opac-memberentry.pl (-1 / +13 lines)
Lines 94-99 $template->param( Link Here
94
    libraries         => \@libraries,
94
    libraries         => \@libraries,
95
    OPACPatronDetails => C4::Context->preference('OPACPatronDetails'),
95
    OPACPatronDetails => C4::Context->preference('OPACPatronDetails'),
96
);
96
);
97
my $check_BorrowerMandatoryField=C4::Context->preference("BorrowerMandatoryField");
98
        my @field_check=split(/\|/,$check_BorrowerMandatoryField);
99
        my @contactprincipalloop;
100
        my @fieldArray = qw(phone phonepro mobile email emailpro fax);
101
        foreach my $field (@fieldArray) {
102
           if ( !(grep { $field eq $_ } @field_check)){
103
                push @contactprincipalloop,{
104
                    'currentis_' . $field => 1
105
                };
106
            }
107
        }
108
109
        $template->param('contactprincipalloop' => \@contactprincipalloop);
97
110
98
my $attributes = ParsePatronAttributes($borrowernumber,$cgi);
111
my $attributes = ParsePatronAttributes($borrowernumber,$cgi);
99
my $conflicting_attribute = 0;
112
my $conflicting_attribute = 0;
100
- 

Return to bug 11879