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

(-)a/installer/data/mysql/atomicupdate/borrowers_primary_contact_method.sql (+1 lines)
Line 0 Link Here
1
ALTER TABLE `borrowers` ADD COLUMN `primary_contact_method` VARCHAR(45) NULL DEFAULT NULL;
(-)a/installer/data/mysql/updatedatabase.pl (-6 / +1 lines)
Lines 8719-8730 if ( CheckVersion($DBversion) ) { Link Here
8719
    print "Upgrade to $DBversion done (Bug 10402: Move bookseller contacts to separate table)\n";
8719
    print "Upgrade to $DBversion done (Bug 10402: Move bookseller contacts to separate table)\n";
8720
    SetVersion($DBversion);
8720
    SetVersion($DBversion);
8721
}
8721
}
8722
$DBversion = "XXX";
8723
if ( CheckVersion($DBversion) ) {
8724
    $dbh->do("ALTER TABLE `borrowers` ADD COLUMN `primary_contact_method` VARCHAR(45) NULL DEFAULT NULL;");
8725
    print "Upgrade to $DBversion done (Bug 11879: Add a new borrower field : main contact method)\n";
8726
    SetVersion($DBversion);
8727
}
8728
8722
8729
$DBversion = "3.17.00.017";
8723
$DBversion = "3.17.00.017";
8730
if ( CheckVersion($DBversion) ) {
8724
if ( CheckVersion($DBversion) ) {
Lines 11915-11920 foreach my $file ( sort readdir $dirh ) { Link Here
11915
    }
11909
    }
11916
}
11910
}
11917
11911
11912
11918
=head1 FUNCTIONS
11913
=head1 FUNCTIONS
11919
11914
11920
=head2 TableExists($table)
11915
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-27 / +41 lines)
Lines 455-461 Link Here
455
	  [% IF ( mandatoryemailpro ) %]<span class="required">Required</span>[% END %]
455
	  [% IF ( mandatoryemailpro ) %]<span class="required">Required</span>[% END %]
456
    </li>
456
    </li>
457
        [% END %]
457
        [% END %]
458
        [% UNLESS nofax %]
458
    [% UNLESS nofax %]
459
    <li>
459
    <li>
460
      [% IF ( mandatoryfax ) %]
460
      [% IF ( mandatoryfax ) %]
461
      <label for="fax" class="required">
461
      <label for="fax" class="required">
Lines 466-509 Link Here
466
        <input type="text" id="fax" name="fax" value="[% fax %]" />
466
        <input type="text" id="fax" name="fax" value="[% fax %]" />
467
	  [% IF ( mandatoryfax ) %]<span class="required">Required</span>[% END %]
467
	  [% IF ( mandatoryfax ) %]<span class="required">Required</span>[% END %]
468
    </li>
468
    </li>
469
   [% END %]
469
    <li>
470
    <li>
470
       <label for="primary_contact_method">Main Contact Method</label>
471
       <label for="primary_contact_method">Main Contact Method</label>
471
       <select id="primary_contact_method" name="primary_contact_method">
472
       <select id="primary_contact_method" name="primary_contact_method">
472
       <option value=""></option>
473
       <option value=""></option>
473
            [% IF ( primary_contact_method == 'phone' ) %]
474
         [% FOREACH contactprincipalloo IN contactprincipalloop %]
474
                <option value="phone" selected="selected">Primary phone</option>
475
            [% IF ( contactprincipalloo.currentis_phone ) %]
475
            [% ELSE %]
476
               [% IF ( primary_contact_method == 'phone' ) %]
476
                <option value="phone">Primary phone</option>
477
                 <option value="phone" selected="selected">Primary phone</option>
478
               [% ELSE %]
479
                 <option value="phone">Primary phone</option>
480
               [% END %]
477
            [% END %]
481
            [% END %]
478
            [% IF ( primary_contact_method == 'phonepro' ) %]
482
            [% IF ( contactprincipalloo.currentis_phonepro ) %]
479
                <option value="phonepro" selected="selected">Secondary phone</option>
483
               [% IF ( primary_contact_method == 'phonepro' ) %]
