From: Moritz Bunkus Date: Mon, 14 Jan 2013 13:35:51 +0000 (+0100) Subject: Spalte 'cp_function' in 'cp_position' umbenennen zwecks Kompatibilität mit CRM X-Git-Tag: release-3.1.0beta1~704 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=604765d5156076bdac2e2bf305ec287c6b0a0096;p=kivitendo-erp.git Spalte 'cp_function' in 'cp_position' umbenennen zwecks Kompatibilität mit CRM --- diff --git a/SL/CT.pm b/SL/CT.pm index a19609525..a32486b59 100644 --- a/SL/CT.pm +++ b/SL/CT.pm @@ -551,7 +551,7 @@ sub _save_contact { my @columns = qw(cp_title cp_givenname cp_name cp_email cp_phone1 cp_phone2 cp_abteilung cp_fax cp_mobile1 cp_mobile2 cp_satphone cp_satfax cp_project cp_privatphone cp_privatemail cp_birthday cp_gender - cp_street cp_zipcode cp_city cp_function); + cp_street cp_zipcode cp_city cp_position); my @values = map( { if ( $_ eq 'cp_gender' ) { @@ -1123,7 +1123,7 @@ sub search_contacts { 'vcnumber' => 'vcnumber, cp_name, cp_givenname', ); - my %sortcols = map { $_ => 1 } qw(cp_name cp_givenname cp_phone1 cp_phone2 cp_mobile1 cp_email cp_street cp_zipcode cp_city cp_function vcname vcnumber); + my %sortcols = map { $_ => 1 } qw(cp_name cp_givenname cp_phone1 cp_phone2 cp_mobile1 cp_email cp_street cp_zipcode cp_city cp_position vcname vcnumber); my $order_by = $sortcols{$::form->{sort}} ? $::form->{sort} : 'cp_name'; $::form->{sort} = $order_by; diff --git a/SL/DB/MetaSetup/Contact.pm b/SL/DB/MetaSetup/Contact.pm index 20dae29d5..8dd8b5b6d 100644 --- a/SL/DB/MetaSetup/Contact.pm +++ b/SL/DB/MetaSetup/Contact.pm @@ -34,7 +34,7 @@ __PACKAGE__->meta->setup( cp_zipcode => { type => 'text' }, cp_city => { type => 'text' }, cp_birthday => { type => 'date' }, - cp_function => { type => 'text' }, + cp_position => { type => 'character', length => 75 }, ], primary_key_columns => [ 'cp_id' ], diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl index 7c1b2248f..ff7eedef6 100644 --- a/bin/mozilla/ct.pl +++ b/bin/mozilla/ct.pl @@ -303,7 +303,7 @@ sub list_contacts { my @columns = qw( cp_id vcname vcnumber cp_name cp_givenname cp_street cp_zipcode cp_city cp_phone1 cp_phone2 - cp_mobile1 cp_mobile2 cp_email cp_abteilung cp_function cp_birthday cp_gender + cp_mobile1 cp_mobile2 cp_email cp_abteilung cp_position cp_birthday cp_gender ); my @includeable_custom_variables = grep { $_->{includeable} } @{ $cvar_configs }; @@ -336,7 +336,7 @@ sub list_contacts { 'cp_mobile2' => { 'text' => $::locale->text('Mobile2'), }, 'cp_email' => { 'text' => $::locale->text('E-mail'), }, 'cp_abteilung' => { 'text' => $::locale->text('Department'), }, - 'cp_function' => { 'text' => $::locale->text('Function/position'), }, + 'cp_position' => { 'text' => $::locale->text('Function/position'), }, 'cp_birthday' => { 'text' => $::locale->text('Birthday'), }, 'cp_gender' => { 'text' => $::locale->text('Gender'), }, %column_defs_cvars, diff --git a/sql/Pg-upgrade2/contacts_add_cp_function.sql b/sql/Pg-upgrade2/contacts_add_cp_function.sql deleted file mode 100644 index 571d61e3d..000000000 --- a/sql/Pg-upgrade2/contacts_add_cp_function.sql +++ /dev/null @@ -1,5 +0,0 @@ --- @tag: contacts_add_cp_function --- @description: Feld 'Funktion/Position' zu Kontakten --- @depends: release_3_0_0 --- @charset: utf-8 -ALTER TABLE contacts ADD COLUMN cp_function text; diff --git a/sql/Pg-upgrade2/contacts_add_cp_position.pl b/sql/Pg-upgrade2/contacts_add_cp_position.pl new file mode 100644 index 000000000..bd5470777 --- /dev/null +++ b/sql/Pg-upgrade2/contacts_add_cp_position.pl @@ -0,0 +1,18 @@ +# @tag: contacts_add_cp_position +# @description: Feld 'Funktion/Position' zu Kontakten +# @depends: release_3_0_0 +# @charset: utf-8 + +package contacts_add_cp_position; +use strict; + +die 'This script cannot be run from the command line.' if !$::form; + +my $query = 'ALTER TABLE contacts ADD COLUMN cp_position VARCHAR(75)'; + +if (!$dbh->do($query)) { + $dbh->rollback; + $dbh->begin_work; +} + +1; diff --git a/templates/webpages/ct/_contact.html b/templates/webpages/ct/_contact.html index f6c9b8a5a..d1db2e228 100644 --- a/templates/webpages/ct/_contact.html +++ b/templates/webpages/ct/_contact.html @@ -37,7 +37,7 @@ [% 'Function/position' | $T8 %] - [% L.input_tag('cp_function', cp_function, size=40) %] + [% L.input_tag('cp_position', cp_position, size=40, maxlength=75) %] diff --git a/templates/webpages/ct/search_contact.html b/templates/webpages/ct/search_contact.html index af95c2d00..fe26d47de 100644 --- a/templates/webpages/ct/search_contact.html +++ b/templates/webpages/ct/search_contact.html @@ -113,7 +113,7 @@ - [% L.checkbox_tag('l.cp_function', value='Y', label=LxERP.t8('Function/position'), class='checkbox') %] + [% L.checkbox_tag('l.cp_position', value='Y', label=LxERP.t8('Function/position'), class='checkbox') %]