NEW Add thumb of users into thumbs stats on home page
This commit is contained in:
parent
ff4f1e7a5b
commit
9d3451b31d
@ -1503,7 +1503,6 @@ class ExpenseReport extends CommonObject
|
|||||||
$this->error=$this->db->error();
|
$this->error=$this->db->error();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||||
@ -146,6 +146,7 @@ if (empty($user->societe_id))
|
|||||||
{
|
{
|
||||||
// Condition to be checked for each display line dashboard
|
// Condition to be checked for each display line dashboard
|
||||||
$conditions=array(
|
$conditions=array(
|
||||||
|
$user->rights->user->user->lire,
|
||||||
! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS),
|
! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS),
|
||||||
! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS),
|
! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS),
|
||||||
! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS),
|
! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS),
|
||||||
@ -160,21 +161,24 @@ if (empty($user->societe_id))
|
|||||||
! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire,
|
! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire,
|
||||||
! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire);
|
! empty($conf->expensereport->enabled) && $user->rights->expensereport->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(DOL_DOCUMENT_ROOT."/societe/class/client.class.php",
|
$includes=array(
|
||||||
DOL_DOCUMENT_ROOT."/societe/class/client.class.php",
|
DOL_DOCUMENT_ROOT."/user/class/user.class.php",
|
||||||
DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.class.php",
|
DOL_DOCUMENT_ROOT."/societe/class/client.class.php",
|
||||||
DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php",
|
DOL_DOCUMENT_ROOT."/societe/class/client.class.php",
|
||||||
DOL_DOCUMENT_ROOT."/product/class/product.class.php",
|
DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.class.php",
|
||||||
DOL_DOCUMENT_ROOT."/product/class/service.class.php",
|
DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php",
|
||||||
DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php",
|
DOL_DOCUMENT_ROOT."/product/class/product.class.php",
|
||||||
DOL_DOCUMENT_ROOT."/commande/class/commande.class.php",
|
DOL_DOCUMENT_ROOT."/product/class/service.class.php",
|
||||||
DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php",
|
DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php",
|
||||||
DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php",
|
DOL_DOCUMENT_ROOT."/commande/class/commande.class.php",
|
||||||
DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.commande.class.php",
|
DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php",
|
||||||
DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.facture.class.php",
|
DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php",
|
||||||
DOL_DOCUMENT_ROOT."/expensereport/class/expensereport.class.php");
|
DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.commande.class.php",
|
||||||
|
DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.facture.class.php",
|
||||||
|
DOL_DOCUMENT_ROOT."/expensereport/class/expensereport.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('Client',
|
$classes=array('User',
|
||||||
|
'Client',
|
||||||
'Client',
|
'Client',
|
||||||
'Fournisseur',
|
'Fournisseur',
|
||||||
'Adherent',
|
'Adherent',
|
||||||
@ -188,7 +192,8 @@ if (empty($user->societe_id))
|
|||||||
'FactureFournisseur',
|
'FactureFournisseur',
|
||||||
'ExpenseReport');
|
'ExpenseReport');
|
||||||
// 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('customers',
|
$keys=array('users',
|
||||||
|
'customers',
|
||||||
'prospects',
|
'prospects',
|
||||||
'suppliers',
|
'suppliers',
|
||||||
'members',
|
'members',
|
||||||
@ -202,7 +207,8 @@ if (empty($user->societe_id))
|
|||||||
'supplier_invoices',
|
'supplier_invoices',
|
||||||
'expensereports');
|
'expensereports');
|
||||||
// Dashboard Icon lines
|
// Dashboard Icon lines
|
||||||
$icons=array('company',
|
$icons=array('user',
|
||||||
|
'company',
|
||||||
'company',
|
'company',
|
||||||
'company',
|
'company',
|
||||||
'user',
|
'user',
|
||||||
@ -216,7 +222,8 @@ if (empty($user->societe_id))
|
|||||||
'bill',
|
'bill',
|
||||||
'trip');
|
'trip');
|
||||||
// Translation keyword
|
// Translation keyword
|
||||||
$titres=array("ThirdPartyCustomersStats",
|
$titres=array("Users",
|
||||||
|
"ThirdPartyCustomersStats",
|
||||||
"ThirdPartyProspectsStats",
|
"ThirdPartyProspectsStats",
|
||||||
"Suppliers",
|
"Suppliers",
|
||||||
"Members",
|
"Members",
|
||||||
@ -231,21 +238,23 @@ if (empty($user->societe_id))
|
|||||||
"ExpenseReports");
|
"ExpenseReports");
|
||||||
// Dashboard Link lines
|
// Dashboard Link lines
|
||||||
$links=array(
|
$links=array(
|
||||||
DOL_URL_ROOT.'/societe/list.php?type=c',
|
DOL_URL_ROOT.'/user/list.php',
|
||||||
DOL_URL_ROOT.'/societe/list.php?type=p',
|
DOL_URL_ROOT.'/societe/list.php?type=c',
|
||||||
DOL_URL_ROOT.'/societe/list.php?type=f',
|
DOL_URL_ROOT.'/societe/list.php?type=p',
|
||||||
DOL_URL_ROOT.'/adherents/list.php?statut=1&mainmenu=members',
|
DOL_URL_ROOT.'/societe/list.php?type=f',
|
||||||
DOL_URL_ROOT.'/product/list.php?type=0&mainmenu=products',
|
DOL_URL_ROOT.'/adherents/list.php?statut=1&mainmenu=members',
|
||||||
DOL_URL_ROOT.'/product/list.php?type=1&mainmenu=products',
|
DOL_URL_ROOT.'/product/list.php?type=0&mainmenu=products',
|
||||||
DOL_URL_ROOT.'/comm/propal/list.php?mainmenu=commercial',
|
DOL_URL_ROOT.'/product/list.php?type=1&mainmenu=products',
|
||||||
DOL_URL_ROOT.'/commande/list.php?mainmenu=commercial',
|
DOL_URL_ROOT.'/comm/propal/list.php?mainmenu=commercial',
|
||||||
DOL_URL_ROOT.'/compta/facture/list.php?mainmenu=accountancy',
|
DOL_URL_ROOT.'/commande/list.php?mainmenu=commercial',
|
||||||
DOL_URL_ROOT.'/contrat/list.php',
|
DOL_URL_ROOT.'/compta/facture/list.php?mainmenu=accountancy',
|
||||||
DOL_URL_ROOT.'/fourn/commande/list.php',
|
DOL_URL_ROOT.'/contrat/list.php',
|
||||||
DOL_URL_ROOT.'/fourn/facture/list.php',
|
DOL_URL_ROOT.'/fourn/commande/list.php',
|
||||||
DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm');
|
DOL_URL_ROOT.'/fourn/facture/list.php',
|
||||||
|
DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm');
|
||||||
// Translation lang files
|
// Translation lang files
|
||||||
$langfile=array("companies",
|
$langfile=array("users",
|
||||||
|
"companies",
|
||||||
"prospects",
|
"prospects",
|
||||||
"suppliers",
|
"suppliers",
|
||||||
"members",
|
"members",
|
||||||
|
|||||||
@ -2578,5 +2578,41 @@ class User 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."user as u";
|
||||||
|
$sql.= " WHERE u.statut > 0";
|
||||||
|
$sql.= " AND u.entity IN (".getEntity('user', 1).")";
|
||||||
|
|
||||||
|
$resql=$this->db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
while ($obj=$this->db->fetch_object($resql))
|
||||||
|
{
|
||||||
|
$this->nb["users"]=$obj->nb;
|
||||||
|
}
|
||||||
|
$this->db->free($resql);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($this->db);
|
||||||
|
$this->error=$this->db->error();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user