Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
fef06eef
Commit
fef06eef
authored
18 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
La recherche société recherche aussi dans email et url
parent
68f01260
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/societe.php
+17
-6
17 additions, 6 deletions
htdocs/societe.php
with
17 additions
and
6 deletions
htdocs/societe.php
+
17
−
6
View file @
fef06eef
...
...
@@ -82,9 +82,14 @@ if ($mode == 'search')
$sql
=
"SELECT s.idp"
;
if
(
!
$user
->
rights
->
commercial
->
client
->
voir
&&
!
$socid
)
$sql
.
=
", sc.fk_soc, sc.fk_user"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"societe as s"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"societe as s"
;
if
(
!
$user
->
rights
->
commercial
->
client
->
voir
&&
!
$socid
)
$sql
.
=
", "
.
MAIN_DB_PREFIX
.
"societe_commerciaux as sc"
;
$sql
.
=
" WHERE s.nom like '%"
.
$socname
.
"%'"
;
$sql
.
=
" WHERE ("
;
$sql
.
=
"s.nom like '%"
.
$socname
.
"%'"
;
$sql
.
=
" OR s.code_client LIKE '%"
.
$socname
.
"%'"
;
$sql
.
=
" OR s.email like '%"
.
$socname
.
"%'"
;
$sql
.
=
" OR s.url like '%"
.
$socname
.
"%'"
;
$sql
.
=
")"
;
if
(
!
$user
->
rights
->
commercial
->
client
->
voir
&&
!
$socid
)
$sql
.
=
" AND s.idp = sc.fk_soc AND sc.fk_user = "
.
$user
->
id
;
$result
=
$db
->
query
(
$sql
);
...
...
@@ -94,7 +99,7 @@ if ($mode == 'search')
{
$obj
=
$db
->
fetch_object
(
$result
);
$socid
=
$obj
->
idp
;
header
(
"
l
ocation: soc.php?socid=
$socid
"
);
header
(
"
L
ocation: soc.php?socid=
$socid
"
);
exit
;
}
$db
->
free
(
$result
);
...
...
@@ -135,7 +140,7 @@ if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", ".MAIN_DB_PR
$sql
.
=
" WHERE s.fk_stcomm = st.id"
;
if
(
$socid
)
{
$sql
.
=
" AND s.idp =
$socid
"
;
$sql
.
=
" AND s.idp =
"
.
$socid
;
}
if
(
$socname
)
...
...
@@ -152,8 +157,14 @@ if (!$user->rights->commercial->client->voir && !$socid) //restriction
$sql
.
=
" AND s.idp = sc.fk_soc AND sc.fk_user = "
.
$user
->
id
;
}
if
(
$search_nom
)
{
$sql
.
=
" AND (s.nom LIKE '%"
.
$search_nom
.
"%' OR s.code_client LIKE '%"
.
$search_nom
.
"%')"
;
if
(
$search_nom
)
{
$sql
.
=
" AND ("
;
$sql
.
=
"s.nom LIKE '%"
.
$search_nom
.
"%'"
;
$sql
.
=
" OR s.code_client LIKE '%"
.
$search_nom
.
"%'"
;
$sql
.
=
" OR s.email like '%"
.
$search_nom
.
"%'"
;
$sql
.
=
" OR s.url like '%"
.
$search_nom
.
"%'"
;
$sql
.
=
")"
;
}
if
(
$search_ville
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment