From 6f8234dd60ac9bbbfe595e103754a97895c3547d Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 28 Aug 2014 07:13:33 +0200 Subject: [PATCH] Update Eldy menu --- htdocs/core/menus/standard/eldy.lib.php | 24 +- htdocs/core/modules/modAccounting.class.php | 351 +------------------- 2 files changed, 30 insertions(+), 345 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index b1e9ccffd52..0cc34ecb20e 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -858,18 +858,22 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu } } - // Compta simple - if (! empty($conf->comptabilite->enabled) && ($conf->global->MAIN_FEATURES_LEVEL >= 2)) - { - $newmenu->add("/compta/ventilation/index.php?leftmenu=ventil",$langs->trans("Dispatch"),0,$user->rights->compta->ventilation->lire, '', $mainmenu, 'ventil'); - if (empty($leftmenu) || $leftmenu=="ventil") $newmenu->add("/compta/ventilation/liste.php",$langs->trans("ToDispatch"),1,$user->rights->compta->ventilation->lire); - if (empty($leftmenu) || $leftmenu=="ventil") $newmenu->add("/compta/ventilation/lignes.php",$langs->trans("Dispatched"),1,$user->rights->compta->ventilation->lire); - } - - // Compta expert + // Accounting Expert if (! empty($conf->accounting->enabled)) { - + $langs->load("accountancy"); + + $newmenu->add("/accountancy/customer/index.php?leftmenu=ventil_customer",$langs->trans("CustomersVentilation"),0,$user->rights->accounting->ventilation->read, '', $mainmenu, 'ventil_customer'); + if (empty($leftmenu) || $leftmenu=="ventil_customer") $newmenu->add("/accountancy/customer/list.php",$langs->trans("ToDispatch"),1,$user->rights->accounting->ventilation->read); + if (empty($leftmenu) || $leftmenu=="ventil_customer") $newmenu->add("/accountancy/customer/lines.php",$langs->trans("Dispatched"),1,$user->rights->accounting->ventilation->read); + + $newmenu->add("/accountancy/supplier/index.php?leftmenu=ventil_supplier",$langs->trans("SuppliersVentilation"),0,$user->rights->accounting->ventilation->read, '', $mainmenu, 'ventil_supplier'); + if (empty($leftmenu) || $leftmenu=="ventil_customer") $newmenu->add("/accountancy/supplier/list.php",$langs->trans("ToDispatch"),1,$user->rights->accounting->ventilation->read); + if (empty($leftmenu) || $leftmenu=="ventil_customer") $newmenu->add("/accountancy/supplier/lines.php",$langs->trans("Dispatched"),1,$user->rights->accounting->ventilation->read); + + $newmenu->add("/accountancy/bookkeeping/list.php?leftmenu=bookkeeping",$langs->trans("Bookkeeping"),0,$user->rights->accounting->mouvements->lire, '', $mainmenu, 'bookeeping'); + if (empty($leftmenu) || $leftmenu=="bookeeping") $newmenu->add("/accountancy/bookkeeping/listbyyear.php",$langs->trans("ByYear"),1,$user->rights->accounting->mouvements->lire); + if (empty($leftmenu) || $leftmenu=="bookeeping") $newmenu->add("/accountancy/bookkeeping/balancebymonth.php.php",$langs->trans("AccountBalanceByMonth"),1,$user->rights->accounting->mouvements->lire); } // Rapports diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index ae525ccaa75..3d4174be73e 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -200,6 +200,22 @@ class modAccounting extends DolibarrModules $this->rights[$r][4] = 'access'; $this->rights[$r][5] = ''; $r++; + + $this->rights[$r][0] = 50402; + $this->rights[$r][1] = 'Read ventilation'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'ventilation'; + $this->rights[$r][5] = 'read'; + $r++; + + $this->rights[$r][0] = 50403; + $this->rights[$r][1] = 'Dispatched ventilation'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'ventilation'; + $this->rights[$r][5] = 'dispatch'; + $r++; $this->rights[$r][0] = 50411; $this->rights[$r][1] = 'Lire les mouvements comptables'; @@ -228,341 +244,6 @@ class modAccounting extends DolibarrModules // Main menu entries $this->menus = array (); $r = 0; - - $this->menu[$r] = array ( - 'fk_menu' => 0, - 'type' => 'top', - 'titre' => 'Accounting', - 'mainmenu' => 'accounting', - 'leftmenu' => '0', - 'url' => '/accountingex/customer/index.php', - 'langs' => 'accountingex@accountingex', - 'position' => 100, - 'perms' => '$user->rights->accountingex->access', - 'enabled' => '$conf->accounting->enabled', - 'target' => '', - 'user' => 0 - ); - $r ++; - - $this->menu[$r] = array ( - 'fk_menu' => 'fk_mainmenu=accounting', - 'type' => 'left', - 'titre' => 'CustomersVentilation', - 'leftmenu' => 'CustomersVentilation', - 'mainmenu' => 'accounting', - 'url' => '/accountingex/customer/index.php', - 'langs' => 'accountingex@accountingex', - 'position' => 101, - 'enabled' => 1, - 'perms' => 1, - 'target' => '', - 'user' => 0 - ); - $r ++; - - $this->menu[$r] = array ( - 'fk_menu' => 'fk_mainmenu=accounting,fk_leftmenu=CustomersVentilation', - 'type' => 'left', - 'titre' => 'ToDispatch', - 'leftmenu' => 'ToDispatchCustomer', - 'mainmenu' => 'accounting', - 'url' => '/accountingex/customer/liste.php', - 'langs' => 'accountingex@accountingex', - 'position' => 102, - 'enabled' => 1, - 'perms' => 1, - 'target' => '', - 'user' => 0 - ); - $r ++; - - $this->menu[$r] = array ( - 'fk_menu' => 'fk_mainmenu=accounting,fk_leftmenu=CustomersVentilation', - 'type' => 'left', - 'titre' => 'Dispatched', - 'leftmenu' => 'DispatchedCustomer', - 'mainmenu' => 'accounting', - 'url' => '/accountingex/customer/lignes.php', - 'langs' => 'accountingex@accountingex', - 'position' => 103, - 'enabled' => 1, - 'perms' => 1, - 'target' => '', - 'user' => 0 - ); - $r ++; - - $this->menu[$r] = array ( - 'fk_menu' => 'fk_mainmenu=accounting', - 'type' => 'left', - 'titre' => 'SuppliersVentilation', - 'leftmenu' => 'SuppliersVentilation', - 'mainmenu' => 'accounting', - 'url' => '/accountingex/supplier/index.php', - 'langs' => 'accountingex@accountingex', - 'position' => 110, - 'enabled' => '$conf->fournisseur->enabled', - 'perms' => 1, - 'target' => '', - 'user' => 0 - ); - $r ++; - - $this->menu[$r] = array ( - 'fk_menu' => 'fk_mainmenu=accounting,fk_leftmenu=SuppliersVentilation', - 'type' => 'left', - 'titre' => 'ToDispatch', - 'leftmenu' => 'ToDispatchSupplier', - 'mainmenu' => 'accounting', - 'url' => '/accountingex/supplier/liste.php', - 'langs' => 'accountingex@accountingex', - 'position' => 111, - 'enabled' => '$conf->fournisseur->enabled', - 'perms' => 1, - 'target' => '', - 'user' => 0 - ); - $r ++; - - $this->menu[$r] = array ( - 'fk_menu' => 'fk_mainmenu=accounting,fk_leftmenu=SuppliersVentilation', - 'type' => 'left', - 'titre' => 'Dispatched', - 'leftmenu' => 'DispatchedSupplier', - 'mainmenu' => 'accounting', - 'url' => '/accountingex/supplier/lignes.php', - 'langs' => 'accountingex@accountingex', - 'position' => 112, - 'enabled' => '$conf->fournisseur->enabled', - 'perms' => 1, - 'target' => '', - 'user' => 0 - ); - $r ++; - - $this->menu[$r] = array ( - 'fk_menu' => 'fk_mainmenu=accounting', - 'type' => 'left', - 'titre' => 'Journaux', - 'leftmenu' => 'Journaux', - 'mainmenu' => 'accounting', - // 'url'=>'', - 'langs' => 'accountingex@accountingex', - 'position' => 120, - 'enabled' => 1, - 'perms' => 1, - 'target' => '', - 'user' => 0 - ); - $r ++; - - $this->menu[$r] = array ( - 'fk_menu' => 'fk_mainmenu=accounting,fk_leftmenu=Journaux', - 'type' => 'left', - 'titre' => 'SellsJournal', - 'leftmenu' => 'SellsJournal', - 'mainmenu' => 'accounting', - 'url' => '/accountingex/journal/sellsjournal.php', - 'langs' => 'accountingex@accountingex', - 'position' => 121, - 'enabled' => 1, - 'perms' => 1, - 'target' => '', - 'user' => 0 - ); - $r ++; - - $this->menu[$r] = array ( - 'fk_menu' => 'fk_mainmenu=accounting,fk_leftmenu=Journaux', - 'type' => 'left', - 'titre' => 'PurchasesJournal', - 'leftmenu' => 'PurchasesJournal', - 'mainmenu' => 'accounting', - 'url' => '/accountingex/journal/purchasesjournal.php', - 'langs' => 'accountingex@accountingex', - 'position' => 122, - 'enabled' => '$conf->fournisseur->enabled', - 'perms' => 1, - 'target' => '', - 'user' => 0 - ); - $r ++; - - $this->menu[$r] = array ( - 'fk_menu' => 'fk_mainmenu=accounting,fk_leftmenu=Journaux', - 'type' => 'left', - 'titre' => 'CashJournal', - 'leftmenu' => 'CashJournal', - 'mainmenu' => 'accounting', - 'url' => '/accountingex/journal/cashjournal.php', - 'langs' => 'accountingex@accountingex', - 'position' => 123, - 'enabled' => 1, - 'perms' => 1, - 'target' => '', - 'user' => 0 - ); - $r ++; - - $this->menu[$r] = array ( - 'fk_menu' => 'fk_mainmenu=accounting,fk_leftmenu=Journaux', - 'type' => 'left', - 'titre' => 'BankJournal', - 'leftmenu' => 'BankJournal', - 'mainmenu' => 'accounting', - 'url' => '/accountingex/journal/bankjournal.php', - 'langs' => 'accountingex@accountingex', - 'position' => 200, - 'enabled' => '$conf->banque->enabled', - 'perms' => 1, - 'target' => '', - 'user' => 0 - ); - $r ++; - - $this->menu[$r] = array ( - 'fk_menu' => 'fk_mainmenu=accounting', - 'type' => 'left', - 'titre' => 'Bookkeeping', - 'leftmenu' => 'Bookkeeping', - 'mainmenu' => 'accounting', - 'url' => '/accountingex/bookkeeping/liste.php', - 'langs' => 'accountingex@accountingex', - 'position' => 300, - 'enabled' => 1, - 'perms' => 1, - 'target' => '', - 'user' => 0 - ); - $r ++; - - $this->menu[$r] = array ( - 'fk_menu' => 'fk_mainmenu=accounting,fk_leftmenu=Bookkeeping', - 'type' => 'left', - 'titre' => 'ByYear', - 'leftmenu' => 'ByYear', - 'mainmenu' => 'accounting', - 'url' => '/accountingex/bookkeeping/listebyyear.php', - 'langs' => 'accountingex@accountingex', - 'position' => 301, - 'enabled' => 1, - 'perms' => 1, - 'target' => '', - 'user' => 0 - ); - $r ++; - - $this->menu[$r] = array ( - 'fk_menu' => 'fk_mainmenu=accounting,fk_leftmenu=Bookkeeping', - 'type' => 'left', - 'titre' => 'AccountBalanceByMonth', - 'leftmenu' => 'AccountBalanceByMonth', - 'mainmenu' => 'accounting', - 'url' => '/accountingex/bookkeeping/balancebymonth.php', - 'langs' => 'accountingex@accountingex', - 'position' => 302, - 'enabled' => 1, - 'perms' => 1, - 'target' => '', - 'user' => 0 - ); - $r ++; - - // Parameters Menu - $this->menu[$r] = array ( - 'fk_menu' => 'fk_mainmenu=accounting', - 'type' => 'left', - 'titre' => 'Parameters', - 'leftmenu' => 'Parameters', - 'mainmenu' => 'accounting', - 'url' => '/accountingex/admin/index.php', - 'langs' => 'accountingex@accountingex', - 'position' => 400, - 'enabled' => 1, - 'perms' => '$user->rights->accountingex->admin', - 'target' => '', - 'user' => 0 - ); - $r ++; - - $this->menu[$r] = array ( - 'fk_menu' => 'fk_mainmenu=accounting,fk_leftmenu=Parameters', - 'type' => 'left', - 'titre' => 'Globalparameters', - 'leftmenu' => 'Globalparameters', - 'mainmenu' => 'accounting', - 'url' => '/accountingex/admin/index.php', - 'langs' => 'accountingex@accountingex', - 'position' => 401, - 'enabled' => 1, - 'perms' => '$user->rights->accountingex->admin', - 'target' => '', - 'user' => 0 - ); - $r ++; - - $this->menu[$r] = array ( - 'fk_menu' => 'fk_mainmenu=accounting,fk_leftmenu=Globalparameters', - 'type' => 'left', - 'titre' => 'Chartofaccounts', - 'leftmenu' => 'Chartofaccounts', - 'mainmenu' => 'accounting', - 'url' => '/accountingex/admin/account.php', - 'langs' => 'accountingex@accountingex', - 'position' => 402, - 'enabled' => 1, - 'perms' => '$user->rights->accountingex->admin', - 'target' => '', - 'user' => 0 - ); - $r ++; - - $this->menu[$r] = array ( - 'fk_menu' => 'fk_mainmenu=accounting,fk_leftmenu=Globalparameters', - 'type' => 'left', - 'titre' => 'Menuaccount', - 'leftmenu' => 'Menuaccount', - 'mainmenu' => 'accounting', - 'url' => '/accountingex/admin/account.php', - 'langs' => 'accountingex@accountingex', - 'position' => 403, - 'enabled' => 1, - 'perms' => '$user->rights->accountingex->admin', - 'target' => '', - 'user' => 0 - ); - $r ++; - - $this->menu[$r] = array ( - 'fk_menu' => 'fk_mainmenu=accounting,fk_leftmenu=Parameters', - 'type' => 'left', - 'titre' => 'Menuthirdpartyaccount', - 'mainmenu' => 'accounting', - 'url' => '/accountingex/admin/thirdpartyaccount.php', - 'langs' => 'accountingex@accountingex', - 'position' => 404, - 'enabled' => 1, - 'perms' => '$user->rights->accountingex->admin', - 'target' => '', - 'user' => 0 - ); - $r ++; - - $this->menu[$r] = array ( - 'fk_menu' => 'fk_mainmenu=accounting,fk_leftmenu=Parameters', - 'type' => 'left', - 'titre' => 'MenuTools', - 'mainmenu' => 'accounting', - 'url' => '/accountingex/admin/productaccount.php', - 'langs' => 'accountingex@accountingex', - 'position' => 405, - 'enabled' => 1, - 'perms' => '$user->rights->accountingex->admin', - 'target' => '', - 'user' => 0 - ); - $r ++; } /**