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 (+3 lines)
Lines 632-637 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
  `primary_contact_method` varchar(45) DEFAULT NULL, --  useful for reporting purposes
635
  KEY borrowernumber (borrowernumber),
636
  KEY borrowernumber (borrowernumber),
636
  KEY `cardnumber` (`cardnumber`),
637
  KEY `cardnumber` (`cardnumber`),
637
  KEY `sms_provider_id` (`sms_provider_id`)
638
  KEY `sms_provider_id` (`sms_provider_id`)
Lines 1655-1660 CREATE TABLE `borrowers` ( -- this table includes information about your patrons Link Here
1655
  `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'.
1656
  `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'.
1656
  `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)
1657
  `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)
1657
  `lastseen` datetime default NULL, -- last time a patron has been seed (connected at the OPAC or staff interface)
1658
  `lastseen` datetime default NULL, -- last time a patron has been seed (connected at the OPAC or staff interface)
1659
  `primary_contact_method` varchar(45) DEFAULT NULL, --  useful for reporting purposes
1658
  UNIQUE KEY `cardnumber` (`cardnumber`),
1660
  UNIQUE KEY `cardnumber` (`cardnumber`),
1659
  PRIMARY KEY `borrowernumber` (`borrowernumber`),
1661
  PRIMARY KEY `borrowernumber` (`borrowernumber`),
1660
  KEY `categorycode` (`categorycode`),
1662
  KEY `categorycode` (`categorycode`),
Lines 3425-3430 CREATE TABLE IF NOT EXISTS `borrower_modifications` ( Link Here
3425
  `smsalertnumber` varchar(50) DEFAULT NULL,
3427
  `smsalertnumber` varchar(50) DEFAULT NULL,
3426
  `privacy` int(11) DEFAULT NULL,
3428
  `privacy` int(11) DEFAULT NULL,
3427
  `extended_attributes` text DEFAULT NULL,
3429
  `extended_attributes` text DEFAULT NULL,
3430
  `primary_contact_method` varchar(45) DEFAULT NULL, --  useful for reporting purposes
3428
  PRIMARY KEY (`verification_token`,`borrowernumber`),
3431
  PRIMARY KEY (`verification_token`,`borrowernumber`),
3429
  KEY `verification_token` (`verification_token`),
3432
  KEY `verification_token` (`verification_token`),
3430
  KEY `borrowernumber` (`borrowernumber`)
3433
  KEY `borrowernumber` (`borrowernumber`)
(-)a/installer/data/mysql/updatedatabase.pl (+1 lines)
Lines 13738-13743 foreach my $file ( sort readdir $dirh ) { Link Here
13738
    }
13738
    }
13739
}
13739
}
13740
13740
13741
13741
=head1 FUNCTIONS
13742
=head1 FUNCTIONS
13742
13743
13743
=head2 TableExists($table)
13744
=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 265-270 function validate1(date) { Link Here
265
            [% END %]
265
            [% END %]
266
        </li>
266
        </li>
267
    [% END %]
267
    [% END %]
268
    [% SWITCH primary_contact_method %]
269
    [% CASE 'phone' %]
270
    <li><span class="label">Main contact method: </span>Phone</li>
271
    [% CASE 'phonepro' %]
272
    <li><span class="label">Main contact method: </span>Secondary phone</li>
273
    [% CASE 'mobile' %]
274
    <li><span class="label">Main contact method: </span>Other Phone</li>
275
    [% CASE 'email' %]
276
    <li><span class="label">Main contact method: </span>Primary email</li>
277
    [% CASE 'emailpro' %]
278
    <li><span class="label">Main contact method: </span>Secondary email</li>
279
    [% CASE 'fax' %]
280
    <li><span class="label">Main contact method: </span>Fax</li>
281
    [% END %]
268
</ol>
282
</ol>
269
</div>
283
</div>
270
      <div class="action">
284
      <div class="action">
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt (+50 lines)
Lines 566-571 Link Here
566
                                    [% IF mandatory.defined('fax') %]<span class="required">Required</span>[% END %]
566
                                    [% IF mandatory.defined('fax') %]<span class="required">Required</span>[% END %]
567
                                </li>
567
                                </li>
568
                            [% END %]
568
                            [% END %]
569
                            <li>
570
                               <label for="borrower_primary_contact_method">Main contact method:</label>
571
                               <select id="borrower_primary_contact_method" name="borrower_primary_contact_method">
572
                               <option value=""></option>
573
                                 [% FOREACH contactprincipalloo IN contactprincipalloop %]
574
                                    [% IF ( contactprincipalloo.currentis_phone ) %]
575
                                       [% IF ( borrower.primary_contact_method == 'phone' ) %]
576
                                         <option value="phone" selected="selected">Primary phone</option>
577
                                       [% ELSE %]
578
                                         <option value="phone">Primary phone</option>
579
                                       [% END %]
580
                                    [% END %]
581
                                    [% IF ( contactprincipalloo.currentis_phonepro ) %]
582
                                       [% IF ( borrower.primary_contact_method == 'phonepro' ) %]
583
                                         <option value="phonepro" selected="selected">Secondary phone</option>
584
                                       [% ELSE %]
585
                                         <option value="phonepro">Secondary phone</option>
586
                                       [% END %]
587
                                    [% END %]
588
                                    [% IF ( contactprincipalloo.currentis_mobile ) %]
589
                                       [% IF ( borrower.primary_contact_method == 'mobile' ) %]
590
                                         <option value="mobile" selected="selected">Other phone</option>
591
                                       [% ELSE %]
592
                                         <option value="mobile">Other phone</option>
593
                                       [% END %]
594
                                    [% END %]
595
                                    [% IF ( contactprincipalloo.currentis_email ) %]
596
                                       [% IF ( borrower.primary_contact_method == 'email' ) %]
597
                                         <option value="email" selected="selected">Primary email</option>
598
                                       [% ELSE %]
599
                                         <option value="email">Primary email</option>
600
                                       [% END %]
601
                                    [% END %]
602
                                    [% IF ( contactprincipalloo.currentis_emailpro ) %]
603
                                       [% IF ( borrower.primary_contact_method == 'emailpro' ) %]
604
                                         <option value="emailpro" selected="selected">Secondary email</option>
605
                                       [% ELSE %]
606
                                         <option value="emailpro">Secondary email</option>
607
                                       [% END %]
608
                                    [% END %]
609
                                    [% IF ( contactprincipalloo.currentis_fax ) %]
610
                                       [% IF ( borrower.primary_contact_method == 'fax' ) %]
611
                                         <option value="fax" selected="selected">Fax</option>
612
                                       [% ELSE %]
613
                                         <option value="fax">Fax</option>
614
                                       [% END %]
615
                                    [% END %]
616
                                 [% END %]
617
                               </select>
618
                            </li>
569
                        </ol>
619
                        </ol>
570
                    </fieldset>
620
                    </fieldset>
571
                [% END %]
621
                [% END %]
(-)a/members/memberentry.pl (-1 / +10 lines)
Lines 605-610 $template->param('typeloop' => \@typeloop, Link Here
605
        no_categories => $no_categories);
605
        no_categories => $no_categories);
