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
967ae720
Commit
967ae720
authored
9 years ago
by
Regis Houssin
Browse files
Options
Downloads
Patches
Plain Diff
Fix: compatibility with multicompany transversal mode
parent
ca1860a0
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/class/societe.class.php
+13
-4
13 additions, 4 deletions
htdocs/societe/class/societe.class.php
with
13 additions
and
4 deletions
htdocs/societe/class/societe.class.php
+
13
−
4
View file @
967ae720
...
...
@@ -4,7 +4,7 @@
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2003 Brian Fraval <brian@fraval.org>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-201
2
Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005-201
6
Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Patrick Raguin <patrick.raguin@auguria.net>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
...
...
@@ -1660,10 +1660,19 @@ class Societe extends CommonObject
$reparray
=
array
();
$sql
=
"SELECT u.rowid, u.lastname, u.firstname, u.email"
;
$sql
=
"SELECT
DISTINCT
u.rowid, u.lastname, u.firstname, u.email"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"societe_commerciaux as sc, "
.
MAIN_DB_PREFIX
.
"user as u"
;
$sql
.
=
" WHERE u.rowid = sc.fk_user AND sc.fk_soc ="
.
$this
->
id
;
$sql
.
=
" AND entity in (0, "
.
$conf
->
entity
.
")"
;
if
(
!
empty
(
$conf
->
multicompany
->
enabled
)
&&
!
empty
(
$conf
->
multicompany
->
transverse_mode
))
{
$sql
.
=
", "
.
MAIN_DB_PREFIX
.
"usergroup_user as ug"
;
$sql
.
=
" WHERE (ug.fk_user = u.rowid"
;
$sql
.
=
" AND ug.entity = "
.
$conf
->
entity
.
")"
;
$sql
.
=
" OR u.admin = 1"
;
}
else
$sql
.
=
" WHERE entity in (0, "
.
$conf
->
entity
.
")"
;
$sql
.
=
" AND u.rowid = sc.fk_user AND sc.fk_soc ="
.
$this
->
id
;
$resql
=
$this
->
db
->
query
(
$sql
);
if
(
$resql
)
...
...
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