From 3114dd83ecdb6d435dee7bf74c2e789924544298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9rick?= Date: Fri, 28 Feb 2014 15:08:08 -0500 Subject: [PATCH] Add the "Main contact method" field in borrower informations. Used for reporting and contact purposes. --- installer/data/mysql/updatedatabase.pl | 8 ++++++ .../prog/en/modules/members/memberentrygen.tt | 26 ++++++++++++++++++++ members/memberentry.pl | 12 +++++++++ 3 files changed, 46 insertions(+), 0 deletions(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index c8e883f..4384db1 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -8012,6 +8012,14 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { SetVersion($DBversion); } +$DBversion = "XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do("ALTER TABLE `borrowers` ADD COLUMN `contactprincipal` VARCHAR(45) NULL DEFAULT NULL;"); + print "Upgrade to $DBversion done (Add the contactprincipal column to the borrowers table)\n"; + SetVersion($DBversion); +} + + =head1 FUNCTIONS =head2 TableExists($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index 16ada5c..edf103d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -642,6 +642,32 @@ [% IF ( mandatoryfax ) %]Required[% END %] +
  • + + +
  • [% END %] diff --git a/members/memberentry.pl b/members/memberentry.pl index 429768a..99970fb 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -525,6 +525,18 @@ foreach (qw(C A S P I X)) { $template->param('typeloop' => \@typeloop, no_categories => $no_categories); if($no_categories){ $no_add = 1; } + +my @contactprincipalloop; +foreach (qw(phone phonepro mobile email emailpro fax)) { + push @contactprincipalloop,{ + 'code' => $_, + 'selected' => (defined($borrower_data->{'contactprincipal'}) && + $_ eq $borrower_data->{'contactprincipal'}), + 'currentis_' . $_ => 1 + }; +} +$template->param('contactprincipalloop' => \@contactprincipalloop); + # test in city if ( $guarantorid ) { $select_city = getidcity($data{city}); -- 1.7.2.5