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

(-)a/installer/data/mysql/atomicupdate/borrowers_primary_contact_method.perl (-3 / +3 lines)
Lines 1-15 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
2
if( CheckVersion( $DBversion ) ) {
3
    if( !column_exists( 'borrowers', 'primary_contact_method' ) ) {
3
    if( !column_exists( 'borrowers', 'primary_contact_method' ) ) {
4
        $dbh->do( "ALTER TABLE `borrowers` ADD COLUMN `primary_contact_method` VARCHAR(45) NULL DEFAULT NULL AFTER `anonymized`" );
4
        $dbh->do( "ALTER TABLE `borrowers` ADD COLUMN `primary_contact_method` VARCHAR(45) DEFAULT NULL AFTER `autorenew_checkouts`" );
5
    }
5
    }
6
6
7
    if( !column_exists( 'deletedborrowers', 'primary_contact_method' ) ) {
7
    if( !column_exists( 'deletedborrowers', 'primary_contact_method' ) ) {
8
        $dbh->do( "ALTER TABLE `deletedborrowers` ADD COLUMN `primary_contact_method` VARCHAR(45) NULL DEFAULT NULL AFTER `anonymized`" );
8
        $dbh->do( "ALTER TABLE `deletedborrowers` ADD COLUMN `primary_contact_method` VARCHAR(45) DEFAULT NULL AFTER `autorenew_checkouts`" );
9
    }
9
    }
10
10
11
    if( !column_exists( 'borrower_modifications', 'primary_contact_method' ) ) {
11
    if( !column_exists( 'borrower_modifications', 'primary_contact_method' ) ) {
12
        $dbh->do( "ALTER TABLE `borrower_modifications` ADD COLUMN `primary_contact_method` VARCHAR(45) NULL DEFAULT NULL AFTER `gdpr_proc_consent`" );
12
        $dbh->do( "ALTER TABLE `borrower_modifications` ADD COLUMN `primary_contact_method` VARCHAR(45) DEFAULT NULL AFTER `gdpr_proc_consent`" );
13
    }
13
    }
14
14
15
    SetVersion( $DBversion );
15
    SetVersion( $DBversion );
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/borrowers.json (-1 / +2 lines)
Lines 51-55 Link Here
51
    "altcontactzipcode": "altcontactzipcode",
51
    "altcontactzipcode": "altcontactzipcode",
52
    "altcontactcountry": "altcontactcountry",
52
    "altcontactcountry": "altcontactcountry",
53
    "altcontactphone": "altcontactphone",
53
    "altcontactphone": "altcontactphone",
54
    "smsalertnumber": "smsalertnumber"
54
    "smsalertnumber": "smsalertnumber",
55
    "primary_contact_method": "primary_contact_method"
55
}
56
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-49 / +51 lines)
Lines 741-803 legend:hover { Link Here
741
                                                </li>
741
                                                </li>
742
                                            [% END #/UNLESS nofax %]
742
                                            [% END #/UNLESS nofax %]
743
743
744
                                            <li>
744
                                            [% UNLESS noprimary_contact_method %]
745
                                                [% IF mandatoryprimary_contact_method %]
745
                                                <li>
746
                                                    <label for="primary_contact_method" class="required">
746
                                                    [% IF mandatoryprimary_contact_method %]
747
                                                [% ELSE %]
747
                                                        <label for="primary_contact_method" class="required">
748
                                                    <label for="primary_contact_method">
748
                                                    [% ELSE %]
749
                                                [% END %]
749
                                                        <label for="primary_contact_method">
750
                                                Main contact method: </label>
750
                                                    [% END %]
751
                                                    Main contact method: </label>
751
752
752
                                                <select id="primary_contact_method" name="primary_contact_method">
753
                                                    <select id="primary_contact_method" name="primary_contact_method">
753
                                                    <option value=""></option>
754
                                                        <option value=""></option>
754
                                                    [% UNLESS nophone %]
755
                                                        [% UNLESS nophone %]
755
                                                        [% IF ( primary_contact_method == 'phone' ) %]
756
                                                            [% IF ( primary_contact_method == 'phone' ) %]
756
                                                            <option value="phone" selected="selected">Primary phone</option>
757
                                                                <option value="phone" selected="selected">Primary phone</option>
757
                                                        [% ELSE %]
758
                                                            [% ELSE %]
758
                                                            <option value="phone">Primary phone</option>
759
                                                                <option value="phone">Primary phone</option>
760
                                                            [% END %]
759
                                                        [% END %]
761
                                                        [% END %]
760
                                                    [% END %]
762
                                                        [% UNLESS nophonepro %]
761
                                                    [% UNLESS nophonepro %]
763
                                                            [% IF ( primary_contact_method == 'phonepro' ) %]
762
                                                        [% IF ( primary_contact_method == 'phonepro' ) %]
764
                                                                <option value="phonepro" selected="selected">Secondary phone</option>
763
                                                            <option value="phonepro" selected="selected">Secondary phone</option>
765
                                                            [% ELSE %]
764
                                                        [% ELSE %]
766
                                                                <option value="phonepro">Secondary phone</option>
765
                                                            <option value="phonepro">Secondary phone</option>
767
                                                            [% END %]
766
                                                        [% END %]
768
                                                        [% END %]
767
                                                    [% END %]
769
                                                        [% UNLESS nomobile %]
768
                                                    [% UNLESS nomobile %]
770
                                                            [% IF ( primary_contact_method == 'mobile' ) %]
769
                                                        [% IF ( primary_contact_method == 'mobile' ) %]
771
                                                                <option value="mobile" selected="selected">Other phone</option>
770
                                                            <option value="mobile" selected="selected">Other phone</option>
772
                                                            [% ELSE %]
771
                                                        [% ELSE %]
773
                                                                <option value="mobile">Other phone</option>
772
                                                            <option value="mobile">Other phone</option>
774
                                                            [% END %]
773
                                                        [% END %]
775
                                                        [% END %]
774
                                                    [% END %]
776
                                                        [% UNLESS noemail %]
775
                                                    [% UNLESS noemail %]
777
                                                            [% IF ( primary_contact_method == 'email' ) %]
776
                                                        [% IF ( primary_contact_method == 'email' ) %]
778
                                                                <option value="email" selected="selected">Primary email</option>
777
                                                            <option value="email" selected="selected">Primary email</option>
779
                                                            [% ELSE %]
778
                                                        [% ELSE %]
780
                                                                <option value="email">Primary email</option>
779
                                                            <option value="email">Primary email</option>
781
                                                            [% END %]
780
                                                        [% END %]
782
                                                        [% END %]
781
                                                    [% END %]
783
                                                        [% UNLESS noemailpro %]
782
                                                    [% UNLESS noemailpro %]
784
                                                            [% IF ( primary_contact_method == 'emailpro' ) %]
783
                                                        [% IF ( primary_contact_method == 'emailpro' ) %]
785
                                                                <option value="emailpro" selected="selected">Secondary email</option>
784
                                                            <option value="emailpro" selected="selected">Secondary email</option>
786
                                                            [% ELSE %]
785
                                                        [% ELSE %]
787
                                                                <option value="emailpro">Secondary email</option>
786
                                                            <option value="emailpro">Secondary email</option>
788
                                                            [% END %]
787
                                                        [% END %]
789
                                                        [% END %]
788
                                                    [% END %]
790
                                                        [% UNLESS nofax %]
789
                                                    [% UNLESS nofax %]
791
                                                            [% IF ( primary_contact_method == 'fax' ) %]
790
                                                        [% IF ( primary_contact_method == 'fax' ) %]
792
                                                                <option value="fax" selected="selected">Fax</option>
791
                                                            <option value="fax" selected="selected">Fax</option>
793
                                                            [% ELSE %]
792
                                                        [% ELSE %]
794
                                                                <option value="fax">Fax</option>
793
                                                            <option value="fax">Fax</option>
795
                                                            [% END %]
794
                                                        [% END %]
796
                                                        [% END %]
797
                                                    </select>
798
                                                    [% IF mandatoryprimary_contact_method %]
799
                                                        <span class="required">Required</span>
795
                                                    [% END %]
800
                                                    [% END %]
796
                                                </select>
801
                                                </li>
797
                                                [% IF mandatoryprimary_contact_method %]
802
                                            [% END %]
798
                                                    <span class="required">Required</span>
799
                                                [% END %]
800
                                            </li>
801
                                        </ol>
803
                                        </ol>
802
                                    </fieldset> <!-- /#memberentry_contact -->
804
                                    </fieldset> <!-- /#memberentry_contact -->
803
                                [% END # hide fieldset %]
805
                                [% END # hide fieldset %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-2 / +2 lines)
Lines 308-317 Link Here
308
                                                </li>
308
                                                </li>
309
                                        [% END %]
309
                                        [% END %]
310
310
311
                                        [% IF ( primary_contact_method ) %]
311
                                        [% IF ( patron.primary_contact_method ) %]
312
                                            <li>
312
                                            <li>
313
                                                <span class="label">Main contact method: </span>
313
                                                <span class="label">Main contact method: </span>
314
                                                [% SWITCH primary_contact_method %]
314
                                                [% SWITCH patron.primary_contact_method %]
315
                                                    [% CASE 'phone' %]
315
                                                    [% CASE 'phone' %]
316
                                                        Primary phone
316
                                                        Primary phone
317
                                                    [% CASE 'phonepro' %]
317
                                                    [% CASE 'phonepro' %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt (-43 / +29 lines)
Lines 565-613 Link Here
565
565
566
                                                <select id="borrower_primary_contact_method" name="borrower_primary_contact_method">
566
                                                <select id="borrower_primary_contact_method" name="borrower_primary_contact_method">
567
                                                    <option value=""></option>
567
                                                    <option value=""></option>
568
                                                    [% FOREACH contactprincipalloo IN contactprincipalloop %]
568
                                                    [% IF ( borrower.primary_contact_method == 'phone' ) %]
569
                                                        [% IF ( contactprincipalloo.currentis_phone ) %]
569
                                                        <option value="phone" selected="selected">Primary phone</option>
570
                                                            [% IF ( borrower.primary_contact_method == 'phone' ) %]
570
                                                    [% ELSE %]
571
                                                                <option value="phone" selected="selected">Primary phone</option>
571
                                                        <option value="phone">Primary phone</option>
572
                                                            [% ELSE %]
572
                                                    [% END %]
573
                                                                <option value="phone">Primary phone</option>
573
                                                    [% IF ( borrower.primary_contact_method == 'phonepro' ) %]
574
                                                            [% END %]
574
                                                        <option value="phonepro" selected="selected">Secondary phone</option>
575
                                                        [% END %]
575
                                                    [% ELSE %]
576
                                                        [% IF ( contactprincipalloo.currentis_phonepro ) %]
576
                                                        <option value="phonepro">Secondary phone</option>
577
                                                            [% IF ( borrower.primary_contact_method == 'phonepro' ) %]
577
                                                    [% END %]
578
                                                                <option value="phonepro" selected="selected">Secondary phone</option>
578
                                                    [% IF ( borrower.primary_contact_method == 'mobile' ) %]
579
                                                            [% ELSE %]
579
                                                        <option value="mobile" selected="selected">Other phone</option>
580
                                                                <option value="phonepro">Secondary phone</option>
580
                                                    [% ELSE %]
581
                                                            [% END %]
581
                                                        <option value="mobile">Other phone</option>
582
                                                        [% END %]
582
                                                    [% END %]
583
                                                        [% IF ( contactprincipalloo.currentis_mobile ) %]
583
                                                    [% IF ( borrower.primary_contact_method == 'email' ) %]
584
                                                            [% IF ( borrower.primary_contact_method == 'mobile' ) %]
584
                                                        <option value="email" selected="selected">Primary email</option>
585
                                                                <option value="mobile" selected="selected">Other phone</option>
585
                                                    [% ELSE %]
586
                                                            [% ELSE %]
586
                                                        <option value="email">Primary email</option>
587
                                                                <option value="mobile">Other phone</option>
587
                                                    [% END %]
588
                                                            [% END %]
588
                                                    [% IF ( borrower.primary_contact_method == 'emailpro' ) %]
589
                                                        [% END %]
589
                                                        <option value="emailpro" selected="selected">Secondary email</option>
590
                                                        [% IF ( contactprincipalloo.currentis_email ) %]
590
                                                    [% ELSE %]
591
                                                            [% IF ( borrower.primary_contact_method == 'email' ) %]
591
                                                        <option value="emailpro">Secondary email</option>
592
                                                                <option value="email" selected="selected">Primary email</option>
592
                                                    [% END %]
593
                                                            [% ELSE %]
593
                                                    [% IF ( borrower.primary_contact_method == 'fax' ) %]
594
                                                                <option value="email">Primary email</option>
594
                                                        <option value="fax" selected="selected">Fax</option>
595
                                                            [% END %]
595
                                                    [% ELSE %]
596
                                                        [% END %]
596
                                                        <option value="fax">Fax</option>
597
                                                        [% IF ( contactprincipalloo.currentis_emailpro ) %]
598
                                                            [% IF ( borrower.primary_contact_method == 'emailpro' ) %]
599
                                                                <option value="emailpro" selected="selected">Secondary email</option>
600
                                                            [% ELSE %]
601
                                                                <option value="emailpro">Secondary email</option>
602
                                                            [% END %]
603
                                                        [% END %]
604
                                                        [% IF ( contactprincipalloo.currentis_fax ) %]
605
                                                            [% IF ( borrower.primary_contact_method == 'fax' ) %]
606
                                                                <option value="fax" selected="selected">Fax</option>
607
                                                            [% ELSE %]
608
                                                                <option value="fax">Fax</option>
609
                                                            [% END %]
610
                                                        [% END %]
611
                                                    [% END %]
597
                                                    [% END %]
612
                                                </select>
598
                                                </select>
613
                                                [% IF ( mandatory.defined('primary_contact_method') ) %]<span class="required">Required</span>[% END %]
599
                                                [% IF ( mandatory.defined('primary_contact_method') ) %]<span class="required">Required</span>[% END %]
(-)a/opac/opac-memberentry.pl (-15 lines)
Lines 102-121 $template->param( Link Here
102
    defaultCategory  => $defaultCategory,
102
    defaultCategory  => $defaultCategory,
103
);
103
);
104
104
105
my $check_BorrowerMandatoryField=C4::Context->preference("BorrowerMandatoryField");
106
my @field_check=split(/\|/,$check_BorrowerMandatoryField);
107
my @contactprincipalloop;
108
my @fieldArray = qw(phone phonepro mobile email emailpro fax);
109
foreach my $field (@fieldArray) {
110
   if ( !(grep { $field eq $_ } @field_check)){
111
        push @contactprincipalloop,{
112
            'currentis_' . $field => 1
113
        };
114
    }
115
}
116
117
$template->param('contactprincipalloop' => \@contactprincipalloop);
118
119
my $attributes = ParsePatronAttributes($borrowernumber,$cgi);
105
my $attributes = ParsePatronAttributes($borrowernumber,$cgi);
120
my $conflicting_attribute = 0;
106
my $conflicting_attribute = 0;
121
107
122
- 

Return to bug 11879