Revision d744e4f2
Von Sven Schöling vor etwa 15 Jahren hinzugefügt
SL/CT.pm | ||
---|---|---|
62 | 62 |
qq|ORDER BY cp.cp_id LIMIT 1|; |
63 | 63 |
my $sth = prepare_execute_query($form, $dbh, $query, $form->{id}); |
64 | 64 |
|
65 |
my $ref = $sth->fetchrow_hashref(NAME_lc);
|
|
65 |
my $ref = $sth->fetchrow_hashref("NAME_lc");
|
|
66 | 66 |
|
67 | 67 |
map { $form->{$_} = $ref->{$_} } keys %$ref; |
68 | 68 |
|
... | ... | |
116 | 116 |
if ($ref) { |
117 | 117 |
foreach my $key (keys %{ $ref }) { |
118 | 118 |
my $new_key = $key; |
119 |
$new_key =~ s/^([^_]+)/\U\1\E/;
|
|
119 |
$new_key =~ s/^([^_]+)/\U$1\E/;
|
|
120 | 120 |
$form->{$new_key} = $ref->{$key}; |
121 | 121 |
} |
122 | 122 |
} |
... | ... | |
155 | 155 |
$main::lxdebug->enter_sub(); |
156 | 156 |
|
157 | 157 |
my ($self, $myconfig, $form, $provided_dbh) = @_; |
158 |
my $query; |
|
158 | 159 |
|
159 | 160 |
my $dbh = $provided_dbh ? $provided_dbh : $form->dbconnect($myconfig); |
160 | 161 |
|
... | ... | |
190 | 191 |
$main::lxdebug->enter_sub(); |
191 | 192 |
|
192 | 193 |
my ( $self, $myconfig, $form ) = @_; |
193 |
my ( %tmp, $ref ); |
|
194 |
my ( %tmp, $ref, $query );
|
|
194 | 195 |
|
195 | 196 |
my $dbh = $form->dbconnect($myconfig); |
196 | 197 |
|
... | ... | |
203 | 204 |
qq|FROM vendor | . |
204 | 205 |
qq|WHERE greeting ~ '[a-zA-Z]' | . |
205 | 206 |
qq|ORDER BY greeting|; |
206 |
my %tmp; |
|
207 |
|
|
207 | 208 |
map({ $tmp{$_} = 1; } selectall_array_query($form, $dbh, $query)); |
208 | 209 |
$form->{COMPANY_GREETINGS} = [ sort(keys(%tmp)) ]; |
209 | 210 |
|
... | ... | |
449 | 450 |
'variables' => $form, |
450 | 451 |
'always_valid' => 1); |
451 | 452 |
|
452 |
$rc = $dbh->commit(); |
|
453 |
my $rc = $dbh->commit();
|
|
453 | 454 |
$dbh->disconnect(); |
454 | 455 |
|
455 | 456 |
$main::lxdebug->leave_sub(); |
... | ... | |
530 | 531 |
qq| user_password = ?, | . |
531 | 532 |
qq| v_customer_id = ? | . |
532 | 533 |
qq|WHERE id = ?|; |
533 |
@values = ( |
|
534 |
my @values = (
|
|
534 | 535 |
$form->{vendornumber}, |
535 | 536 |
$form->{name}, |
536 | 537 |
$form->{greeting}, |
... | ... | |
655 | 656 |
'variables' => $form, |
656 | 657 |
'always_valid' => 1); |
657 | 658 |
|
658 |
$rc = $dbh->commit(); |
|
659 |
my $rc = $dbh->commit();
|
|
659 | 660 |
$dbh->disconnect(); |
660 | 661 |
|
661 | 662 |
$main::lxdebug->leave_sub(); |
... | ... | |
695 | 696 |
my %allowed_sort_columns = |
696 | 697 |
map({ $_, 1 } qw(id customernumber vendornumber name contact phone fax email |
697 | 698 |
taxnumber business invnumber ordnumber quonumber)); |
698 |
$sortorder = $form->{sort} && $allowed_sort_columns{$form->{sort}} ? $form->{sort} : "name"; |
|
699 |
my $sortorder = $form->{sort} && $allowed_sort_columns{$form->{sort}} ? $form->{sort} : "name";
|
|
699 | 700 |
$form->{sort} = $sortorder; |
700 | 701 |
my $sortdir = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC'; |
701 | 702 |
|
... | ... | |
862 | 863 |
qq|SELECT * FROM contacts c | . |
863 | 864 |
qq|WHERE cp_id = ? ORDER BY cp_id limit 1|; |
864 | 865 |
my $sth = prepare_execute_query($form, $dbh, $query, $form->{cp_id}); |
865 |
my $ref = $sth->fetchrow_hashref(NAME_lc);
|
|
866 |
my $ref = $sth->fetchrow_hashref("NAME_lc");
|
|
866 | 867 |
|
867 | 868 |
map { $form->{$_} = $ref->{$_} } keys %$ref; |
868 | 869 |
|
... | ... | |
888 | 889 |
my $query = qq|SELECT * FROM shipto WHERE shipto_id = ?|; |
889 | 890 |
my $sth = prepare_execute_query($form, $dbh, $query, $form->{shipto_id}); |
890 | 891 |
|
891 |
my $ref = $sth->fetchrow_hashref(NAME_lc);
|
|
892 |
my $ref = $sth->fetchrow_hashref("NAME_lc");
|
|
892 | 893 |
|
893 | 894 |
map { $form->{$_} = $ref->{$_} } keys %$ref; |
894 | 895 |
|
... | ... | |
1036 | 1037 |
$main::lxdebug->leave_sub(); |
1037 | 1038 |
} |
1038 | 1039 |
|
1039 |
sub delete_shipto { |
|
1040 |
$main::lxdebug->enter_sub(); |
|
1041 |
|
|
1042 |
my $self = shift; |
|
1043 |
my $shipto_id = shift; |
|
1044 |
|
|
1045 |
my $form = $main::form; |
|
1046 |
my %myconfig = %main::myconfig; |
|
1047 |
my $dbh = $form->get_standard_dbh(\%myconfig); |
|
1048 |
|
|
1049 |
do_query($form, $dbh, qq|UPDATE shipto SET trans_id = NULL WHERE shipto_id = ?|, $shipto_id); |
|
1050 |
|
|
1051 |
$dbh->commit(); |
|
1052 |
|
|
1053 |
$main::lxdebug->leave_sub(); |
|
1054 |
} |
|
1055 |
|
|
1056 | 1040 |
sub delete_shipto { |
1057 | 1041 |
$main::lxdebug->enter_sub(); |
1058 | 1042 |
|
Auch abrufbar als: Unified diff
strictness