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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
fd3837e1
Commit
fd3837e1
authored
8 years ago
by
Laurent Destailleur
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #6492 from aspangaro/6.0-donation
NEW Add donations statistics in home statistics
parents
e5fc1583
fd0a46c5
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
htdocs/core/modules/modDon.class.php
+1
-1
1 addition, 1 deletion
htdocs/core/modules/modDon.class.php
htdocs/don/class/don.class.php
+34
-1
34 additions, 1 deletion
htdocs/don/class/don.class.php
htdocs/index.php
+16
-8
16 additions, 8 deletions
htdocs/index.php
with
51 additions
and
10 deletions
htdocs/core/modules/modDon.class.php
+
1
−
1
View file @
fd3837e1
This diff is collapsed.
Click to expand it.
htdocs/don/class/don.class.php
+
34
−
1
View file @
fd3837e1
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015
Alexandre Spangaro <aspangaro
.dolibarr@gmail
.com>
* Copyright (C) 2015
-2017
Alexandre Spangaro <aspangaro
@zendsi
.com>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
*
*
* This program is free software; you can redistribute it and/or modify
* This program is free software; you can redistribute it and/or modify
...
@@ -804,6 +804,39 @@ class Don extends CommonObject
...
@@ -804,6 +804,39 @@ class Don extends CommonObject
return
$result
;
return
$result
;
}
}
/**
* Charge indicateurs this->nb pour le tableau de bord
*
* @return int <0 if KO, >0 if OK
*/
function
load_state_board
()
{
global
$conf
;
$this
->
nb
=
array
();
$sql
=
"SELECT count(d.rowid) as nb"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"don as d"
;
$sql
.
=
" WHERE d.fk_statut > 0"
;
$sql
.
=
" AND d.entity IN ("
.
getEntity
(
'don'
,
1
)
.
")"
;
$resql
=
$this
->
db
->
query
(
$sql
);
if
(
$resql
)
{
while
(
$obj
=
$this
->
db
->
fetch_object
(
$resql
))
{
$this
->
nb
[
"donations"
]
=
$obj
->
nb
;
}
$this
->
db
->
free
(
$resql
);
return
1
;
}
else
{
dol_print_error
(
$this
->
db
);
$this
->
error
=
$this
->
db
->
error
();
return
-
1
;
}
}
/**
/**
* Return clicable name (with picto eventually)
* Return clicable name (with picto eventually)
...
...
This diff is collapsed.
Click to expand it.
htdocs/index.php
+
16
−
8
View file @
fd3837e1
...
@@ -158,7 +158,8 @@ if (empty($user->societe_id))
...
@@ -158,7 +158,8 @@ if (empty($user->societe_id))
!
empty
(
$conf
->
supplier_invoice
->
enabled
)
&&
$user
->
rights
->
fournisseur
->
facture
->
lire
&&
empty
(
$conf
->
global
->
SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS
),
!
empty
(
$conf
->
supplier_invoice
->
enabled
)
&&
$user
->
rights
->
fournisseur
->
facture
->
lire
&&
empty
(
$conf
->
global
->
SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS
),
!
empty
(
$conf
->
supplier_proposal
->
enabled
)
&&
$user
->
rights
->
supplier_proposal
->
lire
&&
empty
(
$conf
->
global
->
SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS
),
!
empty
(
$conf
->
supplier_proposal
->
enabled
)
&&
$user
->
rights
->
supplier_proposal
->
lire
&&
empty
(
$conf
->
global
->
SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS
),
!
empty
(
$conf
->
projet
->
enabled
)
&&
$user
->
rights
->
projet
->
lire
,
!
empty
(
$conf
->
projet
->
enabled
)
&&
$user
->
rights
->
projet
->
lire
,
!
empty
(
$conf
->
expensereport
->
enabled
)
&&
$user
->
rights
->
expensereport
->
lire
!
empty
(
$conf
->
expensereport
->
enabled
)
&&
$user
->
rights
->
expensereport
->
lire
,
!
empty
(
$conf
->
don
->
enabled
)
&&
$user
->
rights
->
don
->
lire
);
);
// Class file containing the method load_state_board for each line
// Class file containing the method load_state_board for each line
$includes
=
array
(
$includes
=
array
(
...
@@ -179,7 +180,8 @@ if (empty($user->societe_id))
...
@@ -179,7 +180,8 @@ if (empty($user->societe_id))
DOL_DOCUMENT_ROOT
.
"/fourn/class/fournisseur.facture.class.php"
,
DOL_DOCUMENT_ROOT
.
"/fourn/class/fournisseur.facture.class.php"
,
DOL_DOCUMENT_ROOT
.
"/supplier_proposal/class/supplier_proposal.class.php"
,
DOL_DOCUMENT_ROOT
.
"/supplier_proposal/class/supplier_proposal.class.php"
,
DOL_DOCUMENT_ROOT
.
"/projet/class/project.class.php"
,
DOL_DOCUMENT_ROOT
.
"/projet/class/project.class.php"
,
DOL_DOCUMENT_ROOT
.
"/expensereport/class/expensereport.class.php"
DOL_DOCUMENT_ROOT
.
"/expensereport/class/expensereport.class.php"
,
DOL_DOCUMENT_ROOT
.
"/don/class/don.class.php"
);
);
// Name class containing the method load_state_board for each line
// Name class containing the method load_state_board for each line
$classes
=
array
(
'User'
,
$classes
=
array
(
'User'
,
...
@@ -199,7 +201,8 @@ if (empty($user->societe_id))
...
@@ -199,7 +201,8 @@ if (empty($user->societe_id))
'FactureFournisseur'
,
'FactureFournisseur'
,
'SupplierProposal'
,
'SupplierProposal'
,
'Project'
,
'Project'
,
'ExpenseReport'
'ExpenseReport'
,
'Don'
);
);
// Cle array returned by the method load_state_board for each line
// Cle array returned by the method load_state_board for each line
$keys
=
array
(
'users'
,
$keys
=
array
(
'users'
,
...
@@ -219,7 +222,8 @@ if (empty($user->societe_id))
...
@@ -219,7 +222,8 @@ if (empty($user->societe_id))
'supplier_invoices'
,
'supplier_invoices'
,
'askprice'
,
'askprice'
,
'projects'
,
'projects'
,
'expensereports'
'expensereports'
,
'donations'
);
);
// Dashboard Icon lines
// Dashboard Icon lines
$icons
=
array
(
'user'
,
$icons
=
array
(
'user'
,
...
@@ -239,7 +243,8 @@ if (empty($user->societe_id))
...
@@ -239,7 +243,8 @@ if (empty($user->societe_id))
'bill'
,
'bill'
,
'propal'
,
'propal'
,
'project'
,
'project'
,
'trip'
'trip'
,
'generic'
);
);
// Translation keyword
// Translation keyword
$titres
=
array
(
"Users"
,
$titres
=
array
(
"Users"
,
...
@@ -259,7 +264,8 @@ if (empty($user->societe_id))
...
@@ -259,7 +264,8 @@ if (empty($user->societe_id))
"SuppliersInvoices"
,
"SuppliersInvoices"
,
"SupplierProposalShort"
,
"SupplierProposalShort"
,
"Projects"
,
"Projects"
,
"ExpenseReports"
"ExpenseReports"
,
"Donations"
);
);
// Dashboard Link lines
// Dashboard Link lines
$links
=
array
(
$links
=
array
(
...
@@ -280,7 +286,8 @@ if (empty($user->societe_id))
...
@@ -280,7 +286,8 @@ if (empty($user->societe_id))
DOL_URL_ROOT
.
'/fourn/facture/list.php'
,
DOL_URL_ROOT
.
'/fourn/facture/list.php'
,
DOL_URL_ROOT
.
'/supplier_proposal/list.php'
,
DOL_URL_ROOT
.
'/supplier_proposal/list.php'
,
DOL_URL_ROOT
.
'/projet/list.php?mainmenu=project'
,
DOL_URL_ROOT
.
'/projet/list.php?mainmenu=project'
,
DOL_URL_ROOT
.
'/expensereport/list.php?mainmenu=hrm'
DOL_URL_ROOT
.
'/expensereport/list.php?mainmenu=hrm'
,
DOL_URL_ROOT
.
'/don/list.php?leftmenu=donations'
);
);
// Translation lang files
// Translation lang files
$langfile
=
array
(
"users"
,
$langfile
=
array
(
"users"
,
...
@@ -300,7 +307,8 @@ if (empty($user->societe_id))
...
@@ -300,7 +307,8 @@ if (empty($user->societe_id))
"bills"
,
"bills"
,
"supplier_proposal"
,
"supplier_proposal"
,
"projects"
,
"projects"
,
"trips"
"trips"
,
"donations"
);
);
...
...
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