From c9740c42f8fe78529016723219c82821723df6f3 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Sun, 10 Dec 2006 14:15:38 +0000 Subject: [PATCH] Ajout onglet stats --- htdocs/lib/company.lib.php | 161 ++++++++++++++++++++----------------- 1 file changed, 85 insertions(+), 76 deletions(-) diff --git a/htdocs/lib/company.lib.php b/htdocs/lib/company.lib.php index 0b639c4ccd9..33dc558e1ee 100644 --- a/htdocs/lib/company.lib.php +++ b/htdocs/lib/company.lib.php @@ -1,5 +1,6 @@ + * Copyright (C) 2006 Rodolphe Quiedeville * * 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 @@ -21,97 +22,105 @@ */ /** - \file htdocs/lib/company.lib.php - \brief Ensemble de fonctions de base pour le module societe - \ingroup societe - \version $Revision$ - - Ensemble de fonctions de base de dolibarr sous forme d'include + \file htdocs/lib/company.lib.php + \brief Ensemble de fonctions de base pour le module societe + \ingroup societe + \version $Revision$ + + Ensemble de fonctions de base de dolibarr sous forme d'include */ function societe_prepare_head($objsoc) { - global $langs, $conf, $user; - $h = 0; - $head = array(); - - $head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$objsoc->id; - $head[$h][1] = $langs->trans("Company"); - $head[$h][2] = 'company'; - $h++; - - if ($objsoc->client==1) + global $langs, $conf, $user; + $h = 0; + $head = array(); + + $head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$objsoc->id; + $head[$h][1] = $langs->trans("Company"); + $head[$h][2] = 'company'; + $h++; + + if ($objsoc->client==1) { - $head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$objsoc->id; - $head[$h][1] = $langs->trans("Customer");; - $head[$h][2] = 'customer'; - $h++; + $head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$objsoc->id; + $head[$h][1] = $langs->trans("Customer");; + $head[$h][2] = 'customer'; + $h++; } - if ($objsoc->client==2) + if ($objsoc->client==2) { - $head[$h][0] = DOL_URL_ROOT.'/comm/prospect/fiche.php?id='.$objsoc->id; - $head[$h][1] = $langs->trans("Prospect"); - $head[$h][2] = 'prospect'; - $h++; + $head[$h][0] = DOL_URL_ROOT.'/comm/prospect/fiche.php?id='.$objsoc->id; + $head[$h][1] = $langs->trans("Prospect"); + $head[$h][2] = 'prospect'; + $h++; } - if ($objsoc->fournisseur) + if ($objsoc->fournisseur) { - $head[$h][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$objsoc->id; - $head[$h][1] = $langs->trans("Supplier"); - $head[$h][2] = 'supplier'; - $h++; + $head[$h][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$objsoc->id; + $head[$h][1] = $langs->trans("Supplier"); + $head[$h][2] = 'supplier'; + $h++; + } + + if ($conf->facture->enabled || $conf->compta->enabled || $conf->comptaexpert->enabled) + { + $langs->load("compta"); + $head[$h][0] = DOL_URL_ROOT.'/compta/fiche.php?socid='.$objsoc->id; + $head[$h][1] = $langs->trans("Accountancy"); + $head[$h][2] = 'compta'; + $h++; + } + + if ($user->societe_id == 0) + { + $head[$h][0] = DOL_URL_ROOT.'/socnote.php?socid='.$objsoc->id; + $head[$h][1] = $langs->trans("Note"); + $head[$h][2] = 'note'; + $h++; + } + + if ($user->societe_id == 0) + { + $head[$h][0] = DOL_URL_ROOT.'/docsoc.php?socid='.$objsoc->id; + $head[$h][1] = $langs->trans("Documents"); + $head[$h][2] = 'document'; + $h++; + } + + if ($conf->notification->enabled && $user->societe_id == 0) + { + $head[$h][0] = DOL_URL_ROOT.'/societe/notify/fiche.php?socid='.$objsoc->id; + $head[$h][1] = $langs->trans("Notifications"); + $head[$h][2] = 'notify'; + $h++; } - if ($conf->facture->enabled || $conf->compta->enabled || $conf->comptaexpert->enabled) + if ($objsoc->fournisseur) { - $langs->load("compta"); - $head[$h][0] = DOL_URL_ROOT.'/compta/fiche.php?socid='.$objsoc->id; - $head[$h][1] = $langs->trans("Accountancy"); - $head[$h][2] = 'compta'; - $h++; + $head[$h][0] = DOL_URL_ROOT.'/fourn/fiche-stats.php?socid='.$objsoc->id; + $head[$h][1] = $langs->trans("Statistics"); + $head[$h][2] = 'supplierstat'; + $h++; } - - if ($user->societe_id == 0) - { - $head[$h][0] = DOL_URL_ROOT.'/socnote.php?socid='.$objsoc->id; - $head[$h][1] = $langs->trans("Note"); - $head[$h][2] = 'note'; - $h++; + + if ($user->societe_id == 0) + { + $head[$h][0] = DOL_URL_ROOT.'/societe/info.php?socid='.$objsoc->id; + $head[$h][1] = $langs->trans("Info"); + $head[$h][2] = 'info'; + $h++; } - - if ($user->societe_id == 0) + + if ($conf->bookmark->enabled && $user->rights->bookmark->creer) { - $head[$h][0] = DOL_URL_ROOT.'/docsoc.php?socid='.$objsoc->id; - $head[$h][1] = $langs->trans("Documents"); - $head[$h][2] = 'document'; - $h++; + $head[$h][0] = DOL_URL_ROOT."/bookmarks/fiche.php?action=add&socid=".$objsoc->id."&urlsource=".$_SERVER["PHP_SELF"]."?socid=".$objsoc->id; + $head[$h][1] = img_object($langs->trans("BookmarkThisPage"),'bookmark'); + $head[$h][2] = 'image'; + $h++; } - - if ($conf->notification->enabled && $user->societe_id == 0) - { - $head[$h][0] = DOL_URL_ROOT.'/societe/notify/fiche.php?socid='.$objsoc->id; - $head[$h][1] = $langs->trans("Notifications"); - $head[$h][2] = 'notify'; - $h++; - } - - if ($user->societe_id == 0) - { - $head[$h][0] = DOL_URL_ROOT.'/societe/info.php?socid='.$objsoc->id; - $head[$h][1] = $langs->trans("Info"); - $head[$h][2] = 'info'; - $h++; - } - - if ($conf->bookmark->enabled && $user->rights->bookmark->creer) - { - $head[$h][0] = DOL_URL_ROOT."/bookmarks/fiche.php?action=add&socid=".$objsoc->id."&urlsource=".$_SERVER["PHP_SELF"]."?socid=".$objsoc->id; - $head[$h][1] = img_object($langs->trans("BookmarkThisPage"),'bookmark'); - $head[$h][2] = 'image'; - $h++; - } - - return $head; + + return $head; } -?> \ No newline at end of file +?>