30 require_once DOL_DOCUMENT_ROOT.
'/core/class/menubase.class.php';
45 function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 0, $mode =
'')
47 global $user, $conf, $langs, $mysoc;
48 global $dolibarr_main_db_name;
50 $mainmenu = (empty($_SESSION[
"mainmenu"]) ?
'' : $_SESSION[
"mainmenu"]);
51 $leftmenu = (empty($_SESSION[
"leftmenu"]) ?
'' : $_SESSION[
"leftmenu"]);
54 $listofmodulesforexternal = explode(
',', $conf->global->MAIN_MODULES_FOR_EXTERNAL);
66 if ($mode !=
'jmobile' && $mode !=
'topnb' && $usemenuhider && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
68 $classname =
'class="tmenu menuhider nohover"';
71 $menu->add(
'#', (
getDolGlobalInt(
'THEME_TOPMENU_DISABLE_IMAGE') == 1 ?
'<span class="fa fa-bars"></span>' :
''), 0, $showmode, $atarget,
"xxx",
'', 0, $id, $idsel, $classname);
79 'link' =>
'/index.php?mainmenu=home&leftmenu=home',
82 'enabled' => $showmode = 1,
89 'classname' => $classname = (!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"home") ?
'class="tmenusel"' :
'class="tmenu"',
90 'prefix' =>
'<span class="fa fa-home fa-fw paddingright"></span>',
91 'session' => ((!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"home") ? 0 : 1),
92 'loadLangs' => array(),
93 'submenus' => array(),
99 'perms' => $user->hasRight(
'adherent',
'lire'),
100 'module' =>
'adherent'
104 'link' =>
'/adherents/index.php?mainmenu=members&leftmenu=',
105 'title' =>
"MenuMembers",
107 'enabled' => $showmode =
isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
108 'target' => $atarget,
109 'mainmenu' =>
"members",
113 'idsel' =>
'members',
114 'classname' => $classname = (!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"members") ?
'class="tmenusel"' :
'class="tmenu"',
115 'prefix' =>
img_picto(
'',
'member',
'class="fa-fw paddingright pictofixedwidth"'),
116 'session' => ((!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"members") ? 0 : 1),
117 'loadLangs' => array(
"members"),
118 'submenus' => array(),
124 (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))
128 'perms'=> ($user->hasRight(
'societe',
'lire') || $user->hasRight(
'fournisseur',
'lire') || $user->hasRight(
'supplier_order',
'lire') || $user->hasRight(
'supplier_invoice',
'lire') || $user->hasRight(
'supplier_proposal',
'lire')),
129 'module'=>
'societe|fournisseur'
132 'name' =>
'Companies',
133 'link' =>
'/societe/index.php?mainmenu=companies&leftmenu=',
134 'title' =>
"ThirdParties",
136 'enabled' => $showmode =
isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
137 'target' => $atarget,
138 'mainmenu' =>
"companies",
142 'idsel' =>
'companies',
143 'classname' => $classname = (!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"companies") ?
'class="tmenusel"' :
'class="tmenu"',
144 'prefix' =>
img_picto(
'',
'company',
'class="fa-fw paddingright pictofixedwidth"'),
145 'session' => ((!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"companies") ? 0 : 1),
146 'loadLangs' => array(
"companies",
"suppliers"),
147 'submenus' => array(),
153 'perms'=> ($user->hasRight(
'product',
'read') || $user->hasRight(
'service',
'read') || $user->hasRight(
'expedition',
'lire')),
154 'module'=>
'product|service'
157 'name' =>
'Products',
158 'link' =>
'/product/index.php?mainmenu=products&leftmenu=',
160 ? (array(
"TMenuProducts",
" | ",
"TMenuServices"))
161 : (
isModEnabled(
'product') ?
"TMenuProducts" :
"TMenuServices"),
163 'enabled' => $showmode =
isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
164 'target' => $atarget,
165 'mainmenu' =>
"products",
169 'idsel' =>
'products',
170 'classname' => $classname = (!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"products") ?
'class="tmenusel"' :
'class="tmenu"',
171 'prefix' =>
img_picto(
'',
'product',
'class="fa-fw paddingright pictofixedwidth"'),
172 'session' => ((!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"products") ? 0 : 1),
173 'loadLangs' => array(
"products",
"stocks"),
174 'submenus' => array(),
180 'perms'=>($user->hasRight(
'bom',
'read') || $user->hasRight(
'mrp',
'read')),
184 'name' =>
'TMenuMRP',
185 'link' =>
'/mrp/index.php?mainmenu=mrp&leftmenu=',
186 'title' =>
"TMenuMRP",
188 'enabled' => $showmode =
isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
189 'target' => $atarget,
195 'classname' => $classname = (!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"mrp") ?
'class="tmenusel"' :
'class="tmenu"',
196 'prefix' =>
img_picto(
'',
'mrp',
'class="fa-fw paddingright pictofixedwidth"'),
197 'session' => ((!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"mrp") ? 0 : 1),
198 'loadLangs' => array(
"mrp"),
199 'submenus' => array(),
205 'perms'=> ($user->hasRight(
'projet',
'lire') ? 1 : 0),
209 if ($mode ==
'jmobile') {
210 $titleboth = $langs->trans(
"LeadsOrProjects");
212 $titleboth = $langs->trans(
"Projects");
214 if (empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
215 $titleboth = $langs->trans(
"Projects");
217 if (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 2) {
218 $titleboth = $langs->trans(
"Leads");
223 'link' =>
'/projet/index.php?mainmenu=project&leftmenu=',
224 'title' => $titleboth,
226 'enabled' => $showmode =
isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
227 'target' => $atarget,
228 'mainmenu' =>
"project",
232 'idsel' =>
'project',
233 'classname' => $classname = (!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"project") ?
'class="tmenusel"' :
'class="tmenu"',
234 'prefix' =>
img_picto(
'',
'project',
'class="fa-fw paddingright pictofixedwidth"'),
235 'session' => ((!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"project") ? 0 : 1),
236 'loadLangs' => array(
"projects"),
237 'submenus' => array(),
250 'perms'=>($user->hasRight(
'propal',
'read')
251 || $user->hasRight(
'commande',
'lire')
252 || $user->hasRight(
'supplier_proposal',
'lire')
253 || $user->hasRight(
'fournisseur',
'lire')
254 || $user->hasRight(
'fournisseur',
'commande',
'lire')
255 || $user->hasRight(
'supplier_order',
'lire')
256 || $user->hasRight(
'contrat',
'lire')
257 || $user->hasRight(
'ficheinter',
'lire')
259 'module'=>
'propal|commande|supplier_proposal|supplier_order|contrat|ficheinter'
262 $onlysupplierorder = $user->hasRight(
'fournisseur',
'commande',
'lire') &&
263 !$user->hasRight(
'propal',
'lire') &&
264 !$user->hasRight(
'commande',
'lire') &&
265 !$user->hasRight(
'supplier_order',
'lire') &&
266 !$user->hasRight(
'supplier_proposal',
'lire') &&
267 !$user->hasRight(
'contrat',
'lire') &&
268 !$user->hasRight(
'ficheinter',
'lire');
271 'name' =>
'Commercial',
272 'link' => ($onlysupplierorder ?
'/fourn/commande/index.php?mainmenu=commercial&leftmenu=' :
'/comm/index.php?mainmenu=commercial&leftmenu='),
273 'title' =>
"Commercial",
275 'enabled' => $showmode =
isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
276 'target' => $atarget,
277 'mainmenu' =>
"commercial",
281 'idsel' =>
'commercial',
282 'classname' => $classname = (!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"commercial") ?
'class="tmenusel"' :
'class="tmenu"',
283 'prefix' =>
img_picto(
'',
'contract',
'class="fa-fw paddingright pictofixedwidth"'),
284 'session' => ((!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"commercial") ? 0 : 1),
285 'loadLangs' => array(
"commercial"),
286 'submenus' => array(),
299 'perms'=>($user->hasRight(
'facture',
'lire') || $user->hasRight(
'don',
'contact',
'lire')
300 || $user->hasRight(
'tax',
'charges',
'lire') || $user->hasRight(
'salaries',
'read')
301 || $user->hasRight(
'fournisseur',
'facture',
'lire') || $user->hasRight(
'loan',
'read') || $user->hasRight(
'margins',
'liretous')),
302 'module'=>
'facture|supplier_invoice|don|tax|salaries|loan'
306 'link' =>
'/compta/index.php?mainmenu=billing&leftmenu=',
307 'title' =>
"MenuFinancial",
309 'enabled' => $showmode =
isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
310 'target' => $atarget,
311 'mainmenu' =>
"billing",
315 'idsel' =>
'billing',
316 'classname' => $classname = (!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"billing") ?
'class="tmenusel"' :
'class="tmenu"',
317 'prefix' =>
img_picto(
'',
'bill',
'class="fa-fw paddingright pictofixedwidth"'),
318 'session' => ((!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"billing") ? 0 : 1),
319 'loadLangs' => array(
"compta"),
320 'submenus' => array(),
326 'perms'=>($user->hasRight(
'banque',
'lire') || $user->hasRight(
'prelevement',
'lire') || $user->hasRight(
'paymentbybanktransfer',
'read')),
327 'module'=>
'banque|prelevement|paymentbybanktransfer'
331 'link' =>
'/compta/bank/list.php?mainmenu=bank&leftmenu=',
332 'title' =>
"MenuBankCash",
334 'enabled' => $showmode =
isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
335 'target' => $atarget,
336 'mainmenu' =>
"bank",
341 'classname' => $classname = (!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"bank") ?
'class="tmenusel"' :
'class="tmenu"',
342 'prefix' =>
img_picto(
'',
'bank_account',
'class="fa-fw paddingright pictofixedwidth"'),
343 'session' => ((!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"bank") ? 0 : 1),
344 'loadLangs' => array(
"compta",
"banks"),
345 'submenus' => array(),
351 'perms'=>($user->hasRight(
'compta',
'resultat',
'lire') || $user->hasRight(
'accounting',
'comptarapport',
'lire') || $user->hasRight(
'accounting',
'mouvements',
'lire') || $user->hasRight(
'asset',
'read') || $user->hasRight(
'intracommreport',
'read')),
352 'module'=>
'comptabilite|accounting|asset|intracommreport'
355 'name' =>
'Accounting',
356 'link' =>
'/accountancy/index.php?mainmenu=accountancy&leftmenu=',
357 'title' =>
"MenuAccountancy",
359 'enabled' => $showmode =
isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
360 'target' => $atarget,
361 'mainmenu' =>
"accountancy",
365 'idsel' =>
'accountancy',
366 'classname' => $classname = (!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"accountancy") ?
'class="tmenusel"' :
'class="tmenu"',
367 'prefix' =>
img_picto(
'',
'accountancy',
'class="fa-fw paddingright pictofixedwidth"'),
368 'session' => ((!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"accountancy") ? 0 : 1),
369 'loadLangs' => array(
"compta",
"accountancy",
"assets",
"intracommreport"),
370 'submenus' => array(),
376 'perms'=>($user->hasRight(
'user',
'user',
'lire') || $user->hasRight(
'holiday',
'read') || $user->hasRight(
'deplacement',
'lire') || $user->hasRight(
'expensereport',
'lire') || $user->hasRight(
'recruitment',
'recruitmentjobposition',
'read')),
377 'module'=>
'hrm|holiday|deplacement|expensereport|recruitment'
382 'link' =>
'/hrm/index.php?mainmenu=hrm&leftmenu=',
385 'enabled' => $showmode =
isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
386 'target' => $atarget,
392 'classname' => $classname = (!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"hrm") ?
'class="tmenusel"' :
'class="tmenu"',
393 'prefix' =>
img_picto(
'',
'hrm',
'class="fa-fw paddingright pictofixedwidth"'),
394 'session' => ((!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"hrm") ? 0 : 1),
395 'loadLangs' => array(
"hrm",
"holiday"),
396 'submenus' => array(),
402 'perms'=>($user->hasRight(
'ticket',
'read') || $user->hasRight(
'knowledgemanagement',
'knowledgerecord',
'read')),
403 'module'=>
'ticket|knowledgemanagement'
407 $link =
'/ticket/index.php?mainmenu=ticket&leftmenu=';
409 $link =
'/knowledgemanagement/knowledgerecord_list.php?mainmenu=ticket&leftmenu=';
414 'title' =>
"Tickets",
416 'enabled' => $showmode =
isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
417 'target' => $atarget,
418 'mainmenu' =>
"ticket",
423 'classname' => $classname = (!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"ticket") ?
'class="tmenusel"' :
'class="tmenu"',
424 'prefix' =>
img_picto(
'',
'ticket',
'class="fa-fw paddingright pictofixedwidth"'),
425 'session' => ((!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"ticket") ? 0 : 1),
426 'loadLangs' => array(
"ticket",
"knowledgemanagement"),
427 'submenus' => array(),
438 'link' =>
'/core/tools.php?mainmenu=tools&leftmenu=',
441 'enabled' => $showmode =
isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
442 'target' => $atarget,
443 'mainmenu' =>
"tools",
448 'classname' => $classname = (!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"tools") ?
'class="tmenusel"' :
'class="tmenu"',
449 'prefix' =>
img_picto(
'',
'tools',
'class="fa-fw paddingright pictofixedwidth"'),
450 'session' => ((!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"tools") ? 0 : 1),
451 'loadLangs' => array(
"other"),
452 'submenus' => array(),
456 foreach ($menu_arr as $key => $smenu) {
457 $smenu = (object) $smenu;
459 if ($smenu->enabled) {
460 if ($smenu->session) {
461 $_SESSION[
'idmenu'] =
'';
465 if (!empty($smenu->loadLangs)) {
466 $langs->loadLangs($smenu->loadLangs);
471 if (is_array($smenu->title)) {
472 foreach ($smenu->title as $item) {
473 $mtitle .= $langs->trans($item);
476 $mtitle = $langs->trans($smenu->title);
479 $menu->add($smenu->link, $mtitle, $smenu->level, $smenu->enabled, $smenu->target, $smenu->mainmenu, $smenu->leftmenu, $smenu->position, $smenu->id, $smenu->idsel, $smenu->classname, $smenu->prefix);
484 $menuArbo =
new Menubase($db,
'eldy');
486 $newTabMenu = $menuArbo->menuTopCharger(
'',
'', $type_user,
'eldy', $tabMenu);
488 $num = count($newTabMenu);
489 for ($i = 0; $i < $num; $i++) {
491 $idsel = (empty($newTabMenu[$i][
'mainmenu']) ?
'none' : $newTabMenu[$i][
'mainmenu']);
496 $url = $shorturl = $newTabMenu[$i][
'url'];
497 if (!preg_match(
"/^(http:\/\/|https:\/\/)/i", $newTabMenu[$i][
'url'])) {
498 $tmp = explode(
'?', $newTabMenu[$i][
'url'], 2);
499 $url = $shorturl = $tmp[0];
500 $param = (isset($tmp[1]) ? $tmp[1] :
'');
502 if ((!preg_match(
'/mainmenu/i', $param)) || !preg_match(
'/leftmenu/i', $param)) {
503 $param .= ($param ?
'&' :
'').
'mainmenu='.$newTabMenu[$i][
'mainmenu'].
'&leftmenu=';
510 $shorturl = preg_replace(
'/^'.preg_quote(DOL_URL_ROOT,
'/').
'/',
'', $shorturl);
515 if ($showmode == 1) {
517 if (!empty($_SESSION[
'idmenu']) && $newTabMenu[$i][
'rowid'] == $_SESSION[
'idmenu']) {
518 $classname =
'class="tmenusel"';
519 } elseif (!empty($_SESSION[
"mainmenu"]) && $newTabMenu[$i][
'mainmenu'] == $_SESSION[
"mainmenu"]) {
520 $classname =
'class="tmenusel"';
522 $classname =
'class="tmenu"';
524 } elseif ($showmode == 2) {
525 $classname =
'class="tmenu"';
530 $newTabMenu[$i][
'titre'],
533 ($newTabMenu[$i][
'target'] ? $newTabMenu[$i][
'target'] : $atarget),
534 ($newTabMenu[$i][
'mainmenu'] ? $newTabMenu[$i][
'mainmenu'] : $newTabMenu[$i][
'rowid']),
535 ($newTabMenu[$i][
'leftmenu'] ? $newTabMenu[$i][
'leftmenu'] :
''),
536 $newTabMenu[$i][
'position'],
540 $newTabMenu[$i][
'prefix']
549 if (empty($conf->global->MAIN_MENU_INVERT) && empty($noout) && !empty($conf->global->MAIN_SHOW_LOGO) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
551 $mysoc->logo_squarred_mini = (empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI) ?
'' : $conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI);
553 $logoContainerAdditionalClass =
'backgroundforcompanylogo';
554 if (!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_NO_BACKGROUND)) {
555 $logoContainerAdditionalClass =
'';
558 if (!empty($mysoc->logo_squarred_mini) && is_readable($conf->mycompany->dir_output.
'/logos/thumbs/'.$mysoc->logo_squarred_mini)) {
559 $urllogo = DOL_URL_ROOT.
'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode(
'logos/thumbs/'.$mysoc->logo_squarred_mini);
565 $urllogo = DOL_URL_ROOT.
'/theme/dolibarr_512x512_white.png';
566 $logoContainerAdditionalClass =
'';
568 $title = $langs->trans(
"GoIntoSetupToChangeLogo");
570 print
"\n".
'<!-- Show logo on menu -->'.
"\n";
573 print
'<div class="center '.$logoContainerAdditionalClass.
' menulogocontainer"><img class="mycompany" title="'.
dol_escape_htmltag($title).
'" alt="" src="'.$urllogo.
'" style="max-width: 100px"></div>'.
"\n";
579 foreach ($menu->liste as $menuval) {
581 print_text_menu_entry($menuval[
'titre'], $menuval[
'enabled'], (($menuval[
'url'] !=
'#' && !preg_match(
'/^(http:\/\/|https:\/\/)/i', $menuval[
'url'])) ? DOL_URL_ROOT:
'').$menuval[
'url'], $menuval[
'id'], $menuval[
'idsel'], $menuval[
'classname'], ($menuval[
'target'] ? $menuval[
'target'] : $atarget));
606 print
'<div class="tmenudiv">';
607 print
'<ul role="navigation" class="tmenu"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ?
'' :
' title="Top menu"').
'>';
621 print
'<li '.$classname.
' id="mainmenutd_'.$idsel.
'">';
623 print
'<div class="tmenucenter">';
641 global $conf, $langs;
643 $classnameimg = str_replace(
'class="',
'class="tmenuimage ', $classname);
644 $classnametxt = str_replace(
'class="',
'class="tmenulabel ', $classname);
647 if ($showmode == 1) {
648 print
'<a '.$classnameimg.
' tabindex="-1" href="'.$url.
'"'.($atarget ?
' target="'.$atarget.
'"' :
'').
' title="'.
dol_escape_htmltag($text).
'">';
649 print
'<div class="'.$id.
' '.$idsel.
' topmenuimage"><span class="'.$id.
' tmenuimageforpng" id="mainmenuspan_'.$idsel.
'"></span></div>';
651 if (empty($conf->global->THEME_TOPMENU_DISABLE_TEXT)) {
652 print
'<a '.$classnametxt.
' id="mainmenua_'.$idsel.
'" href="'.$url.
'"'.($atarget ?
' target="'.$atarget.
'"' :
'').
' title="'.
dol_escape_htmltag($text).
'">';
653 print
'<span class="mainmenuaspan">';
658 } elseif ($showmode == 2) {
659 print
'<div '.$classnameimg.
' title="'.
dol_escape_htmltag($text.
' - '.$langs->trans(
"NotAllowed")).
'">';
660 print
'<div class="'.$id.
' '.$idsel.
' topmenuimage tmenudisabled"><span class="'.$id.
' tmenuimageforpng tmenudisabled" id="mainmenuspan_'.$idsel.
'"></span></div>';
662 if (empty($conf->global->THEME_TOPMENU_DISABLE_TEXT)) {
663 print
'<span '.$classnametxt.
' id="mainmenua_'.$idsel.
'" href="#" title="'.
dol_escape_htmltag($text.
' - '.$langs->trans(
"NotAllowed")).
'">';
664 print
'<span class="mainmenuaspan tmenudisabled">';
714 function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabMenu, &$menu, $noout = 0, $forcemainmenu =
'', $forceleftmenu =
'', $moredata =
null, $type_user = 0)
717 global $user, $conf, $langs, $hookmanager;
723 $mainmenu = ($forcemainmenu ? $forcemainmenu : $_SESSION[
"mainmenu"]);
724 $leftmenu = ($forceleftmenu ?
'' : (empty($_SESSION[
"leftmenu"]) ?
'none' : $_SESSION[
"leftmenu"]));
726 global $usemenuhider;
729 if (is_array($moredata) && !empty($moredata[
'searchform'])) {
731 print
"<!-- Begin SearchForm -->\n";
732 print
'<div id="blockvmenusearch" class="blockvmenusearch">'.
"\n";
733 print $moredata[
'searchform'];
735 print
"<!-- End SearchForm -->\n";
738 if (is_array($moredata) && !empty($moredata[
'bookmarks'])) {
740 print
"<!-- Begin Bookmarks -->\n";
741 print
'<div id="blockvmenubookmarks" class="blockvmenubookmarks">'.
"\n";
742 print $moredata[
'bookmarks'];
744 print
"<!-- End Bookmarks -->\n";
749 $listofmodulesforexternal = explode(
',', $conf->global->MAIN_MODULES_FOR_EXTERNAL);
759 if ($mainmenu ==
'home') {
766 if ($mainmenu ==
'companies') {
773 if ($mainmenu ==
'commercial') {
780 if ($mainmenu ==
'billing') {
787 if ($mainmenu ==
'accountancy') {
794 if ($mainmenu ==
'bank') {
801 if ($mainmenu ==
'products') {
808 if ($mainmenu ==
'mrp') {
815 if ($mainmenu ==
'project') {
822 if ($mainmenu ==
'hrm') {
828 if ($mainmenu ==
'tools') {
835 if ($mainmenu ==
'members') {
841 $menuArbo =
new Menubase($db,
'eldy');
842 $newmenu = $menuArbo->menuLeftCharger($newmenu, $mainmenu, $leftmenu, (empty($user->socid) ? 0 : 1),
'eldy', $tabMenu);
848 while ($i <= $MAXFTP) {
849 $paramkey =
'FTP_NAME_'.$i;
851 if (!empty($conf->global->$paramkey)) {
852 $link =
"/ftp/index.php?idmenu=".$_SESSION[
"idmenu"].
"&numero_ftp=".$i;
853 $newmenu->add($link,
dol_trunc($conf->global->$paramkey, 24));
866 $menu_array = $newmenu->liste;
867 if (is_array($menu_array_before)) {
868 $menu_array = array_merge($menu_array_before, $menu_array);
870 if (is_array($menu_array_after)) {
871 $menu_array = array_merge($menu_array, $menu_array_after);
874 if (!is_array($menu_array)) {
880 'mainmenu' => $mainmenu,
882 $hook_items = $menu_array;
883 $reshook = $hookmanager->executeHooks(
'menuLeftMenuItems', $parameters, $hook_items);
885 if (is_numeric($reshook)) {
886 if ($reshook == 0 && !empty($hookmanager->results)) {
887 $menu_array[] = $hookmanager->results;
888 } elseif ($reshook == 1) {
889 $menu_array = $hookmanager->results;
913 $invert = empty($conf->global->MAIN_MENU_INVERT) ?
"" :
"invert";
916 $blockvmenuopened =
false;
918 $num = count($menu_array);
919 for ($i = 0; $i < $num; $i++) {
921 if (!empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED) && empty($menu_array[$i][
'enabled'])) {
926 if (empty($menu_array[$i][
'level']) && $showmenu) {
928 $blockvmenuopened =
true;
930 for ($j = ($i + 1); $j < $num; $j++) {
931 if (empty($menu_array[$j][
'level'])) {
935 if ($altok % 2 == 0) {
936 print
'<div class="blockvmenu blockvmenuimpair'.$invert.($lastopened ?
' blockvmenulast' :
'').($altok == 1 ?
' blockvmenufirst' :
'').
'">'.
"\n";
938 print
'<div class="blockvmenu blockvmenupair'.$invert.($lastopened ?
' blockvmenulast' :
'').($altok == 1 ?
' blockvmenufirst' :
'').
'">'.
"\n";
944 $tabul = ($menu_array[$i][
'level'] - 1);
946 for ($j = 0; $j < $tabul; $j++) {
947 $tabstring .=
' ';
955 $url = $shorturl = $shorturlwithoutparam = $menu_array[$i][
'url'];
956 if (!preg_match(
"/^(http:\/\/|https:\/\/)/i", $menu_array[$i][
'url'])) {
957 $tmp = explode(
'?', $menu_array[$i][
'url'], 2);
958 $url = $shorturl = $tmp[0];
959 $param = (isset($tmp[1]) ? $tmp[1] :
'');
962 if ((!preg_match(
'/mainmenu/i', $param)) && (!preg_match(
'/leftmenu/i', $param)) && !empty($menu_array[$i][
'mainmenu'])) {
963 $param .= ($param ?
'&' :
'').
'mainmenu='.$menu_array[$i][
'mainmenu'].
'&leftmenu=';
965 if ((!preg_match(
'/mainmenu/i', $param)) && (!preg_match(
'/leftmenu/i', $param)) && empty($menu_array[$i][
'mainmenu'])) {
966 $param .= ($param ?
'&' :
'').
'leftmenu=';
970 $shorturlwithoutparam = $shorturl;
971 $shorturl = $shorturl.($param ?
'?'.$param :
'');
975 print
'<!-- Process menu entry with mainmenu='.$menu_array[$i][
'mainmenu'].
', leftmenu='.$menu_array[$i][
'leftmenu'].
', level='.$menu_array[$i][
'level'].
' enabled='.$menu_array[$i][
'enabled'].
', position='.$menu_array[$i][
'position'].
' -->'.
"\n";
978 if ($menu_array[$i][
'level'] == 0) {
979 if ($menu_array[$i][
'enabled']) {
980 print
'<div class="menu_titre">'.$tabstring;
981 if ($shorturlwithoutparam) {
982 print
'<a class="vmenu" title="'.dol_escape_htmltag(
dol_string_nohtmltag($menu_array[$i][
'titre'])).
'" href="'.$url.
'"'.($menu_array[$i][
'target'] ?
' target="'.$menu_array[$i][
'target'].
'"' :
'').
'>';
984 print
'<span class="vmenu">';
986 print ($menu_array[$i][
'prefix'] ? $menu_array[$i][
'prefix'] :
'').$menu_array[$i][
'titre'];
987 if ($shorturlwithoutparam) {
993 $lastlevel0 =
'enabled';
994 } elseif ($showmenu) {
995 print
'<div class="menu_titre">'.$tabstring;
996 print
'<span class="vmenudisabled">';
997 print ($menu_array[$i][
'prefix'] ? $menu_array[$i][
'prefix'] :
'').$menu_array[$i][
'titre'];
1000 $lastlevel0 =
'greyed';
1002 $lastlevel0 =
'hidden';
1005 print
'<div class="menu_top"></div>'.
"\n";
1010 if ($menu_array[$i][
'level'] > 0) {
1012 if ($menu_array[$i][
'url']) {
1013 $cssmenu =
' menu_contenu'.dol_string_nospecial(preg_replace(
'/\.php.*$/',
'', $menu_array[$i][
'url']));
1016 if ($menu_array[$i][
'enabled'] && $lastlevel0 ==
'enabled') {
1018 print
'<div class="menu_contenu'.$cssmenu.
'">';
1020 if ($shorturlwithoutparam) {
1021 print
'<a class="vsmenu" title="'.dol_escape_htmltag(
dol_string_nohtmltag($menu_array[$i][
'titre'])).
'" href="'.$url.
'"'.($menu_array[$i][
'target'] ?
' target="'.$menu_array[$i][
'target'].
'"' :
'').
'>';
1023 print
'<span class="vsmenu" title="'.dol_escape_htmltag($menu_array[$i][
'titre']).
'">';
1025 print $menu_array[$i][
'titre'];
1026 if ($shorturlwithoutparam) {
1032 if (!strstr($menu_array[$i][
'titre'],
'<table')) {
1035 print
'</div>'.
"\n";
1036 } elseif ($showmenu && $lastlevel0 ==
'enabled') {
1038 print
'<div class="menu_contenu'.$cssmenu.
'">';
1040 print
'<span class="vsmenudisabled vsmenudisabledmargin">'.$menu_array[$i][
'titre'].
'</span><br>';
1041 print
'</div>'.
"\n";
1046 if (empty($menu_array[$i + 1][
'level'])) {
1048 print
'<div class="menu_end"></div>'.
"\n";
1050 if ($blockvmenuopened) {
1051 print
'</div>'.
"\n";
1052 $blockvmenuopened =
false;
1058 print
'<div class="blockvmenuend"></div>';
1062 return count($menu_array);
1078 global $user, $conf, $langs;
1080 if ($mainmenu ==
'home') {
1081 $langs->load(
"users");
1084 $newmenu->add(
"/index.php?mainmenu=home&leftmenu=home", $langs->trans(
"MyDashboard"), 0, 1,
'', $mainmenu,
'home', 0,
'',
'',
'',
'<i class="fa fa-bar-chart fa-fw paddingright pictofixedwidth"></i>');
1087 $newmenu->add(
"/admin/index.php?mainmenu=home&leftmenu=setup", $langs->trans(
"Setup"), 0, $user->admin,
'', $mainmenu,
'setup', 0,
'',
'',
'',
'<i class="fa fa-tools fa-fw paddingright pictofixedwidth"></i>');
1089 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"setup") {
1091 $langs->loadLangs(array(
"admin",
"help"));
1094 if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) {
1095 $langs->load(
"errors");
1096 $warnpicto =
img_warning($langs->trans(
"WarningMandatorySetupNotComplete"));
1098 $newmenu->add(
"/admin/company.php?mainmenu=home", $langs->trans(
"MenuCompanySetup").$warnpicto, 1);
1101 if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING) ? 1 : $conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) {
1102 $langs->load(
"errors");
1103 $warnpicto =
img_warning($langs->trans(
"WarningMandatorySetupNotComplete"));
1105 $newmenu->add(
"/admin/modules.php?mainmenu=home", $langs->trans(
"Modules").$warnpicto, 1);
1106 $newmenu->add(
"/admin/ihm.php?mainmenu=home", $langs->trans(
"GUISetup"), 1);
1107 $newmenu->add(
"/admin/menus.php?mainmenu=home", $langs->trans(
"Menus"), 1);
1109 $newmenu->add(
"/admin/translation.php?mainmenu=home", $langs->trans(
"Translation"), 1);
1110 $newmenu->add(
"/admin/defaultvalues.php?mainmenu=home", $langs->trans(
"DefaultValues"), 1);
1111 $newmenu->add(
"/admin/boxes.php?mainmenu=home", $langs->trans(
"Boxes"), 1);
1112 $newmenu->add(
"/admin/delais.php?mainmenu=home", $langs->trans(
"MenuWarnings"), 1);
1113 $newmenu->add(
"/admin/security_other.php?mainmenu=home", $langs->trans(
"Security"), 1);
1114 $newmenu->add(
"/admin/limits.php?mainmenu=home", $langs->trans(
"MenuLimits"), 1);
1115 $newmenu->add(
"/admin/pdf.php?mainmenu=home", $langs->trans(
"PDF"), 1);
1118 if (
getDolGlobalString(
'MAIN_MAIL_SENDMODE',
'mail') ==
'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) {
1119 $langs->load(
"errors");
1120 $warnpicto =
img_warning($langs->trans(
"WarningPHPMailD"));
1122 if (!empty($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array(
'smtps',
'swiftmail')) && empty($conf->global->MAIN_MAIL_SMTP_SERVER)) {
1123 $langs->load(
"errors");
1124 $warnpicto =
img_warning($langs->trans(
"ErrorSetupOfEmailsNotComplete"));
1127 $newmenu->add(
"/admin/mails.php?mainmenu=home", $langs->trans(
"Emails").$warnpicto, 1);
1128 $newmenu->add(
"/admin/sms.php?mainmenu=home", $langs->trans(
"SMS"), 1);
1129 $newmenu->add(
"/admin/dict.php?mainmenu=home", $langs->trans(
"Dictionary"), 1);
1130 $newmenu->add(
"/admin/const.php?mainmenu=home", $langs->trans(
"OtherSetup"), 1);
1134 $newmenu->add(
"/admin/tools/index.php?mainmenu=home&leftmenu=admintools", $langs->trans(
"AdminTools"), 0, $user->admin,
'', $mainmenu,
'admintools', 0,
'',
'',
'',
'<i class="fa fa-server fa-fw paddingright pictofixedwidth"></i>');
1135 if ($usemenuhider || empty($leftmenu) || preg_match(
'/^admintools/', $leftmenu)) {
1137 $langs->loadLangs(array(
'admin',
'help'));
1139 $newmenu->add(
'/admin/system/dolibarr.php?mainmenu=home&leftmenu=admintools_info', $langs->trans(
'InfoDolibarr'), 1);
1140 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
'admintools_info') {
1141 $newmenu->add(
'/admin/system/modules.php?mainmenu=home&leftmenu=admintools_info', $langs->trans(
'Modules'), 2);
1142 $newmenu->add(
'/admin/triggers.php?mainmenu=home&leftmenu=admintools_info', $langs->trans(
'Triggers'), 2);
1143 $newmenu->add(
'/admin/system/filecheck.php?mainmenu=home&leftmenu=admintools_info', $langs->trans(
'FileCheck'), 2);
1145 $newmenu->add(
'/admin/system/browser.php?mainmenu=home&leftmenu=admintools', $langs->trans(
'InfoBrowser'), 1);
1146 $newmenu->add(
'/admin/system/os.php?mainmenu=home&leftmenu=admintools', $langs->trans(
'InfoOS'), 1);
1147 $newmenu->add(
'/admin/system/web.php?mainmenu=home&leftmenu=admintools', $langs->trans(
'InfoWebServer'), 1);
1148 $newmenu->add(
'/admin/system/phpinfo.php?mainmenu=home&leftmenu=admintools', $langs->trans(
'InfoPHP'), 1);
1149 $newmenu->add(
'/admin/system/database.php?mainmenu=home&leftmenu=admintools', $langs->trans(
'InfoDatabase'), 1);
1150 $newmenu->add(
"/admin/system/perf.php?mainmenu=home&leftmenu=admintools", $langs->trans(
"InfoPerf"), 1);
1151 $newmenu->add(
"/admin/system/security.php?mainmenu=home&leftmenu=admintools", $langs->trans(
"InfoSecurity"), 1);
1152 $newmenu->add(
"/admin/tools/dolibarr_export.php?mainmenu=home&leftmenu=admintools", $langs->trans(
"Backup"), 1);
1153 $newmenu->add(
"/admin/tools/dolibarr_import.php?mainmenu=home&leftmenu=admintools", $langs->trans(
"Restore"), 1);
1154 $newmenu->add(
"/admin/tools/update.php?mainmenu=home&leftmenu=admintools", $langs->trans(
"MenuUpgrade"), 1);
1155 $newmenu->add(
"/admin/tools/purge.php?mainmenu=home&leftmenu=admintools", $langs->trans(
"Purge"), 1);
1156 $newmenu->add(
"/admin/tools/listevents.php?mainmenu=home&leftmenu=admintools", $langs->trans(
"Audit"), 1);
1157 $newmenu->add(
"/admin/tools/listsessions.php?mainmenu=home&leftmenu=admintools", $langs->trans(
"Sessions"), 1);
1158 $newmenu->add(
'/admin/system/about.php?mainmenu=home&leftmenu=admintools', $langs->trans(
'ExternalResources'), 1);
1161 $langs->load(
"products");
1162 $newmenu->add(
"/product/admin/product_tools.php?mainmenu=home&leftmenu=admintools", $langs->trans(
"ProductVatMassChange"), 1, $user->admin);
1166 $newmenu->add(
"/user/home.php?leftmenu=users", $langs->trans(
"MenuUsersAndGroups"), 0, $user->hasRight(
'user',
'user',
'read'),
'', $mainmenu,
'users', 0,
'',
'',
'',
img_picto(
'',
'user',
'class="paddingright pictofixedwidth"'));
1167 if ($user->hasRight(
'user',
'user',
'read')) {
1168 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"users") {
1169 $newmenu->add(
"", $langs->trans(
"Users"), 1, $user->hasRight(
'user',
'user',
'lire') || $user->admin);
1170 $newmenu->add(
"/user/card.php?leftmenu=users&action=create", $langs->trans(
"NewUser"), 2, ($user->hasRight(
"user",
"user",
"write") || $user->admin) && !(
isModEnabled(
'multicompany') && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE),
'',
'home');
1171 $newmenu->add(
"/user/list.php?leftmenu=users", $langs->trans(
"ListOfUsers"), 2, $user->hasRight(
'user',
'user',
'lire') || $user->admin);
1172 $newmenu->add(
"/user/hierarchy.php?leftmenu=users", $langs->trans(
"HierarchicView"), 2, $user->hasRight(
'user',
'user',
'lire') || $user->admin);
1174 $langs->load(
"categories");
1175 $newmenu->add(
"/categories/index.php?leftmenu=users&type=7", $langs->trans(
"UsersCategoriesShort"), 2, $user->hasRight(
'categorie',
'lire'),
'', $mainmenu,
'cat');
1177 $newmenu->add(
"", $langs->trans(
"Groups"), 1, ($user->hasRight(
'user',
'user',
'lire') || $user->admin) && !(
isModEnabled(
'multicompany') && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE));
1178 $newmenu->add(
"/user/group/card.php?leftmenu=users&action=create", $langs->trans(
"NewGroup"), 2, ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) ? $user->hasRight(
"user",
"group_advance",
"create") : $user->hasRight(
"user",
"user",
"create")) || $user->admin) && !(
isModEnabled(
'multicompany') && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE));
1179 $newmenu->add(
"/user/group/list.php?leftmenu=users", $langs->trans(
"ListOfGroups"), 2, ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) ? $user->hasRight(
'user',
'group_advance',
'read') : $user->hasRight(
'user',
'user',
'lire')) || $user->admin) && !(
isModEnabled(
'multicompany') && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE));
1197 global $user, $conf, $langs;
1199 if ($mainmenu ==
'companies') {
1202 $langs->load(
"companies");
1203 $newmenu->add(
"/societe/index.php?leftmenu=thirdparties", $langs->trans(
"ThirdParty"), 0, $user->hasRight(
'societe',
'lire'),
'', $mainmenu,
'thirdparties', 0,
'',
'',
'',
img_picto(
'',
'company',
'class="paddingright pictofixedwidth"'));
1205 if ($user->hasRight(
'societe',
'creer')) {
1206 $newmenu->add(
"/societe/card.php?action=create", $langs->trans(
"MenuNewThirdParty"), 1);
1207 if (!$conf->use_javascript_ajax) {
1208 $newmenu->add(
"/societe/card.php?action=create&private=1", $langs->trans(
"MenuNewPrivateIndividual"), 1);
1213 $newmenu->add(
"/societe/list.php?leftmenu=thirdparties", $langs->trans(
"List"), 1);
1216 if (
isModEnabled(
'societe') && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) {
1217 $langs->load(
"commercial");
1218 $newmenu->add(
"/societe/list.php?type=p&leftmenu=prospects", $langs->trans(
"ListProspectsShort"), 2, $user->hasRight(
'societe',
'lire'),
'', $mainmenu,
'prospects');
1226 $newmenu->add(
"/societe/card.php?leftmenu=prospects&action=create&type=p", $langs->trans(
"MenuNewProspect"), 3, $user->hasRight(
'societe',
'creer'));
1230 if (
isModEnabled(
'societe') && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) {
1231 $langs->load(
"commercial");
1232 $newmenu->add(
"/societe/list.php?type=c&leftmenu=customers", $langs->trans(
"ListCustomersShort"), 2, $user->hasRight(
'societe',
'lire'),
'', $mainmenu,
'customers');
1234 $newmenu->add(
"/societe/card.php?leftmenu=customers&action=create&type=c", $langs->trans(
"MenuNewCustomer"), 3, $user->hasRight(
'societe',
'creer'));
1239 $langs->load(
"suppliers");
1240 $newmenu->add(
"/societe/list.php?type=f&leftmenu=suppliers", $langs->trans(
"ListSuppliersShort"), 2, ($user->hasRight(
'fournisseur',
'lire') || $user->hasRight(
'supplier_order',
'lire') || $user->hasRight(
'supplier_invoice',
'lire') || $user->hasRight(
'supplier_proposal',
'lire')),
'', $mainmenu,
'suppliers');
1241 $newmenu->add(
"/societe/card.php?leftmenu=suppliers&action=create&type=f", $langs->trans(
"MenuNewSupplier"), 3, $user->hasRight(
'societe',
'creer') && ($user->hasRight(
'fournisseur',
'lire') || $user->hasRight(
'supplier_order',
'lire') || $user->hasRight(
'supplier_invoice',
'lire') || $user->hasRight(
'supplier_proposal',
'lire')));
1246 $langs->load(
"categories");
1247 if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) {
1249 $menutoshow = $langs->trans(
"CustomersProspectsCategoriesShort");
1250 if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) {
1251 $menutoshow = $langs->trans(
"CustomersCategoriesShort");
1253 if (!empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) {
1254 $menutoshow = $langs->trans(
"ProspectsCategoriesShort");
1256 $newmenu->add(
"/categories/index.php?leftmenu=cat&type=2", $menutoshow, 1, $user->hasRight(
'categorie',
'lire'),
'', $mainmenu,
'cat');
1260 $newmenu->add(
"/categories/index.php?leftmenu=catfournish&type=1", $langs->trans(
"SuppliersCategoriesShort"), 1, $user->hasRight(
'categorie',
'lire'));
1265 $newmenu->add(
"/societe/index.php?leftmenu=thirdparties", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans(
"Contacts") : $langs->trans(
"ContactsAddresses")), 0, $user->hasRight(
'societe',
'contact',
'lire'),
'', $mainmenu,
'contacts', 0,
'',
'',
'',
img_picto(
'',
'contact',
'class="paddingright pictofixedwidth"'));
1267 $newmenu->add(
"/contact/card.php?leftmenu=contacts&action=create", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans(
"NewContact") : $langs->trans(
"NewContactAddress")), 1, $user->hasRight(
'societe',
'contact',
'creer'));
1268 $newmenu->add(
"/contact/list.php?leftmenu=contacts", $langs->trans(
"List"), 1, $user->hasRight(
'societe',
'contact',
'lire'));
1269 if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) {
1270 $newmenu->add(
"/contact/list.php?leftmenu=contacts&type=p", $langs->trans(
"Prospects"), 2, $user->hasRight(
'societe',
'contact',
'lire'));
1272 if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) {
1273 $newmenu->add(
"/contact/list.php?leftmenu=contacts&type=c", $langs->trans(
"Customers"), 2, $user->hasRight(
'societe',
'contact',
'lire'));
1276 $newmenu->add(
"/contact/list.php?leftmenu=contacts&type=f", $langs->trans(
"Suppliers"), 2, $user->hasRight(
'societe',
'contact',
'lire'));
1278 $newmenu->add(
"/contact/list.php?leftmenu=contacts&type=o", $langs->trans(
"ContactOthers"), 2, $user->hasRight(
'societe',
'contact',
'lire'));
1283 $langs->load(
"categories");
1285 $newmenu->add(
"/categories/index.php?leftmenu=catcontact&type=4", $langs->trans(
"ContactCategoriesShort"), 1, $user->hasRight(
'categorie',
'lire'),
'', $mainmenu,
'cat');
1302 global $user, $conf, $langs;
1304 if ($mainmenu ==
'commercial') {
1305 $langs->load(
"companies");
1309 $langs->load(
"propal");
1310 $newmenu->add(
"/comm/propal/index.php?leftmenu=propals", $langs->trans(
"Proposals"), 0, $user->hasRight(
'propal',
'read'),
'', $mainmenu,
'propals', 100,
'',
'',
'',
img_picto(
'',
'propal',
'class="paddingright pictofixedwidth"'));
1311 $newmenu->add(
"/comm/propal/card.php?action=create&leftmenu=propals", $langs->trans(
"NewPropal"), 1, $user->hasRight(
'propal',
'write'));
1312 $newmenu->add(
"/comm/propal/list.php?leftmenu=propals", $langs->trans(
"List"), 1, $user->hasRight(
'propal',
'read'));
1313 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"propals") {
1314 $newmenu->add(
"/comm/propal/list.php?leftmenu=propals&search_status=0", $langs->trans(
"PropalsDraft"), 2, $user->hasRight(
'propal',
'read'));
1315 $newmenu->add(
"/comm/propal/list.php?leftmenu=propals&search_status=1", $langs->trans(
"PropalsOpened"), 2, $user->hasRight(
'propal',
'read'));
1316 $newmenu->add(
"/comm/propal/list.php?leftmenu=propals&search_status=2", $langs->trans(
"PropalStatusSigned"), 2, $user->hasRight(
'propal',
'read'));
1317 $newmenu->add(
"/comm/propal/list.php?leftmenu=propals&search_status=3", $langs->trans(
"PropalStatusNotSigned"), 2, $user->hasRight(
'propal',
'read'));
1318 $newmenu->add(
"/comm/propal/list.php?leftmenu=propals&search_status=4", $langs->trans(
"PropalStatusBilled"), 2, $user->hasRight(
'propal',
'read'));
1321 $newmenu->add(
"/comm/propal/stats/index.php?leftmenu=propals", $langs->trans(
"Statistics"), 1, $user->hasRight(
'propal',
'read'));
1326 $langs->load(
"orders");
1327 $newmenu->add(
"/commande/index.php?leftmenu=orders", $langs->trans(
"CustomersOrders"), 0, $user->hasRight(
'commande',
'lire'),
'', $mainmenu,
'orders', 200,
'',
'',
'',
img_picto(
'',
'order',
'class="paddingright pictofixedwidth"'));
1328 $newmenu->add(
"/commande/card.php?action=create&leftmenu=orders", $langs->trans(
"NewOrder"), 1, $user->hasRight(
'commande',
'creer'));
1329 $newmenu->add(
"/commande/list.php?leftmenu=orders", $langs->trans(
"List"), 1, $user->hasRight(
'commande',
'lire'));
1330 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"orders") {
1331 $newmenu->add(
"/commande/list.php?leftmenu=orders&search_status=0", $langs->trans(
"StatusOrderDraftShort"), 2, $user->hasRight(
'commande',
'lire'));
1332 $newmenu->add(
"/commande/list.php?leftmenu=orders&search_status=1", $langs->trans(
"StatusOrderValidated"), 2, $user->hasRight(
'commande',
'lire'));
1334 $newmenu->add(
"/commande/list.php?leftmenu=orders&search_status=2", $langs->trans(
"StatusOrderSentShort"), 2, $user->hasRight(
'commande',
'lire'));
1336 $newmenu->add(
"/commande/list.php?leftmenu=orders&search_status=3", $langs->trans(
"StatusOrderDelivered"), 2, $user->hasRight(
'commande',
'lire'));
1338 $newmenu->add(
"/commande/list.php?leftmenu=orders&search_status=-1", $langs->trans(
"StatusOrderCanceledShort"), 2, $user->hasRight(
'commande',
'lire'));
1340 $newmenu->add(
"/commande/stats/index.php?leftmenu=orders", $langs->trans(
"Statistics"), 1, $user->hasRight(
'commande',
'lire'));
1345 $langs->load(
"supplier_proposal");
1346 $newmenu->add(
"/supplier_proposal/index.php?leftmenu=propals_supplier", $langs->trans(
"SupplierProposalsShort"), 0, $user->hasRight(
'supplier_proposal',
'lire'),
'', $mainmenu,
'propals_supplier', 300,
'',
'',
'',
img_picto(
'',
'supplier_proposal',
'class="paddingright pictofixedwidth"'));
1347 $newmenu->add(
"/supplier_proposal/card.php?action=create&leftmenu=supplier_proposals", $langs->trans(
"SupplierProposalNew"), 1, $user->hasRight(
'supplier_proposal',
'creer'));
1348 $newmenu->add(
"/supplier_proposal/list.php?leftmenu=supplier_proposals", $langs->trans(
"List"), 1, $user->hasRight(
'supplier_proposal',
'lire'));
1349 $newmenu->add(
"/comm/propal/stats/index.php?leftmenu=supplier_proposals&mode=supplier", $langs->trans(
"Statistics"), 1, $user->hasRight(
'supplier_proposal',
'lire'));
1354 $langs->load(
"orders");
1355 $newmenu->add(
"/fourn/commande/index.php?leftmenu=orders_suppliers", $langs->trans(
"SuppliersOrders"), 0, $user->hasRight(
'fournisseur',
'commande',
'lire'),
'', $mainmenu,
'orders_suppliers', 400,
'',
'',
'',
img_picto(
'',
'supplier_order',
'class="paddingright pictofixedwidth"'));
1356 $newmenu->add(
"/fourn/commande/card.php?action=create&leftmenu=orders_suppliers", $langs->trans(
"NewSupplierOrderShort"), 1, $user->hasRight(
'fournisseur',
'commande',
'creer'));
1357 $newmenu->add(
"/fourn/commande/list.php?leftmenu=orders_suppliers", $langs->trans(
"List"), 1, $user->hasRight(
'fournisseur',
'commande',
'lire'));
1359 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"orders_suppliers") {
1360 $newmenu->add(
"/fourn/commande/list.php?leftmenu=orders_suppliers&statut=0", $langs->trans(
"StatusSupplierOrderDraftShort"), 2, $user->hasRight(
'fournisseur',
'commande',
'lire'));
1361 if (empty($conf->global->SUPPLIER_ORDER_HIDE_VALIDATED)) {
1362 $newmenu->add(
"/fourn/commande/list.php?leftmenu=orders_suppliers&statut=1", $langs->trans(
"StatusSupplierOrderValidated"), 2, $user->hasRight(
'fournisseur',
'commande',
'lire'));
1364 $newmenu->add(
"/fourn/commande/list.php?leftmenu=orders_suppliers&statut=2", $langs->trans(
"StatusSupplierOrderApprovedShort"), 2, $user->hasRight(
'fournisseur',
'commande',
'lire'));
1365 $newmenu->add(
"/fourn/commande/list.php?leftmenu=orders_suppliers&statut=3", $langs->trans(
"StatusSupplierOrderOnProcessShort"), 2, $user->hasRight(
'fournisseur',
'commande',
'lire'));
1366 $newmenu->add(
"/fourn/commande/list.php?leftmenu=orders_suppliers&statut=4", $langs->trans(
"StatusSupplierOrderReceivedPartiallyShort"), 2, $user->hasRight(
'fournisseur',
'commande',
'lire'));
1367 $newmenu->add(
"/fourn/commande/list.php?leftmenu=orders_suppliers&statut=5", $langs->trans(
"StatusSupplierOrderReceivedAll"), 2, $user->hasRight(
'fournisseur',
'commande',
'lire'));
1368 $newmenu->add(
"/fourn/commande/list.php?leftmenu=orders_suppliers&statut=6,7", $langs->trans(
"StatusSupplierOrderCanceled"), 2, $user->hasRight(
'fournisseur',
'commande',
'lire'));
1369 $newmenu->add(
"/fourn/commande/list.php?leftmenu=orders_suppliers&statut=9", $langs->trans(
"StatusSupplierOrderRefused"), 2, $user->hasRight(
'fournisseur',
'commande',
'lire'));
1374 $newmenu->add(
"/commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier", $langs->trans(
"Statistics"), 1, $user->hasRight(
'fournisseur',
'commande',
'lire'));
1379 $langs->load(
"contracts");
1380 $newmenu->add(
"/contrat/index.php?leftmenu=contracts", $langs->trans(
"ContractsSubscriptions"), 0, $user->hasRight(
'contrat',
'lire'),
'', $mainmenu,
'contracts', 2000,
'',
'',
'',
img_picto(
'',
'contract',
'class="paddingright pictofixedwidth"'));
1381 $newmenu->add(
"/contrat/card.php?action=create&leftmenu=contracts", $langs->trans(
"NewContractSubscription"), 1, $user->hasRight(
'contrat',
'creer'));
1382 $newmenu->add(
"/contrat/list.php?leftmenu=contracts", $langs->trans(
"List"), 1, $user->hasRight(
'contrat',
'lire'));
1383 $newmenu->add(
"/contrat/services_list.php?leftmenu=contracts", $langs->trans(
"MenuServices"), 1, $user->hasRight(
'contrat',
'lire'));
1384 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"contracts") {
1385 $newmenu->add(
"/contrat/services_list.php?leftmenu=contracts&mode=0", $langs->trans(
"MenuInactiveServices"), 2, $user->hasRight(
'contrat',
'lire'));
1386 $newmenu->add(
"/contrat/services_list.php?leftmenu=contracts&mode=4", $langs->trans(
"MenuRunningServices"), 2, $user->hasRight(
'contrat',
'lire'));
1387 $newmenu->add(
"/contrat/services_list.php?leftmenu=contracts&mode=4&filter=expired", $langs->trans(
"MenuExpiredServices"), 2, $user->hasRight(
'contrat',
'lire'));
1388 $newmenu->add(
"/contrat/services_list.php?leftmenu=contracts&mode=5", $langs->trans(
"MenuClosedServices"), 2, $user->hasRight(
'contrat',
'lire'));
1394 $langs->load(
"interventions");
1395 $newmenu->add(
"/fichinter/index.php?leftmenu=ficheinter", $langs->trans(
"Interventions"), 0, $user->hasRight(
'ficheinter',
'lire'),
'', $mainmenu,
'ficheinter', 2200,
'',
'',
'',
img_picto(
'',
'intervention',
'class="paddingright pictofixedwidth"'));
1396 $newmenu->add(
"/fichinter/card.php?action=create&leftmenu=ficheinter", $langs->trans(
"NewIntervention"), 1, $user->hasRight(
'ficheinter',
'creer'),
'',
'',
'', 201);
1397 $newmenu->add(
"/fichinter/list.php?leftmenu=ficheinter", $langs->trans(
"List"), 1, $user->hasRight(
'ficheinter',
'lire'),
'',
'',
'', 202);
1398 if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
1399 $newmenu->add(
"/fichinter/card-rec.php?leftmenu=ficheinter", $langs->trans(
"ListOfTemplates"), 1, $user->hasRight(
'ficheinter',
'lire'),
'',
'',
'', 203);
1401 $newmenu->add(
"/fichinter/stats/index.php?leftmenu=ficheinter", $langs->trans(
"Statistics"), 1, $user->hasRight(
'ficheinter',
'lire'));
1418 global $user, $conf, $langs;
1420 if ($mainmenu ==
'billing') {
1421 $langs->load(
"companies");
1425 $langs->load(
"bills");
1426 $newmenu->add(
"/compta/facture/index.php?leftmenu=customers_bills", $langs->trans(
"BillsCustomers"), 0, $user->hasRight(
'facture',
'lire'),
'', $mainmenu,
'customers_bills', 0,
'',
'',
'',
img_picto(
'',
'bill',
'class="paddingright pictofixedwidth"'));
1427 $newmenu->add(
"/compta/facture/card.php?action=create", $langs->trans(
"NewBill"), 1, $user->hasRight(
'facture',
'creer'));
1428 $newmenu->add(
"/compta/facture/list.php?leftmenu=customers_bills", $langs->trans(
"List"), 1, $user->hasRight(
'facture',
'lire'),
'', $mainmenu,
'customers_bills_list');
1430 if ($usemenuhider || empty($leftmenu) || preg_match(
'/customers_bills(|_draft|_notpaid|_paid|_canceled)$/', $leftmenu)) {
1431 $newmenu->add(
"/compta/facture/list.php?leftmenu=customers_bills_draft&search_status=0", $langs->trans(
"BillShortStatusDraft"), 2, $user->hasRight(
'facture',
'lire'));
1432 $newmenu->add(
"/compta/facture/list.php?leftmenu=customers_bills_notpaid&search_status=1", $langs->trans(
"BillShortStatusNotPaid"), 2, $user->hasRight(
'facture',
'lire'));
1433 $newmenu->add(
"/compta/facture/list.php?leftmenu=customers_bills_paid&search_status=2", $langs->trans(
"BillShortStatusPaid"), 2, $user->hasRight(
'facture',
'lire'));
1434 $newmenu->add(
"/compta/facture/list.php?leftmenu=customers_bills_canceled&search_status=3", $langs->trans(
"BillShortStatusCanceled"), 2, $user->hasRight(
'facture',
'lire'));
1436 $newmenu->add(
"/compta/facture/invoicetemplate_list.php?leftmenu=customers_bills_templates", $langs->trans(
"ListOfTemplates"), 1, $user->hasRight(
'facture',
'creer'),
'', $mainmenu,
'customers_bills_templates');
1438 $newmenu->add(
"/compta/paiement/list.php?leftmenu=customers_bills_payment", $langs->trans(
"Payments"), 1, $user->hasRight(
'facture',
'lire'),
'', $mainmenu,
'customers_bills_payment');
1440 if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) {
1441 $newmenu->add(
"/compta/paiement/tovalidate.php?leftmenu=customers_bills_tovalid", $langs->trans(
"MenuToValid"), 2, $user->hasRight(
'facture',
'lire'),
'', $mainmenu,
'customer_bills_tovalid');
1443 if ($usemenuhider || empty($leftmenu) || preg_match(
'/customers_bills/', $leftmenu)) {
1444 $newmenu->add(
"/compta/paiement/rapport.php?leftmenu=customers_bills_payment_report", $langs->trans(
"Reportings"), 2, $user->hasRight(
'facture',
'lire'),
'', $mainmenu,
'customers_bills_payment_report');
1447 $newmenu->add(
"/compta/facture/stats/index.php?leftmenu=customers_bills_stats", $langs->trans(
"Statistics"), 1, $user->hasRight(
'facture',
'lire'),
'', $mainmenu,
'customers_bills_stats');
1452 $langs->load(
"bills");
1453 $newmenu->add(
"/fourn/facture/index.php?leftmenu=suppliers_bills", $langs->trans(
"BillsSuppliers"), 0, $user->hasRight(
'fournisseur',
'facture',
'lire'),
'', $mainmenu,
'suppliers_bills', 0,
'',
'',
'',
img_picto(
'',
'supplier_invoice',
'class="paddingright pictofixedwidth"'));
1454 $newmenu->add(
"/fourn/facture/card.php?leftmenu=suppliers_bills&action=create", $langs->trans(
"NewBill"), 1, ($user->hasRight(
'fournisseur',
'facture',
'creer') || $user->hasRight(
'supplier_invoice',
'creer')),
'', $mainmenu,
'suppliers_bills_create');
1455 $newmenu->add(
"/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans(
"List"), 1, $user->hasRight(
'fournisseur',
'facture',
'lire'),
'', $mainmenu,
'suppliers_bills_list');
1457 if ($usemenuhider || empty($leftmenu) || preg_match(
'/suppliers_bills/', $leftmenu)) {
1458 $newmenu->add(
"/fourn/facture/list.php?leftmenu=suppliers_bills_draft&search_status=0", $langs->trans(
"BillShortStatusDraft"), 2, $user->hasRight(
'fournisseur',
'facture',
'lire'),
'', $mainmenu,
'suppliers_bills_draft');
1459 $newmenu->add(
"/fourn/facture/list.php?leftmenu=suppliers_bills_notpaid&search_status=1", $langs->trans(
"BillShortStatusNotPaid"), 2, $user->hasRight(
'fournisseur',
'facture',
'lire'),
'', $mainmenu,
'suppliers_bills_notpaid');
1460 $newmenu->add(
"/fourn/facture/list.php?leftmenu=suppliers_bills_paid&search_status=2", $langs->trans(
"BillShortStatusPaid"), 2, $user->hasRight(
'fournisseur',
'facture',
'lire'),
'', $mainmenu,
'suppliers_bills_paid');
1463 $newmenu->add(
"/fourn/facture/list-rec.php?leftmenu=supplierinvoicestemplate_list", $langs->trans(
"ListOfTemplates"), 1, $user->hasRight(
'fournisseur',
'facture',
'lire'),
'', $mainmenu,
'supplierinvoicestemplate_list');
1465 $newmenu->add(
"/fourn/paiement/list.php?leftmenu=suppliers_bills_payment", $langs->trans(
"Payments"), 1, $user->hasRight(
'fournisseur',
'facture',
'lire'),
'', $mainmenu,
'suppliers_bills_payment');
1467 if ($usemenuhider || empty($leftmenu) || preg_match(
'/suppliers_bills/', $leftmenu)) {
1468 $newmenu->add(
"/fourn/facture/rapport.php?leftmenu=suppliers_bills_payment_report", $langs->trans(
"Reportings"), 2, $user->hasRight(
'fournisseur',
'facture',
'lire'),
'', $mainmenu,
'suppliers_bills_payment_report');
1471 $newmenu->add(
"/compta/facture/stats/index.php?mode=supplier&leftmenu=suppliers_bills_stats", $langs->trans(
"Statistics"), 1, $user->hasRight(
'fournisseur',
'facture',
'lire'),
'', $mainmenu,
'suppliers_bills_stats');
1476 $langs->load(
"orders");
1478 $newmenu->add(
"/commande/list.php?leftmenu=orders&search_status=-3&billed=0&contextpage=billableorders", $langs->trans(
"MenuOrdersToBill2"), 0, $user->hasRight(
'commande',
'lire'),
'', $mainmenu,
'orders', 0,
'',
'',
'',
img_picto(
'',
'order',
'class="paddingright pictofixedwidth"'));
1485 if (!empty($conf->global->SUPPLIER_MENU_ORDER_RECEIVED_INTO_INVOICE)) {
1486 $langs->load(
"supplier");
1487 $newmenu->add(
"/fourn/commande/list.php?leftmenu=orders&search_status=5&billed=0", $langs->trans(
"MenuOrdersSupplierToBill"), 0, $user->hasRight(
'commande',
'lire'),
'', $mainmenu,
'orders', 0,
'',
'',
'',
img_picto(
'',
'supplier_order',
'class="paddingright pictofixedwidth"'));
1495 $langs->load(
"donations");
1496 $newmenu->add(
"/don/index.php?leftmenu=donations&mainmenu=billing", $langs->trans(
"Donations"), 0, $user->hasRight(
'don',
'lire'),
'', $mainmenu,
'donations', 0,
'',
'',
'',
img_picto(
'',
'donation',
'class="paddingright pictofixedwidth"'));
1497 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"donations") {
1498 $newmenu->add(
"/don/card.php?leftmenu=donations&action=create", $langs->trans(
"NewDonation"), 1, $user->hasRight(
'don',
'creer'));
1499 $newmenu->add(
"/don/list.php?leftmenu=donations", $langs->trans(
"List"), 1, $user->hasRight(
'don',
'lire'));
1506 $newmenu->add(
"/compta/charges/index.php?leftmenu=tax&mainmenu=billing", $langs->trans(
"MenuTaxesAndSpecialExpenses"), 0, $user->hasRight(
'tax',
'charges',
'lire'),
'', $mainmenu,
'tax', 0,
'',
'',
'',
img_picto(
'',
'payment',
'class="paddingright pictofixedwidth"'));
1508 $newmenu->add(
"/compta/sociales/list.php?leftmenu=tax_social", $langs->trans(
"MenuSocialContributions"), 1, $user->hasRight(
'tax',
'charges',
'lire'));
1509 if ($usemenuhider || empty($leftmenu) || preg_match(
'/^tax_social/i', $leftmenu)) {
1510 $newmenu->add(
"/compta/sociales/card.php?leftmenu=tax_social&action=create", $langs->trans(
"MenuNewSocialContribution"), 2, $user->hasRight(
'tax',
'charges',
'creer'));
1511 $newmenu->add(
"/compta/sociales/list.php?leftmenu=tax_social", $langs->trans(
"List"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1512 $newmenu->add(
"/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=billing", $langs->trans(
"Payments"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1515 if (empty($conf->global->TAX_DISABLE_VAT_MENUS)) {
1518 $newmenu->add(
"/compta/tva/list.php?leftmenu=tax_vat&mainmenu=billing", $langs->transcountry(
"VAT", $mysoc->country_code), 1, $user->hasRight(
'tax',
'charges',
'lire'),
'', $mainmenu,
'tax_vat');
1519 if ($usemenuhider || empty($leftmenu) || preg_match(
'/^tax_vat/i', $leftmenu)) {
1520 $newmenu->add(
"/compta/tva/card.php?leftmenu=tax_vat&action=create", $langs->trans(
"New"), 2, $user->hasRight(
'tax',
'charges',
'creer'));
1521 $newmenu->add(
"/compta/tva/list.php?leftmenu=tax_vat", $langs->trans(
"List"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1522 $newmenu->add(
"/compta/tva/payments.php?mode=tvaonly&leftmenu=tax_vat", $langs->trans(
"Payments"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1523 $newmenu->add(
"/compta/tva/index.php?leftmenu=tax_vat", $langs->trans(
"ReportByMonth"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1524 $newmenu->add(
"/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans(
"ReportByThirdparties"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1525 $newmenu->add(
"/compta/tva/quadri_detail.php?leftmenu=tax_vat", $langs->trans(
"ReportByQuarter"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1529 if ($mysoc->useLocalTax(1) && (isset($mysoc->localtax1_assuj) && $mysoc->localtax1_assuj ==
"1")) {
1530 $newmenu->add(
"/compta/localtax/list.php?leftmenu=tax_1_vat&mainmenu=billing&localTaxType=1", $langs->transcountry(
"LT1", $mysoc->country_code), 1, $user->hasRight(
'tax',
'charges',
'lire'));
1531 if ($usemenuhider || empty($leftmenu) || preg_match(
'/^tax_1_vat/i', $leftmenu)) {
1532 $newmenu->add(
"/compta/localtax/card.php?leftmenu=tax_1_vat&action=create&localTaxType=1", $langs->trans(
"New"), 2, $user->hasRight(
'tax',
'charges',
'creer'));
1533 $newmenu->add(
"/compta/localtax/list.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans(
"List"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1534 $newmenu->add(
"/compta/localtax/index.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans(
"ReportByMonth"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1535 $newmenu->add(
"/compta/localtax/clients.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans(
"ReportByThirdparties"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1536 $newmenu->add(
"/compta/localtax/quadri_detail.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans(
"ReportByQuarter"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1540 if ($mysoc->useLocalTax(2) && (isset($mysoc->localtax2_assuj) && $mysoc->localtax2_assuj ==
"1")) {
1541 $newmenu->add(
"/compta/localtax/list.php?leftmenu=tax_2_vat&mainmenu=billing&localTaxType=2", $langs->transcountry(
"LT2", $mysoc->country_code), 1, $user->hasRight(
'tax',
'charges',
'lire'));
1542 if ($usemenuhider || empty($leftmenu) || preg_match(
'/^tax_2_vat/i', $leftmenu)) {
1543 $newmenu->add(
"/compta/localtax/card.php?leftmenu=tax_2_vat&action=create&localTaxType=2", $langs->trans(
"New"), 2, $user->hasRight(
'tax',
'charges',
'creer'));
1544 $newmenu->add(
"/compta/localtax/list.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans(
"List"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1545 $newmenu->add(
"/compta/localtax/index.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans(
"ReportByMonth"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1546 $newmenu->add(
"/compta/localtax/clients.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans(
"ReportByThirdparties"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1547 $newmenu->add(
"/compta/localtax/quadri_detail.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans(
"ReportByQuarter"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1555 $langs->load(
"salaries");
1556 $newmenu->add(
"/salaries/list.php?leftmenu=tax_salary&mainmenu=billing", $langs->trans(
"Salaries"), 0, $user->hasRight(
'salaries',
'read'),
'', $mainmenu,
'tax_salary', 0,
'',
'',
'',
img_picto(
'',
'salary',
'class="paddingright pictofixedwidth"'));
1557 if ($usemenuhider || empty($leftmenu) || preg_match(
'/^tax_salary/i', $leftmenu)) {
1558 $newmenu->add(
"/salaries/card.php?leftmenu=tax_salary&action=create", $langs->trans(
"New"), 1, $user->hasRight(
'salaries',
'write'));
1559 $newmenu->add(
"/salaries/list.php?leftmenu=tax_salary", $langs->trans(
"List"), 1, $user->hasRight(
'salaries',
'read'));
1560 $newmenu->add(
"/salaries/payments.php?leftmenu=tax_salary", $langs->trans(
"Payments"), 1, $user->hasRight(
'salaries',
'read'));
1561 $newmenu->add(
"/salaries/stats/index.php?leftmenu=tax_salary", $langs->trans(
"Statistics"), 1, $user->hasRight(
'salaries',
'read'));
1567 $langs->load(
"loan");
1568 $newmenu->add(
"/loan/list.php?leftmenu=tax_loan&mainmenu=billing", $langs->trans(
"Loans"), 0, $user->hasRight(
'loan',
'read'),
'', $mainmenu,
'tax_loan', 0,
'',
'',
'',
img_picto(
'',
'loan',
'class="paddingright pictofixedwidth"'));
1569 if ($usemenuhider || empty($leftmenu) || preg_match(
'/^tax_loan/i', $leftmenu)) {
1570 $newmenu->add(
"/loan/card.php?leftmenu=tax_loan&action=create", $langs->trans(
"NewLoan"), 1, $user->hasRight(
'loan',
'write'));
1576 if (
isModEnabled(
'banque') && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) {
1577 $langs->load(
"banks");
1578 $newmenu->add(
"/compta/bank/various_payment/list.php?leftmenu=tax_various&mainmenu=billing", $langs->trans(
"MenuVariousPayment"), 0, $user->hasRight(
'banque',
'lire'),
'', $mainmenu,
'tax_various', 0,
'',
'',
'',
img_picto(
'',
'payment',
'class="paddingright pictofixedwidth"'));
1579 if ($usemenuhider || empty($leftmenu) || preg_match(
'/^tax_various/i', $leftmenu)) {
1580 $newmenu->add(
"/compta/bank/various_payment/card.php?leftmenu=tax_various&action=create", $langs->trans(
"New"), 1, $user->hasRight(
'banque',
'modifier'));
1581 $newmenu->add(
"/compta/bank/various_payment/list.php?leftmenu=tax_various", $langs->trans(
"List"), 1, $user->hasRight(
'banque',
'lire'));
1599 global $user, $conf, $langs;
1602 if ($mainmenu ==
'accountancy') {
1603 $langs->load(
"companies");
1611 $newmenu->add(
"/accountancy/index.php?leftmenu=accountancy_admin", $langs->trans(
"Setup"), 0, $user->hasRight(
'accounting',
'chartofaccount'),
'', $mainmenu,
'accountancy_admin', 1,
'',
'',
'',
img_picto(
'',
'technic',
'class="paddingright pictofixedwidth"'));
1612 if ($usemenuhider || empty($leftmenu) || preg_match(
'/accountancy_admin/', $leftmenu)) {
1614 $newmenu->add(
"/accountancy/admin/index.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans(
"General"), 1, $user->hasRight(
'accounting',
'chartofaccount'),
'', $mainmenu,
'accountancy_admin_general', 10);
1617 if ($conf->global->MAIN_FEATURES_LEVEL > 1) {
1618 $newmenu->add(
"/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans(
"FiscalPeriod"), 1, $user->hasRight(
'accounting',
'fiscalyear',
'write'),
'', $mainmenu,
'fiscalyear', 20);
1621 $newmenu->add(
"/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans(
"AccountingJournals"), 1, $user->hasRight(
'accounting',
'chartofaccount'),
'', $mainmenu,
'accountancy_admin_journal', 30);
1622 $newmenu->add(
"/accountancy/admin/accountmodel.php?id=31&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans(
"Pcg_version"), 1, $user->hasRight(
'accounting',
'chartofaccount'),
'', $mainmenu,
'accountancy_admin_chartmodel', 40);
1623 $newmenu->add(
"/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans(
"Chartofaccounts"), 1, $user->hasRight(
'accounting',
'chartofaccount'),
'', $mainmenu,
'accountancy_admin_chart', 41);
1624 $newmenu->add(
"/accountancy/admin/subaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans(
"ChartOfSubaccounts"), 1, $user->hasRight(
'accounting',
'chartofaccount'),
'', $mainmenu,
'accountancy_admin_chart', 41);
1625 $newmenu->add(
"/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans(
"MenuDefaultAccounts"), 1, $user->hasRight(
'accounting',
'chartofaccount'),
'', $mainmenu,
'accountancy_admin_default', 60);
1627 $newmenu->add(
"/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans(
"MenuBankAccounts"), 1, $user->hasRight(
'accounting',
'chartofaccount'),
'', $mainmenu,
'accountancy_admin_bank', 70);
1630 $newmenu->add(
"/admin/dict.php?id=10&from=accountancy&search_country_id=".$mysoc->country_id.
"&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans(
"MenuVatAccounts"), 1, $user->hasRight(
'accounting',
'chartofaccount'),
'', $mainmenu,
'accountancy_admin_default', 80);
1633 $newmenu->add(
"/admin/dict.php?id=7&from=accountancy&search_country_id=".$mysoc->country_id.
"&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans(
"MenuTaxAccounts"), 1, $user->hasRight(
'accounting',
'chartofaccount'),
'', $mainmenu,
'accountancy_admin_default', 90);
1636 $newmenu->add(
"/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans(
"MenuExpenseReportAccounts"), 1, $user->hasRight(
'accounting',
'chartofaccount'),
'', $mainmenu,
'accountancy_admin_default', 100);
1638 $newmenu->add(
"/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans(
"MenuProductsAccounts"), 1, $user->hasRight(
'accounting',
'chartofaccount'),
'', $mainmenu,
'accountancy_admin_product', 110);
1639 if ($conf->global->MAIN_FEATURES_LEVEL > 1) {
1640 $newmenu->add(
"/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans(
"MenuClosureAccounts"), 1, $user->hasRight(
'accounting',
'chartofaccount'),
'', $mainmenu,
'accountancy_admin_closure', 120);
1642 $newmenu->add(
"/accountancy/admin/categories_list.php?id=32&search_country_id=".$mysoc->country_id.
"&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans(
"AccountingCategory"), 1, $user->hasRight(
'accounting',
'chartofaccount'),
'', $mainmenu,
'accountancy_admin_chart', 125);
1643 $newmenu->add(
"/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans(
"ExportOptions"), 1, $user->hasRight(
'accounting',
'chartofaccount'),
'', $mainmenu,
'accountancy_admin_export', 130);
1647 $newmenu->add(
"/accountancy/index.php?leftmenu=accountancy_transfer", $langs->trans(
"TransferInAccounting"), 0, $user->hasRight(
'accounting',
'bind',
'write'),
'', $mainmenu,
'transfer', 1,
'',
'',
'',
img_picto(
'',
'long-arrow-alt-right',
'class="paddingright pictofixedwidth"'));
1651 if (
isModEnabled(
'facture') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) {
1652 $newmenu->add(
"/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy", $langs->trans(
"CustomersVentilation"), 1, $user->hasRight(
'accounting',
'bind',
'write'),
'', $mainmenu,
'dispatch_customer');
1653 if ($usemenuhider || empty($leftmenu) || preg_match(
'/accountancy_dispatch_customer/', $leftmenu)) {
1654 $newmenu->add(
"/accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans(
"ToBind"), 2, $user->hasRight(
'accounting',
'bind',
'write'));
1655 $newmenu->add(
"/accountancy/customer/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans(
"Binded"), 2, $user->hasRight(
'accounting',
'bind',
'write'));
1658 if (
isModEnabled(
'supplier_invoice') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) {
1659 $newmenu->add(
"/accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy", $langs->trans(
"SuppliersVentilation"), 1, $user->hasRight(
'accounting',
'bind',
'write'),
'', $mainmenu,
'dispatch_supplier');
1660 if ($usemenuhider || empty($leftmenu) || preg_match(
'/accountancy_dispatch_supplier/', $leftmenu)) {
1661 $newmenu->add(
"/accountancy/supplier/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans(
"ToBind"), 2, $user->hasRight(
'accounting',
'bind',
'write'));
1662 $newmenu->add(
"/accountancy/supplier/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans(
"Binded"), 2, $user->hasRight(
'accounting',
'bind',
'write'));
1665 if (
isModEnabled(
'expensereport') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) {
1666 $newmenu->add(
"/accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport&mainmenu=accountancy", $langs->trans(
"ExpenseReportsVentilation"), 1, $user->hasRight(
'accounting',
'bind',
'write'),
'', $mainmenu,
'dispatch_expensereport');
1667 if ($usemenuhider || empty($leftmenu) || preg_match(
'/accountancy_dispatch_expensereport/', $leftmenu)) {
1668 $newmenu->add(
"/accountancy/expensereport/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", $langs->trans(
"ToBind"), 2, $user->hasRight(
'accounting',
'bind',
'write'));
1669 $newmenu->add(
"/accountancy/expensereport/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", $langs->trans(
"Binded"), 2, $user->hasRight(
'accounting',
'bind',
'write'));
1674 if (
isModEnabled(
'accounting') && $user->hasRight(
'accounting',
'comptarapport',
'lire') && $mainmenu ==
'accountancy') {
1675 $newmenu->add(
'', $langs->trans(
"RegistrationInAccounting"), 1, $user->hasRight(
'accounting',
'comptarapport',
'lire'),
'',
'',
'');
1678 $sql =
"SELECT rowid, code, label, nature";
1679 $sql .=
" FROM ".MAIN_DB_PREFIX.
"accounting_journal";
1680 $sql .=
" WHERE entity = ".$conf->entity;
1681 $sql .=
" AND active = 1";
1682 $sql .=
" ORDER BY nature ASC, label DESC";
1684 $resql = $db->query($sql);
1686 $numr = $db->num_rows(
$resql);
1690 while ($i < $numr) {
1691 $objp = $db->fetch_object(
$resql);
1696 if ($objp->nature == 2 &&
isModEnabled(
'facture') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) {
1699 if ($objp->nature == 3
1700 && ((
isModEnabled(
'fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) ||
isModEnabled(
'supplier_invoice'))
1701 && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) {
1702 $nature =
"purchases";
1707 if ($objp->nature == 5 &&
isModEnabled(
'expensereport') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) {
1708 $nature =
"expensereports";
1711 $nature =
"various";
1713 if ($objp->nature == 8) {
1714 $nature =
"inventory";
1716 if ($objp->nature == 9) {
1721 if (empty($conf->global->ACCOUNTANCY_SHOW_DEVELOP_JOURNAL)) {
1722 if ($nature ==
'hasnew' || $nature ==
'inventory') {
1728 $langs->load(
'accountancy');
1729 $journallabel = $langs->transnoentities($objp->label);
1731 $key = $langs->trans(
"AccountingJournalType".strtoupper($objp->nature));
1732 $transferlabel = ($objp->nature && $key !=
"AccountingJournalType".strtoupper($langs->trans($objp->nature)) ? $key.($journallabel != $key ?
' '.$journallabel :
''): $journallabel);
1734 $newmenu->add(
'/accountancy/journal/'.$nature.
'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal='.$objp->rowid, $transferlabel, 2, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1740 $newmenu->add(
'', $langs->trans(
"NoJournalDefined"), 2, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1749 if (empty($conf->global->ACCOUNTANCY_HIDE_EXPORT_FILES_MENU)) {
1750 $newmenu->add(
"/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans(
"AccountantFiles"), 1, $user->hasRight(
'accounting',
'mouvements',
'lire'));
1755 $newmenu->add(
"/accountancy/index.php?leftmenu=accountancy_accountancy", $langs->trans(
"MenuAccountancy"), 0, $user->hasRight(
'accounting',
'mouvements',
'lire') || $user->hasRight(
'accounting',
'comptarapport',
'lire'),
'', $mainmenu,
'accountancy', 1,
'',
'',
'',
img_picto(
'',
'accountancy',
'class="paddingright pictofixedwidth"'));
1758 $newmenu->add(
"/accountancy/bookkeeping/listbyaccount.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans(
"Bookkeeping"), 1, $user->hasRight(
'accounting',
'mouvements',
'lire'));
1761 $newmenu->add(
"/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans(
"Journals"), 1, $user->hasRight(
'accounting',
'mouvements',
'lire'));
1764 $newmenu->add(
"/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans(
"AccountBalance"), 1, $user->hasRight(
'accounting',
'mouvements',
'lire'));
1767 $newmenu->add(
"/accountancy/closure/index.php?mainmenu=accountancy&leftmenu=accountancy_closure", $langs->trans(
"MenuAccountancyClosure"), 1, $user->hasRight(
'accounting',
'fiscalyear',
'write'),
'', $mainmenu,
'closure');
1770 $newmenu->add(
"/accountancy/index.php?leftmenu=accountancy_report", $langs->trans(
"Reportings"), 1, $user->hasRight(
'accounting',
'comptarapport',
'lire'),
'', $mainmenu,
'ca');
1772 if ($usemenuhider || empty($leftmenu) || preg_match(
'/accountancy_report/', $leftmenu)) {
1773 $newmenu->add(
"/compta/resultat/index.php?leftmenu=accountancy_report", $langs->trans(
"MenuReportInOut"), 2, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1774 $newmenu->add(
"/compta/resultat/clientfourn.php?leftmenu=accountancy_report", $langs->trans(
"ByPredefinedAccountGroups"), 3, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1775 $newmenu->add(
"/compta/resultat/result.php?leftmenu=accountancy_report", $langs->trans(
"ByPersonalizedAccountGroups"), 3, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1778 $modecompta =
'CREANCES-DETTES';
1779 if (
isModEnabled(
'accounting') && $user->hasRight(
'accounting',
'comptarapport',
'lire') && $mainmenu ==
'accountancy') {
1780 $modecompta =
'BOOKKEEPING';
1783 if ($usemenuhider || empty($leftmenu) || preg_match(
'/accountancy_report/', $leftmenu)) {
1784 $newmenu->add(
"/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ReportTurnover"), 2, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1785 $newmenu->add(
"/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ByCompanies"), 3, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1786 $newmenu->add(
"/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ByUsers"), 3, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1787 $newmenu->add(
"/compta/stats/cabyprodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ByProductsAndServices"), 3, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1788 $newmenu->add(
"/compta/stats/byratecountry.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ByVatRate"), 3, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1792 $modecompta =
'RECETTES-DEPENSES';
1795 if ($usemenuhider || empty($leftmenu) || preg_match(
'/accountancy_report/', $leftmenu)) {
1796 $newmenu->add(
"/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ReportTurnoverCollected"), 2, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1797 $newmenu->add(
"/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ByCompanies"), 3, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1798 $newmenu->add(
"/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ByUsers"), 3, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1804 $modecompta =
'CREANCES-DETTES';
1805 if (
isModEnabled(
'accounting') && $user->hasRight(
'accounting',
'comptarapport',
'lire') && $mainmenu ==
'accountancy') {
1806 $modecompta =
'BOOKKEEPING';
1808 if ($modecompta && ((
isModEnabled(
'fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) ||
isModEnabled(
'supplier_invoice'))) {
1809 if ($usemenuhider || empty($leftmenu) || preg_match(
'/accountancy_report/', $leftmenu)) {
1810 $newmenu->add(
"/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ReportPurchaseTurnover"), 2, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1811 $newmenu->add(
"/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ByCompanies"), 3, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1812 $newmenu->add(
"/compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ByProductsAndServices"), 3, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1816 $modecompta =
'RECETTES-DEPENSES';
1817 if (
isModEnabled(
'accounting') && $user->hasRight(
'accounting',
'comptarapport',
'lire') && $mainmenu ==
'accountancy') {
1818 $modecompta =
'BOOKKEEPINGCOLLECTED';
1820 if ($modecompta && ((
isModEnabled(
'fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) ||
isModEnabled(
'supplier_invoice'))) {
1821 if ($usemenuhider || empty($leftmenu) || preg_match(
'/accountancy_report/', $leftmenu)) {
1822 $newmenu->add(
"/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ReportPurchaseTurnoverCollected"), 2, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1823 $newmenu->add(
"/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ByCompanies"), 3, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1831 if (empty($conf->global->ACCOUNTANCY_HIDE_EXPORT_FILES_MENU)) {
1832 $newmenu->add(
"/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans(
"AccountantFiles"), 0, $user->hasRight(
'compta',
'resultat',
'lire'),
'', $mainmenu,
'files', 0,
'',
'',
'',
img_picto(
'',
'accountancy',
'class="paddingright pictofixedwidth"'));
1836 $newmenu->add(
"/compta/resultat/index.php?leftmenu=report&mainmenu=accountancy", $langs->trans(
"Reportings"), 0, $user->hasRight(
'compta',
'resultat',
'lire'),
'', $mainmenu,
'ca', 0,
'',
'',
'',
img_picto(
'',
'accountancy',
'class="paddingright pictofixedwidth"'));
1838 if ($usemenuhider || empty($leftmenu) || preg_match(
'/report/', $leftmenu)) {
1839 $newmenu->add(
"/compta/resultat/index.php?leftmenu=report", $langs->trans(
"MenuReportInOut"), 1, $user->hasRight(
'compta',
'resultat',
'lire'));
1840 $newmenu->add(
"/compta/resultat/clientfourn.php?leftmenu=report", $langs->trans(
"ByCompanies"), 2, $user->hasRight(
'compta',
'resultat',
'lire'));
1854 $modecompta =
'CREANCES-DETTES';
1855 $newmenu->add(
"/compta/stats/index.php?leftmenu=report&modecompta=".$modecompta, $langs->trans(
"ReportTurnover"), 1, $user->hasRight(
'compta',
'resultat',
'lire'));
1856 $newmenu->add(
"/compta/stats/casoc.php?leftmenu=report&modecompta=".$modecompta, $langs->trans(
"ByCompanies"), 2, $user->hasRight(
'compta',
'resultat',
'lire'));
1857 $newmenu->add(
"/compta/stats/cabyuser.php?leftmenu=report&modecompta=".$modecompta, $langs->trans(
"ByUsers"), 2, $user->hasRight(
'compta',
'resultat',
'lire'));
1858 $newmenu->add(
"/compta/stats/cabyprodserv.php?leftmenu=report&modecompta=".$modecompta, $langs->trans(
"ByProductsAndServices"), 2, $user->hasRight(
'compta',
'resultat',
'lire'));
1859 $newmenu->add(
"/compta/stats/byratecountry.php?leftmenu=report&modecompta=".$modecompta, $langs->trans(
"ByVatRate"), 2, $user->hasRight(
'compta',
'resultat',
'lire'));
1861 $modecompta =
'RECETTES-DEPENSES';
1862 $newmenu->add(
"/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ReportTurnoverCollected"), 1, $user->hasRight(
'compta',
'resultat',
'lire'));
1863 $newmenu->add(
"/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ByCompanies"), 2, $user->hasRight(
'compta',
'resultat',
'lire'));
1864 $newmenu->add(
"/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ByUsers"), 2, $user->hasRight(
'compta',
'resultat',
'lire'));
1867 $modecompta =
'CREANCES-DETTES';
1868 $newmenu->add(
"/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ReportPurchaseTurnover"), 1, $user->hasRight(
'compta',
'resultat',
'lire'));
1869 $newmenu->add(
"/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ByCompanies"), 2, $user->hasRight(
'compta',
'resultat',
'lire'));
1870 $newmenu->add(
"/compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ByProductsAndServices"), 2, $user->hasRight(
'compta',
'resultat',
'lire'));
1880 $newmenu->add(
"/compta/journal/sellsjournal.php?leftmenu=report", $langs->trans(
"SellsJournal"), 1, $user->hasRight(
'compta',
'resultat',
'lire'),
'',
'',
'', 50);
1881 $newmenu->add(
"/compta/journal/purchasesjournal.php?leftmenu=report", $langs->trans(
"PurchasesJournal"), 1, $user->hasRight(
'compta',
'resultat',
'lire'),
'',
'',
'', 51);
1888 $newmenu->add(
"/intracommreport/list.php?leftmenu=intracommreport", $langs->trans(
"MenuIntracommReport"), 0, $user->hasRight(
'intracommreport',
'read'),
'', $mainmenu,
'intracommreport', 60,
'',
'',
'',
img_picto(
'',
'intracommreport',
'class="paddingright pictofixedwidth"'));
1889 if ($usemenuhider || empty($leftmenu) || preg_match(
'/intracommreport/', $leftmenu)) {
1891 $newmenu->add(
"/intracommreport/card.php?action=create&leftmenu=intracommreport", $langs->trans(
"MenuIntracommReportNew"), 1, $user->hasRight(
'intracommreport',
'write'),
'', $mainmenu,
'intracommreport', 1);
1892 $newmenu->add(
"/intracommreport/list.php?leftmenu=intracommreport", $langs->trans(
"MenuIntracommReportList"), 1, $user->hasRight(
'intracommreport',
'read'),
'', $mainmenu,
'intracommreport', 1);
1898 $newmenu->add(
"/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans(
"MenuAssets"), 0, $user->hasRight(
'asset',
'read'),
'', $mainmenu,
'asset', 100,
'',
'',
'',
img_picto(
'',
'payment',
'class="paddingright pictofixedwidth"'));
1899 $newmenu->add(
"/asset/card.php?leftmenu=asset&action=create", $langs->trans(
"MenuNewAsset"), 1, $user->hasRight(
'asset',
'write'));
1900 $newmenu->add(
"/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans(
"MenuListAssets"), 1, $user->hasRight(
'asset',
'read'));
1901 $newmenu->add(
"/asset/model/list.php?leftmenu=asset_model", $langs->trans(
"MenuAssetModels"), 1, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight(
'asset',
'read')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight(
'asset',
'model_advance',
'read')),
'', $mainmenu,
'asset_model');
1902 if ($usemenuhider || empty($leftmenu) || preg_match(
'/asset_model/', $leftmenu)) {
1903 $newmenu->add(
"/asset/model/card.php?leftmenu=asset_model&action=create", $langs->trans(
"MenuNewAssetModel"), 2, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight(
'asset',
'write')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight(
'asset',
'model_advance',
'write')));
1904 $newmenu->add(
"/asset/model/list.php?leftmenu=asset_model", $langs->trans(
"MenuListAssetModels"), 2, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight(
'asset',
'read')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight(
'asset',
'model_advance',
'read')));
1922 global $user, $conf, $langs;
1924 if ($mainmenu ==
'bank') {
1926 $langs->loadLangs(array(
"withdrawals",
"banks",
"bills",
"categories"));
1930 $newmenu->add(
"/compta/bank/list.php?leftmenu=bank&mainmenu=bank", $langs->trans(
"MenuBankCash"), 0, $user->hasRight(
'banque',
'lire'),
'', $mainmenu,
'bank', 0,
'',
'',
'',
img_picto(
'',
'bank_account',
'class="paddingright pictofixedwidth"'));
1932 $newmenu->add(
"/compta/bank/card.php?action=create", $langs->trans(
"MenuNewFinancialAccount"), 1, $user->hasRight(
'banque',
'configurer'));
1933 $newmenu->add(
"/compta/bank/list.php?leftmenu=bank&mainmenu=bank", $langs->trans(
"List"), 1, $user->hasRight(
'banque',
'lire'),
'', $mainmenu,
'bank');
1934 $newmenu->add(
"/compta/bank/bankentries_list.php", $langs->trans(
"ListTransactions"), 1, $user->hasRight(
'banque',
'lire'));
1935 $newmenu->add(
"/compta/bank/budget.php", $langs->trans(
"ListTransactionsByCategory"), 1, $user->hasRight(
'banque',
'lire'));
1937 $newmenu->add(
"/compta/bank/transfer.php", $langs->trans(
"MenuBankInternalTransfer"), 1, $user->hasRight(
'banque',
'transfer'));
1941 $langs->load(
"categories");
1942 $newmenu->add(
"/categories/index.php?type=5", $langs->trans(
"Rubriques"), 1, $user->hasRight(
'categorie',
'creer'),
'', $mainmenu,
'tags');
1943 $newmenu->add(
"/compta/bank/categ.php", $langs->trans(
"RubriquesTransactions"), 1, $user->hasRight(
'banque',
'configurer'),
'', $mainmenu,
'tags');
1948 $newmenu->add(
"/compta/prelevement/index.php?leftmenu=withdraw&mainmenu=bank", $langs->trans(
"PaymentByDirectDebit"), 0, $user->hasRight(
'prelevement',
'bons',
'lire'),
'', $mainmenu,
'withdraw', 0,
'',
'',
'',
img_picto(
'',
'payment',
'class="paddingright pictofixedwidth"'));
1950 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"withdraw") {
1951 $newmenu->add(
"/compta/prelevement/create.php?mainmenu=bank", $langs->trans(
"NewStandingOrder"), 1, $user->hasRight(
'prelevement',
'bons',
'creer'));
1953 $newmenu->add(
"/compta/prelevement/orders_list.php?mainmenu=bank", $langs->trans(
"WithdrawalsReceipts"), 1, $user->hasRight(
'prelevement',
'bons',
'lire'));
1954 $newmenu->add(
"/compta/prelevement/list.php?mainmenu=bank", $langs->trans(
"WithdrawalsLines"), 1, $user->hasRight(
'prelevement',
'bons',
'lire'));
1955 $newmenu->add(
"/compta/prelevement/rejets.php?mainmenu=bank", $langs->trans(
"Rejects"), 1, $user->hasRight(
'prelevement',
'bons',
'lire'));
1956 $newmenu->add(
"/compta/prelevement/stats.php?mainmenu=bank", $langs->trans(
"Statistics"), 1, $user->hasRight(
'prelevement',
'bons',
'lire'));
1962 $newmenu->add(
"/compta/paymentbybanktransfer/index.php?leftmenu=banktransfer&mainmenu=bank", $langs->trans(
"PaymentByBankTransfer"), 0, $user->hasRight(
'paymentbybanktransfer',
'read'),
'', $mainmenu,
'banktransfer', 0,
'',
'',
'',
img_picto(
'',
'payment',
'class="paddingright pictofixedwidth"'));
1964 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"banktransfer") {
1965 $newmenu->add(
"/compta/prelevement/create.php?type=bank-transfer&mainmenu=bank", $langs->trans(
"NewPaymentByBankTransfer"), 1, $user->hasRight(
'paymentbybanktransfer',
'create'));
1967 $newmenu->add(
"/compta/prelevement/orders_list.php?type=bank-transfer&mainmenu=bank", $langs->trans(
"PaymentByBankTransferReceipts"), 1, $user->hasRight(
'paymentbybanktransfer',
'read'));
1968 $newmenu->add(
"/compta/prelevement/list.php?type=bank-transfer&mainmenu=bank", $langs->trans(
"PaymentByBankTransferLines"), 1, $user->hasRight(
'paymentbybanktransfer',
'read'));
1969 $newmenu->add(
"/compta/prelevement/rejets.php?type=bank-transfer&mainmenu=bank", $langs->trans(
"Rejects"), 1, $user->hasRight(
'paymentbybanktransfer',
'read'));
1970 $newmenu->add(
"/compta/prelevement/stats.php?type=bank-transfer&mainmenu=bank", $langs->trans(
"Statistics"), 1, $user->hasRight(
'paymentbybanktransfer',
'read'));
1975 if (empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) &&
isModEnabled(
'banque') && (
isModEnabled(
'facture') || !empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))) {
1976 $newmenu->add(
"/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=bank", $langs->trans(
"MenuChequeDeposits"), 0, $user->hasRight(
'banque',
'cheque'),
'', $mainmenu,
'checks', 0,
'',
'',
'',
img_picto(
'',
'payment',
'class="paddingright pictofixedwidth"'));
1977 if (preg_match(
'/checks/', $leftmenu)) {
1978 $newmenu->add(
"/compta/paiement/cheque/card.php?leftmenu=checks_bis&action=new&mainmenu=bank", $langs->trans(
"NewChequeDeposit"), 1, $user->hasRight(
'banque',
'cheque'));
1979 $newmenu->add(
"/compta/paiement/cheque/list.php?leftmenu=checks_bis&mainmenu=bank", $langs->trans(
"List"), 1, $user->hasRight(
'banque',
'cheque'));
1985 $permtomakecashfence = ($user->hasRight(
'cashdesk',
'run')|| $user->hasRight(
'takepos',
'run'));
1986 $newmenu->add(
"/compta/cashcontrol/cashcontrol_list.php?action=list", $langs->trans(
"POS"), 0, $permtomakecashfence,
'', $mainmenu,
'cashcontrol', 0,
'',
'',
'',
img_picto(
'',
'pos',
'class="pictofixedwidth"'));
1987 $newmenu->add(
"/compta/cashcontrol/cashcontrol_card.php?action=create", $langs->trans(
"NewCashFence"), 1, $permtomakecashfence);
1988 $newmenu->add(
"/compta/cashcontrol/cashcontrol_list.php?action=list", $langs->trans(
"List"), 1, $permtomakecashfence);
2005 global $user, $conf, $langs;
2007 if ($mainmenu ==
'products') {
2010 $newmenu->add(
"/product/index.php?leftmenu=product&type=0", $langs->trans(
"Products"), 0, $user->hasRight(
'product',
'read'),
'', $mainmenu,
'product', 0,
'',
'',
'',
img_picto(
'',
'product',
'class="pictofixedwidth"'));
2011 $newmenu->add(
"/product/card.php?leftmenu=product&action=create&type=0", $langs->trans(
"NewProduct"), 1, $user->hasRight(
'product',
'creer'));
2012 $newmenu->add(
"/product/list.php?leftmenu=product&type=0", $langs->trans(
"List"), 1, $user->hasRight(
'product',
'read'));
2014 $newmenu->add(
"/product/reassort.php?type=0", $langs->trans(
"MenuStocks"), 1, $user->hasRight(
'product',
'read') && $user->hasRight(
'stock',
'lire'));
2017 $langs->load(
"stocks");
2018 $newmenu->add(
"/product/reassortlot.php?type=0&search_subjecttolotserial=1", $langs->trans(
"StocksByLotSerial"), 1, $user->hasRight(
'product',
'read') && $user->hasRight(
'stock',
'lire'));
2019 $newmenu->add(
"/product/stock/productlot_list.php", $langs->trans(
"LotSerial"), 1, $user->hasRight(
'product',
'read') && $user->hasRight(
'stock',
'lire'));
2022 $newmenu->add(
"/variants/list.php", $langs->trans(
"VariantAttributes"), 1, $user->hasRight(
'product',
'read'));
2025 $newmenu->add(
"/product/stats/card.php?id=all&leftmenu=stats&type=0", $langs->trans(
"Statistics"), 1, $user->hasRight(
'product',
'read'));
2030 $langs->load(
"categories");
2031 $newmenu->add(
"/categories/index.php?leftmenu=cat&type=0", $langs->trans(
"Categories"), 1, $user->hasRight(
'categorie',
'lire'),
'', $mainmenu,
'cat');
2038 $newmenu->add(
"/product/index.php?leftmenu=service&type=1", $langs->trans(
"Services"), 0, $user->hasRight(
'service',
'read'),
'', $mainmenu,
'service', 0,
'',
'',
'',
img_picto(
'',
'service',
'class="pictofixedwidth"'));
2039 $newmenu->add(
"/product/card.php?leftmenu=service&action=create&type=1", $langs->trans(
"NewService"), 1, $user->hasRight(
'service',
'creer'));
2040 $newmenu->add(
"/product/list.php?leftmenu=service&type=1", $langs->trans(
"List"), 1, $user->hasRight(
'service',
'read'));
2042 $newmenu->add(
"/product/stats/card.php?id=all&leftmenu=stats&type=1", $langs->trans(
"Statistics"), 1, $user->hasRight(
'service',
'read'));
2046 $langs->load(
"categories");
2047 $newmenu->add(
"/categories/index.php?leftmenu=cat&type=0", $langs->trans(
"Categories"), 1, $user->hasRight(
'categorie',
'lire'),
'', $mainmenu,
'cat');
2054 $langs->load(
"stocks");
2055 $newmenu->add(
"/product/stock/index.php?leftmenu=stock", $langs->trans(
"Warehouses"), 0, $user->hasRight(
'stock',
'lire'),
'', $mainmenu,
'stock', 0,
'',
'',
'',
img_picto(
'',
'stock',
'class="pictofixedwidth"'));
2056 $newmenu->add(
"/product/stock/card.php?action=create", $langs->trans(
"MenuNewWarehouse"), 1, $user->hasRight(
'stock',
'creer'));
2057 $newmenu->add(
"/product/stock/list.php", $langs->trans(
"List"), 1, $user->hasRight(
'stock',
'lire'));
2058 $newmenu->add(
"/product/stock/movement_list.php", $langs->trans(
"Movements"), 1, $user->hasRight(
'stock',
'mouvement',
'lire'));
2060 $newmenu->add(
"/product/stock/massstockmove.php?init=1", $langs->trans(
"MassStockTransferShort"), 1, $user->hasRight(
'stock',
'mouvement',
'creer'));
2062 $newmenu->add(
"/product/stock/replenish.php", $langs->trans(
"Replenishment"), 1, $user->hasRight(
'stock',
'mouvement',
'creer') && $user->hasRight(
'fournisseur',
'lire'));
2064 $newmenu->add(
"/product/stock/stockatdate.php", $langs->trans(
"StockAtDate"), 1, $user->hasRight(
'product',
'read') && $user->hasRight(
'stock',
'lire'));
2068 $newmenu->add(
"/categories/index.php?leftmenu=stock&type=9", $langs->trans(
"Categories"), 1, $user->hasRight(
'categorie',
'lire'),
'', $mainmenu,
'cat');
2073 $newmenu->add(
'/product/stock/stocktransfer/stocktransfer_list.php', $langs->trans(
"ModuleStockTransferName"), 0, $user->hasRight(
'stocktransfer',
'stocktransfer',
'read'),
'', $mainmenu,
'stocktransfer', 0,
'',
'',
'',
img_picto(
'',
'stock',
'class="pictofixedwidth"'));
2074 $newmenu->add(
'/product/stock/stocktransfer/stocktransfer_card.php?action=create', $langs->trans(
'StockTransferNew'), 1, $user->hasRight(
'stocktransfer',
'stocktransfer',
'write'));
2075 $newmenu->add(
'/product/stock/stocktransfer/stocktransfer_list.php', $langs->trans(
'List'), 1, $user->hasRight(
'stocktransfer',
'stocktransfer',
'read'));
2080 $langs->load(
"stocks");
2081 if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
2082 $newmenu->add(
"/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans(
"Inventories"), 0, $user->hasRight(
'stock',
'lire'),
'', $mainmenu,
'stock', 0,
'',
'',
'',
img_picto(
'',
'inventory',
'class="pictofixedwidth"'));
2083 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"stock_inventories") {
2084 $newmenu->add(
"/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans(
"NewInventory"), 1, $user->hasRight(
'stock',
'creer'));
2085 $newmenu->add(
"/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans(
"List"), 1, $user->hasRight(
'stock',
'lire'));
2088 $newmenu->add(
"/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans(
"Inventories"), 0, $user->hasRight(
'stock',
'inventory_advance',
'read'),
'', $mainmenu,
'stock', 0,
'',
'',
'',
img_picto(
'',
'inventory',
'class="pictofixedwidth"'));
2089 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"stock_inventories") {
2090 $newmenu->add(
"/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans(
"NewInventory"), 1, $user->hasRight(
'stock',
'inventory_advance',
'write'));
2091 $newmenu->add(
"/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans(
"List"), 1, $user->hasRight(
'stock',
'inventory_advance',
'read'));
2098 $langs->load(
"sendings");
2099 $newmenu->add(
"/expedition/index.php?leftmenu=sendings", $langs->trans(
"Shipments"), 0, $user->hasRight(
'expedition',
'lire'),
'', $mainmenu,
'sendings', 0,
'',
'',
'',
img_picto(
'',
'shipment',
'class="pictofixedwidth"'));
2100 $newmenu->add(
"/expedition/card.php?action=create2&leftmenu=sendings", $langs->trans(
"NewSending"), 1, $user->hasRight(
'expedition',
'creer'));
2101 $newmenu->add(
"/expedition/list.php?leftmenu=sendings", $langs->trans(
"List"), 1, $user->hasRight(
'expedition',
'lire'));
2102 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"sendings") {
2103 $newmenu->add(
"/expedition/list.php?leftmenu=sendings&search_status=0", $langs->trans(
"StatusSendingDraftShort"), 2, $user->hasRight(
'expedition',
'lire'));
2104 $newmenu->add(
"/expedition/list.php?leftmenu=sendings&search_status=1", $langs->trans(
"StatusSendingValidatedShort"), 2, $user->hasRight(
'expedition',
'lire'));
2105 $newmenu->add(
"/expedition/list.php?leftmenu=sendings&search_status=2", $langs->trans(
"StatusSendingProcessedShort"), 2, $user->hasRight(
'expedition',
'lire'));
2107 $newmenu->add(
"/expedition/stats/index.php?leftmenu=sendings", $langs->trans(
"Statistics"), 1, $user->hasRight(
'expedition',
'lire'));
2112 $langs->load(
"receptions");
2113 $newmenu->add(
"/reception/index.php?leftmenu=receptions", $langs->trans(
"Receptions"), 0, $user->hasRight(
'reception',
'lire'),
'', $mainmenu,
'receptions', 0,
'',
'',
'',
img_picto(
'',
'dollyrevert',
'class="pictofixedwidth"'));
2114 $newmenu->add(
"/reception/card.php?action=create2&leftmenu=receptions", $langs->trans(
"NewReception"), 1, $user->hasRight(
'reception',
'creer'));
2115 $newmenu->add(
"/reception/list.php?leftmenu=receptions", $langs->trans(
"List"), 1, $user->hasRight(
'reception',
'lire'));
2116 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"receptions") {
2117 $newmenu->add(
"/reception/list.php?leftmenu=receptions&search_status=0", $langs->trans(
"StatusReceptionDraftShort"), 2, $user->hasRight(
'reception',
'lire'));
2119 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"receptions") {
2120 $newmenu->add(
"/reception/list.php?leftmenu=receptions&search_status=1", $langs->trans(
"StatusReceptionValidatedShort"), 2, $user->hasRight(
'reception',
'lire'));
2122 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"receptions") {
2123 $newmenu->add(
"/reception/list.php?leftmenu=receptions&search_status=2", $langs->trans(
"StatusReceptionProcessedShort"), 2, $user->hasRight(
'reception',
'lire'));
2125 $newmenu->add(
"/reception/stats/index.php?leftmenu=receptions", $langs->trans(
"Statistics"), 1, $user->hasRight(
'reception',
'lire'));
2140 function get_left_menu_mrp($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu =
'none', $type_user = 0)
2142 global $user, $conf, $langs;
2144 if ($mainmenu ==
'mrp') {
2147 $langs->load(
"mrp");
2149 $newmenu->add(
"", $langs->trans(
"MenuBOM"), 0, $user->hasRight(
'bom',
'read'),
'', $mainmenu,
'bom', 0,
'',
'',
'',
img_picto(
'',
'bom',
'class="paddingright pictofixedwidth"'));
2150 $newmenu->add(
"/bom/bom_card.php?leftmenu=bom&action=create", $langs->trans(
"NewBOM"), 1, $user->hasRight(
'bom',
'write'),
'', $mainmenu,
'bom');
2151 $newmenu->add(
"/bom/bom_list.php?leftmenu=bom", $langs->trans(
"List"), 1, $user->hasRight(
'bom',
'read'),
'', $mainmenu,
'bom');
2155 $langs->load(
"mrp");
2157 $newmenu->add(
"", $langs->trans(
"MenuMRP"), 0, $user->hasRight(
'mrp',
'read'),
'', $mainmenu,
'mo', 0,
'',
'',
'',
img_picto(
'',
'mrp',
'class="paddingright pictofixedwidth"'));
2158 $newmenu->add(
"/mrp/mo_card.php?leftmenu=mo&action=create", $langs->trans(
"NewMO"), 1, $user->hasRight(
'mrp',
'write'),
'', $mainmenu,
'mo');
2159 $newmenu->add(
"/mrp/mo_list.php?leftmenu=mo", $langs->trans(
"List"), 1, $user->hasRight(
'mrp',
'read'),
'', $mainmenu,
'mo');
2176 global $user, $conf, $langs;
2178 if ($mainmenu ==
'project') {
2180 $langs->load(
"projects");
2182 $search_project_user =
GETPOST(
'search_project_user',
'int');
2186 'perms'=>$user->hasRight(
'projet',
'lire'),
2189 $listofmodulesforexternal = explode(
',', $conf->global->MAIN_MODULES_FOR_EXTERNAL);
2192 $titleboth = $langs->trans(
"LeadsOrProjects");
2193 $titlenew = $langs->trans(
"NewLeadOrProject");
2194 if (empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
2195 $titleboth = $langs->trans(
"Projects");
2196 $titlenew = $langs->trans(
"NewProject");
2198 if (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 2) {
2199 $titleboth = $langs->trans(
"Leads");
2200 $titlenew = $langs->trans(
"NewLead");
2204 $newmenu->add(
"/projet/index.php?leftmenu=projects".($search_project_user ?
'&search_project_user='.$search_project_user :
''), $titleboth, 0, $user->hasRight(
'projet',
'lire'),
'', $mainmenu,
'projects', 0,
'',
'',
'',
img_picto(
'',
'project',
'class="paddingright pictofixedwidth"'));
2205 $newmenu->add(
"/projet/card.php?leftmenu=projects&action=create".($search_project_user ?
'&search_project_user='.$search_project_user :
''), $titlenew, 1, $user->hasRight(
'projet',
'creer'));
2207 if (empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
2208 $newmenu->add(
"/projet/list.php?leftmenu=projets".($search_project_user ?
'&search_project_user='.$search_project_user :
'').
'&search_status=99', $langs->trans(
"List"), 1, $showmode,
'',
'project',
'list');
2209 } elseif (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 1) {
2210 $newmenu->add(
"/projet/list.php?leftmenu=projets".($search_project_user ?
'&search_project_user='.$search_project_user :
''), $langs->trans(
"List"), 1, $showmode,
'',
'project',
'list');
2211 $newmenu->add(
'/projet/list.php?mainmenu=project&leftmenu=list&search_usage_opportunity=1&search_status=99&search_opp_status=openedopp&contextpage=lead', $langs->trans(
"ListOpenLeads"), 2, $showmode);
2212 $newmenu->add(
'/projet/list.php?mainmenu=project&leftmenu=list&search_opp_status=notopenedopp&search_status=99&contextpage=project', $langs->trans(
"ListOpenProjects"), 2, $showmode);
2213 } elseif (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 2) {
2214 $newmenu->add(
'/projet/list.php?mainmenu=project&leftmenu=list&search_usage_opportunity=1&search_status=99', $langs->trans(
"List"), 2, $showmode);
2217 $newmenu->add(
"/projet/stats/index.php?leftmenu=projects", $langs->trans(
"Statistics"), 1, $user->hasRight(
'projet',
'lire'));
2221 $langs->load(
"categories");
2222 $newmenu->add(
"/categories/index.php?leftmenu=cat&type=6", $langs->trans(
"Categories"), 1, $user->hasRight(
'categorie',
'lire'),
'', $mainmenu,
'cat');
2225 if (empty($conf->global->PROJECT_HIDE_TASKS)) {
2227 $newmenu->add(
"/projet/activity/index.php?leftmenu=tasks".($search_project_user ?
'&search_project_user='.$search_project_user :
''), $langs->trans(
"Activities"), 0, $user->hasRight(
'projet',
'lire'),
'',
'project',
'tasks', 0,
'',
'',
'',
img_picto(
'',
'projecttask',
'class="paddingright pictofixedwidth"'));
2228 $newmenu->add(
"/projet/tasks.php?leftmenu=tasks&action=create", $langs->trans(
"NewTask"), 1, $user->hasRight(
'projet',
'creer'));
2229 $newmenu->add(
"/projet/tasks/list.php?leftmenu=tasks".($search_project_user ?
'&search_project_user='.$search_project_user :
''), $langs->trans(
"List"), 1, $user->hasRight(
'projet',
'lire'));
2230 $newmenu->add(
"/projet/tasks/stats/index.php?leftmenu=projects", $langs->trans(
"Statistics"), 1, $user->hasRight(
'projet',
'lire'));
2232 $newmenu->add(
"/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ?
'&search_project_user='.$search_project_user :
''), $langs->trans(
"NewTimeSpent"), 0, $user->hasRight(
'projet',
'lire'),
'',
'project',
'timespent', 0,
'',
'',
'',
img_picto(
'',
'timespent',
'class="paddingright pictofixedwidth"'));
2233 $newmenu->add(
"/projet/tasks/time.php?leftmenu=tasks".($search_project_user ?
'&search_project_user='.$search_project_user :
''), $langs->trans(
"List"), 1, $user->hasRight(
'projet',
'lire'));
2249 function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu =
'none', $type_user = 0)
2251 global $user, $conf, $langs;
2253 if ($mainmenu ==
'hrm') {
2256 $langs->load(
"hrm");
2258 $newmenu->add(
"/user/list.php?mainmenu=hrm&leftmenu=hrm&contextpage=employeelist", $langs->trans(
"Employees"), 0, $user->hasRight(
'user',
'user',
'read'),
'', $mainmenu,
'hrm', 0,
'',
'',
'',
img_picto(
'',
'user',
'class="paddingright pictofixedwidth"'));
2259 $newmenu->add(
"/user/card.php?mainmenu=hrm&leftmenu=hrm&action=create&employee=1", $langs->trans(
"NewEmployee"), 1, $user->hasRight(
'user',
'user',
'write'));
2260 $newmenu->add(
"/user/list.php?mainmenu=hrm&leftmenu=hrm&contextpage=employeelist", $langs->trans(
"List"), 1, $user->hasRight(
'user',
'user',
'read'));
2262 $newmenu->add(
"/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans(
"SkillsManagement"), 0, $user->hasRight(
'hrm',
'all',
'read'),
'', $mainmenu,
'hrm_sm', 0,
'',
'',
'',
img_picto(
'',
'shapes',
'class="paddingright pictofixedwidth"'));
2265 $newmenu->add(
"/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans(
"Skills"), 1, $user->hasRight(
'hrm',
'all',
'read'),
'', $mainmenu,
'hrm_sm', 0,
'',
'',
'',
img_picto(
'',
'shapes',
'class="paddingright pictofixedwidth"'));
2270 $newmenu->add(
"/hrm/job_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans(
"JobsPosition"), 1, $user->hasRight(
'hrm',
'all',
'read'),
'', $mainmenu,
'hrm_sm', 0,
'',
'',
'',
img_picto(
'',
'technic',
'class="paddingright pictofixedwidth"'));
2275 $newmenu->add(
"/hrm/position_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans(
"EmployeePositions"), 1, $user->hasRight(
'hrm',
'all',
'read'),
'', $mainmenu,
'hrm_sm', 0,
'',
'',
'',
img_picto(
'',
'user-cog',
'class="paddingright pictofixedwidth"'));
2280 $newmenu->add(
"/hrm/evaluation_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans(
"Evals"), 1, $user->hasRight(
'hrm',
'evaluation',
'read'),
'', $mainmenu,
'hrm_sm', 0,
'',
'',
'',
img_picto(
'',
'user',
'class="paddingright pictofixedwidth"'));
2283 $newmenu->add(
"/hrm/compare.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans(
"SkillComparison"), 1, $user->hasRight(
'hrm',
'evaluation',
'read') || $user->hasRight(
'hrm',
'compare_advance',
'read'));
2289 $langs->loadLangs(array(
"holiday",
"trips"));
2291 $newmenu->add(
"/holiday/list.php?mainmenu=hrm&leftmenu=holiday", $langs->trans(
"CPTitreMenu"), 0, $user->hasRight(
'holiday',
'read'),
'', $mainmenu,
'holiday', 0,
'',
'',
'',
img_picto(
'',
'holiday',
'class="paddingright pictofixedwidth"'));
2292 $newmenu->add(
"/holiday/card.php?mainmenu=hrm&leftmenu=holiday&action=create", $langs->trans(
"New"), 1, $user->hasRight(
'holiday',
'write'),
'', $mainmenu);
2293 $newmenu->add(
"/holiday/card_group.php?mainmenu=hrm&leftmenu=holiday&action=create", $langs->trans(
"NewHolidayForGroup"), 1, ($user->hasRight(
'holiday',
'writeall') && $user->hasRight(
'holiday',
'readall')),
'', $mainmenu,
'holiday_sm');
2294 $newmenu->add(
"/holiday/list.php?mainmenu=hrm&leftmenu=holiday", $langs->trans(
"List"), 1, $user->hasRight(
'holiday',
'read'),
'', $mainmenu);
2295 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"holiday") {
2296 $newmenu->add(
"/holiday/list.php?search_status=1&mainmenu=hrm&leftmenu=holiday", $langs->trans(
"DraftCP"), 2, $user->hasRight(
'holiday',
'read'),
'', $mainmenu,
'holiday_sm');
2297 $newmenu->add(
"/holiday/list.php?search_status=2&mainmenu=hrm&leftmenu=holiday", $langs->trans(
"ToReviewCP"), 2, $user->hasRight(
'holiday',
'read'),
'', $mainmenu,
'holiday_sm');
2298 $newmenu->add(
"/holiday/list.php?search_status=3&mainmenu=hrm&leftmenu=holiday", $langs->trans(
"ApprovedCP"), 2, $user->hasRight(
'holiday',
'read'),
'', $mainmenu,
'holiday_sm');
2299 $newmenu->add(
"/holiday/list.php?search_status=4&mainmenu=hrm&leftmenu=holiday", $langs->trans(
"CancelCP"), 2, $user->hasRight(
'holiday',
'read'),
'', $mainmenu,
'holiday_sm');
2300 $newmenu->add(
"/holiday/list.php?search_status=5&mainmenu=hrm&leftmenu=holiday", $langs->trans(
"RefuseCP"), 2, $user->hasRight(
'holiday',
'read'),
'', $mainmenu,
'holiday_sm');
2302 $newmenu->add(
"/holiday/define_holiday.php?mainmenu=hrm", $langs->trans(
"MenuConfCP"), 1, $user->hasRight(
'holiday',
'read'),
'', $mainmenu,
'holiday_sm');
2303 $newmenu->add(
"/holiday/month_report.php?mainmenu=hrm&leftmenu=holiday", $langs->trans(
"MenuReportMonth"), 1, $user->hasRight(
'holiday',
'readall'),
'', $mainmenu,
'holiday_sm');
2304 $newmenu->add(
"/holiday/view_log.php?mainmenu=hrm&leftmenu=holiday", $langs->trans(
"MenuLogCP"), 1, $user->hasRight(
'holiday',
'define_holiday'),
'', $mainmenu,
'holiday_sm');
2309 $langs->load(
"trips");
2310 $newmenu->add(
"/compta/deplacement/index.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans(
"TripsAndExpenses"), 0, $user->hasRight(
'deplacement',
'lire'),
'', $mainmenu,
'tripsandexpenses', 0,
'',
'',
'',
img_picto(
'',
'trip',
'class="paddingright pictofixedwidth"'));
2311 $newmenu->add(
"/compta/deplacement/card.php?action=create&leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans(
"New"), 1, $user->hasRight(
'deplacement',
'creer'));
2312 $newmenu->add(
"/compta/deplacement/list.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans(
"List"), 1, $user->hasRight(
'deplacement',
'lire'));
2313 $newmenu->add(
"/compta/deplacement/stats/index.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans(
"Statistics"), 1, $user->hasRight(
'deplacement',
'lire'));
2318 $langs->loadLangs(array(
"trips",
"bills"));
2319 $newmenu->add(
"/expensereport/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans(
"TripsAndExpenses"), 0, $user->hasRight(
'expensereport',
'lire'),
'', $mainmenu,
'expensereport', 0,
'',
'',
'',
img_picto(
'',
'trip',
'class="paddingright pictofixedwidth"'));
2320 $newmenu->add(
"/expensereport/card.php?action=create&leftmenu=expensereport&mainmenu=hrm", $langs->trans(
"New"), 1, $user->hasRight(
'expensereport',
'creer'));
2321 $newmenu->add(
"/expensereport/list.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans(
"List"), 1, $user->hasRight(
'expensereport',
'lire'));
2322 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"expensereport") {
2323 $newmenu->add(
"/expensereport/list.php?search_status=0&leftmenu=expensereport&mainmenu=hrm", $langs->trans(
"Draft"), 2, $user->hasRight(
'expensereport',
'lire'));
2324 $newmenu->add(
"/expensereport/list.php?search_status=2&leftmenu=expensereport&mainmenu=hrm", $langs->trans(
"Validated"), 2, $user->hasRight(
'expensereport',
'lire'));
2325 $newmenu->add(
"/expensereport/list.php?search_status=5&leftmenu=expensereport&mainmenu=hrm", $langs->trans(
"Approved"), 2, $user->hasRight(
'expensereport',
'lire'));
2326 $newmenu->add(
"/expensereport/list.php?search_status=6&leftmenu=expensereport&mainmenu=hrm", $langs->trans(
"Paid"), 2, $user->hasRight(
'expensereport',
'lire'));
2327 $newmenu->add(
"/expensereport/list.php?search_status=4&leftmenu=expensereport&mainmenu=hrm", $langs->trans(
"Canceled"), 2, $user->hasRight(
'expensereport',
'lire'));
2328 $newmenu->add(
"/expensereport/list.php?search_status=99&leftmenu=expensereport&mainmenu=hrm", $langs->trans(
"Refused"), 2, $user->hasRight(
'expensereport',
'lire'));
2330 $newmenu->add(
"/expensereport/payment/list.php?leftmenu=expensereport_payments&mainmenu=hrm", $langs->trans(
"Payments"), 1, $user->hasRight(
'expensereport',
'lire'));
2331 $newmenu->add(
"/expensereport/stats/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans(
"Statistics"), 1, $user->hasRight(
'expensereport',
'lire'));
2335 if (empty($conf->global->PROJECT_HIDE_TASKS)) {
2336 $langs->load(
"projects");
2338 $search_project_user =
GETPOST(
'search_project_user',
'int');
2340 $newmenu->add(
"/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ?
'&search_project_user='.$search_project_user :
''), $langs->trans(
"NewTimeSpent"), 0, $user->hasRight(
'projet',
'lire'),
'', $mainmenu,
'timespent', 0,
'',
'',
'',
img_picto(
'',
'timespent',
'class="paddingright pictofixedwidth"'));
2359 global $user, $conf, $langs;
2361 if ($mainmenu ==
'tools') {
2362 if (empty($user->socid)) {
2363 $langs->load(
"mails");
2364 $newmenu->add(
"/admin/mails_templates.php?leftmenu=email_templates", $langs->trans(
"EMailTemplates"), 0, 1,
'', $mainmenu,
'email_templates', 0,
'',
'',
'',
img_picto(
'',
'email',
'class="paddingright pictofixedwidth"'));
2368 $newmenu->add(
"/comm/mailing/index.php?leftmenu=mailing", $langs->trans(
"EMailings"), 0, $user->hasRight(
'mailing',
'lire'),
'', $mainmenu,
'mailing', 0,
'',
'',
'',
img_picto(
'',
'email',
'class="paddingright pictofixedwidth"'));
2369 $newmenu->add(
"/comm/mailing/card.php?leftmenu=mailing&action=create", $langs->trans(
"NewMailing"), 1, $user->hasRight(
'mailing',
'creer'));
2370 $newmenu->add(
"/comm/mailing/list.php?leftmenu=mailing", $langs->trans(
"List"), 1, $user->hasRight(
'mailing',
'lire'));
2374 $langs->load(
"exports");
2375 $newmenu->add(
"/exports/index.php?leftmenu=export", $langs->trans(
"FormatedExport"), 0, $user->hasRight(
'export',
'lire'),
'', $mainmenu,
'export', 0,
'',
'',
'',
img_picto(
'',
'technic',
'class="paddingright pictofixedwidth"'));
2376 $newmenu->add(
"/exports/export.php?leftmenu=export", $langs->trans(
"NewExport"), 1, $user->hasRight(
'export',
'creer'));
2381 $langs->load(
"exports");
2382 $newmenu->add(
"/imports/index.php?leftmenu=import", $langs->trans(
"FormatedImport"), 0, $user->hasRight(
'import',
'run'),
'', $mainmenu,
'import', 0,
'',
'',
'',
img_picto(
'',
'technic',
'class="paddingright pictofixedwidth"'));
2383 $newmenu->add(
"/imports/import.php?leftmenu=import", $langs->trans(
"NewImport"), 1, $user->hasRight(
'import',
'run'));
2400 global $user, $conf, $langs;
2402 if ($mainmenu ==
'members') {
2405 $langs->loadLangs(array(
"members",
"compta"));
2407 $newmenu->add(
"/adherents/index.php?leftmenu=members&mainmenu=members", $langs->trans(
"Members"), 0, $user->hasRight(
'adherent',
'read'),
'', $mainmenu,
'members', 0,
'',
'',
'',
img_picto(
'',
'member',
'class="paddingright pictofixedwidth"'));
2408 $newmenu->add(
"/adherents/card.php?leftmenu=members&action=create", $langs->trans(
"NewMember"), 1, $user->hasRight(
'adherent',
'write'));
2409 $newmenu->add(
"/adherents/list.php?leftmenu=members", $langs->trans(
"List"), 1, $user->hasRight(
'adherent',
'read'));
2410 $newmenu->add(
"/adherents/list.php?leftmenu=members&statut=-1", $langs->trans(
"MenuMembersToValidate"), 2, $user->hasRight(
'adherent',
'read'));
2411 $newmenu->add(
"/adherents/list.php?leftmenu=members&statut=1", $langs->trans(
"MenuMembersValidated"), 2, $user->hasRight(
'adherent',
'read'));
2412 $newmenu->add(
"/adherents/list.php?leftmenu=members&statut=1&filter=waitingsubscription", $langs->trans(
"WaitingSubscription"), 3, $user->hasRight(
'adherent',
'read'));
2413 $newmenu->add(
"/adherents/list.php?leftmenu=members&statut=1&filter=uptodate", $langs->trans(
"UpToDate"), 3, $user->hasRight(
'adherent',
'read'));
2414 $newmenu->add(
"/adherents/list.php?leftmenu=members&statut=1&filter=outofdate", $langs->trans(
"OutOfDate"), 3, $user->hasRight(
'adherent',
'read'));
2415 $newmenu->add(
"/adherents/list.php?leftmenu=members&statut=0", $langs->trans(
"MenuMembersResiliated"), 2, $user->hasRight(
'adherent',
'read'));
2416 $newmenu->add(
"/adherents/list.php?leftmenu=members&statut=-2", $langs->trans(
"MenuMembersExcluded"), 2, $user->hasRight(
'adherent',
'read'));
2417 $newmenu->add(
"/adherents/stats/index.php?leftmenu=members", $langs->trans(
"MenuMembersStats"), 1, $user->hasRight(
'adherent',
'read'));
2419 $newmenu->add(
"/adherents/cartes/carte.php?leftmenu=export", $langs->trans(
"MembersCards"), 1, $user->hasRight(
'adherent',
'export'));
2420 if (!empty($conf->global->MEMBER_LINK_TO_HTPASSWDFILE) && ($usemenuhider || empty($leftmenu) || $leftmenu ==
'none' || $leftmenu ==
"members" || $leftmenu ==
"export")) {
2421 $newmenu->add(
"/adherents/htpasswd.php?leftmenu=export", $langs->trans(
"Filehtpasswd"), 1, $user->hasRight(
'adherent',
'export'));
2425 $langs->load(
"categories");
2426 $newmenu->add(
"/categories/index.php?leftmenu=cat&type=3", $langs->trans(
"Categories"), 1, $user->hasRight(
'categorie',
'read'),
'', $mainmenu,
'cat');
2429 $newmenu->add(
"/adherents/index.php?leftmenu=members&mainmenu=members", $langs->trans(
"Subscriptions"), 0, $user->hasRight(
'adherent',
'cotisation',
'read'),
'', $mainmenu,
'members', 0,
'',
'',
'',
img_picto(
'',
'payment',
'class="paddingright pictofixedwidth"'));
2430 $newmenu->add(
"/adherents/list.php?leftmenu=members&statut=-1,1&mainmenu=members", $langs->trans(
"NewSubscription"), 1, $user->hasRight(
'adherent',
'cotisation',
'write'));
2431 $newmenu->add(
"/adherents/subscription/list.php?leftmenu=members", $langs->trans(
"List"), 1, $user->hasRight(
'adherent',
'cotisation',
'read'));
2432 $newmenu->add(
"/adherents/stats/index.php?leftmenu=members", $langs->trans(
"MenuMembersStats"), 1, $user->hasRight(
'adherent',
'read'));
2438 $newmenu->add(
"/adherents/type.php?leftmenu=setup&mainmenu=members", $langs->trans(
"MembersTypes"), 0, $user->hasRight(
'adherent',
'configurer'),
'', $mainmenu,
'setup', 0,
'',
'',
'',
img_picto(
'',
'members',
'class="paddingright pictofixedwidth"'));
2439 $newmenu->add(
"/adherents/type.php?leftmenu=setup&mainmenu=members&action=create", $langs->trans(
"New"), 1, $user->hasRight(
'adherent',
'configurer'));
2440 $newmenu->add(
"/adherents/type.php?leftmenu=setup&mainmenu=members", $langs->trans(
"List"), 1, $user->hasRight(
'adherent',
'configurer'));
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout=0, $mode='')
Core function to output top menu eldy.
get_left_menu_home($mainmenu, &$newmenu, $usemenuhider=1, $leftmenu='none', $type_user=0)
Get left Menu HOME.
print_start_menu_entry($idsel, $classname, $showmode)
Output start menu entry.
print_end_menu_entry($showmode)
Output end menu entry.
get_left_menu_members($mainmenu, &$newmenu, $usemenuhider=1, $leftmenu='none', $type_user=0)
Get left Menu MEMBERS.
print_text_menu_entry($text, $showmode, $url, $id, $idsel, $classname, $atarget)
Output menu entry.
get_left_menu_products($mainmenu, &$newmenu, $usemenuhider=1, $leftmenu='none', $type_user=0)
Get left Menu PRODUCTS-SERVICES.
get_left_menu_bank($mainmenu, &$newmenu, $usemenuhider=1, $leftmenu='none', $type_user=0)
Get left Menu BANK.
get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider=1, $leftmenu='none', $type_user=0)
Get left Menu HRM.
get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider=1, $leftmenu='none', $type_user=0)
Get left Menu COMMERCIAL (propal, commande, supplier_proposal, supplier_order, contrat,...
print_end_menu_array()
Output menu array.
get_left_menu_projects($mainmenu, &$newmenu, $usemenuhider=1, $leftmenu='none', $type_user=0)
Get left Menu PROJECTS.
get_left_menu_tools($mainmenu, &$newmenu, $usemenuhider=1, $leftmenu='none', $type_user=0)
Get left Menu TOOLS.
print_start_menu_array()
Output start menu array.
get_left_menu_mrp($mainmenu, &$newmenu, $usemenuhider=1, $leftmenu='none', $type_user=0)
Get left Menu PRODUCTS-SERVICES MRP - GPAO.
get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider=1, $leftmenu='none', $type_user=0)
Get left Menu THIRDPARTIES.
get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider=1, $leftmenu='none', $type_user=0)
Get left COMPTA-FINANCIAL (accountancy)
print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabMenu, &$menu, $noout=0, $forcemainmenu='', $forceleftmenu='', $moredata=null, $type_user=0)
Core function to output left menu eldy Fill &$menu (example with $forcemainmenu='home' $forceleftmenu...
get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider=1, $leftmenu='none', $type_user=0)
Get left COMPTA-FINANCIAL.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
isVisibleToUserType($type_user, &$menuentry, &$listofmodulesforexternal)
Function to test if an entry is enabled or not.
dol_string_nohtmltag($stringtoclean, $removelinefeed=1, $pagecodeto='UTF-8', $strip_tags=0, $removedoublespaces=1)
Clean a string from all HTML tags and entities.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
make_substitutions($text, $substitutionarray, $outputlangs=null, $converttextinhtmlifnecessary=0)
Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newva...
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $object=null)
Return array of possible common substitutions.
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
isModEnabled($module)
Is Dolibarr module enabled.