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

(-)a/installer/data/mysql/atomicupdate/bug_31498_add_primary_contact_av.pl (+31 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "31498",
5
    description => "Add CONTACT_METHODS authorized value category",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
10
        $dbh->do(q{
11
          INSERT IGNORE INTO authorised_value_categories (category_name, is_system)
12
          VALUES
13
              ('CONTACT_METHODS', 1)
14
        });
15
16
        say $out "Added CONTACT_METHODS authorized value category";
17
18
        $dbh->do(q{
19
          INSERT IGNORE INTO authorised_values (category, authorised_value, lib)
20
          VALUES
21
              ('CONTACT_METHODS', 'phone', 'Primary phone'),
22
              ('CONTACT_METHODS', 'phonepro', 'Secondary phone'),
23
              ('CONTACT_METHODS', 'mobile', 'Other phone'),
24
              ('CONTACT_METHODS', 'email', 'Primary email'),
25
              ('CONTACT_METHODS', 'emailpro', 'Secondary email'),
26
              ('CONTACT_METHODS', 'fax', 'Fax')
27
        });
28
29
        say $out "Add values to CONTACT_METHODS";
30
    },
31
};
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-46 / +13 lines)
Lines 809-860 legend:hover { Link Here
809
                                                        <label for="primary_contact_method">
809
                                                        <label for="primary_contact_method">
810
                                                    [% END %]
810
                                                    [% END %]
811
                                                    Main contact method: </label>
811
                                                    Main contact method: </label>
812
812
                                                    [% SET contact_methods = AuthorisedValues.GetAuthValueDropbox('CONTACT_METHODS') %]
813
                                                    <select id="primary_contact_method" name="primary_contact_method">
813
                                                    [% IF contact_methods.count %]
814
                                                        <option value=""></option>
814
                                                                    <select id="primary_contact_method" name="primary_contact_method">
815
                                                        [% UNLESS nophone %]
815
                                                                    <option value=""></option>
816
                                                            [% IF ( borrower_data.primary_contact_method == 'phone' ) %]
816
                                                                    [% FOR contact_method IN contact_methods %]
817
                                                                <option value="phone" selected="selected">Primary phone</option>
817
                                                                        [% IF contact_method.authorised_value == borrower_data.primary_contact_method %]
818
                                                            [% ELSE %]
818
                                                                            <option value="[% contact_method.authorised_value | html %]" selected="selected">[% contact_method.lib | html %]</option>
819
                                                                <option value="phone">Primary phone</option>
819
                                                                        [% ELSE %]
820
                                                            [% END %]
820
                                                                            <option value="[% contact_method.authorised_value | html %]">[% contact_method.lib | html %]</option>
821
                                                        [% END %]
821
                                                                        [% END %]
822
                                                        [% UNLESS nophonepro %]
822
                                                                    [% END %]
823
                                                            [% IF ( borrower_data.primary_contact_method == 'phonepro' ) %]
823
                                                                </select>
824
                                                                <option value="phonepro" selected="selected">Secondary phone</option>
824
                                                    [% END %]
825
                                                            [% ELSE %]
826
                                                                <option value="phonepro">Secondary phone</option>
827
                                                            [% END %]
828
                                                        [% END %]
829
                                                        [% UNLESS nomobile %]
830
                                                            [% IF ( borrower_data.primary_contact_method == 'mobile' ) %]
831
                                                                <option value="mobile" selected="selected">Other phone</option>
832
                                                            [% ELSE %]
833
                                                                <option value="mobile">Other phone</option>
834
                                                            [% END %]
835
                                                        [% END %]
836
                                                        [% UNLESS noemail %]
837
                                                            [% IF ( borrower_data.primary_contact_method == 'email' ) %]
838
                                                                <option value="email" selected="selected">Primary email</option>
839
                                                            [% ELSE %]
840
                                                                <option value="email">Primary email</option>
841
                                                            [% END %]
842
                                                        [% END %]
843
                                                        [% UNLESS noemailpro %]
844
                                                            [% IF ( borrower_data.primary_contact_method == 'emailpro' ) %]
845
                                                                <option value="emailpro" selected="selected">Secondary email</option>
846
                                                            [% ELSE %]
847
                                                                <option value="emailpro">Secondary email</option>
848
                                                            [% END %]
849
                                                        [% END %]
850
                                                        [% UNLESS nofax %]
851
                                                            [% IF ( borrower_data.primary_contact_method == 'fax' ) %]
852
                                                                <option value="fax" selected="selected">Fax</option>
853
                                                            [% ELSE %]
854
                                                                <option value="fax">Fax</option>
855
                                                            [% END %]
856
                                                        [% END %]
857
                                                    </select>
858
                                                    [% IF mandatoryprimary_contact_method %]
825
                                                    [% IF mandatoryprimary_contact_method %]
859
                                                        <span class="required">Required</span>
826
                                                        <span class="required">Required</span>
860
                                                    [% END %]
827
                                                    [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-14 / +1 lines)
Lines 245-264 Link Here
245
                                        [% IF ( patron.primary_contact_method ) %]
245
                                        [% IF ( patron.primary_contact_method ) %]
246
                                            <li>
246
                                            <li>
247
                                                <span class="label">Main contact method: </span>
247
                                                <span class="label">Main contact method: </span>
248
                                                [% SWITCH patron.primary_contact_method %]
248
                                                <span>[% AuthorisedValues.GetByCode('CONTACT_METHODS', patron.primary_contact_method) | html %]</span>
249
                                                    [% CASE 'phone' %]
250
                                                        <span>Primary phone</span>
251
                                                    [% CASE 'phonepro' %]
252
                                                        <span>Secondary phone</span>
253
                                                    [% CASE 'mobile' %]
254
                                                        <span>Other phone</span>
255
                                                    [% CASE 'email' %]
256
                                                        <span>Primary email</span>
257
                                                    [% CASE 'emailpro' %]
258
                                                        <span>Secondary email</span>
259
                                                    [% CASE 'fax' %]
260
                                                        <span>Fax</span>
261
                                                [% END %]
262
                                            </li>
249
                                            </li>
263
                                        [% END %]
250
                                        [% END %]
264
                                    </ol>
251
                                    </ol>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt (-44 / +11 lines)
Lines 606-656 Link Here
606
                                                    <label for="borrower_primary_contact_method">Main contact method:</label>
606
                                                    <label for="borrower_primary_contact_method">Main contact method:</label>
607
                                                [% END %]
607
                                                [% END %]
608
608
609
                                                <select id="borrower_primary_contact_method" name="borrower_primary_contact_method">
609
                                                [% SET contact_methods = AuthorisedValues.GetAuthValueDropbox('CONTACT_METHODS') %]
610
                                                [% IF contact_methods.count %]
611
                                                    <select id="borrower_primary_contact_method" name="borrower_primary_contact_method">
610
                                                    <option value=""></option>
612
                                                    <option value=""></option>
611
                                                    [% UNLESS hidden.defined('phone') %]
613
                                                        [% FOR contact_method IN contact_methods %]
612
                                                        [% IF ( borrower.primary_contact_method == 'phone' ) %]
614
                                                            [% IF contact_method.authorised_value == patron.primary_contact_method %]
613
                                                            <option value="phone" selected="selected">Primary phone</option>
615
                                                                <option value="[% contact_method.authorised_value | html %]" selected="selected">[% contact_method.lib | html %]</option>
614
                                                        [% ELSE %]
616
                                                            [% ELSE %]
615
                                                            <option value="phone">Primary phone</option>
617
                                                                <option value="[% contact_method.authorised_value | html %]">[% contact_method.lib | html %]</option>
616
                                                        [% END %]
618
                                                            [% END %]
617
                                                    [% END %]
618
                                                    [% UNLESS hidden.defined('phonepro') %]
619
                                                        [% IF ( borrower.primary_contact_method == 'phonepro' ) %]
620
                                                            <option value="phonepro" selected="selected">Secondary phone</option>
621
                                                        [% ELSE %]
622
                                                            <option value="phonepro">Secondary phone</option>
623
                                                        [% END %]
624
                                                    [% END %]
625
                                                    [% UNLESS hidden.defined('mobile') %]
626
                                                        [% IF ( borrower.primary_contact_method == 'mobile' ) %]
627
                                                            <option value="mobile" selected="selected">Other phone</option>
628
                                                        [% ELSE %]
629
                                                            <option value="mobile">Other phone</option>
630
                                                        [% END %]
631
                                                    [% END %]
632
                                                    [% UNLESS hidden.defined('email') %]
633
                                                        [% IF ( borrower.primary_contact_method == 'email' ) %]
634
                                                            <option value="email" selected="selected">Primary email</option>
635
                                                        [% ELSE %]
636
                                                            <option value="email">Primary email</option>
637
                                                        [% END %]
638
                                                    [% END %]
639
                                                    [% UNLESS hidden.defined('emailpro') %]
640
                                                        [% IF ( borrower.primary_contact_method == 'emailpro' ) %]
641
                                                            <option value="emailpro" selected="selected">Secondary email</option>
642
                                                        [% ELSE %]
643
                                                            <option value="emailpro">Secondary email</option>
644
                                                        [% END %]
645
                                                    [% END %]
646
                                                    [% UNLESS hidden.defined('fax') %]
647
                                                        [% IF ( borrower.primary_contact_method == 'fax' ) %]
648
                                                            <option value="fax" selected="selected">Fax</option>
649
                                                        [% ELSE %]
650
                                                            <option value="fax">Fax</option>
651
                                                        [% END %]
619
                                                        [% END %]
652
                                                    [% END %]
620
                                                    </select>
653
                                                </select>
621
                                                [% END %]
654
                                                [% IF ( mandatory.defined('primary_contact_method') ) %]<span class="required">Required</span>[% END %]
622
                                                [% IF ( mandatory.defined('primary_contact_method') ) %]<span class="required">Required</span>[% END %]
655
                                            </li>
623
                                            </li>
656
                                        [% END %]
624
                                        [% END %]
657
- 

Return to bug 31498