NEW Add statistics on number of projets on home page
This commit is contained in:
parent
2ee74a80d9
commit
1df8e50a1b
@ -168,7 +168,9 @@ if (empty($user->societe_id))
|
|||||||
! empty($conf->contrat->enabled) && $user->rights->contrat->activer,
|
! empty($conf->contrat->enabled) && $user->rights->contrat->activer,
|
||||||
! empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS),
|
! empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS),
|
||||||
! 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->expensereport->enabled) && $user->rights->expensereport->lire);
|
! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire,
|
||||||
|
! empty($conf->projet->enabled) && $user->rights->projet->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(
|
||||||
DOL_DOCUMENT_ROOT."/user/class/user.class.php",
|
DOL_DOCUMENT_ROOT."/user/class/user.class.php",
|
||||||
@ -184,7 +186,9 @@ if (empty($user->societe_id))
|
|||||||
DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php",
|
DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php",
|
||||||
DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.commande.class.php",
|
DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.commande.class.php",
|
||||||
DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.facture.class.php",
|
DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.facture.class.php",
|
||||||
DOL_DOCUMENT_ROOT."/expensereport/class/expensereport.class.php");
|
DOL_DOCUMENT_ROOT."/expensereport/class/expensereport.class.php",
|
||||||
|
DOL_DOCUMENT_ROOT."/projet/class/project.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',
|
||||||
'Client',
|
'Client',
|
||||||
@ -199,7 +203,9 @@ if (empty($user->societe_id))
|
|||||||
'Contrat',
|
'Contrat',
|
||||||
'CommandeFournisseur',
|
'CommandeFournisseur',
|
||||||
'FactureFournisseur',
|
'FactureFournisseur',
|
||||||
'ExpenseReport');
|
'ExpenseReport',
|
||||||
|
'Project'
|
||||||
|
);
|
||||||
// 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',
|
||||||
'customers',
|
'customers',
|
||||||
@ -214,7 +220,9 @@ if (empty($user->societe_id))
|
|||||||
'Contracts',
|
'Contracts',
|
||||||
'supplier_orders',
|
'supplier_orders',
|
||||||
'supplier_invoices',
|
'supplier_invoices',
|
||||||
'expensereports');
|
'expensereports',
|
||||||
|
'projects'
|
||||||
|
);
|
||||||
// Dashboard Icon lines
|
// Dashboard Icon lines
|
||||||
$icons=array('user',
|
$icons=array('user',
|
||||||
'company',
|
'company',
|
||||||
@ -229,7 +237,9 @@ if (empty($user->societe_id))
|
|||||||
'order',
|
'order',
|
||||||
'order',
|
'order',
|
||||||
'bill',
|
'bill',
|
||||||
'trip');
|
'trip',
|
||||||
|
'project'
|
||||||
|
);
|
||||||
// Translation keyword
|
// Translation keyword
|
||||||
$titres=array("Users",
|
$titres=array("Users",
|
||||||
"ThirdPartyCustomersStats",
|
"ThirdPartyCustomersStats",
|
||||||
@ -244,7 +254,9 @@ if (empty($user->societe_id))
|
|||||||
"Contracts",
|
"Contracts",
|
||||||
"SuppliersOrders",
|
"SuppliersOrders",
|
||||||
"SuppliersInvoices",
|
"SuppliersInvoices",
|
||||||
"ExpenseReports");
|
"ExpenseReports",
|
||||||
|
"Projects"
|
||||||
|
);
|
||||||
// Dashboard Link lines
|
// Dashboard Link lines
|
||||||
$links=array(
|
$links=array(
|
||||||
DOL_URL_ROOT.'/user/index.php',
|
DOL_URL_ROOT.'/user/index.php',
|
||||||
@ -260,7 +272,9 @@ if (empty($user->societe_id))
|
|||||||
DOL_URL_ROOT.'/contrat/list.php',
|
DOL_URL_ROOT.'/contrat/list.php',
|
||||||
DOL_URL_ROOT.'/fourn/commande/list.php',
|
DOL_URL_ROOT.'/fourn/commande/list.php',
|
||||||
DOL_URL_ROOT.'/fourn/facture/list.php',
|
DOL_URL_ROOT.'/fourn/facture/list.php',
|
||||||
DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm');
|
DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm',
|
||||||
|
DOL_URL_ROOT.'/projet/list.php?mainmenu=project'
|
||||||
|
);
|
||||||
// Translation lang files
|
// Translation lang files
|
||||||
$langfile=array("users",
|
$langfile=array("users",
|
||||||
"companies",
|
"companies",
|
||||||
@ -273,7 +287,9 @@ if (empty($user->societe_id))
|
|||||||
"orders",
|
"orders",
|
||||||
"bills",
|
"bills",
|
||||||
"contracts",
|
"contracts",
|
||||||
"trips");
|
"trips",
|
||||||
|
"projects"
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// Loop and displays each line of table
|
// Loop and displays each line of table
|
||||||
|
|||||||
@ -1664,6 +1664,44 @@ class Project extends CommonObject
|
|||||||
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
|
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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(u.rowid) as nb";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."projet as u";
|
||||||
|
$sql.= " WHERE";
|
||||||
|
//$sql.= " WHERE u.fk_statut > 0";
|
||||||
|
//$sql.= " AND employee != 0";
|
||||||
|
$sql.= " u.entity IN (".getEntity('projet', 1).")";
|
||||||
|
|
||||||
|
$resql=$this->db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
while ($obj=$this->db->fetch_object($resql))
|
||||||
|
{
|
||||||
|
$this->nb["projects"]=$obj->nb;
|
||||||
|
}
|
||||||
|
$this->db->free($resql);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($this->db);
|
||||||
|
$this->error=$this->db->error();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Is the action delayed?
|
* Is the action delayed?
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user