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

(-)a/installer/data/mysql/updatedatabase.pl (-2 / +2 lines)
Lines 8014-8021 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
8014
8014
8015
$DBversion = "XXX";
8015
$DBversion = "XXX";
8016
if ( CheckVersion($DBversion) ) {
8016
if ( CheckVersion($DBversion) ) {
8017
    $dbh->do("ALTER TABLE `borrowers` ADD COLUMN `contactprincipal` VARCHAR(45) NULL DEFAULT NULL;");
8017
    $dbh->do("ALTER TABLE `borrowers` ADD COLUMN `primary_contact_method` VARCHAR(45) NULL DEFAULT NULL;");
8018
    print "Upgrade to $DBversion done (Add the contactprincipal column to the borrowers table)\n";
8018
    print "Upgrade to $DBversion done (Add the primary_contact_method column to the borrowers table)\n";
8019
    SetVersion($DBversion);
8019
    SetVersion($DBversion);
8020
}
8020
}
8021
8021
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-17 / +32 lines)
Lines 643-677 Link Here
643
	  [% IF ( mandatoryfax ) %]<span class="required">Required</span>[% END %]
643
	  [% IF ( mandatoryfax ) %]<span class="required">Required</span>[% END %]
644
    </li>
644
    </li>
645
    <li>
645
    <li>
646
        <label for="contactprincipal">Main Contact Method</label>
646
        <label for="primary_contact_method">Main Contact Method</label>
647
        <select id="contactprincipal" name="contactprincipal">
647
        <select id="primary_contact_method" name="primary_contact_method">
648
            <option value=""></option>
648
            <option value=""></option>
649
        [% FOREACH contactprincipalloo IN contactprincipalloop %]
649
            [% IF ( primary_contact_method == 'phone' ) %]
650
            [% IF ( contactprincipalloo.currentis_phone ) %]
650
                <option value="phone" selected="selected">Primary phone</option>
651
                <option value="phone" [% IF ( contactprincipalloo.selected ) %]selected="selected"[% END %]>Phone (home)</option>
651
            [% ELSE %]
652
                <option value="phone">Primary phone</option>
652
            [% END %]
653
            [% END %]
653
            [% IF ( contactprincipalloo.currentis_phonepro ) %]
654
654
                <option value="phonepro" [% IF ( contactprincipalloo.selected ) %]selected="selected"[% END %]>Phone (work)</option>
655
            [% IF ( primary_contact_method == 'phonepro' ) %]
656
                <option value="phonepro" selected="selected">Secondary phone</option>
657
            [% ELSE %]
658
                <option value="phonepro">Secondary phone</option>
655
            [% END %]
659
            [% END %]
656
            [% IF ( contactprincipalloo.currentis_mobile ) %]
660
657
                <option value="mobile" [% IF ( contactprincipalloo.selected ) %]selected="selected"[% END %]>Phone (cell)</option>
661
            [% IF ( primary_contact_method == 'mobile' ) %]
662
                <option value="mobile" selected="selected">Other phone</option>
663
            [% ELSE %]
664
                <option value="mobile">Other phone</option>
658
            [% END %]
665
            [% END %]
659
            [% IF ( contactprincipalloo.currentis_email ) %]
666
660
                <option value="email" [% IF ( contactprincipalloo.selected ) %]selected="selected"[% END %]>Email (home)</option>
667
            [% IF ( primary_contact_method == 'email' ) %]
668
                <option value="email" selected="selected">Primary email</option>
669
            [% ELSE %]
670
                <option value="email">Primary email</option>
661
            [% END %]
671
            [% END %]
662
            [% IF ( contactprincipalloo.currentis_emailpro ) %]
672
663
                <option value="emailpro" [% IF ( contactprincipalloo.selected ) %]selected="selected"[% END %]>Email (work)</option>
673
            [% IF ( primary_contact_method == 'emailpro' ) %]
674
                <option value="emailpro" selected="selected">Secondary email</option>
675
            [% ELSE %]
676
                <option value="emailpro">Secondary email</option>
664
            [% END %]
677
            [% END %]
665
            [% IF ( contactprincipalloo.currentis_fax ) %]
678
666
                <option value="fax" [% IF ( contactprincipalloo.selected ) %]selected="selected"[% END %]>Fax</option>
679
            [% IF ( primary_contact_method == 'fax' ) %]
680
                <option value="fax" selected="selected">Fax</option>
681
            [% ELSE %]
682
                <option value="fax">Fax</option>
667
            [% END %]
683
            [% END %]
668
       [% END %]
669
       </select>
684
       </select>
670
    </li>
685
    </li>
671
        [% END %]
686
        [% END %]
672
	</ol>
687
	</ol>
673
  </fieldset>
688
  </fieldset>
674
[%END # hide fieldset %]
689
[% END # hide fieldset %]
675
690
676
<!-- ************************ STEP_1 *********************** -->
691
<!-- ************************ STEP_1 *********************** -->
677
[% END %]
692
[% END %]
(-)a/members/memberentry.pl (-12 lines)
Lines 526-542 $template->param('typeloop' => \@typeloop, Link Here
526
        no_categories => $no_categories);
526
        no_categories => $no_categories);
527
if($no_categories){ $no_add = 1; }
527
if($no_categories){ $no_add = 1; }
528
528
529
my @contactprincipalloop;
530
foreach (qw(phone phonepro mobile email emailpro fax)) {
531
    push @contactprincipalloop,{
532
        'code' => $_,
533
        'selected' => (defined($borrower_data->{'contactprincipal'}) &&
534
            $_ eq $borrower_data->{'contactprincipal'}),
535
        'currentis_' . $_ => 1
536
     };
537
}
538
$template->param('contactprincipalloop' => \@contactprincipalloop);
539
540
# test in city
529
# test in city
541
if ( $guarantorid ) {
530
if ( $guarantorid ) {
542
    $select_city = getidcity($data{city});
531
    $select_city = getidcity($data{city});
543
- 

Return to bug 11879