mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
New: Ajout d'informations dans le tableau de bord Dolibarr.
This commit is contained in:
parent
7c7e9c1bb1
commit
9bf544f727
|
|
@ -1280,5 +1280,67 @@ class Adherent
|
|||
if ($statut == 0) return $langs->trans("MemberStatusResiliated");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Charge indicateurs this->nb de tableau de bord
|
||||
* \return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function load_state_board()
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$this->nb=array();
|
||||
|
||||
$sql = "SELECT count(a.rowid) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a";
|
||||
$sql.= " WHERE a.statut > 0";
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
$this->nb["members"]=$obj->nb;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($this->db);
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Charge indicateurs this->nbtodo et this->nbtodolate de tableau de bord
|
||||
* \return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function load_board()
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$this->nbtodo=$this->nbtodolate=0;
|
||||
$sql = "SELECT a.rowid,".$this->db->pdate("a.datefin")." as datefin";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a";
|
||||
$sql.= " WHERE a.statut=1";
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
$this->nbtodo++;
|
||||
if ($obj->datefin < (time() - $conf->adherent->cotisation->warning_delay)) $this->nbtodolate++;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($this->db);
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ if ($result)
|
|||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Name")." / ".$langs->trans("Company"),"liste.php","d.nom","&page=$page&statut=$statut","","",$sortfield);
|
||||
print_liste_field_titre($langs->trans("DateAbonment"),"liste.php","t.cotisation","&page=$page&statut=$statut","","",$sortfield);
|
||||
print_liste_field_titre($langs->trans("EndSubscription"),"liste.php","t.cotisation","&page=$page&statut=$statut","","",$sortfield);
|
||||
print_liste_field_titre($langs->trans("EMail"),"liste.php","d.email","&page=$page&statut=$statut","","",$sortfield);
|
||||
print_liste_field_titre($langs->trans("Type"),"liste.php","t.libelle","&page=$page&statut=$statut","","",$sortfield);
|
||||
print_liste_field_titre($langs->trans("Person"),"liste.php","d.morphy","&page=$page&statut=$statut","","",$sortfield);
|
||||
|
|
|
|||
|
|
@ -20,63 +20,102 @@
|
|||
*
|
||||
*/
|
||||
|
||||
/*! \file htdocs/client.class.php
|
||||
/**
|
||||
\file htdocs/client.class.php
|
||||
\ingroup societe
|
||||
\brief Fichier de la classe des clients
|
||||
\version $Revision$
|
||||
*/
|
||||
|
||||
|
||||
/*! \class Client
|
||||
\brief Classe permettant la gestion des clients
|
||||
/**
|
||||
\class Client
|
||||
\brief Classe permettant la gestion des clients
|
||||
*/
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT."/societe.class.php";
|
||||
|
||||
class Client extends Societe {
|
||||
var $db;
|
||||
|
||||
/**
|
||||
* \brief Constructeur de la classe
|
||||
* \param DB handler accès base de données
|
||||
* \param id id societe (0 par defaut)
|
||||
*/
|
||||
|
||||
function Client($DB, $id=0)
|
||||
{
|
||||
global $config;
|
||||
class Client extends Societe
|
||||
{
|
||||
var $db;
|
||||
|
||||
$this->db = $DB;
|
||||
$this->id = $id;
|
||||
$this->factures = array();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
function read_factures()
|
||||
{
|
||||
$sql = "SELECT rowid, facnumber";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f";
|
||||
$sql .= " WHERE f.fk_soc = ".$this->id;
|
||||
$sql .= " ORDER BY datef DESC";
|
||||
|
||||
$result = $this->db->query($sql) ;
|
||||
$i = 0;
|
||||
if ( $result )
|
||||
{
|
||||
$num = $this->db->num_rows();
|
||||
|
||||
while ($i < $num )
|
||||
{
|
||||
$row = $this->db->fetch_row();
|
||||
/**
|
||||
* \brief Constructeur de la classe
|
||||
* \param DB handler accès base de données
|
||||
* \param id id societe (0 par defaut)
|
||||
*/
|
||||
function Client($DB, $id=0)
|
||||
{
|
||||
global $config;
|
||||
|
||||
$this->db = $DB;
|
||||
$this->id = $id;
|
||||
$this->factures = array();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
function read_factures()
|
||||
{
|
||||
$sql = "SELECT rowid, facnumber";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f";
|
||||
$sql .= " WHERE f.fk_soc = ".$this->id;
|
||||
$sql .= " ORDER BY datef DESC";
|
||||
|
||||
$result = $this->db->query($sql) ;
|
||||
$i = 0;
|
||||
if ( $result )
|
||||
{
|
||||
$num = $this->db->num_rows();
|
||||
|
||||
while ($i < $num )
|
||||
{
|
||||
$row = $this->db->fetch_row();
|
||||
|
||||
$this->factures[$i][0] = $row[0];
|
||||
$this->factures[$i][1] = $row[1];
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
$this->factures[$i][0] = $row[0];
|
||||
$this->factures[$i][1] = $row[1];
|
||||
|
||||
/**
|
||||
* \brief Charge indicateurs this->nb de tableau de bord
|
||||
* \return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function load_state_board()
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$this->nb=array();
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
$sql = "SELECT count(s.idp) as nb, s.client";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql.= " WHERE s.client in (1,2)";
|
||||
$sql.= " GROUP BY s.client";
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
if ($obj->client == 1) $this->nb["customers"]=$obj->nb;
|
||||
if ($obj->client == 2) $this->nb["prospects"]=$obj->nb;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($this->db);
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -464,6 +464,36 @@ class Account
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Charge indicateurs this->nbtodo et this->nbtodolate de tableau de bord
|
||||
* \return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function load_board()
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$this->nbtodo=$this->nbtodolate=0;
|
||||
$sql = "SELECT b.rowid,".$this->db->pdate("b.datev")." as datefin";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
|
||||
$sql.= " WHERE b.rappro=0";
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
$this->nbtodo++;
|
||||
if ($obj->datefin < (time() - $conf->bank->rappro->warning_delay)) $this->nbtodolate++;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($this->db);
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -159,6 +159,38 @@ class Fournisseur extends Societe {
|
|||
$commf->addline("Toto",120,1,$prod->tva, $prod->id, 0, $prod->ref_fourn);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Charge indicateurs this->nb de tableau de bord
|
||||
* \return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function load_state_board()
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$this->nb=array();
|
||||
|
||||
$sql = "SELECT count(s.idp) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql.= " WHERE s.fournisseur = 1";
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
$this->nb["suppliers"]=$obj->nb;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($this->db);
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
230
htdocs/index.php
230
htdocs/index.php
|
|
@ -128,15 +128,143 @@ else
|
|||
}
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Dolibarr State Board
|
||||
*/
|
||||
print '<br>';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">'.$langs->trans("DolibarrStateBoard").'</td>';
|
||||
print '<td align="right"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
$var=true;
|
||||
|
||||
// Nbre de sociétés clients/prospects
|
||||
if ($conf->societe->enabled)
|
||||
{
|
||||
include_once("./client.class.php");
|
||||
$board=new Client($db);
|
||||
$board->load_state_board();
|
||||
|
||||
foreach($board->nb as $key=>$val)
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="16">'.img_object($langs->trans("Customers"),"company").'</td>';
|
||||
print '<td>';
|
||||
if ($key == "customers") print $langs->trans("Customers");
|
||||
if ($key == "prospects") print $langs->trans("Prospects");
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
if ($key == "customers") print '<a href="'.DOL_URL_ROOT.'/comm/clients.php">';
|
||||
if ($key == "prospects") print '<a href="'.DOL_URL_ROOT.'/comm/clients.php">';
|
||||
print $val;
|
||||
print '</a></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
// Nbre de sociétés fournisseurs
|
||||
if ($conf->fournisseur->enabled)
|
||||
{
|
||||
include_once("./fourn/fournisseur.class.php");
|
||||
$board=new Fournisseur($db);
|
||||
$board->load_state_board();
|
||||
|
||||
foreach($board->nb as $key=>$val)
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="16">'.img_object($langs->trans("Suppliers"),"company").'</td>';
|
||||
print '<td>';
|
||||
if ($key == "suppliers") print $langs->trans("Suppliers");
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
if ($key == "suppliers") print '<a href="'.DOL_URL_ROOT.'/fourn/liste.php">';
|
||||
print $val;
|
||||
print '</a></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
// Nbre d'adhérents
|
||||
if ($conf->adherent->enabled)
|
||||
{
|
||||
include_once("./adherents/adherent.class.php");
|
||||
$board=new Adherent($db);
|
||||
$board->load_state_board();
|
||||
|
||||
foreach($board->nb as $key=>$val)
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="16">'.img_object($langs->trans("Adherent"),"user").'</td>';
|
||||
print '<td>';
|
||||
if ($key == "members") print $langs->trans("Adherents");
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
if ($key == "members") print '<a href="'.DOL_URL_ROOT.'/adherents/liste.php?statut=1&mainmenu=members">';
|
||||
print $val;
|
||||
print '</a></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
// Nbre de produits
|
||||
if ($conf->produit->enabled)
|
||||
{
|
||||
//include_once("./product.class.php");
|
||||
$board=new Product($db);
|
||||
$board->load_state_board();
|
||||
|
||||
foreach($board->nb as $key=>$val)
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="16">'.img_object($langs->trans("Producst"),"product").'</td>';
|
||||
print '<td>';
|
||||
if ($key == "products") print $langs->trans("Products");
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
if ($key == "products") print '<a href="'.DOL_URL_ROOT.'/product/liste.php?type=0&mainmenu=products">';
|
||||
print $val;
|
||||
print '</a></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
// Nbre de services
|
||||
if ($conf->service->enabled)
|
||||
{
|
||||
include_once("./service.class.php");
|
||||
$board=new Service($db);
|
||||
$board->load_state_board();
|
||||
|
||||
foreach($board->nb as $key=>$val)
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="16">'.img_object($langs->trans("Services"),"service").'</td>';
|
||||
print '<td>';
|
||||
if ($key == "services") print $langs->trans("Services");
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
if ($key == "services") print '<a href="'.DOL_URL_ROOT.'/product/liste.php?type=1&mainmenu=products">';
|
||||
print $val;
|
||||
print '</a></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
print '</td><td width="65%" valign="top" class="notopnoleftnoright">';
|
||||
|
||||
|
||||
/*
|
||||
* Dolibarr Board
|
||||
* Dolibarr Work Board
|
||||
*/
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">'.$langs->trans("DolibarrBoard").'</td>';
|
||||
print '<td colspan="2">'.$langs->trans("DolibarrWorkBoard").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Number").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Late").'</td>';
|
||||
print '<td> </td>';
|
||||
|
|
@ -151,15 +279,17 @@ if ($conf->commercial->enabled || $conf->compta->enabled)
|
|||
include_once("./actioncomm.class.php");
|
||||
$board=new ActionComm($db);
|
||||
$board->load_board();
|
||||
$board->warning_delay=$conf->actions->warning_delay/60/60/24;
|
||||
$board->label=$langs->trans("ActionsToDo");
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="16">'.img_object($langs->trans("Actions"),"task").'</td><td>'.$langs->trans("ActionsToDo").'</td>';
|
||||
print '<tr '.$bc[$var].'><td width="16">'.img_object($langs->trans("Actions"),"task").'</td><td>'.$board->label.'</td>';
|
||||
print '<td align="right"><a href="'.DOL_URL_ROOT.'/comm/action/index.php?status=todo">'.$board->nbtodo.'</a></td>';
|
||||
print '<td align="right">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?status=todo">';
|
||||
print $board->nbtodolate;
|
||||
print '</a></td><td nowrap align="right">';
|
||||
print ' (>'.ceil($conf->actions->warning_delay/60/60/24).' '.$langs->trans("days").')';
|
||||
print ' (>'.ceil($board->warning_delay).' '.$langs->trans("days").')';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if ($board->nbtodolate > 0) print img_picto($langs->trans("Late"),"warning");
|
||||
|
|
@ -237,6 +367,56 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
|
|||
print '</tr>';
|
||||
}
|
||||
|
||||
// Nbre services à activer (en retard)
|
||||
if ($conf->contrat->enabled && $user->rights->contrat->lire)
|
||||
{
|
||||
$langs->load("contracts");
|
||||
|
||||
include_once("./contrat/contrat.class.php");
|
||||
$board=new Contrat($db);
|
||||
$board->load_board("inactives");
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="16">'.img_object($langs->trans("Contract"),"contract").'</td><td>'.$langs->trans("BoardNotActivatedServices").'</td>';
|
||||
print '<td align="right"><a href="'.DOL_URL_ROOT.'/contrat/services.php?mainmenu=commercial&leftmenu=contracts&mode=0">'.$board->nbtodo.'</a></td>';
|
||||
print '<td align="right">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/contrat/services.php?mainmenu=commercial&leftmenu=contracts&mode=0">';
|
||||
print $board->nbtodolate;
|
||||
print '</a></td><td nowrap align="right">';
|
||||
print ' (>'.ceil($conf->contrat->services->inactifs->warning_delay/60/60/24).' '.$langs->trans("days").')';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if ($board->nbtodolate > 0) print img_picto($langs->trans("Late"),"warning");
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Nbre services actifs (à renouveler)
|
||||
if ($conf->contrat->enabled && $user->rights->contrat->lire)
|
||||
{
|
||||
$langs->load("contracts");
|
||||
|
||||
include_once("./contrat/contrat.class.php");
|
||||
$board=new Contrat($db);
|
||||
$board->load_board("expired");
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="16">'.img_object($langs->trans("Contract"),"contract").'</td><td>'.$langs->trans("BoardRunningServices").'</td>';
|
||||
print '<td align="right"><a href="'.DOL_URL_ROOT.'/contrat/services.php?mainmenu=commercial&leftmenu=contracts&mode=4">'.$board->nbtodo.'</a></td>';
|
||||
print '<td align="right">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/contrat/services.php?mainmenu=commercial&leftmenu=contracts&mode=4">';
|
||||
print $board->nbtodolate;
|
||||
print '</a></td><td nowrap align="right">';
|
||||
print ' (>'.ceil($conf->contrat->services->expires->warning_delay/60/60/24).' '.$langs->trans("days").')';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if ($board->nbtodolate > 0) print img_picto($langs->trans("Late"),"warning");
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Nbre factures fournisseurs (à payer)
|
||||
if ($conf->fournisseur->enabled && $conf->facture->enabled && $user->rights->facture->lire)
|
||||
{
|
||||
|
|
@ -283,23 +463,23 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
|
|||
print '</tr>';
|
||||
}
|
||||
|
||||
// Nbre services à activer (en retard)
|
||||
if ($conf->contrat->enabled && $user->rights->contrat->lire)
|
||||
// Nbre ecritures à rapprocher
|
||||
if ($conf->banque->enabled && $user->rights->banque->lire)
|
||||
{
|
||||
$langs->load("contracts");
|
||||
|
||||
include_once("./contrat/contrat.class.php");
|
||||
$board=new Contrat($db);
|
||||
$board->load_board("inactives");
|
||||
$langs->load("banks");
|
||||
|
||||
//include_once("./compta/bank/account.class.php");
|
||||
$board=new Account($db);
|
||||
$board->load_board();
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="16">'.img_object($langs->trans("Contract"),"contract").'</td><td>'.$langs->trans("BoardNotActivatedServices").'</td>';
|
||||
print '<td align="right"><a href="'.DOL_URL_ROOT.'/contrat/services.php?mainmenu=commercial&leftmenu=contracts&mode=0">'.$board->nbtodo.'</a></td>';
|
||||
print '<tr '.$bc[$var].'><td width="16">'.img_object($langs->trans("TransactionsToConciliate"),"payment").'</td><td>'.$langs->trans("TransactionsToConciliate").'</td>';
|
||||
print '<td align="right"><a href="'.DOL_URL_ROOT.'/compta/bank/index.php?leftmenu=bank&mainmenu=bank">'.$board->nbtodo.'</a></td>';
|
||||
print '<td align="right">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/contrat/services.php?mainmenu=commercial&leftmenu=contracts&mode=0">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/bank/index.php?leftmenu=bank&mainmenu=bank">';
|
||||
print $board->nbtodolate;
|
||||
print '</a></td><td nowrap align="right">';
|
||||
print ' (>'.ceil($conf->contrat->services->inactifs->warning_delay/60/60/24).' '.$langs->trans("days").')';
|
||||
print ' (>'.ceil($conf->bank->rappro->warning_delay/60/60/24).' '.$langs->trans("days").')';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if ($board->nbtodolate > 0) print img_picto($langs->trans("Late"),"warning");
|
||||
|
|
@ -308,23 +488,23 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire)
|
|||
print '</tr>';
|
||||
}
|
||||
|
||||
// Nbre services actifs (à renouveler)
|
||||
if ($conf->contrat->enabled && $user->rights->contrat->lire)
|
||||
// Nbre adhérent valides (attente cotisation)
|
||||
if ($conf->adherent->enabled && $user->rights->adherent->lire)
|
||||
{
|
||||
$langs->load("contracts");
|
||||
$langs->load("members");
|
||||
|
||||
include_once("./contrat/contrat.class.php");
|
||||
$board=new Contrat($db);
|
||||
$board->load_board("expired");
|
||||
include_once("./adherents/adherent.class.php");
|
||||
$board=new Adherent($db);
|
||||
$board->load_board();
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="16">'.img_object($langs->trans("Contract"),"contract").'</td><td>'.$langs->trans("BoardRunningServices").'</td>';
|
||||
print '<td align="right"><a href="'.DOL_URL_ROOT.'/contrat/services.php?mainmenu=commercial&leftmenu=contracts&mode=4">'.$board->nbtodo.'</a></td>';
|
||||
print '<tr '.$bc[$var].'><td width="16">'.img_object($langs->trans("Members"),"user").'</td><td>'.$langs->trans("Members").'</td>';
|
||||
print '<td align="right"><a href="'.DOL_URL_ROOT.'/adherents/liste.php?mainmenu=members&statut=1">'.$board->nbtodo.'</a></td>';
|
||||
print '<td align="right">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/contrat/services.php?mainmenu=commercial&leftmenu=contracts&mode=4">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/adherents/liste.php?mainmenu=members&statut=1">';
|
||||
print $board->nbtodolate;
|
||||
print '</a></td><td nowrap align="right">';
|
||||
print ' (>'.ceil($conf->contrat->services->expires->warning_delay/60/60/24).' '.$langs->trans("days").')';
|
||||
print ' (>'.ceil($conf->adherent->cotisation->warning_delay/60/60/24).' '.$langs->trans("days").')';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if ($board->nbtodolate > 0) print img_picto($langs->trans("Late"),"warning");
|
||||
|
|
|
|||
|
|
@ -381,6 +381,8 @@ $conf->facture->fournisseur->warning_delay=2*24*60*60;
|
|||
$conf->facture->client->warning_delay=31*24*60*60; // 1 mois
|
||||
$conf->contrat->services->inactifs->warning_delay=0*24*60*60;
|
||||
$conf->contrat->services->expires->warning_delay=0*24*60*60;
|
||||
$conf->adherent->cotisation->warning_delay=31*24*60*60; // 1 mois
|
||||
$conf->bank->rappro->warning_delay=2*31*24*60*60; // 2 mois
|
||||
|
||||
/*
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1145,5 +1145,37 @@ class Product
|
|||
return $tabobj;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Charge indicateurs this->nb de tableau de bord
|
||||
* \return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function load_state_board()
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$this->nb=array();
|
||||
|
||||
$sql = "SELECT count(p.rowid) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||
$sql.= " WHERE p.fk_product_type = 0";
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
$this->nb["products"]=$obj->nb;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($this->db);
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -20,7 +21,21 @@
|
|||
*
|
||||
*/
|
||||
|
||||
class Service {
|
||||
/**
|
||||
\file htdocs/service.class.php
|
||||
\ingroup service
|
||||
\brief Fichier de la classe des services prédéfinis
|
||||
\version $Revision$
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
\class Service
|
||||
\brief Classe permettant la gestion des services prédéfinis
|
||||
*/
|
||||
|
||||
class Service
|
||||
{
|
||||
var $db;
|
||||
|
||||
var $id;
|
||||
|
|
@ -179,6 +194,36 @@ class Service {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Charge indicateurs this->nb de tableau de bord
|
||||
* \return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function load_state_board()
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$this->nb=array();
|
||||
|
||||
$sql = "SELECT count(p.rowid) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||
$sql.= " WHERE p.fk_product_type = 1";
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
$this->nb["services"]=$obj->nb;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($this->db);
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user