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 `privacy_guarantor_checkouts`;
2
ALTER TABLE `deletedborrowers` ADD COLUMN `primary_contact_method` VARCHAR(45) NULL DEFAULT NULL AFTER `privacy_guarantor_checkouts`;
3
ALTER TABLE `borrower_modifications` ADD COLUMN `primary_contact_method` VARCHAR(45) NULL DEFAULT NULL AFTER `privacy`;
(-)a/installer/data/mysql/kohastructure.sql (-2 / +3 lines)
Lines 632-638 CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrower Link Here
632
  `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'.
632
  `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'.
633
  `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)
633
  `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)
634
  `lastseen` datetime default NULL, -- last time a patron has been seed (connected at the OPAC or staff interface)
634
  `lastseen` datetime default NULL, -- last time a patron has been seed (connected at the OPAC or staff interface)
635
  `overdrive_auth_token` text default NULL, -- persist OverDrive auth token
635
  `primary_contact_method` varchar(45) DEFAULT NULL, --  useful for reporting purposes
636
  KEY borrowernumber (borrowernumber),
636
  KEY borrowernumber (borrowernumber),
637
  KEY `cardnumber` (`cardnumber`),
637
  KEY `cardnumber` (`cardnumber`),
638
  KEY `sms_provider_id` (`sms_provider_id`)
638
  KEY `sms_provider_id` (`sms_provider_id`)
Lines 1664-1670 CREATE TABLE `borrowers` ( -- this table includes information about your patrons Link Here
1664
  `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'.
1664
  `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'.
1665
  `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)
1665
  `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)
1666
  `lastseen` datetime default NULL, -- last time a patron has been seed (connected at the OPAC or staff interface)
1666
  `lastseen` datetime default NULL, -- last time a patron has been seed (connected at the OPAC or staff interface)
1667
  `overdrive_auth_token` text default NULL, -- persist OverDrive auth token
1667
  `primary_contact_method` varchar(45) DEFAULT NULL, --  useful for reporting purposes
1668
  UNIQUE KEY `cardnumber` (`cardnumber`),
1668
  UNIQUE KEY `cardnumber` (`cardnumber`),
1669
  PRIMARY KEY `borrowernumber` (`borrowernumber`),
1669
  PRIMARY KEY `borrowernumber` (`borrowernumber`),
1670
  KEY `categorycode` (`categorycode`),
1670
  KEY `categorycode` (`categorycode`),
Lines 3438-3443 CREATE TABLE IF NOT EXISTS `borrower_modifications` ( Link Here
3438
  `smsalertnumber` varchar(50) DEFAULT NULL,
3438
  `smsalertnumber` varchar(50) DEFAULT NULL,
3439
  `privacy` int(11) DEFAULT NULL,
3439
  `privacy` int(11) DEFAULT NULL,
3440
  `extended_attributes` text DEFAULT NULL,
3440
  `extended_attributes` text DEFAULT NULL,
3441
  `primary_contact_method` varchar(45) DEFAULT NULL, --  useful for reporting purposes
3441
  PRIMARY KEY (`verification_token`,`borrowernumber`),
3442
  PRIMARY KEY (`verification_token`,`borrowernumber`),
3442
  KEY `verification_token` (`verification_token`),
3443
  KEY `verification_token` (`verification_token`),
3443
  KEY `borrowernumber` (`borrowernumber`)
3444
  KEY `borrowernumber` (`borrowernumber`)
(-)a/installer/data/mysql/updatedatabase.pl (+1 lines)
Lines 14352-14357 foreach my $file ( sort readdir $dirh ) { Link Here
14352
    }
14352
    }
