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 (-1 / +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 575-580 __PACKAGE__->add_columns( Link Here
575
    default_value => \"current_timestamp",
575
    default_value => \"current_timestamp",
576
    is_nullable => 0,
576
    is_nullable => 0,
577
  },
577
  },
578
  "primary_contact_method",
579
  { data_type => "varchar", is_nullable => 1, size => 45 },
578
);
580
);
579
581
580
582
(-)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;
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 619-624 CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrower Link Here
619
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history  KEY `borrowernumber` (`borrowernumber`),
619
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history  KEY `borrowernumber` (`borrowernumber`),
620
  `privacy_guarantor_checkouts` tinyint(1) NOT NULL DEFAULT '0', -- controls if relatives can see this patron's checkouts
620
  `privacy_guarantor_checkouts` tinyint(1) NOT NULL DEFAULT '0', -- controls if relatives can see this patron's checkouts
621
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- time of last change could be useful for synchronization with external systems (among others)
621
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- time of last change could be useful for synchronization with external systems (among others)
622
  `primary_contact_method` varchar(45) DEFAULT NULL, --  useful for reporting purposes
622
  KEY borrowernumber (borrowernumber),
623
  KEY borrowernumber (borrowernumber),
623
  KEY `cardnumber` (`cardnumber`),
624
  KEY `cardnumber` (`cardnumber`),
624
  KEY `sms_provider_id` (`sms_provider_id`)
625
  KEY `sms_provider_id` (`sms_provider_id`)
Lines 3376-3381 CREATE TABLE IF NOT EXISTS `borrower_modifications` ( Link Here
3376
  `altcontactphone` varchar(50) DEFAULT NULL,
3377
  `altcontactphone` varchar(50) DEFAULT NULL,
3377
  `smsalertnumber` varchar(50) DEFAULT NULL,
3378
  `smsalertnumber` varchar(50) DEFAULT NULL,
3378
  `privacy` int(11) DEFAULT NULL,
3379
  `privacy` int(11) DEFAULT NULL,
3380
  `primary_contact_method` varchar(45) DEFAULT NULL, --  useful for reporting purposes
3379
  PRIMARY KEY (`verification_token`,`borrowernumber`),
3381
  PRIMARY KEY (`verification_token`,`borrowernumber`),
3380
  KEY `verification_token` (`verification_token`),
3382
  KEY `verification_token` (`verification_token`),
3381
  KEY `borrowernumber` (`borrowernumber`)
3383
  KEY `borrowernumber` (`borrowernumber`)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-2 / +56 lines)
