Revision 5c5c1eef
Von Moritz Bunkus vor fast 12 Jahren hinzugefügt
SL/Projects.pm | ||
---|---|---|
94 | 94 |
push @filters, 'NOT COALESCE(p.active, FALSE)'; |
95 | 95 |
} |
96 | 96 |
|
97 |
if ($params{valid} eq "valid") { |
|
98 |
push @filters, 'p.valid'; |
|
99 |
|
|
100 |
} elsif ($params{valid} eq "invalid") { |
|
101 |
push @filters, 'NOT COALESCE(p.valid, FALSE)'; |
|
102 |
} |
|
103 |
|
|
104 |
if ($params{customer}) { |
|
105 |
push @filters, 'c.name ILIKE ?'; |
|
106 |
push @values, '%' . $params{customer} . '%'; |
|
107 |
} |
|
108 |
|
|
109 |
if ($params{type}) { |
|
110 |
push @filters, 'p.type ILIKE ?'; |
|
111 |
push @values, '%' . $params{type} . '%'; |
|
112 |
} |
|
113 |
|
|
97 | 114 |
my ($cvar_where, @cvar_values) = CVar->build_filter_query('module' => 'Projects', |
98 | 115 |
'trans_id_field' => 'p.id', |
99 | 116 |
'filter' => $form); |
... | ... | |
108 | 125 |
|
109 | 126 |
my $sortorder = $params{sort} ? $params{sort} : "projectnumber"; |
110 | 127 |
$sortorder =~ s/[^a-z_]//g; |
111 |
my $query = qq|SELECT p.id, p.projectnumber, p.description, p.active |
|
128 |
my $query = qq|SELECT p.id, p.projectnumber, p.description, p.active, p.valid, p.type, |
|
129 |
c.name AS customer |
|
112 | 130 |
FROM project p |
131 |
LEFT JOIN customer c ON (p.customer_id = c.id) |
|
113 | 132 |
$where |
114 | 133 |
ORDER BY $sortorder|; |
115 | 134 |
|
... | ... | |
180 | 199 |
$params{active} = 1; |
181 | 200 |
} |
182 | 201 |
|
183 |
my $query = qq|UPDATE project SET projectnumber = ?, description = ?, active = ? |
|
184 |
WHERE id = ?|; |
|
202 |
my $query = <<SQL; |
|
203 |
UPDATE project |
|
204 |
SET projectnumber = ?, description = ?, active = ?, customer_id = ?, type = ?, valid = ? |
|
205 |
WHERE id = ? |
|
206 |
SQL |
|
185 | 207 |
|
186 |
@values = ($params{projectnumber}, $params{description}, $params{active} ? 't' : 'f', conv_i($params{id})); |
|
208 |
@values = ($params{projectnumber}, $params{description}, $params{active} ? 't' : 'f', conv_i($params{customer_id}), $params{type}, $params{valid} ? 't' : 'f', conv_i($params{id}));
|
|
187 | 209 |
do_query($form, $dbh, $query, @values); |
188 | 210 |
|
189 | 211 |
CVar->save_custom_variables('dbh' => $dbh, |
... | ... | |
220 | 242 |
} |
221 | 243 |
|
222 | 244 |
1; |
223 |
|
Auch abrufbar als: Unified diff
Projekt: neue Spalten (Kunde, Typ, gültig)