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 642-647 CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrower Link Here
642
  `lang` varchar(25) NOT NULL default 'default', -- lang to use to send notices to this patron
642
  `lang` varchar(25) NOT NULL default 'default', -- lang to use to send notices to this patron
643
  `login_attempts` int(4) default 0, -- number of failed login attemps
643
  `login_attempts` int(4) default 0, -- number of failed login attemps
644
  `overdrive_auth_token` MEDIUMTEXT default NULL, -- persist OverDrive auth token
644
  `overdrive_auth_token` MEDIUMTEXT default NULL, -- persist OverDrive auth token
645
  `primary_contact_method` varchar(45) DEFAULT NULL, --  useful for reporting purposes
645
  KEY borrowernumber (borrowernumber),
646
  KEY borrowernumber (borrowernumber),
646
  KEY `cardnumber` (`cardnumber`),
647
  KEY `cardnumber` (`cardnumber`),
647
  KEY `sms_provider_id` (`sms_provider_id`)
648
  KEY `sms_provider_id` (`sms_provider_id`)
Lines 1674-1679 CREATE TABLE `borrowers` ( -- this table includes information about your patrons Link Here
1674
  `lang` varchar(25) NOT NULL default 'default', -- lang to use to send notices to this patron
1675
  `lang` varchar(25) NOT NULL default 'default', -- lang to use to send notices to this patron
1675
  `login_attempts` int(4) default 0, -- number of failed login attemps
1676
  `login_attempts` int(4) default 0, -- number of failed login attemps
1676
  `overdrive_auth_token` MEDIUMTEXT default NULL, -- persist OverDrive auth token
1677
  `overdrive_auth_token` MEDIUMTEXT default NULL, -- persist OverDrive auth token
1678
  `primary_contact_method` varchar(45) DEFAULT NULL, --  useful for reporting purposes
1677
  UNIQUE KEY `cardnumber` (`cardnumber`),
1679
  UNIQUE KEY `cardnumber` (`cardnumber`),
1678
  PRIMARY KEY `borrowernumber` (`borrowernumber`),
1680
  PRIMARY KEY `borrowernumber` (`borrowernumber`),
1679
  KEY `categorycode` (`categorycode`),
1681
  KEY `categorycode` (`categorycode`),
Lines 3484-3489 CREATE TABLE IF NOT EXISTS `borrower_modifications` ( Link Here
3484
  `privacy` int(11) DEFAULT NULL,
3486
  `privacy` int(11) DEFAULT NULL,
3485
  `extended_attributes` MEDIUMTEXT DEFAULT NULL,
3487
  `extended_attributes` MEDIUMTEXT DEFAULT NULL,
3486
  `gdpr_proc_consent` datetime, -- data processing consent
3488
  `gdpr_proc_consent` datetime, -- data processing consent
3489
  `primary_contact_method` varchar(45) DEFAULT NULL, --  useful for reporting purposes
3487
  PRIMARY KEY (`verification_token` (191),`borrowernumber`),
3490
  PRIMARY KEY (`verification_token` (191),`borrowernumber`),
3488
  KEY `verification_token` (`verification_token` (191)),
3491
  KEY `verification_token` (`verification_token` (191)),
3489
  KEY `borrowernumber` (`borrowernumber`)
3492
  KEY `borrowernumber` (`borrowernumber`)
(-)a/installer/data/mysql/updatedatabase.pl (+1 lines)
Lines 17263-17268 foreach my $file ( sort readdir $dirh ) { Link Here
17263
    }
17263
    }
17264
}
17264
}
17265
17265
17266
17266
=head1 FUNCTIONS
17267
=head1 FUNCTIONS
17267
17268
17268
=head2 TableExists($table)
17269
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-4 / +57 lines)
Lines 430-436 Link Here
430
430
431
[% UNLESS nophone && nophonepro && nomobile && noemail && noemailpro && nofax %]
431
[% UNLESS nophone && nophonepro && nomobile && noemail && noemailpro && nofax %]
432
  <fieldset class="rows" id="memberentry_contact">
