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 589-594 __PACKAGE__->add_columns( Link Here
589
    default_value => \"current_timestamp",
589
    default_value => \"current_timestamp",
590
    is_nullable => 0,
590
    is_nullable => 0,
591
  },
591
  },
592
  "primary_contact_method",
593
  { data_type => "varchar", is_nullable => 1, size => 45 },
592
);
594
);
593
595
594
596
(-)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 621-626 CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrower Link Here
621
  `privacy_guarantor_checkouts` tinyint(1) NOT NULL DEFAULT '0', -- controls if relatives can see this patron's checkouts
621
  `privacy_guarantor_checkouts` tinyint(1) NOT NULL DEFAULT '0', -- controls if relatives can see this patron's checkouts
622
  `checkprevcheckout` varchar(7) NOT NULL default 'inherit', -- produce a warning for this patron if this item has previously been checked out to this patron if 'yes', not if 'no', defer to category setting if 'inherit'.
622
  `checkprevcheckout` varchar(7) NOT NULL default 'inherit', -- produce a warning for this patron if this item has previously been checked out to this patron if 'yes', not if 'no', defer to category setting if 'inherit'.
623
  `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)
623
  `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)
624
  `primary_contact_method` varchar(45) DEFAULT NULL, --  useful for reporting purposes
624
  KEY borrowernumber (borrowernumber),
625
  KEY borrowernumber (borrowernumber),
625
  KEY `cardnumber` (`cardnumber`),
626
  KEY `cardnumber` (`cardnumber`),
626
  KEY `sms_provider_id` (`sms_provider_id`)
627
  KEY `sms_provider_id` (`sms_provider_id`)
Lines 3390-3395 CREATE TABLE IF NOT EXISTS `borrower_modifications` ( Link Here
3390
  `altcontactphone` varchar(50) DEFAULT NULL,
3391
  `altcontactphone` varchar(50) DEFAULT NULL,
3391
  `smsalertnumber` varchar(50) DEFAULT NULL,
3392
  `smsalertnumber` varchar(50) DEFAULT NULL,
3392
  `privacy` int(11) DEFAULT NULL,
3393
  `privacy` int(11) DEFAULT NULL,
3394
  `primary_contact_method` varchar(45) DEFAULT NULL, --  useful for reporting purposes
3393
  PRIMARY KEY (`verification_token`,`borrowernumber`),
3395
  PRIMARY KEY (`verification_token`,`borrowernumber`),
3394
  KEY `verification_token` (`verification_token`),
3396
  KEY `verification_token` (`verification_token`),
3395
  KEY `borrowernumber` (`borrowernumber`)
3397
  KEY `borrowernumber` (`borrowernumber`)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-2 / +56 lines)