480
            [% ELSE %]
484
                 <option value="phonepro" selected="selected">Secondary phone</option>
481
                <option value="phonepro">Secondary phone</option>
485
               [% ELSE %]
486
                 <option value="phonepro">Secondary phone</option>
487
               [% END %]
482
            [% END %]
488
            [% END %]
483
            [% IF ( primary_contact_method == 'mobile' ) %]
489
            [% IF ( contactprincipalloo.currentis_mobile ) %]
484
                <option value="mobile" selected="selected">Other phone</option>
490
               [% IF ( primary_contact_method == 'mobile' ) %]
485
            [% ELSE %]
491
                 <option value="mobile" selected="selected">Mobile phone</option>
486
                <option value="mobile">Other phone</option>
492
               [% ELSE %]
493
                 <option value="mobile">Mobile phone</option>
494
               [% END %]
487
            [% END %]
495
            [% END %]
488
            [% IF ( primary_contact_method == 'email' ) %]
496
            [% IF ( contactprincipalloo.currentis_email ) %]
489
                <option value="email" selected="selected">Primary email</option>
497
               [% IF ( primary_contact_method == 'email' ) %]
490
            [% ELSE %]
498
                 <option value="email" selected="selected">Primary email</option>
491
                <option value="email">Primary email</option>
499
               [% ELSE %]
500
                 <option value="email">Primary email</option>
501
               [% END %]
492
            [% END %]
502
            [% END %]
493
            [% IF ( primary_contact_method == 'emailpro' ) %]
503
            [% IF ( contactprincipalloo.currentis_emailpro ) %]
494
                <option value="emailpro" selected="selected">Secondary email</option>
504
               [% IF ( primary_contact_method == 'emailpro' ) %]
495
            [% ELSE %]
505
                 <option value="emailpro" selected="selected">Secondary email</option>
496
                <option value="emailpro">Secondary email</option>
506
               [% ELSE %]
507
                 <option value="emailpro">Secondary email</option>
508
               [% END %]
497
            [% END %]
509
            [% END %]
498
            [% IF ( primary_contact_method == 'fax' ) %]
510
            [% IF ( contactprincipalloo.currentis_fax ) %]
499
                <option value="fax" selected="selected">Fax</option>
511
               [% IF ( primary_contact_method == 'fax' ) %]
500
            [% ELSE %]
512
                 <option value="fax" selected="selected">Fax</option>
501
                <option value="fax">Fax</option>
513
               [% ELSE %]
514
                 <option value="fax">Fax</option>
515
               [% END %]
502
            [% END %]
516
            [% END %]
517
         [% END %]
503
       </select>
518
       </select>
504
    </li>
519
    </li>
505
        [% END %]
520
    </ol>
506
	</ol>
507
  </fieldset>
521
  </fieldset>
508
[%END # hide fieldset %]
522
[%END # hide fieldset %]
509
523
(-)a/members/memberentry.pl (-1 / +10 lines)
Lines 537-542 $template->param('typeloop' => \@typeloop, Link Here
537
        no_categories => $no_categories);
537
        no_categories => $no_categories);
538
if($no_categories){ $no_add = 1; }
538
if($no_categories){ $no_add = 1; }
539
539
540
my @contactprincipalloop;
541
my @fieldArray = qw(phone phonepro mobile email emailpro fax);
542
foreach my $field (@fieldArray) {
543
   if ( !(grep { $field eq $_ } @field_check)){
544
        push @contactprincipalloop,{
545
            'currentis_' . $field => 1
546
        };
547
    }
548
}
549
$template->param('contactprincipalloop' => \@contactprincipalloop);
540
550
541
my $cities = Koha::Cities->search( {}, { order_by => 'city_name' } );
551
my $cities = Koha::Cities->search( {}, { order_by => 'city_name' } );
542
my $roadtypes = C4::Koha::GetAuthorisedValues( 'ROADTYPE', $data{streettype} );
552
my $roadtypes = C4::Koha::GetAuthorisedValues( 'ROADTYPE', $data{streettype} );
543
- 

Return to bug 11879