432
  <fieldset class="rows" id="memberentry_contact">
433
    <legend id="contact_lgd">Contact</legend><ol>
433
    <legend id="contact_lgd">Contact</legend>
434
<ol>
434
        [% UNLESS nophone %]
435
        [% UNLESS nophone %]
435
      <li>
436
      <li>
436
      [% IF ( mandatoryphone ) %]
437
      [% IF ( mandatoryphone ) %]
Lines 493-499 Link Here
493
	  [% IF ( mandatoryemailpro ) %]<span class="required">Required</span>[% END %]
494
	  [% IF ( mandatoryemailpro ) %]<span class="required">Required</span>[% END %]
494
    </li>
495
    </li>
495
        [% END %]
496
        [% END %]
496
        [% UNLESS nofax %]
497
    [% UNLESS nofax %]
497
    <li>
498
    <li>
498
      [% IF ( mandatoryfax ) %]
499
      [% IF ( mandatoryfax ) %]
499
      <label for="fax" class="required">
500
      <label for="fax" class="required">
Lines 504-511 Link Here
504
        <input type="text" id="fax" name="fax" value="[% fax | html %]" />
505
        <input type="text" id="fax" name="fax" value="[% fax | html %]" />
505
	  [% IF ( mandatoryfax ) %]<span class="required">Required</span>[% END %]
506
	  [% IF ( mandatoryfax ) %]<span class="required">Required</span>[% END %]
506
    </li>
507
    </li>
507
        [% END %]
508
508
	</ol>
509
   [% END %]
510
    <li>
511
       <label for="primary_contact_method">Main contact method:</label>
512
       <select id="primary_contact_method" name="primary_contact_method">
513
       <option value=""></option>
514
         [% FOREACH contactprincipalloo IN contactprincipalloop %]
515
            [% IF ( contactprincipalloo.currentis_phone ) %]
516
               [% IF ( primary_contact_method == 'phone' ) %]
517
                 <option value="phone" selected="selected">Primary phone</option>
518
               [% ELSE %]
519
                 <option value="phone">Primary phone</option>
520
               [% END %]
521
            [% END %]
522
            [% IF ( contactprincipalloo.currentis_phonepro ) %]
523
               [% IF ( primary_contact_method == 'phonepro' ) %]
524
                 <option value="phonepro" selected="selected">Secondary phone</option>
525
               [% ELSE %]
526
                 <option value="phonepro">Secondary phone</option>
527
               [% END %]
528
            [% END %]
529
            [% IF ( contactprincipalloo.currentis_mobile ) %]
530
               [% IF ( primary_contact_method == 'mobile' ) %]
531
                 <option value="mobile" selected="selected">Other phone</option>
532
               [% ELSE %]
533
                 <option value="mobile">Other phone</option>
534
               [% END %]
535
            [% END %]
536
            [% IF ( contactprincipalloo.currentis_email ) %]
537
               [% IF ( primary_contact_method == 'email' ) %]
538
                 <option value="email" selected="selected">Primary email</option>
539
               [% ELSE %]
540
                 <option value="email">Primary email</option>
541
               [% END %]
542
            [% END %]
543
            [% IF ( contactprincipalloo.currentis_emailpro ) %]
544
               [% IF ( primary_contact_method == 'emailpro' ) %]
545
                 <option value="emailpro" selected="selected">Secondary email</option>
546
               [% ELSE %]
547
                 <option value="emailpro">Secondary email</option>
548
               [% END %]
549
            [% END %]
550
            [% IF ( contactprincipalloo.currentis_fax ) %]
551
               [% IF ( primary_contact_method == 'fax' ) %]
552
                 <option value="fax" selected="selected">Fax</option>
553
               [% ELSE %]
554
                 <option value="fax">Fax</option>
