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

(-)a/Koha/Schema/Result/BorrowerModification.pm (+9 lines)
Lines 406-411 __PACKAGE__->table("borrower_modifications"); Link Here
406
406
407
=cut
407
=cut
408
408
409
=head2 primary_contact_method
410
411
  data_type: 'tinyint'
412
  default_value: 0
413
  is_nullable: 0
414
415
=cut
409
__PACKAGE__->add_columns(
416
__PACKAGE__->add_columns(
410
  "timestamp",
417
  "timestamp",
411
  {
418
  {
Lines 566-571 __PACKAGE__->add_columns( Link Here
566
  { data_type => "varchar", is_nullable => 1, size => 50 },
573
  { data_type => "varchar", is_nullable => 1, size => 50 },
567
  "privacy",
574
  "privacy",
568
  { data_type => "integer", is_nullable => 1 },
575
  { data_type => "integer", is_nullable => 1 },
576
  "primary_contact_method",
577
  { data_type => "varchar", is_nullable => 1, size => 45 },
569
);
578
);
570
579
571
=head1 PRIMARY KEY
580
=head1 PRIMARY KEY
(-)a/Koha/Schema/Result/Deletedborrower.pm (-3 / +3 lines)
Lines 398-404 __PACKAGE__->table("deletedborrowers"); Link Here
398
  default_value: 1
398
  default_value: 1
399
  is_nullable: 0
399
  is_nullable: 0
400
400
401
=head2 privacy_guarantor_checkouts
401
=head2 primary_contact_method
402
402
403
  data_type: 'tinyint'
403
  data_type: 'tinyint'
404
  default_value: 0
404
  default_value: 0
Lines 559-566 __PACKAGE__->add_columns( Link Here
559
  { data_type => "integer", is_nullable => 1 },
559
  { data_type => "integer", is_nullable => 1 },
560
  "privacy",
560
  "privacy",
561
  { data_type => "integer", default_value => 1, is_nullable => 0 },
561
  { data_type => "integer", default_value => 1, is_nullable => 0 },
562
  "privacy_guarantor_checkouts",
562
  "primary_contact_method",
563
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
563
  { data_type => "varchar", is_nullable => 1, size => 45 },
564
);
564
);
565
565
566
566
(-)a/installer/data/mysql/atomicupdate/borrowers_primary_contact_method.sql (-1 / +3 lines)
Line 1 Link Here
1
ALTER TABLE `borrowers` ADD COLUMN `primary_contact_method` VARCHAR(45) NULL DEFAULT NULL;
1
ALTER TABLE `borrowers` ADD COLUMN `primary_contact_method` VARCHAR(45) NULL DEFAULT NULL;
2
ALTER TABLE `deletedborrowers` ADD COLUMN `primary_contact_method` VARCHAR(45) NULL DEFAULT NULL;
3
ALTER TABLE `borrower_modifications` ADD COLUMN `primary_contact_method` VARCHAR(45) NULL DEFAULT NULL;
(-)a/installer/data/mysql/kohastructure.sql (+2 lines)
Lines 918-923 CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrower Link Here
918
  `sms_provider_id` int(11) DEFAULT NULL, -- the provider of the mobile phone number defined in smsalertnumber
918
  `sms_provider_id` int(11) DEFAULT NULL, -- the provider of the mobile phone number defined in smsalertnumber
919
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history  KEY `borrowernumber` (`borrowernumber`),
919
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history  KEY `borrowernumber` (`borrowernumber`),
920
  `privacy_guarantor_checkouts` tinyint(1) NOT NULL DEFAULT '0', -- controls if relatives can see this patron's checkouts
920
  `privacy_guarantor_checkouts` tinyint(1) NOT NULL DEFAULT '0', -- controls if relatives can see this patron's checkouts
921
  `primary_contact_method` varchar(45) DEFAULT NULL, --  useful for reporting purposes
921
  KEY borrowernumber (borrowernumber),
922
  KEY borrowernumber (borrowernumber),
922
  KEY `cardnumber` (`cardnumber`),
923
  KEY `cardnumber` (`cardnumber`),
923
  KEY `sms_provider_id` (`sms_provider_id`)
924
  KEY `sms_provider_id` (`sms_provider_id`)
Lines 3383-3388 CREATE TABLE IF NOT EXISTS `borrower_modifications` ( Link Here
3383
  `altcontactphone` varchar(50) DEFAULT NULL,
3384
  `altcontactphone` varchar(50) DEFAULT NULL,
3384
  `smsalertnumber` varchar(50) DEFAULT NULL,
3385
  `smsalertnumber` varchar(50) DEFAULT NULL,
3385
  `privacy` int(11) DEFAULT NULL,
3386
  `privacy` int(11) DEFAULT NULL,
3387
  `primary_contact_method` varchar(45) DEFAULT NULL, --  useful for reporting purposes
3386
  PRIMARY KEY (`verification_token`,`borrowernumber`),
3388
  PRIMARY KEY (`verification_token`,`borrowernumber`),
3387
  KEY `verification_token` (`verification_token`),
3389
  KEY `verification_token` (`verification_token`),
3388
  KEY `borrowernumber` (`borrowernumber`)
3390
  KEY `borrowernumber` (`borrowernumber`)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-2 / +2 lines)
Lines 488-496 Link Here
488
            [% END %]
488
            [% END %]
489
            [% IF ( contactprincipalloo.currentis_mobile ) %]
489
            [% IF ( contactprincipalloo.currentis_mobile ) %]
490
               [% IF ( primary_contact_method == 'mobile' ) %]
490
               [% IF ( primary_contact_method == 'mobile' ) %]
491
                 <option value="mobile" selected="selected">Mobile phone</option>
491
                 <option value="mobile" selected="selected">Other phone</option>
492
               [% ELSE %]
492
               [% ELSE %]
493
                 <option value="mobile">Mobile phone</option>
493
                 <option value="mobile">Other phone</option>
494
               [% END %]
494
               [% END %]
495
            [% END %]
495
            [% END %]
496
            [% IF ( contactprincipalloo.currentis_email ) %]
496
            [% IF ( contactprincipalloo.currentis_email ) %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt (+50 lines)
Lines 498-503 Link Here
498
                                    [% IF mandatory.defined('fax') %]<span class="required">Required</span>[% END %]
498
                                    [% IF mandatory.defined('fax') %]<span class="required">Required</span>[% END %]
499
                                </li>
499
                                </li>
500
                            [% END %]
500
                            [% END %]
501
                            <li>
502
                               <label for="borrower_primary_contact_method">Main Contact Method</label>
503
                               <select id="borrower_primary_contact_method" name="borrower_primary_contact_method">
504
                               <option value=""></option>
505
                                 [% FOREACH contactprincipalloo IN contactprincipalloop %]
506
                                    [% IF ( contactprincipalloo.currentis_phone ) %]
507
                                       [% IF ( borrower.primary_contact_method == 'phone' ) %]
508
                                         <option value="phone" selected="selected">Primary phone</option>
509
                                       [% ELSE %]
510
                                         <option value="phone">Primary phone</option>
511
                                       [% END %]
512
                                    [% END %]
513
                                    [% IF ( contactprincipalloo.currentis_phonepro ) %]
514
                                       [% IF ( borrower.primary_contact_method == 'phonepro' ) %]
515
                                         <option value="phonepro" selected="selected">Secondary phone</option>
516
                                       [% ELSE %]
517
                                         <option value="phonepro">Secondary phone</option>
518
                                       [% END %]
519
                                    [% END %]
520
                                    [% IF ( contactprincipalloo.currentis_mobile ) %]
521
                                       [% IF ( borrower.primary_contact_method == 'mobile' ) %]
522
                                         <option value="mobile" selected="selected">Other phone</option>
523
                                       [% ELSE %]
524
                                         <option value="mobile">Other phone</option>
525
                                       [% END %]
526
                                    [% END %]
527
                                    [% IF ( contactprincipalloo.currentis_email ) %]
528
                                       [% IF ( borrower.primary_contact_method == 'email' ) %]
529
                                         <option value="email" selected="selected">Primary email</option>
530
                                       [% ELSE %]
531
                                         <option value="email">Primary email</option>
532
                                       [% END %]
533
                                    [% END %]
534
                                    [% IF ( contactprincipalloo.currentis_emailpro ) %]
535
                                       [% IF ( borrower.primary_contact_method == 'emailpro' ) %]
536
                                         <option value="emailpro" selected="selected">Secondary email</option>
537
                                       [% ELSE %]
538
                                         <option value="emailpro">Secondary email</option>
539
                                       [% END %]
540
                                    [% END %]
541
                                    [% IF ( contactprincipalloo.currentis_fax ) %]
542
                                       [% IF ( borrower.primary_contact_method == 'fax' ) %]
543
                                         <option value="fax" selected="selected">Fax</option>
544
                                       [% ELSE %]
545
                                         <option value="fax">Fax</option>
546
                                       [% END %]
547
                                    [% END %]
548
                                 [% END %]
549
                               </select>
550
                            </li>
501
                        </ol>
551
                        </ol>
502
                    </fieldset>
552
                    </fieldset>
503
                [% END %]
553
                [% END %]
(-)a/members/memberentry.pl (-7 lines)
Lines 548-560 foreach my $field (@fieldArray) { Link Here
548
}
548
}
549
$template->param('contactprincipalloop' => \@contactprincipalloop);
549
$template->param('contactprincipalloop' => \@contactprincipalloop);
550
550
551
my $cities = Koha::Cities->search( {}, { order_by => 'city_name' } );
552
my $roadtypes = C4::Koha::GetAuthorisedValues( 'ROADTYPE', $data{streettype} );
553
$template->param(
554
    roadtypes => $roadtypes,
555
    cities    => $cities,
556
);
557
558
my $default_borrowertitle = '';
551
my $default_borrowertitle = '';
559
unless ( $op eq 'duplicate' ) { $default_borrowertitle=$data{'title'} }
552
unless ( $op eq 'duplicate' ) { $default_borrowertitle=$data{'title'} }
560
my($borrowertitle)=GetTitles();
553
my($borrowertitle)=GetTitles();
(-)a/opac/opac-memberentry.pl (-1 / +13 lines)
Lines 70-75 $template->param( Link Here
70
    branches          => GetBranchesLoop(),
70
    branches          => GetBranchesLoop(),
71
    OPACPatronDetails => C4::Context->preference('OPACPatronDetails'),
71
    OPACPatronDetails => C4::Context->preference('OPACPatronDetails'),
72
);
72
);
73
my $check_BorrowerMandatoryField=C4::Context->preference("BorrowerMandatoryField");
74
        my @field_check=split(/\|/,$check_BorrowerMandatoryField);
75
        my @contactprincipalloop;
76
        my @fieldArray = qw(phone phonepro mobile email emailpro fax);
77
        foreach my $field (@fieldArray) {
78
           if ( !(grep { $field eq $_ } @field_check)){
79
                push @contactprincipalloop,{
80
                    'currentis_' . $field => 1
81
                };
82
            }
83
        }
84
85
        $template->param('contactprincipalloop' => \@contactprincipalloop);
73
86
74
if ( $action eq 'create' ) {
87
if ( $action eq 'create' ) {
75
88
76
- 

Return to bug 11879