';
print '';
-print '| '.$langs->trans("DolibarrBoard").' | ';
+print ''.$langs->trans("DolibarrWorkBoard").' | ';
print ''.$langs->trans("Number").' | ';
print ''.$langs->trans("Late").' | ';
print ' | ';
@@ -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 '
| '.img_object($langs->trans("Actions"),"task").' | '.$langs->trans("ActionsToDo").' | ';
+ print '
| '.img_object($langs->trans("Actions"),"task").' | '.$board->label.' | ';
print ''.$board->nbtodo.' | ';
print '';
print '';
print $board->nbtodolate;
print ' | ';
- print ' (>'.ceil($conf->actions->warning_delay/60/60/24).' '.$langs->trans("days").')';
+ print ' (>'.ceil($board->warning_delay).' '.$langs->trans("days").')';
print ' | ';
print '';
if ($board->nbtodolate > 0) print img_picto($langs->trans("Late"),"warning");
@@ -237,6 +367,56 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
print ' |
';
}
+// 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 '| '.img_object($langs->trans("Contract"),"contract").' | '.$langs->trans("BoardNotActivatedServices").' | ';
+ print ''.$board->nbtodo.' | ';
+ print '';
+ print '';
+ print $board->nbtodolate;
+ print ' | ';
+ print ' (>'.ceil($conf->contrat->services->inactifs->warning_delay/60/60/24).' '.$langs->trans("days").')';
+ print ' | ';
+ print '';
+ if ($board->nbtodolate > 0) print img_picto($langs->trans("Late"),"warning");
+ else print ' ';
+ print ' | ';
+ print '
';
+}
+
+// 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 '| '.img_object($langs->trans("Contract"),"contract").' | '.$langs->trans("BoardRunningServices").' | ';
+ print ''.$board->nbtodo.' | ';
+ print '';
+ print '';
+ print $board->nbtodolate;
+ print ' | ';
+ print ' (>'.ceil($conf->contrat->services->expires->warning_delay/60/60/24).' '.$langs->trans("days").')';
+ print ' | ';
+ print '';
+ if ($board->nbtodolate > 0) print img_picto($langs->trans("Late"),"warning");
+ else print ' ';
+ print ' | ';
+ print '
';
+}
+
// 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 '';
}
-// 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 '| '.img_object($langs->trans("Contract"),"contract").' | '.$langs->trans("BoardNotActivatedServices").' | ';
- print ''.$board->nbtodo.' | ';
+ print '
| '.img_object($langs->trans("TransactionsToConciliate"),"payment").' | '.$langs->trans("TransactionsToConciliate").' | ';
+ print ''.$board->nbtodo.' | ';
print '';
- print '';
+ print '';
print $board->nbtodolate;
print ' | ';
- 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 ' | ';
print '';
if ($board->nbtodolate > 0) print img_picto($langs->trans("Late"),"warning");
@@ -308,23 +488,23 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire)
print ' |
';
}
-// 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 '| '.img_object($langs->trans("Contract"),"contract").' | '.$langs->trans("BoardRunningServices").' | ';
- print ''.$board->nbtodo.' | ';
+ print '
| '.img_object($langs->trans("Members"),"user").' | '.$langs->trans("Members").' | ';
+ print ''.$board->nbtodo.' | ';
print '';
- print '';
+ print '';
print $board->nbtodolate;
print ' | ';
- 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 ' | ';
print '';
if ($board->nbtodolate > 0) print img_picto($langs->trans("Late"),"warning");
diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php
index 566f2bacabe..672a9598fe7 100644
--- a/htdocs/master.inc.php
+++ b/htdocs/master.inc.php
@@ -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
/*
*/
diff --git a/htdocs/product.class.php b/htdocs/product.class.php
index 150c2c08ce3..8bc0615bc24 100644
--- a/htdocs/product.class.php
+++ b/htdocs/product.class.php
@@ -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;
+ }
+
+ }
+
}
?>
diff --git a/htdocs/service.class.php b/htdocs/service.class.php
index 42bb95ba03f..1a9c3339162 100644
--- a/htdocs/service.class.php
+++ b/htdocs/service.class.php
@@ -1,5 +1,6 @@
+/* Copyright (C) 2002 Rodolphe Quiedeville
+ * Copyright (C) 2004-2005 Laurent Destailleur
*
* 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;
+ }
+
+ }
+
}
?>
|