Lines 473-480 $(document).ready(function() { Link Here
473
        <input type="text" id="fax" name="fax" value="[% fax %]" />
473
        <input type="text" id="fax" name="fax" value="[% fax %]" />
474
	  [% IF ( mandatoryfax ) %]<span class="required">Required</span>[% END %]
474
	  [% IF ( mandatoryfax ) %]<span class="required">Required</span>[% END %]
475
    </li>
475
    </li>
476
        [% END %]
476
477
	</ol>
477
    
478
479
   [% END %]
480
    <li>
481
       <label for="primary_contact_method">Main Contact Method</label>
482
       <select id="primary_contact_method" name="primary_contact_method">
483
       <option value=""></option>
484
         [% FOREACH contactprincipalloo IN contactprincipalloop %]
485
            [% IF ( contactprincipalloo.currentis_phone ) %]
486
               [% IF ( primary_contact_method == 'phone' ) %]
487
                 <option value="phone" selected="selected">Primary phone</option>
488
               [% ELSE %]
489
                 <option value="phone">Primary phone</option>
490
               [% END %]
491
            [% END %]
492
            [% IF ( contactprincipalloo.currentis_phonepro ) %]
493
               [% IF ( primary_contact_method == 'phonepro' ) %]
494
                 <option value="phonepro" selected="selected">Secondary phone</option>
495
               [% ELSE %]
496
                 <option value="phonepro">Secondary phone</option>
497
               [% END %]
498
            [% END %]
499
            [% IF ( contactprincipalloo.currentis_mobile ) %]
500
               [% IF ( primary_contact_method == 'mobile' ) %]
501
                 <option value="mobile" selected="selected">Other phone</option>
502
               [% ELSE %]
503
                 <option value="mobile">Other phone</option>
504
               [% END %]
505
            [% END %]
506
            [% IF ( contactprincipalloo.currentis_email ) %]
507
               [% IF ( primary_contact_method == 'email' ) %]
508
                 <option value="email" selected="selected">Primary email</option>
509
               [% ELSE %]
510
                 <option value="email">Primary email</option>
511
               [% END %]
512
            [% END %]
513
            [% IF ( contactprincipalloo.currentis_emailpro ) %]
514
               [% IF ( primary_contact_method == 'emailpro' ) %]
515
                 <option value="emailpro" selected="selected">Secondary email</option>
516
               [% ELSE %]
517
                 <option value="emailpro">Secondary email</option>
518
               [% END %]
519
            [% END %]
520
            [% IF ( contactprincipalloo.currentis_fax ) %]
521
               [% IF ( primary_contact_method == 'fax' ) %]
522
                 <option value="fax" selected="selected">Fax</option>
523
               [% ELSE %]
524
                 <option value="fax">Fax</option>
525
               [% END %]
526
            [% END %]
527
         [% END %]
528
       </select>
529
    </li>
530
    </ol>
531
478
  </fieldset>
532
  </fieldset>
479
[%END # hide fieldset %]
533
[%END # hide fieldset %]
480
534
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt (+50 lines)
Lines 542-547 Link Here
542
                                    [% IF mandatory.defined('fax') %]<span class="required">Required</span>[% END %]
542
                                    [% IF mandatory.defined('fax') %]<span class="required">Required</span>[% END %]
543
                                </li>
543
                                </li>
544
                            [% END %]
544
                            [% END %]
545
                            <li>
546
                               <label for="borrower_primary_contact_method">Main Contact Method</label>
547
                               <select id="borrower_primary_contact_method" name="borrower_primary_contact_method">
548
                               <option value=""></option>
549
                                 [% FOREACH contactprincipalloo IN contactprincipalloop %]
550
                                    [% IF ( contactprincipalloo.currentis_phone ) %]
551
                                       [% IF ( borrower.primary_contact_method == 'phone' ) %]
552
                                         <option value="phone" selected="selected">Primary phone</option>
553
                                       [% ELSE %]
554
                                         <option value="phone">Primary phone</option>
555
                                       [% END %]
556
                                    [% END %]
557
                                    [% IF ( contactprincipalloo.currentis_phonepro ) %]
558
                                       [% IF ( borrower.primary_contact_method == 'phonepro' ) %]
559
                                         <option value="phonepro" selected="selected">Secondary phone</option>
560
                                       [% ELSE %]
561
                                         <option value="phonepro">Secondary phone</option>
562
                                       [% END %]
563
                                    [% END %]
564
                                    [% IF ( contactprincipalloo.currentis_mobile ) %]
565
                                       [% IF ( borrower.primary_contact_method == 'mobile' ) %]
566
                                         <option value="mobile" selected="selected">Other phone</option>
567
                                       [% ELSE %]
568
                                         <option value="mobile">Other phone</option>
569
                                       [% END %]
570
                                    [% END %]
571
                                    [% IF ( contactprincipalloo.currentis_email ) %]
572
                                       [% IF ( borrower.primary_contact_method == 'email' ) %]
573
                                         <option value="email" selected="selected">Primary email</option>
574
                                       [% ELSE %]
575
                                         <option value="email">Primary email</option>
576
                                       [% END %]
577
                                    [% END %]
578
                                    [% IF ( contactprincipalloo.currentis_emailpro ) %]
579
                                       [% IF ( borrower.primary_contact_method == 'emailpro' ) %]
580
                                         <option value="emailpro" selected="selected">Secondary email</option>
581
                                       [% ELSE %]
582
                                         <option value="emailpro">Secondary email</option>
583
                                       [% END %]
584
                                    [% END %]
585
                                    [% IF ( contactprincipalloo.currentis_fax ) %]
586
                                       [% IF ( borrower.primary_contact_method == 'fax' ) %]
587
                                         <option value="fax" selected="selected">Fax</option>
588
                                       [% ELSE %]
589
                                         <option value="fax">Fax</option>
590
                                       [% END %]
591
                                    [% END %]
592
                                 [% END %]
593
                               </select>
594
                            </li>
545
                        </ol>
595
                        </ol>
546
                    </fieldset>
596
                    </fieldset>
547
                [% END %]
597
                [% END %]
(-)a/members/memberentry.pl (-1 lines)
Lines 544-550 $template->param( Link Here
544
    roadtypes => $roadtypes,
544
    roadtypes => $roadtypes,
545
    cities    => $cities,
545
    cities    => $cities,
546
);
546
);
547
548
my $default_borrowertitle = '';
547
my $default_borrowertitle = '';
549
unless ( $op eq 'duplicate' ) { $default_borrowertitle=$data{'title'} }
548
unless ( $op eq 'duplicate' ) { $default_borrowertitle=$data{'title'} }
550
my($borrowertitle)=GetTitles();
549
my($borrowertitle)=GetTitles();
(-)a/opac/opac-memberentry.pl (-1 / +13 lines)
Lines 71-76 $template->param( Link Here
71
    branches          => GetBranchesLoop(),
71
    branches          => GetBranchesLoop(),
72
    OPACPatronDetails => C4::Context->preference('OPACPatronDetails'),
72
    OPACPatronDetails => C4::Context->preference('OPACPatronDetails'),
73
);
73
);
74
my $check_BorrowerMandatoryField=C4::Context->preference("BorrowerMandatoryField");
75
        my @field_check=split(/\|/,$check_BorrowerMandatoryField);
76
        my @contactprincipalloop;
77
        my @fieldArray = qw(phone phonepro mobile email emailpro fax);
78
        foreach my $field (@fieldArray) {
79
           if ( !(grep { $field eq $_ } @field_check)){
80
                push @contactprincipalloop,{
81
                    'currentis_' . $field => 1
82
                };
83
            }
84
        }
85
86
        $template->param('contactprincipalloop' => \@contactprincipalloop);
74
87
75
if ( $action eq 'create' ) {
88
if ( $action eq 'create' ) {
76
89
77
- 

Return to bug 11879