Revision 96e32f35
Von Bernd Bleßmann vor mehr als 2 Jahren hinzugefügt
SL/CT.pm | ||
---|---|---|
246 | 246 |
} |
247 | 247 |
|
248 | 248 |
if ($form->{all_phonenumbers}) { |
249 |
$where .= qq| AND (ct.phone ILIKE ? OR |
|
250 |
ct.fax ILIKE ? OR |
|
249 |
my $search_term = trim($form->{all_phonenumbers}); |
|
250 |
$search_term =~ s{\p{WSpace}+}{}g; |
|
251 |
$search_term = join ' *', split(//, $search_term); |
|
252 |
|
|
253 |
$where .= qq| AND (ct.phone ~* ? OR |
|
254 |
ct.fax ~* ? OR |
|
251 | 255 |
ct.id IN |
252 | 256 |
(SELECT cp_cv_id FROM contacts |
253 |
WHERE cp_phone1 ILIKE ? OR
|
|
254 |
cp_phone2 ILIKE ? OR
|
|
255 |
cp_fax ILIKE ? OR
|
|
256 |
cp_mobile1 ILIKE ? OR
|
|
257 |
cp_mobile2 ILIKE ? OR
|
|
258 |
cp_satphone ILIKE ? OR
|
|
259 |
cp_satfax ILIKE ? OR
|
|
260 |
cp_privatphone ILIKE ?
|
|
257 |
WHERE cp_phone1 ~* ? OR
|
|
258 |
cp_phone2 ~* ? OR
|
|
259 |
cp_fax ~* ? OR
|
|
260 |
cp_mobile1 ~* ? OR
|
|
261 |
cp_mobile2 ~* ? OR
|
|
262 |
cp_satphone ~* ? OR
|
|
263 |
cp_satfax ~* ? OR
|
|
264 |
cp_privatphone ~* ?
|
|
261 | 265 |
) |
262 | 266 |
)|; |
263 |
push @values, (like(trim($form->{all_phonenumbers})))x10;
|
|
267 |
push @values, ($search_term)x10;
|
|
264 | 268 |
} |
265 | 269 |
|
266 | 270 |
my ($cvar_where, @cvar_values) = CVar->build_filter_query('module' => 'CT', |
Auch abrufbar als: Unified diff
Kunden-/Lieferanten-Suche nach allen Telefonnummern: Leerzeichen ignorieren.
Sowohl in der Sucheingabe, als auch beim Vergleich der DB-Einträge.