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
df4d0166
Commit
df4d0166
authored
8 years ago
by
Maxime Kohlhaas
Browse files
Options
Downloads
Patches
Plain Diff
New add stats on contacts
parent
5bfc6567
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/contact/class/contact.class.php
+41
-0
41 additions, 0 deletions
htdocs/contact/class/contact.class.php
htdocs/index.php
+8
-0
8 additions, 0 deletions
htdocs/index.php
with
49 additions
and
0 deletions
htdocs/contact/class/contact.class.php
+
41
−
0
View file @
df4d0166
...
...
@@ -107,6 +107,47 @@ class Contact extends CommonObject
$this
->
db
=
$db
;
$this
->
statut
=
1
;
// By default, status is enabled
}
/**
* Load indicators into this->nb for board
*
* @return int <0 if KO, >0 if OK
*/
function
load_state_board
()
{
global
$user
;
$this
->
nb
=
array
();
$clause
=
"WHERE"
;
$sql
=
"SELECT count(sp.rowid) as nb"
;
$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
.
=
" LEFT JOIN "
.
MAIN_DB_PREFIX
.
"societe_commerciaux as sc ON s.rowid = sc.fk_soc"
;
$sql
.
=
" WHERE sc.fk_user = "
.
$user
->
id
;
$clause
=
"AND"
;
}
$sql
.
=
' '
.
$clause
.
' s.entity IN ('
.
getEntity
(
$this
->
element
,
1
)
.
')'
;
$resql
=
$this
->
db
->
query
(
$sql
);
if
(
$resql
)
{
while
(
$obj
=
$this
->
db
->
fetch_object
(
$resql
))
{
$this
->
nb
[
"contacts"
]
=
$obj
->
nb
;
}
$this
->
db
->
free
(
$resql
);
return
1
;
}
else
{
dol_print_error
(
$this
->
db
);
$this
->
error
=
$this
->
db
->
lasterror
();
return
-
1
;
}
}
/**
* Add a contact into database
...
...
This diff is collapsed.
Click to expand it.
htdocs/index.php
+
8
−
0
View file @
df4d0166
...
...
@@ -162,6 +162,7 @@ if (empty($user->societe_id))
!
empty
(
$conf
->
societe
->
enabled
)
&&
$user
->
rights
->
societe
->
lire
&&
empty
(
$conf
->
global
->
SOCIETE_DISABLE_CUSTOMERS
)
&&
empty
(
$conf
->
global
->
SOCIETE_DISABLE_CUSTOMERS_STATS
),
!
empty
(
$conf
->
societe
->
enabled
)
&&
$user
->
rights
->
societe
->
lire
&&
empty
(
$conf
->
global
->
SOCIETE_DISABLE_PROSPECTS
)
&&
empty
(
$conf
->
global
->
SOCIETE_DISABLE_PROSPECTS_STATS
),
!
empty
(
$conf
->
fournisseur
->
enabled
)
&&
$user
->
rights
->
fournisseur
->
lire
&&
empty
(
$conf
->
global
->
SOCIETE_DISABLE_SUPPLIERS_STATS
),
!
empty
(
$conf
->
societe
->
enabled
)
&&
$user
->
rights
->
societe
->
contact
->
lire
,
!
empty
(
$conf
->
adherent
->
enabled
)
&&
$user
->
rights
->
adherent
->
lire
,
!
empty
(
$conf
->
product
->
enabled
)
&&
$user
->
rights
->
produit
->
lire
,
!
empty
(
$conf
->
service
->
enabled
)
&&
$user
->
rights
->
service
->
lire
,
...
...
@@ -181,6 +182,7 @@ if (empty($user->societe_id))
DOL_DOCUMENT_ROOT
.
"/societe/class/client.class.php"
,
DOL_DOCUMENT_ROOT
.
"/societe/class/client.class.php"
,
DOL_DOCUMENT_ROOT
.
"/fourn/class/fournisseur.class.php"
,
DOL_DOCUMENT_ROOT
.
"/contact/class/contact.class.php"
,
DOL_DOCUMENT_ROOT
.
"/adherents/class/adherent.class.php"
,
DOL_DOCUMENT_ROOT
.
"/product/class/product.class.php"
,
DOL_DOCUMENT_ROOT
.
"/product/class/service.class.php"
,
...
...
@@ -199,6 +201,7 @@ if (empty($user->societe_id))
'Client'
,
'Client'
,
'Fournisseur'
,
'Contact'
,
'Adherent'
,
'Product'
,
'Service'
,
...
...
@@ -217,6 +220,7 @@ if (empty($user->societe_id))
'customers'
,
'prospects'
,
'suppliers'
,
'contacts'
,
'members'
,
'products'
,
'services'
,
...
...
@@ -235,6 +239,7 @@ if (empty($user->societe_id))
'company'
,
'company'
,
'company'
,
'contact'
,
'user'
,
'product'
,
'service'
,
...
...
@@ -253,6 +258,7 @@ if (empty($user->societe_id))
"ThirdPartyCustomersStats"
,
"ThirdPartyProspectsStats"
,
"Suppliers"
,
"Contacts"
,
"Members"
,
"Products"
,
"Services"
,
...
...
@@ -272,6 +278,7 @@ if (empty($user->societe_id))
DOL_URL_ROOT
.
'/societe/list.php?type=c'
,
DOL_URL_ROOT
.
'/societe/list.php?type=p'
,
DOL_URL_ROOT
.
'/societe/list.php?type=f'
,
DOL_URL_ROOT
.
'/contact/list.php'
,
DOL_URL_ROOT
.
'/adherents/list.php?statut=1&mainmenu=members'
,
DOL_URL_ROOT
.
'/product/list.php?type=0&mainmenu=products'
,
DOL_URL_ROOT
.
'/product/list.php?type=1&mainmenu=products'
,
...
...
@@ -290,6 +297,7 @@ if (empty($user->societe_id))
"companies"
,
"prospects"
,
"suppliers"
,
"companies"
,
"members"
,
"products"
,
"produts"
,
...
...
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