14353
}
14353
}
14354
14354
14355
14355
=head1 FUNCTIONS
14356
=head1 FUNCTIONS
14356
14357
14357
=head2 TableExists($table)
14358
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-4 / +57 lines)
Lines 493-499 $(document).ready(function() { Link Here
493
493
494
[% UNLESS nophone && nophonepro && nomobile && noemail && noemailpro && nofax %]
494
[% UNLESS nophone && nophonepro && nomobile && noemail && noemailpro && nofax %]
495
  <fieldset class="rows" id="memberentry_contact">
495
  <fieldset class="rows" id="memberentry_contact">
496
    <legend id="contact_lgd">Contact</legend><ol>
496
    <legend id="contact_lgd">Contact</legend>
497
<ol>
497
        [% UNLESS nophone %]
498
        [% UNLESS nophone %]
498
      <li>
499
      <li>
499
      [% IF ( mandatoryphone ) %]
500
      [% IF ( mandatoryphone ) %]
Lines 556-562 $(document).ready(function() { Link Here
556
	  [% IF ( mandatoryemailpro ) %]<span class="required">Required</span>[% END %]
557
	  [% IF ( mandatoryemailpro ) %]<span class="required">Required</span>[% END %]
557
    </li>
558
    </li>
558
        [% END %]
559
        [% END %]
559
        [% UNLESS nofax %]
560
    [% UNLESS nofax %]
560
    <li>
561
    <li>
561
      [% IF ( mandatoryfax ) %]
562
      [% IF ( mandatoryfax ) %]
562
      <label for="fax" class="required">
563
      <label for="fax" class="required">
Lines 567-574 $(document).ready(function() { Link Here
567
        <input type="text" id="fax" name="fax" value="[% fax | html %]" />
568
        <input type="text" id="fax" name="fax" value="[% fax | html %]" />
568
	  [% IF ( mandatoryfax ) %]<span class="required">Required</span>[% END %]
569
	  [% IF ( mandatoryfax ) %]<span class="required">Required</span>[% END %]
569
    </li>
570
    </li>
570
        [% END %]
571
571
	</ol>
572
   [% END %]
573
    <li>
574
       <label for="primary_contact_method">Main contact method:</label>
575
       <select id="primary_contact_method" name="primary_contact_method">
576
       <option value=""></option>
577
         [% FOREACH contactprincipalloo IN contactprincipalloop %]
578
            [% IF ( contactprincipalloo.currentis_phone ) %]
579
               [% IF ( primary_contact_method == 'phone' ) %]
580
                 <option value="phone" selected="selected">Primary phone</option>
581
               [% ELSE %]
582
                 <option value="phone">Primary phone</option>
583
               [% END %]
584
            [% END %]
585
            [% IF ( contactprincipalloo.currentis_phonepro ) %]
586
               [% IF ( primary_contact_method == 'phonepro' ) %]
587
                 <option value="phonepro" selected="selected">Secondary phone</option>
588
               [% ELSE %]
589
                 <option value="phonepro">Secondary phone</option>
590
               [% END %]
591
            [% END %]
592
            [% IF ( contactprincipalloo.currentis_mobile ) %]
593
               [% IF ( primary_contact_method == 'mobile' ) %]
594
                 <option value="mobile" selected="selected">Other phone</option>
595
               [% ELSE %]
596
                 <option value="mobile">Other phone</option>
597
               [% END %]
598
            [% END %]
599
            [% IF ( contactprincipalloo.currentis_email ) %]
600
               [% IF ( primary_contact_method == 'email' ) %]
601
                 <option value="email" selected="selected">Primary email</option>
602
               [% ELSE %]
603
                 <option value="email">Primary email</option>
604
               [% END %]
605
            [% END %]
606
            [% IF ( contactprincipalloo.currentis_emailpro ) %]
607
               [% IF ( primary_contact_method == 'emailpro' ) %]
608
                 <option value="emailpro" selected="selected">Secondary email</option>
609
               [% ELSE %]
610
                 <option value="emailpro">Secondary email</option>
611
               [% END %]
612
            [% END %]
613
            [% IF ( contactprincipalloo.currentis_fax ) %]
614
               [% IF ( primary_contact_method == 'fax' ) %]
615
                 <option value="fax" selected="selected">Fax</option>
616
               [% ELSE %]
617
                 <option value="fax">Fax</option>
618
               [% END %]
619
            [% END %]
620
         [% END %]
621
       </select>
622
    </li>
623
    </ol>
624
572
  </fieldset>
625
  </fieldset>
573
[%END # hide fieldset %]
626
[%END # hide fieldset %]
574
627
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (+14 lines)
Lines 273-278 function validate1(date) { Link Here
273
            [% END %]
273
            [% END %]
274
        </li>
274
        </li>
275
    [% END %]
275
    [% END %]
276
    [% SWITCH primary_contact_method %]
277
    [% CASE 'phone' %]
278
    <li><span class="label">Main contact method: </span>Phone</li>
279
    [% CASE 'phonepro' %]
280
    <li><span class="label">Main contact method: </span>Secondary phone</li>
281
    [% CASE 'mobile' %]
282
    <li><span class="label">Main contact method: </span>Other Phone</li>
283
    [% CASE 'email' %]
284
    <li><span class="label">Main contact method: </span>Primary email</li>
285
    [% CASE 'emailpro' %]
286
    <li><span class="label">Main contact method: </span>Secondary email</li>
287
    [% CASE 'fax' %]
288
    <li><span class="label">Main contact method: </span>Fax</li>
289
    [% END %]
276
</ol>
290
</ol>
277
</div>
291
</div>
278
      <div class="action">
292
      <div class="action">
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt (+50 lines)
Lines 571-576 Link Here
571
                                    [% IF mandatory.defined('fax') %]<span class="required">Required</span>[% END %]
571
                                    [% IF mandatory.defined('fax') %]<span class="required">Required</span>[% END %]
572
                                </li>
572
                                </li>
573
                            [% END %]
573
                            [% END %]
574
                            <li>
575
                               <label for="borrower_primary_contact_method">Main contact method:</label>
576
                               <select id="borrower_primary_contact_method" name="borrower_primary_contact_method">
577
                               <option value=""></option>
578
                                 [% FOREACH contactprincipalloo IN contactprincipalloop %]
579
                                    [% IF ( contactprincipalloo.currentis_phone ) %]
580
                                       [% IF ( borrower.primary_contact_method == 'phone' ) %]
581
                                         <option value="phone" selected="selected">Primary phone</option>
582
                                       [% ELSE %]
583
                                         <option value="phone">Primary phone</option>
584
                                       [% END %]
585
                                    [% END %]
586
                                    [% IF ( contactprincipalloo.currentis_phonepro ) %]
587
                                       [% IF ( borrower.primary_contact_method == 'phonepro' ) %]
588
                                         <option value="phonepro" selected="selected">Secondary phone</option>
589
                                       [% ELSE %]
590
                                         <option value="phonepro">Secondary phone</option>
591
                                       [% END %]
592
                                    [% END %]
593
                                    [% IF ( contactprincipalloo.currentis_mobile ) %]
594
                                       [% IF ( borrower.primary_contact_method == 'mobile' ) %]
595
                                         <option value="mobile" selected="selected">Other phone</option>
596
                                       [% ELSE %]
597
                                         <option value="mobile">Other phone</option>
598
                                       [% END %]
599
                                    [% END %]
600
                                    [% IF ( contactprincipalloo.currentis_email ) %]
601
                                       [% IF ( borrower.primary_contact_method == 'email' ) %]
602
                                         <option value="email" selected="selected">Primary email</option>
603
                                       [% ELSE %]
604
                                         <option value="email">Primary email</option>
605
                                       [% END %]
606
                                    [% END %]
607
                                    [% IF ( contactprincipalloo.currentis_emailpro ) %]
608
                                       [% IF ( borrower.primary_contact_method == 'emailpro' ) %]
609
                                         <option value="emailpro" selected="selected">Secondary email</option>
610
                                       [% ELSE %]
611
                                         <option value="emailpro">Secondary email</option>
612
                                       [% END %]
613
                                    [% END %]
614
                                    [% IF ( contactprincipalloo.currentis_fax ) %]
615
                                       [% IF ( borrower.primary_contact_method == 'fax' ) %]
616
                                         <option value="fax" selected="selected">Fax</option>
617
                                       [% ELSE %]
618
                                         <option value="fax">Fax</option>
619
                                       [% END %]
620
                                    [% END %]
621
                                 [% END %]
622
                               </select>
623
                            </li>
574
                        </ol>
624
                        </ol>
575
                    </fieldset>
625
                    </fieldset>
576
                [% END %]
626
                [% END %]
(-)a/members/memberentry.pl (-1 / +10 lines)
Lines 601-606 $template->param('typeloop' => \@typeloop, Link Here
601
        no_categories => $no_categories);
601
        no_categories => $no_categories);
602
if($no_categories){ $no_add = 1; }
602
if($no_categories){ $no_add = 1; }
603
603
604
my @contactprincipalloop;
605
my @fieldArray = qw(phone phonepro mobile email emailpro fax);
606
foreach my $field (@fieldArray) {
607
   if ( !(grep { $field eq $_ } @field_check)){
608
        push @contactprincipalloop,{
609
            'currentis_' . $field => 1
610
        };
611
    }
612
}
613
$template->param('contactprincipalloop' => \@contactprincipalloop);
604
614
605
my $cities = Koha::Cities->search( {}, { order_by => 'city_name' } );
615
my $cities = Koha::Cities->search( {}, { order_by => 'city_name' } );
606
my $roadtypes = C4::Koha::GetAuthorisedValues( 'ROADTYPE' );
616
my $roadtypes = C4::Koha::GetAuthorisedValues( 'ROADTYPE' );
Lines 608-614 $template->param( Link Here
608
    roadtypes => $roadtypes,
618
    roadtypes => $roadtypes,
609
    cities    => $cities,
619
    cities    => $cities,
610
);
620
);
611
612
my $default_borrowertitle = '';
621
my $default_borrowertitle = '';
613
unless ( $op eq 'duplicate' ) { $default_borrowertitle=$data{'title'} }
622
unless ( $op eq 'duplicate' ) { $default_borrowertitle=$data{'title'} }
614
623
(-)a/members/moremember.pl (-1 / +2 lines)
Lines 337-343 $template->param( Link Here
337
    borrowernumber  => $borrowernumber,
337
    borrowernumber  => $borrowernumber,
338
    othernames      => $data->{'othernames'},
338
    othernames      => $data->{'othernames'},
339
    categoryname    => $data->{'description'},
339
    categoryname    => $data->{'description'},
340
    was_renewed     => scalar $input->param('was_renewed') ? 1 : 0,
340
    primary_contact_method  => $data->{'primary_contact_method'},
341
    was_renewed     => $input->param('was_renewed') ? 1 : 0,
341
    todaysdate      => output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }),
342
    todaysdate      => output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }),
342
    totalprice      => sprintf("%.2f", $totalprice),
343
    totalprice      => sprintf("%.2f", $totalprice),
343
    totaldue        => sprintf("%.2f", $total),
344
    totaldue        => sprintf("%.2f", $total),
(-)a/opac/opac-memberentry.pl (-1 / +13 lines)
Lines 89-94 $template->param( Link Here
89
    libraries         => \@libraries,
89
    libraries         => \@libraries,
90
    OPACPatronDetails => C4::Context->preference('OPACPatronDetails'),
90
    OPACPatronDetails => C4::Context->preference('OPACPatronDetails'),
91
);
91
);
92
my $check_BorrowerMandatoryField=C4::Context->preference("BorrowerMandatoryField");
93
        my @field_check=split(/\|/,$check_BorrowerMandatoryField);
94
        my @contactprincipalloop;
95
        my @fieldArray = qw(phone phonepro mobile email emailpro fax);
96
        foreach my $field (@fieldArray) {
97
           if ( !(grep { $field eq $_ } @field_check)){
98
                push @contactprincipalloop,{
99
                    'currentis_' . $field => 1
100
                };
101
            }
102
        }
103
104
        $template->param('contactprincipalloop' => \@contactprincipalloop);
92
105
93
my $attributes = ParsePatronAttributes($borrowernumber,$cgi);
106
my $attributes = ParsePatronAttributes($borrowernumber,$cgi);
94
my $conflicting_attribute = 0;
107
my $conflicting_attribute = 0;
95
- 

Return to bug 11879