32require_once DOL_DOCUMENT_ROOT.
'/core/class/menubase.class.php';
47function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 0, $mode =
'')
49 global $user,
$conf, $langs, $mysoc;
50 global $dolibarr_main_db_name;
52 $mainmenu = (empty($_SESSION[
"mainmenu"]) ?
'' : $_SESSION[
"mainmenu"]);
53 $leftmenu = (empty($_SESSION[
"leftmenu"]) ?
'' : $_SESSION[
"leftmenu"]);
56 $listofmodulesforexternal = explode(
',',
getDolGlobalString(
'MAIN_MODULES_FOR_EXTERNAL'));
68 if ($mode !=
'jmobile' && $mode !=
'topnb' && $usemenuhider && !
getDolGlobalString(
'MAIN_OPTIMIZEFORTEXTBROWSER')) {
70 $classname =
'class="tmenu menuhider nohover"';
73 $menu->add(
'#', (
getDolGlobalInt(
'THEME_TOPMENU_DISABLE_IMAGE') == 1 ?
'<span class="fas fa-bars size12x"></span>' :
''), 0, $showmode, $atarget,
"xxx",
'', 0,
$id, $idsel, $classname,
'<span class="fas fa-bars size12x"></span>');
81 'link' =>
'/index.php?mainmenu=home&leftmenu=home',
84 'enabled' => $showmode = 1,
91 'classname' => $classname = (empty($_SESSION[
"mainmenu"]) || $_SESSION[
"mainmenu"] ==
"home") ?
'class="tmenusel"' :
'class="tmenu"',
92 'prefix' =>
'<span class="fas fa-home fa-fw"></span>',
93 'session' => ((!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"home") ? 0 : 1),
94 'loadLangs' => array(),
95 'submenus' => array(),
100 'enabled' => isModEnabled(
'member'),
101 'perms' => $user->hasRight(
'adherent',
'lire'),
102 'module' =>
'adherent'
106 'link' =>
'/adherents/index.php?mainmenu=members&leftmenu=',
107 'title' =>
"MenuMembers",
109 'enabled' => $showmode =
isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
110 'target' => $atarget,
111 'mainmenu' =>
"members",
115 'idsel' =>
'members',
116 'classname' => $classname = (!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"members") ?
'class="tmenusel"' :
'class="tmenu"',
117 'prefix' =>
img_picto(
'',
'member',
'class="fa-fw pictofixedwidth"'),
118 'session' => ((!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"members") ? 0 : 1),
119 'loadLangs' => array(
"members"),
120 'submenus' => array(),
127 isModEnabled(
'societe') &&
130 || (isModEnabled(
'supplier_proposal') || isModEnabled(
'supplier_order') || isModEnabled(
'supplier_invoice'))
132 'perms' => ($user->hasRight(
'societe',
'lire') || $user->hasRight(
'societe',
'contact',
'lire') || $user->hasRight(
'fournisseur',
'lire') || $user->hasRight(
'supplier_order',
'lire') || $user->hasRight(
'supplier_invoice',
'lire') || $user->hasRight(
'supplier_proposal',
'lire')),
133 'module' =>
'societe|fournisseur'
137 'name' =>
'Companies',
138 'link' =>
'/societe/index.php?mainmenu=companies&leftmenu=',
139 'title' =>
"ThirdParties",
141 'enabled' => $showmode =
isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
142 'target' => $atarget,
143 'mainmenu' =>
"companies",
147 'idsel' =>
'companies',
148 'classname' => $classname = (!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"companies") ?
'class="tmenusel"' :
'class="tmenu"',
149 'prefix' =>
img_picto(
'',
'company',
'class="fa-fw pictofixedwidth"'),
150 'session' => ((!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"companies") ? 0 : 1),
151 'loadLangs' => array(
"companies",
"suppliers"),
152 'submenus' => array(),
157 'enabled' => (isModEnabled(
'product') || isModEnabled(
'service') || isModEnabled(
'shipping')),
158 'perms' => ($user->hasRight(
'product',
'read') || $user->hasRight(
'service',
'read') || $user->hasRight(
'expedition',
'lire')),
159 'module' =>
'product|service'
162 'name' =>
'Products',
163 'link' =>
'/product/index.php?mainmenu=products&leftmenu=',
164 'title' => (isModEnabled(
'product') && isModEnabled(
'service'))
165 ? (array(
"TMenuProducts",
" | ",
"TMenuServices"))
166 : (isModEnabled(
'product') ?
"TMenuProducts" :
"TMenuServices"),
168 'enabled' => $showmode =
isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
169 'target' => $atarget,
170 'mainmenu' =>
"products",
174 'idsel' =>
'products',
175 'classname' => $classname = (!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"products") ?
'class="tmenusel"' :
'class="tmenu"',
176 'prefix' =>
img_picto(
'',
'product',
'class="fa-fw pictofixedwidth"'),
177 'session' => ((!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"products") ? 0 : 1),
178 'loadLangs' => array(
"products",
"stocks"),
179 'submenus' => array(),
184 'enabled' => (isModEnabled(
'bom') || isModEnabled(
'mrp')),
185 'perms' => ($user->hasRight(
'bom',
'read') || $user->hasRight(
'mrp',
'read')),
186 'module' =>
'bom|mrp'
189 'name' =>
'TMenuMRP',
190 'link' =>
'/mrp/index.php?mainmenu=mrp&leftmenu=',
191 'title' =>
"TMenuMRP",
193 'enabled' => $showmode =
isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
194 'target' => $atarget,
200 'classname' => $classname = (!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"mrp") ?
'class="tmenusel"' :
'class="tmenu"',
201 'prefix' =>
img_picto(
'',
'mrp',
'class="fa-fw pictofixedwidth"'),
202 'session' => ((!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"mrp") ? 0 : 1),
203 'loadLangs' => array(
"mrp"),
204 'submenus' => array(),
209 'enabled' => (isModEnabled(
'project') ? 1 : 0),
210 'perms' => ($user->hasRight(
'projet',
'lire') ? 1 : 0),
214 if ($mode ==
'jmobile') {
215 $titleboth = $langs->trans(
"LeadsOrProjects");
217 $titleboth = $langs->trans(
"Projects");
220 $titleboth = $langs->trans(
"Projects");
223 $titleboth = $langs->trans(
"Leads");
228 'link' =>
'/projet/index.php?mainmenu=project&leftmenu=',
229 'title' => $titleboth,
231 'enabled' => $showmode =
isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
232 'target' => $atarget,
233 'mainmenu' =>
"project",
237 'idsel' =>
'project',
238 'classname' => $classname = (!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"project") ?
'class="tmenusel"' :
'class="tmenu"',
239 'prefix' =>
img_picto(
'',
'project',
'class="fa-fw pictofixedwidth"'),
240 'session' => ((!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"project") ? 0 : 1),
241 'loadLangs' => array(
"projects"),
242 'submenus' => array(),
248 isModEnabled(
'propal')
249 || isModEnabled(
'order')
250 || isModEnabled(
'fournisseur')
251 || isModEnabled(
'supplier_proposal')
252 || isModEnabled(
'supplier_order')
253 || isModEnabled(
'contract')
254 || isModEnabled(
'intervention')
257 $user->hasRight(
'propal',
'read')
258 || $user->hasRight(
'commande',
'lire')
259 || $user->hasRight(
'supplier_proposal',
'lire')
260 || $user->hasRight(
'fournisseur',
'lire')
261 || $user->hasRight(
'fournisseur',
'commande',
'lire')
262 || $user->hasRight(
'supplier_order',
'lire')
263 || $user->hasRight(
'contrat',
'lire')
264 || $user->hasRight(
'ficheinter',
'lire')
266 'module' =>
'propal|commande|supplier_proposal|supplier_order|contrat|ficheinter'
269 $onlysupplierorder = $user->hasRight(
'fournisseur',
'commande',
'lire') &&
270 !$user->hasRight(
'propal',
'lire') &&
271 !$user->hasRight(
'commande',
'lire') &&
272 !$user->hasRight(
'supplier_order',
'lire') &&
273 !$user->hasRight(
'supplier_proposal',
'lire') &&
274 !$user->hasRight(
'contrat',
'lire') &&
275 !$user->hasRight(
'ficheinter',
'lire');
278 'name' =>
'Commercial',
279 'link' => ($onlysupplierorder ?
'/fourn/commande/index.php?mainmenu=commercial&leftmenu=' :
'/comm/index.php?mainmenu=commercial&leftmenu='),
280 'title' =>
"Commercial",
282 'enabled' => $showmode =
isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
283 'target' => $atarget,
284 'mainmenu' =>
"commercial",
288 'idsel' =>
'commercial',
289 'classname' => $classname = (!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"commercial") ?
'class="tmenusel"' :
'class="tmenu"',
290 'prefix' =>
img_picto(
'',
'contract',
'class="fa-fw pictofixedwidth"'),
291 'session' => ((!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"commercial") ? 0 : 1),
292 'loadLangs' => array(
"commercial"),
293 'submenus' => array(),
299 isModEnabled(
'invoice') ||
300 isModEnabled(
'don') ||
301 isModEnabled(
'tax') ||
302 isModEnabled(
'salaries') ||
303 isModEnabled(
'supplier_invoice') ||
304 isModEnabled(
'loan') ||
305 isModEnabled(
'margin')
307 'perms' => ($user->hasRight(
'facture',
'lire') || $user->hasRight(
'don',
'contact',
'lire')
308 || $user->hasRight(
'tax',
'charges',
'lire') || $user->hasRight(
'salaries',
'read')
309 || $user->hasRight(
'fournisseur',
'facture',
'lire') || $user->hasRight(
'loan',
'read') || $user->hasRight(
'margins',
'liretous')),
310 'module' =>
'facture|supplier_invoice|don|tax|salaries|loan'
314 'link' =>
'/compta/index.php?mainmenu=billing&leftmenu=',
315 'title' =>
"MenuFinancial",
317 'enabled' => $showmode =
isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
318 'target' => $atarget,
319 'mainmenu' =>
"billing",
323 'idsel' =>
'billing',
324 'classname' => $classname = (!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"billing") ?
'class="tmenusel"' :
'class="tmenu"',
325 'prefix' =>
img_picto(
'',
'bill',
'class="fa-fw pictofixedwidth"'),
326 'session' => ((!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"billing") ? 0 : 1),
327 'loadLangs' => array(
"compta"),
328 'submenus' => array(),
333 'enabled' => (isModEnabled(
'bank') || isModEnabled(
'prelevement')),
334 'perms' => ($user->hasRight(
'banque',
'lire') || $user->hasRight(
'prelevement',
'lire') || $user->hasRight(
'paymentbybanktransfer',
'read')),
335 'module' =>
'banque|prelevement|paymentbybanktransfer'
339 'link' =>
'/compta/bank/list.php?mainmenu=bank&leftmenu=&search_status=opened',
340 'title' =>
"MenuBankCash",
342 'enabled' => $showmode =
isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
343 'target' => $atarget,
344 'mainmenu' =>
"bank",
349 'classname' => $classname = (!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"bank") ?
'class="tmenusel"' :
'class="tmenu"',
350 'prefix' =>
img_picto(
'',
'bank_account',
'class="fa-fw pictofixedwidth"'),
351 'session' => ((!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"bank") ? 0 : 1),
352 'loadLangs' => array(
"compta",
"banks"),
353 'submenus' => array(),
358 'enabled' => (isModEnabled(
'comptabilite') || isModEnabled(
'accounting') || isModEnabled(
'asset') || isModEnabled(
'intracommreport')),
359 'perms' => ($user->hasRight(
'compta',
'resultat',
'lire') || $user->hasRight(
'accounting',
'comptarapport',
'lire') || $user->hasRight(
'accounting',
'mouvements',
'lire') || $user->hasRight(
'asset',
'read') || $user->hasRight(
'intracommreport',
'read')),
360 'module' =>
'comptabilite|accounting|asset|intracommreport'
363 'name' =>
'Accounting',
364 'link' =>
'/accountancy/index.php?mainmenu=accountancy&leftmenu=',
365 'title' =>
"MenuAccountancy",
367 'enabled' => $showmode =
isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
368 'target' => $atarget,
369 'mainmenu' =>
"accountancy",
373 'idsel' =>
'accountancy',
374 'classname' => $classname = (!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"accountancy") ?
'class="tmenusel"' :
'class="tmenu"',
375 'prefix' =>
img_picto(
'',
'accountancy',
'class="fa-fw pictofixedwidth"'),
376 'session' => ((!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"accountancy") ? 0 : 1),
377 'loadLangs' => array(
"compta",
"accountancy",
"assets",
"intracommreport"),
378 'submenus' => array(),
383 'enabled' => (isModEnabled(
'hrm') || (isModEnabled(
'holiday')) || isModEnabled(
'deplacement') || isModEnabled(
'expensereport') || isModEnabled(
'recruitment')),
384 'perms' => ($user->hasRight(
'user',
'user',
'lire') || $user->hasRight(
'holiday',
'read') || $user->hasRight(
'deplacement',
'lire') || $user->hasRight(
'expensereport',
'lire') || $user->hasRight(
'recruitment',
'recruitmentjobposition',
'read')),
385 'module' =>
'hrm|holiday|deplacement|expensereport|recruitment'
390 'link' =>
'/hrm/index.php?mainmenu=hrm&leftmenu=',
393 'enabled' => $showmode =
isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
394 'target' => $atarget,
400 'classname' => $classname = (!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"hrm") ?
'class="tmenusel"' :
'class="tmenu"',
401 'prefix' =>
img_picto(
'',
'hrm',
'class="fa-fw pictofixedwidth"'),
402 'session' => ((!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"hrm") ? 0 : 1),
403 'loadLangs' => array(
"hrm",
"holiday"),
404 'submenus' => array(),
409 'enabled' => (isModEnabled(
'ticket') || isModEnabled(
'knowledgemanagement')),
410 'perms' => ($user->hasRight(
'ticket',
'read') || $user->hasRight(
'knowledgemanagement',
'knowledgerecord',
'read')),
411 'module' =>
'ticket|knowledgemanagement'
414 if (isModEnabled(
'ticket')) {
415 $link =
'/ticket/index.php?mainmenu=ticket&leftmenu=';
417 $link =
'/knowledgemanagement/knowledgerecord_list.php?mainmenu=ticket&leftmenu=';
422 'title' => isModEnabled(
'ticket') ?
"Tickets" :
"MenuKnowledgeRecordShort",
424 'enabled' => $showmode =
isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
425 'target' => $atarget,
426 'mainmenu' =>
"ticket",
431 'classname' => $classname = (!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"ticket") ?
'class="tmenusel"' :
'class="tmenu"',
432 'prefix' =>
img_picto(
'',
'ticket',
'class="fa-fw pictofixedwidth"'),
433 'session' => ((!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"ticket") ? 0 : 1),
434 'loadLangs' => array(
"ticket",
"knowledgemanagement"),
435 'submenus' => array(),
446 'link' =>
'/core/tools.php?mainmenu=tools&leftmenu=',
449 'enabled' => $showmode =
isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
450 'target' => $atarget,
451 'mainmenu' =>
"tools",
456 'classname' => $classname = (!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"tools") ?
'class="tmenusel"' :
'class="tmenu"',
457 'prefix' =>
img_picto(
'',
'tools',
'class="fa-fw pictofixedwidth"'),
458 'session' => ((!empty($_SESSION[
"mainmenu"]) && $_SESSION[
"mainmenu"] ==
"tools") ? 0 : 1),
459 'loadLangs' => array(
"other"),
460 'submenus' => array(),
464 foreach ($menu_arr as $key => $smenu) {
465 $smenu = (object) $smenu;
467 if ($smenu->enabled) {
468 if ($smenu->session) {
469 $_SESSION[
'idmenu'] =
'';
473 if (!empty($smenu->loadLangs)) {
474 $langs->loadLangs($smenu->loadLangs);
479 if (is_array($smenu->title)) {
480 foreach ($smenu->title as $item) {
481 $mtitle .= $langs->trans($item);
484 $mtitle = $langs->trans($smenu->title);
487 $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);
492 $menuArbo =
new Menubase($db,
'eldy');
494 $newTabMenu = $menuArbo->menuTopCharger(
'',
'', $type_user,
'eldy', $tabMenu);
496 $num = count($newTabMenu);
497 for ($i = 0; $i < $num; $i++) {
499 $idsel = (empty($newTabMenu[$i][
'mainmenu']) ?
'none' : $newTabMenu[$i][
'mainmenu']);
502 '@phan-var-force array<array{rowid:string,fk_menu:string,langs:string,enabled:int<0,2>,type:string,fk_mainmenu:string,fk_leftmenu:string,url:string,titre:string,perms:string,target:string,mainmenu:string,leftmenu:string,position:int,prefix:string}> $newTabMenu';
505 $url = $shorturl = $newTabMenu[$i][
'url'];
506 if (!preg_match(
"/^(http:\/\/|https:\/\/)/i", $newTabMenu[$i][
'url'])) {
507 $tmp = explode(
'?', $newTabMenu[$i][
'url'], 2);
508 $url = $shorturl = $tmp[0];
509 $param = (isset($tmp[1]) ? $tmp[1] :
'');
511 if ((!preg_match(
'/mainmenu/i', $param)) || !preg_match(
'/leftmenu/i', $param)) {
513 $param .= ($param ?
'&' :
'').
'mainmenu='.$newTabMenu[$i][
'mainmenu'].
'&leftmenu=';
520 $shorturl = preg_replace(
'/^'.preg_quote(DOL_URL_ROOT,
'/').
'/',
'', $shorturl);
525 if ($showmode == 1) {
527 if (!empty($_SESSION[
'idmenu']) && $newTabMenu[$i][
'rowid'] == $_SESSION[
'idmenu']) {
528 $classname =
'class="tmenusel"';
529 } elseif (!empty($_SESSION[
"mainmenu"]) && $newTabMenu[$i][
'mainmenu'] == $_SESSION[
"mainmenu"]) {
530 $classname =
'class="tmenusel"';
532 $classname =
'class="tmenu"';
534 } elseif ($showmode == 2) {
535 $classname =
'class="tmenu"';
540 $newTabMenu[$i][
'titre'],
543 ($newTabMenu[$i][
'target'] ? $newTabMenu[$i][
'target'] : $atarget),
544 ($newTabMenu[$i][
'mainmenu'] ? $newTabMenu[$i][
'mainmenu'] : $newTabMenu[$i][
'rowid']),
545 ($newTabMenu[$i][
'leftmenu'] ? $newTabMenu[$i][
'leftmenu'] :
''),
546 $newTabMenu[$i][
'position'],
550 $newTabMenu[$i][
'prefix']
561 $mysoc->logo_squarred_mini = (!
getDolGlobalString(
'MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI') ?
'' :
$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI);
563 $logoContainerAdditionalClass =
'backgroundforcompanylogo';
565 $logoContainerAdditionalClass =
'';
568 if (!empty($mysoc->logo_squarred_mini) && is_readable(
$conf->mycompany->dir_output.
'/logos/thumbs/'.$mysoc->logo_squarred_mini)) {
569 $urllogo = DOL_URL_ROOT.
'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode(
'logos/thumbs/'.$mysoc->logo_squarred_mini);
575 $urllogo = DOL_URL_ROOT.
'/theme/dolibarr_512x512_white.png';
576 $logoContainerAdditionalClass =
'';
578 $title = $langs->trans(
"GoIntoSetupToChangeLogo");
580 print
"\n".
'<!-- Show logo on menu -->'.
"\n";
583 print
'<div class="center '.$logoContainerAdditionalClass.
' menulogocontainer"><img class="mycompany" title="'.
dol_escape_htmltag($title).
'" alt="" src="'.$urllogo.
'" style="max-width: 100px"></div>'.
"\n";
590 foreach ($menu->liste as $menuval) {
592 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), $menuval);
615 print
'<div class="tmenudiv">';
616 print
'<ul role="navigation" class="tmenu"'.(getDolGlobalString(
'MAIN_OPTIMIZEFORTEXTBROWSER') ?
' title="Top menu"' :
'').
'>';
630 print
'<li '.$classname.
' id="mainmenutd_'.$idsel.
'">';
632 print
'<div class="tmenucenter">';
653 $classnameimg = str_replace(
'class="',
'class="tmenuimage ', $classname);
654 $classnametxt = str_replace(
'class="',
'class="tmenulabel ', $classname);
657 if ($showmode == 1) {
658 print
'<a '.$classnameimg.
' tabindex="-1" href="'.$url.
'"'.($atarget ?
' target="'.$atarget.
'"' :
'').
' title="'.
dol_escape_htmltag($text).
'">';
659 print
'<div class="'.$id.
' '.$idsel.
' topmenuimage">';
660 if (!empty($menuval[
'prefix']) && strpos($menuval[
'prefix'],
'<span') === 0) {
661 print $menuval[
'prefix'];
662 } elseif (!empty($menuval[
'prefix']) && strpos($menuval[
'prefix'],
'fa-') === 0) {
663 print
'<span class="'.$id.
' '.$menuval[
'prefix'].
'" id="mainmenuspan_'.$idsel.
'"></span>';
665 print
'<span class="'.$id.
' tmenuimageforpng" id="mainmenuspan_'.$idsel.
'"></span>';
670 print
'<a '.$classnametxt.
' id="mainmenua_'.$idsel.
'" href="'.$url.
'"'.($atarget ?
' target="'.$atarget.
'"' :
'').
' title="'.
dol_escape_htmltag($text).
'">';
671 print
'<span class="mainmenuaspan">';
676 } elseif ($showmode == 2) {
677 print
'<div '.$classnameimg.
' title="'.
dol_escape_htmltag($text.
' - '.$langs->trans(
"NotAllowed")).
'">';
678 print
'<div class="'.$id.
' '.$idsel.
' topmenuimage tmenudisabled">';
679 if (!empty($menuval[
'prefix']) && strpos($menuval[
'prefix'],
'<span') === 0) {
680 print $menuval[
'prefix'];
682 print
'<span class="'.$id.
' tmenuimageforpng tmenudisabled" id="mainmenuspan_'.$idsel.
'"></span>';
687 print
'<span '.$classnametxt.
' id="mainmenua_'.$idsel.
'" href="#" title="'.
dol_escape_htmltag($text.
' - '.$langs->trans(
"NotAllowed")).
'">';
688 print
'<span class="mainmenuaspan tmenudisabled">';
738function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabMenu, &$menu, $noout = 0, $forcemainmenu =
'', $forceleftmenu =
'', $moredata =
null, $type_user = 0)
740 global $user,
$conf, $langs, $hookmanager;
746 $mainmenu = ($forcemainmenu ? $forcemainmenu : $_SESSION[
"mainmenu"] ??
'');
747 $leftmenu = ($forceleftmenu ?
'' : (empty($_SESSION[
"leftmenu"]) ?
'none' : $_SESSION[
"leftmenu"] ??
''));
749 if (empty($mainmenu)) {
753 global $usemenuhider;
756 if (is_array($moredata) && !empty($moredata[
'searchform'])) {
758 print
"<!-- Begin SearchForm -->\n";
759 print
'<div id="blockvmenusearch" class="blockvmenusearch">'.
"\n";
760 print $moredata[
'searchform'];
762 print
"<!-- End SearchForm -->\n";
765 if (is_array($moredata) && !empty($moredata[
'bookmarks'])) {
767 print
"<!-- Begin Bookmarks -->\n";
768 print
'<div id="blockvmenubookmarks" class="blockvmenubookmarks">'.
"\n";
769 print $moredata[
'bookmarks'];
771 print
"<!-- End Bookmarks -->\n";
776 $listofmodulesforexternal = explode(
',',
getDolGlobalString(
'MAIN_MODULES_FOR_EXTERNAL'));
786 if ($mainmenu ==
'home') {
793 if ($mainmenu ==
'companies') {
800 if ($mainmenu ==
'commercial') {
807 if ($mainmenu ==
'billing') {
814 if ($mainmenu ==
'accountancy') {
821 if ($mainmenu ==
'bank') {
828 if ($mainmenu ==
'products') {
835 if ($mainmenu ==
'mrp') {
842 if ($mainmenu ==
'project') {
849 if ($mainmenu ==
'hrm') {
855 if ($mainmenu ==
'tools') {
862 if ($mainmenu ==
'members') {
868 $menuArbo =
new Menubase($db,
'eldy');
869 $newmenu = $menuArbo->menuLeftCharger($newmenu, $mainmenu, $leftmenu, (empty($user->socid) ? 0 : 1),
'eldy', $tabMenu);
872 if (isModEnabled(
'ftp') && $mainmenu ==
'ftp') {
875 while ($i <= $MAXFTP) {
876 $paramkey =
'FTP_NAME_'.$i;
879 $link =
"/ftp/index.php?idmenu=".$_SESSION[
"idmenu"].
"&numero_ftp=".$i;
893 $menu_array = $newmenu->liste;
894 if (is_array($menu_array_before)) {
895 $menu_array = array_merge($menu_array_before, $menu_array);
897 if (is_array($menu_array_after)) {
898 $menu_array = array_merge($menu_array, $menu_array_after);
901 if (!is_array($menu_array)) {
907 'mainmenu' => $mainmenu,
909 $hook_items = $menu_array;
910 $reshook = $hookmanager->executeHooks(
'menuLeftMenuItems', $parameters, $hook_items);
912 if (is_numeric($reshook)) {
913 if ($reshook == 0 && !empty($hookmanager->resArray)) {
914 $menu_array[] = $hookmanager->resArray;
915 } elseif ($reshook == 1) {
916 $menu_array = $hookmanager->resArray;
940 '@phan-var-force array<array{rowid:string,fk_menu:string,langs:string,enabled:int<0,2>,type:string,fk_mainmenu:string,fk_leftmenu:string,url:string,titre:string,perms:string,target:string,mainmenu:string,leftmenu:string,position:int,level?:int,prefix:string}> $menu_array';
947 $blockvmenuopened =
false;
949 $num = count($menu_array);
950 foreach (array_keys($menu_array) as $i) {
952 if (
getDolGlobalString(
'MAIN_MENU_HIDE_UNAUTHORIZED') && empty($menu_array[$i][
'enabled'])) {
957 if (empty($menu_array[$i][
'level']) && $showmenu) {
959 $blockvmenuopened =
true;
961 for ($j = ($i + 1); $j < $num; $j++) {
962 if (empty($menu_array[$j][
'level'])) {
966 if ($altok % 2 == 0) {
967 print
'<div class="blockvmenu blockvmenuimpair'.$invert.($lastopened ?
' blockvmenulast' :
'').($altok == 1 ?
' blockvmenufirst' :
'').
'">'.
"\n";
969 print
'<div class="blockvmenu blockvmenupair'.$invert.($lastopened ?
' blockvmenulast' :
'').($altok == 1 ?
' blockvmenufirst' :
'').
'">'.
"\n";
975 $tabul = ($menu_array[$i][
'level'] - 1);
977 for ($j = 0; $j < $tabul; $j++) {
978 $tabstring .=
' ';
986 $url = $shorturl = $shorturlwithoutparam = $menu_array[$i][
'url'];
987 if (!preg_match(
"/^(http:\/\/|https:\/\/)/i", $menu_array[$i][
'url'])) {
988 $tmp = explode(
'?', $menu_array[$i][
'url'], 2);
989 $url = $shorturl = $tmp[0];
990 $param = (isset($tmp[1]) ? $tmp[1] :
'');
993 if ((!preg_match(
'/mainmenu/i', $param)) && (!preg_match(
'/leftmenu/i', $param)) && !empty($menu_array[$i][
'mainmenu'])) {
994 $param .= ($param ?
'&' :
'').
'mainmenu='.$menu_array[$i][
'mainmenu'].
'&leftmenu=';
996 if ((!preg_match(
'/mainmenu/i', $param)) && (!preg_match(
'/leftmenu/i', $param)) && empty($menu_array[$i][
'mainmenu'])) {
997 $param .= ($param ?
'&' :
'').
'leftmenu=';
1001 $shorturlwithoutparam = $shorturl;
1002 $shorturl .= ($param ?
'?'.$param :
'');
1006 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";
1009 if ($menu_array[$i][
'level'] == 0) {
1010 if ($menu_array[$i][
'enabled']) {
1011 print
'<div class="menu_titre">'.$tabstring;
1012 if ($shorturlwithoutparam) {
1013 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'].
'"' :
'').
'>';
1015 print
'<span class="vmenu">';
1017 if (!empty($menu_array[$i][
'prefix'])) {
1018 if (preg_match(
'/^fa\-[a-zA-Z0-9\-_]+$/', $menu_array[$i][
'prefix'])) {
1019 print
'<span class="fas '.$menu_array[$i][
'prefix'].
' paddingright pictofixedwidth"></span>';
1021 print $menu_array[$i][
'prefix'];
1024 print $menu_array[$i][
'titre'];
1025 if ($shorturlwithoutparam) {
1030 print
'</div>'.
"\n";
1031 $lastlevel0 =
'enabled';
1032 } elseif ($showmenu) {
1033 print
'<div class="menu_titre">'.$tabstring;
1034 print
'<span class="vmenudisabled" title="'.dolPrintHTMLForAttribute($menu_array[$i][
'titre']).
'">';
1035 if (!empty($menu_array[$i][
'prefix'])) {
1036 print $menu_array[$i][
'prefix'];
1038 print $menu_array[$i][
'titre'];
1040 print
'</div>'.
"\n";
1041 $lastlevel0 =
'greyed';
1043 $lastlevel0 =
'hidden';
1046 print
'<div class="menu_top"></div>'.
"\n";
1051 if ($menu_array[$i][
'level'] > 0) {
1053 if ($menu_array[$i][
'url']) {
1054 $cssmenu =
' menu_contenu'.dol_string_nospecial(preg_replace(
'/\.php.*$/',
'', $menu_array[$i][
'url']));
1057 if ($menu_array[$i][
'enabled'] && $lastlevel0 ==
'enabled') {
1059 print
'<div class="menu_contenu'.$cssmenu.
'">';
1061 if ($shorturlwithoutparam) {
1062 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'].
'"' :
'').
'>';
1064 print
'<span class="vsmenu" title="'.dol_escape_htmltag($menu_array[$i][
'titre']).
'">';
1066 print $menu_array[$i][
'titre'];
1067 if ($shorturlwithoutparam) {
1073 if (!strstr($menu_array[$i][
'titre'],
'<table')) {
1076 print
'</div>'.
"\n";
1077 } elseif ($showmenu && $lastlevel0 ==
'enabled') {
1079 print
'<div class="menu_contenu'.$cssmenu.
'">';
1081 print
'<span class="vsmenudisabled vsmenudisabledmargin" title="'.dolPrintHTMLForAttribute($menu_array[$i][
'titre']).
'">'.$menu_array[$i][
'titre'].
'</span><br>';
1082 print
'</div>'.
"\n";
1087 if (empty($menu_array[$i + 1][
'level'])) {
1089 print
'<div class="menu_end"></div>'.
"\n";
1091 if ($blockvmenuopened) {
1092 print
'</div>'.
"\n";
1093 $blockvmenuopened =
false;
1099 print
'<div class="blockvmenuend"></div>';
1103 return count($menu_array);
1119 global $user,
$conf, $langs;
1121 if ($mainmenu ==
'home') {
1122 $langs->load(
"users");
1125 $newmenu->add(
"/index.php?mainmenu=home&leftmenu=home", $langs->trans(
"MyDashboard"), 0, 1,
'', $mainmenu,
'home', 0,
'',
'',
'',
'<i class="fas fa-chart-bar fa-fw paddingright pictofixedwidth"></i>');
1128 $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>');
1130 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"setup") {
1132 $nbmodulesnotautoenabled = count(
$conf->modules);
1133 $listofmodulesautoenabled = array(
'agenda',
'fckeditor',
'export',
'import');
1134 foreach ($listofmodulesautoenabled as $moduleautoenable) {
1135 if (in_array($moduleautoenable,
$conf->modules)) {
1136 $nbmodulesnotautoenabled--;
1141 $langs->loadLangs(array(
"admin",
"help"));
1144 $langs->load(
"errors");
1145 $warnpicto =
img_warning($langs->trans(
"WarningMandatorySetupNotComplete"));
1147 $newmenu->add(
"/admin/company.php?mainmenu=home", $langs->trans(
"MenuCompanySetup").$warnpicto, 1);
1149 if ($nbmodulesnotautoenabled <=
getDolGlobalInt(
'MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING', 1)) {
1150 $langs->load(
"errors");
1151 $warnpicto =
img_warning($langs->trans(
"WarningMandatorySetupNotComplete"));
1153 $newmenu->add(
"/admin/modules.php?mainmenu=home", $langs->trans(
"Modules").$warnpicto, 1);
1154 $newmenu->add(
"/admin/ihm.php?mainmenu=home", $langs->trans(
"GUISetup"), 1);
1155 $newmenu->add(
"/admin/menus.php?mainmenu=home", $langs->trans(
"Menus"), 1);
1157 $newmenu->add(
"/admin/translation.php?mainmenu=home", $langs->trans(
"Translation"), 1);
1158 $newmenu->add(
"/admin/defaultvalues.php?mainmenu=home", $langs->trans(
"DefaultValues"), 1);
1159 $newmenu->add(
"/admin/boxes.php?mainmenu=home", $langs->trans(
"Boxes"), 1);
1160 $newmenu->add(
"/admin/delais.php?mainmenu=home", $langs->trans(
"MenuWarnings"), 1);
1161 $newmenu->add(
"/admin/security_other.php?mainmenu=home", $langs->trans(
"Security"), 1);
1162 $newmenu->add(
"/admin/limits.php?mainmenu=home", $langs->trans(
"MenuLimits"), 1);
1163 $newmenu->add(
"/admin/pdf.php?mainmenu=home", $langs->trans(
"PDF"), 1);
1174 $langs->load(
"errors");
1175 $warnpicto =
img_warning($langs->trans(
"ErrorSetupOfEmailsNotComplete"));
1178 $newmenu->add(
"/admin/mails.php?mainmenu=home", $langs->trans(
"Emails").$warnpicto, 1);
1179 $newmenu->add(
"/admin/sms.php?mainmenu=home", $langs->trans(
"SMS"), 1);
1180 $newmenu->add(
"/admin/dict.php?mainmenu=home", $langs->trans(
"Dictionary"), 1);
1181 $newmenu->add(
"/admin/const.php?mainmenu=home", $langs->trans(
"OtherSetup"), 1);
1185 $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>');
1186 if ($usemenuhider || empty($leftmenu) || preg_match(
'/^admintools/', $leftmenu)) {
1188 $langs->loadLangs(array(
'admin',
'help'));
1190 $newmenu->add(
'/admin/system/dolibarr.php?mainmenu=home&leftmenu=admintools_info', $langs->trans(
'InfoDolibarr'), 1);
1191 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
'admintools_info') {
1192 $newmenu->add(
'/admin/system/modules.php?mainmenu=home&leftmenu=admintools_info', $langs->trans(
'Modules'), 2);
1193 $newmenu->add(
'/admin/triggers.php?mainmenu=home&leftmenu=admintools_info', $langs->trans(
'Triggers'), 2);
1194 $newmenu->add(
'/admin/system/filecheck.php?mainmenu=home&leftmenu=admintools_info', $langs->trans(
'FileCheck'), 2);
1196 $newmenu->add(
'/admin/system/browser.php?mainmenu=home&leftmenu=admintools', $langs->trans(
'InfoBrowser'), 1);
1197 $newmenu->add(
'/admin/system/os.php?mainmenu=home&leftmenu=admintools', $langs->trans(
'InfoOS'), 1);
1198 $newmenu->add(
'/admin/system/web.php?mainmenu=home&leftmenu=admintools', $langs->trans(
'InfoWebServer'), 1);
1199 $newmenu->add(
'/admin/system/phpinfo.php?mainmenu=home&leftmenu=admintools', $langs->trans(
'InfoPHP'), 1);
1200 $newmenu->add(
'/admin/system/database.php?mainmenu=home&leftmenu=admintools', $langs->trans(
'InfoDatabase'), 1);
1201 $newmenu->add(
"/admin/system/perf.php?mainmenu=home&leftmenu=admintools", $langs->trans(
"InfoPerf"), 1);
1202 $newmenu->add(
"/admin/system/security.php?mainmenu=home&leftmenu=admintools", $langs->trans(
"InfoSecurity"), 1);
1203 $newmenu->add(
"/admin/tools/listevents.php?mainmenu=home&leftmenu=admintools", $langs->trans(
"Audit"), 1);
1204 $newmenu->add(
"/admin/tools/listsessions.php?mainmenu=home&leftmenu=admintools", $langs->trans(
"Sessions"), 1);
1205 $newmenu->add(
"/admin/tools/dolibarr_export.php?mainmenu=home&leftmenu=admintools", $langs->trans(
"Backup"), 1);
1206 $newmenu->add(
"/admin/tools/dolibarr_import.php?mainmenu=home&leftmenu=admintools", $langs->trans(
"Restore"), 1);
1207 $newmenu->add(
"/admin/tools/update.php?mainmenu=home&leftmenu=admintools", $langs->trans(
"MenuUpgrade"), 1);
1208 $newmenu->add(
"/admin/tools/purge.php?mainmenu=home&leftmenu=admintools", $langs->trans(
"Purge"), 1);
1209 $newmenu->add(
'/admin/system/about.php?mainmenu=home&leftmenu=admintools_info', $langs->trans(
'ExternalResources'), 1);
1218 if (isModEnabled(
'product') || isModEnabled(
'service')) {
1219 $langs->load(
"products");
1220 $newmenu->add(
"/product/admin/product_tools.php?mainmenu=home&leftmenu=admintools", $langs->trans(
"ProductVatMassChange"), 1, $user->admin);
1224 $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"'));
1225 if ($user->hasRight(
'user',
'user',
'read')) {
1226 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"users") {
1227 $newmenu->add(
"", $langs->trans(
"Users"), 1, $user->hasRight(
'user',
'user',
'read') || $user->admin);
1228 $newmenu->add(
"/user/card.php?leftmenu=users&action=create", $langs->trans(
"NewUser"), 2, ($user->hasRight(
"user",
"user",
"write") || $user->admin) && !(isModEnabled(
'multicompany') && !empty($user->entity) &&
getDolGlobalString(
'MULTICOMPANY_TRANSVERSE_MODE')),
'',
'home');
1229 $newmenu->add(
"/user/list.php?leftmenu=users", $langs->trans(
"ListOfUsers"), 2, $user->hasRight(
'user',
'user',
'read') || $user->admin);
1230 $newmenu->add(
"/user/hierarchy.php?leftmenu=users", $langs->trans(
"HierarchicView"), 2, $user->hasRight(
'user',
'user',
'read') || $user->admin);
1231 if (isModEnabled(
'category')) {
1232 $langs->load(
"categories");
1233 $newmenu->add(
"/categories/index.php?leftmenu=users&type=7", $langs->trans(
"UsersCategoriesShort"), 2, $user->hasRight(
'categorie',
'read'),
'', $mainmenu,
'cat');
1235 $newmenu->add(
"", $langs->trans(
"Groups"), 1, ($user->hasRight(
'user',
'user',
'read') || $user->admin) && !(isModEnabled(
'multicompany') && !empty($user->entity) &&
getDolGlobalString(
'MULTICOMPANY_TRANSVERSE_MODE')));
1236 $newmenu->add(
"/user/group/card.php?leftmenu=users&action=create", $langs->trans(
"NewGroup"), 2, ((
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') ? $user->hasRight(
"user",
"group_advance",
"write") : $user->hasRight(
"user",
"user",
"write")) || $user->admin) && !(isModEnabled(
'multicompany') && !empty($user->entity) &&
getDolGlobalString(
'MULTICOMPANY_TRANSVERSE_MODE')));
1237 $newmenu->add(
"/user/group/list.php?leftmenu=users", $langs->trans(
"ListOfGroups"), 2, ((
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') ? $user->hasRight(
'user',
'group_advance',
'read') : $user->hasRight(
'user',
'user',
'read')) || $user->admin));
1255 global $user,
$conf, $langs;
1257 if ($mainmenu ==
'companies') {
1259 if (isModEnabled(
'societe')) {
1260 $langs->load(
"companies");
1261 $newmenu->add(
"/societe/index.php?leftmenu=thirdparties", $langs->trans(
"ThirdParty"), 0, $user->hasRight(
'societe',
'lire'),
'', $mainmenu,
'thirdparties', 0,
'',
'',
'',
img_picto(
'',
'company',
'class="paddingright pictofixedwidth"'));
1263 if ($user->hasRight(
'societe',
'creer')) {
1264 $newmenu->add(
"/societe/card.php?action=create", $langs->trans(
"MenuNewThirdParty"), 1);
1265 if (!
$conf->use_javascript_ajax) {
1266 $newmenu->add(
"/societe/card.php?action=create&private=1", $langs->trans(
"MenuNewPrivateIndividual"), 1);
1271 $newmenu->add(
"/societe/list.php?leftmenu=thirdparties", $langs->trans(
"List"), 1, $user->hasRight(
'societe',
'lire'),
'', $mainmenu,
'thirdparties_list', 2);
1275 $langs->load(
"commercial");
1276 $newmenu->add(
"/societe/list.php?type=p&leftmenu=prospects", $langs->trans(
"Prospects"), 2, $user->hasRight(
'societe',
'lire'),
'', $mainmenu,
'prospects', 5);
1278 $newmenu->add(
"/societe/card.php?leftmenu=prospects&action=create&type=p", $langs->trans(
"MenuNewProspect"), 3, $user->hasRight(
'societe',
'creer'));
1283 $langs->load(
"commercial");
1284 $newmenu->add(
"/societe/list.php?type=c&leftmenu=customers", $langs->trans(
"Customers"), 2, $user->hasRight(
'societe',
'lire'),
'', $mainmenu,
'customers', 10);
1286 $newmenu->add(
"/societe/card.php?leftmenu=customers&action=create&type=c", $langs->trans(
"MenuNewCustomer"), 3, $user->hasRight(
'societe',
'creer'));
1290 if (isModEnabled(
'societe') && (isModEnabled(
'supplier_order') || isModEnabled(
'supplier_invoice') || isModEnabled(
'supplier_proposal'))) {
1291 $langs->load(
"suppliers");
1292 $newmenu->add(
"/societe/list.php?type=f&leftmenu=suppliers", $langs->trans(
"Suppliers"), 2, ($user->hasRight(
'fournisseur',
'lire') || $user->hasRight(
'supplier_order',
'lire') || $user->hasRight(
'supplier_invoice',
'lire') || $user->hasRight(
'supplier_proposal',
'lire')),
'', $mainmenu,
'suppliers', 15);
1294 $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')));
1298 if (isModEnabled(
'category')) {
1299 $langs->load(
"categories");
1302 $menutoshow = $langs->trans(
"CustomersProspectsCategoriesShort");
1304 $menutoshow = $langs->trans(
"CustomersCategoriesShort");
1307 $menutoshow = $langs->trans(
"ProspectsCategoriesShort");
1309 $newmenu->add(
"/categories/index.php?leftmenu=cat&type=2", $menutoshow, 1, $user->hasRight(
'categorie',
'lire'),
'', $mainmenu,
'cat');
1312 if (isModEnabled(
'supplier_proposal') || isModEnabled(
'supplier_order') || isModEnabled(
'supplier_invoice')) {
1313 $newmenu->add(
"/categories/index.php?leftmenu=catfournish&type=1", $langs->trans(
"SuppliersCategoriesShort"), 1, $user->hasRight(
'categorie',
'lire'));
1318 $newmenu->add(
"/societe/index.php?leftmenu=thirdparties", (
getDolGlobalString(
'SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans(
"Contacts") : $langs->trans(
"ContactsAddresses")), 0, $user->hasRight(
'societe',
'contact',
'lire'),
'', $mainmenu,
'contacts', 0,
'',
'',
'',
img_picto(
'',
'contact',
'class="paddingright pictofixedwidth"'));
1320 $newmenu->add(
"/contact/card.php?leftmenu=contacts&action=create", (
getDolGlobalString(
'SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans(
"NewContact") : $langs->trans(
"NewContactAddress")), 1, $user->hasRight(
'societe',
'contact',
'creer'));
1321 $newmenu->add(
"/contact/list.php?leftmenu=contacts", $langs->trans(
"List"), 1, $user->hasRight(
'societe',
'contact',
'lire'));
1323 $newmenu->add(
"/contact/list.php?leftmenu=contacts&type=p", $langs->trans(
"Prospects"), 2, $user->hasRight(
'societe',
'contact',
'lire'));
1326 $newmenu->add(
"/contact/list.php?leftmenu=contacts&type=c", $langs->trans(
"Customers"), 2, $user->hasRight(
'societe',
'contact',
'lire'));
1328 if (isModEnabled(
'supplier_proposal') || isModEnabled(
'supplier_order') || isModEnabled(
'supplier_invoice')) {
1329 $newmenu->add(
"/contact/list.php?leftmenu=contacts&type=f", $langs->trans(
"Suppliers"), 2, $user->hasRight(
'fournisseur',
'lire'));
1331 $newmenu->add(
"/contact/list.php?leftmenu=contacts&type=o", $langs->trans(
"ContactOthers"), 2, $user->hasRight(
'societe',
'contact',
'lire'));
1335 if (isModEnabled(
'category')) {
1336 $langs->load(
"categories");
1338 $newmenu->add(
"/categories/index.php?leftmenu=catcontact&type=4", $langs->trans(
"ContactCategoriesShort"), 1, $user->hasRight(
'categorie',
'lire'),
'', $mainmenu,
'cat');
1355 global $user, $langs;
1357 if ($mainmenu ==
'commercial') {
1358 $langs->load(
"companies");
1361 if (isModEnabled(
'propal')) {
1362 $langs->load(
"propal");
1363 $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"'));
1364 $newmenu->add(
"/comm/propal/card.php?action=create&leftmenu=propals", $langs->trans(
"NewPropal"), 1, $user->hasRight(
'propal',
'write'));
1365 $newmenu->add(
"/comm/propal/list.php?leftmenu=propals", $langs->trans(
"List"), 1, $user->hasRight(
'propal',
'read'));
1366 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"propals") {
1367 $newmenu->add(
"/comm/propal/list.php?leftmenu=propals&search_status=0", $langs->trans(
"PropalsDraft"), 2, $user->hasRight(
'propal',
'read'));
1368 $newmenu->add(
"/comm/propal/list.php?leftmenu=propals&search_status=1", $langs->trans(
"PropalsOpened"), 2, $user->hasRight(
'propal',
'read'));
1369 $newmenu->add(
"/comm/propal/list.php?leftmenu=propals&search_status=2", $langs->trans(
"PropalStatusSigned"), 2, $user->hasRight(
'propal',
'read'));
1370 $newmenu->add(
"/comm/propal/list.php?leftmenu=propals&search_status=3", $langs->trans(
"PropalStatusNotSigned"), 2, $user->hasRight(
'propal',
'read'));
1371 $newmenu->add(
"/comm/propal/list.php?leftmenu=propals&search_status=4", $langs->trans(
"PropalStatusBilled"), 2, $user->hasRight(
'propal',
'read'));
1374 $newmenu->add(
"/comm/propal/stats/index.php?leftmenu=propals", $langs->trans(
"Statistics"), 1, $user->hasRight(
'propal',
'read'));
1378 if (isModEnabled(
'order')) {
1379 $langs->load(
"orders");
1380 $newmenu->add(
"/commande/index.php?leftmenu=orders", $langs->trans(
"CustomersOrders"), 0, $user->hasRight(
'commande',
'lire'),
'', $mainmenu,
'orders', 200,
'',
'',
'',
img_picto(
'',
'order',
'class="paddingright pictofixedwidth"'));
1381 $newmenu->add(
"/commande/card.php?action=create&leftmenu=orders", $langs->trans(
"NewOrder"), 1, $user->hasRight(
'commande',
'creer'));
1382 $newmenu->add(
"/commande/list.php?leftmenu=orders", $langs->trans(
"List"), 1, $user->hasRight(
'commande',
'lire'));
1383 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"orders") {
1384 $newmenu->add(
"/commande/list.php?leftmenu=orders&search_status=0", $langs->trans(
"StatusOrderDraftShort"), 2, $user->hasRight(
'commande',
'lire'));
1385 $newmenu->add(
"/commande/list.php?leftmenu=orders&search_status=1", $langs->trans(
"StatusOrderValidated"), 2, $user->hasRight(
'commande',
'lire'));
1386 if (isModEnabled(
'shipping')) {
1387 $newmenu->add(
"/commande/list.php?leftmenu=orders&search_status=2", $langs->trans(
"StatusOrderSentShort"), 2, $user->hasRight(
'commande',
'lire'));
1389 $newmenu->add(
"/commande/list.php?leftmenu=orders&search_status=3", $langs->trans(
"StatusOrderDelivered"), 2, $user->hasRight(
'commande',
'lire'));
1391 $newmenu->add(
"/commande/list.php?leftmenu=orders&search_status=-1", $langs->trans(
"StatusOrderCanceledShort"), 2, $user->hasRight(
'commande',
'lire'));
1393 if (empty($user->socid)) {
1394 $newmenu->add(
"/commande/list_det.php?leftmenu=orders", $langs->trans(
"ListOrderLigne"), 1, $user->hasRight(
'commande',
'lire'));
1396 if (
getDolGlobalInt(
'MAIN_NEED_EXPORT_PERMISSION_TO_READ_STATISTICS')) {
1397 $newmenu->add(
"/commande/stats/index.php?leftmenu=orders", $langs->trans(
"Statistics"), 1, $user->hasRight(
'commande',
'commande',
'export'));
1399 $newmenu->add(
"/commande/stats/index.php?leftmenu=orders", $langs->trans(
"Statistics"), 1, $user->hasRight(
'commande',
'lire'));
1404 if (isModEnabled(
'supplier_proposal')) {
1405 $langs->load(
"supplier_proposal");
1406 $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"'));
1407 $newmenu->add(
"/supplier_proposal/card.php?action=create&leftmenu=supplier_proposals", $langs->trans(
"SupplierProposalNew"), 1, $user->hasRight(
'supplier_proposal',
'creer'));
1408 $newmenu->add(
"/supplier_proposal/list.php?leftmenu=supplier_proposals", $langs->trans(
"List"), 1, $user->hasRight(
'supplier_proposal',
'lire'));
1409 $newmenu->add(
"/comm/propal/stats/index.php?leftmenu=supplier_proposals&mode=supplier", $langs->trans(
"Statistics"), 1, $user->hasRight(
'supplier_proposal',
'lire'));
1413 if (isModEnabled(
'supplier_order')) {
1414 $langs->load(
"orders");
1415 $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"'));
1416 $newmenu->add(
"/fourn/commande/card.php?action=create&leftmenu=orders_suppliers", $langs->trans(
"NewSupplierOrderShort"), 1, $user->hasRight(
'fournisseur',
'commande',
'creer'));
1417 $newmenu->add(
"/fourn/commande/list.php?leftmenu=orders_suppliers", $langs->trans(
"List"), 1, $user->hasRight(
'fournisseur',
'commande',
'lire'));
1419 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"orders_suppliers") {
1420 $newmenu->add(
"/fourn/commande/list.php?leftmenu=orders_suppliers&statut=0", $langs->trans(
"StatusSupplierOrderDraftShort"), 2, $user->hasRight(
'fournisseur',
'commande',
'lire'));
1422 $newmenu->add(
"/fourn/commande/list.php?leftmenu=orders_suppliers&statut=1", $langs->trans(
"StatusSupplierOrderValidated"), 2, $user->hasRight(
'fournisseur',
'commande',
'lire'));
1424 $newmenu->add(
"/fourn/commande/list.php?leftmenu=orders_suppliers&statut=2", $langs->trans(
"StatusSupplierOrderApprovedShort"), 2, $user->hasRight(
'fournisseur',
'commande',
'lire'));
1425 $newmenu->add(
"/fourn/commande/list.php?leftmenu=orders_suppliers&statut=3", $langs->trans(
"StatusSupplierOrderOnProcessShort"), 2, $user->hasRight(
'fournisseur',
'commande',
'lire'));
1426 $newmenu->add(
"/fourn/commande/list.php?leftmenu=orders_suppliers&statut=4", $langs->trans(
"StatusSupplierOrderReceivedPartiallyShort"), 2, $user->hasRight(
'fournisseur',
'commande',
'lire'));
1427 $newmenu->add(
"/fourn/commande/list.php?leftmenu=orders_suppliers&statut=5", $langs->trans(
"StatusSupplierOrderReceivedAll"), 2, $user->hasRight(
'fournisseur',
'commande',
'lire'));
1428 $newmenu->add(
"/fourn/commande/list.php?leftmenu=orders_suppliers&statut=6,7", $langs->trans(
"StatusSupplierOrderCanceled"), 2, $user->hasRight(
'fournisseur',
'commande',
'lire'));
1429 $newmenu->add(
"/fourn/commande/list.php?leftmenu=orders_suppliers&statut=9", $langs->trans(
"StatusSupplierOrderRefused"), 2, $user->hasRight(
'fournisseur',
'commande',
'lire'));
1433 if (
getDolGlobalInt(
'MAIN_NEED_EXPORT_PERMISSION_TO_READ_STATISTICS')) {
1434 $newmenu->add(
"/commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier", $langs->trans(
"Statistics"), 1, $user->hasRight(
'fournisseur',
'commande',
'export'));
1436 $newmenu->add(
"/commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier", $langs->trans(
"Statistics"), 1, $user->hasRight(
'fournisseur',
'commande',
'lire'));
1441 if (isModEnabled(
'contract')) {
1442 $langs->load(
"contracts");
1443 $newmenu->add(
"/contrat/index.php?leftmenu=contracts", $langs->trans(
"ContractsSubscriptions"), 0, $user->hasRight(
'contrat',
'lire'),
'', $mainmenu,
'contracts', 2000,
'',
'',
'',
img_picto(
'',
'contract',
'class="paddingright pictofixedwidth"'));
1444 $newmenu->add(
"/contrat/card.php?action=create&leftmenu=contracts", $langs->trans(
"NewContractSubscription"), 1, $user->hasRight(
'contrat',
'creer'));
1445 $newmenu->add(
"/contrat/list.php?leftmenu=contracts", $langs->trans(
"List"), 1, $user->hasRight(
'contrat',
'lire'));
1446 $newmenu->add(
"/contrat/services_list.php?leftmenu=contracts", $langs->trans(
"MenuServices"), 1, $user->hasRight(
'contrat',
'lire'));
1447 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"contracts") {
1448 $newmenu->add(
"/contrat/services_list.php?leftmenu=contracts&search_status=0", $langs->trans(
"MenuInactiveServices"), 2, $user->hasRight(
'contrat',
'lire'));
1449 $newmenu->add(
"/contrat/services_list.php?leftmenu=contracts&search_status=4", $langs->trans(
"MenuRunningServices"), 2, $user->hasRight(
'contrat',
'lire'));
1450 $newmenu->add(
"/contrat/services_list.php?leftmenu=contracts&search_status=4%26filter=expired", $langs->trans(
"MenuExpiredServices"), 2, $user->hasRight(
'contrat',
'lire'));
1451 $newmenu->add(
"/contrat/services_list.php?leftmenu=contracts&search_status=5", $langs->trans(
"MenuClosedServices"), 2, $user->hasRight(
'contrat',
'lire'));
1456 if (isModEnabled(
'intervention')) {
1457 $langs->load(
"interventions");
1458 $newmenu->add(
"/fichinter/index.php?leftmenu=ficheinter", $langs->trans(
"Interventions"), 0, $user->hasRight(
'ficheinter',
'lire'),
'', $mainmenu,
'ficheinter', 2200,
'',
'',
'',
img_picto(
'',
'intervention',
'class="paddingright pictofixedwidth"'));
1459 $newmenu->add(
"/fichinter/card.php?action=create&leftmenu=ficheinter", $langs->trans(
"NewIntervention"), 1, $user->hasRight(
'ficheinter',
'creer'),
'',
'',
'', 201);
1460 $newmenu->add(
"/fichinter/list.php?leftmenu=ficheinter", $langs->trans(
"List"), 1, $user->hasRight(
'ficheinter',
'lire'),
'',
'',
'', 202);
1462 $newmenu->add(
"/fichinter/card-rec.php?leftmenu=ficheinter", $langs->trans(
"ListOfTemplates"), 1, $user->hasRight(
'ficheinter',
'lire'),
'',
'',
'', 203);
1464 $newmenu->add(
"/fichinter/stats/index.php?leftmenu=ficheinter", $langs->trans(
"Statistics"), 1, $user->hasRight(
'ficheinter',
'lire'));
1481 global $user,
$conf, $langs;
1483 if ($mainmenu ==
'billing') {
1484 $langs->load(
"companies");
1487 if (isModEnabled(
'invoice')) {
1488 $langs->load(
"bills");
1489 $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"'));
1490 $newmenu->add(
"/compta/facture/card.php?action=create", $langs->trans(
"NewBill"), 1, $user->hasRight(
'facture',
'creer'));
1491 $newmenu->add(
"/compta/facture/list.php?leftmenu=customers_bills", $langs->trans(
"List"), 1, $user->hasRight(
'facture',
'lire'),
'', $mainmenu,
'customers_bills_list');
1493 if ($usemenuhider || empty($leftmenu) || preg_match(
'/customers_bills(|_draft|_notpaid|_paid|_canceled)$/', $leftmenu)) {
1494 $newmenu->add(
"/compta/facture/list.php?leftmenu=customers_bills_draft&search_status=0", $langs->trans(
"BillShortStatusDraft"), 2, $user->hasRight(
'facture',
'lire'));
1495 $newmenu->add(
"/compta/facture/list.php?leftmenu=customers_bills_notpaid&search_status=1", $langs->trans(
"BillShortStatusNotPaid"), 2, $user->hasRight(
'facture',
'lire'));
1496 $newmenu->add(
"/compta/facture/list.php?leftmenu=customers_bills_paid&search_status=2", $langs->trans(
"BillShortStatusPaid"), 2, $user->hasRight(
'facture',
'lire'));
1497 $newmenu->add(
"/compta/facture/list.php?leftmenu=customers_bills_canceled&search_status=3", $langs->trans(
"BillShortStatusCanceled"), 2, $user->hasRight(
'facture',
'lire'));
1499 $newmenu->add(
"/compta/facture/invoicetemplate_list.php?leftmenu=customers_bills_templates", $langs->trans(
"ListOfTemplates"), 1, $user->hasRight(
'facture',
'creer'),
'', $mainmenu,
'customers_bills_templates');
1501 $newmenu->add(
"/compta/paiement/list.php?leftmenu=customers_bills_payment", $langs->trans(
"Payments"), 1, $user->hasRight(
'facture',
'lire'),
'', $mainmenu,
'customers_bills_payment');
1503 if (
getDolGlobalString(
'BILL_ADD_PAYMENT_VALIDATION') && preg_match(
'/customers_bills_payment/', $leftmenu)) {
1504 $newmenu->add(
"/compta/paiement/tovalidate.php?leftmenu=customers_bills_payment_tovalid", $langs->trans(
"MenuToValid"), 2, $user->hasRight(
'facture',
'lire'),
'', $mainmenu,
'customers_bills_payment_tovalid');
1506 if ($usemenuhider || empty($leftmenu) || preg_match(
'/customers_bills_payment/', $leftmenu)) {
1507 $newmenu->add(
"/compta/paiement/rapport.php?leftmenu=customers_bills_payment_report", $langs->trans(
"Reportings"), 2, $user->hasRight(
'facture',
'lire'),
'', $mainmenu,
'customers_bills_payment_report');
1510 $newmenu->add(
"/compta/facture/stats/index.php?leftmenu=customers_bills_stats", $langs->trans(
"Statistics"), 1, $user->hasRight(
'facture',
'lire'),
'', $mainmenu,
'customers_bills_stats');
1514 if (isModEnabled(
'societe') && isModEnabled(
'supplier_invoice') && !
getDolGlobalString(
'SUPPLIER_INVOICE_MENU_DISABLED')) {
1515 $langs->load(
"bills");
1516 $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"'));
1517 $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');
1518 $newmenu->add(
"/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans(
"List"), 1, $user->hasRight(
'fournisseur',
'facture',
'lire'),
'', $mainmenu,
'suppliers_bills_list');
1520 if ($usemenuhider || empty($leftmenu) || preg_match(
'/suppliers_bills/', $leftmenu)) {
1521 $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');
1522 $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');
1523 $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');
1526 $newmenu->add(
"/fourn/facture/list-rec.php?leftmenu=supplierinvoicestemplate_list", $langs->trans(
"ListOfTemplates"), 1, $user->hasRight(
'fournisseur',
'facture',
'lire'),
'', $mainmenu,
'supplierinvoicestemplate_list');
1528 $newmenu->add(
"/fourn/paiement/list.php?leftmenu=suppliers_bills_payment", $langs->trans(
"Payments"), 1, $user->hasRight(
'fournisseur',
'facture',
'lire'),
'', $mainmenu,
'suppliers_bills_payment');
1530 if ($usemenuhider || empty($leftmenu) || preg_match(
'/suppliers_bills/', $leftmenu)) {
1531 $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');
1534 $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');
1538 if (isModEnabled(
'order')) {
1539 $langs->load(
"orders");
1540 if (isModEnabled(
'invoice')) {
1541 $newmenu->add(
"/commande/list.php?leftmenu=orders&search_status=-3&search_billed=0&contextpage=billableorders", $langs->trans(
"MenuOrdersToBill2"), 0, $user->hasRight(
'commande',
'lire'),
'', $mainmenu,
'orders', 0,
'',
'',
'',
img_picto(
'',
'order',
'class="paddingright pictofixedwidth"'));
1547 if (isModEnabled(
'supplier_invoice')) {
1549 $langs->load(
"supplier");
1550 $newmenu->add(
"/fourn/commande/list.php?leftmenu=orders&search_status=5&search_billed=0", $langs->trans(
"MenuOrdersSupplierToBill"), 0, $user->hasRight(
'commande',
'lire'),
'', $mainmenu,
'orders', 0,
'',
'',
'',
img_picto(
'',
'supplier_order',
'class="paddingright pictofixedwidth"'));
1557 if (isModEnabled(
'don')) {
1558 $langs->load(
"donations");
1559 $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"'));
1560 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"donations") {
1561 $newmenu->add(
"/don/card.php?leftmenu=donations&action=create", $langs->trans(
"NewDonation"), 1, $user->hasRight(
'don',
'creer'));
1562 $newmenu->add(
"/don/list.php?leftmenu=donations", $langs->trans(
"List"), 1, $user->hasRight(
'don',
'lire'));
1563 $newmenu->add(
"/don/paiement/list.php?leftmenu=donations", $langs->trans(
"Payments"), 1, $user->hasRight(
'don',
'lire'));
1564 $newmenu->add(
"/don/stats/index.php", $langs->trans(
"Statistics"), 1, $user->hasRight(
'don',
'lire'));
1570 if (isModEnabled(
'tax')) {
1571 $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"'));
1573 $newmenu->add(
"/compta/sociales/list.php?leftmenu=tax_social", $langs->trans(
"MenuSocialContributions"), 1, $user->hasRight(
'tax',
'charges',
'lire'));
1574 if ($usemenuhider || empty($leftmenu) || preg_match(
'/^tax_social/i', $leftmenu)) {
1575 $newmenu->add(
"/compta/sociales/card.php?leftmenu=tax_social&action=create", $langs->trans(
"MenuNewSocialContribution"), 2, $user->hasRight(
'tax',
'charges',
'creer'));
1576 $newmenu->add(
"/compta/sociales/list.php?leftmenu=tax_social", $langs->trans(
"List"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1577 $newmenu->add(
"/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=billing", $langs->trans(
"Payments"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1583 $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');
1584 if ($usemenuhider || empty($leftmenu) || preg_match(
'/^tax_vat/i', $leftmenu)) {
1585 $newmenu->add(
"/compta/tva/card.php?leftmenu=tax_vat&action=create", $langs->trans(
"New"), 2, $user->hasRight(
'tax',
'charges',
'creer'));
1586 $newmenu->add(
"/compta/tva/list.php?leftmenu=tax_vat", $langs->trans(
"List"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1587 $newmenu->add(
"/compta/tva/payments.php?mode=tvaonly&leftmenu=tax_vat", $langs->trans(
"Payments"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1588 $newmenu->add(
"/compta/tva/index.php?leftmenu=tax_vat", $langs->trans(
"ReportByMonth"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1589 $newmenu->add(
"/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans(
"ReportByThirdparties"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1590 $newmenu->add(
"/compta/tva/quadri_detail.php?leftmenu=tax_vat", $langs->trans(
"ReportByQuarter"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1594 if ($mysoc->useLocalTax(1) && (isset($mysoc->localtax1_assuj) && $mysoc->localtax1_assuj ==
"1")) {
1595 $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'));
1596 if ($usemenuhider || empty($leftmenu) || preg_match(
'/^tax_1_vat/i', $leftmenu)) {
1597 $newmenu->add(
"/compta/localtax/card.php?leftmenu=tax_1_vat&action=create&localTaxType=1", $langs->trans(
"New"), 2, $user->hasRight(
'tax',
'charges',
'creer'));
1598 $newmenu->add(
"/compta/localtax/list.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans(
"List"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1599 $newmenu->add(
"/compta/localtax/index.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans(
"ReportByMonth"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1600 $newmenu->add(
"/compta/localtax/clients.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans(
"ReportByThirdparties"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1601 $newmenu->add(
"/compta/localtax/quadri_detail.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans(
"ReportByQuarter"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1605 if ($mysoc->useLocalTax(2) && (isset($mysoc->localtax2_assuj) && $mysoc->localtax2_assuj ==
"1")) {
1606 $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'));
1607 if ($usemenuhider || empty($leftmenu) || preg_match(
'/^tax_2_vat/i', $leftmenu)) {
1608 $newmenu->add(
"/compta/localtax/card.php?leftmenu=tax_2_vat&action=create&localTaxType=2", $langs->trans(
"New"), 2, $user->hasRight(
'tax',
'charges',
'creer'));
1609 $newmenu->add(
"/compta/localtax/list.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans(
"List"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1610 $newmenu->add(
"/compta/localtax/index.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans(
"ReportByMonth"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1611 $newmenu->add(
"/compta/localtax/clients.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans(
"ReportByThirdparties"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1612 $newmenu->add(
"/compta/localtax/quadri_detail.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans(
"ReportByQuarter"), 2, $user->hasRight(
'tax',
'charges',
'lire'));
1619 if (isModEnabled(
'salaries')) {
1620 $langs->load(
"salaries");
1621 $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"'));
1622 if ($usemenuhider || empty($leftmenu) || preg_match(
'/^tax_salary/i', $leftmenu)) {
1623 $newmenu->add(
"/salaries/card.php?leftmenu=tax_salary&action=create", $langs->trans(
"New"), 1, $user->hasRight(
'salaries',
'write'));
1624 $newmenu->add(
"/salaries/list.php?leftmenu=tax_salary", $langs->trans(
"List"), 1, $user->hasRight(
'salaries',
'read'));
1625 $newmenu->add(
"/salaries/payments.php?leftmenu=tax_salary", $langs->trans(
"Payments"), 1, $user->hasRight(
'salaries',
'read'));
1626 $newmenu->add(
"/salaries/stats/index.php?leftmenu=tax_salary", $langs->trans(
"Statistics"), 1, $user->hasRight(
'salaries',
'read'));
1631 if (isModEnabled(
'loan')) {
1632 $langs->load(
"loan");
1633 $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"'));
1634 if ($usemenuhider || empty($leftmenu) || preg_match(
'/^tax_loan/i', $leftmenu)) {
1635 $newmenu->add(
"/loan/card.php?leftmenu=tax_loan&action=create", $langs->trans(
"NewLoan"), 1, $user->hasRight(
'loan',
'write'));
1642 $langs->load(
"banks");
1643 $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"'));
1644 if ($usemenuhider || empty($leftmenu) || preg_match(
'/^tax_various/i', $leftmenu)) {
1645 $newmenu->add(
"/compta/bank/various_payment/card.php?leftmenu=tax_various&action=create", $langs->trans(
"New"), 1, $user->hasRight(
'banque',
'modifier'));
1646 $newmenu->add(
"/compta/bank/various_payment/list.php?leftmenu=tax_various", $langs->trans(
"List"), 1, $user->hasRight(
'banque',
'lire'));
1664 global $user,
$conf, $langs;
1667 if ($mainmenu ==
'accountancy') {
1668 $langs->load(
"companies");
1671 if (isModEnabled(
'accounting')) {
1676 $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"'));
1677 if ($usemenuhider || empty($leftmenu) || preg_match(
'/accountancy_admin/', $leftmenu)) {
1679 $newmenu->add(
"/accountancy/admin/index.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans(
"General"), 1, $user->hasRight(
'accounting',
'chartofaccount'),
'', $mainmenu,
'accountancy_admin_general', 10);
1681 $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);
1682 $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);
1683 $newmenu->add(
"/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans(
"Chartofaccounts"), 1, $user->hasRight(
'accounting',
'chartofaccount'),
'', $mainmenu,
'accountancy_admin_chart', 41);
1684 $newmenu->add(
"/accountancy/admin/subaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans(
"ChartOfSubaccounts"), 1, $user->hasRight(
'accounting',
'chartofaccount'),
'', $mainmenu,
'accountancy_admin_chart', 41);
1687 $newmenu->add(
"/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans(
"FiscalPeriod"), 1, $user->hasRight(
'accounting',
'fiscalyear',
'write'),
'', $mainmenu,
'fiscalyear', 45);
1689 $newmenu->add(
"/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans(
"MenuDefaultAccounts"), 1, $user->hasRight(
'accounting',
'chartofaccount'),
'', $mainmenu,
'accountancy_admin_default', 60);
1690 if (isModEnabled(
'bank')) {
1691 $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);
1693 if (isModEnabled(
'invoice') || isModEnabled(
'supplier_invoice')) {
1694 $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);
1696 if (isModEnabled(
'tax')) {
1697 $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);
1699 if (isModEnabled(
'expensereport')) {
1700 $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);
1702 $newmenu->add(
"/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans(
"MenuProductsAccounts"), 1, $user->hasRight(
'accounting',
'chartofaccount'),
'', $mainmenu,
'accountancy_admin_product', 110);
1703 $newmenu->add(
"/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans(
"MenuClosureAccounts"), 1, $user->hasRight(
'accounting',
'chartofaccount'),
'', $mainmenu,
'accountancy_admin_closure', 120);
1705 $newmenu->add(
"/accountancy/admin/report_list.php?id=32&search_country_id=" . $mysoc->country_id .
"&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans(
"AccountingReport"), 1, $user->hasRight(
'accounting',
'chartofaccount'),
'', $mainmenu,
'accountancy_admin_report', 125);
1707 $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', 130);
1711 $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"'));
1715 if (isModEnabled(
'invoice') && !
getDolGlobalString(
'ACCOUNTING_DISABLE_BINDING_ON_SALES')) {
1716 $newmenu->add(
"/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy", $langs->trans(
"CustomersVentilation"), 1, $user->hasRight(
'accounting',
'bind',
'write'),
'', $mainmenu,
'dispatch_customer');
1717 if ($usemenuhider || empty($leftmenu) || preg_match(
'/accountancy_dispatch_customer/', $leftmenu)) {
1718 $newmenu->add(
"/accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans(
"ToBind"), 2, $user->hasRight(
'accounting',
'bind',
'write'));
1719 $newmenu->add(
"/accountancy/customer/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans(
"Binded"), 2, $user->hasRight(
'accounting',
'bind',
'write'));
1722 if (isModEnabled(
'supplier_invoice') && !
getDolGlobalString(
'ACCOUNTING_DISABLE_BINDING_ON_PURCHASES')) {
1723 $newmenu->add(
"/accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy", $langs->trans(
"SuppliersVentilation"), 1, $user->hasRight(
'accounting',
'bind',
'write'),
'', $mainmenu,
'dispatch_supplier');
1724 if ($usemenuhider || empty($leftmenu) || preg_match(
'/accountancy_dispatch_supplier/', $leftmenu)) {
1725 $newmenu->add(
"/accountancy/supplier/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans(
"ToBind"), 2, $user->hasRight(
'accounting',
'bind',
'write'));
1726 $newmenu->add(
"/accountancy/supplier/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans(
"Binded"), 2, $user->hasRight(
'accounting',
'bind',
'write'));
1729 if (isModEnabled(
'expensereport') && !
getDolGlobalString(
'ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS')) {
1730 $newmenu->add(
"/accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport&mainmenu=accountancy", $langs->trans(
"ExpenseReportsVentilation"), 1, $user->hasRight(
'accounting',
'bind',
'write'),
'', $mainmenu,
'dispatch_expensereport');
1731 if ($usemenuhider || empty($leftmenu) || preg_match(
'/accountancy_dispatch_expensereport/', $leftmenu)) {
1732 $newmenu->add(
"/accountancy/expensereport/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", $langs->trans(
"ToBind"), 2, $user->hasRight(
'accounting',
'bind',
'write'));
1733 $newmenu->add(
"/accountancy/expensereport/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", $langs->trans(
"Binded"), 2, $user->hasRight(
'accounting',
'bind',
'write'));
1738 if (isModEnabled(
'accounting') && $user->hasRight(
'accounting',
'comptarapport',
'lire') && $mainmenu ==
'accountancy') {
1739 $newmenu->add(
'', $langs->trans(
"RegistrationInAccounting"), 1, $user->hasRight(
'accounting',
'comptarapport',
'lire'),
'', $mainmenu,
'accountancy_journal');
1742 $sql =
"SELECT rowid, code, label, nature";
1743 $sql .=
" FROM ".MAIN_DB_PREFIX.
"accounting_journal";
1744 $sql .=
" WHERE entity = ".((int)
$conf->entity);
1745 $sql .=
" AND active = 1";
1746 $sql .=
" ORDER BY nature ASC, label DESC";
1748 $resql = $db->query($sql);
1750 $numr = $db->num_rows($resql);
1754 while ($i < $numr) {
1755 $objp = $db->fetch_object($resql);
1760 if ($objp->nature == 2 && isModEnabled(
'invoice') && !
getDolGlobalString(
'ACCOUNTING_DISABLE_BINDING_ON_SALES')) {
1763 if ($objp->nature == 3
1764 && isModEnabled(
'supplier_invoice')
1766 $nature =
"purchases";
1768 if ($objp->nature == 4 && isModEnabled(
'bank')) {
1771 if ($objp->nature == 5 && isModEnabled(
'expensereport') && !
getDolGlobalString(
'ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS')) {
1772 $nature =
"expensereports";
1774 if ($objp->nature == 1 && isModEnabled(
'asset')) {
1775 $nature =
"various";
1777 if ($objp->nature == 8) {
1778 $nature =
"inventory";
1780 if ($objp->nature == 9) {
1786 if ($nature ==
'hasnew' || $nature ==
'inventory') {
1792 $langs->load(
'accountancy');
1794 $journallabelwithoutspan =
'';
1796 $journallabelwithoutspan = $langs->trans($objp->label);
1797 $journallabel =
'<span class="opacitymedium">('.$langs->trans($objp->label).
')</span>';
1800 $key = $langs->trans(
"AccountingJournalType".$objp->nature);
1801 $transferlabel = (($objp->nature && $key !=
"AccountingJournalType".$objp->nature) ? $key.($journallabelwithoutspan != $key ?
' '.$journallabel :
'') : $journallabel);
1803 $newmenu->add(
'/accountancy/journal/'.$nature.
'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal='.$objp->rowid, $transferlabel, 2, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1809 $newmenu->add(
'', $langs->trans(
"NoJournalDefined"), 2, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1819 $newmenu->add(
"/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans(
"AccountantFiles"), 1, $user->hasRight(
'accounting',
'mouvements',
'lire'));
1824 $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"'));
1827 $newmenu->add(
"/accountancy/bookkeeping/listbyaccount.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans(
"Bookkeeping"), 1, $user->hasRight(
'accounting',
'mouvements',
'lire'));
1830 $newmenu->add(
"/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans(
"Journals"), 1, $user->hasRight(
'accounting',
'mouvements',
'lire'));
1833 $newmenu->add(
"/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans(
"AccountBalance"), 1, $user->hasRight(
'accounting',
'mouvements',
'lire'));
1836 $newmenu->add(
"/accountancy/bookkeeping/export.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans(
"MenuExportAccountancy"), 1, $user->hasRight(
'accounting',
'mouvements',
'lire'));
1839 $newmenu->add(
"/accountancy/closure/index.php?mainmenu=accountancy&leftmenu=accountancy_closure", $langs->trans(
"MenuAccountancyClosure"), 1, $user->hasRight(
'accounting',
'fiscalyear',
'write'),
'', $mainmenu,
'closure');
1842 $newmenu->add(
"/accountancy/index.php?leftmenu=accountancy_report", $langs->trans(
"Reportings"), 1, $user->hasRight(
'accounting',
'comptarapport',
'lire'),
'', $mainmenu,
'ca');
1844 if ($usemenuhider || empty($leftmenu) || preg_match(
'/accountancy_report/', $leftmenu)) {
1845 $newmenu->add(
"/compta/resultat/index.php?leftmenu=accountancy_report", $langs->trans(
"MenuReportInOut"), 2, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1846 $newmenu->add(
"/compta/resultat/clientfourn.php?leftmenu=accountancy_report", $langs->trans(
"ByPredefinedAccountGroups"), 3, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1852 $sql =
"SELECT rowid, code, label";
1853 $sql .=
" FROM ".MAIN_DB_PREFIX.
"c_accounting_report";
1854 $sql .=
" WHERE entity = ".((int)
$conf->entity);
1855 $sql .=
" AND fk_country = ".((int) $mysoc->country_id);
1856 $sql .=
" AND active = 1";
1857 $sql .=
" ORDER BY label DESC";
1859 $resql = $db->query($sql);
1861 $numr = $db->num_rows($resql);
1865 while ($i < $numr) {
1866 $objp = $db->fetch_object($resql);
1867 $newmenu->add(
'/compta/resultat/result.php?mainmenu=accountancy&leftmenu=accountancy_report&id_report='.$objp->rowid, $langs->trans(
"Personalized") .
" - " . $objp->label, 3, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1872 $newmenu->add(
'', $langs->trans(
"NoReportDefined"), 3, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1879 $newmenu->add(
"/compta/resultat/result.php?leftmenu=accountancy_report", $langs->trans(
"ByPersonalizedAccountGroups"), 3, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1883 $modecompta =
'CREANCES-DETTES';
1884 if (isModEnabled(
'accounting') && $user->hasRight(
'accounting',
'comptarapport',
'lire') && $mainmenu ==
'accountancy') {
1885 $modecompta =
'BOOKKEEPING';
1888 if ($usemenuhider || empty($leftmenu) || preg_match(
'/accountancy_report/', $leftmenu)) {
1889 $newmenu->add(
"/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ReportTurnover"), 2, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1890 $newmenu->add(
"/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ByCompanies"), 3, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1891 $newmenu->add(
"/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ByUsers"), 3, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1892 $newmenu->add(
"/compta/stats/cabyprodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ByProductsAndServices"), 3, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1893 $newmenu->add(
"/compta/stats/byratecountry.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ByVatRate"), 3, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1897 $modecompta =
'RECETTES-DEPENSES';
1900 if ($usemenuhider || empty($leftmenu) || preg_match(
'/accountancy_report/', $leftmenu)) {
1901 $newmenu->add(
"/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ReportTurnoverCollected"), 2, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1902 $newmenu->add(
"/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ByCompanies"), 3, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1903 $newmenu->add(
"/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ByUsers"), 3, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1909 $modecompta =
'CREANCES-DETTES';
1910 if (isModEnabled(
'accounting') && $user->hasRight(
'accounting',
'comptarapport',
'lire') && $mainmenu ==
'accountancy') {
1911 $modecompta =
'BOOKKEEPING';
1913 if ($modecompta && isModEnabled(
'supplier_invoice')) {
1914 if ($usemenuhider || empty($leftmenu) || preg_match(
'/accountancy_report/', $leftmenu)) {
1915 $newmenu->add(
"/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ReportPurchaseTurnover"), 2, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1916 $newmenu->add(
"/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ByCompanies"), 3, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1917 $newmenu->add(
"/compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ByProductsAndServices"), 3, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1921 $modecompta =
'RECETTES-DEPENSES';
1922 if (isModEnabled(
'accounting') && $user->hasRight(
'accounting',
'comptarapport',
'lire') && $mainmenu ==
'accountancy') {
1923 $modecompta =
'BOOKKEEPINGCOLLECTED';
1925 if ($modecompta && ((isModEnabled(
'fournisseur') && !
getDolGlobalString(
'MAIN_USE_NEW_SUPPLIERMOD')) || isModEnabled(
'supplier_invoice'))) {
1926 if ($usemenuhider || empty($leftmenu) || preg_match(
'/accountancy_report/', $leftmenu)) {
1927 $newmenu->add(
"/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ReportPurchaseTurnoverCollected"), 2, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1928 $newmenu->add(
"/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ByCompanies"), 3, $user->hasRight(
'accounting',
'comptarapport',
'lire'));
1934 if (isModEnabled(
'comptabilite')) {
1937 $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"'));
1941 $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"'));
1943 if ($usemenuhider || empty($leftmenu) || preg_match(
'/report/', $leftmenu)) {
1944 $newmenu->add(
"/compta/resultat/index.php?leftmenu=report", $langs->trans(
"MenuReportInOut"), 1, $user->hasRight(
'compta',
'resultat',
'lire'));
1945 $newmenu->add(
"/compta/resultat/clientfourn.php?leftmenu=report", $langs->trans(
"ByPredefinedAccountGroups"), 2, $user->hasRight(
'compta',
'resultat',
'lire'));
1959 $modecompta =
'CREANCES-DETTES';
1960 $newmenu->add(
"/compta/stats/index.php?leftmenu=report&modecompta=".$modecompta, $langs->trans(
"ReportTurnover"), 1, $user->hasRight(
'compta',
'resultat',
'lire'));
1961 $newmenu->add(
"/compta/stats/casoc.php?leftmenu=report&modecompta=".$modecompta, $langs->trans(
"ByCompanies"), 2, $user->hasRight(
'compta',
'resultat',
'lire'));
1962 $newmenu->add(
"/compta/stats/cabyuser.php?leftmenu=report&modecompta=".$modecompta, $langs->trans(
"ByUsers"), 2, $user->hasRight(
'compta',
'resultat',
'lire'));
1963 $newmenu->add(
"/compta/stats/cabyprodserv.php?leftmenu=report&modecompta=".$modecompta, $langs->trans(
"ByProductsAndServices"), 2, $user->hasRight(
'compta',
'resultat',
'lire'));
1964 $newmenu->add(
"/compta/stats/byratecountry.php?leftmenu=report&modecompta=".$modecompta, $langs->trans(
"ByVatRate"), 2, $user->hasRight(
'compta',
'resultat',
'lire'));
1966 $modecompta =
'RECETTES-DEPENSES';
1967 $newmenu->add(
"/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ReportTurnoverCollected"), 1, $user->hasRight(
'compta',
'resultat',
'lire'));
1968 $newmenu->add(
"/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ByCompanies"), 2, $user->hasRight(
'compta',
'resultat',
'lire'));
1969 $newmenu->add(
"/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ByUsers"), 2, $user->hasRight(
'compta',
'resultat',
'lire'));
1972 $modecompta =
'CREANCES-DETTES';
1973 $newmenu->add(
"/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ReportPurchaseTurnover"), 1, $user->hasRight(
'compta',
'resultat',
'lire'));
1974 $newmenu->add(
"/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ByCompanies"), 2, $user->hasRight(
'compta',
'resultat',
'lire'));
1975 $newmenu->add(
"/compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans(
"ByProductsAndServices"), 2, $user->hasRight(
'compta',
'resultat',
'lire'));
1985 $newmenu->add(
"/compta/journal/sellsjournal.php?leftmenu=report", $langs->trans(
"SellsJournal"), 1, $user->hasRight(
'compta',
'resultat',
'lire'),
'',
'',
'', 50);
1986 $newmenu->add(
"/compta/journal/purchasesjournal.php?leftmenu=report", $langs->trans(
"PurchasesJournal"), 1, $user->hasRight(
'compta',
'resultat',
'lire'),
'',
'',
'', 51);
1992 if (isModEnabled(
'intracommreport')) {
1993 $newmenu->add(
"/intracommreport/list.php?leftmenu=intracommreport", $langs->trans(
"MenuIntracommReport"), 0, $user->hasRight(
'intracommreport',
'read'),
'', $mainmenu,
'intracommreport', 60,
'',
'',
'',
img_picto(
'',
'intracommreport',
'class="paddingright pictofixedwidth"'));
1994 if ($usemenuhider || empty($leftmenu) || preg_match(
'/intracommreport/', $leftmenu)) {
1996 $newmenu->add(
"/intracommreport/card.php?action=create&leftmenu=intracommreport", $langs->trans(
"MenuIntracommReportNew"), 1, $user->hasRight(
'intracommreport',
'write'),
'', $mainmenu,
'intracommreport', 1);
1997 $newmenu->add(
"/intracommreport/list.php?leftmenu=intracommreport", $langs->trans(
"MenuIntracommReportList"), 1, $user->hasRight(
'intracommreport',
'read'),
'', $mainmenu,
'intracommreport', 1);
2002 if (isModEnabled(
'asset')) {
2003 $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"'));
2004 $newmenu->add(
"/asset/card.php?leftmenu=asset&action=create", $langs->trans(
"MenuNewAsset"), 1, $user->hasRight(
'asset',
'write'));
2005 $newmenu->add(
"/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans(
"MenuListAssets"), 1, $user->hasRight(
'asset',
'read'));
2006 $newmenu->add(
"/asset/model/list.php?leftmenu=asset_model", $langs->trans(
"MenuAssetModels"), 1, (!
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
'asset',
'read')) || (
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
'asset',
'model_advance',
'read')),
'', $mainmenu,
'asset_model');
2007 if ($usemenuhider || empty($leftmenu) || preg_match(
'/asset_model/', $leftmenu)) {
2008 $newmenu->add(
"/asset/model/card.php?leftmenu=asset_model&action=create", $langs->trans(
"MenuNewAssetModel"), 2, (!
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
'asset',
'write')) || (
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
'asset',
'model_advance',
'write')));
2009 $newmenu->add(
"/asset/model/list.php?leftmenu=asset_model", $langs->trans(
"MenuListAssetModels"), 2, (!
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
'asset',
'read')) || (
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
'asset',
'model_advance',
'read')));
2027 global $user,
$conf, $langs;
2029 if ($mainmenu ==
'bank') {
2031 $langs->loadLangs(array(
"withdrawals",
"banks",
"bills",
"categories"));
2034 if (isModEnabled(
'bank')) {
2035 $newmenu->add(
"/compta/bank/list.php?leftmenu=bank&mainmenu=bank&search_status=opened", $langs->trans(
"MenuBankCash"), 0, $user->hasRight(
'banque',
'lire'),
'', $mainmenu,
'bank', 0,
'',
'',
'',
img_picto(
'',
'bank_account',
'class="paddingright pictofixedwidth"'));
2037 $newmenu->add(
"/compta/bank/card.php?action=create", $langs->trans(
"MenuNewFinancialAccount"), 1, $user->hasRight(
'banque',
'configurer'));
2038 $newmenu->add(
"/compta/bank/list.php?leftmenu=bank&mainmenu=bank&search_status=opened", $langs->trans(
"List"), 1, $user->hasRight(
'banque',
'lire'),
'', $mainmenu,
'bank');
2039 $newmenu->add(
"/compta/bank/bankentries_list.php", $langs->trans(
"ListTransactions"), 1, $user->hasRight(
'banque',
'lire'));
2040 $newmenu->add(
"/compta/bank/budget.php", $langs->trans(
"ListTransactionsByCategory"), 1, $user->hasRight(
'banque',
'lire'));
2042 $newmenu->add(
"/compta/bank/transfer.php", $langs->trans(
"MenuBankInternalTransfer"), 1, $user->hasRight(
'banque',
'transfer'));
2045 if (isModEnabled(
'category')) {
2046 $langs->load(
"categories");
2047 $newmenu->add(
"/categories/index.php?type=5", $langs->trans(
"Rubriques"), 1, $user->hasRight(
'categorie',
'creer'),
'', $mainmenu,
'tags');
2048 $newmenu->add(
"/categories/index.php?type=8", $langs->trans(
"RubriquesTransactions"), 1, $user->hasRight(
'banque',
'configurer'),
'', $mainmenu,
'tags');
2052 if (isModEnabled(
'prelevement')) {
2053 $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"'));
2055 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"withdraw") {
2056 $newmenu->add(
"/compta/prelevement/create.php?mainmenu=bank", $langs->trans(
"NewStandingOrder"), 1, $user->hasRight(
'prelevement',
'bons',
'creer'));
2058 $newmenu->add(
"/compta/prelevement/orders_list.php?mainmenu=bank", $langs->trans(
"List"), 1, $user->hasRight(
'prelevement',
'bons',
'lire'));
2059 $newmenu->add(
"/compta/prelevement/list.php?mainmenu=bank", $langs->trans(
"WithdrawalsLines"), 1, $user->hasRight(
'prelevement',
'bons',
'lire'));
2060 $newmenu->add(
"/compta/prelevement/rejets.php?mainmenu=bank", $langs->trans(
"Rejects"), 1, $user->hasRight(
'prelevement',
'bons',
'lire'));
2061 $newmenu->add(
"/compta/prelevement/stats.php?mainmenu=bank", $langs->trans(
"Statistics"), 1, $user->hasRight(
'prelevement',
'bons',
'lire'));
2066 if (isModEnabled(
'paymentbybanktransfer')) {
2067 $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"'));
2069 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"banktransfer") {
2070 $newmenu->add(
"/compta/prelevement/create.php?type=bank-transfer&mainmenu=bank", $langs->trans(
"NewPaymentByBankTransfer"), 1, $user->hasRight(
'paymentbybanktransfer',
'create'));
2072 $newmenu->add(
"/compta/prelevement/orders_list.php?type=bank-transfer&mainmenu=bank", $langs->trans(
"List"), 1, $user->hasRight(
'paymentbybanktransfer',
'read'));
2073 $newmenu->add(
"/compta/prelevement/list.php?type=bank-transfer&mainmenu=bank", $langs->trans(
"PaymentByBankTransferLines"), 1, $user->hasRight(
'paymentbybanktransfer',
'read'));
2074 $newmenu->add(
"/compta/prelevement/rejets.php?type=bank-transfer&mainmenu=bank", $langs->trans(
"Rejects"), 1, $user->hasRight(
'paymentbybanktransfer',
'read'));
2075 $newmenu->add(
"/compta/prelevement/stats.php?type=bank-transfer&mainmenu=bank", $langs->trans(
"Statistics"), 1, $user->hasRight(
'paymentbybanktransfer',
'read'));
2081 $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"'));
2082 if (preg_match(
'/checks/', $leftmenu)) {
2083 $newmenu->add(
"/compta/paiement/cheque/card.php?leftmenu=checks_bis&action=new&mainmenu=bank", $langs->trans(
"NewChequeDeposit"), 1, $user->hasRight(
'banque',
'cheque'));
2084 $newmenu->add(
"/compta/paiement/cheque/list.php?leftmenu=checks_bis&mainmenu=bank", $langs->trans(
"List"), 1, $user->hasRight(
'banque',
'cheque'));
2089 if (isModEnabled(
'takepos') || isModEnabled(
'cashdesk')) {
2090 $permtomakecashfence = ($user->hasRight(
'cashdesk',
'run') || $user->hasRight(
'takepos',
'run'));
2091 $newmenu->add(
"/compta/cashcontrol/cashcontrol_list.php", $langs->trans(
"CashControl"), 0, $permtomakecashfence,
'', $mainmenu,
'cashcontrol', 0,
'',
'',
'',
img_picto(
'',
'pos',
'class="paddingright pictofixedwidth"'));
2092 $newmenu->add(
"/compta/cashcontrol/cashcontrol_card.php?action=create", $langs->trans(
"NewCashFence"), 1, $permtomakecashfence);
2093 $newmenu->add(
"/compta/cashcontrol/cashcontrol_list.php", $langs->trans(
"List"), 1, $permtomakecashfence);
2110 global $user,
$conf, $langs;
2112 if ($mainmenu ==
'products') {
2114 if (isModEnabled(
'product')) {
2115 $newmenu->add(
"/product/index.php?leftmenu=product", $langs->trans(
"Products"), 0, $user->hasRight(
'product',
'read'),
'', $mainmenu,
'product', 0,
'',
'',
'',
img_picto(
'',
'product',
'class="paddingright pictofixedwidth"'));
2116 $newmenu->add(
"/product/card.php?leftmenu=product&action=create&type=0", $langs->trans(
"NewProduct"), 1, $user->hasRight(
'product',
'creer'));
2117 $newmenu->add(
"/product/list.php?leftmenu=product&type=0", $langs->trans(
"List"), 1, $user->hasRight(
'product',
'read'));
2118 if (isModEnabled(
'stock')) {
2119 $newmenu->add(
"/product/reassort.php?type=0", $langs->trans(
"MenuStocks"), 1, $user->hasRight(
'product',
'read') && $user->hasRight(
'stock',
'lire'));
2121 if (isModEnabled(
'productbatch')) {
2122 $langs->load(
"stocks");
2123 $newmenu->add(
"/product/reassortlot.php?type=0&search_subjecttolotserial=1", $langs->trans(
"StocksByLotSerial"), 1, $user->hasRight(
'product',
'read') && $user->hasRight(
'stock',
'lire'));
2124 $newmenu->add(
"/product/stock/productlot_list.php", $langs->trans(
"LotSerial"), 1, $user->hasRight(
'product',
'read') && $user->hasRight(
'stock',
'lire'));
2126 if (isModEnabled(
'variants')) {
2127 $newmenu->add(
"/variants/list.php", $langs->trans(
"VariantAttributes"), 1, $user->hasRight(
'product',
'read'));
2129 if (isModEnabled(
'propal') || isModEnabled(
'order') || isModEnabled(
'invoice') || isModEnabled(
'supplier_proposal') || isModEnabled(
'supplier_order') || isModEnabled(
'supplier_invoice')) {
2130 $newmenu->add(
"/product/stats/card.php?id=all&leftmenu=stats&type=0", $langs->trans(
"Statistics"), 1, $user->hasRight(
'product',
'read'));
2134 if (isModEnabled(
'category')) {
2135 $langs->load(
"categories");
2136 $newmenu->add(
"/categories/index.php?leftmenu=cat&type=0", $langs->trans(
"Categories"), 1, $user->hasRight(
'categorie',
'lire'),
'', $mainmenu,
'cat');
2142 if (isModEnabled(
'service')) {
2143 $newmenu->add(
"/product/index.php?leftmenu=service", $langs->trans(
"Services"), 0, $user->hasRight(
'service',
'read'),
'', $mainmenu,
'service', 0,
'',
'',
'',
img_picto(
'',
'service',
'class="paddingright pictofixedwidth"'));
2144 $newmenu->add(
"/product/card.php?leftmenu=service&action=create&type=1", $langs->trans(
"NewService"), 1, $user->hasRight(
'service',
'creer'));
2145 $newmenu->add(
"/product/list.php?leftmenu=service&type=1", $langs->trans(
"List"), 1, $user->hasRight(
'service',
'read'));
2148 $newmenu->add(
"/product/reassort.php?type=1", $langs->trans(
"MenuStocks"), 1, $user->hasRight(
'service',
'read') && $user->hasRight(
'stock',
'lire'));
2150 if (isModEnabled(
'variants')) {
2151 $newmenu->add(
"/variants/list.php", $langs->trans(
"VariantAttributes"), 1, $user->hasRight(
'service',
'read'));
2153 if (isModEnabled(
'propal') || isModEnabled(
'order') || isModEnabled(
'invoice') || isModEnabled(
'supplier_proposal') || isModEnabled(
'supplier_order') || isModEnabled(
'supplier_invoice')) {
2154 $newmenu->add(
"/product/stats/card.php?id=all&leftmenu=stats&type=1", $langs->trans(
"Statistics"), 1, $user->hasRight(
'service',
'read'));
2157 if (isModEnabled(
'category')) {
2158 $langs->load(
"categories");
2159 $newmenu->add(
"/categories/index.php?leftmenu=cat&type=0", $langs->trans(
"Categories"), 1, $user->hasRight(
'categorie',
'lire'),
'', $mainmenu,
'cat');
2165 if (isModEnabled(
'stock')) {
2166 $langs->load(
"stocks");
2167 $newmenu->add(
"/product/index.php?leftmenu=stock", $langs->trans(
"Warehouses"), 0, $user->hasRight(
'stock',
'lire'),
'', $mainmenu,
'stock', 0,
'',
'',
'',
img_picto(
'',
'stock',
'class="paddingright pictofixedwidth"'));
2168 $newmenu->add(
"/product/stock/card.php?action=create", $langs->trans(
"MenuNewWarehouse"), 1, $user->hasRight(
'stock',
'creer'));
2169 $newmenu->add(
"/product/stock/list.php", $langs->trans(
"List"), 1, $user->hasRight(
'stock',
'lire'));
2170 $newmenu->add(
"/product/stock/movement_list.php", $langs->trans(
"Movements"), 1, $user->hasRight(
'stock',
'mouvement',
'lire'));
2172 $newmenu->add(
"/product/stock/massstockmove.php?init=1", $langs->trans(
"MassStockTransferShort"), 1, $user->hasRight(
'stock',
'mouvement',
'creer'));
2173 if (isModEnabled(
'supplier_order')) {
2174 $newmenu->add(
"/product/stock/replenish.php", $langs->trans(
"Replenishment"), 1, $user->hasRight(
'stock',
'mouvement',
'creer') && $user->hasRight(
'fournisseur',
'lire'));
2176 $newmenu->add(
"/product/stock/stockatdate.php", $langs->trans(
"StockAtDate"), 1, $user->hasRight(
'product',
'read') && $user->hasRight(
'stock',
'lire'));
2179 if (isModEnabled(
'category')) {
2180 $newmenu->add(
"/categories/index.php?leftmenu=stock&type=9", $langs->trans(
"Categories"), 1, $user->hasRight(
'categorie',
'lire'),
'', $mainmenu,
'cat');
2184 if (isModEnabled(
'stocktransfer')) {
2185 $newmenu->add(
'/product/stock/stocktransfer/stocktransfer_list.php', $langs->trans(
"ModuleStockTransferName"), 0, $user->hasRight(
'stocktransfer',
'stocktransfer',
'read'),
'', $mainmenu,
'stocktransfer', 0,
'',
'',
'',
img_picto(
'',
'stock',
'class="paddingright pictofixedwidth"'));
2186 $newmenu->add(
'/product/stock/stocktransfer/stocktransfer_card.php?action=create', $langs->trans(
'StockTransferNew'), 1, $user->hasRight(
'stocktransfer',
'stocktransfer',
'write'));
2187 $newmenu->add(
'/product/stock/stocktransfer/stocktransfer_list.php', $langs->trans(
'List'), 1, $user->hasRight(
'stocktransfer',
'stocktransfer',
'read'));
2191 if (isModEnabled(
'stock')) {
2192 $langs->load(
"stocks");
2194 $newmenu->add(
"/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans(
"Inventories"), 0, $user->hasRight(
'stock',
'lire'),
'', $mainmenu,
'stock', 0,
'',
'',
'',
img_picto(
'',
'inventory',
'class="paddingright pictofixedwidth"'));
2195 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"stock_inventories") {
2196 $newmenu->add(
"/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans(
"NewInventory"), 1, $user->hasRight(
'stock',
'creer'));
2197 $newmenu->add(
"/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans(
"List"), 1, $user->hasRight(
'stock',
'lire'));
2200 $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="paddingright pictofixedwidth"'));
2201 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"stock_inventories") {
2202 $newmenu->add(
"/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans(
"NewInventory"), 1, $user->hasRight(
'stock',
'inventory_advance',
'write'));
2203 $newmenu->add(
"/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans(
"List"), 1, $user->hasRight(
'stock',
'inventory_advance',
'read'));
2209 if (isModEnabled(
'shipping')) {
2210 $langs->load(
"sendings");
2211 $newmenu->add(
"/expedition/index.php?leftmenu=sendings", $langs->trans(
"Shipments"), 0, $user->hasRight(
'expedition',
'lire'),
'', $mainmenu,
'sendings', 0,
'',
'',
'',
img_picto(
'',
'shipment',
'class="paddingright pictofixedwidth"'));
2212 $newmenu->add(
"/expedition/card.php?action=create2&leftmenu=sendings", $langs->trans(
"NewSending"), 1, $user->hasRight(
'expedition',
'creer'));
2213 $newmenu->add(
"/expedition/list.php?leftmenu=sendings", $langs->trans(
"List"), 1, $user->hasRight(
'expedition',
'lire'));
2214 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"sendings") {
2215 $newmenu->add(
"/expedition/list.php?leftmenu=sendings&search_status=0", $langs->trans(
"StatusSendingDraftShort"), 2, $user->hasRight(
'expedition',
'lire'));
2216 $newmenu->add(
"/expedition/list.php?leftmenu=sendings&search_status=1", $langs->trans(
"StatusSendingValidatedShort"), 2, $user->hasRight(
'expedition',
'lire'));
2217 $newmenu->add(
"/expedition/list.php?leftmenu=sendings&search_status=2", $langs->trans(
"StatusSendingProcessedShort"), 2, $user->hasRight(
'expedition',
'lire'));
2219 $newmenu->add(
"/expedition/stats/index.php?leftmenu=sendings", $langs->trans(
"Statistics"), 1, $user->hasRight(
'expedition',
'lire'));
2223 if (isModEnabled(
'reception')) {
2224 $langs->load(
"receptions");
2225 $newmenu->add(
"/reception/index.php?leftmenu=receptions", $langs->trans(
"Receptions"), 0, $user->hasRight(
'reception',
'lire'),
'', $mainmenu,
'receptions', 0,
'',
'',
'',
img_picto(
'',
'dollyrevert',
'class="paddingright pictofixedwidth"'));
2226 $newmenu->add(
"/reception/card.php?action=create2&leftmenu=receptions", $langs->trans(
"NewReception"), 1, $user->hasRight(
'reception',
'creer'));
2227 $newmenu->add(
"/reception/list.php?leftmenu=receptions", $langs->trans(
"List"), 1, $user->hasRight(
'reception',
'lire'));
2228 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"receptions") {
2229 $newmenu->add(
"/reception/list.php?leftmenu=receptions&search_status=0", $langs->trans(
"StatusReceptionDraftShort"), 2, $user->hasRight(
'reception',
'lire'));
2231 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"receptions") {
2232 $newmenu->add(
"/reception/list.php?leftmenu=receptions&search_status=1", $langs->trans(
"StatusReceptionValidatedShort"), 2, $user->hasRight(
'reception',
'lire'));
2234 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"receptions") {
2235 $newmenu->add(
"/reception/list.php?leftmenu=receptions&search_status=2", $langs->trans(
"StatusReceptionProcessedShort"), 2, $user->hasRight(
'reception',
'lire'));
2237 $newmenu->add(
"/reception/stats/index.php?leftmenu=receptions", $langs->trans(
"Statistics"), 1, $user->hasRight(
'reception',
'lire'));
2252function get_left_menu_mrp($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu =
'none', $type_user = 0)
2254 global $user,
$conf, $langs;
2256 if ($mainmenu ==
'mrp') {
2258 if (isModEnabled(
'bom') || isModEnabled(
'mrp')) {
2259 $langs->load(
"mrp");
2261 $newmenu->add(
"", $langs->trans(
"MenuBOM"), 0, $user->hasRight(
'bom',
'read'),
'', $mainmenu,
'bom', 0,
'',
'',
'',
img_picto(
'',
'bom',
'class="paddingright pictofixedwidth"'));
2262 $newmenu->add(
"/bom/bom_card.php?leftmenu=bom&action=create", $langs->trans(
"NewBOM"), 1, $user->hasRight(
'bom',
'write'),
'', $mainmenu,
'bom');
2263 $newmenu->add(
"/bom/bom_list.php?leftmenu=bom", $langs->trans(
"List"), 1, $user->hasRight(
'bom',
'read'),
'', $mainmenu,
'bom');
2266 if (isModEnabled(
'mrp')) {
2267 $langs->load(
"mrp");
2269 $newmenu->add(
"", $langs->trans(
"MenuMRP"), 0, $user->hasRight(
'mrp',
'read'),
'', $mainmenu,
'mrp', 0,
'',
'',
'',
img_picto(
'',
'mrp',
'class="paddingright pictofixedwidth"'));
2270 $newmenu->add(
"/mrp/mo_card.php?leftmenu=mo&action=create", $langs->trans(
"NewMO"), 1, $user->hasRight(
'mrp',
'write'),
'', $mainmenu,
'');
2271 $newmenu->add(
"/mrp/mo_list.php?leftmenu=mo", $langs->trans(
"List"), 1, $user->hasRight(
'mrp',
'read'),
'', $mainmenu,
'');
2288 global $user,
$conf, $langs;
2290 if ($mainmenu ==
'project') {
2291 if (isModEnabled(
'project')) {
2292 $langs->load(
"projects");
2294 $search_project_user =
GETPOSTINT(
'search_project_user');
2297 'enabled' => isModEnabled(
'project'),
2298 'perms' => $user->hasRight(
'projet',
'lire'),
2299 'module' =>
'projet'
2301 $listofmodulesforexternal = explode(
',',
getDolGlobalString(
'MAIN_MODULES_FOR_EXTERNAL'));
2304 $titleboth = $langs->trans(
"LeadsOrProjects");
2305 $titlenew = $langs->trans(
"NewLeadOrProject");
2307 $titleboth = $langs->trans(
"Projects");
2308 $titlenew = $langs->trans(
"NewProject");
2311 $titleboth = $langs->trans(
"Leads");
2312 $titlenew = $langs->trans(
"NewLead");
2316 $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"'));
2317 $newmenu->add(
"/projet/card.php?leftmenu=projects&action=create".($search_project_user ?
'&search_project_user='.$search_project_user :
''), $titlenew, 1, $user->hasRight(
'projet',
'creer'));
2320 $newmenu->add(
"/projet/list.php?leftmenu=projects".($search_project_user ?
'&search_project_user='.$search_project_user :
'').
'&search_status=99', $langs->trans(
"List"), 1, $showmode,
'',
'project',
'list');
2322 $newmenu->add(
"/projet/list.php?leftmenu=projects".($search_project_user ?
'&search_project_user='.$search_project_user :
''), $langs->trans(
"List"), 1, $showmode,
'',
'project',
'list');
2323 $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);
2324 $newmenu->add(
'/projet/list.php?mainmenu=project&leftmenu=list&search_opp_status=notopenedopp&search_status=99&contextpage=project', $langs->trans(
"ListOpenProjects"), 2, $showmode);
2326 $newmenu->add(
'/projet/list.php?mainmenu=project&leftmenu=list&search_usage_opportunity=1&search_status=99', $langs->trans(
"List"), 2, $showmode);
2329 $newmenu->add(
"/projet/stats/index.php?leftmenu=projects", $langs->trans(
"Statistics"), 1, $user->hasRight(
'projet',
'lire'));
2332 if (isModEnabled(
'category')) {
2333 $langs->load(
"categories");
2334 $newmenu->add(
"/categories/index.php?leftmenu=cat&type=6", $langs->trans(
"Categories"), 1, $user->hasRight(
'categorie',
'lire'),
'', $mainmenu,
'cat');
2339 $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"'));
2340 $newmenu->add(
"/projet/tasks.php?leftmenu=tasks&action=create", $langs->trans(
"NewTask"), 1, $user->hasRight(
'projet',
'creer'));
2341 $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'));
2342 $newmenu->add(
"/projet/tasks/stats/index.php?leftmenu=projects", $langs->trans(
"Statistics"), 1, $user->hasRight(
'projet',
'lire'));
2344 $newmenu->add(
"/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ?
'&search_project_user='.$search_project_user :
''), $langs->trans(
"TimeEntry"), 0, $user->hasRight(
'projet',
'lire'),
'',
'project',
'timespent', 0,
'',
'',
'',
img_picto(
'',
'timespent',
'class="paddingright pictofixedwidth"'));
2345 $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'));
2361function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu =
'none', $type_user = 0)
2363 global $user,
$conf, $langs;
2365 if ($mainmenu ==
'hrm') {
2367 if (isModEnabled(
'hrm')) {
2368 $langs->load(
"hrm");
2370 $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"'));
2371 $newmenu->add(
"/user/card.php?mainmenu=hrm&leftmenu=hrm&action=create&employee=1", $langs->trans(
"NewEmployee"), 1, $user->hasRight(
'user',
'user',
'write'));
2372 $newmenu->add(
"/user/list.php?mainmenu=hrm&leftmenu=hrm&contextpage=employeelist", $langs->trans(
"List"), 1, $user->hasRight(
'user',
'user',
'read'));
2374 $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"'));
2377 $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"'));
2382 $newmenu->add(
"/hrm/job_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans(
"JobsProfiles"), 1, $user->hasRight(
'hrm',
'all',
'read'),
'', $mainmenu,
'hrm_sm', 0,
'',
'',
'',
img_picto(
'',
'technic',
'class="paddingright pictofixedwidth"'));
2387 $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"'));
2392 $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"'));
2395 $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'));
2399 if (isModEnabled(
'holiday')) {
2401 $langs->loadLangs(array(
"holiday",
"trips"));
2403 $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"'));
2404 $newmenu->add(
"/holiday/card.php?mainmenu=hrm&leftmenu=holiday&action=create", $langs->trans(
"New"), 1, $user->hasRight(
'holiday',
'write'),
'', $mainmenu);
2405 $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');
2406 $newmenu->add(
"/holiday/list.php?mainmenu=hrm&leftmenu=holiday", $langs->trans(
"List"), 1, $user->hasRight(
'holiday',
'read'),
'', $mainmenu);
2407 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"holiday") {
2408 $newmenu->add(
"/holiday/list.php?search_status=1&mainmenu=hrm&leftmenu=holiday", $langs->trans(
"DraftCP"), 2, $user->hasRight(
'holiday',
'read'),
'', $mainmenu,
'holiday_sm');
2409 $newmenu->add(
"/holiday/list.php?search_status=2&mainmenu=hrm&leftmenu=holiday", $langs->trans(
"ToReviewCP"), 2, $user->hasRight(
'holiday',
'read'),
'', $mainmenu,
'holiday_sm');
2410 $newmenu->add(
"/holiday/list.php?search_status=3&mainmenu=hrm&leftmenu=holiday", $langs->trans(
"ApprovedCP"), 2, $user->hasRight(
'holiday',
'read'),
'', $mainmenu,
'holiday_sm');
2411 $newmenu->add(
"/holiday/list.php?search_status=4&mainmenu=hrm&leftmenu=holiday", $langs->trans(
"CancelCP"), 2, $user->hasRight(
'holiday',
'read'),
'', $mainmenu,
'holiday_sm');
2412 $newmenu->add(
"/holiday/list.php?search_status=5&mainmenu=hrm&leftmenu=holiday", $langs->trans(
"RefuseCP"), 2, $user->hasRight(
'holiday',
'read'),
'', $mainmenu,
'holiday_sm');
2414 $newmenu->add(
"/holiday/define_holiday.php?mainmenu=hrm", $langs->trans(
"MenuConfCP"), 1, $user->hasRight(
'holiday',
'read'),
'', $mainmenu,
'holiday_sm');
2415 $newmenu->add(
"/holiday/month_report.php?mainmenu=hrm&leftmenu=holiday", $langs->trans(
"MenuReportMonth"), 1, $user->hasRight(
'holiday',
'readall'),
'', $mainmenu,
'holiday_sm');
2416 $newmenu->add(
"/holiday/view_log.php?mainmenu=hrm&leftmenu=holiday", $langs->trans(
"MenuLogCP"), 1, $user->hasRight(
'holiday',
'define_holiday'),
'', $mainmenu,
'holiday_sm');
2420 if (isModEnabled(
'deplacement')) {
2421 $langs->load(
"trips");
2422 $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"'));
2423 $newmenu->add(
"/compta/deplacement/card.php?action=create&leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans(
"New"), 1, $user->hasRight(
'deplacement',
'creer'));
2424 $newmenu->add(
"/compta/deplacement/list.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans(
"List"), 1, $user->hasRight(
'deplacement',
'lire'));
2425 $newmenu->add(
"/compta/deplacement/stats/index.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans(
"Statistics"), 1, $user->hasRight(
'deplacement',
'lire'));
2429 if (isModEnabled(
'expensereport')) {
2430 $langs->loadLangs(array(
"trips",
"bills"));
2431 $newmenu->add(
"/expensereport/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans(
"TripsAndExpenses"), 0, $user->hasRight(
'expensereport',
'lire'),
'', $mainmenu,
'expensereport', 0,
'',
'',
'',
img_picto(
'',
'expensereport',
'class="paddingright pictofixedwidth"'));
2432 $newmenu->add(
"/expensereport/card.php?action=create&leftmenu=expensereport&mainmenu=hrm", $langs->trans(
"New"), 1, $user->hasRight(
'expensereport',
'creer'));
2433 $newmenu->add(
"/expensereport/list.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans(
"List"), 1, $user->hasRight(
'expensereport',
'lire'));
2434 if ($usemenuhider || empty($leftmenu) || $leftmenu ==
"expensereport") {
2435 $newmenu->add(
"/expensereport/list.php?search_status=0&leftmenu=expensereport&mainmenu=hrm", $langs->trans(
"Draft"), 2, $user->hasRight(
'expensereport',
'lire'));
2436 $newmenu->add(
"/expensereport/list.php?search_status=2&leftmenu=expensereport&mainmenu=hrm", $langs->trans(
"Validated"), 2, $user->hasRight(
'expensereport',
'lire'));
2437 $newmenu->add(
"/expensereport/list.php?search_status=5&leftmenu=expensereport&mainmenu=hrm", $langs->trans(
"Approved"), 2, $user->hasRight(
'expensereport',
'lire'));
2438 $newmenu->add(
"/expensereport/list.php?search_status=6&leftmenu=expensereport&mainmenu=hrm", $langs->trans(
"Paid"), 2, $user->hasRight(
'expensereport',
'lire'));
2439 $newmenu->add(
"/expensereport/list.php?search_status=4&leftmenu=expensereport&mainmenu=hrm", $langs->trans(
"Canceled"), 2, $user->hasRight(
'expensereport',
'lire'));
2440 $newmenu->add(
"/expensereport/list.php?search_status=99&leftmenu=expensereport&mainmenu=hrm", $langs->trans(
"Refused"), 2, $user->hasRight(
'expensereport',
'lire'));
2442 $newmenu->add(
"/expensereport/payment/list.php?leftmenu=expensereport_payments&mainmenu=hrm", $langs->trans(
"Payments"), 1, ($user->hasRight(
'expensereport',
'lire')) && isModEnabled(
'bank'));
2443 $newmenu->add(
"/expensereport/stats/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans(
"Statistics"), 1, $user->hasRight(
'expensereport',
'lire'));
2446 if (isModEnabled(
'project')) {
2448 $langs->load(
"projects");
2450 $search_project_user =
GETPOSTINT(
'search_project_user');
2452 $newmenu->add(
"/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ?
'&search_project_user='.$search_project_user :
''), $langs->trans(
"TimeEntry"), 0, $user->hasRight(
'projet',
'lire'),
'', $mainmenu,
'timespent', 0,
'',
'',
'',
img_picto(
'',
'timespent',
'class="paddingright pictofixedwidth"'));
2471 global $user, $langs;
2473 if ($mainmenu ==
'tools') {
2474 if (empty($user->socid)) {
2475 $langs->load(
"mails");
2476 $newmenu->add(
"/admin/mails_templates.php?leftmenu=email_templates", $langs->trans(
"EMailTemplates"), 0, 1,
'', $mainmenu,
'email_templates', 0,
'',
'',
'',
img_picto(
'',
'email',
'class="paddingright pictofixedwidth"'));
2479 if (isModEnabled(
'mailing')) {
2480 $titleindex = $langs->trans(
"EMailings");
2481 $titlenew = $langs->trans(
"NewMailing");
2482 $titlelist = $langs->trans(
"List");
2484 $titleindex .=
' | '.$langs->trans(
"SMSings");
2485 $titlenew .=
' | '.$langs->trans(
"NewSMSing");
2487 $newmenu->add(
"/comm/mailing/index.php?leftmenu=mailing", $titleindex, 0, $user->hasRight(
'mailing',
'lire'),
'', $mainmenu,
'mailing', 0,
'',
'',
'',
img_picto(
'',
'email',
'class="paddingright pictofixedwidth"'));
2488 $newmenu->add(
"/comm/mailing/card.php?leftmenu=mailing&action=create", $titlenew, 1, $user->hasRight(
'mailing',
'creer'));
2489 $newmenu->add(
"/comm/mailing/list.php?leftmenu=mailing", $titlelist, 1, $user->hasRight(
'mailing',
'lire'));
2492 if (isModEnabled(
'import')) {
2493 $langs->load(
"exports");
2494 $newmenu->add(
"/imports/index.php?leftmenu=import", $langs->trans(
"FormatedImport"), 0, $user->hasRight(
'import',
'run'),
'', $mainmenu,
'import', 0,
'',
'',
'',
img_picto(
'',
'technic',
'class="paddingright pictofixedwidth"'));
2495 $newmenu->add(
"/imports/import.php?leftmenu=import", $langs->trans(
"NewImport"), 1, $user->hasRight(
'import',
'run'));
2498 if (isModEnabled(
'export')) {
2499 $langs->load(
"exports");
2500 $newmenu->add(
"/exports/index.php?leftmenu=export", $langs->trans(
"FormatedExport"), 0, $user->hasRight(
'export',
'lire'),
'', $mainmenu,
'export', 0,
'',
'',
'',
img_picto(
'',
'technic',
'class="paddingright pictofixedwidth"'));
2501 $newmenu->add(
"/exports/export.php?leftmenu=export", $langs->trans(
"NewExport"), 1, $user->hasRight(
'export',
'lire'));
2505 $newmenu->add(
"/core/customreports.php?leftmenu=customreports", $langs->trans(
"CustomReports"), 0, 1,
'', $mainmenu,
'customreports', 0,
'',
'',
'',
img_picto(
'',
'graph',
'class="paddingright pictofixedwidth"'));
2521 global $user,
$conf, $langs;
2523 if ($mainmenu ==
'members') {
2524 if (isModEnabled(
'member')) {
2526 $langs->loadLangs(array(
"members",
"compta"));
2528 $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"'));
2529 $newmenu->add(
"/adherents/card.php?leftmenu=members&action=create", $langs->trans(
"NewMember"), 1, $user->hasRight(
'adherent',
'write'));
2530 $newmenu->add(
"/adherents/list.php?leftmenu=members", $langs->trans(
"List"), 1, $user->hasRight(
'adherent',
'read'));
2531 $newmenu->add(
"/adherents/list.php?leftmenu=members&statut=-1", $langs->trans(
"MenuMembersToValidate"), 2, $user->hasRight(
'adherent',
'read'));
2532 $newmenu->add(
"/adherents/list.php?leftmenu=members&statut=1", $langs->trans(
"MenuMembersValidated"), 2, $user->hasRight(
'adherent',
'read'));
2533 $newmenu->add(
"/adherents/list.php?leftmenu=members&statut=1&filter=waitingsubscription", $langs->trans(
"WaitingSubscription"), 3, $user->hasRight(
'adherent',
'read'));
2534 $newmenu->add(
"/adherents/list.php?leftmenu=members&statut=1&filter=uptodate", $langs->trans(
"UpToDate"), 3, $user->hasRight(
'adherent',
'read'));
2535 $newmenu->add(
"/adherents/list.php?leftmenu=members&statut=1&filter=outofdate", $langs->trans(
"OutOfDate"), 3, $user->hasRight(
'adherent',
'read'));
2536 $newmenu->add(
"/adherents/list.php?leftmenu=members&statut=0", $langs->trans(
"MenuMembersResiliated"), 2, $user->hasRight(
'adherent',
'read'));
2537 $newmenu->add(
"/adherents/list.php?leftmenu=members&statut=-2", $langs->trans(
"MenuMembersExcluded"), 2, $user->hasRight(
'adherent',
'read'));
2538 $newmenu->add(
"/adherents/stats/index.php?leftmenu=members", $langs->trans(
"MenuMembersStats"), 1, $user->hasRight(
'adherent',
'read'));
2540 $newmenu->add(
"/adherents/cartes/carte.php?leftmenu=export", $langs->trans(
"MembersCards"), 1, $user->hasRight(
'adherent',
'export'));
2542 if (isModEnabled(
'category')) {
2543 $langs->load(
"categories");
2544 $newmenu->add(
"/categories/index.php?leftmenu=cat&type=3", $langs->trans(
"Categories"), 1, $user->hasRight(
'categorie',
'read'),
'', $mainmenu,
'cat');
2547 $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"'));
2548 $newmenu->add(
"/adherents/list.php?leftmenu=members&statut=-1,1&mainmenu=members", $langs->trans(
"NewMembership"), 1, $user->hasRight(
'adherent',
'cotisation',
'write'));
2549 $newmenu->add(
"/adherents/subscription/list.php?leftmenu=members", $langs->trans(
"List"), 1, $user->hasRight(
'adherent',
'cotisation',
'read'));
2550 $newmenu->add(
"/adherents/stats/index.php?leftmenu=members", $langs->trans(
"MenuMembersStats"), 1, $user->hasRight(
'adherent',
'read'));
2556 $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"'));
2557 $newmenu->add(
"/adherents/type.php?leftmenu=setup&mainmenu=members&action=create", $langs->trans(
"New"), 1, $user->hasRight(
'adherent',
'configurer'));
2558 $newmenu->add(
"/adherents/type.php?leftmenu=setup&mainmenu=members", $langs->trans(
"List"), 1, $user->hasRight(
'adherent',
'configurer'));
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, $menuval=array())
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.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
make_substitutions($text, $substitutionarray, $outputlangs=null, $converttextinhtmlifnecessary=0)
Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newva...
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.
getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $object=null, $include=null)
Return array of possible common substitutions.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...