2010-10-02 23:31:14 +02:00
< ? php
2024-11-04 16:38:17 +01:00
/* Copyright ( C ) 2010 - 2022 Laurent Destailleur < eldy @ users . sourceforge . net >
* Copyright ( C ) 2010 - 2024 Regis Houssin < regis . houssin @ inodbox . com >
* Copyright ( C ) 2012 - 2015 Juanjo Menent < jmenent @ 2 byte . es >
* Copyright ( C ) 2013 Cédric Salvador < csalvador @ gpcsolutions . fr >
* Copyright ( C ) 2015 Marcos García < marcosgdf @ gmail . com >
* Copyright ( C ) 2018 Ferran Marcet < fmarcet @ 2 byte . es >
* Copyright ( C ) 2018 - 2024 Frédéric France < frederic . france @ free . fr >
* Copyright ( C ) 2021 Gauthier VERDOL < gauthier . verdol @ atm - consulting . fr >
2025-02-04 01:17:07 +01:00
* Copyright ( C ) 2024 - 2025 MDW < mdeweerd @ users . noreply . github . com >
2024-11-04 16:38:17 +01:00
* Copyright ( C ) 2024 Alexandre Spangaro < alexandre @ inovea - conseil . com >
2010-10-02 23:31:14 +02:00
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
2013-01-16 15:36:08 +01:00
* the Free Software Foundation ; either version 3 of the License , or
2010-10-02 23:31:14 +02:00
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
2019-09-23 21:55:30 +02:00
* along with this program . If not , see < https :// www . gnu . org / licenses />.
* or see https :// www . gnu . org /
2010-10-02 23:31:14 +02:00
*/
/**
2011-10-24 14:11:49 +02:00
* \file htdocs / core / menus / standard / eldy . lib . php
2010-10-02 23:31:14 +02:00
* \brief Library for file eldy menus
*/
2013-03-30 14:27:13 +01:00
require_once DOL_DOCUMENT_ROOT . '/core/class/menubase.class.php' ;
2010-10-02 23:31:14 +02:00
/**
* Core function to output top menu eldy
*
2012-02-17 10:04:10 +01:00
* @ param DoliDB $db Database handler
2014-04-23 12:22:01 +02:00
* @ param string $atarget Target ( Example : '' or '_top' )
2012-12-27 17:06:55 +01:00
* @ param int $type_user 0 = Menu for backoffice , 1 = Menu for front office
2024-03-13 15:06:34 +01:00
* @ param 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 } > $tabMenu If array with menu entries already loaded , we put this array here ( in most cases , it ' s empty ) . For eldy menu , it contains menu entries loaded from database .
2016-05-17 19:49:37 +02:00
* @ param Menu $menu Object Menu to return back list of menu entries
2016-05-09 14:59:59 +02:00
* @ param int $noout 1 = Disable output ( Initialise & $menu only ) .
2016-06-12 20:23:25 +02:00
* @ param string $mode 'top' , 'topnb' , 'left' , 'jmobile'
2014-04-25 20:11:38 +02:00
* @ return int 0
2010-10-02 23:31:14 +02:00
*/
2019-01-27 15:20:16 +01:00
function print_eldy_menu ( $db , $atarget , $type_user , & $tabMenu , & $menu , $noout = 0 , $mode = '' )
2010-10-02 23:31:14 +02:00
{
2019-11-13 19:35:02 +01:00
global $user , $conf , $langs , $mysoc ;
2019-09-23 19:21:06 +02:00
global $dolibarr_main_db_name ;
2010-10-02 23:31:14 +02:00
2019-11-13 19:35:02 +01:00
$mainmenu = ( empty ( $_SESSION [ " mainmenu " ]) ? '' : $_SESSION [ " mainmenu " ]);
$leftmenu = ( empty ( $_SESSION [ " leftmenu " ]) ? '' : $_SESSION [ " leftmenu " ]);
2013-02-24 21:16:36 +01:00
2019-11-13 19:35:02 +01:00
$id = 'mainmenu' ;
2023-12-13 15:20:53 +01:00
$listofmodulesforexternal = explode ( ',' , getDolGlobalString ( 'MAIN_MODULES_FOR_EXTERNAL' ));
2010-10-02 23:31:14 +02:00
2019-12-19 13:41:43 +01:00
$substitarray = getCommonSubstitutionArray ( $langs , 0 , null , null );
2010-10-02 23:31:14 +02:00
2020-12-04 18:00:31 +01:00
if ( empty ( $noout )) {
print_start_menu_array ();
}
2010-10-02 23:31:14 +02:00
2022-07-26 16:14:19 +02:00
global $usemenuhider ;
2020-09-07 10:18:17 +02:00
$usemenuhider = 1 ;
2017-06-02 19:28:22 +02:00
2019-09-15 15:15:46 +02:00
// Show/Hide vertical menu. The hamburger icon for .menuhider action.
2023-11-27 11:39:32 +01:00
if ( $mode != 'jmobile' && $mode != 'topnb' && $usemenuhider && ! getDolGlobalString ( 'MAIN_OPTIMIZEFORTEXTBROWSER' )) {
2020-09-07 10:18:17 +02:00
$showmode = 1 ;
2022-05-02 20:10:42 +02:00
$classname = 'class="tmenu menuhider nohover"' ;
2020-09-07 10:18:17 +02:00
$idsel = 'menu' ;
2016-08-29 10:32:00 +02:00
2023-11-17 16:13:46 +01:00
$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>' );
2016-05-09 14:59:59 +02:00
}
2016-08-29 10:32:00 +02:00
2020-09-07 10:18:17 +02:00
$menu_arr = array ();
2019-09-15 15:15:46 +02:00
2010-10-02 23:31:14 +02:00
// Home
2019-01-29 19:44:59 +01:00
$menu_arr [] = array (
'name' => 'Home' ,
'link' => '/index.php?mainmenu=home&leftmenu=home' ,
2021-03-13 18:56:02 +01:00
'title' => " Home " ,
2019-01-29 19:44:59 +01:00
'level' => 0 ,
'enabled' => $showmode = 1 ,
'target' => $atarget ,
'mainmenu' => " home " ,
'leftmenu' => '' ,
'position' => 10 ,
'id' => $id ,
'idsel' => 'home' ,
2023-07-02 16:51:18 +02:00
'classname' => $classname = ( empty ( $_SESSION [ " mainmenu " ]) || $_SESSION [ " mainmenu " ] == " home " ) ? 'class="tmenusel"' : 'class="tmenu"' ,
2023-10-13 15:00:51 +02:00
'prefix' => '<span class="fas fa-home fa-fw"></span>' ,
2021-08-28 18:50:00 +02:00
'session' => (( ! empty ( $_SESSION [ " mainmenu " ]) && $_SESSION [ " mainmenu " ] == " home " ) ? 0 : 1 ),
2019-01-29 19:44:59 +01:00
'loadLangs' => array (),
'submenus' => array (),
);
2010-10-02 23:31:14 +02:00
2018-09-16 12:15:33 +02:00
// Members
2019-04-23 10:38:20 +02:00
$tmpentry = array (
2025-02-04 01:17:07 +01:00
'enabled' => ( int ) isModEnabled ( 'member' ),
'perms' => ( string ) ( int ) $user -> hasRight ( 'adherent' , 'lire' ),
2020-09-07 10:18:17 +02:00
'module' => 'adherent'
2019-04-23 10:38:20 +02:00
);
2019-01-29 19:44:59 +01:00
$menu_arr [] = array (
'name' => 'Members' ,
'link' => '/adherents/index.php?mainmenu=members&leftmenu=' ,
'title' => " MenuMembers " ,
'level' => 0 ,
2025-02-04 01:17:07 +01:00
'enabled' => ( int ) ( $showmode = isVisibleToUserType ( $type_user , $tmpentry , $listofmodulesforexternal )),
2019-01-29 19:44:59 +01:00
'target' => $atarget ,
'mainmenu' => " members " ,
'leftmenu' => '' ,
'position' => 18 ,
'id' => $id ,
'idsel' => 'members' ,
2021-08-29 12:15:09 +02:00
'classname' => $classname = ( ! empty ( $_SESSION [ " mainmenu " ]) && $_SESSION [ " mainmenu " ] == " members " ) ? 'class="tmenusel"' : 'class="tmenu"' ,
2023-10-13 15:00:51 +02:00
'prefix' => img_picto ( '' , 'member' , 'class="fa-fw pictofixedwidth"' ),
2021-08-29 12:15:09 +02:00
'session' => (( ! empty ( $_SESSION [ " mainmenu " ]) && $_SESSION [ " mainmenu " ] == " members " ) ? 0 : 1 ),
2022-09-13 20:14:51 +02:00
'loadLangs' => array ( " members " ),
2019-01-29 19:44:59 +01:00
'submenus' => array (),
);
2010-10-02 23:31:14 +02:00
// Third parties
2019-04-23 10:38:20 +02:00
$tmpentry = array (
2025-02-04 01:17:07 +01:00
'enabled' => ( int ) (
2023-12-04 12:07:53 +01:00
(
2024-03-13 15:06:34 +01:00
isModEnabled ( 'societe' ) &&
2023-11-27 11:39:32 +01:00
( ! getDolGlobalString ( 'SOCIETE_DISABLE_PROSPECTS' ) || ! getDolGlobalString ( 'SOCIETE_DISABLE_CUSTOMERS' ))
2024-03-13 15:06:34 +01:00
)
2023-04-26 01:59:53 +02:00
|| ( isModEnabled ( 'supplier_proposal' ) || isModEnabled ( 'supplier_order' ) || isModEnabled ( 'supplier_invoice' ))
2023-12-04 12:07:53 +01:00
),
2025-02-04 01:17:07 +01:00
'perms' => ( string ) ( int ) ( $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' )),
2024-03-13 15:06:34 +01:00
'module' => 'societe|fournisseur'
2019-04-23 10:38:20 +02:00
);
2024-05-02 21:03:26 +02:00
2019-01-29 19:44:59 +01:00
$menu_arr [] = array (
'name' => 'Companies' ,
'link' => '/societe/index.php?mainmenu=companies&leftmenu=' ,
'title' => " ThirdParties " ,
'level' => 0 ,
2025-02-04 01:17:07 +01:00
'enabled' => ( int ) ( $showmode = isVisibleToUserType ( $type_user , $tmpentry , $listofmodulesforexternal )),
2019-01-29 19:44:59 +01:00
'target' => $atarget ,
'mainmenu' => " companies " ,
'leftmenu' => '' ,
'position' => 20 ,
'id' => $id ,
'idsel' => 'companies' ,
2021-08-29 12:15:09 +02:00
'classname' => $classname = ( ! empty ( $_SESSION [ " mainmenu " ]) && $_SESSION [ " mainmenu " ] == " companies " ) ? 'class="tmenusel"' : 'class="tmenu"' ,
2023-10-13 15:00:51 +02:00
'prefix' => img_picto ( '' , 'company' , 'class="fa-fw pictofixedwidth"' ),
2021-08-29 12:15:09 +02:00
'session' => (( ! empty ( $_SESSION [ " mainmenu " ]) && $_SESSION [ " mainmenu " ] == " companies " ) ? 0 : 1 ),
2019-11-13 19:35:02 +01:00
'loadLangs' => array ( " companies " , " suppliers " ),
2019-01-29 19:44:59 +01:00
'submenus' => array (),
);
2010-10-02 23:31:14 +02:00
// Products-Services
2019-04-23 10:38:20 +02:00
$tmpentry = array (
2025-02-04 01:17:07 +01:00
'enabled' => ( int ) ( isModEnabled ( 'product' ) || isModEnabled ( 'service' ) || isModEnabled ( 'shipping' )),
'perms' => ( string ) ( int ) ( $user -> hasRight ( 'product' , 'read' ) || $user -> hasRight ( 'service' , 'read' ) || $user -> hasRight ( 'expedition' , 'lire' )),
2024-03-13 15:06:34 +01:00
'module' => 'product|service'
2019-04-23 10:38:20 +02:00
);
2019-01-29 19:44:59 +01:00
$menu_arr [] = array (
'name' => 'Products' ,
'link' => '/product/index.php?mainmenu=products&leftmenu=' ,
2022-06-09 21:33:39 +02:00
'title' => ( isModEnabled ( 'product' ) && isModEnabled ( 'service' ))
2022-03-19 15:03:32 +01:00
? ( array ( " TMenuProducts " , " | " , " TMenuServices " ))
2022-06-09 21:33:39 +02:00
: ( isModEnabled ( 'product' ) ? " TMenuProducts " : " TMenuServices " ),
2019-01-29 19:44:59 +01:00
'level' => 0 ,
2025-02-04 01:17:07 +01:00
'enabled' => ( int ) ( $showmode = isVisibleToUserType ( $type_user , $tmpentry , $listofmodulesforexternal )),
2019-01-29 19:44:59 +01:00
'target' => $atarget ,
'mainmenu' => " products " ,
'leftmenu' => '' ,
'position' => 30 ,
'id' => $id ,
'idsel' => 'products' ,
2021-08-29 12:15:09 +02:00
'classname' => $classname = ( ! empty ( $_SESSION [ " mainmenu " ]) && $_SESSION [ " mainmenu " ] == " products " ) ? 'class="tmenusel"' : 'class="tmenu"' ,
2023-10-13 15:00:51 +02:00
'prefix' => img_picto ( '' , 'product' , 'class="fa-fw pictofixedwidth"' ),
2021-08-29 12:15:09 +02:00
'session' => (( ! empty ( $_SESSION [ " mainmenu " ]) && $_SESSION [ " mainmenu " ] == " products " ) ? 0 : 1 ),
2022-09-13 20:14:51 +02:00
'loadLangs' => array ( " products " , " stocks " ),
2019-01-29 19:44:59 +01:00
'submenus' => array (),
);
2010-10-02 23:31:14 +02:00
2020-09-15 02:41:08 +02:00
// MRP - GPAO
2019-04-23 10:38:20 +02:00
$tmpentry = array (
2025-02-04 01:17:07 +01:00
'enabled' => ( int ) ( isModEnabled ( 'bom' ) || isModEnabled ( 'mrp' )),
'perms' => ( string ) ( int ) ( $user -> hasRight ( 'bom' , 'read' ) || $user -> hasRight ( 'mrp' , 'read' )),
2024-03-13 15:06:34 +01:00
'module' => 'bom|mrp'
2019-04-23 10:38:20 +02:00
);
2019-03-06 14:18:58 +01:00
$menu_arr [] = array (
2020-09-07 10:18:17 +02:00
'name' => 'TMenuMRP' ,
'link' => '/mrp/index.php?mainmenu=mrp&leftmenu=' ,
'title' => " TMenuMRP " ,
'level' => 0 ,
2025-02-04 01:17:07 +01:00
'enabled' => ( int ) ( $showmode = isVisibleToUserType ( $type_user , $tmpentry , $listofmodulesforexternal )),
2020-09-07 10:18:17 +02:00
'target' => $atarget ,
'mainmenu' => " mrp " ,
'leftmenu' => '' ,
2020-09-15 02:41:08 +02:00
'position' => 31 ,
2020-09-07 10:18:17 +02:00
'id' => $id ,
'idsel' => 'mrp' ,
2021-08-29 12:15:09 +02:00
'classname' => $classname = ( ! empty ( $_SESSION [ " mainmenu " ]) && $_SESSION [ " mainmenu " ] == " mrp " ) ? 'class="tmenusel"' : 'class="tmenu"' ,
2023-10-13 15:00:51 +02:00
'prefix' => img_picto ( '' , 'mrp' , 'class="fa-fw pictofixedwidth"' ),
2021-08-29 12:15:09 +02:00
'session' => (( ! empty ( $_SESSION [ " mainmenu " ]) && $_SESSION [ " mainmenu " ] == " mrp " ) ? 0 : 1 ),
2020-09-07 10:18:17 +02:00
'loadLangs' => array ( " mrp " ),
'submenus' => array (),
2019-02-26 19:27:04 +01:00
);
2018-12-15 15:35:59 +01:00
// Projects
2019-04-23 10:38:20 +02:00
$tmpentry = array (
2025-02-04 01:17:07 +01:00
'enabled' => ( int ) ( isModEnabled ( 'project' ) ? 1 : 0 ),
'perms' => ( string ) ( int ) ( $user -> hasRight ( 'projet' , 'lire' ) ? 1 : 0 ),
2024-03-13 15:06:34 +01:00
'module' => 'projet'
2019-04-23 10:38:20 +02:00
);
2022-10-06 17:36:52 +02:00
if ( $mode == 'jmobile' ) {
$titleboth = $langs -> trans ( " LeadsOrProjects " );
} else {
$titleboth = $langs -> trans ( " Projects " );
}
2023-11-27 11:39:32 +01:00
if ( ! getDolGlobalString ( 'PROJECT_USE_OPPORTUNITIES' )) {
2022-10-06 17:36:52 +02:00
$titleboth = $langs -> trans ( " Projects " );
}
2023-10-08 23:19:49 +02:00
if ( getDolGlobalInt ( 'PROJECT_USE_OPPORTUNITIES' ) == 2 ) { // 2 = leads only
2022-10-06 17:36:52 +02:00
$titleboth = $langs -> trans ( " Leads " );
}
2019-01-29 19:44:59 +01:00
$menu_arr [] = array (
2022-10-06 17:36:52 +02:00
'name' => 'Project' ,
2019-01-29 19:44:59 +01:00
'link' => '/projet/index.php?mainmenu=project&leftmenu=' ,
2022-10-06 17:36:52 +02:00
'title' => $titleboth ,
2019-01-29 19:44:59 +01:00
'level' => 0 ,
2025-02-04 01:17:07 +01:00
'enabled' => ( int ) ( $showmode = isVisibleToUserType ( $type_user , $tmpentry , $listofmodulesforexternal )),
2019-01-29 19:44:59 +01:00
'target' => $atarget ,
'mainmenu' => " project " ,
'leftmenu' => '' ,
'position' => 35 ,
'id' => $id ,
'idsel' => 'project' ,
2021-08-29 12:15:09 +02:00
'classname' => $classname = ( ! empty ( $_SESSION [ " mainmenu " ]) && $_SESSION [ " mainmenu " ] == " project " ) ? 'class="tmenusel"' : 'class="tmenu"' ,
2023-10-13 15:00:51 +02:00
'prefix' => img_picto ( '' , 'project' , 'class="fa-fw pictofixedwidth"' ),
2021-08-29 12:15:09 +02:00
'session' => (( ! empty ( $_SESSION [ " mainmenu " ]) && $_SESSION [ " mainmenu " ] == " project " ) ? 0 : 1 ),
2019-01-29 19:44:59 +01:00
'loadLangs' => array ( " projects " ),
'submenus' => array (),
);
2018-12-15 15:35:59 +01:00
2020-09-18 08:00:43 +02:00
// Commercial (propal, commande, supplier_proposal, supplier_order, contrat, ficheinter)
2019-04-23 10:38:20 +02:00
$tmpentry = array (
2025-02-04 01:17:07 +01:00
'enabled' => ( int ) (
2023-12-04 12:07:53 +01:00
isModEnabled ( 'propal' )
2024-02-27 15:30:37 +01:00
|| isModEnabled ( 'order' )
2022-06-09 21:33:39 +02:00
|| isModEnabled ( 'fournisseur' )
|| isModEnabled ( 'supplier_proposal' )
|| isModEnabled ( 'supplier_order' )
2024-02-27 15:30:37 +01:00
|| isModEnabled ( 'contract' )
|| isModEnabled ( 'intervention' )
2023-12-04 12:07:53 +01:00
) ? 1 : 0 ,
2025-02-04 01:17:07 +01:00
'perms' => ( string ) ( int ) (
2023-12-04 12:07:53 +01:00
$user -> hasRight ( 'propal' , 'read' )
|| $user -> hasRight ( 'commande' , 'lire' )
|| $user -> hasRight ( 'supplier_proposal' , 'lire' )
|| $user -> hasRight ( 'fournisseur' , 'lire' )
|| $user -> hasRight ( 'fournisseur' , 'commande' , 'lire' )
|| $user -> hasRight ( 'supplier_order' , 'lire' )
|| $user -> hasRight ( 'contrat' , 'lire' )
|| $user -> hasRight ( 'ficheinter' , 'lire' )
),
2024-03-13 15:06:34 +01:00
'module' => 'propal|commande|supplier_proposal|supplier_order|contrat|ficheinter'
2019-04-23 10:38:20 +02:00
);
2020-02-02 19:50:53 +01:00
2023-12-04 12:07:53 +01:00
$onlysupplierorder = $user -> hasRight ( 'fournisseur' , 'commande' , 'lire' ) &&
! $user -> hasRight ( 'propal' , 'lire' ) &&
! $user -> hasRight ( 'commande' , 'lire' ) &&
! $user -> hasRight ( 'supplier_order' , 'lire' ) &&
! $user -> hasRight ( 'supplier_proposal' , 'lire' ) &&
! $user -> hasRight ( 'contrat' , 'lire' ) &&
! $user -> hasRight ( 'ficheinter' , 'lire' );
2020-02-02 19:50:53 +01:00
2019-01-29 19:44:59 +01:00
$menu_arr [] = array (
'name' => 'Commercial' ,
2020-02-02 19:50:53 +01:00
'link' => ( $onlysupplierorder ? '/fourn/commande/index.php?mainmenu=commercial&leftmenu=' : '/comm/index.php?mainmenu=commercial&leftmenu=' ),
2019-01-29 19:44:59 +01:00
'title' => " Commercial " ,
'level' => 0 ,
2025-02-04 01:17:07 +01:00
'enabled' => ( int ) ( $showmode = isVisibleToUserType ( $type_user , $tmpentry , $listofmodulesforexternal )),
2019-01-29 19:44:59 +01:00
'target' => $atarget ,
'mainmenu' => " commercial " ,
'leftmenu' => '' ,
'position' => 40 ,
'id' => $id ,
'idsel' => 'commercial' ,
2021-08-29 12:15:09 +02:00
'classname' => $classname = ( ! empty ( $_SESSION [ " mainmenu " ]) && $_SESSION [ " mainmenu " ] == " commercial " ) ? 'class="tmenusel"' : 'class="tmenu"' ,
2023-10-13 15:00:51 +02:00
'prefix' => img_picto ( '' , 'contract' , 'class="fa-fw pictofixedwidth"' ),
2021-08-29 12:15:09 +02:00
'session' => (( ! empty ( $_SESSION [ " mainmenu " ]) && $_SESSION [ " mainmenu " ] == " commercial " ) ? 0 : 1 ),
2019-01-29 19:44:59 +01:00
'loadLangs' => array ( " commercial " ),
'submenus' => array (),
);
2010-10-02 23:31:14 +02:00
2017-08-29 12:43:47 +02:00
// Billing - Financial
2019-04-23 10:38:20 +02:00
$tmpentry = array (
2025-02-04 01:17:07 +01:00
'enabled' => ( int ) (
2024-02-27 15:30:37 +01:00
isModEnabled ( 'invoice' ) ||
2022-06-09 21:33:39 +02:00
isModEnabled ( 'don' ) ||
isModEnabled ( 'tax' ) ||
isModEnabled ( 'salaries' ) ||
isModEnabled ( 'supplier_invoice' ) ||
isModEnabled ( 'loan' ) ||
2024-02-22 02:45:36 +01:00
isModEnabled ( 'margin' )
2023-12-04 12:07:53 +01:00
) ? 1 : 0 ,
2025-02-04 01:17:07 +01:00
'perms' => ( string ) ( int ) ( $user -> hasRight ( 'facture' , 'lire' ) || $user -> hasRight ( 'don' , 'contact' , 'lire' )
2023-12-04 12:07:53 +01:00
|| $user -> hasRight ( 'tax' , 'charges' , 'lire' ) || $user -> hasRight ( 'salaries' , 'read' )
|| $user -> hasRight ( 'fournisseur' , 'facture' , 'lire' ) || $user -> hasRight ( 'loan' , 'read' ) || $user -> hasRight ( 'margins' , 'liretous' )),
2024-03-13 15:06:34 +01:00
'module' => 'facture|supplier_invoice|don|tax|salaries|loan'
2019-04-23 10:38:20 +02:00
);
2019-01-29 19:44:59 +01:00
$menu_arr [] = array (
'name' => 'Compta' ,
'link' => '/compta/index.php?mainmenu=billing&leftmenu=' ,
'title' => " MenuFinancial " ,
'level' => 0 ,
2025-02-04 01:17:07 +01:00
'enabled' => ( int ) ( $showmode = isVisibleToUserType ( $type_user , $tmpentry , $listofmodulesforexternal )),
2019-01-29 19:44:59 +01:00
'target' => $atarget ,
'mainmenu' => " billing " ,
'leftmenu' => '' ,
'position' => 50 ,
'id' => $id ,
'idsel' => 'billing' ,
2021-08-29 12:15:09 +02:00
'classname' => $classname = ( ! empty ( $_SESSION [ " mainmenu " ]) && $_SESSION [ " mainmenu " ] == " billing " ) ? 'class="tmenusel"' : 'class="tmenu"' ,
2023-10-13 15:00:51 +02:00
'prefix' => img_picto ( '' , 'bill' , 'class="fa-fw pictofixedwidth"' ),
2021-08-29 12:15:09 +02:00
'session' => (( ! empty ( $_SESSION [ " mainmenu " ]) && $_SESSION [ " mainmenu " ] == " billing " ) ? 0 : 1 ),
2019-01-29 19:44:59 +01:00
'loadLangs' => array ( " compta " ),
'submenus' => array (),
);
2010-10-02 23:31:14 +02:00
2013-02-24 21:16:36 +01:00
// Bank
2019-04-23 10:38:20 +02:00
$tmpentry = array (
2025-02-04 01:17:07 +01:00
'enabled' => ( int ) ( isModEnabled ( 'bank' ) || isModEnabled ( 'prelevement' )),
'perms' => ( string ) ( int ) ( $user -> hasRight ( 'banque' , 'lire' ) || $user -> hasRight ( 'prelevement' , 'lire' ) || $user -> hasRight ( 'paymentbybanktransfer' , 'read' )),
2024-03-13 15:06:34 +01:00
'module' => 'banque|prelevement|paymentbybanktransfer'
2019-04-23 10:38:20 +02:00
);
2019-01-29 19:44:59 +01:00
$menu_arr [] = array (
'name' => 'Bank' ,
2024-04-02 17:02:14 +02:00
'link' => '/compta/bank/list.php?mainmenu=bank&leftmenu=&search_status=opened' ,
2019-01-29 19:44:59 +01:00
'title' => " MenuBankCash " ,
'level' => 0 ,
2025-02-04 01:17:07 +01:00
'enabled' => ( int ) ( $showmode = isVisibleToUserType ( $type_user , $tmpentry , $listofmodulesforexternal )),
2019-01-29 19:44:59 +01:00
'target' => $atarget ,
'mainmenu' => " bank " ,
'leftmenu' => '' ,
'position' => 52 ,
'id' => $id ,
'idsel' => 'bank' ,
2021-08-29 12:15:09 +02:00
'classname' => $classname = ( ! empty ( $_SESSION [ " mainmenu " ]) && $_SESSION [ " mainmenu " ] == " bank " ) ? 'class="tmenusel"' : 'class="tmenu"' ,
2023-10-13 15:00:51 +02:00
'prefix' => img_picto ( '' , 'bank_account' , 'class="fa-fw pictofixedwidth"' ),
2021-08-29 12:15:09 +02:00
'session' => (( ! empty ( $_SESSION [ " mainmenu " ]) && $_SESSION [ " mainmenu " ] == " bank " ) ? 0 : 1 ),
2019-11-13 19:35:02 +01:00
'loadLangs' => array ( " compta " , " banks " ),
2019-01-29 19:44:59 +01:00
'submenus' => array (),
);
2010-10-02 23:31:14 +02:00
2018-01-22 04:13:29 +01:00
// Accounting
2019-04-23 10:38:20 +02:00
$tmpentry = array (
2025-02-04 01:17:07 +01:00
'enabled' => ( int ) ( isModEnabled ( 'comptabilite' ) || isModEnabled ( 'accounting' ) || isModEnabled ( 'asset' ) || isModEnabled ( 'intracommreport' )),
'perms' => ( string ) ( int ) ( $user -> hasRight ( 'compta' , 'resultat' , 'lire' ) || $user -> hasRight ( 'accounting' , 'comptarapport' , 'lire' ) || $user -> hasRight ( 'accounting' , 'mouvements' , 'lire' ) || $user -> hasRight ( 'asset' , 'read' ) || $user -> hasRight ( 'intracommreport' , 'read' )),
2024-03-13 15:06:34 +01:00
'module' => 'comptabilite|accounting|asset|intracommreport'
2019-04-23 10:38:20 +02:00
);
2019-01-29 19:44:59 +01:00
$menu_arr [] = array (
'name' => 'Accounting' ,
'link' => '/accountancy/index.php?mainmenu=accountancy&leftmenu=' ,
'title' => " MenuAccountancy " ,
'level' => 0 ,
2025-02-04 01:17:07 +01:00
'enabled' => ( int ) ( $showmode = isVisibleToUserType ( $type_user , $tmpentry , $listofmodulesforexternal )),
2019-01-29 19:44:59 +01:00
'target' => $atarget ,
'mainmenu' => " accountancy " ,
'leftmenu' => '' ,
'position' => 54 ,
'id' => $id ,
'idsel' => 'accountancy' ,
2021-08-29 12:15:09 +02:00
'classname' => $classname = ( ! empty ( $_SESSION [ " mainmenu " ]) && $_SESSION [ " mainmenu " ] == " accountancy " ) ? 'class="tmenusel"' : 'class="tmenu"' ,
2023-10-13 15:00:51 +02:00
'prefix' => img_picto ( '' , 'accountancy' , 'class="fa-fw pictofixedwidth"' ),
2021-08-29 12:15:09 +02:00
'session' => (( ! empty ( $_SESSION [ " mainmenu " ]) && $_SESSION [ " mainmenu " ] == " accountancy " ) ? 0 : 1 ),
2020-10-31 14:32:18 +01:00
'loadLangs' => array ( " compta " , " accountancy " , " assets " , " intracommreport " ),
2019-01-29 19:44:59 +01:00
'submenus' => array (),
);
2010-10-02 23:31:14 +02:00
2013-05-04 01:22:09 +02:00
// HRM
2019-04-23 10:38:20 +02:00
$tmpentry = array (
2025-02-04 01:17:07 +01:00
'enabled' => ( int ) ( isModEnabled ( 'hrm' ) || ( isModEnabled ( 'holiday' )) || isModEnabled ( 'deplacement' ) || isModEnabled ( 'expensereport' ) || isModEnabled ( 'recruitment' )),
'perms' => ( string ) ( int ) ( $user -> hasRight ( 'user' , 'user' , 'lire' ) || $user -> hasRight ( 'holiday' , 'read' ) || $user -> hasRight ( 'deplacement' , 'lire' ) || $user -> hasRight ( 'expensereport' , 'lire' ) || $user -> hasRight ( 'recruitment' , 'recruitmentjobposition' , 'read' )),
2024-03-13 15:06:34 +01:00
'module' => 'hrm|holiday|deplacement|expensereport|recruitment'
2019-04-23 10:38:20 +02:00
);
2020-12-07 14:25:49 +01:00
2019-01-29 19:44:59 +01:00
$menu_arr [] = array (
'name' => 'HRM' ,
'link' => '/hrm/index.php?mainmenu=hrm&leftmenu=' ,
'title' => " HRM " ,
'level' => 0 ,
2025-02-04 01:17:07 +01:00
'enabled' => ( int ) ( $showmode = isVisibleToUserType ( $type_user , $tmpentry , $listofmodulesforexternal )),
2019-01-29 19:44:59 +01:00
'target' => $atarget ,
'mainmenu' => " hrm " ,
'leftmenu' => '' ,
'position' => 80 ,
'id' => $id ,
'idsel' => 'hrm' ,
2021-08-29 12:15:09 +02:00
'classname' => $classname = ( ! empty ( $_SESSION [ " mainmenu " ]) && $_SESSION [ " mainmenu " ] == " hrm " ) ? 'class="tmenusel"' : 'class="tmenu"' ,
2023-10-13 15:00:51 +02:00
'prefix' => img_picto ( '' , 'hrm' , 'class="fa-fw pictofixedwidth"' ),
2021-08-29 12:15:09 +02:00
'session' => (( ! empty ( $_SESSION [ " mainmenu " ]) && $_SESSION [ " mainmenu " ] == " hrm " ) ? 0 : 1 ),
2022-09-13 20:14:51 +02:00
'loadLangs' => array ( " hrm " , " holiday " ),
2019-01-29 19:44:59 +01:00
'submenus' => array (),
);
2013-07-07 03:26:51 +02:00
2023-08-28 14:12:40 +02:00
// Tickets and Knowledge base
2021-06-26 15:39:52 +02:00
$tmpentry = array (
2025-02-04 01:17:07 +01:00
'enabled' => ( int ) ( isModEnabled ( 'ticket' ) || isModEnabled ( 'knowledgemanagement' )),
'perms' => ( string ) ( int ) ( $user -> hasRight ( 'ticket' , 'read' ) || $user -> hasRight ( 'knowledgemanagement' , 'knowledgerecord' , 'read' )),
2024-03-13 15:06:34 +01:00
'module' => 'ticket|knowledgemanagement'
2021-06-26 15:39:52 +02:00
);
2021-09-08 18:23:44 +02:00
$link = '' ;
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'ticket' )) {
2021-09-08 18:23:44 +02:00
$link = '/ticket/index.php?mainmenu=ticket&leftmenu=' ;
2021-09-08 19:51:34 +02:00
} else {
2021-09-08 18:23:44 +02:00
$link = '/knowledgemanagement/knowledgerecord_list.php?mainmenu=ticket&leftmenu=' ;
}
2021-06-26 15:39:52 +02:00
$menu_arr [] = array (
'name' => 'Ticket' ,
2022-10-06 17:36:52 +02:00
'link' => $link ,
2023-08-28 14:12:40 +02:00
'title' => isModEnabled ( 'ticket' ) ? " Tickets " : " MenuKnowledgeRecordShort " ,
2021-06-26 15:39:52 +02:00
'level' => 0 ,
2025-02-04 01:17:07 +01:00
'enabled' => ( int ) ( $showmode = isVisibleToUserType ( $type_user , $tmpentry , $listofmodulesforexternal )),
2021-06-26 15:39:52 +02:00
'target' => $atarget ,
'mainmenu' => " ticket " ,
'leftmenu' => '' ,
'position' => 88 ,
'id' => $id ,
'idsel' => 'ticket' ,
2021-08-29 12:15:09 +02:00
'classname' => $classname = ( ! empty ( $_SESSION [ " mainmenu " ]) && $_SESSION [ " mainmenu " ] == " ticket " ) ? 'class="tmenusel"' : 'class="tmenu"' ,
2023-10-13 15:00:51 +02:00
'prefix' => img_picto ( '' , 'ticket' , 'class="fa-fw pictofixedwidth"' ),
2021-08-29 12:15:09 +02:00
'session' => (( ! empty ( $_SESSION [ " mainmenu " ]) && $_SESSION [ " mainmenu " ] == " ticket " ) ? 0 : 1 ),
2022-09-13 20:14:51 +02:00
'loadLangs' => array ( " ticket " , " knowledgemanagement " ),
2021-06-26 15:39:52 +02:00
'submenus' => array (),
);
2010-10-02 23:31:14 +02:00
// Tools
2019-04-23 10:38:20 +02:00
$tmpentry = array (
2024-03-13 15:06:34 +01:00
'enabled' => 1 ,
2025-02-04 01:17:07 +01:00
'perms' => '1' ,
2024-03-13 15:06:34 +01:00
'module' => ''
2019-04-23 10:38:20 +02:00
);
2019-01-29 19:44:59 +01:00
$menu_arr [] = array (
'name' => 'Tools' ,
'link' => '/core/tools.php?mainmenu=tools&leftmenu=' ,
'title' => " Tools " ,
'level' => 0 ,
2025-02-04 01:17:07 +01:00
'enabled' => ( int ) ( $showmode = isVisibleToUserType ( $type_user , $tmpentry , $listofmodulesforexternal )),
2019-01-29 19:44:59 +01:00
'target' => $atarget ,
'mainmenu' => " tools " ,
'leftmenu' => '' ,
'position' => 90 ,
'id' => $id ,
'idsel' => 'tools' ,
2021-08-29 12:15:09 +02:00
'classname' => $classname = ( ! empty ( $_SESSION [ " mainmenu " ]) && $_SESSION [ " mainmenu " ] == " tools " ) ? 'class="tmenusel"' : 'class="tmenu"' ,
2023-10-13 15:00:51 +02:00
'prefix' => img_picto ( '' , 'tools' , 'class="fa-fw pictofixedwidth"' ),
2021-08-25 12:45:40 +02:00
'session' => (( ! empty ( $_SESSION [ " mainmenu " ]) && $_SESSION [ " mainmenu " ] == " tools " ) ? 0 : 1 ),
2019-01-29 19:44:59 +01:00
'loadLangs' => array ( " other " ),
'submenus' => array (),
);
2019-03-06 14:18:58 +01:00
2019-01-29 19:44:59 +01:00
// Add menus
2020-12-04 18:00:31 +01:00
foreach ( $menu_arr as $key => $smenu ) {
2019-01-29 19:44:59 +01:00
$smenu = ( object ) $smenu ;
2019-03-06 14:18:58 +01:00
2020-12-04 18:00:31 +01:00
if ( $smenu -> enabled ) {
if ( $smenu -> session ) {
2019-11-13 19:35:02 +01:00
$_SESSION [ 'idmenu' ] = '' ;
2019-01-29 19:44:59 +01:00
}
2019-03-06 14:18:58 +01:00
2019-01-29 19:44:59 +01:00
// Load Langue
2020-12-04 18:00:31 +01:00
if ( ! empty ( $smenu -> loadLangs )) {
2019-01-29 19:44:59 +01:00
$langs -> loadLangs ( $smenu -> loadLangs );
}
2019-03-06 14:18:58 +01:00
2019-01-29 19:44:59 +01:00
// Trans title
$mtitle = '' ;
2020-12-04 18:00:31 +01:00
if ( is_array ( $smenu -> title )) {
foreach ( $smenu -> title as $item ) {
2019-11-13 19:35:02 +01:00
$mtitle .= $langs -> trans ( $item );
2019-01-29 19:44:59 +01:00
}
2020-05-21 15:05:19 +02:00
} else {
2019-11-13 19:35:02 +01:00
$mtitle = $langs -> trans ( $smenu -> title );
2019-01-29 19:44:59 +01:00
}
// Add item
2025-02-04 01:17:07 +01:00
$menu -> add ( $smenu -> link , $mtitle , $smenu -> level , $smenu -> enabled , $smenu -> target , $smenu -> mainmenu , $smenu -> leftmenu , $smenu -> position , $smenu -> id , $smenu -> idsel , $smenu -> classname , ( string ) $smenu -> prefix );
2019-01-29 19:44:59 +01:00
}
2010-10-02 23:31:14 +02:00
}
// Show personalized menus
2019-01-27 11:55:16 +01:00
$menuArbo = new Menubase ( $db , 'eldy' );
2020-09-25 14:09:51 +02:00
2019-11-13 19:35:02 +01:00
$newTabMenu = $menuArbo -> menuTopCharger ( '' , '' , $type_user , 'eldy' , $tabMenu ); // Return tabMenu with only top entries
2011-10-30 17:26:55 +01:00
2011-09-20 18:12:52 +02:00
$num = count ( $newTabMenu );
2020-12-04 18:00:31 +01:00
for ( $i = 0 ; $i < $num ; $i ++ ) {
2020-06-27 15:27:09 +02:00
//var_dump($type_user.' '.$newTabMenu[$i]['url'].' '.$showmode.' '.$newTabMenu[$i]['perms']);
2019-11-13 19:35:02 +01:00
$idsel = ( empty ( $newTabMenu [ $i ][ 'mainmenu' ]) ? 'none' : $newTabMenu [ $i ][ 'mainmenu' ]);
2013-01-02 21:35:28 +01:00
2020-09-25 14:09:51 +02:00
$newTabMenu [ $i ][ 'url' ] = make_substitutions ( $newTabMenu [ $i ][ 'url' ], $substitarray );
2024-09-29 21:52:31 +02:00
'@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' ;
2020-09-25 14:09:51 +02:00
// url = url from host, shorturl = relative path into dolibarr sources
$url = $shorturl = $newTabMenu [ $i ][ 'url' ];
2020-12-04 18:00:31 +01:00
if ( ! preg_match ( " /^(http: \ / \ /|https: \ / \ /)/i " , $newTabMenu [ $i ][ 'url' ])) { // Do not change url content for external links
2020-09-25 14:09:51 +02:00
$tmp = explode ( '?' , $newTabMenu [ $i ][ 'url' ], 2 );
$url = $shorturl = $tmp [ 0 ];
$param = ( isset ( $tmp [ 1 ]) ? $tmp [ 1 ] : '' );
2022-07-26 16:14:19 +02:00
if (( ! preg_match ( '/mainmenu/i' , $param )) || ! preg_match ( '/leftmenu/i' , $param )) {
2024-03-16 02:38:34 +01:00
// @phan-suppress-next-line PhanTypeSuspiciousStringExpression
2022-07-26 16:14:19 +02:00
$param .= ( $param ? '&' : '' ) . 'mainmenu=' . $newTabMenu [ $i ][ 'mainmenu' ] . '&leftmenu=' ;
2020-12-04 18:00:31 +01:00
}
2020-09-25 14:09:51 +02:00
//$url.="idmenu=".$newTabMenu[$i]['rowid']; // Already done by menuLoad
$url = dol_buildpath ( $url , 1 ) . ( $param ? '?' . $param : '' );
//$shorturl = $shorturl.($param?'?'.$param:'');
$shorturl = $url ;
2020-12-04 18:00:31 +01:00
if ( DOL_URL_ROOT ) {
$shorturl = preg_replace ( '/^' . preg_quote ( DOL_URL_ROOT , '/' ) . '/' , '' , $shorturl );
}
2020-09-25 14:09:51 +02:00
}
2019-11-13 19:35:02 +01:00
$showmode = isVisibleToUserType ( $type_user , $newTabMenu [ $i ], $listofmodulesforexternal );
2020-12-04 18:00:31 +01:00
if ( $showmode == 1 ) {
2013-01-02 21:35:28 +01:00
// Define the class (top menu selected or not)
2020-12-04 18:00:31 +01:00
if ( ! empty ( $_SESSION [ 'idmenu' ]) && $newTabMenu [ $i ][ 'rowid' ] == $_SESSION [ 'idmenu' ]) {
$classname = 'class="tmenusel"' ;
} elseif ( ! empty ( $_SESSION [ " mainmenu " ]) && $newTabMenu [ $i ][ 'mainmenu' ] == $_SESSION [ " mainmenu " ]) {
$classname = 'class="tmenusel"' ;
} else {
$classname = 'class="tmenu"' ;
}
2020-09-25 14:09:51 +02:00
} elseif ( $showmode == 2 ) {
$classname = 'class="tmenu"' ;
}
2013-02-27 21:40:43 +01:00
2020-12-04 18:00:31 +01:00
$menu -> add (
$shorturl ,
$newTabMenu [ $i ][ 'titre' ],
0 ,
$showmode ,
( $newTabMenu [ $i ][ 'target' ] ? $newTabMenu [ $i ][ 'target' ] : $atarget ),
2020-09-25 14:09:51 +02:00
( $newTabMenu [ $i ][ 'mainmenu' ] ? $newTabMenu [ $i ][ 'mainmenu' ] : $newTabMenu [ $i ][ 'rowid' ]),
( $newTabMenu [ $i ][ 'leftmenu' ] ? $newTabMenu [ $i ][ 'leftmenu' ] : '' ),
2020-12-04 18:00:31 +01:00
$newTabMenu [ $i ][ 'position' ],
$id ,
$idsel ,
2021-03-13 18:56:02 +01:00
$classname ,
$newTabMenu [ $i ][ 'prefix' ]
2023-12-04 12:07:53 +01:00
);
2017-06-27 04:25:41 +02:00
}
// Sort on position
$menu -> liste = dol_sort_array ( $menu -> liste , 'position' );
2020-09-07 10:18:17 +02:00
// Output menu entries
2019-09-15 15:15:46 +02:00
// Show logo company
2023-11-27 11:39:32 +01:00
if ( ! getDolGlobalString ( 'MAIN_MENU_INVERT' ) && empty ( $noout ) && getDolGlobalString ( 'MAIN_SHOW_LOGO' ) && ! getDolGlobalString ( 'MAIN_OPTIMIZEFORTEXTBROWSER' )) {
2019-10-11 12:28:13 +02:00
//$mysoc->logo_mini=(empty($conf->global->MAIN_INFO_SOCIETE_LOGO_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI);
2023-11-27 11:39:32 +01:00
$mysoc -> logo_squarred_mini = ( ! getDolGlobalString ( 'MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI' ) ? '' : $conf -> global -> MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI );
2019-10-11 10:02:59 +02:00
$logoContainerAdditionalClass = 'backgroundforcompanylogo' ;
2023-11-27 11:39:32 +01:00
if ( getDolGlobalString ( 'MAIN_INFO_SOCIETE_LOGO_NO_BACKGROUND' )) {
2019-10-11 10:02:59 +02:00
$logoContainerAdditionalClass = '' ;
}
2020-12-04 18:00:31 +01:00
if ( ! empty ( $mysoc -> logo_squarred_mini ) && is_readable ( $conf -> mycompany -> dir_output . '/logos/thumbs/' . $mysoc -> logo_squarred_mini )) {
2019-11-13 19:35:02 +01:00
$urllogo = DOL_URL_ROOT . '/viewimage.php?cache=1&modulepart=mycompany&file=' . urlencode ( 'logos/thumbs/' . $mysoc -> logo_squarred_mini );
2022-08-31 22:14:20 +02:00
/* } elseif ( ! empty ( $mysoc -> logo_mini ) && is_readable ( $conf -> mycompany -> dir_output . '/logos/thumbs/' . $mysoc -> logo_mini ))
2023-12-04 12:07:53 +01:00
{
$urllogo = DOL_URL_ROOT . '/viewimage.php?cache=1&modulepart=mycompany&file=' . urlencode ( 'logos/thumbs/' . $mysoc -> logo_mini );
} */
2021-03-01 20:37:16 +01:00
} else {
2020-05-25 13:36:56 +02:00
$urllogo = DOL_URL_ROOT . '/theme/dolibarr_512x512_white.png' ;
2019-10-15 11:41:22 +02:00
$logoContainerAdditionalClass = '' ;
2019-09-15 15:15:46 +02:00
}
2019-11-13 19:35:02 +01:00
$title = $langs -> trans ( " GoIntoSetupToChangeLogo " );
2019-09-15 15:15:46 +02:00
print " \n " . '<!-- Show logo on menu -->' . " \n " ;
2019-11-17 20:25:39 +01:00
print_start_menu_entry ( 'companylogo' , 'class="tmenu tmenucompanylogo nohover"' , 1 );
2019-09-15 15:15:46 +02:00
2019-10-11 10:10:12 +02:00
print '<div class="center ' . $logoContainerAdditionalClass . ' menulogocontainer"><img class="mycompany" title="' . dol_escape_htmltag ( $title ) . '" alt="" src="' . $urllogo . '" style="max-width: 100px"></div>' . " \n " ;
2019-09-15 15:15:46 +02:00
print_end_menu_entry ( 4 );
}
2023-10-13 15:00:51 +02:00
//var_dump($menu->liste);
2020-09-07 10:18:17 +02:00
if ( empty ( $noout )) {
foreach ( $menu -> liste as $menuval ) {
print_start_menu_entry ( $menuval [ 'idsel' ], $menuval [ 'classname' ], $menuval [ 'enabled' ]);
2023-12-04 12:07:53 +01:00
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 );
2020-09-07 10:18:17 +02:00
print_end_menu_entry ( $menuval [ 'enabled' ]);
}
}
2010-10-02 23:31:14 +02:00
2019-11-13 19:35:02 +01:00
$showmode = 1 ;
2024-03-12 01:55:26 +01:00
if ( empty ( $noout ) && ! getDolGlobalString ( 'MAIN_OPTIMIZEFORTEXTBROWSER' )) {
2020-09-07 10:18:17 +02:00
print_start_menu_entry ( '' , 'class="tmenuend"' , $showmode );
print_end_menu_entry ( $showmode );
print_end_menu_array ();
}
2014-04-25 20:11:38 +02:00
return 0 ;
2010-10-02 23:31:14 +02:00
}
2012-05-01 23:40:23 +02:00
/**
* Output start menu array
*
* @ return void
*/
2010-10-02 23:31:14 +02:00
function print_start_menu_array ()
{
2012-05-01 23:40:23 +02:00
print '<div class="tmenudiv">' ;
2024-02-29 00:52:56 +01:00
print '<ul role="navigation" class="tmenu"' . ( getDolGlobalString ( 'MAIN_OPTIMIZEFORTEXTBROWSER' ) ? ' title="Top menu"' : '' ) . '>' ;
2010-10-02 23:31:14 +02:00
}
2012-03-19 17:18:11 +01:00
/**
* Output start menu entry
*
* @ param string $idsel Text
2012-05-09 00:28:02 +02:00
* @ param string $classname String to add a css class
2013-03-24 03:51:49 +01:00
* @ param int $showmode 0 = hide , 1 = allowed or 2 = not allowed
2012-03-19 17:18:11 +01:00
* @ return void
*/
2019-01-27 15:20:16 +01:00
function print_start_menu_entry ( $idsel , $classname , $showmode )
2010-10-02 23:31:14 +02:00
{
2020-12-04 18:00:31 +01:00
if ( $showmode ) {
2013-03-24 03:51:49 +01:00
print '<li ' . $classname . ' id="mainmenutd_' . $idsel . '">' ;
2018-02-05 23:06:48 +01:00
//print '<div class="tmenuleft tmenusep"></div>';
print '<div class="tmenucenter">' ;
2013-03-24 03:51:49 +01:00
}
2010-10-02 23:31:14 +02:00
}
2012-03-19 17:18:11 +01:00
/**
* Output menu entry
*
2023-10-13 15:00:51 +02:00
* @ param string $text Text
* @ param int $showmode 0 = hide , 1 = allowed or 2 = not allowed
* @ param string $url Url
* @ param string $id Id
* @ param string $idsel Id sel
* @ param string $classname Class name
* @ param string $atarget Target
2024-03-15 13:30:01 +01:00
* @ param 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 } $menuval All the $menuval array
2012-03-19 17:18:11 +01:00
* @ return void
*/
2023-10-13 15:00:51 +02:00
function print_text_menu_entry ( $text , $showmode , $url , $id , $idsel , $classname , $atarget , $menuval = array ())
2010-10-02 23:31:14 +02:00
{
2024-02-29 02:46:01 +01:00
global $langs ;
2013-02-27 21:40:43 +01:00
2022-05-02 16:47:28 +02:00
$classnameimg = str_replace ( 'class="' , 'class="tmenuimage ' , $classname );
$classnametxt = str_replace ( 'class="' , 'class="tmenulabel ' , $classname );
2024-02-29 02:46:01 +01:00
//$conf->global->THEME_TOPMENU_DISABLE_IMAGE=1;
2018-11-20 21:40:37 +01:00
if ( $showmode == 1 ) {
2022-05-02 16:47:28 +02:00
print '<a ' . $classnameimg . ' tabindex="-1" href="' . $url . '"' . ( $atarget ? ' target="' . $atarget . '"' : '' ) . ' title="' . dol_escape_htmltag ( $text ) . '">' ;
2023-10-13 15:00:51 +02:00
print '<div class="' . $id . ' ' . $idsel . ' topmenuimage">' ;
if ( ! empty ( $menuval [ 'prefix' ]) && strpos ( $menuval [ 'prefix' ], '<span' ) === 0 ) {
print $menuval [ 'prefix' ];
2024-03-09 23:46:38 +01:00
} elseif ( ! empty ( $menuval [ 'prefix' ]) && strpos ( $menuval [ 'prefix' ], 'fa-' ) === 0 ) {
print '<span class="' . $id . ' ' . $menuval [ 'prefix' ] . '" id="mainmenuspan_' . $idsel . '"></span>' ;
2023-10-13 15:00:51 +02:00
} else {
print '<span class="' . $id . ' tmenuimageforpng" id="mainmenuspan_' . $idsel . '"></span>' ;
}
print '</div>' ;
2013-03-30 14:27:13 +01:00
print '</a>' ;
2023-11-27 11:39:32 +01:00
if ( ! getDolGlobalString ( 'THEME_TOPMENU_DISABLE_TEXT' )) {
2022-05-02 16:47:28 +02:00
print '<a ' . $classnametxt . ' id="mainmenua_' . $idsel . '" href="' . $url . '"' . ( $atarget ? ' target="' . $atarget . '"' : '' ) . ' title="' . dol_escape_htmltag ( $text ) . '">' ;
2021-04-12 12:07:11 +02:00
print '<span class="mainmenuaspan">' ;
print $text ;
print '</span>' ;
print '</a>' ;
}
2018-11-20 21:40:37 +01:00
} elseif ( $showmode == 2 ) {
2022-05-02 20:10:42 +02:00
print '<div ' . $classnameimg . ' title="' . dol_escape_htmltag ( $text . ' - ' . $langs -> trans ( " NotAllowed " )) . '">' ;
2023-10-13 15:00:51 +02:00
print '<div class="' . $id . ' ' . $idsel . ' topmenuimage tmenudisabled">' ;
if ( ! empty ( $menuval [ 'prefix' ]) && strpos ( $menuval [ 'prefix' ], '<span' ) === 0 ) {
print $menuval [ 'prefix' ];
} else {
print '<span class="' . $id . ' tmenuimageforpng tmenudisabled" id="mainmenuspan_' . $idsel . '"></span>' ;
}
print '</div>' ;
2022-05-02 20:10:42 +02:00
print '</div>' ;
2023-11-27 11:39:32 +01:00
if ( ! getDolGlobalString ( 'THEME_TOPMENU_DISABLE_TEXT' )) {
2022-05-02 16:47:28 +02:00
print '<span ' . $classnametxt . ' id="mainmenua_' . $idsel . '" href="#" title="' . dol_escape_htmltag ( $text . ' - ' . $langs -> trans ( " NotAllowed " )) . '">' ;
print '<span class="mainmenuaspan tmenudisabled">' ;
2021-04-12 12:07:11 +02:00
print $text ;
print '</span>' ;
2022-05-02 16:47:28 +02:00
print '</span>' ;
2021-04-12 12:07:11 +02:00
}
2013-02-27 21:40:43 +01:00
}
2010-10-02 23:31:14 +02:00
}
2012-03-19 17:18:11 +01:00
/**
* Output end menu entry
*
2013-03-24 03:51:49 +01:00
* @ param int $showmode 0 = hide , 1 = allowed or 2 = not allowed
2012-03-19 17:18:11 +01:00
* @ return void
*/
2013-03-24 03:51:49 +01:00
function print_end_menu_entry ( $showmode )
2010-10-02 23:31:14 +02:00
{
2020-12-04 18:00:31 +01:00
if ( $showmode ) {
2013-03-24 03:51:49 +01:00
print '</div></li>' ;
}
2010-10-02 23:31:14 +02:00
print " \n " ;
}
2012-03-19 17:18:11 +01:00
/**
* Output menu array
*
* @ return void
*/
2010-10-02 23:31:14 +02:00
function print_end_menu_array ()
{
2013-02-24 21:16:36 +01:00
print '</ul>' ;
print '</div>' ;
2010-10-02 23:31:14 +02:00
print " \n " ;
}
/**
2022-03-03 11:29:47 +01:00
* Core function to output left menu eldy
* Fill & $menu ( example with $forcemainmenu = 'home' $forceleftmenu = 'all' , return left menu tree of Home )
2017-06-02 19:28:22 +02:00
*
2022-03-03 11:29:47 +01:00
* @ param DoliDB $db Database handler
2025-02-04 01:17:07 +01:00
* @ param array < array { rowid : string , fk_menu : string , module ? : 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_before Table of menu entries to show before entries of menu handler ( menu -> liste filled with menu -> add )
* @ param array < array { rowid : string , fk_menu : string , module ? : 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_after Table of menu entries to show after entries of menu handler ( menu -> liste filled with menu -> add )
* @ param array < array { rowid : string , fk_menu : string , module ? : 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 } > $tabMenu If array with menu entries already loaded , we put this array here ( in most cases , it ' s empty )
2022-03-03 11:29:47 +01:00
* @ param Menu $menu Object Menu to return back list of menu entries
2024-08-14 14:05:56 +02:00
* @ param int < 0 , 1 > $noout Disable output ( Initialise & $menu only ) .
2022-03-03 11:29:47 +01:00
* @ param string $forcemainmenu 'x' = Force mainmenu to mainmenu = 'x'
* @ param string $forceleftmenu 'all' = Force leftmenu to '' ( = all ) . If value come being '' , we change it to value in session and 'none' if not defined in session .
2024-08-02 19:24:11 +02:00
* @ param ? array { searchform ? : string , bookmarks ? : string } $moredata An array with more data to output
2024-08-14 14:05:56 +02:00
* @ param int < 0 , 1 > $type_user 0 = Menu for backoffice , 1 = Menu for front office
2024-08-02 19:24:11 +02:00
* @ return int < 0 , max > Nb of menu entries
2010-10-02 23:31:14 +02:00
*/
2022-03-03 11:29:47 +01:00
function print_left_eldy_menu ( $db , $menu_array_before , $menu_array_after , & $tabMenu , & $menu , $noout = 0 , $forcemainmenu = '' , $forceleftmenu = '' , $moredata = null , $type_user = 0 )
2021-07-30 13:19:18 +02:00
{
2022-03-03 11:29:47 +01:00
global $user , $conf , $langs , $hookmanager ;
2018-12-10 17:50:58 +01:00
2022-03-03 11:29:47 +01:00
//var_dump($tabMenu);
2013-02-24 21:16:36 +01:00
2022-03-03 11:29:47 +01:00
$newmenu = $menu ;
2013-03-30 20:34:13 +01:00
2024-03-13 15:06:34 +01:00
$mainmenu = ( $forcemainmenu ? $forcemainmenu : $_SESSION [ " mainmenu " ] ? ? '' );
$leftmenu = ( $forceleftmenu ? '' : ( empty ( $_SESSION [ " leftmenu " ]) ? 'none' : $_SESSION [ " leftmenu " ] ? ? '' ));
2017-06-02 19:28:22 +02:00
2024-08-13 23:16:09 +02:00
if ( empty ( $mainmenu )) {
2023-07-02 16:51:18 +02:00
$mainmenu = 'home' ;
}
2022-07-26 16:14:19 +02:00
global $usemenuhider ;
2022-03-03 11:29:47 +01:00
$usemenuhider = 0 ;
2016-08-29 10:32:00 +02:00
2022-03-03 11:29:47 +01:00
if ( is_array ( $moredata ) && ! empty ( $moredata [ 'searchform' ])) { // searchform can contains select2 code or link to show old search form or link to switch on search page
print " \n " ;
print " <!-- Begin SearchForm --> \n " ;
print '<div id="blockvmenusearch" class="blockvmenusearch">' . " \n " ;
print $moredata [ 'searchform' ];
print '</div>' . " \n " ;
print " <!-- End SearchForm --> \n " ;
}
2022-03-02 22:41:00 +01:00
2022-03-03 11:29:47 +01:00
if ( is_array ( $moredata ) && ! empty ( $moredata [ 'bookmarks' ])) {
print " \n " ;
print " <!-- Begin Bookmarks --> \n " ;
print '<div id="blockvmenubookmarks" class="blockvmenubookmarks">' . " \n " ;
print $moredata [ 'bookmarks' ];
print '</div>' . " \n " ;
print " <!-- End Bookmarks --> \n " ;
}
2022-03-02 22:41:00 +01:00
2022-03-03 11:29:47 +01:00
$substitarray = getCommonSubstitutionArray ( $langs , 0 , null , null );
2017-06-02 19:28:22 +02:00
2023-12-13 15:20:53 +01:00
$listofmodulesforexternal = explode ( ',' , getDolGlobalString ( 'MAIN_MODULES_FOR_EXTERNAL' ));
2019-12-19 13:41:43 +01:00
2022-03-03 11:29:47 +01:00
/**
* We update newmenu with entries found into database
* --------------------------------------------------
*/
if ( $mainmenu ) { // If this is empty, loading hard coded menu and loading personalised menu will fail
/*
* Menu HOME
*/
if ( $mainmenu == 'home' ) {
get_left_menu_home ( $mainmenu , $newmenu , $usemenuhider , $leftmenu , $type_user );
}
2021-02-17 17:56:08 +01:00
2022-03-03 11:29:47 +01:00
/*
* Menu THIRDPARTIES
*/
if ( $mainmenu == 'companies' ) {
get_left_menu_thridparties ( $mainmenu , $newmenu , $usemenuhider , $leftmenu , $type_user );
}
2022-03-02 22:41:00 +01:00
2022-03-03 11:29:47 +01:00
/*
* Menu COMMERCIAL ( propal , commande , supplier_proposal , supplier_order , contrat , ficheinter )
*/
if ( $mainmenu == 'commercial' ) {
get_left_menu_commercial ( $mainmenu , $newmenu , $usemenuhider , $leftmenu , $type_user );
2022-03-02 22:41:00 +01:00
}
2013-02-24 21:16:36 +01:00
2022-03-03 11:29:47 +01:00
/*
* Menu COMPTA - FINANCIAL
*/
if ( $mainmenu == 'billing' ) {
get_left_menu_billing ( $mainmenu , $newmenu , $usemenuhider , $leftmenu , $type_user );
2022-03-02 22:41:00 +01:00
}
2016-08-29 10:32:00 +02:00
2022-03-03 11:29:47 +01:00
/*
* Menu COMPTA - FINANCIAL
*/
if ( $mainmenu == 'accountancy' ) {
2022-05-17 20:08:59 +02:00
get_left_menu_accountancy ( $mainmenu , $newmenu , $usemenuhider , $leftmenu , $type_user );
2022-03-03 11:29:47 +01:00
}
2018-06-19 13:10:13 +02:00
2022-03-03 11:29:47 +01:00
/*
* Menu BANK
*/
if ( $mainmenu == 'bank' ) {
get_left_menu_bank ( $mainmenu , $newmenu , $usemenuhider , $leftmenu , $type_user );
}
2013-02-24 21:16:36 +01:00
2022-03-03 11:29:47 +01:00
/*
* Menu PRODUCTS - SERVICES
*/
if ( $mainmenu == 'products' ) {
get_left_menu_products ( $mainmenu , $newmenu , $usemenuhider , $leftmenu , $type_user );
2022-03-02 22:41:00 +01:00
}
2020-11-30 19:14:18 +01:00
2022-03-03 11:29:47 +01:00
/*
* Menu PRODUCTS - SERVICES MRP - GPAO
*/
if ( $mainmenu == 'mrp' ) {
get_left_menu_mrp ( $mainmenu , $newmenu , $usemenuhider , $leftmenu , $type_user );
}
2022-03-02 22:41:00 +01:00
2022-03-03 11:29:47 +01:00
/*
* Menu PROJECTS
*/
if ( $mainmenu == 'project' ) {
get_left_menu_projects ( $mainmenu , $newmenu , $usemenuhider , $leftmenu , $type_user );
2022-03-02 22:41:00 +01:00
}
2020-11-30 19:14:18 +01:00
2022-03-03 11:29:47 +01:00
/*
* Menu HRM
2022-03-19 15:03:32 +01:00
*/
2022-03-03 11:29:47 +01:00
if ( $mainmenu == 'hrm' ) {
get_left_menu_hrm ( $mainmenu , $newmenu , $usemenuhider , $leftmenu , $type_user );
}
/*
* Menu TOOLS
*/
if ( $mainmenu == 'tools' ) {
get_left_menu_tools ( $mainmenu , $newmenu , $usemenuhider , $leftmenu , $type_user );
2022-03-02 22:41:00 +01:00
}
2022-03-03 11:29:47 +01:00
/*
* Menu MEMBERS
*/
if ( $mainmenu == 'members' ) {
get_left_menu_members ( $mainmenu , $newmenu , $usemenuhider , $leftmenu , $type_user );
2022-03-02 22:41:00 +01:00
}
2016-01-24 11:35:33 +01:00
2022-03-03 11:29:47 +01:00
// Add personalized menus and modules menus
//var_dump($newmenu->liste); //
$menuArbo = new Menubase ( $db , 'eldy' );
$newmenu = $menuArbo -> menuLeftCharger ( $newmenu , $mainmenu , $leftmenu , ( empty ( $user -> socid ) ? 0 : 1 ), 'eldy' , $tabMenu );
//var_dump($newmenu->liste); //
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'ftp' ) && $mainmenu == 'ftp' ) { // Entry for FTP
2022-03-03 11:29:47 +01:00
$MAXFTP = 20 ;
$i = 1 ;
while ( $i <= $MAXFTP ) {
$paramkey = 'FTP_NAME_' . $i ;
//print $paramkey;
2024-07-03 20:05:29 +02:00
if ( getDolGlobalString ( $paramkey )) {
2022-03-03 11:29:47 +01:00
$link = " /ftp/index.php?idmenu= " . $_SESSION [ " idmenu " ] . " &numero_ftp= " . $i ;
$newmenu -> add ( $link , dol_trunc ( $conf -> global -> $paramkey , 24 ));
2016-02-16 12:46:39 +01:00
}
2022-03-03 11:29:47 +01:00
$i ++ ;
2013-02-24 21:16:36 +01:00
}
}
2022-03-03 11:29:47 +01:00
}
2013-02-24 21:16:36 +01:00
2022-07-26 16:14:19 +02:00
//var_dump($tabMenu);
2022-03-03 11:29:47 +01:00
//var_dump($newmenu->liste);
2013-02-24 21:16:36 +01:00
2022-03-03 11:29:47 +01:00
// Build final $menu_array = $menu_array_before +$newmenu->liste + $menu_array_after
//var_dump($menu_array_before);exit;
//var_dump($menu_array_after);exit;
$menu_array = $newmenu -> liste ;
if ( is_array ( $menu_array_before )) {
$menu_array = array_merge ( $menu_array_before , $menu_array );
}
if ( is_array ( $menu_array_after )) {
$menu_array = array_merge ( $menu_array , $menu_array_after );
}
//var_dump($menu_array);exit;
if ( ! is_array ( $menu_array )) {
return 0 ;
}
// Allow the $menu_array of the menu to be manipulated by modules
$parameters = array (
'mainmenu' => $mainmenu ,
);
$hook_items = $menu_array ;
2025-02-04 01:17:07 +01:00
$reshook = $hookmanager -> executeHooks ( 'menuLeftMenuItems' , $parameters , $hook_items ); // Note that $action and $object may have been modified by some hooks @phan-suppress-current-line PhanTypeMismatchArgument
2022-03-03 11:29:47 +01:00
if ( is_numeric ( $reshook )) {
2023-02-15 12:10:32 +01:00
if ( $reshook == 0 && ! empty ( $hookmanager -> resArray )) {
$menu_array [] = $hookmanager -> resArray ; // add
2022-03-03 11:29:47 +01:00
} elseif ( $reshook == 1 ) {
2023-02-15 12:10:32 +01:00
$menu_array = $hookmanager -> resArray ; // replace
2022-03-02 22:41:00 +01:00
}
2022-03-03 11:29:47 +01:00
// @todo Sort menu items by 'position' value
// $position = array();
// foreach ($menu_array as $key => $row) {
// $position[$key] = $row['position'];
// }
2022-06-03 14:14:53 +02:00
// $array1_sort_order = SORT_ASC;
// array_multisort($position, $array1_sort_order, $menu_array);
2022-03-03 11:29:47 +01:00
}
// TODO Use the position property in menu_array to reorder the $menu_array
//var_dump($menu_array);
/* $new_menu_array = array ();
2022-03-19 15:03:32 +01:00
$level = 0 ; $cusor = 0 ; $position = 0 ;
$nbentry = count ( $menu_array );
while ( findNextEntryForLevel ( $menu_array , $cursor , $position , $level ))
{
2022-03-03 11:29:47 +01:00
2022-03-19 15:03:32 +01:00
$cursor ++ ;
} */
2022-03-03 11:29:47 +01:00
2024-03-13 15:06:34 +01:00
// Force the typing at this point to get useful analysis below:
'@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' ;
2022-03-03 11:29:47 +01:00
// Show menu
2023-11-27 11:39:32 +01:00
$invert = ! getDolGlobalString ( 'MAIN_MENU_INVERT' ) ? " " : " invert " ;
2022-03-03 11:29:47 +01:00
if ( empty ( $noout )) {
$altok = 0 ;
$blockvmenuopened = false ;
$lastlevel0 = '' ;
$num = count ( $menu_array );
2024-03-13 15:06:34 +01:00
foreach ( array_keys ( $menu_array ) as $i ) { // Loop on each menu entry (got better static analysis)
2022-03-03 11:29:47 +01:00
$showmenu = true ;
2023-11-27 11:39:32 +01:00
if ( getDolGlobalString ( 'MAIN_MENU_HIDE_UNAUTHORIZED' ) && empty ( $menu_array [ $i ][ 'enabled' ])) {
2022-03-03 11:29:47 +01:00
$showmenu = false ;
}
// Begin of new left menu block
if ( empty ( $menu_array [ $i ][ 'level' ]) && $showmenu ) {
$altok ++ ;
$blockvmenuopened = true ;
$lastopened = true ;
for ( $j = ( $i + 1 ); $j < $num ; $j ++ ) {
if ( empty ( $menu_array [ $j ][ 'level' ])) {
$lastopened = false ;
}
}
if ( $altok % 2 == 0 ) {
print '<div class="blockvmenu blockvmenuimpair' . $invert . ( $lastopened ? ' blockvmenulast' : '' ) . ( $altok == 1 ? ' blockvmenufirst' : '' ) . '">' . " \n " ;
} else {
print '<div class="blockvmenu blockvmenupair' . $invert . ( $lastopened ? ' blockvmenulast' : '' ) . ( $altok == 1 ? ' blockvmenufirst' : '' ) . '">' . " \n " ;
}
}
// Add tabulation
$tabstring = '' ;
$tabul = ( $menu_array [ $i ][ 'level' ] - 1 );
if ( $tabul > 0 ) {
for ( $j = 0 ; $j < $tabul ; $j ++ ) {
$tabstring .= ' ' ;
}
}
// $menu_array[$i]['url'] can be a relative url, a full external url. We try substitution
$menu_array [ $i ][ 'url' ] = make_substitutions ( $menu_array [ $i ][ 'url' ], $substitarray );
$url = $shorturl = $shorturlwithoutparam = $menu_array [ $i ][ 'url' ];
if ( ! preg_match ( " /^(http: \ / \ /|https: \ / \ /)/i " , $menu_array [ $i ][ 'url' ])) {
$tmp = explode ( '?' , $menu_array [ $i ][ 'url' ], 2 );
$url = $shorturl = $tmp [ 0 ];
$param = ( isset ( $tmp [ 1 ]) ? $tmp [ 1 ] : '' ); // params in url of the menu link
// Complete param to force leftmenu to '' to close open menu when we click on a link with no leftmenu defined.
if (( ! preg_match ( '/mainmenu/i' , $param )) && ( ! preg_match ( '/leftmenu/i' , $param )) && ! empty ( $menu_array [ $i ][ 'mainmenu' ])) {
$param .= ( $param ? '&' : '' ) . 'mainmenu=' . $menu_array [ $i ][ 'mainmenu' ] . '&leftmenu=' ;
}
if (( ! preg_match ( '/mainmenu/i' , $param )) && ( ! preg_match ( '/leftmenu/i' , $param )) && empty ( $menu_array [ $i ][ 'mainmenu' ])) {
$param .= ( $param ? '&' : '' ) . 'leftmenu=' ;
}
//$url.="idmenu=".$menu_array[$i]['rowid']; // Already done by menuLoad
$url = dol_buildpath ( $url , 1 ) . ( $param ? '?' . $param : '' );
$shorturlwithoutparam = $shorturl ;
2024-08-07 02:53:45 +02:00
$shorturl .= ( $param ? '?' . $param : '' );
2022-03-03 11:29:47 +01:00
}
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 " ;
// Menu level 0
if ( $menu_array [ $i ][ 'level' ] == 0 ) {
if ( $menu_array [ $i ][ 'enabled' ]) { // Enabled so visible
print '<div class="menu_titre">' . $tabstring ;
if ( $shorturlwithoutparam ) {
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' ] . '"' : '' ) . '>' ;
} else {
print '<span class="vmenu">' ;
}
2023-08-05 12:37:25 +02:00
if ( ! empty ( $menu_array [ $i ][ 'prefix' ])) {
2023-10-13 15:00:51 +02:00
if ( preg_match ( '/^fa\-[a-zA-Z0-9\-_]+$/' , $menu_array [ $i ][ 'prefix' ])) {
print '<span class="fas ' . $menu_array [ $i ][ 'prefix' ] . ' paddingright pictofixedwidth"></span>' ;
2023-08-05 12:37:25 +02:00
} else {
print $menu_array [ $i ][ 'prefix' ];
}
}
print $menu_array [ $i ][ 'titre' ];
2022-03-03 11:29:47 +01:00
if ( $shorturlwithoutparam ) {
print '</a>' ;
} else {
print '</span>' ;
}
print '</div>' . " \n " ;
$lastlevel0 = 'enabled' ;
} elseif ( $showmenu ) { // Not enabled but visible (so greyed)
print '<div class="menu_titre">' . $tabstring ;
2024-05-16 16:06:31 +02:00
print '<span class="vmenudisabled" title="' . dolPrintHTMLForAttribute ( $menu_array [ $i ][ 'titre' ]) . '">' ;
2023-08-05 12:37:25 +02:00
if ( ! empty ( $menu_array [ $i ][ 'prefix' ])) {
print $menu_array [ $i ][ 'prefix' ];
}
print $menu_array [ $i ][ 'titre' ];
2022-03-03 11:29:47 +01:00
print '</span>' ;
print '</div>' . " \n " ;
$lastlevel0 = 'greyed' ;
} else {
$lastlevel0 = 'hidden' ;
}
if ( $showmenu ) {
print '<div class="menu_top"></div>' . " \n " ;
}
}
// Menu level > 0
if ( $menu_array [ $i ][ 'level' ] > 0 ) {
$cssmenu = '' ;
if ( $menu_array [ $i ][ 'url' ]) {
$cssmenu = ' menu_contenu' . dol_string_nospecial ( preg_replace ( '/\.php.*$/' , '' , $menu_array [ $i ][ 'url' ]));
}
if ( $menu_array [ $i ][ 'enabled' ] && $lastlevel0 == 'enabled' ) {
// Enabled so visible, except if parent was not enabled.
print '<div class="menu_contenu' . $cssmenu . '">' ;
print $tabstring ;
if ( $shorturlwithoutparam ) {
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' ] . '"' : '' ) . '>' ;
} else {
print '<span class="vsmenu" title="' . dol_escape_htmltag ( $menu_array [ $i ][ 'titre' ]) . '">' ;
}
print $menu_array [ $i ][ 'titre' ];
if ( $shorturlwithoutparam ) {
print '</a>' ;
} else {
print '</span>' ;
}
// If title is not pure text and contains a table, no carriage return added
if ( ! strstr ( $menu_array [ $i ][ 'titre' ], '<table' )) {
print '<br>' ;
}
print '</div>' . " \n " ;
} elseif ( $showmenu && $lastlevel0 == 'enabled' ) {
// Not enabled but visible (so greyed), except if parent was not enabled.
print '<div class="menu_contenu' . $cssmenu . '">' ;
print $tabstring ;
2024-05-16 16:06:31 +02:00
print '<span class="vsmenudisabled vsmenudisabledmargin" title="' . dolPrintHTMLForAttribute ( $menu_array [ $i ][ 'titre' ]) . '">' . $menu_array [ $i ][ 'titre' ] . '</span><br>' ;
2022-03-03 11:29:47 +01:00
print '</div>' . " \n " ;
}
}
// If next is a new block or if there is nothing after
if ( empty ( $menu_array [ $i + 1 ][ 'level' ])) { // End menu block
if ( $showmenu ) {
print '<div class="menu_end"></div>' . " \n " ;
}
if ( $blockvmenuopened ) {
print '</div>' . " \n " ;
$blockvmenuopened = false ;
}
}
2022-03-02 22:41:00 +01:00
}
2022-03-03 11:29:47 +01:00
if ( $altok ) {
print '<div class="blockvmenuend"></div>' ; // End menu block
2022-03-02 22:41:00 +01:00
}
}
2022-03-03 11:29:47 +01:00
return count ( $menu_array );
2022-03-02 22:41:00 +01:00
}
2022-03-03 11:29:47 +01:00
2022-03-02 22:41:00 +01:00
/**
2022-03-03 11:29:47 +01:00
* Get left Menu HOME
2022-03-02 22:41:00 +01:00
*
2022-03-19 15:03:32 +01:00
* @ param string $mainmenu Main menu
* @ param Menu $newmenu Object Menu to return back list of menu entries
2023-12-15 13:54:56 +01:00
* @ param int $usemenuhider Use menu hider
2022-03-19 15:03:32 +01:00
* @ param string $leftmenu Left menu
* @ param int $type_user Type of user
2022-03-02 22:41:00 +01:00
* @ return void
*/
2022-03-03 11:29:47 +01:00
function get_left_menu_home ( $mainmenu , & $newmenu , $usemenuhider = 1 , $leftmenu = 'none' , $type_user = 0 )
2022-03-02 22:41:00 +01:00
{
global $user , $conf , $langs ;
2022-03-03 11:29:47 +01:00
if ( $mainmenu == 'home' ) {
$langs -> load ( " users " );
2022-03-02 22:41:00 +01:00
2022-03-03 11:29:47 +01:00
// Home - dashboard
2023-09-28 01:00:36 +02:00
$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>' );
2022-03-03 11:29:47 +01:00
// Setup
$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>' );
if ( $usemenuhider || empty ( $leftmenu ) || $leftmenu == " setup " ) {
2024-06-19 18:21:19 +02:00
// Define $nbmodulesnotautoenabled - TODO This code is at different places
2023-02-09 00:47:33 +01:00
$nbmodulesnotautoenabled = count ( $conf -> modules );
2024-06-19 18:21:19 +02:00
$listofmodulesautoenabled = array ( 'agenda' , 'fckeditor' , 'export' , 'import' );
foreach ( $listofmodulesautoenabled as $moduleautoenable ) {
if ( in_array ( $moduleautoenable , $conf -> modules )) {
$nbmodulesnotautoenabled -- ;
}
2023-12-04 12:07:53 +01:00
}
2023-02-09 00:47:33 +01:00
2022-03-03 11:29:47 +01:00
// Load translation files required by the page
$langs -> loadLangs ( array ( " admin " , " help " ));
$warnpicto = '' ;
2023-11-27 11:39:32 +01:00
if ( ! getDolGlobalString ( 'MAIN_INFO_SOCIETE_NOM' ) || ! getDolGlobalString ( 'MAIN_INFO_SOCIETE_COUNTRY' ) || getDolGlobalString ( 'MAIN_INFO_SOCIETE_SETUP_TODO_WARNING' )) {
2022-03-03 11:29:47 +01:00
$langs -> load ( " errors " );
$warnpicto = img_warning ( $langs -> trans ( " WarningMandatorySetupNotComplete " ));
}
$newmenu -> add ( " /admin/company.php?mainmenu=home " , $langs -> trans ( " MenuCompanySetup " ) . $warnpicto , 1 );
$warnpicto = '' ;
2023-02-09 00:47:33 +01:00
if ( $nbmodulesnotautoenabled <= getDolGlobalInt ( 'MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING' , 1 )) { // If only user module enabled
2022-03-03 11:29:47 +01:00
$langs -> load ( " errors " );
$warnpicto = img_warning ( $langs -> trans ( " WarningMandatorySetupNotComplete " ));
}
$newmenu -> add ( " /admin/modules.php?mainmenu=home " , $langs -> trans ( " Modules " ) . $warnpicto , 1 );
$newmenu -> add ( " /admin/ihm.php?mainmenu=home " , $langs -> trans ( " GUISetup " ), 1 );
$newmenu -> add ( " /admin/menus.php?mainmenu=home " , $langs -> trans ( " Menus " ), 1 );
$newmenu -> add ( " /admin/translation.php?mainmenu=home " , $langs -> trans ( " Translation " ), 1 );
$newmenu -> add ( " /admin/defaultvalues.php?mainmenu=home " , $langs -> trans ( " DefaultValues " ), 1 );
$newmenu -> add ( " /admin/boxes.php?mainmenu=home " , $langs -> trans ( " Boxes " ), 1 );
$newmenu -> add ( " /admin/delais.php?mainmenu=home " , $langs -> trans ( " MenuWarnings " ), 1 );
$newmenu -> add ( " /admin/security_other.php?mainmenu=home " , $langs -> trans ( " Security " ), 1 );
$newmenu -> add ( " /admin/limits.php?mainmenu=home " , $langs -> trans ( " MenuLimits " ), 1 );
$newmenu -> add ( " /admin/pdf.php?mainmenu=home " , $langs -> trans ( " PDF " ), 1 );
$warnpicto = '' ;
2024-09-07 15:24:53 +02:00
/* No warning into menu entry , the message in Email setup page is enough
A warning will be important if a DMARC record exists and SPF is not aligned .
2023-11-27 11:39:32 +01:00
if ( getDolGlobalString ( 'MAIN_MAIL_SENDMODE' , 'mail' ) == 'mail' && ! getDolGlobalString ( 'MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP' )) {
2022-03-03 11:29:47 +01:00
$langs -> load ( " errors " );
$warnpicto = img_warning ( $langs -> trans ( " WarningPHPMailD " ));
}
2024-09-07 15:24:53 +02:00
*/
if ( getDolGlobalString ( 'MAIN_MAIL_SENDMODE' ) && in_array ( getDolGlobalString ( 'MAIN_MAIL_SENDMODE' ), array ( 'smtps' , 'swiftmail' )) && ! getDolGlobalString ( 'MAIN_MAIL_SMTP_SERVER' )) {
2022-03-03 11:29:47 +01:00
$langs -> load ( " errors " );
$warnpicto = img_warning ( $langs -> trans ( " ErrorSetupOfEmailsNotComplete " ));
}
$newmenu -> add ( " /admin/mails.php?mainmenu=home " , $langs -> trans ( " Emails " ) . $warnpicto , 1 );
$newmenu -> add ( " /admin/sms.php?mainmenu=home " , $langs -> trans ( " SMS " ), 1 );
$newmenu -> add ( " /admin/dict.php?mainmenu=home " , $langs -> trans ( " Dictionary " ), 1 );
$newmenu -> add ( " /admin/const.php?mainmenu=home " , $langs -> trans ( " OtherSetup " ), 1 );
}
// System tools
$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>' );
if ( $usemenuhider || empty ( $leftmenu ) || preg_match ( '/^admintools/' , $leftmenu )) {
// Load translation files required by the page
$langs -> loadLangs ( array ( 'admin' , 'help' ));
$newmenu -> add ( '/admin/system/dolibarr.php?mainmenu=home&leftmenu=admintools_info' , $langs -> trans ( 'InfoDolibarr' ), 1 );
if ( $usemenuhider || empty ( $leftmenu ) || $leftmenu == 'admintools_info' ) {
$newmenu -> add ( '/admin/system/modules.php?mainmenu=home&leftmenu=admintools_info' , $langs -> trans ( 'Modules' ), 2 );
$newmenu -> add ( '/admin/triggers.php?mainmenu=home&leftmenu=admintools_info' , $langs -> trans ( 'Triggers' ), 2 );
$newmenu -> add ( '/admin/system/filecheck.php?mainmenu=home&leftmenu=admintools_info' , $langs -> trans ( 'FileCheck' ), 2 );
}
$newmenu -> add ( '/admin/system/browser.php?mainmenu=home&leftmenu=admintools' , $langs -> trans ( 'InfoBrowser' ), 1 );
$newmenu -> add ( '/admin/system/os.php?mainmenu=home&leftmenu=admintools' , $langs -> trans ( 'InfoOS' ), 1 );
$newmenu -> add ( '/admin/system/web.php?mainmenu=home&leftmenu=admintools' , $langs -> trans ( 'InfoWebServer' ), 1 );
$newmenu -> add ( '/admin/system/phpinfo.php?mainmenu=home&leftmenu=admintools' , $langs -> trans ( 'InfoPHP' ), 1 );
$newmenu -> add ( '/admin/system/database.php?mainmenu=home&leftmenu=admintools' , $langs -> trans ( 'InfoDatabase' ), 1 );
$newmenu -> add ( " /admin/system/perf.php?mainmenu=home&leftmenu=admintools " , $langs -> trans ( " InfoPerf " ), 1 );
$newmenu -> add ( " /admin/system/security.php?mainmenu=home&leftmenu=admintools " , $langs -> trans ( " InfoSecurity " ), 1 );
2023-07-28 18:49:03 +02:00
$newmenu -> add ( " /admin/tools/listevents.php?mainmenu=home&leftmenu=admintools " , $langs -> trans ( " Audit " ), 1 );
$newmenu -> add ( " /admin/tools/listsessions.php?mainmenu=home&leftmenu=admintools " , $langs -> trans ( " Sessions " ), 1 );
2022-03-03 11:29:47 +01:00
$newmenu -> add ( " /admin/tools/dolibarr_export.php?mainmenu=home&leftmenu=admintools " , $langs -> trans ( " Backup " ), 1 );
$newmenu -> add ( " /admin/tools/dolibarr_import.php?mainmenu=home&leftmenu=admintools " , $langs -> trans ( " Restore " ), 1 );
$newmenu -> add ( " /admin/tools/update.php?mainmenu=home&leftmenu=admintools " , $langs -> trans ( " MenuUpgrade " ), 1 );
$newmenu -> add ( " /admin/tools/purge.php?mainmenu=home&leftmenu=admintools " , $langs -> trans ( " Purge " ), 1 );
2024-10-28 01:47:39 +01:00
$newmenu -> add ( '/admin/system/about.php?mainmenu=home&leftmenu=admintools_info' , $langs -> trans ( 'ExternalResources' ), 1 );
2022-03-03 11:29:47 +01:00
2024-10-25 19:12:13 +02:00
/* Already into menu Tools
if ( isModEnabled ( 'blockedlog' )) {
$langs -> load ( " blockedlog " );
$newmenu -> add ( " /blockedlog/admin/blockedlog_list.php?mainmenu=home&leftmenu=admintools " , $langs -> trans ( " BrowseBlockedLog " ), 1 , $user -> admin );
}
*/
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'product' ) || isModEnabled ( 'service' )) {
2022-03-03 11:29:47 +01:00
$langs -> load ( " products " );
$newmenu -> add ( " /product/admin/product_tools.php?mainmenu=home&leftmenu=admintools " , $langs -> trans ( " ProductVatMassChange " ), 1 , $user -> admin );
}
}
2022-09-06 15:37:00 +02:00
$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"' ));
if ( $user -> hasRight ( 'user' , 'user' , 'read' )) {
2022-03-03 11:29:47 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || $leftmenu == " users " ) {
2025-02-04 01:17:07 +01:00
$newmenu -> add ( " " , $langs -> trans ( " Users " ), 1 , ( int ) ( $user -> hasRight ( 'user' , 'user' , 'read' ) || $user -> admin ));
$newmenu -> add ( " /user/card.php?leftmenu=users&action=create " , $langs -> trans ( " NewUser " ), 2 , ( int ) (( $user -> hasRight ( " user " , " user " , " write " ) || $user -> admin ) && ! ( isModEnabled ( 'multicompany' ) && ! empty ( $user -> entity ) && getDolGlobalString ( 'MULTICOMPANY_TRANSVERSE_MODE' ))), '' , 'home' );
$newmenu -> add ( " /user/list.php?leftmenu=users " , $langs -> trans ( " ListOfUsers " ), 2 , ( int ) ( $user -> hasRight ( 'user' , 'user' , 'read' ) || $user -> admin ));
$newmenu -> add ( " /user/hierarchy.php?leftmenu=users " , $langs -> trans ( " HierarchicView " ), 2 , ( int ) ( $user -> hasRight ( 'user' , 'user' , 'read' ) || $user -> admin ));
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'category' )) {
2022-03-03 11:29:47 +01:00
$langs -> load ( " categories " );
2024-04-09 23:55:07 +02:00
$newmenu -> add ( " /categories/index.php?leftmenu=users&type=7 " , $langs -> trans ( " UsersCategoriesShort " ), 2 , $user -> hasRight ( 'categorie' , 'read' ), '' , $mainmenu , 'cat' );
2022-03-03 11:29:47 +01:00
}
2025-02-04 01:17:07 +01:00
$newmenu -> add ( " " , $langs -> trans ( " Groups " ), 1 , ( int ) (( $user -> hasRight ( 'user' , 'user' , 'read' ) || $user -> admin ) && ! ( isModEnabled ( 'multicompany' ) && ! empty ( $user -> entity ) && getDolGlobalString ( 'MULTICOMPANY_TRANSVERSE_MODE' ))));
$newmenu -> add ( " /user/group/card.php?leftmenu=users&action=create " , $langs -> trans ( " NewGroup " ), 2 , ( int ) ((( 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' ))));
$newmenu -> add ( " /user/group/list.php?leftmenu=users " , $langs -> trans ( " ListOfGroups " ), 2 , ( int ) (( getDolGlobalString ( 'MAIN_USE_ADVANCED_PERMS' ) ? $user -> hasRight ( 'user' , 'group_advance' , 'read' ) : $user -> hasRight ( 'user' , 'user' , 'read' )) || $user -> admin ));
2022-03-03 11:29:47 +01:00
}
}
}
}
/**
* Get left Menu THIRDPARTIES
*
2022-03-19 15:03:32 +01:00
* @ param string $mainmenu Main menu
* @ param Menu $newmenu Object Menu to return back list of menu entries
2023-12-15 13:54:56 +01:00
* @ param int $usemenuhider Use menu hider
2022-03-19 15:03:32 +01:00
* @ param string $leftmenu Left menu
* @ param int $type_user Type of targeted user for menu
2022-03-03 11:29:47 +01:00
* @ return void
*/
function get_left_menu_thridparties ( $mainmenu , & $newmenu , $usemenuhider = 1 , $leftmenu = 'none' , $type_user = 0 )
{
global $user , $conf , $langs ;
if ( $mainmenu == 'companies' ) {
// Societes
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'societe' )) {
2022-03-03 11:29:47 +01:00
$langs -> load ( " companies " );
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /societe/index.php?leftmenu=thirdparties " , $langs -> trans ( " ThirdParty " ), 0 , $user -> hasRight ( 'societe' , 'lire' ), '' , $mainmenu , 'thirdparties' , 0 , '' , '' , '' , img_picto ( '' , 'company' , 'class="paddingright pictofixedwidth"' ));
2022-03-03 11:29:47 +01:00
2023-12-04 12:07:53 +01:00
if ( $user -> hasRight ( 'societe' , 'creer' )) {
2022-03-03 11:29:47 +01:00
$newmenu -> add ( " /societe/card.php?action=create " , $langs -> trans ( " MenuNewThirdParty " ), 1 );
if ( ! $conf -> use_javascript_ajax ) {
$newmenu -> add ( " /societe/card.php?action=create&private=1 " , $langs -> trans ( " MenuNewPrivateIndividual " ), 1 );
}
}
}
2024-07-15 18:00:45 +02:00
$newmenu -> add ( " /societe/list.php?leftmenu=thirdparties " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'societe' , 'lire' ), '' , $mainmenu , 'thirdparties_list' , 2 );
2022-03-03 11:29:47 +01:00
// Prospects
2023-11-27 11:39:32 +01:00
if ( isModEnabled ( 'societe' ) && ! getDolGlobalString ( 'SOCIETE_DISABLE_PROSPECTS' )) {
2022-03-03 11:29:47 +01:00
$langs -> load ( " commercial " );
2024-07-15 17:29:08 +02:00
$newmenu -> add ( " /societe/list.php?type=p&leftmenu=prospects " , $langs -> trans ( " Prospects " ), 2 , $user -> hasRight ( 'societe' , 'lire' ), '' , $mainmenu , 'prospects' , 5 );
2025-01-09 13:54:25 +01:00
$newmenu -> add ( " /societe/card.php?leftmenu=prospects&action=create&type=p " , $langs -> trans ( " MenuNewProspect " ), 3 , $user -> hasRight ( 'societe' , 'creer' ));
2022-03-03 11:29:47 +01:00
}
// Customers/Prospects
2023-11-27 11:39:32 +01:00
if ( isModEnabled ( 'societe' ) && ! getDolGlobalString ( 'SOCIETE_DISABLE_CUSTOMERS' )) {
2022-03-03 11:29:47 +01:00
$langs -> load ( " commercial " );
2024-07-15 17:29:08 +02:00
$newmenu -> add ( " /societe/list.php?type=c&leftmenu=customers " , $langs -> trans ( " Customers " ), 2 , $user -> hasRight ( 'societe' , 'lire' ), '' , $mainmenu , 'customers' , 10 );
2022-03-03 11:29:47 +01:00
2025-01-09 13:54:25 +01:00
$newmenu -> add ( " /societe/card.php?leftmenu=customers&action=create&type=c " , $langs -> trans ( " MenuNewCustomer " ), 3 , $user -> hasRight ( 'societe' , 'creer' ));
2022-03-03 11:29:47 +01:00
}
// Suppliers
2023-04-18 16:15:13 +02:00
if ( isModEnabled ( 'societe' ) && ( isModEnabled ( 'supplier_order' ) || isModEnabled ( 'supplier_invoice' ) || isModEnabled ( 'supplier_proposal' ))) {
2022-03-03 11:29:47 +01:00
$langs -> load ( " suppliers " );
2025-02-04 01:17:07 +01:00
$newmenu -> add ( " /societe/list.php?type=f&leftmenu=suppliers " , $langs -> trans ( " Suppliers " ), 2 , ( int ) ( $user -> hasRight ( 'fournisseur' , 'lire' ) || $user -> hasRight ( 'supplier_order' , 'lire' ) || $user -> hasRight ( 'supplier_invoice' , 'lire' ) || $user -> hasRight ( 'supplier_proposal' , 'lire' )), '' , $mainmenu , 'suppliers' , 15 );
2024-07-15 17:29:08 +02:00
2025-02-04 01:17:07 +01:00
$newmenu -> add ( " /societe/card.php?leftmenu=suppliers&action=create&type=f " , $langs -> trans ( " MenuNewSupplier " ), 3 , ( int ) ( $user -> hasRight ( 'societe' , 'creer' ) && ( $user -> hasRight ( 'fournisseur' , 'lire' ) || $user -> hasRight ( 'supplier_order' , 'lire' ) || $user -> hasRight ( 'supplier_invoice' , 'lire' ) || $user -> hasRight ( 'supplier_proposal' , 'lire' ))));
2022-03-03 11:29:47 +01:00
}
// Categories
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'category' )) {
2022-03-03 11:29:47 +01:00
$langs -> load ( " categories " );
2023-11-27 11:39:32 +01:00
if ( ! getDolGlobalString ( 'SOCIETE_DISABLE_PROSPECTS' ) || ! getDolGlobalString ( 'SOCIETE_DISABLE_CUSTOMERS' )) {
2022-03-03 11:29:47 +01:00
// Categories prospects/customers
$menutoshow = $langs -> trans ( " CustomersProspectsCategoriesShort " );
2023-11-27 11:39:32 +01:00
if ( getDolGlobalString ( 'SOCIETE_DISABLE_PROSPECTS' )) {
2022-03-03 11:29:47 +01:00
$menutoshow = $langs -> trans ( " CustomersCategoriesShort " );
}
2023-11-27 11:39:32 +01:00
if ( getDolGlobalString ( 'SOCIETE_DISABLE_CUSTOMERS' )) {
2022-03-03 11:29:47 +01:00
$menutoshow = $langs -> trans ( " ProspectsCategoriesShort " );
}
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /categories/index.php?leftmenu=cat&type=2 " , $menutoshow , 1 , $user -> hasRight ( 'categorie' , 'lire' ), '' , $mainmenu , 'cat' );
2022-03-03 11:29:47 +01:00
}
// Categories suppliers
2023-04-18 16:15:13 +02:00
if ( isModEnabled ( 'supplier_proposal' ) || isModEnabled ( 'supplier_order' ) || isModEnabled ( 'supplier_invoice' )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /categories/index.php?leftmenu=catfournish&type=1 " , $langs -> trans ( " SuppliersCategoriesShort " ), 1 , $user -> hasRight ( 'categorie' , 'lire' ));
2022-03-03 11:29:47 +01:00
}
}
// Contacts
2023-12-04 12:07:53 +01:00
$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"' ));
2022-03-03 11:29:47 +01:00
2025-01-09 13:54:25 +01:00
$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' ));
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /contact/list.php?leftmenu=contacts " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'societe' , 'contact' , 'lire' ));
2023-11-27 11:39:32 +01:00
if ( ! getDolGlobalString ( 'SOCIETE_DISABLE_PROSPECTS' )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /contact/list.php?leftmenu=contacts&type=p " , $langs -> trans ( " Prospects " ), 2 , $user -> hasRight ( 'societe' , 'contact' , 'lire' ));
2022-03-03 11:29:47 +01:00
}
2023-11-27 11:39:32 +01:00
if ( ! getDolGlobalString ( 'SOCIETE_DISABLE_CUSTOMERS' )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /contact/list.php?leftmenu=contacts&type=c " , $langs -> trans ( " Customers " ), 2 , $user -> hasRight ( 'societe' , 'contact' , 'lire' ));
2022-03-03 11:29:47 +01:00
}
2023-04-18 16:15:13 +02:00
if ( isModEnabled ( 'supplier_proposal' ) || isModEnabled ( 'supplier_order' ) || isModEnabled ( 'supplier_invoice' )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /contact/list.php?leftmenu=contacts&type=f " , $langs -> trans ( " Suppliers " ), 2 , $user -> hasRight ( 'fournisseur' , 'lire' ));
2022-03-03 11:29:47 +01:00
}
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /contact/list.php?leftmenu=contacts&type=o " , $langs -> trans ( " ContactOthers " ), 2 , $user -> hasRight ( 'societe' , 'contact' , 'lire' ));
2022-09-06 15:37:00 +02:00
//$newmenu->add("/contact/list.php?userid=$user->id", $langs->trans("MyContacts"), 1, $user->hasRight('societe', 'contact', 'lire'));
2022-03-03 11:29:47 +01:00
// Categories
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'category' )) {
2022-03-03 11:29:47 +01:00
$langs -> load ( " categories " );
// Categories Contact
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /categories/index.php?leftmenu=catcontact&type=4 " , $langs -> trans ( " ContactCategoriesShort " ), 1 , $user -> hasRight ( 'categorie' , 'lire' ), '' , $mainmenu , 'cat' );
2022-03-03 11:29:47 +01:00
}
}
}
/**
* Get left Menu COMMERCIAL ( propal , commande , supplier_proposal , supplier_order , contrat , ficheinter )
*
2022-03-19 15:03:32 +01:00
* @ param string $mainmenu Main menu
* @ param Menu $newmenu Object Menu to return back list of menu entries
2023-12-15 13:54:56 +01:00
* @ param int $usemenuhider Use menu hider
2022-03-19 15:03:32 +01:00
* @ param string $leftmenu Left menu
* @ param int $type_user Type of targeted user for menu
2022-03-03 11:29:47 +01:00
* @ return void
*/
function get_left_menu_commercial ( $mainmenu , & $newmenu , $usemenuhider = 1 , $leftmenu = 'none' , $type_user = 0 )
{
2024-04-03 15:30:10 +02:00
global $user , $langs ;
2022-03-03 11:29:47 +01:00
if ( $mainmenu == 'commercial' ) {
$langs -> load ( " companies " );
// Customer proposal
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'propal' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " propal " );
2023-12-04 12:07:53 +01:00
$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"' ));
$newmenu -> add ( " /comm/propal/card.php?action=create&leftmenu=propals " , $langs -> trans ( " NewPropal " ), 1 , $user -> hasRight ( 'propal' , 'write' ));
$newmenu -> add ( " /comm/propal/list.php?leftmenu=propals " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'propal' , 'read' ));
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || $leftmenu == " propals " ) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /comm/propal/list.php?leftmenu=propals&search_status=0 " , $langs -> trans ( " PropalsDraft " ), 2 , $user -> hasRight ( 'propal' , 'read' ));
$newmenu -> add ( " /comm/propal/list.php?leftmenu=propals&search_status=1 " , $langs -> trans ( " PropalsOpened " ), 2 , $user -> hasRight ( 'propal' , 'read' ));
$newmenu -> add ( " /comm/propal/list.php?leftmenu=propals&search_status=2 " , $langs -> trans ( " PropalStatusSigned " ), 2 , $user -> hasRight ( 'propal' , 'read' ));
$newmenu -> add ( " /comm/propal/list.php?leftmenu=propals&search_status=3 " , $langs -> trans ( " PropalStatusNotSigned " ), 2 , $user -> hasRight ( 'propal' , 'read' ));
$newmenu -> add ( " /comm/propal/list.php?leftmenu=propals&search_status=4 " , $langs -> trans ( " PropalStatusBilled " ), 2 , $user -> hasRight ( 'propal' , 'read' ));
2022-09-07 16:39:19 +02:00
//$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=2,3,4", $langs->trans("PropalStatusClosedShort"), 2, $user->hasRight('propal', 'read'));
2022-03-02 22:41:00 +01:00
}
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /comm/propal/stats/index.php?leftmenu=propals " , $langs -> trans ( " Statistics " ), 1 , $user -> hasRight ( 'propal' , 'read' ));
2022-03-02 22:41:00 +01:00
}
// Customers orders
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'order' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " orders " );
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /commande/index.php?leftmenu=orders " , $langs -> trans ( " CustomersOrders " ), 0 , $user -> hasRight ( 'commande' , 'lire' ), '' , $mainmenu , 'orders' , 200 , '' , '' , '' , img_picto ( '' , 'order' , 'class="paddingright pictofixedwidth"' ));
$newmenu -> add ( " /commande/card.php?action=create&leftmenu=orders " , $langs -> trans ( " NewOrder " ), 1 , $user -> hasRight ( 'commande' , 'creer' ));
$newmenu -> add ( " /commande/list.php?leftmenu=orders " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'commande' , 'lire' ));
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || $leftmenu == " orders " ) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /commande/list.php?leftmenu=orders&search_status=0 " , $langs -> trans ( " StatusOrderDraftShort " ), 2 , $user -> hasRight ( 'commande' , 'lire' ));
$newmenu -> add ( " /commande/list.php?leftmenu=orders&search_status=1 " , $langs -> trans ( " StatusOrderValidated " ), 2 , $user -> hasRight ( 'commande' , 'lire' ));
2024-03-12 11:07:18 +01:00
if ( isModEnabled ( 'shipping' )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /commande/list.php?leftmenu=orders&search_status=2 " , $langs -> trans ( " StatusOrderSentShort " ), 2 , $user -> hasRight ( 'commande' , 'lire' ));
2022-03-02 22:41:00 +01:00
}
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /commande/list.php?leftmenu=orders&search_status=3 " , $langs -> trans ( " StatusOrderDelivered " ), 2 , $user -> hasRight ( 'commande' , 'lire' ));
2022-09-06 15:37:00 +02:00
//$newmenu->add("/commande/list.php?leftmenu=orders&search_status=4", $langs->trans("StatusOrderProcessed"), 2, $user->hasRight('commande', 'lire'));
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /commande/list.php?leftmenu=orders&search_status=-1 " , $langs -> trans ( " StatusOrderCanceledShort " ), 2 , $user -> hasRight ( 'commande' , 'lire' ));
2013-02-24 21:16:36 +01:00
}
2024-10-23 20:25:17 +02:00
if ( empty ( $user -> socid )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /commande/list_det.php?leftmenu=orders " , $langs -> trans ( " ListOrderLigne " ), 1 , $user -> hasRight ( 'commande' , 'lire' ));
2022-08-23 11:37:08 +02:00
}
2023-10-16 17:19:07 +02:00
if ( getDolGlobalInt ( 'MAIN_NEED_EXPORT_PERMISSION_TO_READ_STATISTICS' )) {
$newmenu -> add ( " /commande/stats/index.php?leftmenu=orders " , $langs -> trans ( " Statistics " ), 1 , $user -> hasRight ( 'commande' , 'commande' , 'export' ));
} else {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /commande/stats/index.php?leftmenu=orders " , $langs -> trans ( " Statistics " ), 1 , $user -> hasRight ( 'commande' , 'lire' ));
2023-10-16 17:19:07 +02:00
}
2025-02-14 14:29:49 +01:00
// Categories
2024-08-26 15:45:38 +02:00
if ( isModEnabled ( 'category' )) {
2025-02-14 14:29:49 +01:00
$langs -> load ( " categories " );
2022-12-15 21:27:03 +01:00
$newmenu -> add ( " /categories/index.php?leftmenu=cat&type=16 " , $langs -> trans ( " Categories " ), 1 , $user -> hasRight ( 'categorie' , 'lire' ), '' , $mainmenu , 'cat' );
2025-02-14 14:29:49 +01:00
}
2022-03-02 22:41:00 +01:00
}
2013-02-24 21:16:36 +01:00
2022-03-02 22:41:00 +01:00
// Supplier proposal
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'supplier_proposal' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " supplier_proposal " );
2023-12-04 12:07:53 +01:00
$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"' ));
$newmenu -> add ( " /supplier_proposal/card.php?action=create&leftmenu=supplier_proposals " , $langs -> trans ( " SupplierProposalNew " ), 1 , $user -> hasRight ( 'supplier_proposal' , 'creer' ));
$newmenu -> add ( " /supplier_proposal/list.php?leftmenu=supplier_proposals " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'supplier_proposal' , 'lire' ));
$newmenu -> add ( " /comm/propal/stats/index.php?leftmenu=supplier_proposals&mode=supplier " , $langs -> trans ( " Statistics " ), 1 , $user -> hasRight ( 'supplier_proposal' , 'lire' ));
2022-03-02 22:41:00 +01:00
}
2015-07-15 12:42:50 +02:00
2022-03-02 22:41:00 +01:00
// Suppliers orders
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'supplier_order' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " orders " );
2023-12-04 12:07:53 +01:00
$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"' ));
$newmenu -> add ( " /fourn/commande/card.php?action=create&leftmenu=orders_suppliers " , $langs -> trans ( " NewSupplierOrderShort " ), 1 , $user -> hasRight ( 'fournisseur' , 'commande' , 'creer' ));
$newmenu -> add ( " /fourn/commande/list.php?leftmenu=orders_suppliers " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'fournisseur' , 'commande' , 'lire' ));
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || $leftmenu == " orders_suppliers " ) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /fourn/commande/list.php?leftmenu=orders_suppliers&statut=0 " , $langs -> trans ( " StatusSupplierOrderDraftShort " ), 2 , $user -> hasRight ( 'fournisseur' , 'commande' , 'lire' ));
2023-11-27 11:39:32 +01:00
if ( ! getDolGlobalString ( 'SUPPLIER_ORDER_HIDE_VALIDATED' )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /fourn/commande/list.php?leftmenu=orders_suppliers&statut=1 " , $langs -> trans ( " StatusSupplierOrderValidated " ), 2 , $user -> hasRight ( 'fournisseur' , 'commande' , 'lire' ));
2022-03-02 22:41:00 +01:00
}
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /fourn/commande/list.php?leftmenu=orders_suppliers&statut=2 " , $langs -> trans ( " StatusSupplierOrderApprovedShort " ), 2 , $user -> hasRight ( 'fournisseur' , 'commande' , 'lire' ));
$newmenu -> add ( " /fourn/commande/list.php?leftmenu=orders_suppliers&statut=3 " , $langs -> trans ( " StatusSupplierOrderOnProcessShort " ), 2 , $user -> hasRight ( 'fournisseur' , 'commande' , 'lire' ));
$newmenu -> add ( " /fourn/commande/list.php?leftmenu=orders_suppliers&statut=4 " , $langs -> trans ( " StatusSupplierOrderReceivedPartiallyShort " ), 2 , $user -> hasRight ( 'fournisseur' , 'commande' , 'lire' ));
$newmenu -> add ( " /fourn/commande/list.php?leftmenu=orders_suppliers&statut=5 " , $langs -> trans ( " StatusSupplierOrderReceivedAll " ), 2 , $user -> hasRight ( 'fournisseur' , 'commande' , 'lire' ));
$newmenu -> add ( " /fourn/commande/list.php?leftmenu=orders_suppliers&statut=6,7 " , $langs -> trans ( " StatusSupplierOrderCanceled " ), 2 , $user -> hasRight ( 'fournisseur' , 'commande' , 'lire' ));
$newmenu -> add ( " /fourn/commande/list.php?leftmenu=orders_suppliers&statut=9 " , $langs -> trans ( " StatusSupplierOrderRefused " ), 2 , $user -> hasRight ( 'fournisseur' , 'commande' , 'lire' ));
2013-02-24 21:16:36 +01:00
}
2022-09-06 15:37:00 +02:00
// Billed is another field. We should add instead a dedicated filter on list. if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders_suppliers") $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&billed=1", $langs->trans("Billed"), 2, $user->hasRight('fournisseur', 'commande', 'lire'));
2022-03-02 22:41:00 +01:00
2023-10-16 17:19:07 +02:00
if ( getDolGlobalInt ( 'MAIN_NEED_EXPORT_PERMISSION_TO_READ_STATISTICS' )) {
$newmenu -> add ( " /commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier " , $langs -> trans ( " Statistics " ), 1 , $user -> hasRight ( 'fournisseur' , 'commande' , 'export' ));
} else {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier " , $langs -> trans ( " Statistics " ), 1 , $user -> hasRight ( 'fournisseur' , 'commande' , 'lire' ));
2023-10-16 17:19:07 +02:00
}
2022-03-02 22:41:00 +01:00
}
2013-02-24 21:16:36 +01:00
2022-03-02 22:41:00 +01:00
// Contrat
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'contract' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " contracts " );
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /contrat/index.php?leftmenu=contracts " , $langs -> trans ( " ContractsSubscriptions " ), 0 , $user -> hasRight ( 'contrat' , 'lire' ), '' , $mainmenu , 'contracts' , 2000 , '' , '' , '' , img_picto ( '' , 'contract' , 'class="paddingright pictofixedwidth"' ));
$newmenu -> add ( " /contrat/card.php?action=create&leftmenu=contracts " , $langs -> trans ( " NewContractSubscription " ), 1 , $user -> hasRight ( 'contrat' , 'creer' ));
$newmenu -> add ( " /contrat/list.php?leftmenu=contracts " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'contrat' , 'lire' ));
$newmenu -> add ( " /contrat/services_list.php?leftmenu=contracts " , $langs -> trans ( " MenuServices " ), 1 , $user -> hasRight ( 'contrat' , 'lire' ));
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || $leftmenu == " contracts " ) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /contrat/services_list.php?leftmenu=contracts&search_status=0 " , $langs -> trans ( " MenuInactiveServices " ), 2 , $user -> hasRight ( 'contrat' , 'lire' ));
$newmenu -> add ( " /contrat/services_list.php?leftmenu=contracts&search_status=4 " , $langs -> trans ( " MenuRunningServices " ), 2 , $user -> hasRight ( 'contrat' , 'lire' ));
2024-02-09 15:58:49 +01:00
$newmenu -> add ( " /contrat/services_list.php?leftmenu=contracts&search_status=4%26filter=expired " , $langs -> trans ( " MenuExpiredServices " ), 2 , $user -> hasRight ( 'contrat' , 'lire' ));
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /contrat/services_list.php?leftmenu=contracts&search_status=5 " , $langs -> trans ( " MenuClosedServices " ), 2 , $user -> hasRight ( 'contrat' , 'lire' ));
2013-02-24 21:16:36 +01:00
}
2022-03-02 22:41:00 +01:00
}
2013-02-24 21:16:36 +01:00
2022-03-02 22:41:00 +01:00
// Interventions
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'intervention' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " interventions " );
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /fichinter/index.php?leftmenu=ficheinter " , $langs -> trans ( " Interventions " ), 0 , $user -> hasRight ( 'ficheinter' , 'lire' ), '' , $mainmenu , 'ficheinter' , 2200 , '' , '' , '' , img_picto ( '' , 'intervention' , 'class="paddingright pictofixedwidth"' ));
$newmenu -> add ( " /fichinter/card.php?action=create&leftmenu=ficheinter " , $langs -> trans ( " NewIntervention " ), 1 , $user -> hasRight ( 'ficheinter' , 'creer' ), '' , '' , '' , 201 );
$newmenu -> add ( " /fichinter/list.php?leftmenu=ficheinter " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'ficheinter' , 'lire' ), '' , '' , '' , 202 );
2023-11-27 12:24:18 +01:00
if ( getDolGlobalInt ( 'MAIN_FEATURES_LEVEL' ) >= 2 ) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /fichinter/card-rec.php?leftmenu=ficheinter " , $langs -> trans ( " ListOfTemplates " ), 1 , $user -> hasRight ( 'ficheinter' , 'lire' ), '' , '' , '' , 203 );
2013-02-24 21:16:36 +01:00
}
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /fichinter/stats/index.php?leftmenu=ficheinter " , $langs -> trans ( " Statistics " ), 1 , $user -> hasRight ( 'ficheinter' , 'lire' ));
2022-03-02 22:41:00 +01:00
}
}
}
2013-02-24 21:16:36 +01:00
2022-03-02 22:41:00 +01:00
/**
* Get left COMPTA - FINANCIAL
*
2022-03-19 15:03:32 +01:00
* @ param string $mainmenu Main menu
* @ param Menu $newmenu Object Menu to return back list of menu entries
2023-12-15 13:54:56 +01:00
* @ param int $usemenuhider Use menu hider
2022-03-19 15:03:32 +01:00
* @ param string $leftmenu Left menu
* @ param int $type_user Type of targeted user for menu
2022-03-02 22:41:00 +01:00
* @ return void
*/
function get_left_menu_billing ( $mainmenu , & $newmenu , $usemenuhider = 1 , $leftmenu = 'none' , $type_user = 0 )
{
global $user , $conf , $langs ;
if ( $mainmenu == 'billing' ) {
$langs -> load ( " companies " );
// Customers invoices
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'invoice' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " bills " );
2023-12-04 12:07:53 +01:00
$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"' ));
$newmenu -> add ( " /compta/facture/card.php?action=create " , $langs -> trans ( " NewBill " ), 1 , $user -> hasRight ( 'facture' , 'creer' ));
$newmenu -> add ( " /compta/facture/list.php?leftmenu=customers_bills " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'facture' , 'lire' ), '' , $mainmenu , 'customers_bills_list' );
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || preg_match ( '/customers_bills(|_draft|_notpaid|_paid|_canceled)$/' , $leftmenu )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/facture/list.php?leftmenu=customers_bills_draft&search_status=0 " , $langs -> trans ( " BillShortStatusDraft " ), 2 , $user -> hasRight ( 'facture' , 'lire' ));
$newmenu -> add ( " /compta/facture/list.php?leftmenu=customers_bills_notpaid&search_status=1 " , $langs -> trans ( " BillShortStatusNotPaid " ), 2 , $user -> hasRight ( 'facture' , 'lire' ));
$newmenu -> add ( " /compta/facture/list.php?leftmenu=customers_bills_paid&search_status=2 " , $langs -> trans ( " BillShortStatusPaid " ), 2 , $user -> hasRight ( 'facture' , 'lire' ));
$newmenu -> add ( " /compta/facture/list.php?leftmenu=customers_bills_canceled&search_status=3 " , $langs -> trans ( " BillShortStatusCanceled " ), 2 , $user -> hasRight ( 'facture' , 'lire' ));
2013-02-24 21:16:36 +01:00
}
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/facture/invoicetemplate_list.php?leftmenu=customers_bills_templates " , $langs -> trans ( " ListOfTemplates " ), 1 , $user -> hasRight ( 'facture' , 'creer' ), '' , $mainmenu , 'customers_bills_templates' ); // No need to see recurring invoices, if user has no permission to create invoice.
2013-02-24 21:16:36 +01:00
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/paiement/list.php?leftmenu=customers_bills_payment " , $langs -> trans ( " Payments " ), 1 , $user -> hasRight ( 'facture' , 'lire' ), '' , $mainmenu , 'customers_bills_payment' );
2021-02-04 19:28:49 +01:00
2023-12-16 14:50:54 +01:00
if ( getDolGlobalString ( 'BILL_ADD_PAYMENT_VALIDATION' ) && preg_match ( '/customers_bills_payment/' , $leftmenu )) {
$newmenu -> add ( " /compta/paiement/tovalidate.php?leftmenu=customers_bills_payment_tovalid " , $langs -> trans ( " MenuToValid " ), 2 , $user -> hasRight ( 'facture' , 'lire' ), '' , $mainmenu , 'customers_bills_payment_tovalid' );
2020-12-04 18:00:31 +01:00
}
2023-12-16 14:50:54 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || preg_match ( '/customers_bills_payment/' , $leftmenu )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/paiement/rapport.php?leftmenu=customers_bills_payment_report " , $langs -> trans ( " Reportings " ), 2 , $user -> hasRight ( 'facture' , 'lire' ), '' , $mainmenu , 'customers_bills_payment_report' );
2020-12-04 18:00:31 +01:00
}
2013-02-24 21:16:36 +01:00
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/facture/stats/index.php?leftmenu=customers_bills_stats " , $langs -> trans ( " Statistics " ), 1 , $user -> hasRight ( 'facture' , 'lire' ), '' , $mainmenu , 'customers_bills_stats' );
2013-02-24 21:16:36 +01:00
}
2022-03-02 22:41:00 +01:00
// Suppliers invoices
2024-05-04 23:58:37 +02:00
if ( isModEnabled ( 'societe' ) && isModEnabled ( 'supplier_invoice' ) && ! getDolGlobalString ( 'SUPPLIER_INVOICE_MENU_DISABLED' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " bills " );
2023-12-04 12:07:53 +01:00
$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"' ));
2025-02-04 01:17:07 +01:00
$newmenu -> add ( " /fourn/facture/card.php?leftmenu=suppliers_bills&action=create " , $langs -> trans ( " NewBill " ), 1 , ( int ) ( $user -> hasRight ( 'fournisseur' , 'facture' , 'creer' ) || $user -> hasRight ( 'supplier_invoice' , 'creer' )), '' , $mainmenu , 'suppliers_bills_create' );
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /fourn/facture/list.php?leftmenu=suppliers_bills " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'fournisseur' , 'facture' , 'lire' ), '' , $mainmenu , 'suppliers_bills_list' );
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || preg_match ( '/suppliers_bills/' , $leftmenu )) {
2023-12-04 12:07:53 +01:00
$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' );
$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' );
$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' );
2020-03-23 08:51:38 +01:00
}
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /fourn/facture/list-rec.php?leftmenu=supplierinvoicestemplate_list " , $langs -> trans ( " ListOfTemplates " ), 1 , $user -> hasRight ( 'fournisseur' , 'facture' , 'lire' ), '' , $mainmenu , 'supplierinvoicestemplate_list' );
2016-08-29 10:32:00 +02:00
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /fourn/paiement/list.php?leftmenu=suppliers_bills_payment " , $langs -> trans ( " Payments " ), 1 , $user -> hasRight ( 'fournisseur' , 'facture' , 'lire' ), '' , $mainmenu , 'suppliers_bills_payment' );
2014-06-20 12:01:14 +02:00
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || preg_match ( '/suppliers_bills/' , $leftmenu )) {
2023-12-04 12:07:53 +01:00
$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' );
2013-02-24 21:16:36 +01:00
}
2023-12-04 12:07:53 +01:00
$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' );
2022-03-02 22:41:00 +01:00
}
2013-02-24 21:16:36 +01:00
2022-03-02 22:41:00 +01:00
// Orders
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'order' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " orders " );
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'invoice' )) {
2024-06-30 04:05:46 +02:00
$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"' ));
2013-02-24 21:16:36 +01:00
}
2022-09-06 15:37:00 +02:00
//if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->hasRight('commande', 'lire'));
2013-02-24 21:16:36 +01:00
}
2022-03-02 22:41:00 +01:00
// Supplier Orders to bill
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'supplier_invoice' )) {
2023-11-27 11:39:32 +01:00
if ( getDolGlobalString ( 'SUPPLIER_MENU_ORDER_RECEIVED_INTO_INVOICE' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " supplier " );
2024-08-07 02:53:45 +02:00
$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"' ));
2022-09-06 15:37:00 +02:00
//if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->hasRight('commande', 'lire'));
2022-03-02 22:41:00 +01:00
}
}
2013-02-24 21:16:36 +01:00
2022-03-02 22:41:00 +01:00
// Donations
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'don' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " donations " );
2023-12-04 12:07:53 +01:00
$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"' ));
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || $leftmenu == " donations " ) {
2025-01-09 13:54:25 +01:00
$newmenu -> add ( " /don/card.php?leftmenu=donations&action=create " , $langs -> trans ( " NewDonation " ), 1 , $user -> hasRight ( 'don' , 'creer' ));
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /don/list.php?leftmenu=donations " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'don' , 'lire' ));
2023-12-07 09:44:27 +01:00
$newmenu -> add ( " /don/paiement/list.php?leftmenu=donations " , $langs -> trans ( " Payments " ), 1 , $user -> hasRight ( 'don' , 'lire' ));
2024-03-01 21:17:52 +01:00
$newmenu -> add ( " /don/stats/index.php " , $langs -> trans ( " Statistics " ), 1 , $user -> hasRight ( 'don' , 'lire' ));
2022-03-02 22:41:00 +01:00
}
2022-09-06 15:37:00 +02:00
// if ($leftmenu=="donations") $newmenu->add("/don/stats/index.php",$langs->trans("Statistics"), 1, $user->hasRight('don', 'lire'));
2022-03-02 22:41:00 +01:00
}
2013-02-24 21:16:36 +01:00
2022-03-02 22:41:00 +01:00
// Taxes and social contributions
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'tax' )) {
2023-12-04 12:07:53 +01:00
$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"' ));
2013-02-24 21:16:36 +01:00
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/sociales/list.php?leftmenu=tax_social " , $langs -> trans ( " MenuSocialContributions " ), 1 , $user -> hasRight ( 'tax' , 'charges' , 'lire' ));
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || preg_match ( '/^tax_social/i' , $leftmenu )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/sociales/card.php?leftmenu=tax_social&action=create " , $langs -> trans ( " MenuNewSocialContribution " ), 2 , $user -> hasRight ( 'tax' , 'charges' , 'creer' ));
$newmenu -> add ( " /compta/sociales/list.php?leftmenu=tax_social " , $langs -> trans ( " List " ), 2 , $user -> hasRight ( 'tax' , 'charges' , 'lire' ));
$newmenu -> add ( " /compta/sociales/payments.php?leftmenu=tax_social&mainmenu=billing " , $langs -> trans ( " Payments " ), 2 , $user -> hasRight ( 'tax' , 'charges' , 'lire' ));
2022-03-02 22:41:00 +01:00
}
// VAT
2023-11-27 11:39:32 +01:00
if ( ! getDolGlobalString ( 'TAX_DISABLE_VAT_MENUS' )) {
2022-03-02 22:41:00 +01:00
global $mysoc ;
2023-12-04 12:07:53 +01:00
$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' );
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || preg_match ( '/^tax_vat/i' , $leftmenu )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/tva/card.php?leftmenu=tax_vat&action=create " , $langs -> trans ( " New " ), 2 , $user -> hasRight ( 'tax' , 'charges' , 'creer' ));
$newmenu -> add ( " /compta/tva/list.php?leftmenu=tax_vat " , $langs -> trans ( " List " ), 2 , $user -> hasRight ( 'tax' , 'charges' , 'lire' ));
$newmenu -> add ( " /compta/tva/payments.php?mode=tvaonly&leftmenu=tax_vat " , $langs -> trans ( " Payments " ), 2 , $user -> hasRight ( 'tax' , 'charges' , 'lire' ));
$newmenu -> add ( " /compta/tva/index.php?leftmenu=tax_vat " , $langs -> trans ( " ReportByMonth " ), 2 , $user -> hasRight ( 'tax' , 'charges' , 'lire' ));
$newmenu -> add ( " /compta/tva/clients.php?leftmenu=tax_vat " , $langs -> trans ( " ReportByThirdparties " ), 2 , $user -> hasRight ( 'tax' , 'charges' , 'lire' ));
$newmenu -> add ( " /compta/tva/quadri_detail.php?leftmenu=tax_vat " , $langs -> trans ( " ReportByQuarter " ), 2 , $user -> hasRight ( 'tax' , 'charges' , 'lire' ));
2022-03-02 22:41:00 +01:00
}
//Local Taxes 1
if ( $mysoc -> useLocalTax ( 1 ) && ( isset ( $mysoc -> localtax1_assuj ) && $mysoc -> localtax1_assuj == " 1 " )) {
2023-12-04 12:07:53 +01:00
$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' ));
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || preg_match ( '/^tax_1_vat/i' , $leftmenu )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/localtax/card.php?leftmenu=tax_1_vat&action=create&localTaxType=1 " , $langs -> trans ( " New " ), 2 , $user -> hasRight ( 'tax' , 'charges' , 'creer' ));
$newmenu -> add ( " /compta/localtax/list.php?leftmenu=tax_1_vat&localTaxType=1 " , $langs -> trans ( " List " ), 2 , $user -> hasRight ( 'tax' , 'charges' , 'lire' ));
$newmenu -> add ( " /compta/localtax/index.php?leftmenu=tax_1_vat&localTaxType=1 " , $langs -> trans ( " ReportByMonth " ), 2 , $user -> hasRight ( 'tax' , 'charges' , 'lire' ));
$newmenu -> add ( " /compta/localtax/clients.php?leftmenu=tax_1_vat&localTaxType=1 " , $langs -> trans ( " ReportByThirdparties " ), 2 , $user -> hasRight ( 'tax' , 'charges' , 'lire' ));
$newmenu -> add ( " /compta/localtax/quadri_detail.php?leftmenu=tax_1_vat&localTaxType=1 " , $langs -> trans ( " ReportByQuarter " ), 2 , $user -> hasRight ( 'tax' , 'charges' , 'lire' ));
2022-03-02 22:41:00 +01:00
}
2013-02-24 21:16:36 +01:00
}
2022-03-02 22:41:00 +01:00
//Local Taxes 2
if ( $mysoc -> useLocalTax ( 2 ) && ( isset ( $mysoc -> localtax2_assuj ) && $mysoc -> localtax2_assuj == " 1 " )) {
2023-12-04 12:07:53 +01:00
$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' ));
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || preg_match ( '/^tax_2_vat/i' , $leftmenu )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/localtax/card.php?leftmenu=tax_2_vat&action=create&localTaxType=2 " , $langs -> trans ( " New " ), 2 , $user -> hasRight ( 'tax' , 'charges' , 'creer' ));
$newmenu -> add ( " /compta/localtax/list.php?leftmenu=tax_2_vat&localTaxType=2 " , $langs -> trans ( " List " ), 2 , $user -> hasRight ( 'tax' , 'charges' , 'lire' ));
$newmenu -> add ( " /compta/localtax/index.php?leftmenu=tax_2_vat&localTaxType=2 " , $langs -> trans ( " ReportByMonth " ), 2 , $user -> hasRight ( 'tax' , 'charges' , 'lire' ));
$newmenu -> add ( " /compta/localtax/clients.php?leftmenu=tax_2_vat&localTaxType=2 " , $langs -> trans ( " ReportByThirdparties " ), 2 , $user -> hasRight ( 'tax' , 'charges' , 'lire' ));
$newmenu -> add ( " /compta/localtax/quadri_detail.php?leftmenu=tax_2_vat&localTaxType=2 " , $langs -> trans ( " ReportByQuarter " ), 2 , $user -> hasRight ( 'tax' , 'charges' , 'lire' ));
2022-03-02 22:41:00 +01:00
}
2022-02-07 15:16:11 +01:00
}
2022-03-02 22:41:00 +01:00
}
}
2015-04-06 19:11:31 +02:00
2022-03-02 22:41:00 +01:00
// Salaries
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'salaries' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " salaries " );
2023-12-04 12:07:53 +01:00
$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"' ));
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || preg_match ( '/^tax_salary/i' , $leftmenu )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /salaries/card.php?leftmenu=tax_salary&action=create " , $langs -> trans ( " New " ), 1 , $user -> hasRight ( 'salaries' , 'write' ));
$newmenu -> add ( " /salaries/list.php?leftmenu=tax_salary " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'salaries' , 'read' ));
$newmenu -> add ( " /salaries/payments.php?leftmenu=tax_salary " , $langs -> trans ( " Payments " ), 1 , $user -> hasRight ( 'salaries' , 'read' ));
$newmenu -> add ( " /salaries/stats/index.php?leftmenu=tax_salary " , $langs -> trans ( " Statistics " ), 1 , $user -> hasRight ( 'salaries' , 'read' ));
2013-02-24 21:16:36 +01:00
}
2022-03-02 22:41:00 +01:00
}
2013-02-24 21:16:36 +01:00
2022-03-02 22:41:00 +01:00
// Loan
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'loan' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " loan " );
2023-12-04 12:07:53 +01:00
$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"' ));
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || preg_match ( '/^tax_loan/i' , $leftmenu )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /loan/card.php?leftmenu=tax_loan&action=create " , $langs -> trans ( " NewLoan " ), 1 , $user -> hasRight ( 'loan' , 'write' ));
2022-09-06 15:37:00 +02:00
//$newmenu->add("/loan/payment/list.php?leftmenu=tax_loan",$langs->trans("Payments"),2,$user->hasRight('loan', 'read'));
2022-03-02 22:41:00 +01:00
}
}
2015-03-23 13:40:55 +01:00
2022-03-02 22:41:00 +01:00
// Various payment
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'bank' ) && ! getDolGlobalString ( 'BANK_USE_OLD_VARIOUS_PAYMENT' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " banks " );
2023-12-04 12:07:53 +01:00
$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"' ));
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || preg_match ( '/^tax_various/i' , $leftmenu )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/bank/various_payment/card.php?leftmenu=tax_various&action=create " , $langs -> trans ( " New " ), 1 , $user -> hasRight ( 'banque' , 'modifier' ));
$newmenu -> add ( " /compta/bank/various_payment/list.php?leftmenu=tax_various " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'banque' , 'lire' ));
2022-03-02 22:41:00 +01:00
}
}
}
}
2015-03-23 13:40:55 +01:00
2022-03-02 22:41:00 +01:00
/**
* Get left COMPTA - FINANCIAL ( accountancy )
*
2022-03-19 15:03:32 +01:00
* @ param string $mainmenu Main menu
* @ param Menu $newmenu Object Menu to return back list of menu entries
2023-12-15 13:54:56 +01:00
* @ param int $usemenuhider Use menu hider
2022-03-19 15:03:32 +01:00
* @ param string $leftmenu Left menu
* @ param int $type_user Type of targeted user for menu
2022-03-02 22:41:00 +01:00
* @ return void
*/
2022-03-19 15:03:32 +01:00
function get_left_menu_accountancy ( $mainmenu , & $newmenu , $usemenuhider = 1 , $leftmenu = 'none' , $type_user = 0 )
2022-03-02 22:41:00 +01:00
{
global $user , $conf , $langs ;
2022-03-19 15:03:32 +01:00
global $db ;
2022-02-07 14:34:27 +01:00
2022-03-02 22:41:00 +01:00
if ( $mainmenu == 'accountancy' ) {
$langs -> load ( " companies " );
2017-06-02 19:28:22 +02:00
2022-03-02 22:41:00 +01:00
// Accounting (Double entries)
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'accounting' )) {
2022-09-06 15:37:00 +02:00
//$permtoshowmenu = (isModEnabled('accounting') || $user->hasRight('accounting', 'bind', 'write') || $user->hasRight('compta', 'resultat', 'lire'));
2022-03-02 22:41:00 +01:00
//$newmenu->add("/accountancy/index.php?leftmenu=accountancy", $langs->trans("MenuAccountancy"), 0, $permtoshowmenu, '', $mainmenu, 'accountancy');
2013-02-24 21:16:36 +01:00
2022-03-02 22:41:00 +01:00
// Configuration
2023-12-04 12:07:53 +01:00
$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"' ));
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || preg_match ( '/accountancy_admin/' , $leftmenu )) {
global $mysoc ;
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /accountancy/admin/index.php?mainmenu=accountancy&leftmenu=accountancy_admin " , $langs -> trans ( " General " ), 1 , $user -> hasRight ( 'accounting' , 'chartofaccount' ), '' , $mainmenu , 'accountancy_admin_general' , 10 );
2013-02-24 21:16:36 +01:00
2023-12-04 12:07:53 +01:00
$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 );
$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 );
$newmenu -> add ( " /accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin " , $langs -> trans ( " Chartofaccounts " ), 1 , $user -> hasRight ( 'accounting' , 'chartofaccount' ), '' , $mainmenu , 'accountancy_admin_chart' , 41 );
$newmenu -> add ( " /accountancy/admin/subaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin " , $langs -> trans ( " ChartOfSubaccounts " ), 1 , $user -> hasRight ( 'accounting' , 'chartofaccount' ), '' , $mainmenu , 'accountancy_admin_chart' , 41 );
2024-06-05 11:57:17 +02:00
// Fiscal year
$newmenu -> add ( " /accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin " , $langs -> trans ( " FiscalPeriod " ), 1 , $user -> hasRight ( 'accounting' , 'fiscalyear' , 'write' ), '' , $mainmenu , 'fiscalyear' , 45 );
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin " , $langs -> trans ( " MenuDefaultAccounts " ), 1 , $user -> hasRight ( 'accounting' , 'chartofaccount' ), '' , $mainmenu , 'accountancy_admin_default' , 60 );
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'bank' )) {
2023-12-04 12:07:53 +01:00
$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 );
2014-11-07 23:15:02 +01:00
}
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'invoice' ) || isModEnabled ( 'supplier_invoice' )) {
2023-12-04 12:07:53 +01:00
$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 );
2020-09-07 10:18:17 +02:00
}
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'tax' )) {
2023-12-04 12:07:53 +01:00
$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 );
2020-09-08 14:09:56 +02:00
}
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'expensereport' )) {
2023-12-04 12:07:53 +01:00
$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 );
2013-02-24 21:16:36 +01:00
}
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin " , $langs -> trans ( " MenuProductsAccounts " ), 1 , $user -> hasRight ( 'accounting' , 'chartofaccount' ), '' , $mainmenu , 'accountancy_admin_product' , 110 );
$newmenu -> add ( " /accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin " , $langs -> trans ( " MenuClosureAccounts " ), 1 , $user -> hasRight ( 'accounting' , 'chartofaccount' ), '' , $mainmenu , 'accountancy_admin_closure' , 120 );
2024-11-04 16:38:17 +01:00
if ( getDolGlobalInt ( 'MAIN_FEATURES_LEVEL' ) >= 2 ) {
2024-11-16 20:48:09 +01:00
$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 );
2024-11-04 16:38:17 +01:00
}
$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 );
2020-09-08 14:09:56 +02:00
}
2016-08-29 10:32:00 +02:00
2022-03-02 22:41:00 +01:00
// Transfer in accounting
2023-12-04 12:07:53 +01:00
$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"' ));
2022-03-02 22:41:00 +01:00
// Binding
2022-09-06 15:37:00 +02:00
// $newmenu->add("", $langs->trans("Binding"), 0, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'dispatch');
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'invoice' ) && ! getDolGlobalString ( 'ACCOUNTING_DISABLE_BINDING_ON_SALES' )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy " , $langs -> trans ( " CustomersVentilation " ), 1 , $user -> hasRight ( 'accounting' , 'bind' , 'write' ), '' , $mainmenu , 'dispatch_customer' );
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || preg_match ( '/accountancy_dispatch_customer/' , $leftmenu )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer " , $langs -> trans ( " ToBind " ), 2 , $user -> hasRight ( 'accounting' , 'bind' , 'write' ));
$newmenu -> add ( " /accountancy/customer/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer " , $langs -> trans ( " Binded " ), 2 , $user -> hasRight ( 'accounting' , 'bind' , 'write' ));
2016-06-20 11:43:53 +02:00
}
2020-09-08 14:09:56 +02:00
}
2023-11-27 11:39:32 +01:00
if ( isModEnabled ( 'supplier_invoice' ) && ! getDolGlobalString ( 'ACCOUNTING_DISABLE_BINDING_ON_PURCHASES' )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy " , $langs -> trans ( " SuppliersVentilation " ), 1 , $user -> hasRight ( 'accounting' , 'bind' , 'write' ), '' , $mainmenu , 'dispatch_supplier' );
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || preg_match ( '/accountancy_dispatch_supplier/' , $leftmenu )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /accountancy/supplier/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier " , $langs -> trans ( " ToBind " ), 2 , $user -> hasRight ( 'accounting' , 'bind' , 'write' ));
$newmenu -> add ( " /accountancy/supplier/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier " , $langs -> trans ( " Binded " ), 2 , $user -> hasRight ( 'accounting' , 'bind' , 'write' ));
2016-06-20 11:43:53 +02:00
}
2020-09-08 14:09:56 +02:00
}
2023-11-27 11:39:32 +01:00
if ( isModEnabled ( 'expensereport' ) && ! getDolGlobalString ( 'ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS' )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport&mainmenu=accountancy " , $langs -> trans ( " ExpenseReportsVentilation " ), 1 , $user -> hasRight ( 'accounting' , 'bind' , 'write' ), '' , $mainmenu , 'dispatch_expensereport' );
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || preg_match ( '/accountancy_dispatch_expensereport/' , $leftmenu )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /accountancy/expensereport/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport " , $langs -> trans ( " ToBind " ), 2 , $user -> hasRight ( 'accounting' , 'bind' , 'write' ));
$newmenu -> add ( " /accountancy/expensereport/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport " , $langs -> trans ( " Binded " ), 2 , $user -> hasRight ( 'accounting' , 'bind' , 'write' ));
2016-06-20 11:43:53 +02:00
}
2013-02-24 21:16:36 +01:00
}
2016-01-24 08:21:18 +01:00
2022-03-02 22:41:00 +01:00
// Journals
2023-12-04 12:07:53 +01:00
if ( isModEnabled ( 'accounting' ) && $user -> hasRight ( 'accounting' , 'comptarapport' , 'lire' ) && $mainmenu == 'accountancy' ) {
$newmenu -> add ( '' , $langs -> trans ( " RegistrationInAccounting " ), 1 , $user -> hasRight ( 'accounting' , 'comptarapport' , 'lire' ), '' , $mainmenu , 'accountancy_journal' );
2019-06-04 01:22:26 +02:00
2022-03-02 22:41:00 +01:00
// Multi journal
$sql = " SELECT rowid, code, label, nature " ;
$sql .= " FROM " . MAIN_DB_PREFIX . " accounting_journal " ;
2023-03-03 12:23:00 +01:00
$sql .= " WHERE entity = " . (( int ) $conf -> entity );
2022-03-02 22:41:00 +01:00
$sql .= " AND active = 1 " ;
$sql .= " ORDER BY nature ASC, label DESC " ;
2019-06-04 01:22:26 +02:00
2022-03-02 22:41:00 +01:00
$resql = $db -> query ( $sql );
if ( $resql ) {
$numr = $db -> num_rows ( $resql );
$i = 0 ;
2019-06-04 01:22:26 +02:00
2022-03-02 22:41:00 +01:00
if ( $numr > 0 ) {
while ( $i < $numr ) {
$objp = $db -> fetch_object ( $resql );
2019-03-08 09:11:56 +01:00
2022-03-02 22:41:00 +01:00
$nature = '' ;
2016-10-24 06:41:32 +02:00
2022-03-02 22:41:00 +01:00
// Must match array $sourceList defined into journals_list.php
2024-02-27 15:30:37 +01:00
if ( $objp -> nature == 2 && isModEnabled ( 'invoice' ) && ! getDolGlobalString ( 'ACCOUNTING_DISABLE_BINDING_ON_SALES' )) {
2022-03-02 22:41:00 +01:00
$nature = " sells " ;
}
if ( $objp -> nature == 3
2023-04-18 16:15:13 +02:00
&& isModEnabled ( 'supplier_invoice' )
2023-11-27 11:39:32 +01:00
&& ! getDolGlobalString ( 'ACCOUNTING_DISABLE_BINDING_ON_PURCHASES' )) {
2023-12-04 12:07:53 +01:00
$nature = " purchases " ;
2022-03-02 22:41:00 +01:00
}
2024-02-27 15:30:37 +01:00
if ( $objp -> nature == 4 && isModEnabled ( 'bank' )) {
2022-03-02 22:41:00 +01:00
$nature = " bank " ;
}
2023-11-27 11:39:32 +01:00
if ( $objp -> nature == 5 && isModEnabled ( 'expensereport' ) && ! getDolGlobalString ( 'ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS' )) {
2022-03-02 22:41:00 +01:00
$nature = " expensereports " ;
}
2022-06-09 21:33:39 +02:00
if ( $objp -> nature == 1 && isModEnabled ( 'asset' )) {
2022-04-01 11:24:58 +02:00
$nature = " various " ; // Warning: The page /accountancy/journal/variousjournal.php is bugged. It read tables that does not exists.
2022-03-02 22:41:00 +01:00
}
if ( $objp -> nature == 8 ) {
$nature = " inventory " ;
}
if ( $objp -> nature == 9 ) {
$nature = " hasnew " ;
}
2017-06-03 07:23:14 +02:00
2023-12-04 12:07:53 +01:00
// To enable when page exists
2023-11-27 11:39:32 +01:00
if ( ! getDolGlobalString ( 'ACCOUNTANCY_SHOW_DEVELOP_JOURNAL' )) {
2022-03-02 22:41:00 +01:00
if ( $nature == 'hasnew' || $nature == 'inventory' ) {
$nature = '' ;
2017-06-03 07:23:14 +02:00
}
2022-03-02 22:41:00 +01:00
}
2017-06-03 07:23:14 +02:00
2022-03-02 22:41:00 +01:00
if ( $nature ) {
$langs -> load ( 'accountancy' );
2023-01-30 02:41:13 +01:00
$journallabel = '' ;
2024-08-14 14:05:56 +02:00
$journallabelwithoutspan = '' ;
2023-01-30 02:41:13 +01:00
if ( $objp -> label ) {
2023-03-18 18:13:44 +01:00
$journallabelwithoutspan = $langs -> trans ( $objp -> label );
$journallabel = '<span class="opacitymedium">(' . $langs -> trans ( $objp -> label ) . ')</span>' ; // Label of bank account in llx_accounting_journal
2023-01-30 02:41:13 +01:00
}
2022-11-07 21:48:52 +01:00
2023-03-03 12:23:00 +01:00
$key = $langs -> trans ( " AccountingJournalType " . $objp -> nature ); // $objp->nature is 1, 2, 3 ...
2023-12-04 12:07:53 +01:00
$transferlabel = (( $objp -> nature && $key != " AccountingJournalType " . $objp -> nature ) ? $key . ( $journallabelwithoutspan != $key ? ' ' . $journallabel : '' ) : $journallabel );
2022-11-07 21:48:52 +01:00
2023-12-04 12:07:53 +01:00
$newmenu -> add ( '/accountancy/journal/' . $nature . 'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=' . $objp -> rowid , $transferlabel , 2 , $user -> hasRight ( 'accounting' , 'comptarapport' , 'lire' ));
2017-06-03 07:23:14 +02:00
}
2022-11-07 21:48:52 +01:00
$i ++ ;
2017-02-21 07:09:58 +01:00
}
2020-12-04 18:00:31 +01:00
} else {
2024-01-13 19:48:20 +01:00
// Should not happen. Entries are added
2023-12-04 12:07:53 +01:00
$newmenu -> add ( '' , $langs -> trans ( " NoJournalDefined " ), 2 , $user -> hasRight ( 'accounting' , 'comptarapport' , 'lire' ));
2020-12-04 18:00:31 +01:00
}
2022-03-02 22:41:00 +01:00
} else {
dol_print_error ( $db );
2014-09-06 09:50:42 +02:00
}
2022-03-02 22:41:00 +01:00
$db -> free ( $resql );
}
2016-01-24 08:21:18 +01:00
2022-03-02 22:41:00 +01:00
// Files
2023-11-27 11:39:32 +01:00
if ( ! getDolGlobalString ( 'ACCOUNTANCY_HIDE_EXPORT_FILES_MENU' )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files " , $langs -> trans ( " AccountantFiles " ), 1 , $user -> hasRight ( 'accounting' , 'mouvements' , 'lire' ));
2022-03-02 22:41:00 +01:00
}
2021-12-26 15:41:09 +01:00
2022-03-02 22:41:00 +01:00
// Accounting
2025-02-04 01:17:07 +01:00
$newmenu -> add ( " /accountancy/index.php?leftmenu=accountancy_accountancy " , $langs -> trans ( " MenuAccountancy " ), 0 , ( int ) ( $user -> hasRight ( 'accounting' , 'mouvements' , 'lire' ) || $user -> hasRight ( 'accounting' , 'comptarapport' , 'lire' )), '' , $mainmenu , 'accountancy' , 1 , '' , '' , '' , img_picto ( '' , 'accountancy' , 'class="paddingright pictofixedwidth"' ));
2016-02-11 06:39:02 +01:00
2022-03-02 22:41:00 +01:00
// General Ledger
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /accountancy/bookkeeping/listbyaccount.php?mainmenu=accountancy&leftmenu=accountancy_accountancy " , $langs -> trans ( " Bookkeeping " ), 1 , $user -> hasRight ( 'accounting' , 'mouvements' , 'lire' ));
2019-10-17 18:16:57 +02:00
2022-03-02 22:41:00 +01:00
// Journals
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_accountancy " , $langs -> trans ( " Journals " ), 1 , $user -> hasRight ( 'accounting' , 'mouvements' , 'lire' ));
2022-03-02 22:41:00 +01:00
// Account Balance
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_accountancy " , $langs -> trans ( " AccountBalance " ), 1 , $user -> hasRight ( 'accounting' , 'mouvements' , 'lire' ));
2019-10-17 18:43:07 +02:00
2023-04-05 10:48:45 +02:00
// Export accountancy
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /accountancy/bookkeeping/export.php?mainmenu=accountancy&leftmenu=accountancy_accountancy " , $langs -> trans ( " MenuExportAccountancy " ), 1 , $user -> hasRight ( 'accounting' , 'mouvements' , 'lire' ));
2023-04-05 10:48:45 +02:00
2022-03-02 22:41:00 +01:00
// Closure
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /accountancy/closure/index.php?mainmenu=accountancy&leftmenu=accountancy_closure " , $langs -> trans ( " MenuAccountancyClosure " ), 1 , $user -> hasRight ( 'accounting' , 'fiscalyear' , 'write' ), '' , $mainmenu , 'closure' );
2021-08-03 15:02:09 +02:00
2022-03-02 22:41:00 +01:00
// Reports
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /accountancy/index.php?leftmenu=accountancy_report " , $langs -> trans ( " Reportings " ), 1 , $user -> hasRight ( 'accounting' , 'comptarapport' , 'lire' ), '' , $mainmenu , 'ca' );
2019-10-17 18:43:07 +02:00
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || preg_match ( '/accountancy_report/' , $leftmenu )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/resultat/index.php?leftmenu=accountancy_report " , $langs -> trans ( " MenuReportInOut " ), 2 , $user -> hasRight ( 'accounting' , 'comptarapport' , 'lire' ));
$newmenu -> add ( " /compta/resultat/clientfourn.php?leftmenu=accountancy_report " , $langs -> trans ( " ByPredefinedAccountGroups " ), 3 , $user -> hasRight ( 'accounting' , 'comptarapport' , 'lire' ));
2024-11-16 20:48:09 +01:00
if ( getDolGlobalInt ( 'MAIN_FEATURES_LEVEL' ) >= 2 ) {
global $mysoc ;
// Multi personalized reports
$sql = " SELECT rowid, code, label " ;
$sql .= " FROM " . MAIN_DB_PREFIX . " c_accounting_report " ;
$sql .= " WHERE entity = " . (( int ) $conf -> entity );
$sql .= " AND fk_country = " . (( int ) $mysoc -> country_id );
$sql .= " AND active = 1 " ;
$sql .= " ORDER BY label DESC " ;
$resql = $db -> query ( $sql );
if ( $resql ) {
$numr = $db -> num_rows ( $resql );
$i = 0 ;
if ( $numr > 0 ) {
while ( $i < $numr ) {
$objp = $db -> fetch_object ( $resql );
$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' ));
$i ++ ;
}
} else {
// Should not happen. Entries are added
$newmenu -> add ( '' , $langs -> trans ( " NoReportDefined " ), 3 , $user -> hasRight ( 'accounting' , 'comptarapport' , 'lire' ));
}
} else {
dol_print_error ( $db );
}
$db -> free ( $resql );
} else {
$newmenu -> add ( " /compta/resultat/result.php?leftmenu=accountancy_report " , $langs -> trans ( " ByPersonalizedAccountGroups " ), 3 , $user -> hasRight ( 'accounting' , 'comptarapport' , 'lire' ));
}
2022-03-02 22:41:00 +01:00
}
2016-01-24 08:21:18 +01:00
2022-03-02 22:41:00 +01:00
$modecompta = 'CREANCES-DETTES' ;
2023-12-04 12:07:53 +01:00
if ( isModEnabled ( 'accounting' ) && $user -> hasRight ( 'accounting' , 'comptarapport' , 'lire' ) && $mainmenu == 'accountancy' ) {
2022-03-02 22:41:00 +01:00
$modecompta = 'BOOKKEEPING' ; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED
}
if ( $modecompta ) {
2020-09-07 10:18:17 +02:00
if ( $usemenuhider || empty ( $leftmenu ) || preg_match ( '/accountancy_report/' , $leftmenu )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/stats/index.php?leftmenu=accountancy_report&modecompta= " . $modecompta , $langs -> trans ( " ReportTurnover " ), 2 , $user -> hasRight ( 'accounting' , 'comptarapport' , 'lire' ));
$newmenu -> add ( " /compta/stats/casoc.php?leftmenu=accountancy_report&modecompta= " . $modecompta , $langs -> trans ( " ByCompanies " ), 3 , $user -> hasRight ( 'accounting' , 'comptarapport' , 'lire' ));
$newmenu -> add ( " /compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta= " . $modecompta , $langs -> trans ( " ByUsers " ), 3 , $user -> hasRight ( 'accounting' , 'comptarapport' , 'lire' ));
$newmenu -> add ( " /compta/stats/cabyprodserv.php?leftmenu=accountancy_report&modecompta= " . $modecompta , $langs -> trans ( " ByProductsAndServices " ), 3 , $user -> hasRight ( 'accounting' , 'comptarapport' , 'lire' ));
$newmenu -> add ( " /compta/stats/byratecountry.php?leftmenu=accountancy_report&modecompta= " . $modecompta , $langs -> trans ( " ByVatRate " ), 3 , $user -> hasRight ( 'accounting' , 'comptarapport' , 'lire' ));
2020-09-07 10:18:17 +02:00
}
2022-03-02 22:41:00 +01:00
}
2016-01-24 08:21:18 +01:00
2022-03-02 22:41:00 +01:00
$modecompta = 'RECETTES-DEPENSES' ;
2022-09-07 13:42:31 +02:00
//if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') $modecompta=''; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED
2022-03-02 22:41:00 +01:00
if ( $modecompta ) {
if ( $usemenuhider || empty ( $leftmenu ) || preg_match ( '/accountancy_report/' , $leftmenu )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/stats/index.php?leftmenu=accountancy_report&modecompta= " . $modecompta , $langs -> trans ( " ReportTurnoverCollected " ), 2 , $user -> hasRight ( 'accounting' , 'comptarapport' , 'lire' ));
$newmenu -> add ( " /compta/stats/casoc.php?leftmenu=accountancy_report&modecompta= " . $modecompta , $langs -> trans ( " ByCompanies " ), 3 , $user -> hasRight ( 'accounting' , 'comptarapport' , 'lire' ));
$newmenu -> add ( " /compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta= " . $modecompta , $langs -> trans ( " ByUsers " ), 3 , $user -> hasRight ( 'accounting' , 'comptarapport' , 'lire' ));
2022-09-06 15:37:00 +02:00
//$newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"),3,$user->hasRight('accounting', 'comptarapport', 'lire'));
//$newmenu->add("/compta/stats/byratecountry.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByVatRate"),3,$user->hasRight('accounting', 'comptarapport', 'lire'));
2018-06-26 11:18:31 +02:00
}
2022-03-02 22:41:00 +01:00
}
2018-06-26 11:18:31 +02:00
2022-03-02 22:41:00 +01:00
$modecompta = 'CREANCES-DETTES' ;
2023-12-04 12:07:53 +01:00
if ( isModEnabled ( 'accounting' ) && $user -> hasRight ( 'accounting' , 'comptarapport' , 'lire' ) && $mainmenu == 'accountancy' ) {
2022-03-02 22:41:00 +01:00
$modecompta = 'BOOKKEEPING' ; // Not yet implemented.
}
2023-04-18 16:15:13 +02:00
if ( $modecompta && isModEnabled ( 'supplier_invoice' )) {
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || preg_match ( '/accountancy_report/' , $leftmenu )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta= " . $modecompta , $langs -> trans ( " ReportPurchaseTurnover " ), 2 , $user -> hasRight ( 'accounting' , 'comptarapport' , 'lire' ));
$newmenu -> add ( " /compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta= " . $modecompta , $langs -> trans ( " ByCompanies " ), 3 , $user -> hasRight ( 'accounting' , 'comptarapport' , 'lire' ));
$newmenu -> add ( " /compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report&modecompta= " . $modecompta , $langs -> trans ( " ByProductsAndServices " ), 3 , $user -> hasRight ( 'accounting' , 'comptarapport' , 'lire' ));
2018-06-26 11:18:31 +02:00
}
2022-03-02 22:41:00 +01:00
}
2020-04-04 18:45:33 +02:00
2022-03-02 22:41:00 +01:00
$modecompta = 'RECETTES-DEPENSES' ;
2023-12-04 12:07:53 +01:00
if ( isModEnabled ( 'accounting' ) && $user -> hasRight ( 'accounting' , 'comptarapport' , 'lire' ) && $mainmenu == 'accountancy' ) {
2022-03-02 22:41:00 +01:00
$modecompta = 'BOOKKEEPINGCOLLECTED' ; // Not yet implemented.
}
2023-11-27 11:39:32 +01:00
if ( $modecompta && (( isModEnabled ( 'fournisseur' ) && ! getDolGlobalString ( 'MAIN_USE_NEW_SUPPLIERMOD' )) || isModEnabled ( 'supplier_invoice' ))) {
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || preg_match ( '/accountancy_report/' , $leftmenu )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta= " . $modecompta , $langs -> trans ( " ReportPurchaseTurnoverCollected " ), 2 , $user -> hasRight ( 'accounting' , 'comptarapport' , 'lire' ));
$newmenu -> add ( " /compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta= " . $modecompta , $langs -> trans ( " ByCompanies " ), 3 , $user -> hasRight ( 'accounting' , 'comptarapport' , 'lire' ));
2020-04-04 18:45:33 +02:00
}
2022-03-02 22:41:00 +01:00
}
}
2020-04-04 18:45:33 +02:00
2022-03-02 22:41:00 +01:00
// Accountancy (simple)
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'comptabilite' )) {
2022-03-02 22:41:00 +01:00
// Files
2023-11-27 11:39:32 +01:00
if ( ! getDolGlobalString ( 'ACCOUNTANCY_HIDE_EXPORT_FILES_MENU' )) {
2023-12-04 12:07:53 +01:00
$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"' ));
2020-09-07 10:18:17 +02:00
}
2018-04-01 21:26:52 +02:00
2022-03-02 22:41:00 +01:00
// Bilan, resultats
2023-12-04 12:07:53 +01:00
$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"' ));
2020-09-07 10:18:17 +02:00
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || preg_match ( '/report/' , $leftmenu )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/resultat/index.php?leftmenu=report " , $langs -> trans ( " MenuReportInOut " ), 1 , $user -> hasRight ( 'compta' , 'resultat' , 'lire' ));
$newmenu -> add ( " /compta/resultat/clientfourn.php?leftmenu=report " , $langs -> trans ( " ByPredefinedAccountGroups " ), 2 , $user -> hasRight ( 'compta' , 'resultat' , 'lire' ));
2022-03-02 22:41:00 +01:00
/* On verra ca avec module compabilite expert
2022-09-06 15:37:00 +02:00
$newmenu -> add ( " /compta/resultat/compteres.php?leftmenu=report " , " Compte de resultat " , 2 , $user -> hasRight ( 'compta' , 'resultat' , 'lire' ));
$newmenu -> add ( " /compta/resultat/bilan.php?leftmenu=report " , " Bilan " , 2 , $user -> hasRight ( 'compta' , 'resultat' , 'lire' ));
2022-03-19 15:03:32 +01:00
*/
2022-03-02 22:41:00 +01:00
/*
2022-09-06 15:37:00 +02:00
$newmenu -> add ( " /compta/stats/cumul.php?leftmenu=report " , " Cumule " , 2 , $user -> hasRight ( 'compta' , 'resultat' , 'lire' ));
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'propal' )) {
2022-09-06 15:37:00 +02:00
$newmenu -> add ( " /compta/stats/prev.php?leftmenu=report " , " Previsionnel " , 2 , $user -> hasRight ( 'compta' , 'resultat' , 'lire' ));
2024-01-13 19:48:20 +01:00
$newmenu -> add ( " /compta/stats/comp.php?leftmenu=report " , " Transferred " , 2 , $user -> hasRight ( 'compta' , 'resultat' , 'lire' ));
2022-03-19 15:03:32 +01:00
}
*/
2022-03-02 22:41:00 +01:00
$modecompta = 'CREANCES-DETTES' ;
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/stats/index.php?leftmenu=report&modecompta= " . $modecompta , $langs -> trans ( " ReportTurnover " ), 1 , $user -> hasRight ( 'compta' , 'resultat' , 'lire' ));
$newmenu -> add ( " /compta/stats/casoc.php?leftmenu=report&modecompta= " . $modecompta , $langs -> trans ( " ByCompanies " ), 2 , $user -> hasRight ( 'compta' , 'resultat' , 'lire' ));
$newmenu -> add ( " /compta/stats/cabyuser.php?leftmenu=report&modecompta= " . $modecompta , $langs -> trans ( " ByUsers " ), 2 , $user -> hasRight ( 'compta' , 'resultat' , 'lire' ));
$newmenu -> add ( " /compta/stats/cabyprodserv.php?leftmenu=report&modecompta= " . $modecompta , $langs -> trans ( " ByProductsAndServices " ), 2 , $user -> hasRight ( 'compta' , 'resultat' , 'lire' ));
$newmenu -> add ( " /compta/stats/byratecountry.php?leftmenu=report&modecompta= " . $modecompta , $langs -> trans ( " ByVatRate " ), 2 , $user -> hasRight ( 'compta' , 'resultat' , 'lire' ));
2022-03-02 22:41:00 +01:00
$modecompta = 'RECETTES-DEPENSES' ;
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/stats/index.php?leftmenu=accountancy_report&modecompta= " . $modecompta , $langs -> trans ( " ReportTurnoverCollected " ), 1 , $user -> hasRight ( 'compta' , 'resultat' , 'lire' ));
$newmenu -> add ( " /compta/stats/casoc.php?leftmenu=accountancy_report&modecompta= " . $modecompta , $langs -> trans ( " ByCompanies " ), 2 , $user -> hasRight ( 'compta' , 'resultat' , 'lire' ));
$newmenu -> add ( " /compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta= " . $modecompta , $langs -> trans ( " ByUsers " ), 2 , $user -> hasRight ( 'compta' , 'resultat' , 'lire' ));
2022-03-02 22:41:00 +01:00
//Achats
$modecompta = 'CREANCES-DETTES' ;
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta= " . $modecompta , $langs -> trans ( " ReportPurchaseTurnover " ), 1 , $user -> hasRight ( 'compta' , 'resultat' , 'lire' ));
$newmenu -> add ( " /compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta= " . $modecompta , $langs -> trans ( " ByCompanies " ), 2 , $user -> hasRight ( 'compta' , 'resultat' , 'lire' ));
$newmenu -> add ( " /compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report&modecompta= " . $modecompta , $langs -> trans ( " ByProductsAndServices " ), 2 , $user -> hasRight ( 'compta' , 'resultat' , 'lire' ));
2022-03-02 22:41:00 +01:00
/*
2022-03-19 15:03:32 +01:00
$modecompta = 'RECETTES-DEPENSES' ;
2022-09-06 15:37:00 +02:00
$newmenu -> add ( " /compta/stats/index.php?leftmenu=accountancy_report&modecompta= " . $modecompta , $langs -> trans ( " ReportPurchaseTurnoverCollected " ), 1 , $user -> hasRight ( 'compta' , 'resultat' , 'lire' ));
$newmenu -> add ( " /compta/stats/casoc.php?leftmenu=accountancy_report&modecompta= " . $modecompta , $langs -> trans ( " ByCompanies " ), 2 , $user -> hasRight ( 'compta' , 'resultat' , 'lire' ));
$newmenu -> add ( " /compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta= " . $modecompta , $langs -> trans ( " ByUsers " ), 2 , $user -> hasRight ( 'compta' , 'resultat' , 'lire' ));
2022-03-19 15:03:32 +01:00
*/
2022-03-02 22:41:00 +01:00
// Journals
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/journal/sellsjournal.php?leftmenu=report " , $langs -> trans ( " SellsJournal " ), 1 , $user -> hasRight ( 'compta' , 'resultat' , 'lire' ), '' , '' , '' , 50 );
$newmenu -> add ( " /compta/journal/purchasesjournal.php?leftmenu=report " , $langs -> trans ( " PurchasesJournal " ), 1 , $user -> hasRight ( 'compta' , 'resultat' , 'lire' ), '' , '' , '' , 51 );
2020-09-07 10:18:17 +02:00
}
2022-09-06 15:37:00 +02:00
//if ($leftmenu=="ca") $newmenu->add("/compta/journaux/index.php?leftmenu=ca",$langs->trans("Journals"),1,$user->hasRight('compta', 'resultat', 'lire')||$user->hasRight('accounting', 'comptarapport', 'lire'));
2022-03-02 22:41:00 +01:00
}
2019-05-07 09:18:27 +02:00
2022-03-02 22:41:00 +01:00
// Intracomm report
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'intracommreport' )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /intracommreport/list.php?leftmenu=intracommreport " , $langs -> trans ( " MenuIntracommReport " ), 0 , $user -> hasRight ( 'intracommreport' , 'read' ), '' , $mainmenu , 'intracommreport' , 60 , '' , '' , '' , img_picto ( '' , 'intracommreport' , 'class="paddingright pictofixedwidth"' ));
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || preg_match ( '/intracommreport/' , $leftmenu )) {
// DEB / DES
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /intracommreport/card.php?action=create&leftmenu=intracommreport " , $langs -> trans ( " MenuIntracommReportNew " ), 1 , $user -> hasRight ( 'intracommreport' , 'write' ), '' , $mainmenu , 'intracommreport' , 1 );
$newmenu -> add ( " /intracommreport/list.php?leftmenu=intracommreport " , $langs -> trans ( " MenuIntracommReportList " ), 1 , $user -> hasRight ( 'intracommreport' , 'read' ), '' , $mainmenu , 'intracommreport' , 1 );
2020-10-31 14:32:18 +01:00
}
2022-03-02 22:41:00 +01:00
}
2019-05-21 09:55:41 +02:00
2022-03-02 22:41:00 +01:00
// Assets
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'asset' )) {
2025-01-09 13:54:25 +01:00
$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"' ));
$newmenu -> add ( " /asset/card.php?leftmenu=asset&action=create " , $langs -> trans ( " MenuNewAsset " ), 1 , $user -> hasRight ( 'asset' , 'write' ));
$newmenu -> add ( " /asset/list.php?leftmenu=asset&mainmenu=accountancy " , $langs -> trans ( " MenuListAssets " ), 1 , $user -> hasRight ( 'asset' , 'read' ));
2025-02-04 01:17:07 +01:00
$newmenu -> add ( " /asset/model/list.php?leftmenu=asset_model " , $langs -> trans ( " MenuAssetModels " ), 1 , ( int ) (( ! getDolGlobalString ( 'MAIN_USE_ADVANCED_PERMS' ) && $user -> hasRight ( 'asset' , 'read' )) || ( getDolGlobalString ( 'MAIN_USE_ADVANCED_PERMS' ) && $user -> hasRight ( 'asset' , 'model_advance' , 'read' ))), '' , $mainmenu , 'asset_model' );
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || preg_match ( '/asset_model/' , $leftmenu )) {
2025-02-04 01:17:07 +01:00
$newmenu -> add ( " /asset/model/card.php?leftmenu=asset_model&action=create " , $langs -> trans ( " MenuNewAssetModel " ), 2 , ( int ) (( ! getDolGlobalString ( 'MAIN_USE_ADVANCED_PERMS' ) && $user -> hasRight ( 'asset' , 'write' )) || ( getDolGlobalString ( 'MAIN_USE_ADVANCED_PERMS' ) && $user -> hasRight ( 'asset' , 'model_advance' , 'write' ))));
$newmenu -> add ( " /asset/model/list.php?leftmenu=asset_model " , $langs -> trans ( " MenuListAssetModels " ), 2 , ( int ) (( ! getDolGlobalString ( 'MAIN_USE_ADVANCED_PERMS' ) && $user -> hasRight ( 'asset' , 'read' )) || ( getDolGlobalString ( 'MAIN_USE_ADVANCED_PERMS' ) && $user -> hasRight ( 'asset' , 'model_advance' , 'read' ))));
2018-04-01 21:26:52 +02:00
}
2013-02-24 21:16:36 +01:00
}
2022-03-02 22:41:00 +01:00
}
}
2013-02-24 21:16:36 +01:00
2022-03-02 22:41:00 +01:00
/**
* Get left Menu BANK
*
2022-03-19 15:03:32 +01:00
* @ param string $mainmenu Main menu
* @ param Menu $newmenu Object Menu to return back list of menu entries
2023-12-15 13:54:56 +01:00
* @ param int $usemenuhider Use menu hider
2022-03-19 15:03:32 +01:00
* @ param string $leftmenu Left menu
* @ param int $type_user Type of targeted user for menu
2022-03-02 22:41:00 +01:00
* @ return void
*/
function get_left_menu_bank ( $mainmenu , & $newmenu , $usemenuhider = 1 , $leftmenu = 'none' , $type_user = 0 )
{
global $user , $conf , $langs ;
2013-02-24 21:16:36 +01:00
2022-03-02 22:41:00 +01:00
if ( $mainmenu == 'bank' ) {
// Load translation files required by the page
$langs -> loadLangs ( array ( " withdrawals " , " banks " , " bills " , " categories " ));
2013-02-24 21:16:36 +01:00
2022-03-02 22:41:00 +01:00
// Bank-Cash account
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'bank' )) {
2024-04-02 17:02:14 +02:00
$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"' ));
2013-02-24 21:16:36 +01:00
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/bank/card.php?action=create " , $langs -> trans ( " MenuNewFinancialAccount " ), 1 , $user -> hasRight ( 'banque' , 'configurer' ));
2024-04-02 17:02:14 +02:00
$newmenu -> add ( " /compta/bank/list.php?leftmenu=bank&mainmenu=bank&search_status=opened " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'banque' , 'lire' ), '' , $mainmenu , 'bank' );
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/bank/bankentries_list.php " , $langs -> trans ( " ListTransactions " ), 1 , $user -> hasRight ( 'banque' , 'lire' ));
$newmenu -> add ( " /compta/bank/budget.php " , $langs -> trans ( " ListTransactionsByCategory " ), 1 , $user -> hasRight ( 'banque' , 'lire' ));
2013-02-24 21:16:36 +01:00
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/bank/transfer.php " , $langs -> trans ( " MenuBankInternalTransfer " ), 1 , $user -> hasRight ( 'banque' , 'transfer' ));
2022-03-02 22:41:00 +01:00
}
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'category' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " categories " );
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /categories/index.php?type=5 " , $langs -> trans ( " Rubriques " ), 1 , $user -> hasRight ( 'categorie' , 'creer' ), '' , $mainmenu , 'tags' );
2024-10-09 01:48:05 +02:00
$newmenu -> add ( " /categories/index.php?type=8 " , $langs -> trans ( " RubriquesTransactions " ), 1 , $user -> hasRight ( 'banque' , 'configurer' ), '' , $mainmenu , 'tags' );
2022-03-02 22:41:00 +01:00
}
// Direct debit order
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'prelevement' )) {
2023-12-04 12:07:53 +01:00
$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"' ));
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || $leftmenu == " withdraw " ) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/prelevement/create.php?mainmenu=bank " , $langs -> trans ( " NewStandingOrder " ), 1 , $user -> hasRight ( 'prelevement' , 'bons' , 'creer' ));
2022-03-02 22:41:00 +01:00
2024-09-15 18:21:36 +02:00
$newmenu -> add ( " /compta/prelevement/orders_list.php?mainmenu=bank " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'prelevement' , 'bons' , 'lire' ));
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/prelevement/list.php?mainmenu=bank " , $langs -> trans ( " WithdrawalsLines " ), 1 , $user -> hasRight ( 'prelevement' , 'bons' , 'lire' ));
$newmenu -> add ( " /compta/prelevement/rejets.php?mainmenu=bank " , $langs -> trans ( " Rejects " ), 1 , $user -> hasRight ( 'prelevement' , 'bons' , 'lire' ));
$newmenu -> add ( " /compta/prelevement/stats.php?mainmenu=bank " , $langs -> trans ( " Statistics " ), 1 , $user -> hasRight ( 'prelevement' , 'bons' , 'lire' ));
2018-12-15 15:35:59 +01:00
}
2022-03-02 22:41:00 +01:00
}
2016-04-30 14:45:24 +02:00
2022-03-02 22:41:00 +01:00
// Bank transfer order
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'paymentbybanktransfer' )) {
2023-12-04 12:07:53 +01:00
$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"' ));
2013-02-24 21:16:36 +01:00
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || $leftmenu == " banktransfer " ) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/prelevement/create.php?type=bank-transfer&mainmenu=bank " , $langs -> trans ( " NewPaymentByBankTransfer " ), 1 , $user -> hasRight ( 'paymentbybanktransfer' , 'create' ));
2013-02-24 21:16:36 +01:00
2024-09-15 18:21:36 +02:00
$newmenu -> add ( " /compta/prelevement/orders_list.php?type=bank-transfer&mainmenu=bank " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'paymentbybanktransfer' , 'read' ));
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/prelevement/list.php?type=bank-transfer&mainmenu=bank " , $langs -> trans ( " PaymentByBankTransferLines " ), 1 , $user -> hasRight ( 'paymentbybanktransfer' , 'read' ));
$newmenu -> add ( " /compta/prelevement/rejets.php?type=bank-transfer&mainmenu=bank " , $langs -> trans ( " Rejects " ), 1 , $user -> hasRight ( 'paymentbybanktransfer' , 'read' ));
$newmenu -> add ( " /compta/prelevement/stats.php?type=bank-transfer&mainmenu=bank " , $langs -> trans ( " Statistics " ), 1 , $user -> hasRight ( 'paymentbybanktransfer' , 'read' ));
2013-02-24 21:16:36 +01:00
}
2022-03-02 22:41:00 +01:00
}
2013-02-24 21:16:36 +01:00
2022-03-02 22:41:00 +01:00
// Management of checks
2024-02-27 15:30:37 +01:00
if ( ! getDolGlobalString ( 'BANK_DISABLE_CHECK_DEPOSIT' ) && isModEnabled ( 'bank' ) && ( isModEnabled ( 'invoice' ) || getDolGlobalString ( 'MAIN_MENU_CHEQUE_DEPOSIT_ON' ))) {
2023-12-04 12:07:53 +01:00
$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"' ));
2022-03-02 22:41:00 +01:00
if ( preg_match ( '/checks/' , $leftmenu )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /compta/paiement/cheque/card.php?leftmenu=checks_bis&action=new&mainmenu=bank " , $langs -> trans ( " NewChequeDeposit " ), 1 , $user -> hasRight ( 'banque' , 'cheque' ));
$newmenu -> add ( " /compta/paiement/cheque/list.php?leftmenu=checks_bis&mainmenu=bank " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'banque' , 'cheque' ));
2022-03-02 22:41:00 +01:00
}
}
2020-05-17 15:06:09 +02:00
2022-03-02 22:41:00 +01:00
// Cash Control
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'takepos' ) || isModEnabled ( 'cashdesk' )) {
2024-03-13 15:06:34 +01:00
$permtomakecashfence = ( $user -> hasRight ( 'cashdesk' , 'run' ) || $user -> hasRight ( 'takepos' , 'run' ));
2025-02-04 01:17:07 +01:00
$newmenu -> add ( " /compta/cashcontrol/cashcontrol_list.php " , $langs -> trans ( " CashControl " ), 0 , ( int ) $permtomakecashfence , '' , $mainmenu , 'cashcontrol' , 0 , '' , '' , '' , img_picto ( '' , 'pos' , 'class="paddingright pictofixedwidth"' ));
$newmenu -> add ( " /compta/cashcontrol/cashcontrol_card.php?action=create " , $langs -> trans ( " NewCashFence " ), 1 , ( int ) $permtomakecashfence );
$newmenu -> add ( " /compta/cashcontrol/cashcontrol_list.php " , $langs -> trans ( " List " ), 1 , ( int ) $permtomakecashfence );
2022-03-02 22:41:00 +01:00
}
}
}
2020-05-17 15:06:09 +02:00
2022-03-02 22:41:00 +01:00
/**
* Get left Menu PRODUCTS - SERVICES
*
2022-03-19 15:03:32 +01:00
* @ param string $mainmenu Main menu
* @ param Menu $newmenu Object Menu to return back list of menu entries
2023-12-15 13:54:56 +01:00
* @ param int $usemenuhider Use menu hider
2022-03-19 15:03:32 +01:00
* @ param string $leftmenu Left menu
* @ param int $type_user Type of targeted user for menu
2022-03-02 22:41:00 +01:00
* @ return void
*/
function get_left_menu_products ( $mainmenu , & $newmenu , $usemenuhider = 1 , $leftmenu = 'none' , $type_user = 0 )
{
global $user , $conf , $langs ;
if ( $mainmenu == 'products' ) {
// Products
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'product' )) {
2024-04-01 13:08:35 +02:00
$newmenu -> add ( " /product/index.php?leftmenu=product " , $langs -> trans ( " Products " ), 0 , $user -> hasRight ( 'product' , 'read' ), '' , $mainmenu , 'product' , 0 , '' , '' , '' , img_picto ( '' , 'product' , 'class="paddingright pictofixedwidth"' ));
2025-01-09 13:54:25 +01:00
$newmenu -> add ( " /product/card.php?leftmenu=product&action=create&type=0 " , $langs -> trans ( " NewProduct " ), 1 , $user -> hasRight ( 'product' , 'creer' ));
$newmenu -> add ( " /product/list.php?leftmenu=product&type=0 " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'product' , 'read' ));
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'stock' )) {
2025-02-04 01:17:07 +01:00
$newmenu -> add ( " /product/reassort.php?type=0 " , $langs -> trans ( " MenuStocks " ), 1 , ( int ) ( $user -> hasRight ( 'product' , 'read' ) && $user -> hasRight ( 'stock' , 'lire' )));
2022-03-02 22:41:00 +01:00
}
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'productbatch' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " stocks " );
2025-02-04 01:17:07 +01:00
$newmenu -> add ( " /product/reassortlot.php?type=0&search_subjecttolotserial=1 " , $langs -> trans ( " StocksByLotSerial " ), 1 , ( int ) ( $user -> hasRight ( 'product' , 'read' ) && $user -> hasRight ( 'stock' , 'lire' )));
$newmenu -> add ( " /product/stock/productlot_list.php " , $langs -> trans ( " LotSerial " ), 1 , ( int ) ( $user -> hasRight ( 'product' , 'read' ) && $user -> hasRight ( 'stock' , 'lire' )));
2022-03-02 22:41:00 +01:00
}
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'variants' )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /variants/list.php " , $langs -> trans ( " VariantAttributes " ), 1 , $user -> hasRight ( 'product' , 'read' ));
2022-03-02 22:41:00 +01:00
}
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'propal' ) || isModEnabled ( 'order' ) || isModEnabled ( 'invoice' ) || isModEnabled ( 'supplier_proposal' ) || isModEnabled ( 'supplier_order' ) || isModEnabled ( 'supplier_invoice' )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /product/stats/card.php?id=all&leftmenu=stats&type=0 " , $langs -> trans ( " Statistics " ), 1 , $user -> hasRight ( 'product' , 'read' ));
2020-05-17 15:06:09 +02:00
}
2022-03-02 22:41:00 +01:00
// Categories
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'category' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " categories " );
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /categories/index.php?leftmenu=cat&type=0 " , $langs -> trans ( " Categories " ), 1 , $user -> hasRight ( 'categorie' , 'lire' ), '' , $mainmenu , 'cat' );
2022-09-06 15:37:00 +02:00
//if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->hasRight('categorie', 'lire'));
2013-02-24 21:16:36 +01:00
}
2022-03-02 22:41:00 +01:00
}
2018-12-15 18:21:37 +01:00
2022-03-02 22:41:00 +01:00
// Services
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'service' )) {
2024-04-01 13:08:35 +02:00
$newmenu -> add ( " /product/index.php?leftmenu=service " , $langs -> trans ( " Services " ), 0 , $user -> hasRight ( 'service' , 'read' ), '' , $mainmenu , 'service' , 0 , '' , '' , '' , img_picto ( '' , 'service' , 'class="paddingright pictofixedwidth"' ));
2025-01-09 13:54:25 +01:00
$newmenu -> add ( " /product/card.php?leftmenu=service&action=create&type=1 " , $langs -> trans ( " NewService " ), 1 , $user -> hasRight ( 'service' , 'creer' ));
$newmenu -> add ( " /product/list.php?leftmenu=service&type=1 " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'service' , 'read' ));
2023-09-28 23:09:17 +02:00
2024-02-21 19:09:37 +01:00
if ( isModEnabled ( 'stock' ) && getDolGlobalString ( 'STOCK_SUPPORTS_SERVICES' )) {
2025-02-04 01:17:07 +01:00
$newmenu -> add ( " /product/reassort.php?type=1 " , $langs -> trans ( " MenuStocks " ), 1 , ( int ) ( $user -> hasRight ( 'service' , 'read' ) && $user -> hasRight ( 'stock' , 'lire' )));
2023-09-29 00:32:08 +02:00
}
2023-09-17 23:20:44 +02:00
if ( isModEnabled ( 'variants' )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /variants/list.php " , $langs -> trans ( " VariantAttributes " ), 1 , $user -> hasRight ( 'service' , 'read' ));
2023-09-17 22:46:25 +02:00
}
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'propal' ) || isModEnabled ( 'order' ) || isModEnabled ( 'invoice' ) || isModEnabled ( 'supplier_proposal' ) || isModEnabled ( 'supplier_order' ) || isModEnabled ( 'supplier_invoice' )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /product/stats/card.php?id=all&leftmenu=stats&type=1 " , $langs -> trans ( " Statistics " ), 1 , $user -> hasRight ( 'service' , 'read' ));
2022-03-02 22:41:00 +01:00
}
// Categories
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'category' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " categories " );
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /categories/index.php?leftmenu=cat&type=0 " , $langs -> trans ( " Categories " ), 1 , $user -> hasRight ( 'categorie' , 'lire' ), '' , $mainmenu , 'cat' );
2022-09-06 15:37:00 +02:00
//if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->hasRight('categorie', 'lire'));
2018-12-08 21:33:54 +01:00
}
2013-02-24 21:16:36 +01:00
}
2022-03-02 22:41:00 +01:00
// Warehouse
2022-06-02 10:29:34 +02:00
if ( isModEnabled ( 'stock' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " stocks " );
2024-04-01 13:33:15 +02:00
$newmenu -> add ( " /product/index.php?leftmenu=stock " , $langs -> trans ( " Warehouses " ), 0 , $user -> hasRight ( 'stock' , 'lire' ), '' , $mainmenu , 'stock' , 0 , '' , '' , '' , img_picto ( '' , 'stock' , 'class="paddingright pictofixedwidth"' ));
2022-09-08 12:29:46 +02:00
$newmenu -> add ( " /product/stock/card.php?action=create " , $langs -> trans ( " MenuNewWarehouse " ), 1 , $user -> hasRight ( 'stock' , 'creer' ));
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /product/stock/list.php " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'stock' , 'lire' ));
2022-09-08 12:29:46 +02:00
$newmenu -> add ( " /product/stock/movement_list.php " , $langs -> trans ( " Movements " ), 1 , $user -> hasRight ( 'stock' , 'mouvement' , 'lire' ));
2022-03-02 22:41:00 +01:00
2022-11-12 02:16:50 +01:00
$newmenu -> add ( " /product/stock/massstockmove.php?init=1 " , $langs -> trans ( " MassStockTransferShort " ), 1 , $user -> hasRight ( 'stock' , 'mouvement' , 'creer' ));
2022-06-02 10:29:34 +02:00
if ( isModEnabled ( 'supplier_order' )) {
2025-02-04 01:17:07 +01:00
$newmenu -> add ( " /product/stock/replenish.php " , $langs -> trans ( " Replenishment " ), 1 , ( int ) ( $user -> hasRight ( 'stock' , 'mouvement' , 'creer' ) && $user -> hasRight ( 'fournisseur' , 'lire' )));
2022-03-02 22:41:00 +01:00
}
2025-02-04 01:17:07 +01:00
$newmenu -> add ( " /product/stock/stockatdate.php " , $langs -> trans ( " StockAtDate " ), 1 , ( int ) ( $user -> hasRight ( 'product' , 'read' ) && $user -> hasRight ( 'stock' , 'lire' )));
2018-10-09 15:26:15 +02:00
2022-03-02 22:41:00 +01:00
// Categories for warehouses
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'category' )) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /categories/index.php?leftmenu=stock&type=9 " , $langs -> trans ( " Categories " ), 1 , $user -> hasRight ( 'categorie' , 'lire' ), '' , $mainmenu , 'cat' );
2013-02-24 21:16:36 +01:00
}
2022-03-02 22:41:00 +01:00
}
2013-02-24 21:16:36 +01:00
2022-06-02 10:29:34 +02:00
if ( isModEnabled ( 'stocktransfer' )) {
2023-12-04 12:07:53 +01:00
$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"' ));
$newmenu -> add ( '/product/stock/stocktransfer/stocktransfer_card.php?action=create' , $langs -> trans ( 'StockTransferNew' ), 1 , $user -> hasRight ( 'stocktransfer' , 'stocktransfer' , 'write' ));
$newmenu -> add ( '/product/stock/stocktransfer/stocktransfer_list.php' , $langs -> trans ( 'List' ), 1 , $user -> hasRight ( 'stocktransfer' , 'stocktransfer' , 'read' ));
2022-04-12 09:08:57 +02:00
}
2022-03-02 22:41:00 +01:00
// Inventory
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'stock' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " stocks " );
2023-11-27 11:39:32 +01:00
if ( ! getDolGlobalString ( 'MAIN_USE_ADVANCED_PERMS' )) {
2023-12-04 12:07:53 +01:00
$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"' ));
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || $leftmenu == " stock_inventories " ) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /product/inventory/card.php?action=create&leftmenu=stock_inventories " , $langs -> trans ( " NewInventory " ), 1 , $user -> hasRight ( 'stock' , 'creer' ));
$newmenu -> add ( " /product/inventory/list.php?leftmenu=stock_inventories " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'stock' , 'lire' ));
2013-02-24 21:16:36 +01:00
}
2022-03-02 22:41:00 +01:00
} else {
2023-12-04 12:07:53 +01:00
$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"' ));
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || $leftmenu == " stock_inventories " ) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /product/inventory/card.php?action=create&leftmenu=stock_inventories " , $langs -> trans ( " NewInventory " ), 1 , $user -> hasRight ( 'stock' , 'inventory_advance' , 'write' ));
$newmenu -> add ( " /product/inventory/list.php?leftmenu=stock_inventories " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'stock' , 'inventory_advance' , 'read' ));
2018-10-09 15:26:15 +02:00
}
2013-02-24 21:16:36 +01:00
}
2022-03-02 22:41:00 +01:00
}
2013-02-24 21:16:36 +01:00
2022-03-02 22:41:00 +01:00
// Shipments
2024-03-12 11:07:18 +01:00
if ( isModEnabled ( 'shipping' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " sendings " );
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /expedition/index.php?leftmenu=sendings " , $langs -> trans ( " Shipments " ), 0 , $user -> hasRight ( 'expedition' , 'lire' ), '' , $mainmenu , 'sendings' , 0 , '' , '' , '' , img_picto ( '' , 'shipment' , 'class="paddingright pictofixedwidth"' ));
$newmenu -> add ( " /expedition/card.php?action=create2&leftmenu=sendings " , $langs -> trans ( " NewSending " ), 1 , $user -> hasRight ( 'expedition' , 'creer' ));
$newmenu -> add ( " /expedition/list.php?leftmenu=sendings " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'expedition' , 'lire' ));
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || $leftmenu == " sendings " ) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /expedition/list.php?leftmenu=sendings&search_status=0 " , $langs -> trans ( " StatusSendingDraftShort " ), 2 , $user -> hasRight ( 'expedition' , 'lire' ));
$newmenu -> add ( " /expedition/list.php?leftmenu=sendings&search_status=1 " , $langs -> trans ( " StatusSendingValidatedShort " ), 2 , $user -> hasRight ( 'expedition' , 'lire' ));
$newmenu -> add ( " /expedition/list.php?leftmenu=sendings&search_status=2 " , $langs -> trans ( " StatusSendingProcessedShort " ), 2 , $user -> hasRight ( 'expedition' , 'lire' ));
2022-03-02 22:41:00 +01:00
}
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /expedition/stats/index.php?leftmenu=sendings " , $langs -> trans ( " Statistics " ), 1 , $user -> hasRight ( 'expedition' , 'lire' ));
2022-03-02 22:41:00 +01:00
}
2019-09-27 13:28:28 +02:00
2022-03-02 22:41:00 +01:00
// Receptions
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'reception' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " receptions " );
2025-01-08 14:41:45 +01:00
$newmenu -> add ( " /reception/index.php?leftmenu=receptions " , $langs -> trans ( " Receptions " ), 0 , $user -> hasRight ( 'reception' , 'lire' ), '' , $mainmenu , 'receptions' , 0 , '' , '' , '' , img_picto ( '' , 'dollyrevert' , 'class="pictofixedwidth", style="text-align: right;"' ));
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /reception/card.php?action=create2&leftmenu=receptions " , $langs -> trans ( " NewReception " ), 1 , $user -> hasRight ( 'reception' , 'creer' ));
$newmenu -> add ( " /reception/list.php?leftmenu=receptions " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'reception' , 'lire' ));
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || $leftmenu == " receptions " ) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /reception/list.php?leftmenu=receptions&search_status=0 " , $langs -> trans ( " StatusReceptionDraftShort " ), 2 , $user -> hasRight ( 'reception' , 'lire' ));
2022-03-02 22:41:00 +01:00
}
if ( $usemenuhider || empty ( $leftmenu ) || $leftmenu == " receptions " ) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /reception/list.php?leftmenu=receptions&search_status=1 " , $langs -> trans ( " StatusReceptionValidatedShort " ), 2 , $user -> hasRight ( 'reception' , 'lire' ));
2022-03-02 22:41:00 +01:00
}
if ( $usemenuhider || empty ( $leftmenu ) || $leftmenu == " receptions " ) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /reception/list.php?leftmenu=receptions&search_status=2 " , $langs -> trans ( " StatusReceptionProcessedShort " ), 2 , $user -> hasRight ( 'reception' , 'lire' ));
2013-02-24 21:16:36 +01:00
}
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /reception/stats/index.php?leftmenu=receptions " , $langs -> trans ( " Statistics " ), 1 , $user -> hasRight ( 'reception' , 'lire' ));
2022-03-02 22:41:00 +01:00
}
}
}
2013-02-24 21:16:36 +01:00
2022-03-02 22:41:00 +01:00
/**
* Get left Menu PRODUCTS - SERVICES MRP - GPAO
*
2022-03-19 15:03:32 +01:00
* @ param string $mainmenu Main menu
* @ param Menu $newmenu Object Menu to return back list of menu entries
2023-12-15 13:54:56 +01:00
* @ param int $usemenuhider Use menu hider
2022-03-19 15:03:32 +01:00
* @ param string $leftmenu Left menu
* @ param int $type_user Type of targeted user for menu
2022-03-02 22:41:00 +01:00
* @ return void
*/
function get_left_menu_mrp ( $mainmenu , & $newmenu , $usemenuhider = 1 , $leftmenu = 'none' , $type_user = 0 )
{
global $user , $conf , $langs ;
2022-03-19 15:03:32 +01:00
2022-03-02 22:41:00 +01:00
if ( $mainmenu == 'mrp' ) {
// BOM
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'bom' ) || isModEnabled ( 'mrp' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " mrp " );
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " " , $langs -> trans ( " MenuBOM " ), 0 , $user -> hasRight ( 'bom' , 'read' ), '' , $mainmenu , 'bom' , 0 , '' , '' , '' , img_picto ( '' , 'bom' , 'class="paddingright pictofixedwidth"' ));
2025-01-09 13:54:25 +01:00
$newmenu -> add ( " /bom/bom_card.php?leftmenu=bom&action=create " , $langs -> trans ( " NewBOM " ), 1 , $user -> hasRight ( 'bom' , 'write' ), '' , $mainmenu , 'bom' );
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /bom/bom_list.php?leftmenu=bom " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'bom' , 'read' ), '' , $mainmenu , 'bom' );
2022-03-02 22:41:00 +01:00
}
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'mrp' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " mrp " );
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " " , $langs -> trans ( " MenuMRP " ), 0 , $user -> hasRight ( 'mrp' , 'read' ), '' , $mainmenu , 'mrp' , 0 , '' , '' , '' , img_picto ( '' , 'mrp' , 'class="paddingright pictofixedwidth"' ));
2025-01-09 13:54:25 +01:00
$newmenu -> add ( " /mrp/mo_card.php?leftmenu=mo&action=create " , $langs -> trans ( " NewMO " ), 1 , $user -> hasRight ( 'mrp' , 'write' ), '' , $mainmenu , '' );
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /mrp/mo_list.php?leftmenu=mo " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'mrp' , 'read' ), '' , $mainmenu , '' );
2022-03-02 22:41:00 +01:00
}
}
}
/**
* Get left Menu PROJECTS
*
2022-03-19 15:03:32 +01:00
* @ param string $mainmenu Main menu
* @ param Menu $newmenu Object Menu to return back list of menu entries
2023-12-15 13:54:56 +01:00
* @ param int $usemenuhider Use menu hider
2022-03-19 15:03:32 +01:00
* @ param string $leftmenu Left menu
* @ param int $type_user Type of targeted user for menu
2022-03-02 22:41:00 +01:00
* @ return void
*/
function get_left_menu_projects ( $mainmenu , & $newmenu , $usemenuhider = 1 , $leftmenu = 'none' , $type_user = 0 )
{
global $user , $conf , $langs ;
2022-03-19 15:03:32 +01:00
2022-03-02 22:41:00 +01:00
if ( $mainmenu == 'project' ) {
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'project' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " projects " );
Fix: GETPOST(...,'int') to GETPOSTINT(...) (#28448)
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: Update spelling exceptions
* Qual: Ignore Phan Notice
2024-02-27 14:05:53 +01:00
$search_project_user = GETPOSTINT ( 'search_project_user' );
2022-03-02 22:41:00 +01:00
$tmpentry = array (
2025-02-04 01:17:07 +01:00
'enabled' => ( int ) isModEnabled ( 'project' ),
'perms' => ( string ) ( int ) $user -> hasRight ( 'projet' , 'lire' ),
2024-03-13 15:06:34 +01:00
'module' => 'projet'
2022-03-02 22:41:00 +01:00
);
2023-12-13 15:20:53 +01:00
$listofmodulesforexternal = explode ( ',' , getDolGlobalString ( 'MAIN_MODULES_FOR_EXTERNAL' ));
2022-03-02 22:41:00 +01:00
$showmode = isVisibleToUserType ( $type_user , $tmpentry , $listofmodulesforexternal );
$titleboth = $langs -> trans ( " LeadsOrProjects " );
$titlenew = $langs -> trans ( " NewLeadOrProject " ); // Leads and opportunities by default
2023-11-27 11:39:32 +01:00
if ( ! getDolGlobalString ( 'PROJECT_USE_OPPORTUNITIES' )) {
2022-03-02 22:41:00 +01:00
$titleboth = $langs -> trans ( " Projects " );
$titlenew = $langs -> trans ( " NewProject " );
}
2023-10-08 23:19:49 +02:00
if ( getDolGlobalInt ( 'PROJECT_USE_OPPORTUNITIES' ) == 2 ) { // 2 = leads only
2022-03-02 22:41:00 +01:00
$titleboth = $langs -> trans ( " Leads " );
$titlenew = $langs -> trans ( " NewLead " );
2017-04-29 21:53:01 +02:00
}
2017-06-02 19:28:22 +02:00
2022-03-02 22:41:00 +01:00
// Project assigned to user
2023-12-04 12:07:53 +01:00
$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"' ));
$newmenu -> add ( " /projet/card.php?leftmenu=projects&action=create " . ( $search_project_user ? '&search_project_user=' . $search_project_user : '' ), $titlenew , 1 , $user -> hasRight ( 'projet' , 'creer' ));
2022-03-02 22:41:00 +01:00
2023-11-27 11:39:32 +01:00
if ( ! getDolGlobalString ( 'PROJECT_USE_OPPORTUNITIES' )) {
2024-01-13 19:48:20 +01:00
$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' );
2023-10-08 23:19:49 +02:00
} elseif ( getDolGlobalInt ( 'PROJECT_USE_OPPORTUNITIES' ) == 1 ) {
2024-01-13 19:48:20 +01:00
$newmenu -> add ( " /projet/list.php?leftmenu=projects " . ( $search_project_user ? '&search_project_user=' . $search_project_user : '' ), $langs -> trans ( " List " ), 1 , $showmode , '' , 'project' , 'list' );
2022-03-02 22:41:00 +01:00
$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 );
$newmenu -> add ( '/projet/list.php?mainmenu=project&leftmenu=list&search_opp_status=notopenedopp&search_status=99&contextpage=project' , $langs -> trans ( " ListOpenProjects " ), 2 , $showmode );
2023-10-08 23:19:49 +02:00
} elseif ( getDolGlobalInt ( 'PROJECT_USE_OPPORTUNITIES' ) == 2 ) { // 2 = leads only
2022-03-02 22:41:00 +01:00
$newmenu -> add ( '/projet/list.php?mainmenu=project&leftmenu=list&search_usage_opportunity=1&search_status=99' , $langs -> trans ( " List " ), 2 , $showmode );
2013-02-24 21:16:36 +01:00
}
2018-12-15 12:50:31 +01:00
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /projet/stats/index.php?leftmenu=projects " , $langs -> trans ( " Statistics " ), 1 , $user -> hasRight ( 'projet' , 'lire' ));
2022-03-02 22:41:00 +01:00
// Categories
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'category' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " categories " );
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /categories/index.php?leftmenu=cat&type=6 " , $langs -> trans ( " Categories " ), 1 , $user -> hasRight ( 'categorie' , 'lire' ), '' , $mainmenu , 'cat' );
2022-03-02 22:41:00 +01:00
}
2023-11-27 11:39:32 +01:00
if ( ! getDolGlobalString ( 'PROJECT_HIDE_TASKS' )) {
2023-11-20 11:41:02 +01:00
// Project assigned to user
2023-12-04 12:07:53 +01:00
$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"' ));
$newmenu -> add ( " /projet/tasks.php?leftmenu=tasks&action=create " , $langs -> trans ( " NewTask " ), 1 , $user -> hasRight ( 'projet' , 'creer' ));
$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' ));
$newmenu -> add ( " /projet/tasks/stats/index.php?leftmenu=projects " , $langs -> trans ( " Statistics " ), 1 , $user -> hasRight ( 'projet' , 'lire' ));
2022-03-02 22:41:00 +01:00
2023-12-04 12:07:53 +01:00
$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"' ));
$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' ));
2018-10-03 12:22:41 +02:00
}
2013-02-24 21:16:36 +01:00
}
2022-03-02 22:41:00 +01:00
}
}
2013-02-24 21:16:36 +01:00
2022-03-02 22:41:00 +01:00
/**
* Get left Menu HRM
*
2022-03-19 15:03:32 +01:00
* @ param string $mainmenu Main menu
* @ param Menu $newmenu Object Menu to return back list of menu entries
2023-12-15 13:54:56 +01:00
* @ param int $usemenuhider Use menu hider
2022-03-19 15:03:32 +01:00
* @ param string $leftmenu Left menu
* @ param int $type_user Type of targeted user for menu
2022-03-02 22:41:00 +01:00
* @ return void
*/
function get_left_menu_hrm ( $mainmenu , & $newmenu , $usemenuhider = 1 , $leftmenu = 'none' , $type_user = 0 )
{
global $user , $conf , $langs ;
if ( $mainmenu == 'hrm' ) {
// HRM module
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'hrm' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " hrm " );
2022-10-31 08:13:11 +01:00
$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"' ));
2022-09-06 15:37:00 +02:00
$newmenu -> add ( " /user/card.php?mainmenu=hrm&leftmenu=hrm&action=create&employee=1 " , $langs -> trans ( " NewEmployee " ), 1 , $user -> hasRight ( 'user' , 'user' , 'write' ));
2022-10-31 08:13:11 +01:00
$newmenu -> add ( " /user/list.php?mainmenu=hrm&leftmenu=hrm&contextpage=employeelist " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'user' , 'user' , 'read' ));
2022-03-02 22:41:00 +01:00
2022-09-06 15:37:00 +02:00
$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"' ));
2022-03-02 22:41:00 +01:00
2022-03-17 15:20:23 +01:00
// Skills
2022-09-06 15:37:00 +02:00
$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"' ));
//$newmenu->add("/hrm/skill_card.php?mainmenu=hrm&leftmenu=hrm_sm&action=create", $langs->trans("NewSkill"), 1, $user->hasRight('hrm', 'all', 'write'));
//$newmenu->add("/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->hasRight('hrm', 'all', 'read'));
2022-03-02 22:41:00 +01:00
2022-03-17 15:20:23 +01:00
// Job (Description of work to do and skills required)
2023-02-11 12:28:23 +01:00
$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"' ));
2022-09-06 15:37:00 +02:00
//$newmenu->add("/hrm/job_card.php?mainmenu=hrm&leftmenu=hrm_sm&action=create", $langs->transnoentities("NewObject", $langs->trans("Job")), 1, $user->hasRight('hrm', 'all', 'write'));
//$newmenu->add("/hrm/job_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->hasRight('hrm', 'all', 'read'));
2022-03-02 22:41:00 +01:00
2022-03-17 15:20:23 +01:00
// Position = Link job - user
2022-09-06 15:37:00 +02:00
$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"' ));
//$newmenu->add("/hrm/position.php?mainmenu=hrm&leftmenu=hrm_sm&action=create", $langs->transnoentities("NewObject", $langs->trans("Position")), 1, $user->hasRight('hrm', 'all', 'write'));
//$newmenu->add("/hrm/position_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->hasRight('hrm', 'all', 'read'));
2022-03-02 22:41:00 +01:00
2022-03-17 15:20:23 +01:00
// Evaluation
2022-09-06 15:37:00 +02:00
$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"' ));
//$newmenu->add("/hrm/evaluation_card.php?mainmenu=hrm&leftmenu=hrm_sm&action=create", $langs->trans("NewEval"), 1, $user->hasRight('hrm', 'evaluation', 'write'));
//$newmenu->add("/hrm/evaluation_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->hasRight('hrm', 'evaluation', 'read'));
2025-02-04 01:17:07 +01:00
$newmenu -> add ( " /hrm/compare.php?mainmenu=hrm&leftmenu=hrm_sm " , $langs -> trans ( " SkillComparison " ), 1 , ( int ) ( $user -> hasRight ( 'hrm' , 'evaluation' , 'read' ) || $user -> hasRight ( 'hrm' , 'compare_advance' , 'read' )));
2022-03-02 22:41:00 +01:00
}
2020-09-07 10:18:17 +02:00
2022-03-02 22:41:00 +01:00
// Leave/Holiday/Vacation module
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'holiday' )) {
2022-03-02 22:41:00 +01:00
// Load translation files required by the page
$langs -> loadLangs ( array ( " holiday " , " trips " ));
2023-12-04 12:07:53 +01:00
$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"' ));
$newmenu -> add ( " /holiday/card.php?mainmenu=hrm&leftmenu=holiday&action=create " , $langs -> trans ( " New " ), 1 , $user -> hasRight ( 'holiday' , 'write' ), '' , $mainmenu );
2025-02-04 01:17:07 +01:00
$newmenu -> add ( " /holiday/card_group.php?mainmenu=hrm&leftmenu=holiday&action=create " , $langs -> trans ( " NewHolidayForGroup " ), 1 , ( int ) ( $user -> hasRight ( 'holiday' , 'writeall' ) && $user -> hasRight ( 'holiday' , 'readall' )), '' , $mainmenu , 'holiday_sm' );
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /holiday/list.php?mainmenu=hrm&leftmenu=holiday " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'holiday' , 'read' ), '' , $mainmenu );
2022-05-24 15:13:22 +02:00
if ( $usemenuhider || empty ( $leftmenu ) || $leftmenu == " holiday " ) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /holiday/list.php?search_status=1&mainmenu=hrm&leftmenu=holiday " , $langs -> trans ( " DraftCP " ), 2 , $user -> hasRight ( 'holiday' , 'read' ), '' , $mainmenu , 'holiday_sm' );
$newmenu -> add ( " /holiday/list.php?search_status=2&mainmenu=hrm&leftmenu=holiday " , $langs -> trans ( " ToReviewCP " ), 2 , $user -> hasRight ( 'holiday' , 'read' ), '' , $mainmenu , 'holiday_sm' );
$newmenu -> add ( " /holiday/list.php?search_status=3&mainmenu=hrm&leftmenu=holiday " , $langs -> trans ( " ApprovedCP " ), 2 , $user -> hasRight ( 'holiday' , 'read' ), '' , $mainmenu , 'holiday_sm' );
$newmenu -> add ( " /holiday/list.php?search_status=4&mainmenu=hrm&leftmenu=holiday " , $langs -> trans ( " CancelCP " ), 2 , $user -> hasRight ( 'holiday' , 'read' ), '' , $mainmenu , 'holiday_sm' );
$newmenu -> add ( " /holiday/list.php?search_status=5&mainmenu=hrm&leftmenu=holiday " , $langs -> trans ( " RefuseCP " ), 2 , $user -> hasRight ( 'holiday' , 'read' ), '' , $mainmenu , 'holiday_sm' );
2022-05-24 15:24:31 +02:00
}
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /holiday/define_holiday.php?mainmenu=hrm " , $langs -> trans ( " MenuConfCP " ), 1 , $user -> hasRight ( 'holiday' , 'read' ), '' , $mainmenu , 'holiday_sm' );
$newmenu -> add ( " /holiday/month_report.php?mainmenu=hrm&leftmenu=holiday " , $langs -> trans ( " MenuReportMonth " ), 1 , $user -> hasRight ( 'holiday' , 'readall' ), '' , $mainmenu , 'holiday_sm' );
$newmenu -> add ( " /holiday/view_log.php?mainmenu=hrm&leftmenu=holiday " , $langs -> trans ( " MenuLogCP " ), 1 , $user -> hasRight ( 'holiday' , 'define_holiday' ), '' , $mainmenu , 'holiday_sm' );
2022-03-02 22:41:00 +01:00
}
2020-09-07 10:18:17 +02:00
2022-03-02 22:41:00 +01:00
// Trips and expenses (old module)
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'deplacement' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " trips " );
2023-12-04 12:07:53 +01:00
$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"' ));
$newmenu -> add ( " /compta/deplacement/card.php?action=create&leftmenu=tripsandexpenses&mainmenu=hrm " , $langs -> trans ( " New " ), 1 , $user -> hasRight ( 'deplacement' , 'creer' ));
$newmenu -> add ( " /compta/deplacement/list.php?leftmenu=tripsandexpenses&mainmenu=hrm " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'deplacement' , 'lire' ));
$newmenu -> add ( " /compta/deplacement/stats/index.php?leftmenu=tripsandexpenses&mainmenu=hrm " , $langs -> trans ( " Statistics " ), 1 , $user -> hasRight ( 'deplacement' , 'lire' ));
2022-03-02 22:41:00 +01:00
}
2020-09-07 10:18:17 +02:00
2022-03-02 22:41:00 +01:00
// Expense report
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'expensereport' )) {
2022-04-15 12:14:41 +02:00
$langs -> loadLangs ( array ( " trips " , " bills " ));
2024-06-08 01:28:05 +02:00
$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"' ));
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /expensereport/card.php?action=create&leftmenu=expensereport&mainmenu=hrm " , $langs -> trans ( " New " ), 1 , $user -> hasRight ( 'expensereport' , 'creer' ));
$newmenu -> add ( " /expensereport/list.php?leftmenu=expensereport&mainmenu=hrm " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'expensereport' , 'lire' ));
2022-03-02 22:41:00 +01:00
if ( $usemenuhider || empty ( $leftmenu ) || $leftmenu == " expensereport " ) {
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /expensereport/list.php?search_status=0&leftmenu=expensereport&mainmenu=hrm " , $langs -> trans ( " Draft " ), 2 , $user -> hasRight ( 'expensereport' , 'lire' ));
$newmenu -> add ( " /expensereport/list.php?search_status=2&leftmenu=expensereport&mainmenu=hrm " , $langs -> trans ( " Validated " ), 2 , $user -> hasRight ( 'expensereport' , 'lire' ));
$newmenu -> add ( " /expensereport/list.php?search_status=5&leftmenu=expensereport&mainmenu=hrm " , $langs -> trans ( " Approved " ), 2 , $user -> hasRight ( 'expensereport' , 'lire' ));
$newmenu -> add ( " /expensereport/list.php?search_status=6&leftmenu=expensereport&mainmenu=hrm " , $langs -> trans ( " Paid " ), 2 , $user -> hasRight ( 'expensereport' , 'lire' ));
$newmenu -> add ( " /expensereport/list.php?search_status=4&leftmenu=expensereport&mainmenu=hrm " , $langs -> trans ( " Canceled " ), 2 , $user -> hasRight ( 'expensereport' , 'lire' ));
$newmenu -> add ( " /expensereport/list.php?search_status=99&leftmenu=expensereport&mainmenu=hrm " , $langs -> trans ( " Refused " ), 2 , $user -> hasRight ( 'expensereport' , 'lire' ));
2020-09-07 10:18:17 +02:00
}
2025-02-04 01:17:07 +01:00
$newmenu -> add ( " /expensereport/payment/list.php?leftmenu=expensereport_payments&mainmenu=hrm " , $langs -> trans ( " Payments " ), 1 , ( int ) ( int ) ( $user -> hasRight ( 'expensereport' , 'lire' ) && isModEnabled ( 'bank' )));
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /expensereport/stats/index.php?leftmenu=expensereport&mainmenu=hrm " , $langs -> trans ( " Statistics " ), 1 , $user -> hasRight ( 'expensereport' , 'lire' ));
2019-02-26 19:27:04 +01:00
}
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'project' )) {
2023-11-27 11:39:32 +01:00
if ( ! getDolGlobalString ( 'PROJECT_HIDE_TASKS' )) {
2013-02-24 21:16:36 +01:00
$langs -> load ( " projects " );
2017-06-02 19:28:22 +02:00
Fix: GETPOST(...,'int') to GETPOSTINT(...) (#28448)
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: Update spelling exceptions
* Qual: Ignore Phan Notice
2024-02-27 14:05:53 +01:00
$search_project_user = GETPOSTINT ( 'search_project_user' );
2017-06-02 19:28:22 +02:00
2023-12-04 12:07:53 +01:00
$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"' ));
2022-03-02 22:41:00 +01:00
}
}
}
}
2013-02-24 21:16:36 +01:00
2022-05-24 15:13:22 +02:00
2022-03-02 22:41:00 +01:00
/**
* Get left Menu TOOLS
*
2022-03-19 15:03:32 +01:00
* @ param string $mainmenu Main menu
* @ param Menu $newmenu Object Menu to return back list of menu entries
2023-12-15 13:54:56 +01:00
* @ param int $usemenuhider Use menu hider
2022-03-19 15:03:32 +01:00
* @ param string $leftmenu Left menu
* @ param int $type_user Type of targeted user for menu
2022-03-02 22:41:00 +01:00
* @ return void
*/
function get_left_menu_tools ( $mainmenu , & $newmenu , $usemenuhider = 1 , $leftmenu = 'none' , $type_user = 0 )
{
2024-11-04 14:59:22 +01:00
global $user , $langs ;
2022-03-19 15:03:32 +01:00
2022-03-02 22:41:00 +01:00
if ( $mainmenu == 'tools' ) {
if ( empty ( $user -> socid )) { // limit to internal users
$langs -> load ( " mails " );
$newmenu -> add ( " /admin/mails_templates.php?leftmenu=email_templates " , $langs -> trans ( " EMailTemplates " ), 0 , 1 , '' , $mainmenu , 'email_templates' , 0 , '' , '' , '' , img_picto ( '' , 'email' , 'class="paddingright pictofixedwidth"' ));
}
2017-06-02 19:28:22 +02:00
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'mailing' )) {
2024-02-09 15:58:49 +01:00
$titleindex = $langs -> trans ( " EMailings " );
$titlenew = $langs -> trans ( " NewMailing " );
$titlelist = $langs -> trans ( " List " );
if ( getDolGlobalInt ( 'EMAILINGS_SUPPORT_ALSO_SMS' )) {
$titleindex .= ' | ' . $langs -> trans ( " SMSings " );
$titlenew .= ' | ' . $langs -> trans ( " NewSMSing " );
}
$newmenu -> add ( " /comm/mailing/index.php?leftmenu=mailing " , $titleindex , 0 , $user -> hasRight ( 'mailing' , 'lire' ), '' , $mainmenu , 'mailing' , 0 , '' , '' , '' , img_picto ( '' , 'email' , 'class="paddingright pictofixedwidth"' ));
2025-01-09 13:54:25 +01:00
$newmenu -> add ( " /comm/mailing/card.php?leftmenu=mailing&action=create " , $titlenew , 1 , $user -> hasRight ( 'mailing' , 'creer' ));
2024-02-09 15:58:49 +01:00
$newmenu -> add ( " /comm/mailing/list.php?leftmenu=mailing " , $titlelist , 1 , $user -> hasRight ( 'mailing' , 'lire' ));
2022-03-02 22:41:00 +01:00
}
2018-10-26 14:38:26 +02:00
2024-03-11 14:33:02 +01:00
if ( isModEnabled ( 'import' )) {
$langs -> load ( " exports " );
$newmenu -> add ( " /imports/index.php?leftmenu=import " , $langs -> trans ( " FormatedImport " ), 0 , $user -> hasRight ( 'import' , 'run' ), '' , $mainmenu , 'import' , 0 , '' , '' , '' , img_picto ( '' , 'technic' , 'class="paddingright pictofixedwidth"' ));
$newmenu -> add ( " /imports/import.php?leftmenu=import " , $langs -> trans ( " NewImport " ), 1 , $user -> hasRight ( 'import' , 'run' ));
}
2022-06-09 21:33:39 +02:00
if ( isModEnabled ( 'export' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " exports " );
2023-12-04 12:07:53 +01:00
$newmenu -> add ( " /exports/index.php?leftmenu=export " , $langs -> trans ( " FormatedExport " ), 0 , $user -> hasRight ( 'export' , 'lire' ), '' , $mainmenu , 'export' , 0 , '' , '' , '' , img_picto ( '' , 'technic' , 'class="paddingright pictofixedwidth"' ));
2024-09-02 17:48:50 +02:00
$newmenu -> add ( " /exports/export.php?leftmenu=export " , $langs -> trans ( " NewExport " ), 1 , $user -> hasRight ( 'export' , 'lire' ));
2022-09-06 15:37:00 +02:00
//$newmenu->add("/exports/export.php?leftmenu=export",$langs->trans("List"),1, $user->hasRight('export', 'lire'));
2022-03-02 22:41:00 +01:00
}
2024-11-04 14:59:22 +01:00
$newmenu -> add ( " /core/customreports.php?leftmenu=customreports " , $langs -> trans ( " CustomReports " ), 0 , 1 , '' , $mainmenu , 'customreports' , 0 , '' , '' , '' , img_picto ( '' , 'graph' , 'class="paddingright pictofixedwidth"' ));
2022-03-02 22:41:00 +01:00
}
}
2013-07-07 03:26:51 +02:00
2022-03-02 22:41:00 +01:00
/**
* Get left Menu MEMBERS
*
2022-03-19 15:03:32 +01:00
* @ param string $mainmenu Main menu
* @ param Menu $newmenu Object Menu to return back list of menu entries
2023-12-15 13:54:56 +01:00
* @ param int $usemenuhider Use menu hider
2022-03-19 15:03:32 +01:00
* @ param string $leftmenu Left menu
* @ param int $type_user Type of targeted user for menu
2022-03-02 22:41:00 +01:00
* @ return void
*/
function get_left_menu_members ( $mainmenu , & $newmenu , $usemenuhider = 1 , $leftmenu = 'none' , $type_user = 0 )
{
global $user , $conf , $langs ;
if ( $mainmenu == 'members' ) {
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'member' )) {
2022-03-02 22:41:00 +01:00
// Load translation files required by the page
$langs -> loadLangs ( array ( " members " , " compta " ));
2025-01-09 13:54:25 +01:00
$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"' ));
$newmenu -> add ( " /adherents/card.php?leftmenu=members&action=create " , $langs -> trans ( " NewMember " ), 1 , $user -> hasRight ( 'adherent' , 'write' ));
2022-09-06 15:37:00 +02:00
$newmenu -> add ( " /adherents/list.php?leftmenu=members " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'adherent' , 'read' ));
2025-01-09 13:54:25 +01:00
$newmenu -> add ( " /adherents/list.php?leftmenu=members&statut=-1 " , $langs -> trans ( " MenuMembersToValidate " ), 2 , $user -> hasRight ( 'adherent' , 'read' ));
$newmenu -> add ( " /adherents/list.php?leftmenu=members&statut=1 " , $langs -> trans ( " MenuMembersValidated " ), 2 , $user -> hasRight ( 'adherent' , 'read' ));
$newmenu -> add ( " /adherents/list.php?leftmenu=members&statut=1&filter=waitingsubscription " , $langs -> trans ( " WaitingSubscription " ), 3 , $user -> hasRight ( 'adherent' , 'read' ));
$newmenu -> add ( " /adherents/list.php?leftmenu=members&statut=1&filter=uptodate " , $langs -> trans ( " UpToDate " ), 3 , $user -> hasRight ( 'adherent' , 'read' ));
$newmenu -> add ( " /adherents/list.php?leftmenu=members&statut=1&filter=outofdate " , $langs -> trans ( " OutOfDate " ), 3 , $user -> hasRight ( 'adherent' , 'read' ));
$newmenu -> add ( " /adherents/list.php?leftmenu=members&statut=0 " , $langs -> trans ( " MenuMembersResiliated " ), 2 , $user -> hasRight ( 'adherent' , 'read' ));
$newmenu -> add ( " /adherents/list.php?leftmenu=members&statut=-2 " , $langs -> trans ( " MenuMembersExcluded " ), 2 , $user -> hasRight ( 'adherent' , 'read' ));
2022-09-06 15:37:00 +02:00
$newmenu -> add ( " /adherents/stats/index.php?leftmenu=members " , $langs -> trans ( " MenuMembersStats " ), 1 , $user -> hasRight ( 'adherent' , 'read' ));
$newmenu -> add ( " /adherents/cartes/carte.php?leftmenu=export " , $langs -> trans ( " MembersCards " ), 1 , $user -> hasRight ( 'adherent' , 'export' ));
2015-11-17 22:51:34 +01:00
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'category' )) {
2022-03-02 22:41:00 +01:00
$langs -> load ( " categories " );
2022-09-06 15:37:00 +02:00
$newmenu -> add ( " /categories/index.php?leftmenu=cat&type=3 " , $langs -> trans ( " Categories " ), 1 , $user -> hasRight ( 'categorie' , 'read' ), '' , $mainmenu , 'cat' );
2016-08-30 21:43:17 +02:00
}
2017-09-18 13:15:24 +02:00
2022-09-06 15:37:00 +02:00
$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"' ));
2024-03-19 21:42:36 +01:00
$newmenu -> add ( " /adherents/list.php?leftmenu=members&statut=-1,1&mainmenu=members " , $langs -> trans ( " NewMembership " ), 1 , $user -> hasRight ( 'adherent' , 'cotisation' , 'write' ));
2022-09-06 15:37:00 +02:00
$newmenu -> add ( " /adherents/subscription/list.php?leftmenu=members " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'adherent' , 'cotisation' , 'read' ));
$newmenu -> add ( " /adherents/stats/index.php?leftmenu=members " , $langs -> trans ( " MenuMembersStats " ), 1 , $user -> hasRight ( 'adherent' , 'read' ));
2017-09-18 13:15:24 +02:00
2022-09-06 15:37:00 +02:00
//$newmenu->add("/adherents/index.php?leftmenu=export&mainmenu=members",$langs->trans("Tools"),0,$user->hasRight('adherent', 'export'), '', $mainmenu, 'export');
//if (isModEnabled('export') && ($usemenuhider || empty($leftmenu) || $leftmenu=="export")) $newmenu->add("/exports/index.php?leftmenu=export",$langs->trans("Datas"),1,$user->hasRight('adherent', 'export'));
2017-09-18 13:15:24 +02:00
2022-03-02 22:41:00 +01:00
// Type
2022-09-06 15:37:00 +02:00
$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"' ));
2025-01-09 13:54:25 +01:00
$newmenu -> add ( " /adherents/type.php?leftmenu=setup&mainmenu=members&action=create " , $langs -> trans ( " New " ), 1 , $user -> hasRight ( 'adherent' , 'configurer' ));
2022-09-06 15:37:00 +02:00
$newmenu -> add ( " /adherents/type.php?leftmenu=setup&mainmenu=members " , $langs -> trans ( " List " ), 1 , $user -> hasRight ( 'adherent' , 'configurer' ));
2013-05-04 01:22:09 +02:00
}
2022-03-02 22:41:00 +01:00
}
}