606
if($no_categories){ $no_add = 1; }
606
if($no_categories){ $no_add = 1; }
607
607
608
my @contactprincipalloop;
609
my @fieldArray = qw(phone phonepro mobile email emailpro fax);
610
foreach my $field (@fieldArray) {
611
   if ( !(grep { $field eq $_ } @field_check)){
612
        push @contactprincipalloop,{
613
            'currentis_' . $field => 1
614
        };
615
    }
616
}
617
$template->param('contactprincipalloop' => \@contactprincipalloop);
608
618
609
my $cities = Koha::Cities->search( {}, { order_by => 'city_name' } );
619
my $cities = Koha::Cities->search( {}, { order_by => 'city_name' } );
610
my $roadtypes = C4::Koha::GetAuthorisedValues( 'ROADTYPE' );
620
my $roadtypes = C4::Koha::GetAuthorisedValues( 'ROADTYPE' );
Lines 612-618 $template->param( Link Here
612
    roadtypes => $roadtypes,
622
    roadtypes => $roadtypes,
613
    cities    => $cities,
623
    cities    => $cities,
614
);
624
);
615
616
my $default_borrowertitle = '';
625
my $default_borrowertitle = '';
617
unless ( $op eq 'duplicate' ) { $default_borrowertitle=$data{'title'} }
626
unless ( $op eq 'duplicate' ) { $default_borrowertitle=$data{'title'} }
618
627
(-)a/members/moremember.pl (-1 / +2 lines)
Lines 329-335 $template->param( Link Here
329
    borrowernumber  => $borrowernumber,
329
    borrowernumber  => $borrowernumber,
330
    othernames      => $data->{'othernames'},
330
    othernames      => $data->{'othernames'},
331
    categoryname    => $data->{'description'},
331
    categoryname    => $data->{'description'},
332
    was_renewed     => scalar $input->param('was_renewed') ? 1 : 0,
332
    primary_contact_method  => $data->{'primary_contact_method'},
333
    was_renewed     => $input->param('was_renewed') ? 1 : 0,
333
    todaysdate      => output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }),
334
    todaysdate      => output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }),
334
    totalprice      => sprintf("%.2f", $totalprice),
335
    totalprice      => sprintf("%.2f", $totalprice),
335
    totaldue        => sprintf("%.2f", $total),
336
    totaldue        => sprintf("%.2f", $total),
(-)a/opac/opac-memberentry.pl (-1 / +13 lines)
Lines 85-90 $template->param( Link Here
85
    libraries         => \@libraries,
85
    libraries         => \@libraries,
86
    OPACPatronDetails => C4::Context->preference('OPACPatronDetails'),
86
    OPACPatronDetails => C4::Context->preference('OPACPatronDetails'),
87
);
87
);
88
my $check_BorrowerMandatoryField=C4::Context->preference("BorrowerMandatoryField");
89
        my @field_check=split(/\|/,$check_BorrowerMandatoryField);
90
        my @contactprincipalloop;
91
        my @fieldArray = qw(phone phonepro mobile email emailpro fax);
92
        foreach my $field (@fieldArray) {
93
           if ( !(grep { $field eq $_ } @field_check)){
94
                push @contactprincipalloop,{
95
                    'currentis_' . $field => 1
96
                };
97
            }
98
        }
99
100
        $template->param('contactprincipalloop' => \@contactprincipalloop);
88
101
89
if ( $action eq 'create' ) {
102
if ( $action eq 'create' ) {
90
103
91
- 

Return to bug 11879