diff --git a/htdocs/societe/notify/fiche.php b/htdocs/societe/notify/fiche.php index 08a1e259274..df0f282da6b 100644 --- a/htdocs/societe/notify/fiche.php +++ b/htdocs/societe/notify/fiche.php @@ -162,7 +162,28 @@ if ( $soc->fetch($soc->id) ) print ''; print ''; - print ''; + print ''; + print ''; print '
'.$langs->trans("Name").''.$soc->nom.'
'.$langs->trans("NbOfActiveNotifications").'0 (TODO Nombre non mis a jour)
'.$langs->trans("NbOfActiveNotifications").''; + $sql = "SELECT COUNT(n.rowid) as nb"; + $sql.= " FROM ".MAIN_DB_PREFIX."notify_def as n"; + $sql.= " WHERE fk_soc = ".$soc->id; + $resql=$db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) + { + $obj = $db->fetch_object($resql); + $nb=$obj->nb; + $i++; + } + } + else { + dolibarr_print_error($db); + } + print $nb; + print '
'; print ''; @@ -210,7 +231,7 @@ if ( $soc->fetch($soc->id) ) print ''; $html->select_array("actionid",$actions); print ''; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/societe/notify/pre.inc.php b/htdocs/societe/notify/pre.inc.php index 11be874418f..e346fcdd3a9 100644 --- a/htdocs/societe/notify/pre.inc.php +++ b/htdocs/societe/notify/pre.inc.php @@ -25,32 +25,27 @@ require ("../../main.inc.php"); function llxHeader($head = "") { - global $user, $conf; - - /* - * - * - */ + global $langs, $user, $conf; + top_menu($head); $menu = new Menu(); - if ($conf->societe->enabled && $conf->commercial->enabled) + if ($conf->societe->enabled) { - $menu->add(DOL_URL_ROOT."/societe.php", "Sociétés","company"); + $menu->add(DOL_URL_ROOT."/societe.php", $langs->trans("Companies"),"company"); - $menu->add_submenu(DOL_URL_ROOT."/soc.php?&action=create", "Nouvelle société"); + if ($conf->rights->societe->creer) + { + $menu->add_submenu(DOL_URL_ROOT."/soc.php?&action=create", $langs->trans("NewCompany")); + } + + $menu->add_submenu(DOL_URL_ROOT."/contact.php", $langs->trans("Contacts")); - $menu->add_submenu(DOL_URL_ROOT."/contact.php", "Contacts"); - - $menu->add("index.php", "Notifications"); + $menu->add_submenu("notify/index.php", $langs->trans("Notifications")); } - /* - * - */ - left_menu($menu->liste); - } + ?> diff --git a/htdocs/societe/pre.inc.php b/htdocs/societe/pre.inc.php index ba6a09f78af..40a8be35416 100644 --- a/htdocs/societe/pre.inc.php +++ b/htdocs/societe/pre.inc.php @@ -25,32 +25,27 @@ require ("../main.inc.php"); function llxHeader($head = "") { - global $user, $conf; + global $langs, $user, $conf; - /* - * - * - */ top_menu($head); $menu = new Menu(); - if ($conf->societe->enabled && $conf->commercial->enabled) + if ($conf->societe->enabled) { - $menu->add(DOL_URL_ROOT."/societe.php", "Sociétés","company"); + $menu->add(DOL_URL_ROOT."/societe.php", $langs->trans("Companies"),"company"); - $menu->add_submenu(DOL_URL_ROOT."/soc.php?&action=create", "Nouvelle société"); + if ($conf->rights->societe->creer) + { + $menu->add_submenu(DOL_URL_ROOT."/soc.php?&action=create", $langs->trans("NewCompany")); + } + + $menu->add_submenu(DOL_URL_ROOT."/contact.php", $langs->trans("Contacts")); - $menu->add_submenu(DOL_URL_ROOT."/contact.php", "Contacts"); - - $menu->add_submenu("notify/index.php", "Notifications"); + $menu->add_submenu("notify/index.php", $langs->trans("Notifications")); } - /* - * - */ - left_menu($menu->liste); - } + ?>