Lines 565-572 $(document).ready(function() { Link Here
565
        <input type="text" id="fax" name="fax" value="[% fax %]" />
565
        <input type="text" id="fax" name="fax" value="[% fax %]" />
566
	  [% IF ( mandatoryfax ) %]<span class="required">Required</span>[% END %]
566
	  [% IF ( mandatoryfax ) %]<span class="required">Required</span>[% END %]
567
    </li>
567
    </li>
568
        [% END %]
568
569
	</ol>
569
570
571
   [% END %]
572
    <li>
573
       <label for="primary_contact_method">Main Contact Method</label>
574
       <select id="primary_contact_method" name="primary_contact_method">
575
       <option value=""></option>
576
         [% FOREACH contactprincipalloo IN contactprincipalloop %]
577
            [% IF ( contactprincipalloo.currentis_phone ) %]
578
               [% IF ( primary_contact_method == 'phone' ) %]
579
                 <option value="phone" selected="selected">Primary phone</option>
580
               [% ELSE %]
581
                 <option value="phone">Primary phone</option>
582
               [% END %]
583
            [% END %]
584
            [% IF ( contactprincipalloo.currentis_phonepro ) %]
585
               [% IF ( primary_contact_method == 'phonepro' ) %]
586
                 <option value="phonepro" selected="selected">Secondary phone</option>
587
               [% ELSE %]
588
                 <option value="phonepro">Secondary phone</option>
589
               [% END %]
590
            [% END %]
591
            [% IF ( contactprincipalloo.currentis_mobile ) %]
592
               [% IF ( primary_contact_method == 'mobile' ) %]
593
                 <option value="mobile" selected="selected">Other phone</option>
594
               [% ELSE %]
595
                 <option value="mobile">Other phone</option>
596
               [% END %]
597
            [% END %]
598
            [% IF ( contactprincipalloo.currentis_email ) %]
599
               [% IF ( primary_contact_method == 'email' ) %]
600
                 <option value="email" selected="selected">Primary email</option>
601
               [% ELSE %]
602
                 <option value="email">Primary email</option>
603
               [% END %]
604
            [% END %]
605
            [% IF ( contactprincipalloo.currentis_emailpro ) %]
606
               [% IF ( primary_contact_method == 'emailpro' ) %]
607
                 <option value="emailpro" selected="selected">Secondary email</option>
608
               [% ELSE %]
609
                 <option value="emailpro">Secondary email</option>
610
               [% END %]
611
            [% END %]
612
            [% IF ( contactprincipalloo.currentis_fax ) %]
613
               [% IF ( primary_contact_method == 'fax' ) %]
614
                 <option value="fax" selected="selected">Fax</option>
615
               [% ELSE %]
616
                 <option value="fax">Fax</option>
617
               [% END %]
618
            [% END %]
619
         [% END %]
620
       </select>
621
    </li>
622
    </ol>
623
570
  </fieldset>
624
  </fieldset>
571
[%END # hide fieldset %]
625
[%END # hide fieldset %]
572
626
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt (+50 lines)
Lines 543-548 Link Here
543
                                    [% IF mandatory.defined('fax') %]<span class="required">Required</span>[% END %]
543
                                    [% IF mandatory.defined('fax') %]<span class="required">Required</span>[% END %]
544
                                </li>
544
                                </li>
545
                            [% END %]
545
                            [% END %]
546
                            <li>
547
                               <label for="borrower_primary_contact_method">Main Contact Method</label>
548
                               <select id="borrower_primary_contact_method" name="borrower_primary_contact_method">
549
                               <option value=""></option>
550
                                 [% FOREACH contactprincipalloo IN contactprincipalloop %]
551
                                    [% IF ( contactprincipalloo.currentis_phone ) %]
552
                                       [% IF ( borrower.primary_contact_method == 'phone' ) %]
553
                                         <option value="phone" selected="selected">Primary phone</option>
554
                                       [% ELSE %]
555
                                         <option value="phone">Primary phone</option>
556
                                       [% END %]
557
                                    [% END %]
558
                                    [% IF ( contactprincipalloo.currentis_phonepro ) %]
559
                                       [% IF ( borrower.primary_contact_method == 'phonepro' ) %]
560
                                         <option value="phonepro" selected="selected">Secondary phone</option>
561
                                       [% ELSE %]
562
                                         <option value="phonepro">Secondary phone</option>
563
                                       [% END %]
564
                                    [% END %]
565
                                    [% IF ( contactprincipalloo.currentis_mobile ) %]
566
                                       [% IF ( borrower.primary_contact_method == 'mobile' ) %]
567
                                         <option value="mobile" selected="selected">Other phone</option>
568
                                       [% ELSE %]
569
                                         <option value="mobile">Other phone</option>
570
                                       [% END %]
571
                                    [% END %]
572
                                    [% IF ( contactprincipalloo.currentis_email ) %]
573
                                       [% IF ( borrower.primary_contact_method == 'email' ) %]
574
                                         <option value="email" selected="selected">Primary email</option>
575
                                       [% ELSE %]
576
                                         <option value="email">Primary email</option>
577
                                       [% END %]
578
                                    [% END %]
579
                                    [% IF ( contactprincipalloo.currentis_emailpro ) %]
580
                                       [% IF ( borrower.primary_contact_method == 'emailpro' ) %]
581
                                         <option value="emailpro" selected="selected">Secondary email</option>
582
                                       [% ELSE %]
583
                                         <option value="emailpro">Secondary email</option>
584
                                       [% END %]
585
                                    [% END %]
586
                                    [% IF ( contactprincipalloo.currentis_fax ) %]
587
                                       [% IF ( borrower.primary_contact_method == 'fax' ) %]
588
                                         <option value="fax" selected="selected">Fax</option>
589
                                       [% ELSE %]
590
                                         <option value="fax">Fax</option>
591
                                       [% END %]
592
                                    [% END %]
593
                                 [% END %]
594
                               </select>
595
                            </li>
546
                        </ol>
596
                        </ol>
547
                    </fieldset>
597
                    </fieldset>
548
                [% END %]
598
                [% END %]
(-)a/members/memberentry.pl (-1 lines)
Lines 543-549 $template->param( Link Here
543
    roadtypes => $roadtypes,
543
    roadtypes => $roadtypes,
544
    cities    => $cities,
544
    cities    => $cities,
545
);
545
);
546
547
my $default_borrowertitle = '';
546
my $default_borrowertitle = '';
548
unless ( $op eq 'duplicate' ) { $default_borrowertitle=$data{'title'} }
547
unless ( $op eq 'duplicate' ) { $default_borrowertitle=$data{'title'} }
549
548
(-)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