Add patch from sladame to add contracts in home page.
This commit is contained in:
parent
9fbfce7ab4
commit
3cc24419a2
@ -1243,6 +1243,41 @@ class Contrat extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Charge indicateurs this->nb de tableau de bord
|
||||||
|
* \return int <0 si ko, >0 si ok
|
||||||
|
*/
|
||||||
|
function load_state_board()
|
||||||
|
{
|
||||||
|
global $conf, $user;
|
||||||
|
|
||||||
|
$this->nb=array();
|
||||||
|
|
||||||
|
$sql = "SELECT count(c.rowid) as nb";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."contrat as c";
|
||||||
|
if (!$user->rights->contrat->activer && !$user->societe_id)
|
||||||
|
{
|
||||||
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON p.fk_soc = s.rowid";
|
||||||
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc";
|
||||||
|
$sql.= " WHERE sc.fk_user = " .$user->id;
|
||||||
|
}
|
||||||
|
$resql=$this->db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
while ($obj=$this->db->fetch_object($resql))
|
||||||
|
{
|
||||||
|
$this->nb["Contracts"]=$obj->nb;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dolibarr_print_error($this->db);
|
||||||
|
$this->error=$this->db->error();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* gestion des contacts d'un contrat */
|
/* gestion des contacts d'un contrat */
|
||||||
|
|
||||||
|
|||||||
@ -129,7 +129,8 @@ if ($user->societe_id == 0)
|
|||||||
$conf->propal->enabled && $user->rights->propale->lire,
|
$conf->propal->enabled && $user->rights->propale->lire,
|
||||||
$conf->commande->enabled && $user->rights->commande->lire,
|
$conf->commande->enabled && $user->rights->commande->lire,
|
||||||
$conf->facture->enabled && $user->rights->facture->lire,
|
$conf->facture->enabled && $user->rights->facture->lire,
|
||||||
$conf->telephonie->enabled && $user->rights->telephonie->lire);
|
$conf->telephonie->enabled && $user->rights->telephonie->lire,
|
||||||
|
$conf->societe->enabled && $user->rights->contrat->activer);
|
||||||
// Fichier des classes qui contiennent la methode load_state_board pour chaque ligne
|
// Fichier des classes qui contiennent la methode load_state_board pour chaque ligne
|
||||||
$includes=array(DOL_DOCUMENT_ROOT."/client.class.php",
|
$includes=array(DOL_DOCUMENT_ROOT."/client.class.php",
|
||||||
DOL_DOCUMENT_ROOT."/prospect.class.php",
|
DOL_DOCUMENT_ROOT."/prospect.class.php",
|
||||||
@ -140,7 +141,8 @@ if ($user->societe_id == 0)
|
|||||||
DOL_DOCUMENT_ROOT."/propal.class.php",
|
DOL_DOCUMENT_ROOT."/propal.class.php",
|
||||||
DOL_DOCUMENT_ROOT."/commande/commande.class.php",
|
DOL_DOCUMENT_ROOT."/commande/commande.class.php",
|
||||||
DOL_DOCUMENT_ROOT."/facture.class.php",
|
DOL_DOCUMENT_ROOT."/facture.class.php",
|
||||||
DOL_DOCUMENT_ROOT."/telephonie/lignetel.class.php");
|
DOL_DOCUMENT_ROOT."/telephonie/lignetel.class.php",
|
||||||
|
DOL_DOCUMENT_ROOT."/contrat/contrat.class.php");
|
||||||
// Nom des classes qui contiennent la methode load_state_board pour chaque ligne
|
// Nom des classes qui contiennent la methode load_state_board pour chaque ligne
|
||||||
$classes=array('Client',
|
$classes=array('Client',
|
||||||
'Prospect',
|
'Prospect',
|
||||||
@ -151,7 +153,8 @@ if ($user->societe_id == 0)
|
|||||||
'Propal',
|
'Propal',
|
||||||
'Commande',
|
'Commande',
|
||||||
'Facture',
|
'Facture',
|
||||||
'LigneTel');
|
'LigneTel',
|
||||||
|
'Contrat');
|
||||||
// Clé de tableau retourné par la methode load_state_board pour chaque ligne
|
// Clé de tableau retourné par la methode load_state_board pour chaque ligne
|
||||||
$keys=array('customers',
|
$keys=array('customers',
|
||||||
'prospects',
|
'prospects',
|
||||||
@ -162,7 +165,8 @@ if ($user->societe_id == 0)
|
|||||||
'proposals',
|
'proposals',
|
||||||
'orders',
|
'orders',
|
||||||
'invoices',
|
'invoices',
|
||||||
'sign');
|
'sign',
|
||||||
|
'Contracts');
|
||||||
// Icon des lignes du tableau de bord
|
// Icon des lignes du tableau de bord
|
||||||
$icons=array('company',
|
$icons=array('company',
|
||||||
'company',
|
'company',
|
||||||
@ -173,7 +177,8 @@ if ($user->societe_id == 0)
|
|||||||
'propal',
|
'propal',
|
||||||
'order',
|
'order',
|
||||||
'bill',
|
'bill',
|
||||||
'phoning');
|
'phoning',
|
||||||
|
'order');
|
||||||
// Translation keyword
|
// Translation keyword
|
||||||
$titres=array("Customers",
|
$titres=array("Customers",
|
||||||
"Prospects",
|
"Prospects",
|
||||||
@ -184,7 +189,8 @@ if ($user->societe_id == 0)
|
|||||||
"CommercialProposals",
|
"CommercialProposals",
|
||||||
"CustomersOrders",
|
"CustomersOrders",
|
||||||
"BillsCustomers",
|
"BillsCustomers",
|
||||||
"Lignes de téléphonie suivis");
|
"Lignes de telephonie suivis",
|
||||||
|
"Contracts");
|
||||||
// Lien des lignes du tableau de bord
|
// Lien des lignes du tableau de bord
|
||||||
$links=array(DOL_URL_ROOT.'/comm/clients.php',
|
$links=array(DOL_URL_ROOT.'/comm/clients.php',
|
||||||
DOL_URL_ROOT.'/comm/prospect/prospects.php',
|
DOL_URL_ROOT.'/comm/prospect/prospects.php',
|
||||||
@ -195,7 +201,8 @@ if ($user->societe_id == 0)
|
|||||||
DOL_URL_ROOT.'/comm/propal.php?mainmenu=commercial',
|
DOL_URL_ROOT.'/comm/propal.php?mainmenu=commercial',
|
||||||
DOL_URL_ROOT.'/commande/liste.php?mainmenu=commercial',
|
DOL_URL_ROOT.'/commande/liste.php?mainmenu=commercial',
|
||||||
DOL_URL_ROOT.'/compta/facture.php?mainmenu=accountancy',
|
DOL_URL_ROOT.'/compta/facture.php?mainmenu=accountancy',
|
||||||
DOL_URL_ROOT.'/telephonie/ligne/index.php');
|
DOL_URL_ROOT.'/telephonie/ligne/index.php',
|
||||||
|
DOL_URL_ROOT.'/contrat/liste.php');
|
||||||
// Translation lang files
|
// Translation lang files
|
||||||
$langfile=array("bills",
|
$langfile=array("bills",
|
||||||
"prospects",
|
"prospects",
|
||||||
@ -206,7 +213,8 @@ if ($user->societe_id == 0)
|
|||||||
"propal",
|
"propal",
|
||||||
"orders",
|
"orders",
|
||||||
"bills",
|
"bills",
|
||||||
"");
|
"",
|
||||||
|
"Contracts");
|
||||||
|
|
||||||
//print memory_get_usage()."<br>";
|
//print memory_get_usage()."<br>";
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user