555
               [% END %]
556
            [% END %]
557
         [% END %]
558
       </select>
559
    </li>
560
    </ol>
561
509
  </fieldset>
562
  </fieldset>
510
[%END # hide fieldset %]
563
[%END # hide fieldset %]
511
564
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (+15 lines)
Lines 249-254 Link Here
249
                                                [% END %]
249
                                                [% END %]
250
                                            </li>
250
                                            </li>
251
                                        [% END %]
251
                                        [% END %]
252
253
                                        [% SWITCH primary_contact_method %]
254
                                        [% CASE 'phone' %]
255
                                        <li><span class="label">Main contact method: </span>Phone</li>
256
                                        [% CASE 'phonepro' %]
257
                                        <li><span class="label">Main contact method: </span>Secondary phone</li>
258
                                        [% CASE 'mobile' %]
259
                                        <li><span class="label">Main contact method: </span>Other Phone</li>
260
                                        [% CASE 'email' %]
261
                                        <li><span class="label">Main contact method: </span>Primary email</li>
262
                                        [% CASE 'emailpro' %]
263
                                        <li><span class="label">Main contact method: </span>Secondary email</li>
264
                                        [% CASE 'fax' %]
265
                                        <li><span class="label">Main contact method: </span>Fax</li>
266
                                        [% END %]
252
                                    </ol>
267
                                    </ol>
253
                                </div> [% # /div.rows %]
268
                                </div> [% # /div.rows %]
254
                            </div> [% # /div#patron-information %]
269
                            </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 640-645 $template->param('typeloop' => \@typeloop, Link Here
640
        no_categories => $no_categories);
640
        no_categories => $no_categories);
641
if($no_categories){ $no_add = 1; }
641
if($no_categories){ $no_add = 1; }
642
642
643
my @contactprincipalloop;
644
my @fieldArray = qw(phone phonepro mobile email emailpro fax);
645
foreach my $field (@fieldArray) {
646
   if ( !(grep { $field eq $_ } @field_check)){
647
        push @contactprincipalloop,{
648
            'currentis_' . $field => 1
649
        };
650
    }
651
}
652
$template->param('contactprincipalloop' => \@contactprincipalloop);
643
653
644
my $cities = Koha::Cities->search( {}, { order_by => 'city_name' } );
654
my $cities = Koha::Cities->search( {}, { order_by => 'city_name' } );
645
my $roadtypes = C4::Koha::GetAuthorisedValues( 'ROADTYPE' );
655
my $roadtypes = C4::Koha::GetAuthorisedValues( 'ROADTYPE' );
Lines 647-653 $template->param( Link Here
647
    roadtypes => $roadtypes,
657
    roadtypes => $roadtypes,
648
    cities    => $cities,
658
    cities    => $cities,
649
);
659
);
650
651
my $default_borrowertitle = '';
660
my $default_borrowertitle = '';
652
unless ( $op eq 'duplicate' ) { $default_borrowertitle=$data{'title'} }
661
unless ( $op eq 'duplicate' ) { $default_borrowertitle=$data{'title'} }
653
662
(-)a/members/moremember.pl (+4 lines)
Lines 313-318 $template->param( Link Here
313
    patron          => $patron,
313
    patron          => $patron,
314
    translated_language => $translated_language,
314
    translated_language => $translated_language,
315
    detailview      => 1,
315
    detailview      => 1,
316
    borrowernumber  => $borrowernumber,
317
    othernames      => $data->{'othernames'},
318
    categoryname    => $patron->category->description,
319
    primary_contact_method  => $data->{'primary_contact_method'},
316
    was_renewed     => scalar $input->param('was_renewed') ? 1 : 0,
320
    was_renewed     => scalar $input->param('was_renewed') ? 1 : 0,
317
    todaysdate      => output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }),
321
    todaysdate      => output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }),
318
    totalprice      => sprintf("%.2f", $totalprice),
322
    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