From: Moritz Bunkus Date: Mon, 9 Nov 2009 13:44:36 +0000 (+0100) Subject: Kosmetik. X-Git-Tag: release-2.6.1beta1~106 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=8f64093b4d58bd4bd72cd7465b7e402ad949eaf1;p=kivitendo-erp.git Kosmetik. --- diff --git a/sql/Pg-upgrade2/cp_greeting_migration.pl b/sql/Pg-upgrade2/cp_greeting_migration.pl index 3b978a542..46fa43885 100644 --- a/sql/Pg-upgrade2/cp_greeting_migration.pl +++ b/sql/Pg-upgrade2/cp_greeting_migration.pl @@ -8,8 +8,7 @@ die("This script cannot be run from the command line.") unless ($main::form); sub mydberror { my ($msg) = @_; - die($dbup_locale->text("Database update error:") . - "
$msg
" . $DBI::errstr); + die($dbup_locale->text("Database update error:") . "
$msg
" . $DBI::errstr); } sub do_query { @@ -41,14 +40,14 @@ sub query_result { if ($main::form->{"gender_$i"} eq "f" ) { $mchecked = ""; $fchecked = "checked"; - } else { + } else { $mchecked = "checked"; $fchecked = ""; - }; + }; - $gender_table .= "{cp_id}\"> $row->{cp_givenname} $row->{cp_name} $row->{cp_title} $row->{cp_greeting} \n"; - $i++; - }; + $gender_table .= "{cp_id}\"> $row->{cp_givenname} $row->{cp_name} $row->{cp_title} $row->{cp_greeting} \n"; + $i++; + } $gender_table .= ""; $gender_table .= ""; @@ -67,21 +66,18 @@ sub query_result { my $j = 1; while (my $row = $sth3->fetchrow_hashref()) { # Vorschlagsfeld fuer neuen Titel mit Werten von cp_greeting und cp_title vorbelegen - my $value = "$row->{cp_greeting}"; - $value .= " " if $row->{cp_greeting}; - $value .= "$row->{cp_title}"; + my $value = "$row->{cp_greeting}"; + $value .= " " if $row->{cp_greeting}; + $value .= "$row->{cp_title}"; - $title_table .= " {cp_id}> $row->{cp_givenname} $row->{cp_name}$row->{cp_title} $row->{cp_greeting} \n"; - $j++; - }; + $title_table .= " {cp_id}> $row->{cp_givenname} $row->{cp_name}$row->{cp_title} $row->{cp_greeting} \n"; + $j++; + } $title_table .= ""; $title_table .= ""; $main::form->{title_table} = $title_table; - -}; - - +} sub print_question { query_result(); @@ -113,9 +109,9 @@ sub do_update { } else { # case 2: submit button was pressed, hidden field do_migrate was set migrate_data(); - }; + } -return 1; + return 1; } @@ -133,15 +129,15 @@ EOF for (my $i = 1; $i <= $main::form->{number_of_gender_entries}; $i++ ) { next unless $main::form->{"cp_id_$i"}; - if ( $main::form->{"gender_$i"} eq "f" ) { - $sqlcode .= "UPDATE contacts SET cp_gender = \'f\' WHERE cp_id = $main::form->{\"cp_id_$i\"};\n"; - }; - }; + if ( $main::form->{"gender_$i"} eq "f" ) { + $sqlcode .= "UPDATE contacts SET cp_gender = \'f\' WHERE cp_id = $main::form->{\"cp_id_$i\"};\n"; + } + } for (my $i = 1; $i <= $main::form->{number_of_title_entries}; $i++ ) { next unless $main::form->{"cp_id_title_$i"} and $main::form->{"cp_id_$i"}; - $sqlcode .= "UPDATE contacts SET cp_title = \'$main::form->{\"cp_name_$i\"}\' WHERE cp_id = $main::form->{\"cp_id_$i\"};\n"; - }; + $sqlcode .= "UPDATE contacts SET cp_title = \'$main::form->{\"cp_name_$i\"}\' WHERE cp_id = $main::form->{\"cp_id_$i\"};\n"; + } $sqlcode .= "ALTER TABLE contacts DROP COLUMN cp_greeting;"; # insert chosen default values @@ -150,22 +146,18 @@ EOF my $query = $sqlcode; do_query($query); -}; - - +} sub set_default_greetings { # add html input boxes to template so user can specify default greetings - my $default_male = "Herr"; - my $default_female = "Frau"; - - my $default_greeting_text_male = "
"; - my $default_greeting_text_female = "
"; - $main::form->{default_greeting_text_male} = $default_greeting_text_male; + my $default_male = "Herr"; + my $default_female = "Frau"; + my $default_greeting_text_male = "
"; + my $default_greeting_text_female = "
"; + $main::form->{default_greeting_text_male} = $default_greeting_text_male; $main::form->{default_greeting_text_female} = $default_greeting_text_female; -}; - +} return do_update();