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
732a98d9
Commit
732a98d9
authored
12 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
New: Show company in contact box
parent
3242f2fb
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/core/boxes/box_contacts.php
+16
-2
16 additions, 2 deletions
htdocs/core/boxes/box_contacts.php
with
16 additions
and
2 deletions
htdocs/core/boxes/box_contacts.php
+
16
−
2
View file @
732a98d9
...
...
@@ -71,8 +71,10 @@ class box_contacts extends ModeleBoxes
if
(
$user
->
rights
->
societe
->
lire
)
{
$sql
=
"SELECT sp.rowid, sp.name, sp.firstname, sp.civilite, sp.datec, sp.tms"
;
$sql
=
"SELECT sp.rowid, sp.name, sp.firstname, sp.civilite, sp.datec, sp.tms, sp.fk_soc,"
;
$sql
.
=
" s.nom as socname"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"socpeople as sp"
;
$sql
.
=
" LEFT JOIN "
.
MAIN_DB_PREFIX
.
"societe as s ON sp.fk_soc = s.rowid"
;
if
(
!
$user
->
rights
->
societe
->
client
->
voir
&&
!
$user
->
societe_id
)
$sql
.
=
", "
.
MAIN_DB_PREFIX
.
"societe_commerciaux as sc"
;
$sql
.
=
" WHERE sp.entity IN ("
.
getEntity
(
'societe'
,
1
)
.
")"
;
if
(
!
$user
->
rights
->
societe
->
client
->
voir
&&
!
$user
->
societe_id
)
$sql
.
=
" AND sp.rowid = sc.fk_soc AND sc.fk_user = "
.
$user
->
id
;
...
...
@@ -87,6 +89,7 @@ class box_contacts extends ModeleBoxes
$num
=
$db
->
num_rows
(
$result
);
$contactstatic
=
new
Contact
(
$db
);
$societestatic
=
new
Societe
(
$db
);
$i
=
0
;
while
(
$i
<
$num
)
...
...
@@ -99,6 +102,9 @@ class box_contacts extends ModeleBoxes
$contactstatic
->
firstname
=
$objp
->
firstname
;
$contactstatic
->
civilite_id
=
$objp
->
civilite
;
$societestatic
->
id
=
$objp
->
fk_soc
;
$societestatic
->
name
=
$objp
->
socname
;
$this
->
info_box_contents
[
$i
][
0
]
=
array
(
'td'
=>
'align="left" width="16"'
,
'logo'
=>
$this
->
boximg
,
'url'
=>
DOL_URL_ROOT
.
"/contact/fiche.php?id="
.
$objp
->
rowid
);
...
...
@@ -107,7 +113,15 @@ class box_contacts extends ModeleBoxes
'text'
=>
$contactstatic
->
getFullName
(
$langs
,
1
),
'url'
=>
DOL_URL_ROOT
.
"/contact/fiche.php?id="
.
$objp
->
rowid
);
$this
->
info_box_contents
[
$i
][
2
]
=
array
(
'td'
=>
'align="right"'
,
$this
->
info_box_contents
[
$i
][
2
]
=
array
(
'td'
=>
'align="left" width="16"'
,
'logo'
=>
(
$objp
->
fk_soc
>
0
?
'company'
:
''
),
'url'
=>
(
$objp
->
fk_soc
>
0
?
DOL_URL_ROOT
.
"/societe/soc.php?socid="
.
$objp
->
fk_soc
:
''
));
$this
->
info_box_contents
[
$i
][
3
]
=
array
(
'td'
=>
'align="left"'
,
'text'
=>
$societestatic
->
name
,
'url'
=>
DOL_URL_ROOT
.
"/societe/soc.php?socid="
.
$objp
->
fk_soc
);
$this
->
info_box_contents
[
$i
][
4
]
=
array
(
'td'
=>
'align="right"'
,
'text'
=>
dol_print_date
(
$datem
,
"day"
));
$i
++
;
...
...
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