projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Artikel-Controller: Workflow zu Lieferantenauftrag
[kivitendo-erp.git]
/
SL
/
CT.pm
diff --git
a/SL/CT.pm
b/SL/CT.pm
index
f901a3e
..
b52c879
100644
(file)
--- a/
SL/CT.pm
+++ b/
SL/CT.pm
@@
-246,21
+246,25
@@
sub search {
}
if ($form->{all_phonenumbers}) {
}
if ($form->{all_phonenumbers}) {
- $where .= qq| AND (ct.phone ILIKE ? OR
- ct.fax ILIKE ? OR
+ my $search_term = trim($form->{all_phonenumbers});
+ $search_term =~ s{\p{WSpace}+}{}g;
+ $search_term = join ' *', split(//, $search_term);
+
+ $where .= qq| AND (ct.phone ~* ? OR
+ ct.fax ~* ? OR
ct.id IN
(SELECT cp_cv_id FROM contacts
ct.id IN
(SELECT cp_cv_id FROM contacts
- WHERE cp_phone1
ILIKE
? OR
- cp_phone2
ILIKE
? OR
- cp_fax
ILIKE
? OR
- cp_mobile1
ILIKE
? OR
- cp_mobile2
ILIKE
? OR
- cp_satphone
ILIKE
? OR
- cp_satfax
ILIKE
? OR
- cp_privatphone
ILIKE
?
+ WHERE cp_phone1
~*
? OR
+ cp_phone2
~*
? OR
+ cp_fax
~*
? OR
+ cp_mobile1
~*
? OR
+ cp_mobile2
~*
? OR
+ cp_satphone
~*
? OR
+ cp_satfax
~*
? OR
+ cp_privatphone
~*
?
)
)|;
)
)|;
- push @values, (
like(trim($form->{all_phonenumbers}))
)x10;
+ push @values, (
$search_term
)x10;
}
my ($cvar_where, @cvar_values) = CVar->build_filter_query('module' => 'CT',
}
my ($cvar_where, @cvar_values) = CVar->build_filter_query('module' => 'CT',