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 311-320 Link Here
311
                                                </li>
311
                                                </li>
312
                                        [% END %]
312
                                        [% END %]
313
313
314
                                        [% IF ( primary_contact_method ) %]
314
                                        [% IF ( patron.primary_contact_method ) %]
315
                                            <li>
315
                                            <li>
316
                                                <span class="label">Main contact method: </span>
316
                                                <span class="label">Main contact method: </span>
317
                                                [% SWITCH primary_contact_method %]
317
                                                [% SWITCH patron.primary_contact_method %]
318
                                                    [% CASE 'phone' %]
318
                                                    [% CASE 'phone' %]
319
                                                        Primary phone
319
                                                        Primary phone
320
                                                    [% CASE 'phonepro' %]
320
                                                    [% CASE 'phonepro' %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt (-43 / +29 lines)
Lines 634-682 Link Here
634
634
635
                                                <select id="borrower_primary_contact_method" name="borrower_primary_contact_method">
635
                                                <select id="borrower_primary_contact_method" name="borrower_primary_contact_method">
636
                                                    <option value=""></option>
636
                                                    <option value=""></option>
637
                                                    [% FOREACH contactprincipalloo IN contactprincipalloop %]
637
                                                    [% IF ( borrower.primary_contact_method == 'phone' ) %]
638
                                                        [% IF ( contactprincipalloo.currentis_phone ) %]
638
                                                        <option value="phone" selected="selected">Primary phone</option>
639
                                                            [% IF ( borrower.primary_contact_method == 'phone' ) %]
639
                                                    [% ELSE %]
640
                                                                <option value="phone" selected="selected">Primary phone</option>
640
                                                        <option value="phone">Primary phone</option>
641
                                                            [% ELSE %]
641
                                                    [% END %]
642
                                                                <option value="phone">Primary phone</option>
642
                                                    [% IF ( borrower.primary_contact_method == 'phonepro' ) %]
643
                                                            [% END %]
643
                                                        <option value="phonepro" selected="selected">Secondary phone</option>
644
                                                        [% END %]
644
                                                    [% ELSE %]
645
                                                        [% IF ( contactprincipalloo.currentis_phonepro ) %]
645
                                                        <option value="phonepro">Secondary phone</option>
646
                                                            [% IF ( borrower.primary_contact_method == 'phonepro' ) %]
646
                                                    [% END %]
647
                                                                <option value="phonepro" selected="selected">Secondary phone</option>
647
                                                    [% IF ( borrower.primary_contact_method == 'mobile' ) %]
648
                                                            [% ELSE %]
648
                                                        <option value="mobile" selected="selected">Other phone</option>
649
                                                                <option value="phonepro">Secondary phone</option>
649
                                                    [% ELSE %]
650
                                                            [% END %]
650
                                                        <option value="mobile">Other phone</option>
651
                                                        [% END %]
651
                                                    [% END %]
652
                                                        [% IF ( contactprincipalloo.currentis_mobile ) %]
652
                                                    [% IF ( borrower.primary_contact_method == 'email' ) %]
653
                                                            [% IF ( borrower.primary_contact_method == 'mobile' ) %]
653
                                                        <option value="email" selected="selected">Primary email</option>
654
                                                                <option value="mobile" selected="selected">Other phone</option>
654
                                                    [% ELSE %]
655
                                                            [% ELSE %]
655
                                                        <option value="email">Primary email</option>
656
                                                                <option value="mobile">Other phone</option>
656
                                                    [% END %]
657
                                                            [% END %]
657
                                                    [% IF ( borrower.primary_contact_method == 'emailpro' ) %]
658
                                                        [% END %]
658
                                                        <option value="emailpro" selected="selected">Secondary email</option>
659
                                                        [% IF ( contactprincipalloo.currentis_email ) %]
659
                                                    [% ELSE %]
660
                                                            [% IF ( borrower.primary_contact_method == 'email' ) %]
660
                                                        <option value="emailpro">Secondary email</option>
661
                                                                <option value="email" selected="selected">Primary email</option>
661
                                                    [% END %]
662
                                                            [% ELSE %]
662
                                                    [% IF ( borrower.primary_contact_method == 'fax' ) %]
663
                                                                <option value="email">Primary email</option>
663
                                                        <option value="fax" selected="selected">Fax</option>
664
                                                            [% END %]
664
                                                    [% ELSE %]
665
                                                        [% END %]
665
                                                        <option value="fax">Fax</option>
666
                                                        [% IF ( contactprincipalloo.currentis_emailpro ) %]
667
                                                            [% IF ( borrower.primary_contact_method == 'emailpro' ) %]
668
                                                                <option value="emailpro" selected="selected">Secondary email</option>
669
                                                            [% ELSE %]
670
                                                                <option value="emailpro">Secondary email</option>
671
                                                            [% END %]
672
                                                        [% END %]
673
                                                        [% IF ( contactprincipalloo.currentis_fax ) %]
674
                                                            [% IF ( borrower.primary_contact_method == 'fax' ) %]
675
                                                                <option value="fax" selected="selected">Fax</option>
676
                                                            [% ELSE %]
677
                                                                <option value="fax">Fax</option>
678
                                                            [% END %]
679
                                                        [% END %]
680
                                                    [% END %]
666
                                                    [% END %]
681
                                                </select>
667
                                                </select>
682
                                                [% IF ( mandatory.defined('primary_contact_method') ) %]<span class="required">Required</span>[% END %]
668
                                                [% IF ( mandatory.defined('primary_contact_method') ) %]<span class="required">Required</span>[% END %]
(-)a/opac/opac-memberentry.pl (-15 lines)
Lines 101-120 $template->param( Link Here
101
    OPACPatronDetails => C4::Context->preference('OPACPatronDetails'),
101
    OPACPatronDetails => C4::Context->preference('OPACPatronDetails'),
102
);
102
);
103
103
104
my $check_BorrowerMandatoryField=C4::Context->preference("BorrowerMandatoryField");
105
my @field_check=split(/\|/,$check_BorrowerMandatoryField);
106
my @contactprincipalloop;
107
my @fieldArray = qw(phone phonepro mobile email emailpro fax);
108
foreach my $field (@fieldArray) {
109
   if ( !(grep { $field eq $_ } @field_check)){
110
        push @contactprincipalloop,{
111
            'currentis_' . $field => 1
112
        };
113
    }
114
}
115
116
$template->param('contactprincipalloop' => \@contactprincipalloop);
117
118
my $attributes = ParsePatronAttributes($borrowernumber,$cgi);
104
my $attributes = ParsePatronAttributes($borrowernumber,$cgi);
119
my $conflicting_attribute = 0;
105
my $conflicting_attribute = 0;
120
106
121
- 

Return to bug 11879