diff --git a/CHANGELOG.md b/ChangeLog.md similarity index 79% rename from CHANGELOG.md rename to ChangeLog.md index 1d6db4b..bfac147 100644 --- a/CHANGELOG.md +++ b/ChangeLog.md @@ -1,87 +1,109 @@ -## Changelog ## +# CHANGELOG OBLYON FOR [DOLIBARR ERP CRM](https://www.dolibarr.org) +All notable changes to this project will be documented in this file. -### Version 3.0.5 - Compatibility 14.0.x - 20.0.x (2024/09/01) +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +### [3.1.0] - Compatibility 14.0.x - 21.0.x (2024/12/30) + +### Fixed +- CSS + +### Added +- Option to change the Dolibarr font family + +### Changed +- Move ChangeLog to format 1.1.0 of "Keep a changelog" +- Separate the option to change the text color of line titles and the main title +- Remove Cashdesk CSS + +### [3.0.6] - Compatibility 14.0.x - 20.0.x (2024/09/30) +- Fix CSS badges +- Fix CSS for FIX_AREAREF_TABACTION +- Fix print_oblyon_menu function with $noout=1 still prints something (Thanks UltraViolet33 from Easya Solutions) + +### [3.0.5] - Compatibility 14.0.x - 20.0.x (2024/09/01) - Fix Z-index with option FIX_AREAREF_TABACTION activated - Add Use specific landing page to home menu entry (Thanks Christophe from Altairis) - Fix display of new dropdown action button -### Version 3.0.4 - Compatibility 14.0.x - 20.0.x (2024/07/03) +### [3.0.4] - Compatibility 14.0.x - 20.0.x (2024/07/03) - Add CSS for drag & drop card feature - Fix menu orders (customer and supplier), problem on search_billed - If Easya version detected, force json information for dlb_min_version & php_min_version -### Version 3.0.3 - Compatibility 14.0.x - 20-alpha (2024/05/24) +### [3.0.3] - Compatibility 14.0.x - 20-alpha (2024/05/24) - Fix Contract expired services menu link (From Dolibarr 18.0.x) - FIX can not show group when MULTICOMPANY_TRANSVERSE_MODE - Move Import menu before export menu - Move compatibility to minimum Dolibarr 18.0 (Easya 2024) for Easya distribution -### Version 3.0.2 - Compatibility 14.0.x - 20-alpha (2024/05/22) +### [3.0.2] - Compatibility 14.0.x - 20-alpha (2024/05/22) - Update ckeditor configuration - Fix deployment from another customdir - Add some missing link on menu (Module skills & holiday) - Add some missing icons on menu (Module skills, knowledge management, builder, agenda) - Add translation for missing label recruitment in core -### Version 3.0.1 - Compatibility 14.0.x - 20-alpha (2024/04/29) +### [3.0.1] - Compatibility 14.0.x - 20-alpha (2024/04/29) - Fix problem with function Show company name in invert menu (Remove function for the moment) - Fix Access problem on custom CSS on public page - Finish move brand editor to "Inovea-Conseil" -### Version 3.0.0 - Compatibility 14.0.x - 20-alpha (2024/01/13) +### [3.0.0] - Compatibility 14.0.x - 20-alpha (2024/01/13) - Merge theme & custom directory to simplify deployment - Copy of theme directory is made when module Oblyon is enabled - Remove old library icomoons - Fix admin display - Fix CSS error - Ajust template by default -### Version 2.3.0 - Compatibility 14.0.x - 19-alpha (2023/11/12) +### [2.3.0] - Compatibility 14.0.x - 19-alpha (2023/11/12) - NEW Use a lot of new color variables for compatibility with DARK_MODE - Add a lot of variables instead of hard coded values. - Add SQL constants for updates - NEW system of extensions for external modules -### Version 2.2.12 - Compatibility 14.0.x - 19-alpha (2024/07/01) +### [2.2.12] - Compatibility 14.0.x - 19-alpha (2024/07/01) - Remove login functionality -### Version 2.2.11 - Compatibility 14.0.x - 19-alpha (2023/09/12) +### [2.2.11] - Compatibility 14.0.x - 19-alpha (2023/09/12) - Upgrade CSS Compatibility with v18/v19 - Fix token problem (CSRF) on icon page for Easya version - Fix leftmenu min width with reduce menu (hover) -### Version 2.2.10 - Compatibility 14.0.x - 19-alpha (2023/09/12) +### [2.2.10] - Compatibility 14.0.x - 19-alpha (2023/09/12) - NEW Add option to access directly in project list when you click in menu (PROJECT_FORCE_LIST_ACCESS) - NEW Add option to show reconciliation link in menu bank (OBLYON_ENABLE_MENU_BANK_RECONCILIATE) - Fix CSS #133 - Category Pup-Up don't show existing categories in DB v18 -### Version 2.2.9 - Compatibility 14.0.x - 19-alpha (2023/09/01) +### [2.2.9] - Compatibility 14.0.x - 19-alpha (2023/09/01) - NEW Add option to switch select column to the left (MAIN_CHECKBOX_LEFT_COLUMN) - Compatibility module Quicklist with function "Fix the reference banner and action buttons during vertical scrolling" - Upgrade CSS Compatibility with v18/v19 -### Version 2.2.8 - Compatibility 14.0.x - 18.0.x (2023/07/10) +### [2.2.8] - Compatibility 14.0.x - 18.0.x (2023/07/10) - Add constant PROJECT_HIDE_MENU_TASKS_ACTIVITY to hide in project menu the link to manage activity - Upgrade CSS -### Version 2.2.7 - Compatibility 14.0.x - 18beta (2023/06/21) +### [2.2.7] - Compatibility 14.0.x - 18beta (2023/06/21) - Fix right access problem between personalized & tools menu - Compatibility with Dolibarr 18-beta -### Version 2.2.6 - Compatibility 14.0.x - 18beta (2023/06/19) +### [2.2.6] - Compatibility 14.0.x - 18beta (2023/06/19) - Fix CSS Dashboard on Easya 2022.5.3 - Fix Oblyon menu for problem in accountancy module - Move Open-DSI to Easya Solutions - Add support demand in about/support page - Move customCCS to new version -### Version 2.2.5 - Compatibility 14.0.x - 18alpha (2023/05/09) +### [2.2.5] - Compatibility 14.0.x - 18alpha (2023/05/09) - Upgrade CSS - Fix z-index for left menu if invert & with option fix area enabled - Fix info-box in module page - Compatibility with Dolibarr 17.0.x - Compatibility with Dolibarr 18-alpha -### Version 2.2.4 - Compatibility 14.0.x - 17.0.x (2023/03/27) +### [2.2.4] - Compatibility 14.0.x - 17.0.x (2023/03/27) - Fix color on line product selector when stock is ok (global.inc.php L5370 .product_line_stock_ok #33cc66 > #002000 | L5371 .product_line_stock_too_low #f07b6e > #884400) - Fix missing class - Fix Align height of input on list @@ -89,46 +111,46 @@ - Add compatibility with module MyField 16.0.x - Work in Progress - Compatibility with Dolibarr 17.0.x -### Version 2.2.3 - Compatibility 14.0.x - 17beta (2022/12/06) +### [2.2.3] - Compatibility 14.0.x - 17beta (2022/12/06) - Temporary fix problem with bg color on icon bank_account - Problem of dolibarr's core (PR #23114) - Unset minwidth on vmenu when menu is inverted - Small ajust on accountancy menu - Work in Progress - Compatibility v17beta -### Version 2.2.2 - Compatibility 14.0.x - 16.0.x (2022/11/28) +### [2.2.2] - Compatibility 14.0.x - 16.0.x (2022/11/28) - Debug session -### Version 2.2.1 - Compatibility 14.0.x - 16.0.x (2022/11/16) +### [2.2.1] - Compatibility 14.0.x - 16.0.x (2022/11/16) - Fix Help on color page setup : add a warning when color text is white - Fix bis the administration menu was accessible for unpriviledged users -### Version 2.2.0 - Compatibility 14.0.x - 16.0.x (2022/11/08) +### [2.2.0] - Compatibility 14.0.x - 16.0.x (2022/11/08) - New option height image on list - Fix sticky header on list - Fix the setup menu was accessible for unpriviledged users -### Version 2.1.0 - Compatibility 14.0.x - 16.0.x (2022/10/20) +### [2.1.0] - Compatibility 14.0.x - 16.0.x (2022/10/20) - Fix topmenu-login-dropdown when using some external modules - Add an option for Easya 2022.5.2 to fix the table column header on the elements during vertical scrolling - Fix min width on left menu hover - Fix select2 text align inherit -### Version 2.0.0 - Compatibility 14.0.x - 16.0.0 (2022/08/22) +### [2.0.0] - Compatibility 14.0.x - 16.0.0 (2022/08/22) - New versioning of the module / We start again with Oblyon v2 - Compatibility Dolibarr v16 / PHP 8 - Work in progress - Fix some CSS - Abandonment Markdown for Parsedown to read changelog (Compatibility PHP8) -### Version 14.0.2 - 16b1 (2022/06/01) +### [14.0.2] - 16b1 (2022/06/01) - Compatibility Dolibarr v15 - Compatibility Dolibarr v16b - Add custom CSS page in admin - More complete translation language en_US -### Version 14.0.2 - 15a1 (2022/04/24) +### [14.0.2] - 15a1 (2022/04/24) - Compatibility Dolibarr v15 -### Version 14.0.2 (2022/04/20) +### [14.0.2] (2022/04/20) - Fix menu dropdown "checks" (cheque) with invert menu - Fix icon for new module reception - Fix icon in massaction @@ -136,83 +158,83 @@ - Fix language in colors admin - Fix Settings save with multicompany (Thanks @SylvainLegrand) -### Version 14.0.1 (2022/03/06) +### [14.0.1] (2022/03/06) - Compatibility Dolibarr v14 / Easya 2022.5 - Fix restore backup system in oblyon admin - Fix problem with ul/ol on ticket message (Thanks @tnegre) - Fix problem of compatibility with infraSsearch & MBI Calls - Review informations -### Version 13.0.0 - 2021 xx xx +### [13.0.0] - 2021 xx xx - Compatibility Dolibarr v13 -### Version 12.0.0 - 2020 06 30 +### [12.0.0] - 2020 06 30 - Compatibility Dolibarr v12 -### Version 11.0.0 - 2020 02 03 +### [11.0.0] - 2020 02 03 - Compatibility Dolibarr v11 -### Version 10.0 beta 3 - 2019 09 04 +### [10.0 beta 3] - 2019 09 04 - Fix Icon ticket module is missing -### Version 10.0 beta 2 - 2019 08 26 +### [10.0 beta 2] - 2019 08 26 - Standardize code & update - Compatibility with Dolibarr 10.0 - New Add possibility in admin colors menu to manage colors of the buttons - WIP New Add Sticky bar for left menu -### Version 10.0 beta 1 - 2019 06 08 +### [10.0 beta 1] - 2019 06 08 - Standardize code & update - Compatibility with Dolibarr 10.0 -### Version 9.1.2 - 2019 08 22 +### [9.1.2] - 2019 08 22 - CSS | Add level3 for menu - Fix assets menu - New Add some icons on menu - Fix accountancy menu -### Version 9.1.1 - 2019 04 22 +### [9.1.1] - 2019 04 22 - Improve login page -### Version 9.1.0 - 2019 04 08 +### [9.1.0] - 2019 04 08 - Merge 8.1.0 -### Version 9.0.1 - 2019 04 06 +### [9.0.1] - 2019 04 06 - Update author for Mathieu -> Monogramm - Fix issue in admin menu display -### Version 9.0 - 2018 12 05 +### [9.0.0] - 2018 12 05 - Standardize code & update - Compatibility with Dolibarr 9.0 - Update copyright for Alexandre -> Open-DSI - Some improvement to display menu -### Version 8.1.1 - 2019 04 21 +### [8.1.1] - 2019 04 21 - Fixed: Fix login action display -### Version 8.1.0 - 2019 04 08 +### [8.1.0] - 2019 04 08 - Added: Improve cash desk display - Added: Improve borders and shadows - Added: New templates and properties - Added: Missing translations -### Version 8.0.1 - 2019 04 06 +### [8.0.1] - 2019 04 06 - Added: install / usage info and move changelog to module -### Version 8.0 - 2018 10 29 +### [8.0.0] - 2018 10 29 - Standardize code & update - Compatibility with Dolibarr 8.0 -### Version 8.0 beta 1 - 2018 07 22 +### [8.0 beta 1] - 2018 07 22 - Standardize code & update - Compatibility with Dolibarr 8.0 -### Version 7.0 beta 1 - 2018 03 08 +### [7.0 beta 1] - 2018 03 08 - Standardize code & update - Compatibility with Dolibarr 7.0 (Fix #13) -### Version 6.0 beta 1 - 2017 11 17 +### [6.0 beta 1] - 2017 11 17 - Standardize code & update - Compatibility with Dolibarr 6.0 -### Version 4.0.0 +### [4.0.0] - Fixed: 4.0 Correct link to projects - Added: 5.0 Add editor name and link in module descriptor -### Version 4.0 beta 2 +### [4.0 beta 2] - Added: 5.0 Add menu page index for accountancy module - Fixed: 5.0 Menu Accountancy Better terminology - Added: 5.0 Add menu system tool "Files integrity checker" to detect modified files @@ -223,14 +245,14 @@ - Fixed: 4.0 Menu closing - Fixed: 4.0 Correct link to propals -### Version 4.0 beta 1 +### [4.0 beta 1] - Added: Add template Oblyon Green & new options to configurate colors - Added: Compatibility with Dolibarr 4.0 - - Increase number version to align to Dolibarr version + - Increase number [to align to Dolibarr version - Fixed: When the menu is inverted, search bar don't show - New: 4.0 Add icon external.png -### Version 2.2 +### [2.2] - Fixed: old menu manager deletion if still exist - Added: jQuery modules Datatable and Select2 - Added: Holiday module @@ -245,7 +267,7 @@ - New: 4.0 Add icon for website module - New: Try to make the theme more responsive -### Version 2.2 RC +### [2.2 RC] - Fixed: Add new search bar for Dolibarr 3.9 - New: Oblyon theme "forced" when oblyon module activated - Fixed: missing top icons with oblyon theme using eldy menu @@ -256,7 +278,7 @@ - Fixed: css - Added: Add a button in color tab to restore default colors of Oblyon -### Version 2.2 beta 3 +### [2.2 beta 3] - Updated: About page - Fixed: Missing language file for accountancy module - Fixed: Some links are modified for customers invoices in Dolibarr 3.8 @@ -267,23 +289,23 @@ - Fixed: Refactoring admin menu page & add missing language key - Added: Review menu of accountancy expert module since 3.7 (Specific development) -### Version 2.2 beta 2 +### [2.2 beta 2] - Upgraded: Compatibility with Dolibarr 3.9-beta - Upgraded: Modify link for donation module - Added: a tab color in admin * Possibility to define color logo background -### Version 2.2 beta 1 +### [2.2 beta 1] - Upgraded: Compatibility with Dolibarr 3.9-beta - Upgraded: Compatibility with Dolibarr 3.8 - - Fixed: Replace constant $conf->global->MAIN_VERSION_LAST_UPGRADE by DOL_VERSION in Oblyon Menu + - Fixed: Replace constant $conf->global->MAIN_VERSION_LAST_UPGRADE by DOL_[in Oblyon Menu * The first constant are empty when it's a fresh install - Added: an entry in the menu for the new module expense report in hrm - Added: object_gravatar - Added: object_printer - Fixed: Typo Dictionnary -> Dictionary -### Version 2.1 +### [2.1] - Upgraded: Compatibility with Dolibarr 3.7 - Upgraded: Compatibility with Dolibarr 3.5.x - Fixed: Menu entries for Dolibarr 3.5.x, 3.6.x and 3.7 @@ -296,7 +318,7 @@ - Changed: Logo options shown only when logo activated - Added: New title images and missing images from previous versions -### Version 2.0 +### [2.0] - Updated: New options panel - Added: Invert menus option - Added: Pushy left menu @@ -313,25 +335,25 @@ - Added: Cursor not-allowed on input and select areas - Fixed: Bookmarks section links -### Version 1.7 +### [1.7] - Updated: New license CC BY-NC 4.0 -### Version 1.6 +### [1.6] - Upgraded: Compatibility with Dolibarr 3.6 (thanks to A. Spangaro) -### Version 1.5 +### [1.5] - Added: Define Colors Feature (see style.css.php file, section Define Colors) - Fixed: Minor bugs -### Version 1.4 +### [1.4] - Added: Holiday category and icons - Updated: ckeditor.js - Updated: Images license -### Version 1.3.1 +### [1.3.1] - Fixed: Icons display issue (Left Menu) -### Version 1.3 +### [1.3] - Added: Extra Cashdesk icons (oblyon/img/cashdesk) - Added: sort-asc and sort-desc icons - Added: Skype icon @@ -339,7 +361,7 @@ - Changed: Icons size (Left Menu) - Upgraded: Compatibility with **[DoliDroid](https://play.google.com/store/apps/details?id=com.nltechno.dolidroidpro "DoliDroid")** for Dolibarr v3.5 and v3.4.x (thanks to Eldy) -### Version 1.2 +### [1.2] - Stylized: Cashdesk module interface - Removed: Message of the day style - Fixed: Background color for vertical menu when menus managers are different @@ -348,7 +370,7 @@ - Added: Extra weather icons (oblyon/img/weather) - Fixed: Minor bugs -### Version 1.1 +### [1.1] - Stylized: Message of the day - Removed: Navigation bar in "print" mode. - Simplification of the help area. @@ -365,9 +387,9 @@ - Fixed: Visual corrections - Fixed: Minor bugs -### Version 1.0.1 +### [1.0.1] - Fixed: Warning PHP message - Changed: Logo Oblyon -### Version 1.0 +### [1.0] - Initial release \ No newline at end of file diff --git a/VERSION b/VERSION index 7da3c16..a0cd9f0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.5 \ No newline at end of file +3.1.0 \ No newline at end of file diff --git a/admin/about.php b/admin/about.php index 6e55df2..73afbd1 100644 --- a/admin/about.php +++ b/admin/about.php @@ -1,6 +1,7 @@ * Copyright (C) 2015-2024 Alexandre Spangaro + * Copyright (C) 2023-2025 Sylvain Legrand * * 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 @@ -30,6 +31,15 @@ dol_include_once('/oblyon/lib/oblyon.lib.php'); dol_include_once('/oblyon/lib/inovea_common.lib.php'); +/** + * @var Conf $conf + * @var DoliDB $db + * @var HookManager $hookmanager + * @var Societe $mysoc + * @var Translate $langs + * @var User $user + */ + // Langs $langs->loadLangs(array('admin','oblyon@oblyon', 'inovea@oblyon', 'oldauthors@oblyon')); @@ -47,17 +57,19 @@ /* * View */ +$help_url = ''; $page_name = "ThemeOblyonAboutTitle"; -llxHeader('', $langs->trans($page_name)); + +llxHeader('', $langs->trans($page_name), $help_url, '', 0, 0, '', '', '', 'mod-oblyon page-admin_support'); // Subheader $linkback = ''.$langs->trans('BackToModuleList').''; -print load_fiche_titre($langs->trans($page_name), $linkback); +print load_fiche_titre($langs->trans($page_name), $linkback, 'object_inovea.png@oblyon'); // Configuration header $head = oblyon_admin_prepare_head(); -print dol_get_fiche_head($head, 'about', $langs->trans("Module432573Name"), 0, "inovea@oblyon"); +print dol_get_fiche_head($head, 'about', $langs->trans("Module432573Name"), -1, "info"); $modClass = new modOblyon($db); $oblyonVersion = !empty($modClass->getVersion()) ? $modClass->getVersion() : 'NC'; @@ -66,7 +78,7 @@ $supportvalue.= " * Module : Oblyon"."
"; $supportvalue.= " * Module version : ".$oblyonVersion."
"; $supportvalue.= " * Dolibarr version : ".DOL_VERSION."
"; -$supportvalue.= " * Dolibarr version installation initiale : ".$conf->global->MAIN_VERSION_LAST_INSTALL."
"; +$supportvalue.= " * Dolibarr version installation initiale : ".getDolGlobalString('MAIN_VERSION_LAST_INSTALL')."
"; $supportvalue.= " * Version PHP : ".PHP_VERSION."
"; $supportvalue.= " *****/"."

"; $supportvalue.= "Description de votre problème :"."
"; diff --git a/admin/changelog.php b/admin/changelog.php index b1f71ea..a5b995a 100644 --- a/admin/changelog.php +++ b/admin/changelog.php @@ -1,6 +1,7 @@ * Copyright (C) 2015-2024 Alexandre Spangaro + * Copyright (C) 2023-2025 Sylvain Legrand * * 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 @@ -21,14 +22,23 @@ * \ingroup oblyon * \brief Changelog Page < Oblyon Theme Configurator > */ - // Dolibarr environment ************************* - require '../config.php'; +// Dolibarr environment ************************* +require '../config.php'; // Libraries require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; dol_include_once('/oblyon/lib/oblyon.lib.php'); dol_include_once('/oblyon/lib/inovea_common.lib.php'); +/** + * @var Conf $conf + * @var DoliDB $db + * @var HookManager $hookmanager + * @var Societe $mysoc + * @var Translate $langs + * @var User $user + */ + // Langs $langs->loadLangs(array('admin','oblyon@oblyon', 'inovea@oblyon', 'oldauthors@oblyon')); @@ -47,24 +57,23 @@ * View */ $page_name = "ThemeOblyonChangelogTitle"; -llxHeader('', $langs->trans($page_name)); +$help_url = ''; +llxHeader('', $langs->trans($page_name), $help_url, '', 0, 0, '', '', '', 'mod-oblyon page-admin_changelog'); // Subheader $linkback = ''.$langs->trans('BackToModuleList').''; -print load_fiche_titre($langs->trans($page_name), $linkback); +print load_fiche_titre($langs->trans($page_name), $linkback, 'object_inovea.png@oblyon'); // Configuration header $head = oblyon_admin_prepare_head(); -print dol_get_fiche_head($head, 'changelog', $langs->trans("Module432573Name"), 0, "inovea@oblyon"); +print dol_get_fiche_head($head, 'changelog', $langs->trans("Module432573Name"), -1, "info"); print '
'; print ''; print '

Licence

'; print $langs->trans("LicenseMessage"); -print '

Bugs / comments

'; -print $langs->trans("AboutMessage"); $changelog = inovea_common_getChangeLog('oblyon'); diff --git a/admin/colors.php b/admin/colors.php index 716f5d4..a92f1e1 100644 --- a/admin/colors.php +++ b/admin/colors.php @@ -1,7 +1,7 @@ - * Copyright (C) 2023-2024 Sylvain Legrand +/************************************************ + * Copyright (C) 2015-2025 Alexandre Spangaro + * Copyright (C) 2023-2025 Sylvain Legrand * * 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 @@ -17,483 +17,533 @@ * along with this program. If not, see . ************************************************/ - /************************************************ - * \file ../oblyon/admin/colors.php - * \ingroup oblyon - * \brief Options Page < Oblyon Theme Configurator > - ************************************************/ +/************************************************ +* \file ../oblyon/admin/colors.php +* \ingroup oblyon +* \brief Options Page < Oblyon Theme Configurator > +************************************************/ - // Dolibarr environment ************************* - require '../config.php'; +// Dolibarr environment ************************* +require '../config.php'; - // Libraries ************************************ - require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - require_once '../lib/oblyon.lib.php'; +// Libraries ************************************ +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +dol_include_once('/oblyon/lib/oblyon.lib.php'); - // Translations ********************************* - $langs->loadLangs(array('admin', 'oblyon@oblyon', 'inovea@oblyon')); +/** + * @var Conf $conf + * @var DoliDB $db + * @var HookManager $hookmanager + * @var Societe $mysoc + * @var Translate $langs + * @var User $user + */ - // Access control ******************************* - if (! $user->admin) accessforbidden(); +// Translations ********************************* +$langs->loadLangs(array('admin', 'oblyon@oblyon', 'inovea@oblyon')); - // Reset cache ********************************** - $_SESSION['dol_resetcache'] = dol_print_date(dol_now(), 'dayhourlog'); +// Access control ******************************* +if (! $user->admin) accessforbidden(); - // init variables ******************************* - $listcolor = array('top' => array('OBLYON_COLOR_TOPMENU_BCKGRD', - 'OBLYON_COLOR_TOPMENU_BCKGRD_HOVER', - 'OBLYON_COLOR_TOPMENU_TXT', - 'OBLYON_COLOR_TOPMENU_TXT_ACTIVE', - 'OBLYON_COLOR_TOPMENU_TXT_HOVER' - ), - 'left' => array('OBLYON_COLOR_LEFTMENU_BCKGRD', - 'OBLYON_COLOR_LEFTMENU_BCKGRD_HOVER', - 'OBLYON_COLOR_LEFTMENU_TXT', - 'OBLYON_COLOR_LEFTMENU_TXT_ACTIVE', - 'OBLYON_COLOR_LEFTMENU_TXT_HOVER', - ), - 'button' => array('OBLYON_COLOR_BUTTON_ACTION1', - 'OBLYON_COLOR_BUTTON_ACTION2', - 'OBLYON_COLOR_BUTTON_DELETE1', - 'OBLYON_COLOR_BUTTON_DELETE2' - ), - 'message' => array('OBLYON_COLOR_INFO_BORDER', - 'OBLYON_COLOR_INFO_BCKGRD', - 'OBLYON_COLOR_INFO_TEXT', - 'OBLYON_COLOR_WARNING_BORDER', - 'OBLYON_COLOR_WARNING_BCKGRD', - 'OBLYON_COLOR_WARNING_TEXT', - 'OBLYON_COLOR_ERROR_BORDER', - 'OBLYON_COLOR_ERROR_BCKGRD', - 'OBLYON_COLOR_ERROR_TEXT', - 'OBLYON_COLOR_NOTIF_INFO_BCKGRD', - 'OBLYON_COLOR_NOTIF_INFO_TEXT', - 'OBLYON_COLOR_NOTIF_WARNING_BCKGRD', - 'OBLYON_COLOR_NOTIF_WARNING_TEXT', - 'OBLYON_COLOR_NOTIF_ERROR_BCKGRD', - 'OBLYON_COLOR_NOTIF_ERROR_TEXT' - ), - 'options' => array('OBLYON_COLOR_MAIN', - 'OBLYON_COLOR_BCKGRD', - 'OBLYON_COLOR_LOGO_BCKGRD', - 'OBLYON_COLOR_LOGIN_BCKGRD', - 'OBLYON_COLOR_BTITLE', - 'OBLYON_COLOR_FTITLE', - 'OBLYON_COLOR_BLINE', - 'OBLYON_COLOR_BLINE_HOVER', - 'OBLYON_COLOR_FLINE', - 'OBLYON_COLOR_FLINE_HOVER', - 'OBLYON_COLOR_FDATE_DEFAULT', - 'OBLYON_COLOR_TEXTTABACTIVE', - 'OBLYON_COLOR_INPUT_BCKGRD', - 'OBLYON_COLOR_INFOBOX_BCKGRD1', - 'OBLYON_COLOR_INFOBOX_BCKGRD2' - ), - 'eldy' => array('THEME_ELDY_TOPBORDER_TITLE1', - 'THEME_ELDY_BACKTITLE1', - 'THEME_ELDY_BACKTABACTIVE', - 'THEME_ELDY_LINEIMPAIR1', - 'THEME_ELDY_LINEIMPAIR2', - 'THEME_ELDY_LINEPAIR1', - 'THEME_ELDY_LINEPAIR2', - 'THEME_ELDY_LINEBREAK', - 'THEME_ELDY_TEXTTITLENOTAB', - 'THEME_ELDY_TEXTTITLE', - 'THEME_ELDY_TEXT', - 'THEME_ELDY_TEXTLINK' - ) - ); - $listtheme = array('green' => array('OBLYON_INFOXBOX_BACKGROUND' => '#FFFFFF', - 'OBLYON_COLOR_TOPMENU_BCKGRD' => '#34495E', - 'OBLYON_COLOR_TOPMENU_BCKGRD_HOVER' => '#2C3E50', - 'OBLYON_COLOR_TOPMENU_TXT' => '#FFFFFF', - 'OBLYON_COLOR_TOPMENU_TXT_ACTIVE' => '#', - 'OBLYON_COLOR_TOPMENU_TXT_HOVER' => '#', - 'OBLYON_COLOR_LEFTMENU_BCKGRD' => '#2ECC71', - 'OBLYON_COLOR_LEFTMENU_BCKGRD_HOVER' => '#29B564', - 'OBLYON_COLOR_LEFTMENU_TXT' => '#FFFFFF', - 'OBLYON_COLOR_LEFTMENU_TXT_ACTIVE' => '#', - 'OBLYON_COLOR_LEFTMENU_TXT_HOVER' => '#222222', - 'OBLYON_COLOR_BUTTON_ACTION1' => '#0088CC', - 'OBLYON_COLOR_BUTTON_ACTION2' => '#0044CC', - 'OBLYON_COLOR_BUTTON_DELETE1' => '#CC8800', - 'OBLYON_COLOR_BUTTON_DELETE2' => '#CC4400', - 'OBLYON_COLOR_INFO_BORDER' => '#87cfd2', - 'OBLYON_COLOR_INFO_BCKGRD' => '#eff8fc', - 'OBLYON_COLOR_INFO_TEXT' => '#222222', - 'OBLYON_COLOR_WARNING_BORDER' => '#f2cf87', - 'OBLYON_COLOR_WARNING_BCKGRD' => '#fcf8e3', - 'OBLYON_COLOR_WARNING_TEXT' => '#222222', - 'OBLYON_COLOR_ERROR_BORDER' => '#e0796e', - 'OBLYON_COLOR_ERROR_BCKGRD' => '#f07b6e', - 'OBLYON_COLOR_ERROR_TEXT' => '#222222', - 'OBLYON_COLOR_NOTIF_INFO_BCKGRD' => '#d9e5d1', - 'OBLYON_COLOR_NOTIF_INFO_TEXT' => '#446548', - 'OBLYON_COLOR_NOTIF_WARNING_BCKGRD' => '#fff7d1', - 'OBLYON_COLOR_NOTIF_WARNING_TEXT' => '#a28918', - 'OBLYON_COLOR_NOTIF_ERROR_BCKGRD' => '#d79eac', - 'OBLYON_COLOR_NOTIF_ERROR_TEXT' => '#a72947', - 'OBLYON_COLOR_MAIN' => '#0083A2', - 'OBLYON_COLOR_BCKGRD' => '#F5F5F5', - 'OBLYON_COLOR_LOGO_BCKGRD' => '#FFFFFF', - 'OBLYON_COLOR_LOGIN_BCKGRD' => '#F4F4F4', - 'OBLYON_COLOR_BTITLE' => '#0083A2', - 'OBLYON_COLOR_FTITLE' => '#222222', - 'OBLYON_COLOR_BLINE' => '#FFFFFF', - 'OBLYON_COLOR_BLINE_HOVER' => '#F1F1F1', - 'OBLYON_COLOR_FLINE' => '#444444', - 'OBLYON_COLOR_FLINE_HOVER' => '#222222', - 'OBLYON_COLOR_FDATE_DEFAULT' => '#FF0000', - 'OBLYON_COLOR_TEXTTABACTIVE' => '#222222', - 'OBLYON_COLOR_INPUT_BCKGRD' => '#FFFFFF', - 'OBLYON_COLOR_INFOBOX_BCKGRD1' => '#444444', - 'OBLYON_COLOR_INFOBOX_BCKGRD2' => '#E4EFE8', - 'THEME_INVERT_RATIO_FILTER' => '0', - 'THEME_ELDY_TOPBORDER_TITLE1' => '#FFFFFF', - 'THEME_ELDY_BACKTITLE1' => '#E9EAED', - 'THEME_ELDY_BACKTABACTIVE' => '#FFFFFF', - 'THEME_ELDY_LINEIMPAIR1' => '#FFFFFF', - 'THEME_ELDY_LINEIMPAIR2' => '#FFFFFF', - 'THEME_ELDY_LINEPAIR1' => '#FBFBFB', - 'THEME_ELDY_LINEPAIR2' => '#FBFBFB', - 'THEME_ELDY_LINEBREAK' => '#FFFFFF', - 'THEME_ELDY_TEXTTITLENOTAB' => '#222222', - 'THEME_ELDY_TEXTTITLE' => '#28283C', - 'THEME_ELDY_TEXT' => '#000000', - 'THEME_ELDY_TEXTLINK' => '#1C1C1C' - ), - 'dark' => array('OBLYON_INFOXBOX_BACKGROUND' => '#FFFFFF', - 'OBLYON_COLOR_TOPMENU_BCKGRD' => '#333333', - 'OBLYON_COLOR_TOPMENU_BCKGRD_HOVER' => '#0083A2', - 'OBLYON_COLOR_TOPMENU_TXT' => '#F4F4F4', - 'OBLYON_COLOR_TOPMENU_TXT_ACTIVE' => '#', - 'OBLYON_COLOR_TOPMENU_TXT_HOVER' => '#', - 'OBLYON_COLOR_LEFTMENU_BCKGRD' => '#333333', - 'OBLYON_COLOR_LEFTMENU_BCKGRD_HOVER' => '#0083A2', - 'OBLYON_COLOR_LEFTMENU_TXT' => '#F4F4F4', - 'OBLYON_COLOR_LEFTMENU_TXT_ACTIVE' => '#', - 'OBLYON_COLOR_LEFTMENU_TXT_HOVER' => '#FFFFFF', - 'OBLYON_COLOR_BUTTON_ACTION1' => '#0083A2', - 'OBLYON_COLOR_BUTTON_ACTION2' => '#0063A2', - 'OBLYON_COLOR_BUTTON_DELETE1' => '#CC8800', - 'OBLYON_COLOR_BUTTON_DELETE2' => '#CC4400', - 'OBLYON_COLOR_INFO_BORDER' => '#87cfd2', - 'OBLYON_COLOR_INFO_BCKGRD' => '#eff8fc', - 'OBLYON_COLOR_INFO_TEXT' => '#222222', - 'OBLYON_COLOR_WARNING_BORDER' => '#f2cf87', - 'OBLYON_COLOR_WARNING_BCKGRD' => '#fcf8e3', - 'OBLYON_COLOR_WARNING_TEXT' => '#222222', - 'OBLYON_COLOR_ERROR_BORDER' => '#e0796e', - 'OBLYON_COLOR_ERROR_BCKGRD' => '#f07b6e', - 'OBLYON_COLOR_ERROR_TEXT' => '#222222', - 'OBLYON_COLOR_NOTIF_INFO_BCKGRD' => '#d9e5d1', - 'OBLYON_COLOR_NOTIF_INFO_TEXT' => '#446548', - 'OBLYON_COLOR_NOTIF_WARNING_BCKGRD' => '#fff7d1', - 'OBLYON_COLOR_NOTIF_WARNING_TEXT' => '#a28918', - 'OBLYON_COLOR_NOTIF_ERROR_BCKGRD' => '#d79eac', - 'OBLYON_COLOR_NOTIF_ERROR_TEXT' => '#a72947', - 'OBLYON_COLOR_MAIN' => '#0083A2', - 'OBLYON_COLOR_BCKGRD' => '#F4F4F4', - 'OBLYON_COLOR_LOGO_BCKGRD' => '#FFFFFF', - 'OBLYON_COLOR_LOGIN_BCKGRD' => '#F4F4F4', - 'OBLYON_COLOR_BTITLE' => '#0083A2', - 'OBLYON_COLOR_FTITLE' => '#222222', - 'OBLYON_COLOR_BLINE' => '#FFFFFF', - 'OBLYON_COLOR_BLINE_HOVER' => '#F1F1F1', - 'OBLYON_COLOR_FLINE' => '#444444', - 'OBLYON_COLOR_FLINE_HOVER' => '#222222', - 'OBLYON_COLOR_FDATE_DEFAULT' => '#FF0000', - 'OBLYON_COLOR_TEXTTABACTIVE' => '#222222', - 'OBLYON_COLOR_INPUT_BCKGRD' => '#FFFFFF', - 'OBLYON_COLOR_INFOBOX_BCKGRD1' => '#444444', - 'OBLYON_COLOR_INFOBOX_BCKGRD2' => '#E4EFE8', - 'THEME_INVERT_RATIO_FILTER' => '80', - 'THEME_ELDY_TOPBORDER_TITLE1' => '#FFFFFF', - 'THEME_ELDY_BACKTITLE1' => '#E9EAED', - 'THEME_ELDY_BACKTABACTIVE' => '#FFFFFF', - 'THEME_ELDY_LINEIMPAIR1' => '#FFFFFF', - 'THEME_ELDY_LINEIMPAIR2' => '#FFFFFF', - 'THEME_ELDY_LINEPAIR1' => '#FBFBFB', - 'THEME_ELDY_LINEPAIR2' => '#FBFBFB', - 'THEME_ELDY_LINEBREAK' => '#FFFFFF', - 'THEME_ELDY_TEXTTITLENOTAB' => '#222222', - 'THEME_ELDY_TEXTTITLE' => '#28283C', - 'THEME_ELDY_TEXT' => '#000000', - 'THEME_ELDY_TEXTLINK' => '#1C1C1C' - ), - 'blue' => array('OBLYON_INFOXBOX_BACKGROUND' => '#FFFFFF', - 'OBLYON_COLOR_TOPMENU_BCKGRD' => '#092D5C', - 'OBLYON_COLOR_TOPMENU_BCKGRD_HOVER' => '#0D4185', - 'OBLYON_COLOR_TOPMENU_TXT' => '#F4F4F4', - 'OBLYON_COLOR_TOPMENU_TXT_ACTIVE' => '#', - 'OBLYON_COLOR_TOPMENU_TXT_HOVER' => '#', - 'OBLYON_COLOR_LEFTMENU_BCKGRD' => '#092D5C', - 'OBLYON_COLOR_LEFTMENU_BCKGRD_HOVER' => '#0D4185', - 'OBLYON_COLOR_LEFTMENU_TXT' => '#F4F4F4', - 'OBLYON_COLOR_LEFTMENU_TXT_ACTIVE' => '#F4F4F4', - 'OBLYON_COLOR_LEFTMENU_TXT_HOVER' => '#FFFFFF', - 'OBLYON_COLOR_BUTTON_ACTION1' => '#0088CC', - 'OBLYON_COLOR_BUTTON_ACTION2' => '#0044CC', - 'OBLYON_COLOR_BUTTON_DELETE1' => '#CC8800', - 'OBLYON_COLOR_BUTTON_DELETE2' => '#CC4400', - 'OBLYON_COLOR_INFO_BORDER' => '#87CFD2', - 'OBLYON_COLOR_INFO_BCKGRD' => '#EFF8FC', - 'OBLYON_COLOR_INFO_TEXT' => '#222222', - 'OBLYON_COLOR_WARNING_BORDER' => '#F2CF87', - 'OBLYON_COLOR_WARNING_BCKGRD' => '#FCF8E3', - 'OBLYON_COLOR_WARNING_TEXT' => '#222222', - 'OBLYON_COLOR_ERROR_BORDER' => '#E0796E', - 'OBLYON_COLOR_ERROR_BCKGRD' => '#F07B6E', - 'OBLYON_COLOR_ERROR_TEXT' => '#222222', - 'OBLYON_COLOR_NOTIF_INFO_BCKGRD' => '#446548', - 'OBLYON_COLOR_NOTIF_INFO_TEXT' => '#D9E5D1', - 'OBLYON_COLOR_NOTIF_WARNING_BCKGRD' => '#A28918', - 'OBLYON_COLOR_NOTIF_WARNING_TEXT' => '#FFF7D1', - 'OBLYON_COLOR_NOTIF_ERROR_BCKGRD' => '#A72947', - 'OBLYON_COLOR_NOTIF_ERROR_TEXT' => '#D79EAC', - 'OBLYON_COLOR_MAIN' => '#E09430', - 'OBLYON_COLOR_BCKGRD' => '#F4F4F4', - 'OBLYON_COLOR_LOGO_BCKGRD' => '#FFFFFF', - 'OBLYON_COLOR_LOGIN_BCKGRD' => '#F4F4F4', - 'OBLYON_COLOR_BTITLE' => '#E09430', - 'OBLYON_COLOR_FTITLE' => '#222222', - 'OBLYON_COLOR_BLINE' => '#FFFFFF', - 'OBLYON_COLOR_BLINE_HOVER' => '#F1F1F1', - 'OBLYON_COLOR_FLINE' => '#444444', - 'OBLYON_COLOR_FLINE_HOVER' => '#222222', - 'OBLYON_COLOR_FDATE_DEFAULT' => '#FF0000', - 'OBLYON_COLOR_TEXTTABACTIVE' => '#222222', - 'OBLYON_COLOR_INPUT_BCKGRD' => '#FFFFFF', - 'OBLYON_COLOR_INFOBOX_BCKGRD1' => '#444444', - 'OBLYON_COLOR_INFOBOX_BCKGRD2' => '#E4EFE8', - 'THEME_INVERT_RATIO_FILTER' => '0', - 'THEME_ELDY_TOPBORDER_TITLE1' => '#FFFFFF', - 'THEME_ELDY_BACKTITLE1' => '#E9EAED', - 'THEME_ELDY_BACKTABACTIVE' => '#FFFFFF', - 'THEME_ELDY_LINEIMPAIR1' => '#FFFFFF', - 'THEME_ELDY_LINEIMPAIR2' => '#FFFFFF', - 'THEME_ELDY_LINEPAIR1' => '#FBFBFB', - 'THEME_ELDY_LINEPAIR2' => '#FBFBFB', - 'THEME_ELDY_LINEBREAK' => '#FFFFFF', - 'THEME_ELDY_TEXTTITLENOTAB' => '#222222', - 'THEME_ELDY_TEXTTITLE' => '#28283C', - 'THEME_ELDY_TEXT' => '#000000', - 'THEME_ELDY_TEXTLINK' => '#1C1C1C' - ), - 'night' => array('OBLYON_INFOXBOX_BACKGROUND' => '#444444', - 'OBLYON_COLOR_TOPMENU_BCKGRD' => '#222222', - 'OBLYON_COLOR_TOPMENU_BCKGRD_HOVER' => '#333333', - 'OBLYON_COLOR_TOPMENU_TXT' => '#F4F4F4', - 'OBLYON_COLOR_TOPMENU_TXT_ACTIVE' => '#', - 'OBLYON_COLOR_TOPMENU_TXT_HOVER' => '#', - 'OBLYON_COLOR_LEFTMENU_BCKGRD' => '#2C2C2C', - 'OBLYON_COLOR_LEFTMENU_BCKGRD_HOVER' => '#222222', - 'OBLYON_COLOR_LEFTMENU_TXT' => '#F4F4F4', - 'OBLYON_COLOR_LEFTMENU_TXT_ACTIVE' => '#', - 'OBLYON_COLOR_LEFTMENU_TXT_HOVER' => '#FFFFFF', - 'OBLYON_COLOR_BUTTON_ACTION1' => '#0088CC', - 'OBLYON_COLOR_BUTTON_ACTION2' => '#0044CC', - 'OBLYON_COLOR_BUTTON_DELETE1' => '#CC8800', - 'OBLYON_COLOR_BUTTON_DELETE2' => '#CC4400', - 'OBLYON_COLOR_INFO_BORDER' => '#87cfd2', - 'OBLYON_COLOR_INFO_BCKGRD' => '#eff8fc', - 'OBLYON_COLOR_INFO_TEXT' => '#222222', - 'OBLYON_COLOR_WARNING_BORDER' => '#f2cf87', - 'OBLYON_COLOR_WARNING_BCKGRD' => '#fcf8e3', - 'OBLYON_COLOR_WARNING_TEXT' => '#222222', - 'OBLYON_COLOR_ERROR_BORDER' => '#e0796e', - 'OBLYON_COLOR_ERROR_BCKGRD' => '#f07b6e', - 'OBLYON_COLOR_ERROR_TEXT' => '#222222', - 'OBLYON_COLOR_NOTIF_INFO_BCKGRD' => '#d9e5d1', - 'OBLYON_COLOR_NOTIF_INFO_TEXT' => '#446548', - 'OBLYON_COLOR_NOTIF_WARNING_BCKGRD' => '#fff7d1', - 'OBLYON_COLOR_NOTIF_WARNING_TEXT' => '#a28918', - 'OBLYON_COLOR_NOTIF_ERROR_BCKGRD' => '#d79eac', - 'OBLYON_COLOR_NOTIF_ERROR_TEXT' => '#a72947', - 'OBLYON_COLOR_MAIN' => '#E09430', - 'OBLYON_COLOR_BCKGRD' => '#444444', - 'OBLYON_COLOR_LOGO_BCKGRD' => '#FFFFFF', - 'OBLYON_COLOR_LOGIN_BCKGRD' => '#333333', - 'OBLYON_COLOR_BTITLE' => '#E09430', - 'OBLYON_COLOR_FTITLE' => '#F4F4F4', - 'OBLYON_COLOR_BLINE' => '#444444', - 'OBLYON_COLOR_BLINE_HOVER' => '#F1F1F1', - 'OBLYON_COLOR_FLINE' => '#ECECEC', - 'OBLYON_COLOR_FLINE_HOVER' => '#FCFCFC', - 'OBLYON_COLOR_FDATE_DEFAULT' => '#FF0000', - 'OBLYON_COLOR_TEXTTABACTIVE' => '#222222', - 'OBLYON_COLOR_INPUT_BCKGRD' => '#DEDEDE', - 'OBLYON_COLOR_INFOBOX_BCKGRD1' => '#444444', - 'OBLYON_COLOR_INFOBOX_BCKGRD2' => '#E4EFE8', - 'THEME_INVERT_RATIO_FILTER' => '0', - 'THEME_ELDY_TOPBORDER_TITLE1' => '#FFFFFF', - 'THEME_ELDY_BACKTITLE1' => '#E9EAED', - 'THEME_ELDY_BACKTABACTIVE' => '#444444', - 'THEME_ELDY_LINEIMPAIR1' => '#FFFFFF', - 'THEME_ELDY_LINEIMPAIR2' => '#FFFFFF', - 'THEME_ELDY_LINEPAIR1' => '#FBFBFB', - 'THEME_ELDY_LINEPAIR2' => '#FBFBFB', - 'THEME_ELDY_LINEBREAK' => '#FFFFFF', - 'THEME_ELDY_TEXTTITLENOTAB' => '#FFFFFF', - 'THEME_ELDY_TEXTTITLE' => '#28283C', - 'THEME_ELDY_TEXT' => '#000000', - 'THEME_ELDY_TEXTLINK' => '#1C1C1C' - ), - 'light' => array('OBLYON_INFOXBOX_BACKGROUND' => '#FFFFFF', - 'OBLYON_COLOR_TOPMENU_BCKGRD' => '#FFFFFF', - 'OBLYON_COLOR_TOPMENU_BCKGRD_HOVER' => '#D51123', - 'OBLYON_COLOR_TOPMENU_TXT' => '#444444', - 'OBLYON_COLOR_TOPMENU_TXT_ACTIVE' => '#FFFFFF', - 'OBLYON_COLOR_TOPMENU_TXT_HOVER' => '#FFFFFF', - 'OBLYON_COLOR_LEFTMENU_BCKGRD' => '#FFFFFF', - 'OBLYON_COLOR_LEFTMENU_BCKGRD_HOVER' => '#D51123', - 'OBLYON_COLOR_LEFTMENU_TXT' => '#444444', - 'OBLYON_COLOR_LEFTMENU_TXT_ACTIVE' => '#FFFFFF', - 'OBLYON_COLOR_LEFTMENU_TXT_HOVER' => '#FFFFFF', - 'OBLYON_COLOR_BUTTON_ACTION1' => '#0083A2', - 'OBLYON_COLOR_BUTTON_ACTION2' => '#0063A2', - 'OBLYON_COLOR_BUTTON_DELETE1' => '#CC8800', - 'OBLYON_COLOR_BUTTON_DELETE2' => '#CC4400', - 'OBLYON_COLOR_INFO_BORDER' => '#87cfd2', - 'OBLYON_COLOR_INFO_BCKGRD' => '#eff8fc', - 'OBLYON_COLOR_INFO_TEXT' => '#222222', - 'OBLYON_COLOR_WARNING_BORDER' => '#f2cf87', - 'OBLYON_COLOR_WARNING_BCKGRD' => '#fcf8e3', - 'OBLYON_COLOR_WARNING_TEXT' => '#222222', - 'OBLYON_COLOR_ERROR_BORDER' => '#e0796e', - 'OBLYON_COLOR_ERROR_BCKGRD' => '#f07b6e', - 'OBLYON_COLOR_ERROR_TEXT' => '#222222', - 'OBLYON_COLOR_NOTIF_INFO_BCKGRD' => '#d9e5d1', - 'OBLYON_COLOR_NOTIF_INFO_TEXT' => '#446548', - 'OBLYON_COLOR_NOTIF_WARNING_BCKGRD' => '#fff7d1', - 'OBLYON_COLOR_NOTIF_WARNING_TEXT' => '#a28918', - 'OBLYON_COLOR_NOTIF_ERROR_BCKGRD' => '#d79eac', - 'OBLYON_COLOR_NOTIF_ERROR_TEXT' => '#a72947', - 'OBLYON_COLOR_MAIN' => '#D51123', - 'OBLYON_COLOR_BCKGRD' => '#FFFFFF', - 'OBLYON_COLOR_LOGO_BCKGRD' => '#FFFFFF', - 'OBLYON_COLOR_LOGIN_BCKGRD' => '#FFFFFF', - 'OBLYON_COLOR_BTITLE' => '#D51123', - 'OBLYON_COLOR_FTITLE' => '#222222', - 'OBLYON_COLOR_BLINE' => '#FFFFFF', - 'OBLYON_COLOR_BLINE_HOVER' => '#F1F1F1', - 'OBLYON_COLOR_FLINE' => '#444444', - 'OBLYON_COLOR_FLINE_HOVER' => '#D51123', - 'OBLYON_COLOR_FDATE_DEFAULT' => '#FF0000', - 'OBLYON_COLOR_TEXTTABACTIVE' => '#222222', - 'OBLYON_COLOR_INPUT_BCKGRD' => '#F4F4F4', - 'OBLYON_COLOR_INFOBOX_BCKGRD1' => '#444444', - 'OBLYON_COLOR_INFOBOX_BCKGRD2' => '#E4EFE8', - 'THEME_INVERT_RATIO_FILTER' => '0', - 'THEME_ELDY_TOPBORDER_TITLE1' => '#FFFFFF', - 'THEME_ELDY_BACKTITLE1' => '#E9EAED', - 'THEME_ELDY_BACKTABACTIVE' => '#FFFFFF', - 'THEME_ELDY_LINEIMPAIR1' => '#FFFFFF', - 'THEME_ELDY_LINEIMPAIR2' => '#FFFFFF', - 'THEME_ELDY_LINEPAIR1' => '#FBFBFB', - 'THEME_ELDY_LINEPAIR2' => '#FBFBFB', - 'THEME_ELDY_LINEBREAK' => '#FFFFFF', - 'THEME_ELDY_TEXTTITLENOTAB' => '#222222', - 'THEME_ELDY_TEXTTITLE' => '#28283C', - 'THEME_ELDY_TEXT' => '#000000', - 'THEME_ELDY_TEXTLINK' => '#1C1C1C' - ) - ); +// Reset cache ********************************** +$_SESSION['dol_resetcache'] = dol_print_date(dol_now(), 'dayhourlog'); - // Actions ************************************** - $action = GETPOST('action','alpha'); - $result = ''; - // Sauvegarde / Restauration - if ($action == 'bkupParams') $result = oblyon_bkup_module ('oblyon'); - if ($action == 'restoreParams') $result = oblyon_restore_module ('oblyon'); - // On / Off management - if (preg_match('/set_(.*)/', $action, $reg)) { - $confkey = $reg[1]; - $result = dolibarr_set_const($db, $confkey, GETPOST('value'), 'chaine', 0, 'Oblyon module', $conf->entity); +// init variables ******************************* +$listcolor = array('top' => array('OBLYON_COLOR_TOPMENU_BCKGRD', + 'OBLYON_COLOR_TOPMENU_BCKGRD_HOVER', + 'OBLYON_COLOR_TOPMENU_TXT', + 'OBLYON_COLOR_TOPMENU_TXT_ACTIVE', + 'OBLYON_COLOR_TOPMENU_TXT_HOVER' + ), + 'left' => array('OBLYON_COLOR_LEFTMENU_BCKGRD', + 'OBLYON_COLOR_LEFTMENU_BCKGRD_HOVER', + 'OBLYON_COLOR_LEFTMENU_TXT', + 'OBLYON_COLOR_LEFTMENU_TXT_ACTIVE', + 'OBLYON_COLOR_LEFTMENU_TXT_HOVER', + ), + 'button' => array('OBLYON_COLOR_BUTTON_ACTION1', + 'OBLYON_COLOR_BUTTON_ACTION2', + 'OBLYON_COLOR_BUTTON_DELETE1', + 'OBLYON_COLOR_BUTTON_DELETE2' + ), + 'message' => array('OBLYON_COLOR_INFO_BORDER', + 'OBLYON_COLOR_INFO_BCKGRD', + 'OBLYON_COLOR_INFO_TEXT', + 'OBLYON_COLOR_WARNING_BORDER', + 'OBLYON_COLOR_WARNING_BCKGRD', + 'OBLYON_COLOR_WARNING_TEXT', + 'OBLYON_COLOR_ERROR_BORDER', + 'OBLYON_COLOR_ERROR_BCKGRD', + 'OBLYON_COLOR_ERROR_TEXT', + 'OBLYON_COLOR_NOTIF_INFO_BCKGRD', + 'OBLYON_COLOR_NOTIF_INFO_TEXT', + 'OBLYON_COLOR_NOTIF_WARNING_BCKGRD', + 'OBLYON_COLOR_NOTIF_WARNING_TEXT', + 'OBLYON_COLOR_NOTIF_ERROR_BCKGRD', + 'OBLYON_COLOR_NOTIF_ERROR_TEXT' + ), + 'options' => array('OBLYON_COLOR_MAIN', + 'OBLYON_COLOR_BCKGRD', + 'OBLYON_COLOR_LOGO_BCKGRD', + 'OBLYON_COLOR_LOGIN_BCKGRD', + 'OBLYON_COLOR_BTITLE', + 'OBLYON_COLOR_FTITLE', + 'OBLYON_COLOR_STITLE', + 'OBLYON_COLOR_BLINE', + 'OBLYON_COLOR_BLINE_HOVER', + 'OBLYON_COLOR_FLINE', + 'OBLYON_COLOR_FLINE_HOVER', + 'OBLYON_COLOR_FDATE_DEFAULT', + 'OBLYON_COLOR_FDATE_SELECTED', + 'OBLYON_COLOR_TEXTTABACTIVE', + 'OBLYON_COLOR_INPUT_BCKGRD', + 'OBLYON_COLOR_INFOBOX_BCKGRD1', + 'OBLYON_COLOR_INFOBOX_BCKGRD2', + 'OBLYON_COLOR_BORDER_ACTIONCOLUMN' + ), + 'eldy' => array('THEME_ELDY_TOPBORDER_TITLE1', + 'THEME_ELDY_BACKTITLE1', + 'THEME_ELDY_BACKTABACTIVE', + 'THEME_ELDY_LINEIMPAIR1', + 'THEME_ELDY_LINEIMPAIR2', + 'THEME_ELDY_LINEPAIR1', + 'THEME_ELDY_LINEPAIR2', + 'THEME_ELDY_LINEBREAK', + 'THEME_ELDY_TEXTTITLENOTAB', + 'THEME_ELDY_TEXTTITLE', + 'THEME_ELDY_TEXT', + 'THEME_ELDY_TEXTLINK' + ) + ); +$listtheme = array('green' => array('OBLYON_INFOXBOX_BACKGROUND' => '#FFFFFF', + 'OBLYON_COLOR_TOPMENU_BCKGRD' => '#34495E', + 'OBLYON_COLOR_TOPMENU_BCKGRD_HOVER' => '#2C3E50', + 'OBLYON_COLOR_TOPMENU_TXT' => '#FFFFFF', + 'OBLYON_COLOR_TOPMENU_TXT_ACTIVE' => '#', + 'OBLYON_COLOR_TOPMENU_TXT_HOVER' => '#', + 'OBLYON_COLOR_LEFTMENU_BCKGRD' => '#2ECC71', + 'OBLYON_COLOR_LEFTMENU_BCKGRD_HOVER' => '#29B564', + 'OBLYON_COLOR_LEFTMENU_TXT' => '#FFFFFF', + 'OBLYON_COLOR_LEFTMENU_TXT_ACTIVE' => '#', + 'OBLYON_COLOR_LEFTMENU_TXT_HOVER' => '#222222', + 'OBLYON_COLOR_BUTTON_ACTION1' => '#0088CC', + 'OBLYON_COLOR_BUTTON_ACTION2' => '#0044CC', + 'OBLYON_COLOR_BUTTON_DELETE1' => '#CC8800', + 'OBLYON_COLOR_BUTTON_DELETE2' => '#CC4400', + 'OBLYON_COLOR_INFO_BORDER' => '#87cfd2', + 'OBLYON_COLOR_INFO_BCKGRD' => '#eff8fc', + 'OBLYON_COLOR_INFO_TEXT' => '#222222', + 'OBLYON_COLOR_WARNING_BORDER' => '#f2cf87', + 'OBLYON_COLOR_WARNING_BCKGRD' => '#fcf8e3', + 'OBLYON_COLOR_WARNING_TEXT' => '#222222', + 'OBLYON_COLOR_ERROR_BORDER' => '#e0796e', + 'OBLYON_COLOR_ERROR_BCKGRD' => '#f07b6e', + 'OBLYON_COLOR_ERROR_TEXT' => '#222222', + 'OBLYON_COLOR_NOTIF_INFO_BCKGRD' => '#d9e5d1', + 'OBLYON_COLOR_NOTIF_INFO_TEXT' => '#446548', + 'OBLYON_COLOR_NOTIF_WARNING_BCKGRD' => '#fff7d1', + 'OBLYON_COLOR_NOTIF_WARNING_TEXT' => '#a28918', + 'OBLYON_COLOR_NOTIF_ERROR_BCKGRD' => '#d79eac', + 'OBLYON_COLOR_NOTIF_ERROR_TEXT' => '#a72947', + 'OBLYON_COLOR_MAIN' => '#0083A2', + 'OBLYON_COLOR_BCKGRD' => '#F5F5F5', + 'OBLYON_COLOR_LOGO_BCKGRD' => '#FFFFFF', + 'OBLYON_COLOR_LOGIN_BCKGRD' => '#F4F4F4', + 'OBLYON_COLOR_BTITLE' => '#0083A2', + 'OBLYON_COLOR_FTITLE' => '#222222', + 'OBLYON_COLOR_STITLE' => '#222222', + 'OBLYON_COLOR_BLINE' => '#FFFFFF', + 'OBLYON_COLOR_BLINE_HOVER' => '#F1F1F1', + 'OBLYON_COLOR_FLINE' => '#444444', + 'OBLYON_COLOR_FLINE_HOVER' => '#222222', + 'OBLYON_COLOR_FDATE_DEFAULT' => '#FF0000', + 'OBLYON_COLOR_FDATE_SELECTED' => '#FF0000', + 'OBLYON_COLOR_TEXTTABACTIVE' => '#222222', + 'OBLYON_COLOR_INPUT_BCKGRD' => '#FFFFFF', + 'OBLYON_COLOR_INFOBOX_BCKGRD1' => '#444444', + 'OBLYON_COLOR_INFOBOX_BCKGRD2' => '#E4EFE8', + 'OBLYON_COLOR_BORDER_ACTIONCOLUMN' => '#BBBBBB', + 'THEME_INVERT_RATIO_FILTER' => '0', + 'THEME_ELDY_TOPBORDER_TITLE1' => '#FFFFFF', + 'THEME_ELDY_BACKTITLE1' => '#E9EAED', + 'THEME_ELDY_BACKTABACTIVE' => '#FFFFFF', + 'THEME_ELDY_LINEIMPAIR1' => '#FFFFFF', + 'THEME_ELDY_LINEIMPAIR2' => '#FFFFFF', + 'THEME_ELDY_LINEPAIR1' => '#FBFBFB', + 'THEME_ELDY_LINEPAIR2' => '#FBFBFB', + 'THEME_ELDY_LINEBREAK' => '#FFFFFF', + 'THEME_ELDY_TEXTTITLENOTAB' => '#222222', + 'THEME_ELDY_TEXTTITLE' => '#28283C', + 'THEME_ELDY_TEXT' => '#000000', + 'THEME_ELDY_TEXTLINK' => '#1C1C1C' + ), + 'dark' => array('OBLYON_INFOXBOX_BACKGROUND' => '#FFFFFF', + 'OBLYON_COLOR_TOPMENU_BCKGRD' => '#333333', + 'OBLYON_COLOR_TOPMENU_BCKGRD_HOVER' => '#0083A2', + 'OBLYON_COLOR_TOPMENU_TXT' => '#F4F4F4', + 'OBLYON_COLOR_TOPMENU_TXT_ACTIVE' => '#', + 'OBLYON_COLOR_TOPMENU_TXT_HOVER' => '#', + 'OBLYON_COLOR_LEFTMENU_BCKGRD' => '#333333', + 'OBLYON_COLOR_LEFTMENU_BCKGRD_HOVER' => '#0083A2', + 'OBLYON_COLOR_LEFTMENU_TXT' => '#F4F4F4', + 'OBLYON_COLOR_LEFTMENU_TXT_ACTIVE' => '#', + 'OBLYON_COLOR_LEFTMENU_TXT_HOVER' => '#FFFFFF', + 'OBLYON_COLOR_BUTTON_ACTION1' => '#0083A2', + 'OBLYON_COLOR_BUTTON_ACTION2' => '#0063A2', + 'OBLYON_COLOR_BUTTON_DELETE1' => '#CC8800', + 'OBLYON_COLOR_BUTTON_DELETE2' => '#CC4400', + 'OBLYON_COLOR_INFO_BORDER' => '#87cfd2', + 'OBLYON_COLOR_INFO_BCKGRD' => '#eff8fc', + 'OBLYON_COLOR_INFO_TEXT' => '#222222', + 'OBLYON_COLOR_WARNING_BORDER' => '#f2cf87', + 'OBLYON_COLOR_WARNING_BCKGRD' => '#fcf8e3', + 'OBLYON_COLOR_WARNING_TEXT' => '#222222', + 'OBLYON_COLOR_ERROR_BORDER' => '#e0796e', + 'OBLYON_COLOR_ERROR_BCKGRD' => '#f07b6e', + 'OBLYON_COLOR_ERROR_TEXT' => '#222222', + 'OBLYON_COLOR_NOTIF_INFO_BCKGRD' => '#d9e5d1', + 'OBLYON_COLOR_NOTIF_INFO_TEXT' => '#446548', + 'OBLYON_COLOR_NOTIF_WARNING_BCKGRD' => '#fff7d1', + 'OBLYON_COLOR_NOTIF_WARNING_TEXT' => '#a28918', + 'OBLYON_COLOR_NOTIF_ERROR_BCKGRD' => '#d79eac', + 'OBLYON_COLOR_NOTIF_ERROR_TEXT' => '#a72947', + 'OBLYON_COLOR_MAIN' => '#0083A2', + 'OBLYON_COLOR_BCKGRD' => '#F4F4F4', + 'OBLYON_COLOR_LOGO_BCKGRD' => '#FFFFFF', + 'OBLYON_COLOR_LOGIN_BCKGRD' => '#F4F4F4', + 'OBLYON_COLOR_BTITLE' => '#0083A2', + 'OBLYON_COLOR_FTITLE' => '#222222', + 'OBLYON_COLOR_STITLE' => '#222222', + 'OBLYON_COLOR_BLINE' => '#FFFFFF', + 'OBLYON_COLOR_BLINE_HOVER' => '#F1F1F1', + 'OBLYON_COLOR_FLINE' => '#444444', + 'OBLYON_COLOR_FLINE_HOVER' => '#222222', + 'OBLYON_COLOR_FDATE_DEFAULT' => '#FF0000', + 'OBLYON_COLOR_FDATE_SELECTED' => '#FF0000', + 'OBLYON_COLOR_TEXTTABACTIVE' => '#222222', + 'OBLYON_COLOR_INPUT_BCKGRD' => '#FFFFFF', + 'OBLYON_COLOR_INFOBOX_BCKGRD1' => '#444444', + 'OBLYON_COLOR_INFOBOX_BCKGRD2' => '#E4EFE8', + 'OBLYON_COLOR_BORDER_ACTIONCOLUMN' => '#BBBBBB', + 'THEME_INVERT_RATIO_FILTER' => '80', + 'THEME_ELDY_TOPBORDER_TITLE1' => '#FFFFFF', + 'THEME_ELDY_BACKTITLE1' => '#E9EAED', + 'THEME_ELDY_BACKTABACTIVE' => '#FFFFFF', + 'THEME_ELDY_LINEIMPAIR1' => '#FFFFFF', + 'THEME_ELDY_LINEIMPAIR2' => '#FFFFFF', + 'THEME_ELDY_LINEPAIR1' => '#FBFBFB', + 'THEME_ELDY_LINEPAIR2' => '#FBFBFB', + 'THEME_ELDY_LINEBREAK' => '#FFFFFF', + 'THEME_ELDY_TEXTTITLENOTAB' => '#222222', + 'THEME_ELDY_TEXTTITLE' => '#28283C', + 'THEME_ELDY_TEXT' => '#000000', + 'THEME_ELDY_TEXTLINK' => '#1C1C1C' + ), + 'blue' => array('OBLYON_INFOXBOX_BACKGROUND' => '#FFFFFF', + 'OBLYON_COLOR_TOPMENU_BCKGRD' => '#092D5C', + 'OBLYON_COLOR_TOPMENU_BCKGRD_HOVER' => '#0D4185', + 'OBLYON_COLOR_TOPMENU_TXT' => '#F4F4F4', + 'OBLYON_COLOR_TOPMENU_TXT_ACTIVE' => '#', + 'OBLYON_COLOR_TOPMENU_TXT_HOVER' => '#', + 'OBLYON_COLOR_LEFTMENU_BCKGRD' => '#092D5C', + 'OBLYON_COLOR_LEFTMENU_BCKGRD_HOVER' => '#0D4185', + 'OBLYON_COLOR_LEFTMENU_TXT' => '#F4F4F4', + 'OBLYON_COLOR_LEFTMENU_TXT_ACTIVE' => '#F4F4F4', + 'OBLYON_COLOR_LEFTMENU_TXT_HOVER' => '#FFFFFF', + 'OBLYON_COLOR_BUTTON_ACTION1' => '#0088CC', + 'OBLYON_COLOR_BUTTON_ACTION2' => '#0044CC', + 'OBLYON_COLOR_BUTTON_DELETE1' => '#CC8800', + 'OBLYON_COLOR_BUTTON_DELETE2' => '#CC4400', + 'OBLYON_COLOR_INFO_BORDER' => '#87CFD2', + 'OBLYON_COLOR_INFO_BCKGRD' => '#EFF8FC', + 'OBLYON_COLOR_INFO_TEXT' => '#222222', + 'OBLYON_COLOR_WARNING_BORDER' => '#F2CF87', + 'OBLYON_COLOR_WARNING_BCKGRD' => '#FCF8E3', + 'OBLYON_COLOR_WARNING_TEXT' => '#222222', + 'OBLYON_COLOR_ERROR_BORDER' => '#E0796E', + 'OBLYON_COLOR_ERROR_BCKGRD' => '#F07B6E', + 'OBLYON_COLOR_ERROR_TEXT' => '#222222', + 'OBLYON_COLOR_NOTIF_INFO_BCKGRD' => '#446548', + 'OBLYON_COLOR_NOTIF_INFO_TEXT' => '#D9E5D1', + 'OBLYON_COLOR_NOTIF_WARNING_BCKGRD' => '#A28918', + 'OBLYON_COLOR_NOTIF_WARNING_TEXT' => '#FFF7D1', + 'OBLYON_COLOR_NOTIF_ERROR_BCKGRD' => '#A72947', + 'OBLYON_COLOR_NOTIF_ERROR_TEXT' => '#D79EAC', + 'OBLYON_COLOR_MAIN' => '#E09430', + 'OBLYON_COLOR_BCKGRD' => '#F4F4F4', + 'OBLYON_COLOR_LOGO_BCKGRD' => '#FFFFFF', + 'OBLYON_COLOR_LOGIN_BCKGRD' => '#F4F4F4', + 'OBLYON_COLOR_BTITLE' => '#E09430', + 'OBLYON_COLOR_FTITLE' => '#222222', + 'OBLYON_COLOR_STITLE' => '#222222', + 'OBLYON_COLOR_BLINE' => '#FFFFFF', + 'OBLYON_COLOR_BLINE_HOVER' => '#F1F1F1', + 'OBLYON_COLOR_FLINE' => '#444444', + 'OBLYON_COLOR_FLINE_HOVER' => '#222222', + 'OBLYON_COLOR_FDATE_DEFAULT' => '#FF0000', + 'OBLYON_COLOR_FDATE_SELECTED' => '#FF0000', + 'OBLYON_COLOR_TEXTTABACTIVE' => '#222222', + 'OBLYON_COLOR_INPUT_BCKGRD' => '#FFFFFF', + 'OBLYON_COLOR_INFOBOX_BCKGRD1' => '#444444', + 'OBLYON_COLOR_INFOBOX_BCKGRD2' => '#E4EFE8', + 'OBLYON_COLOR_BORDER_ACTIONCOLUMN' => '#BBBBBB', + 'THEME_INVERT_RATIO_FILTER' => '0', + 'THEME_ELDY_TOPBORDER_TITLE1' => '#FFFFFF', + 'THEME_ELDY_BACKTITLE1' => '#E9EAED', + 'THEME_ELDY_BACKTABACTIVE' => '#FFFFFF', + 'THEME_ELDY_LINEIMPAIR1' => '#FFFFFF', + 'THEME_ELDY_LINEIMPAIR2' => '#FFFFFF', + 'THEME_ELDY_LINEPAIR1' => '#FBFBFB', + 'THEME_ELDY_LINEPAIR2' => '#FBFBFB', + 'THEME_ELDY_LINEBREAK' => '#FFFFFF', + 'THEME_ELDY_TEXTTITLENOTAB' => '#222222', + 'THEME_ELDY_TEXTTITLE' => '#28283C', + 'THEME_ELDY_TEXT' => '#000000', + 'THEME_ELDY_TEXTLINK' => '#1C1C1C' + ), + 'night' => array('OBLYON_INFOXBOX_BACKGROUND' => '#444444', + 'OBLYON_COLOR_TOPMENU_BCKGRD' => '#222222', + 'OBLYON_COLOR_TOPMENU_BCKGRD_HOVER' => '#333333', + 'OBLYON_COLOR_TOPMENU_TXT' => '#F4F4F4', + 'OBLYON_COLOR_TOPMENU_TXT_ACTIVE' => '#', + 'OBLYON_COLOR_TOPMENU_TXT_HOVER' => '#', + 'OBLYON_COLOR_LEFTMENU_BCKGRD' => '#2C2C2C', + 'OBLYON_COLOR_LEFTMENU_BCKGRD_HOVER' => '#222222', + 'OBLYON_COLOR_LEFTMENU_TXT' => '#F4F4F4', + 'OBLYON_COLOR_LEFTMENU_TXT_ACTIVE' => '#', + 'OBLYON_COLOR_LEFTMENU_TXT_HOVER' => '#FFFFFF', + 'OBLYON_COLOR_BUTTON_ACTION1' => '#0088CC', + 'OBLYON_COLOR_BUTTON_ACTION2' => '#0044CC', + 'OBLYON_COLOR_BUTTON_DELETE1' => '#CC8800', + 'OBLYON_COLOR_BUTTON_DELETE2' => '#CC4400', + 'OBLYON_COLOR_INFO_BORDER' => '#87cfd2', + 'OBLYON_COLOR_INFO_BCKGRD' => '#eff8fc', + 'OBLYON_COLOR_INFO_TEXT' => '#222222', + 'OBLYON_COLOR_WARNING_BORDER' => '#f2cf87', + 'OBLYON_COLOR_WARNING_BCKGRD' => '#fcf8e3', + 'OBLYON_COLOR_WARNING_TEXT' => '#222222', + 'OBLYON_COLOR_ERROR_BORDER' => '#e0796e', + 'OBLYON_COLOR_ERROR_BCKGRD' => '#f07b6e', + 'OBLYON_COLOR_ERROR_TEXT' => '#222222', + 'OBLYON_COLOR_NOTIF_INFO_BCKGRD' => '#d9e5d1', + 'OBLYON_COLOR_NOTIF_INFO_TEXT' => '#446548', + 'OBLYON_COLOR_NOTIF_WARNING_BCKGRD' => '#fff7d1', + 'OBLYON_COLOR_NOTIF_WARNING_TEXT' => '#a28918', + 'OBLYON_COLOR_NOTIF_ERROR_BCKGRD' => '#d79eac', + 'OBLYON_COLOR_NOTIF_ERROR_TEXT' => '#a72947', + 'OBLYON_COLOR_MAIN' => '#E09430', + 'OBLYON_COLOR_BCKGRD' => '#444444', + 'OBLYON_COLOR_LOGO_BCKGRD' => '#FFFFFF', + 'OBLYON_COLOR_LOGIN_BCKGRD' => '#333333', + 'OBLYON_COLOR_BTITLE' => '#E09430', + 'OBLYON_COLOR_FTITLE' => '#F4F4F4', + 'OBLYON_COLOR_STITLE' => '#F4F4F4', + 'OBLYON_COLOR_BLINE' => '#444444', + 'OBLYON_COLOR_BLINE_HOVER' => '#F1F1F1', + 'OBLYON_COLOR_FLINE' => '#ECECEC', + 'OBLYON_COLOR_FLINE_HOVER' => '#FCFCFC', + 'OBLYON_COLOR_FDATE_DEFAULT' => '#FF0000', + 'OBLYON_COLOR_FDATE_SELECTED' => '#FF0000', + 'OBLYON_COLOR_TEXTTABACTIVE' => '#222222', + 'OBLYON_COLOR_INPUT_BCKGRD' => '#DEDEDE', + 'OBLYON_COLOR_INFOBOX_BCKGRD1' => '#444444', + 'OBLYON_COLOR_INFOBOX_BCKGRD2' => '#E4EFE8', + 'OBLYON_COLOR_BORDER_ACTIONCOLUMN' => '#BBBBBB', + 'THEME_INVERT_RATIO_FILTER' => '0', + 'THEME_ELDY_TOPBORDER_TITLE1' => '#FFFFFF', + 'THEME_ELDY_BACKTITLE1' => '#E9EAED', + 'THEME_ELDY_BACKTABACTIVE' => '#444444', + 'THEME_ELDY_LINEIMPAIR1' => '#FFFFFF', + 'THEME_ELDY_LINEIMPAIR2' => '#FFFFFF', + 'THEME_ELDY_LINEPAIR1' => '#FBFBFB', + 'THEME_ELDY_LINEPAIR2' => '#FBFBFB', + 'THEME_ELDY_LINEBREAK' => '#FFFFFF', + 'THEME_ELDY_TEXTTITLENOTAB' => '#FFFFFF', + 'THEME_ELDY_TEXTTITLE' => '#28283C', + 'THEME_ELDY_TEXT' => '#000000', + 'THEME_ELDY_TEXTLINK' => '#1C1C1C' + ), + 'light' => array('OBLYON_INFOXBOX_BACKGROUND' => '#FFFFFF', + 'OBLYON_COLOR_TOPMENU_BCKGRD' => '#FFFFFF', + 'OBLYON_COLOR_TOPMENU_BCKGRD_HOVER' => '#D51123', + 'OBLYON_COLOR_TOPMENU_TXT' => '#444444', + 'OBLYON_COLOR_TOPMENU_TXT_ACTIVE' => '#FFFFFF', + 'OBLYON_COLOR_TOPMENU_TXT_HOVER' => '#FFFFFF', + 'OBLYON_COLOR_LEFTMENU_BCKGRD' => '#FFFFFF', + 'OBLYON_COLOR_LEFTMENU_BCKGRD_HOVER' => '#D51123', + 'OBLYON_COLOR_LEFTMENU_TXT' => '#444444', + 'OBLYON_COLOR_LEFTMENU_TXT_ACTIVE' => '#FFFFFF', + 'OBLYON_COLOR_LEFTMENU_TXT_HOVER' => '#FFFFFF', + 'OBLYON_COLOR_BUTTON_ACTION1' => '#0083A2', + 'OBLYON_COLOR_BUTTON_ACTION2' => '#0063A2', + 'OBLYON_COLOR_BUTTON_DELETE1' => '#CC8800', + 'OBLYON_COLOR_BUTTON_DELETE2' => '#CC4400', + 'OBLYON_COLOR_INFO_BORDER' => '#87cfd2', + 'OBLYON_COLOR_INFO_BCKGRD' => '#eff8fc', + 'OBLYON_COLOR_INFO_TEXT' => '#222222', + 'OBLYON_COLOR_WARNING_BORDER' => '#f2cf87', + 'OBLYON_COLOR_WARNING_BCKGRD' => '#fcf8e3', + 'OBLYON_COLOR_WARNING_TEXT' => '#222222', + 'OBLYON_COLOR_ERROR_BORDER' => '#e0796e', + 'OBLYON_COLOR_ERROR_BCKGRD' => '#f07b6e', + 'OBLYON_COLOR_ERROR_TEXT' => '#222222', + 'OBLYON_COLOR_NOTIF_INFO_BCKGRD' => '#d9e5d1', + 'OBLYON_COLOR_NOTIF_INFO_TEXT' => '#446548', + 'OBLYON_COLOR_NOTIF_WARNING_BCKGRD' => '#fff7d1', + 'OBLYON_COLOR_NOTIF_WARNING_TEXT' => '#a28918', + 'OBLYON_COLOR_NOTIF_ERROR_BCKGRD' => '#d79eac', + 'OBLYON_COLOR_NOTIF_ERROR_TEXT' => '#a72947', + 'OBLYON_COLOR_MAIN' => '#D51123', + 'OBLYON_COLOR_BCKGRD' => '#FFFFFF', + 'OBLYON_COLOR_LOGO_BCKGRD' => '#FFFFFF', + 'OBLYON_COLOR_LOGIN_BCKGRD' => '#FFFFFF', + 'OBLYON_COLOR_BTITLE' => '#D51123', + 'OBLYON_COLOR_FTITLE' => '#222222', + 'OBLYON_COLOR_STITLE' => '#222222', + 'OBLYON_COLOR_BLINE' => '#FFFFFF', + 'OBLYON_COLOR_BLINE_HOVER' => '#F1F1F1', + 'OBLYON_COLOR_FLINE' => '#444444', + 'OBLYON_COLOR_FLINE_HOVER' => '#D51123', + 'OBLYON_COLOR_FDATE_DEFAULT' => '#FF0000', + 'OBLYON_COLOR_FDATE_SELECTED' => '#FF0000', + 'OBLYON_COLOR_TEXTTABACTIVE' => '#222222', + 'OBLYON_COLOR_INPUT_BCKGRD' => '#F4F4F4', + 'OBLYON_COLOR_INFOBOX_BCKGRD1' => '#444444', + 'OBLYON_COLOR_INFOBOX_BCKGRD2' => '#E4EFE8', + 'OBLYON_COLOR_BORDER_ACTIONCOLUMN' => '#BBBBBB', + 'THEME_INVERT_RATIO_FILTER' => '0', + 'THEME_ELDY_TOPBORDER_TITLE1' => '#FFFFFF', + 'THEME_ELDY_BACKTITLE1' => '#E9EAED', + 'THEME_ELDY_BACKTABACTIVE' => '#FFFFFF', + 'THEME_ELDY_LINEIMPAIR1' => '#FFFFFF', + 'THEME_ELDY_LINEIMPAIR2' => '#FFFFFF', + 'THEME_ELDY_LINEPAIR1' => '#FBFBFB', + 'THEME_ELDY_LINEPAIR2' => '#FBFBFB', + 'THEME_ELDY_LINEBREAK' => '#FFFFFF', + 'THEME_ELDY_TEXTTITLENOTAB' => '#222222', + 'THEME_ELDY_TEXTTITLE' => '#28283C', + 'THEME_ELDY_TEXT' => '#000000', + 'THEME_ELDY_TEXTLINK' => '#1C1C1C' + ) + ); + +// Actions ************************************** +$action = GETPOST('action','alpha'); +$result = ''; + +// Sauvegarde / Restauration +if ($action == 'bkupParams') { + $result = oblyon_bkup_module ('oblyon'); +} +if ($action == 'restoreParams') { + $result = oblyon_restore_module ('oblyon'); +} +// On / Off management +if (preg_match('/set_(.*)/', $action, $reg)) { + $confkey = $reg[1]; + $result = dolibarr_set_const($db, $confkey, GETPOST('value'), 'chaine', 0, 'Oblyon module', $conf->entity); +} +// Update buttons management +if (preg_match('/update_(.*)/', $action, $reg)) { + $list = array ('Gen' => array('THEME_INVERT_RATIO_FILTER')); + $confkey = $reg[1]; + $error = 0; + foreach ($list[$confkey] as $constname) { + $result = dolibarr_set_const($db, $constname, GETPOST($constname, 'alpha'), 'chaine', 0, 'Oblyon module', $conf->entity); } - // Update buttons management - if (preg_match('/update_(.*)/', $action, $reg)) { - $list = array ('Gen' => array('THEME_INVERT_RATIO_FILTER')); - $confkey = $reg[1]; - $error = 0; - foreach ($list[$confkey] as $constname) $result = dolibarr_set_const($db, $constname, GETPOST($constname, 'alpha'), 'chaine', 0, 'Oblyon module', $conf->entity); - foreach ($listcolor as $list) - foreach ($list as $constname) $result = dolibarr_set_const($db, $constname, '#'.GETPOST($constname, 'alpha'), 'chaine', 0, 'Oblyon module', $conf->entity); - if ($confkey == 'theme') { - $res = 1; - foreach ($listtheme[GETPOST('value', 'alpha')] as $constname => $constvalue) { - $result = dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, 'Oblyon module', $conf->entity); - $res = $res * $result; - } - $result = $res > 0 ? 2 : -1; + foreach ($listcolor as $list) { + foreach ($list as $constname) { + $result = dolibarr_set_const($db, $constname, '#'.GETPOST($constname, 'alpha'), 'chaine', 0, 'Oblyon module', $conf->entity); + } + } + if ($confkey == 'theme') { + $res = 1; + foreach ($listtheme[GETPOST('value', 'alpha')] as $constname => $constvalue) { + $result = dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, 'Oblyon module', $conf->entity); + $res = $res * $result; } + $result = $res > 0 ? 2 : -1; } - // Retour => message Ok ou Ko - if ($result == 2) setEventMessages($langs->trans('ThemeApplied').' : '.$langs->trans('Oblyon'.GETPOST('value', 'alpha')), null, 'mesgs'); - if ($result == 1) setEventMessages($langs->trans('SetupSaved'), null, 'mesgs'); - if ($result == -1) setEventMessages($langs->trans('Error'), null, 'errors'); +} +// Retour => message Ok ou Ko +if ($result == 2) { + setEventMessages($langs->trans('ThemeApplied').' : '.$langs->trans('Oblyon'.GETPOST('value', 'alpha')), null, 'mesgs'); +} +if ($result == 1) { + setEventMessages($langs->trans('SetupSaved'), null, 'mesgs'); +} +if ($result == -1) { + setEventMessages($langs->trans('Error'), null, 'errors'); +} - // View ***************************************** - $page_name = $langs->trans('OblyonColorsTitle'); - llxHeader('', $page_name, '', '', '', '', array('/oblyon/js/jscolor.js', '/oblyon/js/jquery.ui.touch-punch.min.js'), ''); - $linkback = ''.$langs->trans('BackToModuleList').''; - print load_fiche_titre($page_name, $linkback); +// View ***************************************** +$page_name = $langs->trans('OblyonColorsTitle'); +llxHeader('', $page_name, '', '', 0, 0, array('/oblyon/js/jscolor.js', '/oblyon/js/jquery.ui.touch-punch.min.js'), ''); +$linkback = ''.$langs->trans('BackToModuleList').''; +print load_fiche_titre($page_name, $linkback); - // Configuration header ************************* - $head = oblyon_admin_prepare_head(); - print dol_get_fiche_head($head, 'colors', $langs->trans('Module432573Name'), 0, 'inovea@oblyon'); +// Configuration header ************************* +$head = oblyon_admin_prepare_head(); +print dol_get_fiche_head($head, 'colors', $langs->trans('Module432573Name'), 0, 'inovea@oblyon'); - // setup page goes here ************************* - print ' -
+ '; + +print ' '; + // Sauvegarde / Restauration oblyon_print_backup_restore(); clearstatcache(); print '
'; - $larg = !empty($listtheme) && count($listtheme) > 0 ? 100 / count($listtheme) : 100; - $metas = array(); - for ($i = 0; $i < count($listtheme); $i++) $metas[] = $larg.'%'; + $larg = !empty($listtheme) && count($listtheme) > 0 ? 100 / count($listtheme) : 100; + $metas = array(); + for ($i = 0; $i < count($listtheme); $i++) { + $metas[] = $larg.'%'; + } oblyon_print_colgroup($metas); // Infobox enable - $metas = array(array(count($listtheme)), 'Themes'); + $metas = array(array(count($listtheme)), 'Themes'); oblyon_print_liste_titre($metas); print ' '; - foreach ($listtheme as $name => $values) + foreach ($listtheme as $name => $values) { print ' '; + } print ' '; // Colors // Top menu - $metas = array(array(5), 'TopMenu'); + $metas = array(array(5), (!getDolGlobalString('MAIN_MENU_INVERT', '') ? 'TopMenu' : 'LeftMenu')); oblyon_print_liste_titre($metas); if (count($listcolor['top'])) { foreach ($listcolor['top'] as $key) { + $transkey = !getDolGlobalString('MAIN_MENU_INVERT', '') ? $key : str_replace('TOP', 'LEFT', $key); $metas = array('type' => 'text', 'class' => 'flat quatrevingtpercent color action'); - oblyon_print_input($key, 'input', $langs->trans($key), '', $metas, 4, 1); + oblyon_print_input($key, 'input', $langs->trans($transkey), '', $metas, 4, 1); } } // Left menu - $metas = array(array(5), 'LeftMenu'); + $metas = array(array(5), (!getDolGlobalString('MAIN_MENU_INVERT', '') ? 'LeftMenu' : 'TopMenu')); oblyon_print_liste_titre($metas); if (count($listcolor['left'])) { foreach ($listcolor['left'] as $key) { + $transkey = !getDolGlobalString('MAIN_MENU_INVERT', '') ? $key : str_replace('LEFT', 'TOP', $key); $metas = array('type' => 'text', 'class' => 'flat quatrevingtpercent color action'); - oblyon_print_input($key, 'input', $langs->trans($key), '', $metas, 4, 1); + oblyon_print_input($key, 'input', $langs->trans($transkey), '', $metas, 4, 1); } } // button @@ -519,18 +569,21 @@ oblyon_print_liste_titre($metas); if (count($listcolor['options'])) { foreach ($listcolor['options'] as $key) { + if ($key == 'OBLYON_COLOR_BORDER_ACTIONCOLUMN' && !getDolGlobalString('FIX_STICKY_COLUMN_FIRST') && !getDolGlobalString('FIX_STICKY_COLUMN_LAST')) { + continue; + } $metas = array('type' => 'text', 'class' => 'flat quatrevingtpercent color action'); oblyon_print_input($key, 'input', $langs->trans($key), '', $metas, 4, 1); } } $metas = '
0 - - + + +100
'; - oblyon_print_input('', 'range', $langs->trans('InvertRatioDesc', $conf->global->THEME_INVERT_RATIO_FILTER), '', $metas, 4, 1); + oblyon_print_input('', 'range', $langs->trans('InvertRatioDesc', getDolGlobalString('THEME_INVERT_RATIO_FILTER')), '', $metas, 4, 1); // Eldy $metas = array(array(5), 'Eldy'); @@ -550,4 +603,3 @@ // End of page llxFooter(); $db->close(); -?> \ No newline at end of file diff --git a/admin/customcss.php b/admin/customcss.php index 5fb4412..8f52940 100644 --- a/admin/customcss.php +++ b/admin/customcss.php @@ -6,6 +6,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2022 Paul Lepont * Copyright (C) 2022-2023 Alexandre Spangaro + * Copyright (C) 2023-2025 Sylvain Legrand * * 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 @@ -34,7 +35,16 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; -require_once '../lib/oblyon.lib.php'; +dol_include_once('/oblyon/lib/oblyon.lib.php'); + +/** + * @var Conf $conf + * @var DoliDB $db + * @var HookManager $hookmanager + * @var Societe $mysoc + * @var Translate $langs + * @var User $user + */ // Translations ********************************* $langs->loadLangs(array('admin', 'oblyon@oblyon', 'inovea@oblyon')); @@ -102,7 +112,7 @@ $customcssValue = getDolGlobalString('OBLYON_CUSTOM_CSS'); -$doleditor = new DolEditor('OBLYON_CUSTOM_CSS', $customcssValue, '', '80%', 'Basic', 'In', true, false, 'ace',10,'90%'); +$doleditor = new DolEditor('OBLYON_CUSTOM_CSS', $customcssValue, 0, 80, 'Basic', 'In', true, false, 'ace',10,'90%'); $doleditor->Create(0,'',true,'css','css'); print ''."\n"; diff --git a/admin/dashboard.php b/admin/dashboard.php index f39d00a..ff2411b 100644 --- a/admin/dashboard.php +++ b/admin/dashboard.php @@ -1,178 +1,193 @@ - * Copyright (C) 2022 Sylvain Legrand - * - * 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 - * the Free Software Foundation, either version 3 of the License, or - * (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 - * along with this program. If not, see . - ************************************************/ - - /************************************************ - * \file ../oblyon/admin/dashboard.php - * \ingroup oblyon - * \brief Options Page < Oblyon Theme Configurator > - ************************************************/ - - // Dolibarr environment ************************* - require '../config.php'; - - // Libraries ************************************ - require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - require_once '../lib/oblyon.lib.php'; - - // Translations ********************************* - $langs->loadLangs(array('admin', 'oblyon@oblyon', 'inovea@oblyon')); - - // Access control ******************************* - if (! $user->admin) accessforbidden(); - - // init variables ******************************* - $result = empty($conf->global->THEME_AGRESSIVENESS_RATIO) ? dolibarr_set_const($db, 'THEME_AGRESSIVENESS_RATIO', -50, 'chaine', 0, 'Oblyon module', $conf->entity) : ''; - $listcolor = array('OBLYON_INFOXBOX_BACKGROUND', // #FFFFFF - 'OBLYON_INFOXBOX_WEATHER_COLOR', // #BDBDBD - 'OBLYON_INFOXBOX_ACTION_COLOR', // #B46080 AGENDA - 'OBLYON_INFOXBOX_PROJECT_COLOR', // #6C6A98 PROJECT - 'OBLYON_INFOXBOX_CUSTOMER_PROPAL_COLOR', // #99A17D CUSTOMER PROPOSAL - 'OBLYON_INFOXBOX_CUSTOMER_ORDER_COLOR', // #99A17D CUSTOMER ORDER - 'OBLYON_INFOXBOX_CUSTOMER_INVOICE_COLOR', // #99A17D CUSTOMER INVOICE - 'OBLYON_INFOXBOX_SUPPLIER_PROPAL_COLOR', // #599CAF SUPPLIER PROPOSAL - 'OBLYON_INFOXBOX_SUPPLIER_ORDER_COLOR', // #599CAF SUPPLIER ORDER - 'OBLYON_INFOXBOX_SUPPLIER_INVOICE_COLOR', // #599CAF SUPPLIER INVOICE - 'OBLYON_INFOXBOX_CONTRAT_COLOR', // #469686 CONTRACT - 'OBLYON_INFOXBOX_BANK_COLOR', // #C5903E BANK - 'OBLYON_INFOXBOX_ADHERENT_COLOR', // #79633F MEMBERS - 'OBLYON_INFOXBOX_EXPENSEREPORT_COLOR', // #79633F EXPENSES - 'OBLYON_INFOXBOX_HOLIDAY_COLOR', // #755114 HOLIDAYS - 'OBLYON_INFOXBOX_TICKET_COLOR', // #755114 TICKETS - ); - - // Actions ************************************** - $action = GETPOST('action','alpha'); - $result = ''; - // Sauvegarde / Restauration - if ($action == 'bkupParams') $result = oblyon_bkup_module ('oblyon'); - if ($action == 'restoreParams') $result = oblyon_restore_module ('oblyon'); - // On / Off management - if (preg_match('/set_(.*)/', $action, $reg)) { - $confkey = $reg[1]; - $result = dolibarr_set_const($db, $confkey, GETPOST('value'), 'chaine', 0, 'Oblyon module', $conf->entity); - } - // Update buttons management - if (preg_match('/update_(.*)/', $action, $reg)) { - $list = array ('Gen' => array('THEME_AGRESSIVENESS_RATIO')); - $confkey = $reg[1]; - $error = 0; - foreach ($list[$confkey] as $constname) $result = dolibarr_set_const($db, $constname, GETPOST($constname, 'alpha'), 'chaine', 0, 'Oblyon module', $conf->entity); - foreach ($listcolor as $constname) $result = dolibarr_set_const($db, $constname, '#'.GETPOST($constname, 'alpha'), 'chaine', 0, 'Oblyon module', $conf->entity); - - $result = dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr(GETPOST("main_motd", 'restricthtml')), 'chaine', 0, '', $conf->entity); - } - // Retour => message Ok ou Ko - if ($result == 1) setEventMessages($langs->trans('SetupSaved'), null, 'mesgs'); - if ($result == -1) setEventMessages($langs->trans('Error'), null, 'errors'); - $_SESSION['dol_resetcache'] = dol_print_date(dol_now(), 'dayhourlog'); // Reset cache - - // View ***************************************** - $page_name = $langs->trans('OblyonDashboardTitle'); - llxHeader('', $page_name, '', '', '', '', array('/oblyon/js/jscolor.js', '/oblyon/js/jquery.ui.touch-punch.min.js'), ''); - $linkback = ''.$langs->trans('BackToModuleList').''; - print load_fiche_titre($page_name, $linkback); - - // Configuration header ************************* - $head = oblyon_admin_prepare_head(); - print dol_get_fiche_head($head, 'dashboard', $langs->trans('Module432573Name'), 0, 'inovea@oblyon'); - - // setup page goes here ************************* - print ' - - - - - '; - // Sauvegarde / Restauration - oblyon_print_backup_restore(); - clearstatcache(); - print '
-
'.img_picto($langs->trans('Oblyon'.$name), 'oblyon'.$name.'.png@oblyon', 'width = "50%"').'
'.$langs->trans('Oblyon'.$name).'
'; - $metas = array('*', '156px', '300px'); - oblyon_print_colgroup($metas); - /* - // Message of the day - require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $texthelp = $langs->trans("FollowingConstantsWillBeSubstituted") . '
'; - oblyon_print_input('MAIN_MOTD', 'textarea', $langs->trans("MessageOfDay"), $texthelp, $metas, 2); - $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'dashboard'); - */ - // Infobox enable - $metas = array(array(3), 'OblyonDashboardDisableBlocks'); - oblyon_print_liste_titre($metas); - $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'dashboard'); - oblyon_print_input('MAIN_DISABLE_GLOBAL_WORKBOARD', 'on_off', $langs->trans('DashboardDisableGlobal'), '', $metas, 2, 1); // Disable all workboard - $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'dashboard'); - oblyon_print_input('MAIN_DISABLE_GLOBAL_BOXSTATS', 'on_off', $langs->trans('DisableGlobalBoxStats'), '', $metas, 2, 1); // Disable boxes stats widget - $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'dashboard'); - oblyon_print_input('THEME_INFOBOX_COLOR_ON_BACKGROUND', 'on_off', $langs->trans('InfoboxColorOnBackground'), '', $metas, 2, 1); // On workboard invert background color with text color - $easyaVersion = (float) !empty($conf->global->EASYA_VERSION) ? $conf->global->EASYA_VERSION : ''; - if ($easyaVersion >= 2022.5 || (float) DOL_VERSION >= 15.0) { - if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { - $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'dashboard'); - oblyon_print_input('MAIN_DISABLE_METEO', 'on_off', $langs->trans('MAIN_DISABLE_METEO'), '', $metas, 2, 1); // weather block - oblyon_print_input('MAIN_DISABLE_BLOCK_AGENDA', 'on_off', $langs->trans('DashboardDisableBlockAgenda'), '', $metas, 2, 1); // calendar block - oblyon_print_input('MAIN_DISABLE_BLOCK_PROJECT', 'on_off', $langs->trans('DashboardDisableBlockProject'), '', $metas, 2, 1); // project block - oblyon_print_input('MAIN_DISABLE_BLOCK_CUSTOMER', 'on_off', $langs->trans('DashboardDisableBlockCustomer'), '', $metas, 2, 1); // customers block - oblyon_print_input('MAIN_DISABLE_BLOCK_SUPPLIER', 'on_off', $langs->trans('DashboardDisableBlockSupplier'), '', $metas, 2, 1); // suppliers block - oblyon_print_input('MAIN_DISABLE_BLOCK_CONTRACT', 'on_off', $langs->trans('DashboardDisableBlockContract'), '', $metas, 2, 1); // contract block - oblyon_print_input('MAIN_DISABLE_BLOCK_BANK', 'on_off', $langs->trans('DashboardDisableBlockBank'), '', $metas, 2, 1); // bank block - oblyon_print_input('MAIN_DISABLE_BLOCK_ADHERENT', 'on_off', $langs->trans('DashboardDisableBlockAdherent'), '', $metas, 2, 1); // members block - oblyon_print_input('MAIN_DISABLE_BLOCK_EXPENSEREPORT', 'on_off', $langs->trans('DashboardDisableBlockExpenseReport'), '', $metas, 2, 1); // expenses block - oblyon_print_input('MAIN_DISABLE_BLOCK_HOLIDAY', 'on_off', $langs->trans('DashboardDisableBlockHoliday'), '', $metas, 2, 1); // holidays block - oblyon_print_input('MAIN_DISABLE_BLOCK_TICKET', 'on_off', $langs->trans('DashboardDisableBlockTicket'), '', $metas, 2, 1); // tickets block - } + }); + '; + +print ''; +print ''; +print ''; +print ''; +print ''; + +// Sauvegarde / Restauration +oblyon_print_backup_restore(); +clearstatcache(); +print '
+
'; +$metas = array('*', '156px', '300px'); +oblyon_print_colgroup($metas); +/* +// Message of the day +require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; +$texthelp = $langs->trans("FollowingConstantsWillBeSubstituted") . '
'; +oblyon_print_input('MAIN_MOTD', 'textarea', $langs->trans("MessageOfDay"), $texthelp, $metas, 2); +$metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'dashboard'); +*/ +// Infobox enable +$metas = array(array(3), 'OblyonDashboardDisableBlocks'); +oblyon_print_liste_titre($metas); +$metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'dashboard'); +oblyon_print_input('MAIN_DISABLE_GLOBAL_WORKBOARD', 'on_off', $langs->trans('DashboardDisableGlobal'), '', $metas, 2, 1); // Disable all workboard +$metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'dashboard'); +oblyon_print_input('MAIN_DISABLE_GLOBAL_BOXSTATS', 'on_off', $langs->trans('DisableGlobalBoxStats'), '', $metas, 2, 1); // Disable boxes stats widget +$metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'dashboard'); +oblyon_print_input('THEME_INFOBOX_COLOR_ON_BACKGROUND', 'on_off', $langs->trans('InfoboxColorOnBackground'), '', $metas, 2, 1); // On workboard invert background color with text color +$easyaVersion = getDolGlobalFloat('EASYA_VERSION', 0); +if ($easyaVersion >= 2022.5 || (float) DOL_VERSION >= 15.0) { + if (!getDolGlobalString('MAIN_DISABLE_GLOBAL_WORKBOARD')) { + $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'dashboard'); + oblyon_print_input('MAIN_DISABLE_METEO', 'on_off', $langs->trans('MAIN_DISABLE_METEO'), '', $metas, 2, 1); // weather block + oblyon_print_input('MAIN_DISABLE_BLOCK_AGENDA', 'on_off', $langs->trans('DashboardDisableBlockAgenda'), '', $metas, 2, 1); // calendar block + oblyon_print_input('MAIN_DISABLE_BLOCK_PROJECT', 'on_off', $langs->trans('DashboardDisableBlockProject'), '', $metas, 2, 1); // project block + oblyon_print_input('MAIN_DISABLE_BLOCK_CUSTOMER', 'on_off', $langs->trans('DashboardDisableBlockCustomer'), '', $metas, 2, 1); // customers block + oblyon_print_input('MAIN_DISABLE_BLOCK_SUPPLIER', 'on_off', $langs->trans('DashboardDisableBlockSupplier'), '', $metas, 2, 1); // suppliers block + oblyon_print_input('MAIN_DISABLE_BLOCK_CONTRACT', 'on_off', $langs->trans('DashboardDisableBlockContract'), '', $metas, 2, 1); // contract block + oblyon_print_input('MAIN_DISABLE_BLOCK_BANK', 'on_off', $langs->trans('DashboardDisableBlockBank'), '', $metas, 2, 1); // bank block + oblyon_print_input('MAIN_DISABLE_BLOCK_ADHERENT', 'on_off', $langs->trans('DashboardDisableBlockAdherent'), '', $metas, 2, 1); // members block + oblyon_print_input('MAIN_DISABLE_BLOCK_EXPENSEREPORT', 'on_off', $langs->trans('DashboardDisableBlockExpenseReport'), '', $metas, 2, 1); // expenses block + oblyon_print_input('MAIN_DISABLE_BLOCK_HOLIDAY', 'on_off', $langs->trans('DashboardDisableBlockHoliday'), '', $metas, 2, 1); // holidays block + oblyon_print_input('MAIN_DISABLE_BLOCK_TICKET', 'on_off', $langs->trans('DashboardDisableBlockTicket'), '', $metas, 2, 1); // tickets block + oblyon_print_input('OBLYON_INFOXBOX_SINGLE_WIDTH', 'on_off', $langs->trans('OblyonInfoboxSingleWidth'), 'OblyonInfoboxSingleWidthHelp', $metas, 2, 1); // Single width for all info boxes } - // Set Intensity - $metas = array(array(3), 'ColorIntensity'); - oblyon_print_liste_titre($metas); - $metas = '
- -100 - - - +100 - -
'; - oblyon_print_input('', 'range', $langs->trans('ColorIntensityDesc', $conf->global->THEME_AGRESSIVENESS_RATIO), '', $metas, 1, 2); - // Colors - $metas = array(array(3), 'Colors'); - oblyon_print_liste_titre($metas); - if (count($listcolor) > 0) { - foreach ($listcolor as $key) { - $metas = array('type' => 'text', 'class' => 'flat quatrevingtpercent color action'); - oblyon_print_input($key, 'input', $langs->trans($key), '', $metas, 2, 1); - } +} +// Set Intensity +$metas = array(array(3), 'ColorIntensity'); +oblyon_print_liste_titre($metas); +$metas = '
+ -100 + + +100 + +
'; +oblyon_print_input('', 'range', $langs->trans('ColorIntensityDesc', getDolGlobalString('THEME_AGRESSIVENESS_RATIO')), '', $metas, 1, 2); +// Colors +$metas = array(array(3), 'Colors'); +oblyon_print_liste_titre($metas); +if (count($listcolor) > 0) { + foreach ($listcolor as $key) { + $metas = array('type' => 'text', 'class' => 'flat quatrevingtpercent color action'); + oblyon_print_input($key, 'input', $langs->trans($key), '', $metas, 2, 1); } - print '
-
'; - print dol_get_fiche_end(); - oblyon_print_btn_action('Gen'); - print ' -
'; - // End of page - llxFooter(); - $db->close(); -?> \ No newline at end of file +} +print ' + '; +print dol_get_fiche_end(); +oblyon_print_btn_action('Gen'); +print ' +
'; +// End of page +llxFooter(); +$db->close(); diff --git a/admin/icons.php b/admin/icons.php index aa72b26..63aa87b 100644 --- a/admin/icons.php +++ b/admin/icons.php @@ -1,7 +1,7 @@ - * Copyright (C) 2022 Sylvain Legrand + * Copyright (C) 2022-2025 Sylvain Legrand * * 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 @@ -97,4 +97,3 @@ // End of page llxFooter(); $db->close(); -?> \ No newline at end of file diff --git a/admin/menus.php b/admin/menus.php index 35dc547..8557720 100644 --- a/admin/menus.php +++ b/admin/menus.php @@ -1,7 +1,7 @@ - * Copyright (C) 2022 Sylvain Legrand + * Copyright (C) 2022-2025 Sylvain Legrand * * 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 @@ -17,75 +17,88 @@ * along with this program. If not, see . ************************************************/ - /************************************************ - * \file ../oblyon/admin/menus.php - * \ingroup oblyon - * \brief Options Page < Oblyon Theme Configurator > - ************************************************/ +/************************************************ +* \file ../oblyon/admin/menus.php +* \ingroup oblyon +* \brief Menus Page < Oblyon Theme Configurator > +************************************************/ - // Dolibarr environment ************************* - require '../config.php'; +// Dolibarr environment ************************* +require '../config.php'; - // Libraries ************************************ - require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'); - require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'); - require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - require_once '../lib/oblyon.lib.php'; +// Libraries ************************************ +require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'); +require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'); +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +dol_include_once('/oblyon/backport/v21/core/lib/functions.lib.php'); +dol_include_once('/oblyon/lib/oblyon.lib.php'); - // Translations ********************************* - $langs->loadLangs(array('admin', 'oblyon@oblyon', 'inovea@oblyon')); +/** + * @var Conf $conf + * @var DoliDB $db + * @var HookManager $hookmanager + * @var Societe $mysoc + * @var Translate $langs + * @var User $user + */ - // Access control ******************************* - if (! $user->admin) accessforbidden(); +// Translations ********************************* +$langs->loadLangs(array('admin', 'oblyon@oblyon', 'inovea@oblyon')); - // Actions ************************************** - $action = GETPOST('action','alpha'); - $result = ''; - $formother = new FormOther($db); - // Sauvegarde / Restauration - if ($action == 'bkupParams') $result = oblyon_bkup_module ('oblyon'); - if ($action == 'restoreParams') $result = oblyon_restore_module ('oblyon'); - // On / Off management - if (preg_match('/set_(.*)/', $action, $reg)) { - $confkey = $reg[1]; - $result = dolibarr_set_const($db, $confkey, GETPOST('value'), 'chaine', 0, 'Oblyon module', $conf->entity); - } - // Update buttons management - if (preg_match('/update_(.*)/', $action, $reg)) { - $list = array ('Gen' => array('OBLYON_EFFECT_LEFTMENU', 'OBLYON_EFFECT_REDUCE_LEFTMENU')); - $confkey = $reg[1]; - $error = 0; - foreach ($list[$confkey] as $constname) $result = dolibarr_set_const($db, $constname, GETPOST($constname, 'alpha'), 'chaine', 0, 'Oblyon module', $conf->entity); - } - // Retour => message Ok ou Ko - if ($result == 1) setEventMessages($langs->trans('SetupSaved'), null, 'mesgs'); - if ($result == -1) setEventMessages($langs->trans('Error'), null, 'errors'); - $_SESSION['dol_resetcache'] = dol_print_date(dol_now(), 'dayhourlog'); // Reset cache +// Access control ******************************* +if (! $user->admin) accessforbidden(); + +// Actions ************************************** +$action = GETPOST('action','alpha'); +$result = ''; +$formother = new FormOther($db); +// Sauvegarde / Restauration +if ($action == 'bkupParams') $result = oblyon_bkup_module ('oblyon'); +if ($action == 'restoreParams') $result = oblyon_restore_module ('oblyon'); +// On / Off management +if (preg_match('/set_(.*)/', $action, $reg)) { + $confkey = $reg[1]; + $result = dolibarr_set_const($db, $confkey, GETPOST('value'), 'chaine', 0, 'Oblyon module', $conf->entity); +} +// Update buttons management +if (preg_match('/update_(.*)/', $action, $reg)) { + $list = array ('Gen' => array('OBLYON_EFFECT_LEFTMENU', 'OBLYON_EFFECT_REDUCE_LEFTMENU')); + $confkey = $reg[1]; + $error = 0; + foreach ($list[$confkey] as $constname) $result = dolibarr_set_const($db, $constname, GETPOST($constname, 'alpha'), 'chaine', 0, 'Oblyon module', $conf->entity); +} +// Retour => message Ok ou Ko +if ($result == 1) setEventMessages($langs->trans('SetupSaved'), null, 'mesgs'); +if ($result == -1) setEventMessages($langs->trans('Error'), null, 'errors'); +$_SESSION['dol_resetcache'] = dol_print_date(dol_now(), 'dayhourlog'); // Reset cache - // init variables ******************************* - $result = !empty($conf->global->MAIN_MENU_INVERT) && (/*!empty($conf->global->OBLYON_SHOW_COMPNAME) || */!empty($conf->global->OBLYON_HIDE_LEFTMENU)) ? dolibarr_set_const($db, 'OBLYON_FULLSIZE_TOPBAR', 1, 'chaine', 0, 'Oblyon module', $conf->entity) : ''; - $result = !empty($conf->global->OBLYON_HIDE_LEFTMENU) && empty($conf->global->OBLYON_EFFECT_LEFTMENU) ? dolibarr_set_const($db, 'OBLYON_EFFECT_LEFTMENU', 'slide', 'chaine', 0, 'Oblyon module', $conf->entity) : ''; - $result = !empty($conf->global->MAIN_MENU_INVERT) && !empty($conf->global->OBLYON_REDUCE_LEFTMENU) ? dolibarr_set_const($db, 'OBLYON_HIDE_LEFTICONS', 0, 'chaine', 0, 'Oblyon module', $conf->entity) : ''; - $result = !empty($conf->global->OBLYON_REDUCE_LEFTMENU) && empty($conf->global->OBLYON_EFFECT_REDUCE_LEFTMENU) ? dolibarr_set_const($db, 'OBLYON_EFFECT_REDUCE_LEFTMENU', 'hover', 'chaine', 0, 'Oblyon module', $conf->entity) : ''; +// init variables ******************************* +$result = getDolGlobalString('MAIN_MENU_INVERT') && (/*getDolGlobalString('OBLYON_SHOW_COMPNAME') || */getDolGlobalString('OBLYON_HIDE_LEFTMENU')) ? dolibarr_set_const($db, 'OBLYON_FULLSIZE_TOPBAR', 1, 'chaine', 0, 'Oblyon module', $conf->entity) : ''; +$result = getDolGlobalString('OBLYON_HIDE_LEFTMENU') && !getDolGlobalString('OBLYON_EFFECT_LEFTMENU') ? dolibarr_set_const($db, 'OBLYON_EFFECT_LEFTMENU', 'slide', 'chaine', 0, 'Oblyon module', $conf->entity) : ''; +$result = getDolGlobalString('MAIN_MENU_INVERT') && getDolGlobalString('OBLYON_REDUCE_LEFTMENU') ? dolibarr_set_const($db, 'OBLYON_HIDE_LEFTICONS', 0, 'chaine', 0, 'Oblyon module', $conf->entity) : ''; +$result = getDolGlobalString('OBLYON_REDUCE_LEFTMENU') && !getDolGlobalString('OBLYON_EFFECT_REDUCE_LEFTMENU') ? dolibarr_set_const($db, 'OBLYON_EFFECT_REDUCE_LEFTMENU', 'hover', 'chaine', 0, 'Oblyon module', $conf->entity) : ''; - // View ***************************************** - $page_name = $langs->trans('OblyonMenusTitle'); - llxHeader('', $page_name); - $linkback = ''.$langs->trans('BackToModuleList').''; - print load_fiche_titre($page_name, $linkback); +// View ***************************************** +$page_name = $langs->trans('OblyonMenusTitle'); +$help_url = ''; +llxHeader('', $page_name, $help_url, '', 0, 0, '', '', '', 'mod-oblyon page-admin_menus'); - // Configuration header ************************* - $head = oblyon_admin_prepare_head(); - print dol_get_fiche_head($head, 'menus', $langs->trans('Module432573Name'), 0, 'inovea@oblyon'); +$linkback = ''.$langs->trans('BackToModuleList').''; +print load_fiche_titre($page_name, $linkback, 'object_inovea.png@oblyon'); - // setup page goes here ************************* - // Alert - if (!defined('MAIN_MODULE_OBLYON') && $conf->theme != 'oblyon') - print '
'.img_warning().' '.$langs->trans('OblyonErrorMessage').'
'; - else - print '
'.$langs->trans('OblyonSuccessMessage').'
'; - print ' -
- - - - '; - // Sauvegarde / Restauration - oblyon_print_backup_restore(); - clearstatcache(); - print '
- '; - $metas = array('*', '156px', '300px'); - oblyon_print_colgroup($metas); - // General - $metas = array(array(3), 'General'); - oblyon_print_liste_titre($metas); - $metas = array('type' => 'number', 'class' => 'flat quatrevingtpercent right action', 'dir' => 'rtl', 'min' => '10', 'max' => '16'); - oblyon_print_input('OBLYON_FONT_SIZE', 'input', $langs->trans('OblyonFontSize'), '', $metas, 2, 1); // Font size - $metas = array('type' => 'number', 'class' => 'flat quatrevingtpercent right action', 'dir' => 'rtl', 'min' => '24', 'max' => '128'); - oblyon_print_input('OBLYON_IMAGE_HEIGHT_TABLE', 'input', $langs->trans('OblyonImageHeightTable'), '', $metas, 2, 1); // Max height for Image on table list - $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); - oblyon_print_input('OBLYON_DISABLE_VERSION', 'on_off', $langs->trans('OblyonDisableVersion'), '', $metas, 2, 1); // Disable version of Dolibarr - $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); - oblyon_print_input('MAIN_STATUS_USES_IMAGES', 'on_off', $langs->trans('MainStatusUseImages'), '', $metas, 2, 1); // Status use images - $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); - oblyon_print_input('MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN', 'on_off', $langs->trans('OblyonMainUseQuickAddDropdown'), '', $metas, 2, 1); // Quickadd dropdown menu - if (!empty($conf->bookmark->enabled)) { - $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); - oblyon_print_input('MAIN_USE_TOP_MENU_BOOKMARK_DROPDOWN', 'on_off', $langs->trans('OblyonMainUseBookmarkDropdown'), '', $metas, 2, 1); // Bookmark dropdown menu - } - $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); - oblyon_print_input('OBLYON_PADDING_RIGHT_BOTTOM', 'on_off', $langs->trans('OblyonPaddingRightBottom'), '', $metas, 2, 1); // Add padding on bottom - // Login - $metas = array(array(3), 'OblyonLogin'); - oblyon_print_liste_titre($metas); - $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); - oblyon_print_input('MAIN_LOGIN_RIGHT', 'on_off', $langs->trans('LoginRight'), '', $metas, 2, 1); // Login box on the right - // Card - $metas = array(array(3), 'Card'); - oblyon_print_liste_titre($metas); - $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); - oblyon_print_input('FIX_AREAREF_TABACTION', 'on_off', $langs->trans('FixAreaRefAndTabAction'), '', $metas, 2, 1); // Sticky area ref & tab action - if ($easyaVersion >= "2022.5.2" || (float) DOL_VERSION >= 17.0) { - $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); - oblyon_print_input('FIX_STICKY_TABS_CARD', 'on_off', $langs->trans('FixStickyTabsCard').$labs_picto, '', $metas, 2, 1); // Sticky tabs card - } - // List - $metas = array(array(3), 'List'); - oblyon_print_liste_titre($metas); - if ($easyaVersion >= "2024.0.0" || (float) DOL_VERSION >= 18.0) { - $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); - oblyon_print_input('MAIN_CHECKBOX_LEFT_COLUMN', 'on_off', $langs->trans('SwitchColunmOnLeft'), '', $metas, 2, 1); // Sticky table headers columns - } - if ($easyaVersion >= "2024.0.0" || (float) DOL_VERSION >= 18.0) { - $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); - oblyon_print_input('OBLYON_DISABLE_KANBAN_VIEW_IN_LIST', 'on_off', $langs->trans('RemoveKanbanViewInList').$labs_picto, '', $metas, 2, 1); // Remove button kanban view in list - } - if ($easyaVersion >= "2022.5.2" || (float) DOL_VERSION >= 17.0) { - $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); - oblyon_print_input('FIX_STICKY_HEADER_CARD', 'on_off', $langs->trans('FixStickyTableHeadersColumns'), '', $metas, 2, 1); // Sticky table headers columns - } - if ($easyaVersion >= "2022.5.2" || (float) DOL_VERSION >= 14.0) { - $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); - oblyon_print_input('OBLYON_STICKY_COLUMN_FIRST', 'on_off', $langs->trans('FixStickyFirstColumn').$labs_picto, '', $metas, 2, 1); // Sticky table first column - } - if ($easyaVersion >= "2022.5.2" || (float) DOL_VERSION >= 14.0) { - $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); - oblyon_print_input('OBLYON_STICKY_COLUMN_LAST', 'on_off', $langs->trans('FixStickyLastColumn').$labs_picto, '', $metas, 2, 1); // Sticky table last column - } - print '
-
'; - print dol_get_fiche_end(); - oblyon_print_btn_action('Gen'); - print '
-
'; - // End of page - llxFooter(); - $db->close(); -?> + }); + + +
+ + + +'; + +// Sauvegarde / Restauration +oblyon_print_backup_restore(); +clearstatcache(); + +print '
'; + +// Disclaimer +print ''; +print ''; +print ''; +print ''; +print '
'; +print '

'; +print img_picto('', 'warning') . ' ' . $langs->trans("ResetCacheDisclaimer"); +print '

'; +print '
'; + +print '
'; + +print '
'; +/* +print ''; +$metas = array('*', '156px', '300px'); +oblyon_print_colgroup($metas); +*/ + +print '
'; +print ''; +print ''; +//print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''."\n"; +print "\n"; + +$countg = 1; + +$metas = array('type' => 'number', 'class' => 'flat quatrevingtpercent right action', 'dir' => 'rtl', 'min' => '10', 'max' => '16'); +oblyon_print_input('OBLYON_FONT_SIZE', 'input', 'G' . $countg . ' - ' . $langs->trans('OblyonFontSize'), '', $metas, 2, 1); // Font size +$countg++; + +$form = new Form($db); +$metas = $form->selectarray('OBLYON_FONT_FAMILY', $font_options, $currentFont, 0, 0, 0, 'class = "fontsizeinherit nopadding cursorpointer"', 0, 0, 0, '', 'maxwidth200'); +oblyon_print_input('OBLYON_FONT_FAMILY', 'select', 'G' . $countg . ' - ' . $langs->trans('OblyonFontFamily'), '', $metas, 2, 1); +$countg++; + +$metas = array('type' => 'number', 'class' => 'flat quatrevingtpercent right action', 'dir' => 'rtl', 'min' => '24', 'max' => '128'); +oblyon_print_input('OBLYON_IMAGE_HEIGHT_TABLE', 'input', 'G' . $countg . ' - ' . $langs->trans('OblyonImageHeightTable'), '', $metas, 2, 1); // Max height for Image on table list +$countg++; + +$metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); +oblyon_print_input('OBLYON_DISABLE_VERSION', 'on_off', 'G' . $countg . ' - ' . $langs->trans('OblyonDisableVersion'), '', $metas, 2, 1); // Disable version of Dolibarr +$countg++; + +$metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); +oblyon_print_input('MAIN_STATUS_USES_IMAGES', 'on_off', 'G' . $countg . ' - ' . $langs->trans('MainStatusUseImages'), '', $metas, 2, 1); // Status use images +$countg++; + +$metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); +oblyon_print_input('MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN', 'on_off', 'G' . $countg . ' - ' . $langs->trans('OblyonMainUseQuickAddDropdown') . ' (' . $stringforfirstkey . ' a)', '', $metas, 2, 1); // Quickadd dropdown menu +$countg++; + +$metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); +oblyon_print_input('MAIN_USE_TOP_MENU_SEARCH_DROPDOWN', 'on_off', 'G' . $countg . ' - ' . $langs->trans('OblyonMainUseSearchDropdown') . ' (' . $stringforfirstkey . ' s)', '', $metas, 2, 1); // Search dropdown menu +$countg++; + +if (isModEnabled('bookmark')) { + $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); + oblyon_print_input('MAIN_USE_TOP_MENU_BOOKMARK_DROPDOWN', 'on_off', 'G' . $countg . ' - ' . $langs->trans('OblyonMainUseBookmarkDropdown'), '', $metas, 2, 1); // Bookmark dropdown menu + $countg++; +} + +$metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); +oblyon_print_input('OBLYON_PADDING_RIGHT_BOTTOM', 'on_off', 'G' . $countg . ' - ' . $langs->trans('OblyonPaddingRightBottom'), '', $metas, 2, 1); // Add padding on bottom +$countg++; + +/* Login +$metas = array(array(3), 'OblyonLogin'); +oblyon_print_liste_titre($metas); +$metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); +oblyon_print_input('MAIN_LOGIN_RIGHT', 'on_off', $langs->trans('LoginRight'), '', $metas, 2, 1); // Login box on the right +*/ + +print ''; +print '
'.$langs->trans("Parameters").''.$langs->trans("OptionsGeneral").''.$langs->trans("Value").'
'; +print '
'; + +oblyon_print_btn_action('Gen'); + +print '
'; +print ''; +print ''; +print ''; +//print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''."\n"; +print "\n"; + +$countl = 1; + +if ($easyaVersion >= "2024.0.0" || (float) DOL_VERSION >= 18.0) { + $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); + oblyon_print_input('MAIN_CHECKBOX_LEFT_COLUMN', 'on_off', 'L' . $countl . ' - ' . $langs->trans('SwitchColunmOnLeft'), '', $metas, 2, 1); // Sticky table headers columns + $countleftcheckbox = $countl; + $countl++; +} +if ($easyaVersion >= "2024.0.0" || (float) DOL_VERSION >= 18.0) { + // Sticky title, pagination and "Add" element in list - FIX_TITLE_IN_LIST + $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); + oblyon_print_input('FIX_TITLE_IN_LIST', 'on_off', 'L' . $countl . ' - ' . $langs->trans('FixTitleInList'), '', $metas, 2, 1); // Sticky table headers columns + $countleftcheckbox = $countl; + $countl++; +} +if ($easyaVersion >= "2024.0.0" || (float) DOL_VERSION >= 19.0) { + // Old Compatibility + if (getDolGlobalString('OBLYON_DISABLE_KANBAN_VIEW_IN_LIST')) { + getDolGlobalString('DISABLE_KANBAN_VIEW_IN_LIST') == 1; + } + + $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); + oblyon_print_input('DISABLE_KANBAN_VIEW_IN_LIST', 'on_off', 'L' . $countl . ' - ' . $langs->trans('RemoveKanbanViewInList'), '', $metas, 2, 1); // Remove button kanban view in list + $countl++; +} +if ($easyaVersion >= "2022.5.2" || (float) DOL_VERSION >= 17.0) { + $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); + oblyon_print_input('FIX_STICKY_HEADER_CARD', 'on_off', 'L' . $countl . ' - ' . $langs->trans('FixStickyTableHeadersColumns'), '', $metas, 2, 1); // Sticky table headers columns + $countl++; +} +if ($easyaVersion >= "2024.0.0" || (float) DOL_VERSION >= 17.0) { + // Old Compatibility + if (getDolGlobalString('OBLYON_STICKY_COLUMN_FIRST')) { + getDolGlobalString('FIX_STICKY_COLUMN_FIRST') == 1; + } + + $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); + oblyon_print_input('FIX_STICKY_COLUMN_FIRST', 'on_off', 'L' . $countl . ' - ' . $langs->trans('FixStickyFirstColumn'), '', $metas, 2, 1); // Sticky table first column + $countl++; +} +if ($easyaVersion >= "2024.0.0" || (float) DOL_VERSION >= 17.0) { + // Old Compatibility + if (getDolGlobalString('OBLYON_STICKY_COLUMN_LAST')) { + getDolGlobalString('FIX_STICKY_COLUMN_LAST') == 1; + } + + $msgleftcheckbox = !empty($countleftcheckbox) ? ' ('.$langs->trans("WarningActivationOption1Enabled", 'L'.$countleftcheckbox).')' : ''; + $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); + oblyon_print_input('FIX_STICKY_COLUMN_LAST', 'on_off', 'L' . $countl . ' - ' . $langs->trans('FixStickyLastColumn') . $msgleftcheckbox, '', $metas, 2, 1); // Sticky table last column + $countl++; +} +if ($easyaVersion >= "2024.0.0" || (float) DOL_VERSION >= 16.0) { + $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); + oblyon_print_input('FIX_STICKY_TOTAL_BAR', 'on_off', 'L' . $countl . ' - ' . $langs->trans('FixStickyTotalBar'), '', $metas, 2, 1); // Sticky table last column + $countl++; +} +if ($easyaVersion >= "2026.0.0" || (float) DOL_VERSION >= 20.0) { + $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); + oblyon_print_input('MAIN_GRANDTOTAL_LIST_SHOW', 'on_off', 'L' . $countl . ' - ' . $langs->trans('ShowGrandTotalList'). ' ('. $langs->trans("NotAvailableOnAllLists") . ') ' . $labs_picto, '', $metas, 2, 1); // Sticky table last column + $countl++; +} +if (getDolGlobalString('MAIN_GRANDTOTAL_LIST_SHOW')) { + if ($easyaVersion >= "2026.0.0" || (float)DOL_VERSION >= 20.0) { + $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); + oblyon_print_input('FIX_STICKY_GRANDTOTAL_BAR', 'on_off', 'L' . $countl . ' - ' . $langs->trans('FixStickyGrandTotalBar') . $labs_picto, '', $metas, 2, 1); // Sticky table last column + $countl++; + } +} +print ''; +print '
'.$langs->trans("Parameters").''.$langs->trans("OptionsList").''.$langs->trans("Value").'
'; +print '
'; + +print ''; +print ''; +print ''; +//print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''."\n"; +print "\n"; + +$countc = 1; + +if ($easyaVersion >= "2024.0.0" || (float) DOL_VERSION >= 17.0) { + $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); + oblyon_print_input('FIX_STICKY_TABS_CARD', 'on_off', 'C' . $countc . ' - ' . $langs->trans('FixStickyTabsCard'), '', $metas, 2, 1); // Sticky table headers columns + $countc++; +} + +if ($easyaVersion >= "2024.0.0" || (float) DOL_VERSION >= 17.0) { + // Old Compatibility + if (getDolGlobalString('FIX_AREAREF_TABACTION')) { + getDolGlobalString('FIX_AREAREF_CARD') == 1; + } + + $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); + oblyon_print_input('FIX_AREAREF_CARD', 'on_off', 'C' . $countc . ' - ' . $langs->trans('FixAreaRefCard'), '', $metas, 2, 1); // Sticky table headers columns + $countc++; +} + +if ($easyaVersion >= "2024.0.0" || (float) DOL_VERSION >= 17.0) { + $txt = getDolGlobalString('FIX_AREAREF_CARD') && getDolGlobalString('FIX_STICKY_TABS_CARD') ? ' '.$langs->trans('LimitTabLineToOne') : ''; + $metas = array('type' => 'number', 'class' => 'flat quatrevingtpercent right action', 'dir' => 'rtl', 'min' => '8', 'max' => '50'); + oblyon_print_input('MAIN_MAXTABS_IN_CARD', 'input', 'C' . $countc . ' - ' . $langs->trans('MainMaxTabsInCard').$txt, '', $metas, 2, 1); // Max tabs in card + $countc++; +} + +if ($easyaVersion >= "2024.0.0" || (float) DOL_VERSION >= 14.0) { + // Old Compatibility + if (getDolGlobalString('FIX_AREAREF_TABACTION')) { + getDolGlobalString('FIX_ABSOLUTE_BUTTONS_ACTION_CARD') == 1; + } + + $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); + oblyon_print_input('FIX_ABSOLUTE_BUTTONS_ACTION_CARD', 'on_off', 'C' . $countc . ' - ' . $langs->trans('FixAbsoluteButtonsActionCard'), '', $metas, 2, 1); // Sticky table headers columns + $countc++; +} + +if ($easyaVersion >= "2024.0.0" || (float) DOL_VERSION >= 18.0) { + $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); + oblyon_print_input('MAIN_VIEW_LINE_NUMBER', 'on_off', 'C' . $countc . ' - ' . $langs->trans('ShowLineNumberCard'), '', $metas, 2, 1); // Sticky table headers columns + $countc++; +} + +print ''; +print '
'.$langs->trans("Parameters").''.$langs->trans("OptionsCard").''.$langs->trans("Value").'
'; +print '
'; + + +print ''; +print ''; +print ''; +print ''."\n"; +print ''."\n"; +print ''."\n"; +print "\n"; + +$countk = 1; + +$metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); +oblyon_print_input('FCKEDITOR_ALLOW_ANY_CONTENT', 'on_off', 'K' . $countk . ' - ' . $langs->trans('FckeditorAllowAnyContent'), '', $metas, 2, 1); // Allow to enter any content. However, this will totally disable content filtering which is one of the most important CKEditor features. You can use this to keep all your tags and attributes in the html content +$countk++; + +$metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); +oblyon_print_input('FCKEDITOR_ENABLE_SCAYT_AUTOSTARTUP', 'on_off', 'K' . $countk . ' - ' . $langs->trans('FckeditorEnableScaytAutostartup'), '', $metas, 2, 1); // Allow to activate the SpellCheckAsYouType (SCAYT) plugins of CKEditor i.e an automatic spell checking +$countk++; + +$metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'options'); +oblyon_print_input('MAIN_SECURITY_ALLOW_UNSECURED_LABELS_WITH_HTML', 'on_off', 'K' . $countk . ' - ' . $langs->trans('MainSecurityAllowUnsecuredLabelsWithHtml'), '', $metas, 2, 1); // Allow HTML tags into products label +$countk++; + +print ''; +print '
'.$langs->trans("OptionsCKEditor").''.$langs->trans("Value").'
'; +print '
'; + +oblyon_print_btn_action('Card'); + +print '
'; +print '
'; + +print dol_get_fiche_end(); + +print '
'; + +llxFooter(); +$db->close(); diff --git a/backport/v21/core/lib/functions.lib.php b/backport/v21/core/lib/functions.lib.php new file mode 100644 index 0000000..7b1f08e --- /dev/null +++ b/backport/v21/core/lib/functions.lib.php @@ -0,0 +1,127 @@ + InfraS - + * + * 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 + * the Free Software Foundation, either version 3 of the License, or + * (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 + * along with this program. If not, see . + ************************************************/ + + /************************************************ + * \file ../oblyon/backport/v21/core/lib/functions.lib.php + * \ingroup InfraS + * \brief about page + ************************************************/ + + + /** + * Return dolibarr global constant string value + * + * @param string $key key to return value, return '' if not set + * @param string $default value to return + * @return string + */ + if (!function_exists('getDolGlobalString')) { + function getDolGlobalString($key, $default = '') + { + global $conf; + // return $conf->global->$key ?? $default; + return (string) (isset($conf->global->$key) ? $conf->global->$key : $default); + } + } + + /** + * Return dolibarr global constant int value + * + * @param string $key key to return value, return 0 if not set + * @param int $default value to return + * @return int + */ + if (!function_exists('getDolGlobalInt')) { + function getDolGlobalInt($key, $default = 0) + { + global $conf; + // return $conf->global->$key ?? $default; + return (int) (isset($conf->global->$key) ? $conf->global->$key : $default); + } + } + + /** + * Return a Dolibarr global constant float value. + * + * @param string $key Key to return value, return $default if not set + * @param float $default Value to return if not defined + * @return float Value returned + * @see getDolUserInt() + **/ + if (!function_exists('getDolGlobalFloat')) { + function getDolGlobalFloat($key, $default = 0) + { + global $conf; + return (float) (isset($conf->global->$key) ? $conf->global->$key : $default); + } + } + + /** + * Return a Dolibarr global constant boolean value. + * + * @param string $key Key to return value, return $default if not set + * @param bool $default Value to return if not defined + * @return bool Value returned + **/ + if (!function_exists('getDolGlobalBool')) { + function getDolGlobalBool($key, $default = false) + { + global $conf; + return (bool) ($conf->global->$key ?? $default); + } + } + + /** + * Return Dolibarr user constant string value + * + * @param string $key key to return value, return '' if not set + * @param string $default value to return + * @param User $tmpuser To get another user than current user + * @return string + */ + if (!function_exists('getDolUserString')) { + function getDolUserString($key, $default = '', $tmpuser = null) + { + if (empty($tmpuser)) { + global $user; + $tmpuser = $user; + } + // return $conf->global->$key ?? $default; + return (string) (empty($tmpuser->conf->$key) ? $default : $tmpuser->conf->$key); + } + } + + /** + * Return Dolibarr user constant int value + * + * @param string $key key to return value, return 0 if not set + * @param int $default value to return + * @param User $tmpuser To get another user than current user + * @return int + */ + if (!function_exists('getDolUserInt')) { + function getDolUserInt($key, $default = 0, $tmpuser = null) + { + if (empty($tmpuser)) { + global $user; + $tmpuser = $user; + } + // return $conf->global->$key ?? $default; + return (int) (empty($tmpuser->conf->$key) ? $default : $tmpuser->conf->$key); + } + } diff --git a/config.php b/config.php index 405bb05..45b5981 100644 --- a/config.php +++ b/config.php @@ -1,7 +1,7 @@ - * Copyright (C) 2022 Sylvain Legrand + * Copyright (C) 2022-2025 Sylvain Legrand * * 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 @@ -24,27 +24,47 @@ ************************************************/ // Dolibarr environment ************************* - $res = 0; + $res = 0; // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) - if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; + if (empty($res) && !empty($_SERVER['CONTEXT_DOCUMENT_ROOT'])) { + $res = @include $_SERVER['CONTEXT_DOCUMENT_ROOT'].'/main.inc.php'; + } // Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME - if (! $res) - { + if (empty($res)) { $tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; - while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) - { + while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; - } // while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) - if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; - if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; - } // if (! $res) + } + if (empty($res) && $i > 0 && file_exists(substr($tmp, 0, ($i+1)).'/main.inc.php')) { + $res = @include substr($tmp, 0, ($i + 1)).'/main.inc.php'; + } + if (empty($res) && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1))).'/main.inc.php')) { + $res = @include dirname(substr($tmp, 0, ($i + 1))).'/main.inc.php'; + } + } // Try main.inc.php using relative path - if (! $res && file_exists("../main.inc.php")) $res = @include "../main.inc.php"; - if (! $res && file_exists("../../main.inc.php")) $res = @include "../../main.inc.php"; - if (! $res && file_exists("../../../main.inc.php")) $res = @include "../../../main.inc.php"; - if (! $res) die("Include of main fails"); -?> \ No newline at end of file + if (empty($res) && file_exists('../main.inc.php')) { + $res = @include '../main.inc.php'; + } + if (empty($res) && file_exists('../../main.inc.php')) { + $res = @include '../../main.inc.php'; + } + if (empty($res) && file_exists('../../../main.inc.php')) { + $res = @include '../../../main.inc.php'; + } + if (empty($res) && file_exists('../../../../main.inc.php')) { + $res = @include '../../../../main.inc.php'; + } + if (empty($res) && file_exists('../../../../../main.inc.php')) { + $res = @include '../../../../../main.inc.php'; + } + if (empty($res) && file_exists('../../../../../../main.inc.php')) { + $res = @include '../../../../../../main.inc.php'; + } + if (empty($res)) { + die('Include of main fails'); + } diff --git a/core/menus/standard/oblyon.lib.php b/core/menus/standard/oblyon.lib.php index dbf63e5..1fd762c 100644 --- a/core/menus/standard/oblyon.lib.php +++ b/core/menus/standard/oblyon.lib.php @@ -27,6 +27,7 @@ * \brief Library for file Oblyon menus */ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php'; +dol_include_once('/oblyon/backport/v21/core/lib/functions.lib.php'); // Translations $langs->loadLangs(array('oblyon@oblyon')); @@ -58,7 +59,7 @@ function print_oblyon_menu($db, $atarget, $type_user = 0, &$tabMenu, &$menu, $no } $id = 'mainmenu'; - $listofmodulesforexternal = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL); + $listofmodulesforexternal = explode(',', getDolGlobalString('MAIN_MODULES_FOR_EXTERNAL')); $classname = ''; @@ -67,31 +68,27 @@ function print_oblyon_menu($db, $atarget, $type_user = 0, &$tabMenu, &$menu, $no if (empty($noout)) print_start_menu_array(); // Show logo company - if (empty($menu_invert) && empty($noout) && ! empty($conf->global->MAIN_SHOW_LOGO)) { - //$mysoc->logo_mini=(empty($conf->global->MAIN_INFO_SOCIETE_LOGO_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI); - $mysoc->logo_squarred_mini=(empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI); + if (empty($menu_invert) && empty($noout) && getDolGlobalString('MAIN_SHOW_LOGO')) { + $mysoc->logo_squarred_mini = getDolGlobalString('MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI', ''); - if (! empty($mysoc->logo_squarred_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini)) - { - $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini); + if (! empty($mysoc->logo_squarred_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini); } /*elseif (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini); }*/ - else - { - $urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png'; + else { + $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.png'; $logoContainerAdditionalClass = ''; } - $title=$langs->trans("GoIntoSetupToChangeLogo"); + $title = $langs->trans("GoIntoSetupToChangeLogo"); print "\n".''."\n"; print_start_menu_entry('companylogo', 'class="tmenu tmenucompanylogo"', 1); - print ''."\n"; @@ -99,24 +96,7 @@ function print_oblyon_menu($db, $atarget, $type_user = 0, &$tabMenu, &$menu, $no print_end_menu_entry(1); } - // Désactivé en menu inversé car provoque un chargement html dans la page style.css et empêche le chargement des variables css - /* - if (!empty($conf->global->OBLYON_SHOW_COMPNAME) && !empty($conf->global->MAIN_INFO_SOCIETE_NOM)) { - if ($menu_invert) { - print "\n".''."\n"; - print_start_menu_entry('companyname', 'class="tmenu tmenucompanylogo"', 1); - - print "\n"; - print '
'."\n"; - print ''. $conf->global->MAIN_INFO_SOCIETE_NOM .''."\n"; - print '
'."\n"; - - print_end_menu_entry(1); - } - } - */ - - 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 + if (is_array($moredata) && ! empty($moredata['searchform']) && empty($noout)) // searchform can contains select2 code or link to show old search form or link to switch on search page { print "\n"; print "\n"; @@ -126,7 +106,7 @@ function print_oblyon_menu($db, $atarget, $type_user = 0, &$tabMenu, &$menu, $no print "\n"; } - if (is_array($moredata) && ! empty($moredata['bookmarks'])) + if (is_array($moredata) && ! empty($moredata['bookmarks']) && empty($noout)) { print "\n"; print "\n"; @@ -136,7 +116,7 @@ function print_oblyon_menu($db, $atarget, $type_user = 0, &$tabMenu, &$menu, $no print "\n"; } - if ( empty($menu_invert) && (getDolGlobalInt('OBLYON_HIDE_LEFTMENU') || $conf->dol_optimize_smallscreen) ) { + if ( empty($menu_invert) && (getDolGlobalInt('OBLYON_HIDE_LEFTMENU') || $conf->dol_optimize_smallscreen) && empty($noout) ) { print '
'; } @@ -159,15 +139,15 @@ function print_oblyon_menu($db, $atarget, $type_user = 0, &$tabMenu, &$menu, $no // Members $tmpentry = array( - 'enabled' => (!empty($conf->adherent->enabled) || !empty($conf->member->enabled)), - 'perms' => (!empty($user->rights->adherent->lire)), + 'enabled' => (isModEnabled('adherent') || isModEnabled('member')), + 'perms' => ($user->hasRight('adherent', 'lire')), 'module' => 'adherent' ); - $showmode=dol_oblyon_showmenu($type_user, $tmpentry, $listofmodulesforexternal); + $showmode = dol_oblyon_showmenu($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) { if (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "members") { - $itemsel=TRUE; + $itemsel = TRUE; $_SESSION['idmenu']=''; } else { $itemsel = FALSE; @@ -184,12 +164,12 @@ function print_oblyon_menu($db, $atarget, $type_user = 0, &$tabMenu, &$menu, $no // Third parties $tmpentry = array( - 'enabled'=> ((!empty($conf->societe->enabled) && - (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) + 'enabled'=> ((isModEnabled('societe') && + (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTS') || !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS')) ) - || ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) + || ((isModEnabled('fournisseur') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) ), - 'perms'=> (!empty($user->rights->societe->lire) || !empty($user->rights->fournisseur->lire) || !empty($user->rights->supplier_order->lire) || !empty($user->rights->supplier_invoice->lire) || !empty($user->rights->supplier_proposal->lire)), + 'perms'=> ($user->hasRight('societe', 'lire') || $user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire')), 'module'=>'societe|fournisseur' ); $showmode=dol_oblyon_showmenu($type_user, $tmpentry, $listofmodulesforexternal); @@ -197,7 +177,7 @@ function print_oblyon_menu($db, $atarget, $type_user = 0, &$tabMenu, &$menu, $no $langs->loadLangs(array("companies","suppliers")); if (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "companies") { - $itemsel=TRUE; + $itemsel = TRUE; $_SESSION['idmenu']=''; } else { $itemsel = FALSE; @@ -214,8 +194,8 @@ function print_oblyon_menu($db, $atarget, $type_user = 0, &$tabMenu, &$menu, $no // Products-Services $tmpentry = array( - 'enabled'=> (!empty($conf->product->enabled) || !empty($conf->service->enabled) || !empty($conf->expedition->enabled)), - 'perms'=> (!empty($user->rights->produit->lire) || !empty($user->rights->service->lire) || !empty($user->rights->expedition->lire)), + 'enabled'=> (isModEnabled('product') || isModEnabled('service') || isModEnabled('expedition')), + 'perms'=> ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire') || $user->hasRight('expedition', 'lire')), 'module'=>'product|service' ); $showmode=dol_oblyon_showmenu($type_user, $tmpentry, $listofmodulesforexternal); @@ -231,17 +211,6 @@ function print_oblyon_menu($db, $atarget, $type_user = 0, &$tabMenu, &$menu, $no $idsel='products'; $chaine=""; - /* - if (! empty($conf->product->enabled)) { - $chaine.=$langs->trans("Products"); - } - if (! empty($conf->product->enabled) && ! empty($conf->service->enabled)) { - $chaine.=" | "; - } - if (! empty($conf->service->enabled)) { - $chaine.=$langs->trans("Services"); - } - */ $chaine.=$langs->trans("MenuCatalog"); if (empty($noout)) print_start_menu_entry($idsel,$itemsel,$showmode); @@ -252,11 +221,11 @@ function print_oblyon_menu($db, $atarget, $type_user = 0, &$tabMenu, &$menu, $no // MRP - GPAO $tmpentry = array( - 'enabled'=>(!empty($conf->bom->enabled) || !empty($conf->mrp->enabled)), - 'perms'=>(!empty($user->rights->bom->read) || !empty($user->rights->mrp->read)), + 'enabled'=>(isModEnabled('bom') || isModEnabled('mrp')), + 'perms'=>($user->hasRight('bom', 'read') || $user->hasRight('mrp', 'read')), 'module'=>'bom|mrp' ); - $showmode=dol_oblyon_showmenu($type_user, $tmpentry, $listofmodulesforexternal); + $showmode = dol_oblyon_showmenu($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) { $langs->loadLangs(array("mrp")); @@ -268,7 +237,7 @@ function print_oblyon_menu($db, $atarget, $type_user = 0, &$tabMenu, &$menu, $no } $idsel='mrp'; - $chaine=$langs->trans("TMenuMRP"); + $chaine = $langs->trans("TMenuMRP"); if (empty($noout)) print_start_menu_entry($idsel,$itemsel,$showmode); if (empty($noout)) print_text_menu_entry($chaine, $showmode, DOL_URL_ROOT.'/mrp/index.php?mainmenu=mrp&leftmenu=', $id, $idsel, $atarget); @@ -277,8 +246,8 @@ function print_oblyon_menu($db, $atarget, $type_user = 0, &$tabMenu, &$menu, $no } // Projects - $tmpentry=array('enabled'=>(! empty($conf->projet->enabled)), - 'perms'=>(! empty($user->rights->projet->lire)), + $tmpentry=array('enabled'=>isModEnabled('projet'), + 'perms'=>($user->hasRight('projet', 'lire')), 'module'=>'projet'); $showmode=dol_oblyon_showmenu($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) { @@ -293,7 +262,7 @@ function print_oblyon_menu($db, $atarget, $type_user = 0, &$tabMenu, &$menu, $no $idsel='project'; if (empty($noout)) print_start_menu_entry($idsel,$itemsel,$showmode); - if (!empty($conf->global->PROJECT_FORCE_LIST_ACCESS)) { + if (getDolGlobalString('PROJECT_FORCE_LIST_ACCESS')) { if (empty($noout)) print_text_menu_entry($langs->trans("MenuProjectsOpportunities"), $showmode, DOL_URL_ROOT . '/projet/list.php?mainmenu=project&leftmenu=', $id, $idsel, $atarget); } else { if (empty($noout)) print_text_menu_entry($langs->trans("MenuProjectsOpportunities"), $showmode, DOL_URL_ROOT . '/projet/index.php?mainmenu=project&leftmenu=', $id, $idsel, $atarget); @@ -301,42 +270,40 @@ function print_oblyon_menu($db, $atarget, $type_user = 0, &$tabMenu, &$menu, $no if (empty($noout)) print_end_menu_entry($showmode); $title = $langs->trans("LeadsOrProjects"); // Leads and opportunities by default $showmodel = $showmodep = $showmode; - if (empty($conf->global->PROJECT_USE_OPPORTUNITIES)) + if (!getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) { $title = $langs->trans("Projects"); $showmodel = 0; } - if ($conf->global->PROJECT_USE_OPPORTUNITIES == 2) { + if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES') == 2) { $title = $langs->trans("Leads"); $showmodep = 0; } - if (!empty($conf->global->PROJECT_FORCE_LIST_ACCESS)) { + if (getDolGlobalString('PROJECT_FORCE_LIST_ACCESS')) { $menu->add('/projet/list.php?mainmenu=project&leftmenu=projets', $title, 0, $showmode, $atarget, "project", '', 70, $id, $idsel, $classname); } else { $menu->add('/projet/index.php?mainmenu=project&leftmenu=', $title, 0, $showmode, $atarget, "project", '', 70, $id, $idsel, $classname); } - //$menu->add('/projet/index.php?mainmenu=project&leftmenu=&search_opp_status=openedopp', $langs->trans("ListLeads"), 0, $showmodel & $conf->global->PROJECT_USE_OPPORTUNITIES, $atarget, "project", '', 70, $id, $idsel, $classname); - //$menu->add('/projet/index.php?mainmenu=project&leftmenu=&search_opp_status=notopenedopp', $langs->trans("ListProjects"), 0, $showmodep, $atarget, "project", '', 70, $id, $idsel, $classname); } // Commercial (propal, commande, supplier_proposal, supplier_order, contrat, ficheinter) $tmpentry = array( - 'enabled'=>(!empty($conf->propal->enabled) - || !empty($conf->commande->enabled) - || !empty($conf->fournisseur->enabled) - || !empty($conf->supplier_proposal->enabled) - || !empty($conf->supplier_order->enabled) - || !empty($conf->contrat->enabled) - || !empty($conf->ficheinter->enabled) + 'enabled'=>(isModEnabled('propal') + || isModEnabled('commande') + || isModEnabled('fournisseur') + || isModEnabled('supplier_proposal') + || isModEnabled('supplier_order') + || isModEnabled('contrat') + || isModEnabled('ficheinter') ) ? 1 : 0, - 'perms'=>(!empty($user->rights->propal->lire) - || !empty($user->rights->commande->lire) - || !empty($user->rights->supplier_proposal->lire) - || !empty($user->rights->fournisseur->lire) - || !empty($user->rights->fournisseur->commande->lire) - || !empty($user->rights->supplier_order->lire) - || !empty($user->rights->contrat->lire) - || !empty($user->rights->ficheinter->lire) + 'perms'=>($user->hasRight('propal', 'lire') + || $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') ), 'module'=>'propal|commande|fournisseur|supplier_proposal|supplier_order|contrat|ficheinter' ); @@ -362,19 +329,19 @@ function print_oblyon_menu($db, $atarget, $type_user = 0, &$tabMenu, &$menu, $no // Billing - Financial $tmpentry = array( - 'enabled'=>(!empty($conf->facture->enabled) || - !empty($conf->don->enabled) || - !empty($conf->tax->enabled) || - !empty($conf->salaries->enabled) || - !empty($conf->supplier_invoice->enabled) || - !empty($conf->loan->enabled) || - !empty($conf->margins->enabled) || - !empty($conf->banque->enabled) + 'enabled'=>(isModEnabled('facture') || + isModEnabled('don') || + isModEnabled('tax') || + isModEnabled('salaries') || + isModEnabled('supplier_invoice') || + isModEnabled('loan') || + isModEnabled('margins') || + isModEnabled('banque') ) ? 1 : 0, - 'perms'=>(!empty($user->rights->facture->lire) || !empty($user->rights->don->contact->lire) - || !empty($user->rights->tax->charges->lire) || !empty($user->rights->salaries->read) - || !empty($user->rights->fournisseur->facture->lire) || !empty($user->rights->loan->read) || !empty($user->rights->margins->liretous) - || !empty($user->rights->banque->lire) + 'perms'=>($user->hasRight('facture', 'lire') || $user->hasRight('don', 'contact', 'lire') + || $user->hasRight('tax', 'charges', 'lire') || $user->hasRight('salaries', 'read') + || $user->hasRight('fournisseur', 'facture', 'lire') || $user->hasRight('loan', 'read') || $user->hasRight('margins', 'liretous') + || $user->hasRight('banque', 'lire') ), 'module'=>'facture|supplier_invoice|don|tax|salaries|loan' ); @@ -399,8 +366,8 @@ function print_oblyon_menu($db, $atarget, $type_user = 0, &$tabMenu, &$menu, $no // Bank $tmpentry = array( - 'enabled'=>(!empty($conf->banque->enabled) || !empty($conf->prelevement->enabled)), - 'perms'=>(!empty($user->rights->banque->lire) || !empty($user->rights->prelevement->lire) || !empty($user->rights->paymentbybanktransfer->read)), + 'enabled'=>(isModEnabled('banque') || isModEnabled('prelevement')), + 'perms'=>($user->hasRight('banque', 'lire') || $user->hasRight('prelevement', 'lire') || $user->hasRight('paymentbybanktransfer', 'read')), 'module'=>'banque|prelevement|paymentbybanktransfer' ); $showmode=dol_oblyon_showmenu($type_user, $tmpentry, $listofmodulesforexternal); @@ -424,8 +391,8 @@ function print_oblyon_menu($db, $atarget, $type_user = 0, &$tabMenu, &$menu, $no // Accounting $tmpentry = array( - 'enabled'=>(!empty($conf->comptabilite->enabled) || !empty($conf->accounting->enabled) || !empty($conf->asset->enabled) || !empty($conf->intracommreport->enabled)), - 'perms'=>(!empty($user->rights->compta->resultat->lire) || !empty($user->rights->accounting->comptarapport->lire) || !empty($user->rights->accounting->mouvements->lire) || !empty($user->rights->asset->read) || !empty($user->rights->intracommreport->read)), + 'enabled'=>(isModEnabled('comptabilite') || isModEnabled('accounting') || isModEnabled('asset') || isModEnabled('intracommreport')), + 'perms'=>($user->hasRight('compta', 'resultat', 'lire') || $user->hasRight('accounting', 'comptarapport', 'lire') || $user->hasRight('accounting', 'mouvements', 'lire') || $user->hasRight('asset', 'read') || $user->hasRight('intracommreport', 'read')), 'module'=>'comptabilite|accounting|asset|intracommreport' ); $showmode=dol_oblyon_showmenu($type_user, $tmpentry, $listofmodulesforexternal); @@ -451,8 +418,8 @@ function print_oblyon_menu($db, $atarget, $type_user = 0, &$tabMenu, &$menu, $no // HRM $tmpentry = array( - 'enabled'=>(!empty($conf->hrm->enabled) || (!empty($conf->holiday->enabled)) || !empty($conf->deplacement->enabled) || !empty($conf->expensereport->enabled) || !empty($conf->recruitment->enabled)), - 'perms'=>(!empty($user->rights->user->user->lire) || !empty($user->rights->holiday->read) || !empty($user->rights->deplacement->lire) || !empty($user->rights->expensereport->lire) || !empty($user->rights->recruitment->recruitmentjobposition->read)), + 'enabled'=>(isModEnabled('hrm') || isModEnabled('holiday') || isModEnabled('deplacement') || isModEnabled('expensereport') || isModEnabled('recruitment')), + 'perms'=>($user->hasRight('user', 'user', 'lire') || $user->hasRight('holiday', 'read') || $user->hasRight('deplacement', 'lire') || $user->hasRight('expensereport', 'lire') || $user->hasRight('recruitment', 'recruitmentjobposition', 'read')), 'module'=>'hrm|holiday|deplacement|expensereport|recruitment' ); @@ -479,8 +446,8 @@ function print_oblyon_menu($db, $atarget, $type_user = 0, &$tabMenu, &$menu, $no // Tickets and knowledge base $tmpentry = array( - 'enabled'=>(!empty($conf->ticket->enabled) || !empty($conf->knowledgemanagement->enabled)), - 'perms'=>(!empty($user->rights->ticket->read) || !empty($user->rights->knowledgemanagement->knowledgerecord->read)), + 'enabled'=>(isModEnabled('ticket') || isModEnabled('knowledgemanagement')), + 'perms'=>($user->hasRight('ticket', 'read') || $user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')), 'module'=>'ticket|knowledgemanagement' ); @@ -500,7 +467,7 @@ function print_oblyon_menu($db, $atarget, $type_user = 0, &$tabMenu, &$menu, $no $chaine=$langs->trans("Tickets"); $link = ''; - if (!empty($conf->ticket->enabled)) { + if (isModEnabled('ticket')) { $link = '/ticket/index.php?mainmenu=ticket&leftmenu='; } else { $link = '/knowledgemanagement/knowledgerecord_list.php?mainmenu=ticket&leftmenu='; @@ -520,6 +487,7 @@ function print_oblyon_menu($db, $atarget, $type_user = 0, &$tabMenu, &$menu, $no for ($i = 0; $i < $num; $i++) { //var_dump($type_user.' '.$newTabMenu[$i]['url'].' '.$showmode.' '.$newTabMenu[$i]['perms']); $idsel = (empty($newTabMenu[$i]['mainmenu']) ? 'none' : $newTabMenu[$i]['mainmenu']); + $url = $shorturl = ''; $showmode=dol_oblyon_showmenu($type_user,$newTabMenu[$i],$listofmodulesforexternal); if ($showmode == 1) { @@ -555,8 +523,8 @@ function print_oblyon_menu($db, $atarget, $type_user = 0, &$tabMenu, &$menu, $no $shorturl, $newTabMenu[$i]['titre'], 0, $showmode, - ($newTabMenu[$i]['target'] ? $newTabMenu[$i]['target'] : $atarget), - ($newTabMenu[$i]['mainmenu'] ? $newTabMenu[$i]['mainmenu'] : $newTabMenu[$i]['rowid']), + $newTabMenu[$i]['target'] ? $newTabMenu[$i]['target'] : $atarget, + $newTabMenu[$i]['mainmenu'] ? $newTabMenu[$i]['mainmenu'] : $newTabMenu[$i]['rowid'], '' ); } @@ -722,7 +690,7 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta } // get landing page - $landingpage = (empty($user->conf->MAIN_LANDING_PAGE) ? (!getDolGlobalString('MAIN_LANDING_PAGE') ? '' : $conf->global->MAIN_LANDING_PAGE) : $user->conf->MAIN_LANDING_PAGE); + $landingpage = (empty($user->conf->MAIN_LANDING_PAGE) ? getDolGlobalString('MAIN_LANDING_PAGE', '') : $user->conf->MAIN_LANDING_PAGE); if (! empty($landingpage)) { $landingpage = str_replace(DOL_URL_ROOT, '', dol_buildpath($landingpage, 1)); } else { @@ -730,18 +698,13 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta } // Show logo company - if (! empty($menu_invert) && empty($noout) && ! empty($conf->global->MAIN_SHOW_LOGO)) { - //$mysoc->logo_mini=(empty($conf->global->MAIN_INFO_SOCIETE_LOGO_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI); - $mysoc->logo_squarred_mini=(empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI); + if (! empty($menu_invert) && empty($noout) && getDolGlobalString('MAIN_SHOW_LOGO')) { + $mysoc->logo_squarred_mini = getDolGlobalString('MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI', ''); if (! empty($mysoc->logo_squarred_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini)) { $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini); } - /*elseif (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) - { - $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini); - }*/ else { $urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png'; @@ -761,7 +724,7 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta if (getDolGlobalInt('OBLYON_SHOW_COMPNAME') && getDolGlobalString('MAIN_INFO_SOCIETE_NOM')) { if (! $menu_invert) { print '
'."\n"; - print ''. $conf->global->MAIN_INFO_SOCIETE_NOM .''."\n"; + print ''. getDolGlobalString('MAIN_INFO_SOCIETE_NOM') .''."\n"; print '
'."\n"; } } @@ -786,7 +749,7 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta $substitarray = getCommonSubstitutionArray($langs, 0, null, null); - $listofmodulesforexternal = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL); + $listofmodulesforexternal = explode(',', getDolGlobalString('MAIN_MODULES_FOR_EXTERNAL')); /** * We update newmenu with entries found into database @@ -812,14 +775,14 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta $langs->loadLangs(array("admin", "help")); $warnpicto = ''; - if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) { + if (!getDolGlobalString('MAIN_INFO_SOCIETE_NOM') || !getDolGlobalString('MAIN_INFO_SOCIETE_COUNTRY')) { $langs->load("errors"); $warnpicto = img_warning($langs->trans("WarningMandatorySetupNotComplete")); } $newmenu->add("/admin/company.php?mainmenu=home", $langs->trans("MenuCompanySetup").$warnpicto, 1); $warnpicto = ''; - if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING) ? 1 : $conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) { // If only user module enabled + if (count($conf->modules) <= getDolGlobalInt('MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING', 1)) { // If only user module enabled $langs->load("errors"); $warnpicto = img_warning($langs->trans("WarningMandatorySetupNotComplete")); } @@ -836,11 +799,7 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta $newmenu->add("/admin/pdf.php?mainmenu=home", $langs->trans("PDF"), 1); $warnpicto = ''; - if (!empty($conf->global->MAIN_MAIL_SENDMODE) && $conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) { - $langs->load("errors"); - $warnpicto = img_warning($langs->trans("WarningPHPMailD")); - } - if (!empty($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmail')) && empty($conf->global->MAIN_MAIL_SMTP_SERVER)) { + if (getDolGlobalString('MAIN_MAIL_SENDMODE') && in_array(getDolGlobalString('MAIN_MAIL_SENDMODE'), array('smtps', 'swiftmail')) && !getDolGlobalString('MAIN_MAIL_SMTP_SERVER')) { $langs->load("errors"); $warnpicto = img_warning($langs->trans("ErrorSetupOfEmailsNotComplete")); } @@ -885,30 +844,30 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta $newmenu->add('/admin/system/about.php?mainmenu=home&leftmenu=admintools', $langs->trans('ExternalResources'), 1); $newmenu->add('/cron/list.php?mainmenu=home&leftmenu=admintools', $langs->trans('CronList'), 1); - if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { + if (isModEnabled('product') || isModEnabled('service')) { $langs->load("products"); $newmenu->add("/product/admin/product_tools.php?mainmenu=home&leftmenu=admintools", $langs->trans("ProductVatMassChange"), 1, $user->admin); } } // Users & Groups - $newmenu->add("/user/home.php?leftmenu=users", $langs->trans("MenuUsersAndGroups"), 0, $user->rights->user->user->lire, '', $mainmenu, 'users', 0, '', '', '', img_picto('', 'user', 'class="paddingright pictofixedwidth"')); - if ($user->rights->user->user->lire) { + $newmenu->add("/user/home.php?leftmenu=users", $langs->trans("MenuUsersAndGroups"), 0, $user->hasRight('user', 'user', 'lire'), '', $mainmenu, 'users', 0, '', '', '', img_picto('', 'user', 'class="paddingright pictofixedwidth"')); + if ($user->hasRight('user', 'user', 'lire')) { if (! empty($menu_invert)) $leftmenu= 'users'; if ($usemenuhider || empty($leftmenu) || $leftmenu=="users") { - $newmenu->add("/user/list.php?leftmenu=users", $langs->trans("Users"), 1, $user->rights->user->user->lire || $user->admin); - $newmenu->add("/user/card.php?leftmenu=users&action=create", $langs->trans("NewUser"), 2, ($user->rights->user->user->creer || $user->admin) && !(!empty($conf->multicompany->enabled) && !empty($user->entity) && $conf->global->MULTICOMPANY_TRANSVERSE_MODE), '', 'home'); - $newmenu->add("/user/list.php?leftmenu=users", $langs->trans("ListOfUsers"), 2, $user->rights->user->user->lire || $user->admin); - $newmenu->add("/user/hierarchy.php?leftmenu=users", $langs->trans("HierarchicView"), 2, $user->rights->user->user->lire || $user->admin); - if (!empty($conf->categorie->enabled)) { + $newmenu->add("/user/list.php?leftmenu=users", $langs->trans("Users"), 1, $user->hasRight('user', 'user', 'lire') || $user->admin); + $newmenu->add("/user/card.php?leftmenu=users&action=create", $langs->trans("NewUser"), 2, ($user->hasRight('user', 'user', 'creer') || $user->admin) && !(!empty($conf->multicompany->enabled) && !empty($user->entity) && getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE')), '', 'home'); + $newmenu->add("/user/list.php?leftmenu=users", $langs->trans("ListOfUsers"), 2, $user->hasRight('user', 'user', 'lire') || $user->admin); + $newmenu->add("/user/hierarchy.php?leftmenu=users", $langs->trans("HierarchicView"), 2, $user->hasRight('user', 'user', 'lire') || $user->admin); + if (isModEnabled('categorie')) { $langs->load("categories"); - $newmenu->add("/categories/index.php?leftmenu=users&type=7", $langs->trans("UsersCategoriesShort"), 2, $user->rights->categorie->lire, '', $mainmenu, 'cat'); + $newmenu->add("/categories/index.php?leftmenu=users&type=7", $langs->trans("UsersCategoriesShort"), 2, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); } - $newmenu->add("/user/group/list.php?leftmenu=users", $langs->trans("Groups"), 1, ($user->rights->user->user->lire || $user->admin) && !(!empty($conf->multicompany->enabled) && !empty($user->entity) && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); - $newmenu->add("/user/group/card.php?leftmenu=users&action=create", $langs->trans("NewGroup"), 2, ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) ? $user->rights->user->group_advance->write : $user->rights->user->user->creer) || $user->admin) && !(!empty($conf->multicompany->enabled) && !empty($user->entity) && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); - $newmenu->add("/user/group/list.php?leftmenu=users", $langs->trans("ListOfGroups"), 2, ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) ? $user->rights->user->group_advance->read : $user->rights->user->user->lire) || $user->admin)); + $newmenu->add("/user/group/list.php?leftmenu=users", $langs->trans("Groups"), 1, ($user->hasRight('user', 'user', 'lire') || $user->admin) && !(!empty($conf->multicompany->enabled) && !empty($user->entity) && getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE'))); + $newmenu->add("/user/group/card.php?leftmenu=users&action=create", $langs->trans("NewGroup"), 2, ((getDolGlobalString('MAIN_USE_ADVANCED_PERMS') ? $user->hasRight('user', 'group_advance', 'write') : $user->hasRight('user', 'user', 'creer')) || $user->admin) && !(!empty($conf->multicompany->enabled) && !empty($user->entity) && getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE'))); + $newmenu->add("/user/group/list.php?leftmenu=users", $langs->trans("ListOfGroups"), 2, ((getDolGlobalString('MAIN_USE_ADVANCED_PERMS') ? $user->hasRight('user', 'group_advance', 'read'): $user->hasRight('user', 'user', 'lire')) || $user->admin)); } } } @@ -919,11 +878,11 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta */ if ($mainmenu == 'companies') { // Societes - if (!empty($conf->societe->enabled)) { + if (isModEnabled('societe')) { $langs->load("companies"); - $newmenu->add("/societe/index.php?leftmenu=thirdparties", $langs->trans("ThirdParty"), 0, $user->rights->societe->lire, '', $mainmenu, 'thirdparties'); + $newmenu->add("/societe/index.php?leftmenu=thirdparties", $langs->trans("ThirdParty"), 0, $user->hasRight('societe', 'lire'), '', $mainmenu, 'thirdparties'); - if ($user->rights->societe->creer) { + if ($user->hasRight('societe', 'creer')) { $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); @@ -931,79 +890,72 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta } } - $newmenu->add("/societe/list.php?leftmenu=thirdparties", $langs->trans("List"), 1); + $newmenu->add("/societe/list.php?leftmenu=thirdparties", $langs->trans("List"), 1, $user->hasRight('societe', 'lire'), '', $mainmenu, 'thirdparties_list', 2); // Prospects - if (!empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { + if (isModEnabled('societe') && !getDolGlobalString('SOCIETE_DISABLE_PROSPECTS')) { $langs->load("commercial"); - $newmenu->add("/societe/list.php?type=p&leftmenu=prospects", $langs->trans("ListProspectsShort"), 2, $user->rights->societe->lire, '', $mainmenu, 'prospects'); - /* no more required, there is a filter that can do more - if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=-1", $langs->trans("LastProspectDoNotContact"), 2, $user->rights->societe->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=0", $langs->trans("LastProspectNeverContacted"), 2, $user->rights->societe->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=1", $langs->trans("LastProspectToContact"), 2, $user->rights->societe->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=2", $langs->trans("LastProspectContactInProcess"), 2, $user->rights->societe->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=3", $langs->trans("LastProspectContactDone"), 2, $user->rights->societe->lire); - */ - $newmenu->add("/societe/card.php?leftmenu=prospects&action=create&type=p", $langs->trans("MenuNewProspect"), 3, $user->rights->societe->creer); + $newmenu->add("/societe/list.php?type=p&leftmenu=prospects", $langs->trans("Prospects"), 2, $user->hasRight('societe', 'lire'), '', $mainmenu, 'prospects'); + $newmenu->add("/societe/card.php?leftmenu=prospects&action=create&type=p", $langs->trans("MenuNewProspect"), 3, $user->hasRight('societe', 'creer')); } // Customers/Prospects - if (!empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { + if (isModEnabled('societe') && !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS')) { $langs->load("commercial"); - $newmenu->add("/societe/list.php?type=c&leftmenu=customers", $langs->trans("ListCustomersShort"), 2, $user->rights->societe->lire, '', $mainmenu, 'customers'); + $newmenu->add("/societe/list.php?type=c&leftmenu=customers", $langs->trans("Customers"), 2, $user->hasRight('societe', 'lire'), '', $mainmenu, 'customers'); - $newmenu->add("/societe/card.php?leftmenu=customers&action=create&type=c", $langs->trans("MenuNewCustomer"), 3, $user->rights->societe->creer); + $newmenu->add("/societe/card.php?leftmenu=customers&action=create&type=c", $langs->trans("MenuNewCustomer"), 3, $user->hasRight('societe', 'creer')); } // Suppliers - if (!empty($conf->societe->enabled) && (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) || !empty($conf->supplier_proposal->enabled))) { + if (isModEnabled('societe') && (((isModEnabled('fournisseur') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) || isModEnabled('supplier_proposal'))) { $langs->load("suppliers"); - $newmenu->add("/societe/list.php?type=f&leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 2, ($user->rights->fournisseur->lire || $user->rights->supplier_order->lire || $user->rights->supplier_invoice->lire || $user->rights->supplier_proposal->lire), '', $mainmenu, 'suppliers'); - $newmenu->add("/societe/card.php?leftmenu=suppliers&action=create&type=f", $langs->trans("MenuNewSupplier"), 3, $user->rights->societe->creer && ($user->rights->fournisseur->lire || $user->rights->supplier_order->lire || $user->rights->supplier_invoice->lire || $user->rights->supplier_proposal->lire)); + $newmenu->add("/societe/list.php?type=f&leftmenu=suppliers", $langs->trans("Suppliers"), 2, ($user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire')), '', $mainmenu, 'suppliers'); + $newmenu->add("/societe/card.php?leftmenu=suppliers&action=create&type=f", $langs->trans("MenuNewSupplier"), 3, $user->hasRight('societe', 'creer') && ($user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire'))); } // Categories - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { $langs->load("categories"); - if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { + if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTS') || !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS')) { // Categories prospects/customers $menutoshow = $langs->trans("CustomersProspectsCategoriesShort"); - if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { + if (getDolGlobalString('SOCIETE_DISABLE_PROSPECTS')) { $menutoshow = $langs->trans("CustomersCategoriesShort"); } - if (!empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { + if (getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS')) { $menutoshow = $langs->trans("ProspectsCategoriesShort"); } - $newmenu->add("/categories/index.php?leftmenu=cat&type=2", $menutoshow, 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); + $newmenu->add("/categories/index.php?leftmenu=cat&type=2", $menutoshow, 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); } // Categories suppliers - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { - $newmenu->add("/categories/index.php?leftmenu=catfournish&type=1", $langs->trans("SuppliersCategoriesShort"), 1, $user->rights->categorie->lire); + if (isModEnabled('fournisseur') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) { + $newmenu->add("/categories/index.php?leftmenu=catfournish&type=1", $langs->trans("SuppliersCategoriesShort"), 1, $user->hasRight('categorie', 'lire')); } } // Contacts - $newmenu->add("/societe/index.php?leftmenu=thirdparties", (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")), 0, $user->rights->societe->contact->lire, '', $mainmenu, 'contacts'); + $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'); - $newmenu->add("/contact/card.php?leftmenu=contacts&action=create", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress")), 1, $user->rights->societe->contact->creer); - $newmenu->add("/contact/list.php?leftmenu=contacts", $langs->trans("List"), 1, $user->rights->societe->contact->lire); - if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { - $newmenu->add("/contact/list.php?leftmenu=contacts&type=p", $langs->trans("Prospects"), 2, $user->rights->societe->contact->lire); + $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')); + $newmenu->add("/contact/list.php?leftmenu=contacts", $langs->trans("List"), 1, $user->hasRight('societe', 'contact', 'lire')); + if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTS')) { + $newmenu->add("/contact/list.php?leftmenu=contacts&type=p", $langs->trans("Prospects"), 2, $user->hasRight('societe', 'contact', 'lire')); } - if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { - $newmenu->add("/contact/list.php?leftmenu=contacts&type=c", $langs->trans("Customers"), 2, $user->rights->societe->contact->lire); + if (!getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS')) { + $newmenu->add("/contact/list.php?leftmenu=contacts&type=c", $langs->trans("Customers"), 2, $user->hasRight('societe', 'contact', 'lire')); } - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { - $newmenu->add("/contact/list.php?leftmenu=contacts&type=f", $langs->trans("Suppliers"), 2, $user->rights->societe->contact->lire); + if (isModEnabled('fournisseur') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) { + $newmenu->add("/contact/list.php?leftmenu=contacts&type=f", $langs->trans("Suppliers"), 2, $user->hasRight('societe', 'contact', 'lire')); } - $newmenu->add("/contact/list.php?leftmenu=contacts&type=o", $langs->trans("ContactOthers"), 2, $user->rights->societe->contact->lire); - //$newmenu->add("/contact/list.php?userid=$user->id", $langs->trans("MyContacts"), 1, $user->rights->societe->contact->lire); + $newmenu->add("/contact/list.php?leftmenu=contacts&type=o", $langs->trans("ContactOthers"), 2, $user->hasRight('societe', 'contact', 'lire')); + //$newmenu->add("/contact/list.php?userid=$user->id", $langs->trans("MyContacts"), 1, $user->hasRight('societe', 'contact', 'lire')); // Categories - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { $langs->load("categories"); // Categories Contact - $newmenu->add("/categories/index.php?leftmenu=catcontact&type=4", $langs->trans("ContactCategoriesShort"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); + $newmenu->add("/categories/index.php?leftmenu=catcontact&type=4", $langs->trans("ContactCategoriesShort"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); } } @@ -1014,91 +966,91 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta $langs->load("companies"); // Customer proposal - if (!empty($conf->propal->enabled)) { + if (isModEnabled('propal')) { $langs->load("propal"); - $newmenu->add("/comm/propal/index.php?leftmenu=propals", $langs->trans("Proposals"), 0, $user->rights->propale->lire, '', $mainmenu, 'propals', 100, '', '', '', img_picto('', 'propal', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/comm/propal/card.php?action=create&leftmenu=propals", $langs->trans("NewPropal"), 1, $user->rights->propale->creer); - $newmenu->add("/comm/propal/list.php?leftmenu=propals", $langs->trans("List"), 1, $user->rights->propale->lire); + $newmenu->add("/comm/propal/index.php?leftmenu=propals", $langs->trans("Proposals"), 0, $user->hasRight('propale', 'lire'), '', $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('propale', 'creer')); + $newmenu->add("/comm/propal/list.php?leftmenu=propals", $langs->trans("List"), 1, $user->hasRight('propale', 'lire')); if (! empty($menu_invert)) $leftmenu= 'propals'; if ($usemenuhider || empty($leftmenu) || $leftmenu == "propals") { - $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=0", $langs->trans("PropalsDraft"), 2, $user->rights->propale->lire); - $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=1", $langs->trans("PropalsOpened"), 2, $user->rights->propale->lire); - $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=2", $langs->trans("PropalStatusSigned"), 2, $user->rights->propale->lire); - $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=3", $langs->trans("PropalStatusNotSigned"), 2, $user->rights->propale->lire); - $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=4", $langs->trans("PropalStatusBilled"), 2, $user->rights->propale->lire); - //$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=2,3,4", $langs->trans("PropalStatusClosedShort"), 2, $user->rights->propale->lire); + $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=0", $langs->trans("PropalsDraft"), 2, $user->hasRight('propale', 'lire')); + $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=1", $langs->trans("PropalsOpened"), 2, $user->hasRight('propale', 'lire')); + $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=2", $langs->trans("PropalStatusSigned"), 2, $user->hasRight('propale', 'lire')); + $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=3", $langs->trans("PropalStatusNotSigned"), 2, $user->hasRight('propale', 'lire')); + $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=4", $langs->trans("PropalStatusBilled"), 2, $user->hasRight('propale', 'lire')); + //$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=2,3,4", $langs->trans("PropalStatusClosedShort"), 2, $user->hasRight('propale', 'lire')); } - $newmenu->add("/comm/propal/stats/index.php?leftmenu=propals", $langs->trans("Statistics"), 1, $user->rights->propale->lire); + $newmenu->add("/comm/propal/stats/index.php?leftmenu=propals", $langs->trans("Statistics"), 1, $user->hasRight('propale', 'lire')); } // Customers orders - if (! empty($conf->commande->enabled)) + if (isModEnabled('commande')) { $langs->load("orders"); - $newmenu->add("/commande/index.php?leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders', 200); - $newmenu->add("/commande/card.php?action=create&leftmenu=orders", $langs->trans("NewOrder"), 1, $user->rights->commande->creer); - $newmenu->add("/commande/list.php?leftmenu=orders", $langs->trans("List"), 1, $user->rights->commande->lire); + $newmenu->add("/commande/index.php?leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 200); + $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')); if (! empty($menu_invert)) $leftmenu= 'orders'; if ($usemenuhider || empty($leftmenu) || $leftmenu == "orders") { - $newmenu->add("/commande/list.php?leftmenu=orders&search_status=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->commande->lire); - $newmenu->add("/commande/list.php?leftmenu=orders&search_status=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->commande->lire); - if (!empty($conf->expedition->enabled)) { - $newmenu->add("/commande/list.php?leftmenu=orders&search_status=2", $langs->trans("StatusOrderSentShort"), 2, $user->rights->commande->lire); + $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')); + if (isModEnabled('expedition')) { + $newmenu->add("/commande/list.php?leftmenu=orders&search_status=2", $langs->trans("StatusOrderSentShort"), 2, $user->hasRight('commande', 'lire')); } - $newmenu->add("/commande/list.php?leftmenu=orders&search_status=3", $langs->trans("StatusOrderDelivered"), 2, $user->rights->commande->lire); - //$newmenu->add("/commande/list.php?leftmenu=orders&search_status=4", $langs->trans("StatusOrderProcessed"), 2, $user->rights->commande->lire); - $newmenu->add("/commande/list.php?leftmenu=orders&search_status=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->rights->commande->lire); + $newmenu->add("/commande/list.php?leftmenu=orders&search_status=3", $langs->trans("StatusOrderDelivered"), 2, $user->hasRight('commande', 'lire')); + //$newmenu->add("/commande/list.php?leftmenu=orders&search_status=4", $langs->trans("StatusOrderProcessed"), 2, $user->hasRight('commande', 'lire')); + $newmenu->add("/commande/list.php?leftmenu=orders&search_status=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->hasRight('commande', 'lire')); } - $newmenu->add("/commande/stats/index.php?leftmenu=orders", $langs->trans("Statistics"), 1, $user->rights->commande->lire); + $newmenu->add("/commande/stats/index.php?leftmenu=orders", $langs->trans("Statistics"), 1, $user->hasRight('commande', 'lire')); } // Supplier proposal - if (!empty($conf->supplier_proposal->enabled)) { + if (isModEnabled('supplier_proposal')) { $langs->load("supplier_proposal"); - $newmenu->add("/supplier_proposal/index.php?leftmenu=propals_supplier", $langs->trans("SupplierProposalsShort"), 0, $user->rights->supplier_proposal->lire, '', $mainmenu, 'propals_supplier', 300); - $newmenu->add("/supplier_proposal/card.php?action=create&leftmenu=supplier_proposals", $langs->trans("SupplierProposalNew"), 1, $user->rights->supplier_proposal->creer); - $newmenu->add("/supplier_proposal/list.php?leftmenu=supplier_proposals", $langs->trans("List"), 1, $user->rights->supplier_proposal->lire); - $newmenu->add("/comm/propal/stats/index.php?leftmenu=supplier_proposals&mode=supplier", $langs->trans("Statistics"), 1, $user->rights->supplier_proposal->lire); + $newmenu->add("/supplier_proposal/index.php?leftmenu=propals_supplier", $langs->trans("SupplierProposalsShort"), 0, $user->hasRight('supplier_proposal', 'lire'), '', $mainmenu, 'propals_supplier', 300); + $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')); } // Suppliers orders - if (!empty($conf->supplier_order->enabled)) { + if (isModEnabled('supplier_order')) { $langs->load("orders"); - $newmenu->add("/fourn/commande/index.php?leftmenu=orders_suppliers", $langs->trans("SuppliersOrders"), 0, $user->rights->fournisseur->commande->lire, '', $mainmenu, 'orders_suppliers', 400); - $newmenu->add("/fourn/commande/card.php?action=create&leftmenu=orders_suppliers", $langs->trans("NewSupplierOrderShort"), 1, $user->rights->fournisseur->commande->creer); - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers", $langs->trans("List"), 1, $user->rights->fournisseur->commande->lire); + $newmenu->add("/fourn/commande/index.php?leftmenu=orders_suppliers", $langs->trans("SuppliersOrders"), 0, $user->hasRight('fournisseur', 'commande', 'lire'), '', $mainmenu, 'orders_suppliers', 400); + $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')); if (! empty($menu_invert)) $leftmenu= 'orders_suppliers'; if ($usemenuhider || empty($leftmenu) || $leftmenu == "orders_suppliers") { - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=0", $langs->trans("StatusSupplierOrderDraftShort"), 2, $user->rights->fournisseur->commande->lire); - if (empty($conf->global->SUPPLIER_ORDER_HIDE_VALIDATED)) { - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=1", $langs->trans("StatusSupplierOrderValidated"), 2, $user->rights->fournisseur->commande->lire); + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=0", $langs->trans("StatusSupplierOrderDraftShort"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); + if (!getDolGlobalString('SUPPLIER_ORDER_HIDE_VALIDATED')) { + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=1", $langs->trans("StatusSupplierOrderValidated"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); } - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=2", $langs->trans("StatusSupplierOrderApprovedShort"), 2, $user->rights->fournisseur->commande->lire); - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=3", $langs->trans("StatusSupplierOrderOnProcessShort"), 2, $user->rights->fournisseur->commande->lire); - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=4", $langs->trans("StatusSupplierOrderReceivedPartiallyShort"), 2, $user->rights->fournisseur->commande->lire); - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=5", $langs->trans("StatusSupplierOrderReceivedAll"), 2, $user->rights->fournisseur->commande->lire); - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=6,7", $langs->trans("StatusSupplierOrderCanceled"), 2, $user->rights->fournisseur->commande->lire); - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=9", $langs->trans("StatusSupplierOrderRefused"), 2, $user->rights->fournisseur->commande->lire); + $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')); } - // 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->rights->fournisseur->commande->lire); + // 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')); - $newmenu->add("/commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier", $langs->trans("Statistics"), 1, $user->rights->fournisseur->commande->lire); + $newmenu->add("/commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier", $langs->trans("Statistics"), 1, $user->hasRight('fournisseur', 'commande', 'lire')); } // Contract - if (!empty($conf->contrat->enabled)) { + if (isModEnabled('contrat')) { $langs->load("contracts"); - $newmenu->add("/contrat/index.php?leftmenu=contracts", $langs->trans("ContractsSubscriptions"), 0, $user->rights->contrat->lire, '', $mainmenu, 'contracts', 2000); - $newmenu->add("/contrat/card.php?action=create&leftmenu=contracts", $langs->trans("NewContractSubscription"), 1, $user->rights->contrat->creer); - $newmenu->add("/contrat/list.php?leftmenu=contracts", $langs->trans("List"), 1, $user->rights->contrat->lire); - $newmenu->add("/contrat/services_list.php?leftmenu=contracts", $langs->trans("MenuServices"), 1, $user->rights->contrat->lire); + $newmenu->add("/contrat/index.php?leftmenu=contracts", $langs->trans("ContractsSubscriptions"), 0, $user->hasRight('contrat', 'lire'), '', $mainmenu, 'contracts', 2000); + $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')); if (!empty($menu_invert)) { $leftmenu = 'contracts'; @@ -1106,29 +1058,29 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta if ($usemenuhider || empty($leftmenu) || $leftmenu == "contracts") { if ((float) DOL_VERSION >= 18.0) { - $newmenu->add("/contrat/services_list.php?leftmenu=contracts&search_status=0", $langs->trans("MenuInactiveServices"), 2, $user->rights->contrat->lire); - $newmenu->add("/contrat/services_list.php?leftmenu=contracts&search_status=4", $langs->trans("MenuRunningServices"), 2, $user->rights->contrat->lire); - $newmenu->add("/contrat/services_list.php?leftmenu=contracts&search_status=4%26filter=expired", $langs->trans("MenuExpiredServices"), 2, $user->rights->contrat->lire); - $newmenu->add("/contrat/services_list.php?leftmenu=contracts&search_status=5", $langs->trans("MenuClosedServices"), 2, $user->rights->contrat->lire); + $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')); + $newmenu->add("/contrat/services_list.php?leftmenu=contracts&search_status=4%26filter=expired", $langs->trans("MenuExpiredServices"), 2, $user->hasRight('contrat', 'lire')); + $newmenu->add("/contrat/services_list.php?leftmenu=contracts&search_status=5", $langs->trans("MenuClosedServices"), 2, $user->hasRight('contrat', 'lire')); } else { - $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=0", $langs->trans("MenuInactiveServices"), 2, $user->rights->contrat->lire); - $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=4", $langs->trans("MenuRunningServices"), 2, $user->rights->contrat->lire); - $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=4&filter=expired", $langs->trans("MenuExpiredServices"), 2, $user->rights->contrat->lire); - $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=5", $langs->trans("MenuClosedServices"), 2, $user->rights->contrat->lire); + $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=0", $langs->trans("MenuInactiveServices"), 2, $user->hasRight('contrat', 'lire')); + $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=4", $langs->trans("MenuRunningServices"), 2, $user->hasRight('contrat', 'lire')); + $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=4&filter=expired", $langs->trans("MenuExpiredServices"), 2, $user->hasRight('contrat', 'lire')); + $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=5", $langs->trans("MenuClosedServices"), 2, $user->hasRight('contrat', 'lire')); } } } // Interventions - if (!empty($conf->ficheinter->enabled)) { + if (isModEnabled('ficheinter')) { $langs->load("interventions"); - $newmenu->add("/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->rights->ficheinter->lire, '', $mainmenu, 'ficheinter', 2200); - $newmenu->add("/fichinter/card.php?action=create&leftmenu=ficheinter", $langs->trans("NewIntervention"), 1, $user->rights->ficheinter->creer, '', '', '', 201); - $newmenu->add("/fichinter/list.php?leftmenu=ficheinter", $langs->trans("List"), 1, $user->rights->ficheinter->lire, '', '', '', 202); - if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { - $newmenu->add("/fichinter/card-rec.php?leftmenu=ficheinter", $langs->trans("ListOfTemplates"), 1, $user->rights->ficheinter->lire, '', '', '', 203); + $newmenu->add("/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->hasRight('ficheinter', 'lire'), '', $mainmenu, 'ficheinter', 2200); + $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); + if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 2) { + $newmenu->add("/fichinter/card-rec.php?leftmenu=ficheinter", $langs->trans("ListOfTemplates"), 1, $user->hasRight('ficheinter', 'lire'), '', '', '', 203); } - $newmenu->add("/fichinter/stats/index.php?leftmenu=ficheinter", $langs->trans("Statistics"), 1, $user->rights->ficheinter->lire); + $newmenu->add("/fichinter/stats/index.php?leftmenu=ficheinter", $langs->trans("Statistics"), 1, $user->hasRight('ficheinter', 'lire')); } } @@ -1140,130 +1092,130 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta $langs->load("companies"); // Customers invoices - if (!empty($conf->facture->enabled)) { + if (isModEnabled('facture')) { $langs->load("bills"); - $newmenu->add("/compta/facture/index.php?leftmenu=customers_bills", $langs->trans("BillsCustomers"), 0, $user->rights->facture->lire, '', $mainmenu, 'customers_bills', 0); - $newmenu->add("/compta/facture/card.php?action=create", $langs->trans("NewBill"), 1, $user->rights->facture->creer); - $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills", $langs->trans("List"), 1, $user->rights->facture->lire, '', $mainmenu, 'customers_bills_list'); + $newmenu->add("/compta/facture/index.php?leftmenu=customers_bills", $langs->trans("BillsCustomers"), 0, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills', 0); + $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'); if (! empty($menu_invert)) $leftmenu= 'customers_bills'; if ($usemenuhider || empty($leftmenu) || preg_match('/customers_bills(|_draft|_notpaid|_paid|_canceled)$/', $leftmenu)) { - $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_draft&search_status=0", $langs->trans("BillShortStatusDraft"), 2, $user->rights->facture->lire); - $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_notpaid&search_status=1", $langs->trans("BillShortStatusNotPaid"), 2, $user->rights->facture->lire); - $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_paid&search_status=2", $langs->trans("BillShortStatusPaid"), 2, $user->rights->facture->lire); - $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_canceled&search_status=3", $langs->trans("BillShortStatusCanceled"), 2, $user->rights->facture->lire); + $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')); } - $newmenu->add("/compta/facture/invoicetemplate_list.php?leftmenu=customers_bills_templates", $langs->trans("ListOfTemplates"), 1, $user->rights->facture->creer, '', $mainmenu, 'customers_bills_templates'); // No need to see recurring invoices, if user has no permission to create invoice. + $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. - $newmenu->add("/compta/paiement/list.php?leftmenu=customers_bills_payment", $langs->trans("Payments"), 1, $user->rights->facture->lire, '', $mainmenu, 'customers_bills_payment'); + $newmenu->add("/compta/paiement/list.php?leftmenu=customers_bills_payment", $langs->trans("Payments"), 1, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_payment'); - if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { - $newmenu->add("/compta/paiement/tovalidate.php?leftmenu=customers_bills_tovalid", $langs->trans("MenuToValid"), 2, $user->rights->facture->lire, '', $mainmenu, 'customer_bills_tovalid'); + if (getDolGlobalString('BILL_ADD_PAYMENT_VALIDATION')) { + $newmenu->add("/compta/paiement/tovalidate.php?leftmenu=customers_bills_tovalid", $langs->trans("MenuToValid"), 2, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customer_bills_tovalid'); } if ($usemenuhider || empty($leftmenu) || preg_match('/customers_bills/', $leftmenu)) { - $newmenu->add("/compta/paiement/rapport.php?leftmenu=customers_bills_payment_report", $langs->trans("Reportings"), 2, $user->rights->facture->lire, '', $mainmenu, 'customers_bills_payment_report'); + $newmenu->add("/compta/paiement/rapport.php?leftmenu=customers_bills_payment_report", $langs->trans("Reportings"), 2, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_payment_report'); } - $newmenu->add("/compta/facture/stats/index.php?leftmenu=customers_bills_stats", $langs->trans("Statistics"), 1, $user->rights->facture->lire, '', $mainmenu, 'customers_bills_stats'); + $newmenu->add("/compta/facture/stats/index.php?leftmenu=customers_bills_stats", $langs->trans("Statistics"), 1, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_stats'); } // Suppliers invoices - if (!empty($conf->societe->enabled) && !empty($conf->supplier_invoice->enabled)) { + if (isModEnabled('societe') && isModEnabled('supplier_invoice')) { $langs->load("bills"); - $newmenu->add("/fourn/facture/index.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"), 0, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills', 0); - $newmenu->add("/fourn/facture/card.php?leftmenu=suppliers_bills&action=create", $langs->trans("NewBill"), 1, ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer), '', $mainmenu, 'suppliers_bills_create'); - $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("List"), 1, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_list'); + $newmenu->add("/fourn/facture/index.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"), 0, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills', 0); + $newmenu->add("/fourn/facture/card.php?leftmenu=suppliers_bills&action=create", $langs->trans("NewBill"), 1, ($user->hasRight('fournisseur', 'facture', 'creer') || $user->hasRight('supplier_invoice', 'creer')), '', $mainmenu, 'suppliers_bills_create'); + $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("List"), 1, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_list'); if (! empty($menu_invert)) $leftmenu= 'suppliers_bills'; if ($usemenuhider || empty($leftmenu) || preg_match('/suppliers_bills/', $leftmenu)) { - $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_draft&search_status=0", $langs->trans("BillShortStatusDraft"), 2, $user->rights->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->rights->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->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_paid'); + $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'); } if ((float) DOL_VERSION >= 16.0) { - $newmenu->add("/fourn/facture/list-rec.php?leftmenu=supplierinvoicestemplate_list", $langs->trans("ListOfTemplates"), 1, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'supplierinvoicestemplate_list'); + $newmenu->add("/fourn/facture/list-rec.php?leftmenu=supplierinvoicestemplate_list", $langs->trans("ListOfTemplates"), 1, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'supplierinvoicestemplate_list'); } - $newmenu->add("/fourn/paiement/list.php?leftmenu=suppliers_bills_payment", $langs->trans("Payments"), 1, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_payment'); + $newmenu->add("/fourn/paiement/list.php?leftmenu=suppliers_bills_payment", $langs->trans("Payments"), 1, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_payment'); if ($usemenuhider || empty($leftmenu) || preg_match('/suppliers_bills/', $leftmenu)) { - $newmenu->add("/fourn/facture/rapport.php?leftmenu=suppliers_bills_payment_report", $langs->trans("Reportings"), 2, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_payment_report'); + $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'); } - $newmenu->add("/compta/facture/stats/index.php?mode=supplier&leftmenu=suppliers_bills_stats", $langs->trans("Statistics"), 1, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_stats'); + $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'); } // Orders - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { $langs->load("orders"); - if (!empty($conf->facture->enabled)) { - $newmenu->add("/commande/list.php?leftmenu=orders&search_status=-3&search_billed=0&contextpage=billableorders", $langs->trans("MenuOrdersToBill2"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders', 0); + if (isModEnabled('facture')) { + $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); } - //if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire); + //if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->hasRight('commande', 'lire')); } // Supplier Orders to bill - if (!empty($conf->supplier_invoice->enabled)) { - if (!empty($conf->global->SUPPLIER_MENU_ORDER_RECEIVED_INTO_INVOICE)) { + if (isModEnabled('supplier_invoice')) { + if (getDolGlobalString('SUPPLIER_MENU_ORDER_RECEIVED_INTO_INVOICE')) { $langs->load("supplier"); - $newmenu->add("/fourn/commande/list.php?leftmenu=orders&search_status=5&search_billed=0", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders', 0); - //if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire); + $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); + //if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->hasRight('commande', 'lire')); } } // Donations - if (!empty($conf->don->enabled)) { + if (isModEnabled('don')) { $langs->load("donations"); - $newmenu->add("/don/index.php?leftmenu=donations&mainmenu=billing",$langs->trans("Donations"), 0, $user->rights->don->lire, '', $mainmenu, 'donations'); + $newmenu->add("/don/index.php?leftmenu=donations&mainmenu=billing",$langs->trans("Donations"), 0, $user->hasRight('don', 'lire'), '', $mainmenu, 'donations'); if (! empty($menu_invert)) $leftmenu= 'donations'; if ($usemenuhider || empty($leftmenu) || $leftmenu == "donations") { - $newmenu->add("/don/card.php?leftmenu=donations&action=create", $langs->trans("NewDonation"), 1, $user->rights->don->creer); - $newmenu->add("/don/list.php?leftmenu=donations", $langs->trans("List"), 1, $user->rights->don->lire); + $newmenu->add("/don/card.php?leftmenu=donations&action=create", $langs->trans("NewDonation"), 1, $user->hasRight('don', 'creer')); + $newmenu->add("/don/list.php?leftmenu=donations", $langs->trans("List"), 1, $user->hasRight('don', 'lire')); } - // if ($leftmenu=="donations") $newmenu->add("/don/stats/index.php",$langs->trans("Statistics"), 1, $user->rights->don->lire); + // if ($leftmenu=="donations") $newmenu->add("/don/stats/index.php",$langs->trans("Statistics"), 1, $user->hasRight('don', 'lire')); } // Taxes and social contributions - if (! empty($conf->tax->enabled) || ! empty($conf->salaries->enabled) || ! empty($conf->loan->enabled) || ! empty($conf->banque->enabled)) + if (isModEnabled('tax') || isModEnabled('salaries') || isModEnabled('loan') || isModEnabled('banque')) { global $mysoc; $langs->load("compta"); - $permtoshowmenu=((! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) || (! empty($conf->loan->enabled) && $user->rights->loan->read) || (! empty($conf->banque->enabled) && $user->rights->banque->lire)); + $permtoshowmenu=((isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) || (isModEnabled('salaries') && $user->hasRight('salaries', 'read')) || (isModEnabled('loan') && $user->hasRight('loan', 'read')) || (isModEnabled('banque') && $user->hasRight('banque', 'lire'))); $newmenu->add("/compta/charges/index.php?leftmenu=tax&mainmenu=billing",$langs->trans("MenuSpecialExpenses"), 0, $permtoshowmenu, '', $mainmenu, 'tax'); // Social contributions - if (! empty($conf->tax->enabled)) + if (isModEnabled('tax')) { - $newmenu->add("/compta/sociales/list.php?leftmenu=tax_social",$langs->trans("MenuSocialContributions"),1,$user->rights->tax->charges->lire); + $newmenu->add("/compta/sociales/list.php?leftmenu=tax_social",$langs->trans("MenuSocialContributions"),1,$user->hasRight('tax', 'charges', 'lire')); if (! empty($menu_invert)) $leftmenu= 'tax_social'; if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i', $leftmenu)) { - $newmenu->add("/compta/sociales/card.php?leftmenu=tax_social&action=create", $langs->trans("MenuNewSocialContribution"), 2, $user->rights->tax->charges->creer); - $newmenu->add("/compta/sociales/list.php?leftmenu=tax_social", $langs->trans("List"), 2, $user->rights->tax->charges->lire); - $newmenu->add("/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=billing", $langs->trans("Payments"), 2, $user->rights->tax->charges->lire); + $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')); } // VAT - if (empty($conf->global->TAX_DISABLE_VAT_MENUS)) + if (!getDolGlobalString('TAX_DISABLE_VAT_MENUS')) { - $newmenu->add("/compta/tva/list.php?leftmenu=tax_vat&mainmenu=billing",$langs->transcountry("MenuVAT", $mysoc->country_code),1,$user->rights->tax->charges->lire, '', $mainmenu, 'tax_vat'); + $newmenu->add("/compta/tva/list.php?leftmenu=tax_vat&mainmenu=billing",$langs->transcountry("MenuVAT", $mysoc->country_code),1,$user->hasRight('tax', 'charges', 'lire'), '', $mainmenu, 'tax_vat'); if (! empty($menu_invert)) $leftmenu= 'tax_vat'; if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i', $leftmenu)) { - $newmenu->add("/compta/tva/card.php?leftmenu=tax_vat&action=create", $langs->trans("New"), 2, $user->rights->tax->charges->creer); - $newmenu->add("/compta/tva/list.php?leftmenu=tax_vat", $langs->trans("List"), 2, $user->rights->tax->charges->lire); - $newmenu->add("/compta/tva/payments.php?mode=tvaonly&leftmenu=tax_vat", $langs->trans("Payments"), 2, $user->rights->tax->charges->lire); - $newmenu->add("/compta/tva/index.php?leftmenu=tax_vat", $langs->trans("ReportByMonth"), 2, $user->rights->tax->charges->lire); - $newmenu->add("/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByThirdparties"), 2, $user->rights->tax->charges->lire); - $newmenu->add("/compta/tva/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire); + $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')); } global $mysoc; @@ -1271,75 +1223,75 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta // Local Taxes 1 if($mysoc->useLocalTax(1) && (isset($mysoc->localtax1_assuj) && $mysoc->localtax1_assuj=="1")) { - $newmenu->add("/compta/localtax/list.php?leftmenu=tax_1_vat&mainmenu=billing&localTaxType=1",$langs->transcountry("LT1",$mysoc->country_code),1,$user->rights->tax->charges->lire); + $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')); if (! empty($menu_invert)) $leftmenu= 'tax_1_vat'; if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_1_vat/i', $leftmenu)) { - $newmenu->add("/compta/localtax/card.php?leftmenu=tax_1_vat&action=create&localTaxType=1", $langs->trans("New"), 2, $user->rights->tax->charges->creer); - $newmenu->add("/compta/localtax/list.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("List"), 2, $user->rights->tax->charges->lire); - $newmenu->add("/compta/localtax/index.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByMonth"), 2, $user->rights->tax->charges->lire); - $newmenu->add("/compta/localtax/clients.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByThirdparties"), 2, $user->rights->tax->charges->lire); - $newmenu->add("/compta/localtax/quadri_detail.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire); + $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')); } } // Local Taxes 2 if($mysoc->useLocalTax(2) && (isset($mysoc->localtax2_assuj) && $mysoc->localtax2_assuj=="1")) { - $newmenu->add("/compta/localtax/list.php?leftmenu=tax_2_vat&mainmenu=billing&localTaxType=2",$langs->transcountry("LT2",$mysoc->country_code),1,$user->rights->tax->charges->lire); + $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')); if (! empty($menu_invert)) $leftmenu= 'tax_2_vat'; if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_2_vat/i', $leftmenu)) { - $newmenu->add("/compta/localtax/card.php?leftmenu=tax_2_vat&action=create&localTaxType=2", $langs->trans("New"), 2, $user->rights->tax->charges->creer); - $newmenu->add("/compta/localtax/list.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("List"), 2, $user->rights->tax->charges->lire); - $newmenu->add("/compta/localtax/index.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByMonth"), 2, $user->rights->tax->charges->lire); - $newmenu->add("/compta/localtax/clients.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByThirdparties"), 2, $user->rights->tax->charges->lire); - $newmenu->add("/compta/localtax/quadri_detail.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire); + $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')); } } } } // Salaries - if (!empty($conf->salaries->enabled)) { + if (isModEnabled('salaries')) { $langs->load("salaries"); - $newmenu->add("/salaries/list.php?leftmenu=tax_salary&mainmenu=billing",$langs->trans("Salaries"),1,$user->rights->salaries->read, '', $mainmenu, 'tax_salary'); + $newmenu->add("/salaries/list.php?leftmenu=tax_salary&mainmenu=billing",$langs->trans("Salaries"),1,$user->hasRight('salaries', 'read'), '', $mainmenu, 'tax_salary'); if (! empty($menu_invert)) $leftmenu= 'tax_salary'; if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i', $leftmenu)) { - $newmenu->add("/salaries/card.php?leftmenu=tax_salary&action=create", $langs->trans("New"), 2, $user->rights->salaries->write); - $newmenu->add("/salaries/list.php?leftmenu=tax_salary", $langs->trans("List"), 2, $user->rights->salaries->read); - $newmenu->add("/salaries/payments.php?leftmenu=tax_salary", $langs->trans("Payments"), 2, $user->rights->salaries->read); - $newmenu->add("/salaries/stats/index.php?leftmenu=tax_salary", $langs->trans("Statistics"), 2, $user->rights->salaries->read); + $newmenu->add("/salaries/card.php?leftmenu=tax_salary&action=create", $langs->trans("New"), 2, $user->hasRight('salaries', 'write')); + $newmenu->add("/salaries/list.php?leftmenu=tax_salary", $langs->trans("List"), 2, $user->hasRight('salaries', 'read')); + $newmenu->add("/salaries/payments.php?leftmenu=tax_salary", $langs->trans("Payments"), 2, $user->hasRight('salaries', 'read')); + $newmenu->add("/salaries/stats/index.php?leftmenu=tax_salary", $langs->trans("Statistics"), 2, $user->hasRight('salaries', 'read')); } } // Loan - if (!empty($conf->loan->enabled)) { + if (isModEnabled('loan')) { $langs->load("loan"); - $newmenu->add("/loan/list.php?leftmenu=tax_loan&mainmenu=billing", $langs->trans("Loans"), 1, $user->rights->loan->read, '', $mainmenu, 'tax_loan'); + $newmenu->add("/loan/list.php?leftmenu=tax_loan&mainmenu=billing", $langs->trans("Loans"), 1, $user->hasRight('loan', 'read'), '', $mainmenu, 'tax_loan'); if (!empty($menu_invert)) $leftmenu = 'tax_loan'; if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_loan/i', $leftmenu)) { - $newmenu->add("/loan/card.php?leftmenu=tax_loan&action=create", $langs->trans("NewLoan"), 2, $user->rights->loan->write); - //$newmenu->add("/loan/payment/list.php?leftmenu=tax_loan",$langs->trans("Payments"),2,$user->rights->loan->read); + $newmenu->add("/loan/card.php?leftmenu=tax_loan&action=create", $langs->trans("NewLoan"), 2, $user->hasRight('loan', 'write')); + //$newmenu->add("/loan/payment/list.php?leftmenu=tax_loan",$langs->trans("Payments"),2,$user->hasRight('loan', 'read')); } } // Various payment - if (!empty($conf->banque->enabled) && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) { + if (isModEnabled('banque') && !getDolGlobalString('BANK_USE_OLD_VARIOUS_PAYMENT')) { $langs->load("banks"); - $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various&mainmenu=billing",$langs->trans("MenuVariousPayment"),1,$user->rights->banque->lire, '', $mainmenu, 'tax_various'); + $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various&mainmenu=billing",$langs->trans("MenuVariousPayment"),1,$user->hasRight('banque', 'lire'), '', $mainmenu, 'tax_various'); if (! empty($menu_invert)) $leftmenu= 'tax_various'; if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_various/i', $leftmenu)) { - $newmenu->add("/compta/bank/various_payment/card.php?leftmenu=tax_various&action=create", $langs->trans("New"), 2, $user->rights->banque->modifier); - $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various", $langs->trans("List"), 2, $user->rights->banque->lire); + $newmenu->add("/compta/bank/various_payment/card.php?leftmenu=tax_various&action=create", $langs->trans("New"), 2, $user->hasRight('banque', 'modifier')); + $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various", $langs->trans("List"), 2, $user->hasRight('banque', 'lire')); } } } @@ -1353,73 +1305,77 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta $langs->loadLangs(array("withdrawals", "banks", "bills", "categories")); // Bank-Cash account - if (!empty($conf->banque->enabled)) { - $newmenu->add("/compta/bank/list.php?leftmenu=bank&mainmenu=bank", $langs->trans("MenuBankCash"), 0, $user->rights->banque->lire, '', $mainmenu, 'bank', 0); + if (isModEnabled('banque')) { + $newmenu->add("/compta/bank/list.php?leftmenu=bank&mainmenu=bank", $langs->trans("MenuBankCash"), 0, $user->hasRight('banque', 'lire'), '', $mainmenu, 'bank', 0); - $newmenu->add("/compta/bank/card.php?action=create", $langs->trans("MenuNewFinancialAccount"), 1, $user->rights->banque->configurer); - $newmenu->add("/compta/bank/list.php?leftmenu=bank&mainmenu=bank", $langs->trans("List"), 1, $user->rights->banque->lire, '', $mainmenu, 'bank'); - $newmenu->add("/compta/bank/bankentries_list.php", $langs->trans("ListTransactions"), 1, $user->rights->banque->lire); - $newmenu->add("/compta/bank/budget.php", $langs->trans("ListTransactionsByCategory"), 1, $user->rights->banque->lire); + $newmenu->add("/compta/bank/card.php?action=create", $langs->trans("MenuNewFinancialAccount"), 1, $user->hasRight('banque', 'configurer')); + $newmenu->add("/compta/bank/list.php?leftmenu=bank&mainmenu=bank", $langs->trans("List"), 1, $user->hasRight('banque', 'lire'), '', $mainmenu, 'bank'); + $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')); - $newmenu->add("/compta/bank/transfer.php", $langs->trans("MenuBankInternalTransfer"), 1, $user->rights->banque->transfer); + $newmenu->add("/compta/bank/transfer.php", $langs->trans("MenuBankInternalTransfer"), 1, $user->hasRight('banque', 'transfer')); } - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { $langs->load("categories"); - $newmenu->add("/categories/index.php?type=5", $langs->trans("Rubriques"), 1, $user->rights->categorie->creer, '', $mainmenu, 'tags'); - $newmenu->add("/compta/bank/categ.php", $langs->trans("RubriquesTransactions"), 1, $user->rights->banque->configurer, '', $mainmenu, 'tags'); - } + $newmenu->add("/categories/index.php?type=5", $langs->trans("Rubriques"), 1, $user->hasRight('categorie', 'creer'), '', $mainmenu, 'tags'); + if ((float) DOL_VERSION >= 21.0) { + $newmenu->add("/categories/index.php?type=8", $langs->trans("RubriquesTransactions"), 1, $user->hasRight('banque', 'configurer'), '', $mainmenu, 'tags'); + } else { + $newmenu->add("/compta/bank/categ.php", $langs->trans("RubriquesTransactions"), 1, $user->hasRight('banque', 'configurer'), '', $mainmenu, 'tags'); + } + } // Direct debit order - if (!empty($conf->prelevement->enabled)) { - $newmenu->add("/compta/prelevement/index.php?leftmenu=withdraw&mainmenu=bank", $langs->trans("PaymentByDirectDebit"), 0, $user->rights->prelevement->bons->lire, '', $mainmenu, 'withdraw', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); + if (isModEnabled('prelevement')) { + $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"')); if (! empty($menu_invert)) $leftmenu= 'withdraw'; if ($usemenuhider || empty($leftmenu) || $leftmenu == "withdraw") { - $newmenu->add("/compta/prelevement/create.php?mainmenu=bank", $langs->trans("NewStandingOrder"), 1, $user->rights->prelevement->bons->creer); + $newmenu->add("/compta/prelevement/create.php?mainmenu=bank", $langs->trans("NewStandingOrder"), 1, $user->hasRight('prelevement', 'bons', 'creer')); - $newmenu->add("/compta/prelevement/orders_list.php?mainmenu=bank", $langs->trans("WithdrawalsReceipts"), 1, $user->rights->prelevement->bons->lire); - $newmenu->add("/compta/prelevement/list.php?mainmenu=bank", $langs->trans("WithdrawalsLines"), 1, $user->rights->prelevement->bons->lire); - $newmenu->add("/compta/prelevement/rejets.php?mainmenu=bank", $langs->trans("Rejects"), 1, $user->rights->prelevement->bons->lire); - $newmenu->add("/compta/prelevement/stats.php?mainmenu=bank", $langs->trans("Statistics"), 1, $user->rights->prelevement->bons->lire); + $newmenu->add("/compta/prelevement/orders_list.php?mainmenu=bank", $langs->trans("List"), 1, $user->hasRight('prelevement', 'bons', 'lire')); + $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')); } } // Bank transfer order - if (!empty($conf->paymentbybanktransfer->enabled)) { - $newmenu->add("/compta/paymentbybanktransfer/index.php?leftmenu=banktransfer&mainmenu=bank", $langs->trans("PaymentByBankTransfer"), 0, $user->rights->paymentbybanktransfer->read, '', $mainmenu, 'banktransfer', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); + if (isModEnabled('paymentbybanktransfer')) { + $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"')); if (! empty($menu_invert)) $leftmenu= 'banktransfer'; if ($usemenuhider || empty($leftmenu) || $leftmenu == "banktransfer") { - $newmenu->add("/compta/prelevement/create.php?type=bank-transfer&mainmenu=bank", $langs->trans("NewPaymentByBankTransfer"), 1, $user->rights->paymentbybanktransfer->create); + $newmenu->add("/compta/prelevement/create.php?type=bank-transfer&mainmenu=bank", $langs->trans("NewPaymentByBankTransfer"), 1, $user->hasRight('paymentbybanktransfer', 'create')); - $newmenu->add("/compta/prelevement/orders_list.php?type=bank-transfer&mainmenu=bank", $langs->trans("PaymentByBankTransferReceipts"), 1, $user->rights->paymentbybanktransfer->read); - $newmenu->add("/compta/prelevement/list.php?type=bank-transfer&mainmenu=bank", $langs->trans("PaymentByBankTransferLines"), 1, $user->rights->paymentbybanktransfer->read); - $newmenu->add("/compta/prelevement/rejets.php?type=bank-transfer&mainmenu=bank", $langs->trans("Rejects"), 1, $user->rights->paymentbybanktransfer->read); - $newmenu->add("/compta/prelevement/stats.php?type=bank-transfer&mainmenu=bank", $langs->trans("Statistics"), 1, $user->rights->paymentbybanktransfer->read); + $newmenu->add("/compta/prelevement/orders_list.php?type=bank-transfer&mainmenu=bank", $langs->trans("List"), 1, $user->hasRight('paymentbybanktransfer', 'read')); + $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')); } } // Management of checks - if (empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && !empty($conf->banque->enabled) && (!empty($conf->facture->enabled) || !empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))) { - $newmenu->add("/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=bank", $langs->trans("MenuChequeDeposits"), 0, $user->rights->banque->cheque, '', $mainmenu, 'checks', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); + if (!getDolGlobalString('BANK_DISABLE_CHECK_DEPOSIT') && isModEnabled('banque') && (isModEnabled('facture') || getDolGlobalString('MAIN_MENU_CHEQUE_DEPOSIT_ON'))) { + $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"')); if (! empty($menu_invert)) $leftmenu= 'checks'; if ($usemenuhider || empty($leftmenu) || $leftmenu == "checks") { - $newmenu->add("/compta/paiement/cheque/card.php?leftmenu=checks&action=new&mainmenu=bank", $langs->trans("NewChequeDeposit"), 1, $user->rights->banque->cheque); - $newmenu->add("/compta/paiement/cheque/list.php?leftmenu=checks&mainmenu=bank", $langs->trans("List"), 1, $user->rights->banque->cheque); + $newmenu->add("/compta/paiement/cheque/card.php?leftmenu=checks&action=new&mainmenu=bank", $langs->trans("NewChequeDeposit"), 1, $user->hasRight('banque', 'cheque')); + $newmenu->add("/compta/paiement/cheque/list.php?leftmenu=checks&mainmenu=bank", $langs->trans("List"), 1, $user->hasRight('banque', 'cheque')); } } // Cash Control - if (!empty($conf->takepos->enabled) || !empty($conf->cashdesk->enabled)) { - $permtomakecashfence = ($user->rights->cashdesk->run || $user->rights->takepos->run); - $newmenu->add("/compta/cashcontrol/cashcontrol_list.php?action=list", $langs->trans("POS"), 0, $permtomakecashfence, '', $mainmenu, 'cashcontrol', 0, '', '', '', img_picto('', 'pos', 'class="pictofixedwidth"')); - $newmenu->add("/compta/cashcontrol/cashcontrol_card.php?action=create", $langs->trans("NewCashFence"), 1, $permtomakecashfence); - $newmenu->add("/compta/cashcontrol/cashcontrol_list.php?action=list", $langs->trans("List"), 1, $permtomakecashfence); + if (isModEnabled('takepos') || isModEnabled('cashdesk')) { + $permtomakecashfence = ($user->hasRight('cashdesk', 'run') || $user->hasRight('takepos', 'run')); + $newmenu->add("/compta/cashcontrol/cashcontrol_list.php?mainmenu=bank", $langs->trans("POS"), 0, $permtomakecashfence, '', $mainmenu, 'cashcontrol', 0, '', '', '', img_picto('', 'pos', 'class="pictofixedwidth"')); + $newmenu->add("/compta/cashcontrol/cashcontrol_card.php?mainmenu=bank&action=create", $langs->trans("NewCashFence"), 1, $permtomakecashfence); + $newmenu->add("/compta/cashcontrol/cashcontrol_list.php?mainmenu=bank", $langs->trans("List"), 1, $permtomakecashfence); } } @@ -1428,126 +1384,126 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta */ if ($mainmenu == 'products') { // Products - if (!empty($conf->product->enabled)) { - $newmenu->add("/product/index.php?leftmenu=product&type=0", $langs->trans("Products"), 0, $user->rights->produit->lire, '', $mainmenu, 'product', 0); - $newmenu->add("/product/card.php?leftmenu=product&action=create&type=0", $langs->trans("NewProduct"), 1, $user->rights->produit->creer); - $newmenu->add("/product/list.php?leftmenu=product&type=0", $langs->trans("List"), 1, $user->rights->produit->lire); - if (!empty($conf->stock->enabled)) { - $newmenu->add("/product/reassort.php?type=0", $langs->trans("MenuStocks"), 1, $user->rights->produit->lire && $user->rights->stock->lire); + if (isModEnabled('product')) { + $newmenu->add("/product/index.php?leftmenu=product&type=0", $langs->trans("Products"), 0, $user->hasRight('produit', 'lire'), '', $mainmenu, 'product', 0); + $newmenu->add("/product/card.php?leftmenu=product&action=create&type=0", $langs->trans("NewProduct"), 1, $user->hasRight('produit', 'creer')); + $newmenu->add("/product/list.php?leftmenu=product&type=0", $langs->trans("List"), 1, $user->hasRight('produit', 'lire')); + if (isModEnabled('stock')) { + $newmenu->add("/product/reassort.php?type=0", $langs->trans("MenuStocks"), 1, $user->hasRight('produit', 'lire') && $user->hasRight('stock', 'lire')); } - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $langs->load("stocks"); - $newmenu->add("/product/reassortlot.php?type=0", $langs->trans("StocksByLotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire); - $newmenu->add("/product/stock/productlot_list.php", $langs->trans("LotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire); + $newmenu->add("/product/reassortlot.php?type=0", $langs->trans("StocksByLotSerial"), 1, $user->hasRight('produit', 'lire') && $user->hasRight('stock', 'lire')); + $newmenu->add("/product/stock/productlot_list.php", $langs->trans("LotSerial"), 1, $user->hasRight('produit', 'lire') && $user->hasRight('stock', 'lire')); } - if (!empty($conf->variants->enabled)) { - $newmenu->add("/variants/list.php", $langs->trans("VariantAttributes"), 1, $user->rights->produit->lire); + if (isModEnabled('variants')) { + $newmenu->add("/variants/list.php", $langs->trans("VariantAttributes"), 1, $user->hasRight('produit', 'lire')); } - if (!empty($conf->propal->enabled) || (!empty($conf->commande->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->facture->enabled) || !empty($conf->fournisseur->enabled) || !empty($conf->supplier_proposal->enabled) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { - $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->rights->produit->lire || $user->rights->product->lire); + if (isModEnabled('propal') || (isModEnabled('commande') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || isModEnabled('facture') || isModEnabled('fournisseur') || isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) { + $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->hasRight('produit', 'lire') || $user->hasRight('product', 'lire')); } // Categories - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { $langs->load("categories"); - $newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); - //if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->rights->categorie->lire); + $newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); + //if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->hasRight('categorie', 'lire')); } } // Services - if (!empty($conf->service->enabled)) { - $newmenu->add("/product/index.php?leftmenu=service&type=1", $langs->trans("Services"), 0, $user->rights->service->lire, '', $mainmenu, 'service', 0); - $newmenu->add("/product/card.php?leftmenu=service&action=create&type=1", $langs->trans("NewService"), 1, $user->rights->service->creer); - $newmenu->add("/product/list.php?leftmenu=service&type=1", $langs->trans("List"), 1, $user->rights->service->lire); - if (!empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->facture->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_proposal->enabled) || !empty($conf->supplier_oder->enabled) || !empty($conf->supplier_invoice->enabled)) { - $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=1", $langs->trans("Statistics"), 1, $user->rights->service->lire || $user->rights->product->lire); + if (isModEnabled('service')) { + $newmenu->add("/product/index.php?leftmenu=service&type=1", $langs->trans("Services"), 0, $user->hasRight('service', 'lire'), '', $mainmenu, 'service', 0); + $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', 'lire')); + if (isModEnabled('propal') || isModEnabled('commande') || isModEnabled('facture') || (isModEnabled('fournisseur') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) { + $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=1", $langs->trans("Statistics"), 1, $user->hasRight('service', 'lire') || $user->hasRight('product', 'lire')); } // Categories - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { $langs->load("categories"); - $newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); - //if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->rights->categorie->lire); + $newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); + //if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->hasRight('categorie', 'lire')); } } // Warehouse - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $langs->load("stocks"); - $newmenu->add("/product/stock/index.php?leftmenu=stock", $langs->trans("Warehouses"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock', 0); - $newmenu->add("/product/stock/card.php?action=create", $langs->trans("MenuNewWarehouse"), 1, $user->rights->stock->creer); - $newmenu->add("/product/stock/list.php", $langs->trans("List"), 1, $user->rights->stock->lire); - $newmenu->add("/product/stock/movement_list.php", $langs->trans("Movements"), 1, $user->rights->stock->mouvement->lire); - - $newmenu->add("/product/stock/massstockmove.php", $langs->trans("MassStockTransferShort"), 1, $user->rights->stock->mouvement->creer); - if ($conf->supplier_order->enabled) { - $newmenu->add("/product/stock/replenish.php", $langs->trans("Replenishment"), 1, $user->rights->stock->mouvement->creer && $user->rights->fournisseur->lire); + $newmenu->add("/product/stock/index.php?leftmenu=stock", $langs->trans("Warehouses"), 0, $user->hasRight('stock', 'lire'), '', $mainmenu, 'stock', 0); + $newmenu->add("/product/stock/card.php?action=create", $langs->trans("MenuNewWarehouse"), 1, $user->hasRight('stock', 'creer')); + $newmenu->add("/product/stock/list.php", $langs->trans("List"), 1, $user->hasRight('stock', 'lire')); + $newmenu->add("/product/stock/movement_list.php", $langs->trans("Movements"), 1, $user->hasRight('stock', 'mouvement', 'lire')); + + $newmenu->add("/product/stock/massstockmove.php", $langs->trans("MassStockTransferShort"), 1, $user->hasRight('stock', 'mouvement', 'creer')); + if (isModEnabled('supplier_order')) { + $newmenu->add("/product/stock/replenish.php", $langs->trans("Replenishment"), 1, $user->hasRight('stock', 'mouvement', 'creer') && $user->hasRight('fournisseur', 'lire')); } - $newmenu->add("/product/stock/stockatdate.php", $langs->trans("StockAtDate"), 1, $user->rights->produit->lire && $user->rights->stock->lire); + $newmenu->add("/product/stock/stockatdate.php", $langs->trans("StockAtDate"), 1, $user->hasRight('produit', 'lire') && $user->hasRight('stock', 'lire')); // Categories for warehouses - if (!empty($conf->categorie->enabled)) { - $newmenu->add("/categories/index.php?leftmenu=stock&type=9", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); + if (isModEnabled('categorie')) { + $newmenu->add("/categories/index.php?leftmenu=stock&type=9", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); } } // Inventory - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $langs->load("stocks"); if (! empty($menu_invert)) $leftmenu= 'stock_inventories'; - if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { - $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("inventoryTitle"), 0, $user->rights->stock->lire, '', $mainmenu, 'inventory', 0); + if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS')) { + $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("inventoryTitle"), 0, $user->hasRight('stock', 'lire'), '', $mainmenu, 'inventory', 0); if ($usemenuhider || empty($leftmenu) || $leftmenu == "stock_inventories") { - $newmenu->add("/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans("NewInventory"), 1, $user->rights->stock->creer); - $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("List"), 1, $user->rights->stock->lire); + $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')); } } else { - $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("inventoryTitle"), 0, $user->rights->stock->inventory_advance->read, '', $mainmenu, 'inventory', 0); + $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("inventoryTitle"), 0, $user->hasRight('stock', 'inventory_advance', 'read'), '', $mainmenu, 'inventory', 0); if ($usemenuhider || empty($leftmenu) || $leftmenu == "stock_inventories") { - $newmenu->add("/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans("NewInventory"), 1, $user->rights->stock->inventory_advance->write); - $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("List"), 1, $user->rights->stock->inventory_advance->read); + $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')); } } } // Shipments - if (!empty($conf->expedition->enabled)) { + if (isModEnabled('expedition')) { $langs->load("sendings"); - $newmenu->add("/expedition/index.php?leftmenu=sendings", $langs->trans("Shipments"), 0, $user->rights->expedition->lire, '', $mainmenu, 'sendings', 0); - $newmenu->add("/expedition/card.php?action=create2&leftmenu=sendings", $langs->trans("NewSending"), 1, $user->rights->expedition->creer); - $newmenu->add("/expedition/list.php?leftmenu=sendings", $langs->trans("List"), 1, $user->rights->expedition->lire); + $newmenu->add("/expedition/index.php?leftmenu=sendings", $langs->trans("Shipments"), 0, $user->hasRight('expedition', 'lire'), '', $mainmenu, 'sendings', 0); + $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')); if (! empty($menu_invert)) $leftmenu= 'sendings'; if ($usemenuhider || empty($leftmenu) || $leftmenu == "sendings") { - $newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=0", $langs->trans("StatusSendingDraftShort"), 2, $user->rights->expedition->lire); - $newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=1", $langs->trans("StatusSendingValidatedShort"), 2, $user->rights->expedition->lire); - $newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=2", $langs->trans("StatusSendingProcessedShort"), 2, $user->rights->expedition->lire); + $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')); } - $newmenu->add("/expedition/stats/index.php?leftmenu=sendings", $langs->trans("Statistics"), 1, $user->rights->expedition->lire); + $newmenu->add("/expedition/stats/index.php?leftmenu=sendings", $langs->trans("Statistics"), 1, $user->hasRight('expedition', 'lire')); } // Receptions - if (!empty($conf->reception->enabled)) { + if (isModEnabled('reception')) { $langs->load("receptions"); - $newmenu->add("/reception/index.php?leftmenu=receptions", $langs->trans("Receptions"), 0, $user->rights->reception->lire, '', $mainmenu, 'receptions', 0, '', '', '', img_picto('', 'dollyrevert', 'class="pictofixedwidth"')); - $newmenu->add("/reception/card.php?action=create2&leftmenu=receptions", $langs->trans("NewReception"), 1, $user->rights->reception->creer); - $newmenu->add("/reception/list.php?leftmenu=receptions", $langs->trans("List"), 1, $user->rights->reception->lire); + $newmenu->add("/reception/index.php?leftmenu=receptions", $langs->trans("Receptions"), 0, $user->hasRight('reception', 'lire'), '', $mainmenu, 'receptions', 0, '', '', '', img_picto('', 'dollyrevert', 'class="pictofixedwidth"')); + $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')); if (! empty($menu_invert)) $leftmenu= 'receptions'; if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") { - $newmenu->add("/reception/list.php?leftmenu=receptions&search_status=0", $langs->trans("StatusReceptionDraftShort"), 2, $user->rights->reception->lire); + $newmenu->add("/reception/list.php?leftmenu=receptions&search_status=0", $langs->trans("StatusReceptionDraftShort"), 2, $user->hasRight('reception', 'lire')); } if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") { - $newmenu->add("/reception/list.php?leftmenu=receptions&search_status=1", $langs->trans("StatusReceptionValidatedShort"), 2, $user->rights->reception->lire); + $newmenu->add("/reception/list.php?leftmenu=receptions&search_status=1", $langs->trans("StatusReceptionValidatedShort"), 2, $user->hasRight('reception', 'lire')); } if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") { - $newmenu->add("/reception/list.php?leftmenu=receptions&search_status=2", $langs->trans("StatusReceptionProcessedShort"), 2, $user->rights->reception->lire); + $newmenu->add("/reception/list.php?leftmenu=receptions&search_status=2", $langs->trans("StatusReceptionProcessedShort"), 2, $user->hasRight('reception', 'lire')); } - $newmenu->add("/reception/stats/index.php?leftmenu=receptions", $langs->trans("Statistics"), 1, $user->rights->reception->lire); + $newmenu->add("/reception/stats/index.php?leftmenu=receptions", $langs->trans("Statistics"), 1, $user->hasRight('reception', 'lire')); } } @@ -1556,20 +1512,20 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta */ if ($mainmenu == 'mrp') { // BOM - if (!empty($conf->bom->enabled) || !empty($conf->mrp->enabled)) { + if (isModEnabled('bom') || isModEnabled('mrp')) { $langs->load("mrp"); - $newmenu->add("", $langs->trans("MenuBOM"), 0, $user->rights->bom->read, '', $mainmenu, 'bom', 0); - $newmenu->add("/bom/bom_card.php?leftmenu=bom&action=create", $langs->trans("NewBOM"), 1, $user->rights->bom->write, '', $mainmenu, 'bom'); - $newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->rights->bom->read, '', $mainmenu, 'bom'); + $newmenu->add("", $langs->trans("MenuBOM"), 0, $user->hasRight('bom', 'read'), '', $mainmenu, 'bom', 0); + $newmenu->add("/bom/bom_card.php?leftmenu=bom&action=create", $langs->trans("NewBOM"), 1, $user->hasRight('bom', 'write'), '', $mainmenu, 'bom'); + $newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->hasRight('bom', 'read'), '', $mainmenu, 'bom'); } - if (!empty($conf->mrp->enabled)) { + if (isModEnabled('mrp')) { $langs->load("mrp"); - $newmenu->add("", $langs->trans("MenuMRP"), 0, $user->rights->mrp->read, '', $mainmenu, 'mo', 0); - $newmenu->add("/mrp/mo_card.php?leftmenu=mo&action=create", $langs->trans("NewMO"), 1, $user->rights->mrp->write, '', $mainmenu, 'mo'); - $newmenu->add("/mrp/mo_list.php?leftmenu=mo", $langs->trans("List"), 1, $user->rights->mrp->read, '', $mainmenu, 'mo'); + $newmenu->add("", $langs->trans("MenuMRP"), 0, $user->hasRight('mrp', 'read'), '', $mainmenu, 'mo', 0); + $newmenu->add("/mrp/mo_card.php?leftmenu=mo&action=create", $langs->trans("NewMO"), 1, $user->hasRight('mrp', 'write'), '', $mainmenu, 'mo'); + $newmenu->add("/mrp/mo_list.php?leftmenu=mo", $langs->trans("List"), 1, $user->hasRight('mrp', 'read'), '', $mainmenu, 'mo'); } } @@ -1577,60 +1533,60 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta * Menu PROJECTS */ if ($mainmenu == 'project') { - if (!empty($conf->projet->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $search_project_user = GETPOST('search_project_user', 'int'); $tmpentry = array( - 'enabled'=>(!empty($conf->projet->enabled)), - 'perms'=>(!empty($user->rights->projet->lire)), + 'enabled'=>(isModEnabled('project')), + 'perms'=>(!empty($user->hasRight('projet', 'lire'))), 'module'=>'projet' ); $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal); $titleboth = $langs->trans("LeadsOrProjects"); $titlenew = $langs->trans("NewLeadOrProject"); // Leads and opportunities by default - if (empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + if (!getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) { $titleboth = $langs->trans("Projects"); $titlenew = $langs->trans("NewProject"); } - if (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only + if (getDolGlobalInt('PROJECT_USE_OPPORTUNITIES') == 2) { // 2 = leads only $titleboth = $langs->trans("Leads"); $titlenew = $langs->trans("NewLead"); } // Project assigned to user - $newmenu->add("/projet/index.php?leftmenu=projects".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titleboth, 0, $user->rights->projet->lire, '', $mainmenu, 'projects', 0); - $newmenu->add("/projet/card.php?leftmenu=projects&action=create".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titlenew, 1, $user->rights->projet->creer); + $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); + $newmenu->add("/projet/card.php?leftmenu=projects&action=create".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titlenew, 1, $user->hasRight('projet', 'creer')); - if (empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + if (!getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) { $newmenu->add("/projet/list.php?leftmenu=projets".($search_project_user ? '&search_project_user='.$search_project_user : '').'&search_status=99', $langs->trans("List"), 1, $showmode, '', 'project', 'list'); - } elseif (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 1) { + } elseif (getDolGlobalInt('PROJECT_USE_OPPORTUNITIES') == 1) { $newmenu->add("/projet/list.php?leftmenu=projets".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $showmode, '', 'project', 'list'); $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); - } elseif (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only + } elseif (getDolGlobalInt('PROJECT_USE_OPPORTUNITIES') == 2) { // 2 = leads only $newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_usage_opportunity=1&search_status=99', $langs->trans("List"), 2, $showmode); } - $newmenu->add("/projet/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->rights->projet->lire); + $newmenu->add("/projet/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->hasRight('projet', 'lire')); // Categories - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { $langs->load("categories"); - $newmenu->add("/categories/index.php?leftmenu=cat&type=6", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); + $newmenu->add("/categories/index.php?leftmenu=cat&type=6", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); } - if (empty($conf->global->PROJECT_HIDE_TASKS)) { + if (!getDolGlobalString('PROJECT_HIDE_TASKS')) { // Project affected to user - $newmenu->add("/projet/activity/index.php?leftmenu=tasks" . ($search_project_user ? '&search_project_user=' . $search_project_user : ''), $langs->trans("Activities"), 0, $user->rights->projet->lire, '', 'project', 'tasks', 0); - $newmenu->add("/projet/tasks.php?leftmenu=tasks&action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer); - $newmenu->add("/projet/tasks/list.php?leftmenu=tasks" . ($search_project_user ? '&search_project_user=' . $search_project_user : ''), $langs->trans("List"), 1, $user->rights->projet->lire); - $newmenu->add("/projet/tasks/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->rights->projet->lire); + $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); + $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')); - if (empty($conf->global->PROJECT_HIDE_MENU_TASKS_ACTIVITY)) { - $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks" . ($search_project_user ? '&search_project_user=' . $search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->rights->projet->lire, '', 'project', 'timespent', 0); + if (!getDolGlobalString('PROJECT_HIDE_MENU_TASKS_ACTIVITY')) { + $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks" . ($search_project_user ? '&search_project_user=' . $search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->hasRight('projet', 'lire'), '', 'project', 'timespent', 0); } } } @@ -1641,102 +1597,94 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta */ if ($mainmenu == 'hrm') { // HRM module - if (!empty($conf->hrm->enabled)) { + if (isModEnabled('hrm')) { $langs->load("hrm"); - $newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&contextpage=employeelist", $langs->trans("Employees"), 0, $user->rights->user->user->lire, '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'user', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/user/card.php?mainmenu=hrm&leftmenu=hrm&action=create&employee=1", $langs->trans("NewEmployee"), 1, $user->rights->user->user->creer); - $newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&contextpage=employeelist", $langs->trans("List"), 1, $user->rights->user->user->lire); + $newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&contextpage=employeelist", $langs->trans("Employees"), 0, $user->hasRight('user', 'user', 'lire'), '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'user', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/user/card.php?mainmenu=hrm&leftmenu=hrm&action=create&employee=1", $langs->trans("NewEmployee"), 1, $user->hasRight('user', 'user', 'creer')); + $newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&contextpage=employeelist", $langs->trans("List"), 1, $user->hasRight('user', 'user', 'lire')); if ((float) DOL_VERSION >= 15.0) { - $newmenu->add("/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("SkillsManagement"), 0, $user->rights->hrm->all->read, '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'shapes', 'class="paddingright pictofixedwidth"')); + $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"')); // Skills - $newmenu->add("/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("Skills"), 1, $user->rights->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->rights->hrm->all->write); - //$newmenu->add("/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->rights->hrm->all->read); + $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"')); // Job (Description of work to do and skills required) - $newmenu->add("/hrm/job_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("JobsProfiles"), 1, $user->rights->hrm->all->read, '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"')); - //$newmenu->add("/hrm/job_card.php?mainmenu=hrm&leftmenu=hrm_sm&action=create", $langs->transnoentities("NewObject", $langs->trans("Job")), 1, $user->rights->hrm->all->write); - //$newmenu->add("/hrm/job_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->rights->hrm->all->read); + $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"')); // Position = Link job - user - $newmenu->add("/hrm/position_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("EmployeePositions"), 1, $user->rights->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->rights->hrm->all->write); - //$newmenu->add("/hrm/position_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->rights->hrm->all->read); + $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"')); // Evaluation - $newmenu->add("/hrm/evaluation_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("Evals"), 1, $user->rights->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->rights->hrm->evaluation->write); - //$newmenu->add("/hrm/evaluation_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->rights->hrm->evaluation->read); - $newmenu->add("/hrm/compare.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("SkillComparison"), 1, $user->rights->hrm->evaluation->read || $user->rights->hrm->compare_advance->read); + $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/compare.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("SkillComparison"), 1, $user->hasRight('hrm', 'evaluation', 'read') || $user->hasRight('hrm', 'compare_advance', 'read')); } } // Leave/Holiday/Vacation module - if (!empty($conf->holiday->enabled)) { + if (isModEnabled('holiday')) { // Load translation files required by the page $langs->loadLangs(array("holiday", "trips")); - $newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("CPTitreMenu"), 0, $user->rights->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->rights->holiday->write, '',$mainmenu); - $newmenu->add("/holiday/card_group.php?mainmenu=hrm&leftmenu=holiday&action=create", $langs->trans("NewHolidayForGroup"), 1, $user->rights->holiday->writeall && $user->rights->holiday->readall, '', $mainmenu, 'holiday_sm'); - $newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("List"), 1, $user->rights->holiday->read, '',$mainmenu); + $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); + $newmenu->add("/holiday/card_group.php?mainmenu=hrm&leftmenu=holiday&action=create", $langs->trans("NewHolidayForGroup"), 1, $user->hasRight('holiday', 'writeall') && $user->hasRight('holiday', 'readall'), '', $mainmenu, 'holiday_sm'); + $newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("List"), 1, $user->hasRight('holiday', 'read'), '',$mainmenu); if (! empty($menu_invert)) $leftmenu= 'holiday'; if ($usemenuhider || empty($leftmenu) || $leftmenu == "holiday") { - $newmenu->add("/holiday/list.php?search_status=1&mainmenu=hrm&leftmenu=holiday", $langs->trans("DraftCP"), 2, $user->rights->holiday->read,'',$mainmenu,'holiday_sm'); - $newmenu->add("/holiday/list.php?search_status=2&mainmenu=hrm&leftmenu=holiday", $langs->trans("ToReviewCP"), 2, $user->rights->holiday->read,'',$mainmenu,'holiday_sm'); - $newmenu->add("/holiday/list.php?search_status=3&mainmenu=hrm&leftmenu=holiday", $langs->trans("ApprovedCP"), 2, $user->rights->holiday->read,'',$mainmenu,'holiday_sm'); - $newmenu->add("/holiday/list.php?search_status=4&mainmenu=hrm&leftmenu=holiday", $langs->trans("CancelCP"), 2, $user->rights->holiday->read,'',$mainmenu,'holiday_sm'); - $newmenu->add("/holiday/list.php?search_status=5&mainmenu=hrm&leftmenu=holiday", $langs->trans("RefuseCP"), 2, $user->rights->holiday->read,'',$mainmenu,'holiday_sm'); + $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'); } - $newmenu->add("/holiday/define_holiday.php?mainmenu=hrm&action=request", $langs->trans("MenuConfCP"), 1, $user->rights->holiday->read, '',$mainmenu,'holiday_sm'); - $newmenu->add("/holiday/month_report.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("MenuReportMonth"), 1, $user->rights->holiday->readall, '',$mainmenu,'holiday_sm'); - $newmenu->add("/holiday/view_log.php?mainmenu=hrm&leftmenu=holiday&action=request", $langs->trans("MenuLogCP"), 1, $user->rights->holiday->define_holiday, '',$mainmenu,'holiday_sm'); + $newmenu->add("/holiday/define_holiday.php?mainmenu=hrm&action=request", $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&action=request", $langs->trans("MenuLogCP"), 1, $user->hasRight('holiday', 'define_holiday'), '',$mainmenu,'holiday_sm'); } // Trips and expenses (old module) - if (!empty($conf->deplacement->enabled)) { + if (isModEnabled('deplacement')) { $langs->load("trips"); - $newmenu->add("/compta/deplacement/index.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->rights->deplacement->lire, '', $mainmenu, 'tripsandexpenses', 0); - $newmenu->add("/compta/deplacement/card.php?action=create&leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("New"), 1, $user->rights->deplacement->creer); - $newmenu->add("/compta/deplacement/list.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("List"), 1, $user->rights->deplacement->lire); - $newmenu->add("/compta/deplacement/stats/index.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->rights->deplacement->lire); + $newmenu->add("/compta/deplacement/index.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->hasRight('deplacement', 'lire'), '', $mainmenu, 'tripsandexpenses', 0); + $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')); } // Expense report - if (!empty($conf->expensereport->enabled)) { + if (isModEnabled('expensereport')) { $langs->loadLangs(array("trips", "bills")); - $newmenu->add("/expensereport/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->rights->expensereport->lire, '', $mainmenu, 'expensereport', 0); - $newmenu->add("/expensereport/card.php?action=create&leftmenu=expensereport&mainmenu=hrm", $langs->trans("New"), 1, $user->rights->expensereport->creer); - $newmenu->add("/expensereport/list.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("List"), 1, $user->rights->expensereport->lire); + $newmenu->add("/expensereport/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->hasRight('expensereport', 'lire'), '', $mainmenu, 'expensereport', 0); + $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')); if (! empty($menu_invert)) $leftmenu= 'expensereport'; if ($usemenuhider || empty($leftmenu) || $leftmenu == "expensereport") { - $newmenu->add("/expensereport/list.php?search_status=0&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Draft"), 2, $user->rights->expensereport->lire); - $newmenu->add("/expensereport/list.php?search_status=2&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Validated"), 2, $user->rights->expensereport->lire); - $newmenu->add("/expensereport/list.php?search_status=5&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Approved"), 2, $user->rights->expensereport->lire); - $newmenu->add("/expensereport/list.php?search_status=6&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Paid"), 2, $user->rights->expensereport->lire); - $newmenu->add("/expensereport/list.php?search_status=4&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Canceled"), 2, $user->rights->expensereport->lire); - $newmenu->add("/expensereport/list.php?search_status=99&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Refused"), 2, $user->rights->expensereport->lire); + $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')); } if ((float) DOL_VERSION >= 16.0) { - $newmenu->add("/expensereport/payment/list.php?leftmenu=expensereport_payments&mainmenu=hrm", $langs->trans("Payments"), 1, $user->rights->expensereport->lire); + $newmenu->add("/expensereport/payment/list.php?leftmenu=expensereport_payments&mainmenu=hrm", $langs->trans("Payments"), 1, $user->hasRight('expensereport', 'lire')); } - $newmenu->add("/expensereport/stats/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->rights->expensereport->lire); + $newmenu->add("/expensereport/stats/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->hasRight('expensereport', 'lire')); } - if (!empty($conf->projet->enabled)) { - if (empty($conf->global->PROJECT_HIDE_TASKS)) { + if (isModEnabled('projet')) { + if (!getDolGlobalString('PROJECT_HIDE_TASKS')) { $langs->load("projects"); $search_project_user = GETPOST('search_project_user', 'int'); - $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->rights->projet->lire, '', $mainmenu, 'timespent', 0); + $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->hasRight('projet', 'lire'), '', $mainmenu, 'timespent', 0); } } } @@ -1749,45 +1697,45 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta $langs->load("companies"); // Accountancy (Double entries) - if (! empty($conf->accounting->enabled)) + if (isModEnabled('accounting')) { - $permtoshowmenu=(! empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire || (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->asset->read) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->asset->model_advance->read))); + $permtoshowmenu=(isModEnabled('accounting') || $user->hasRight('accounting', 'bind', 'write') || $user->hasRight('compta', 'resultat', 'lire') || (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'read')) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'model_advance', 'read'))); // Transfer in accounting $newmenu->add("/accountancy/index.php?leftmenu=accountancy",$langs->trans("TransferInAccounting"), 0, $permtoshowmenu, '', $mainmenu, 'transfer'); // Binding - if (! empty($conf->facture->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) + if (isModEnabled('facture') && !getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_SALES')) { - $newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy",$langs->trans("CustomersVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_customer'); + $newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy",$langs->trans("CustomersVentilation"),1,$user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'dispatch_customer'); if (! empty($menu_invert)) $leftmenu= 'accountancy_dispatch_customer'; - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_customer/',$leftmenu)) $newmenu->add("/accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer",$langs->trans("ToBind"),2,$user->rights->accounting->bind->write); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_customer/',$leftmenu)) $newmenu->add("/accountancy/customer/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer",$langs->trans("Binded"),2,$user->rights->accounting->bind->write); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_customer/',$leftmenu)) $newmenu->add("/accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer",$langs->trans("ToBind"),2,$user->hasRight('accounting', 'bind', 'write')); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_customer/',$leftmenu)) $newmenu->add("/accountancy/customer/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer",$langs->trans("Binded"),2,$user->hasRight('accounting', 'bind', 'write')); } - if (! empty($conf->supplier_invoice->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) + if (isModEnabled('supplier_invoice') && !getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_PURCHASES')) { - $newmenu->add("/accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy",$langs->trans("SuppliersVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_supplier'); + $newmenu->add("/accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy",$langs->trans("SuppliersVentilation"),1,$user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'dispatch_supplier'); if (! empty($menu_invert)) $leftmenu= 'accountancy_dispatch_supplier'; - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_supplier/',$leftmenu)) $newmenu->add("/accountancy/supplier/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier",$langs->trans("ToBind"),2,$user->rights->accounting->bind->write); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_supplier/',$leftmenu)) $newmenu->add("/accountancy/supplier/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier",$langs->trans("Binded"),2,$user->rights->accounting->bind->write); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_supplier/',$leftmenu)) $newmenu->add("/accountancy/supplier/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier",$langs->trans("ToBind"),2,$user->hasRight('accounting', 'bind', 'write')); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_supplier/',$leftmenu)) $newmenu->add("/accountancy/supplier/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier",$langs->trans("Binded"),2,$user->hasRight('accounting', 'bind', 'write')); } - if (! empty($conf->expensereport->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) + if (isModEnabled('expensereport') && !getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS')) { - $newmenu->add("/accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport&mainmenu=accountancy",$langs->trans("ExpenseReportsVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_expensereport'); + $newmenu->add("/accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport&mainmenu=accountancy",$langs->trans("ExpenseReportsVentilation"),1,$user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'dispatch_expensereport'); if (! empty($menu_invert)) $leftmenu= 'accountancy_dispatch_expensereport'; - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_expensereport/',$leftmenu)) $newmenu->add("/accountancy/expensereport/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport",$langs->trans("ToBind"),2,$user->rights->accounting->bind->write); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_expensereport/',$leftmenu)) $newmenu->add("/accountancy/expensereport/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport",$langs->trans("Binded"),2,$user->rights->accounting->bind->write); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_expensereport/',$leftmenu)) $newmenu->add("/accountancy/expensereport/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport",$langs->trans("ToBind"),2,$user->hasRight('accounting', 'bind', 'write')); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_expensereport/',$leftmenu)) $newmenu->add("/accountancy/expensereport/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport",$langs->trans("Binded"),2,$user->hasRight('accounting', 'bind', 'write')); } // Journals - if(! empty($conf->accounting->enabled) && ! empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { - $newmenu->add('',$langs->trans("RegistrationInAccounting"),1,$user->rights->accounting->comptarapport->lire, '', $mainmenu, 'accountancy_journal'); + if(isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') { + $newmenu->add('',$langs->trans("RegistrationInAccounting"),1,$user->hasRight('accounting', 'comptarapport', 'lire'), '', $mainmenu, 'accountancy_journal'); // Multi journal $sql = "SELECT rowid, code, label, nature"; @@ -1809,19 +1757,19 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta $nature=''; // Must match array $sourceList defined into journals_list.php - if ($objp->nature == 2 && !empty($conf->facture->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) { + if ($objp->nature == 2 && isModEnabled('facture') && !getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_SALES')) { $nature="sells"; } - if ($objp->nature == 3 && !empty($conf->fournisseur->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) { + if ($objp->nature == 3 && isModEnabled('fournisseur') && !getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_PURCHASES')) { $nature="purchases"; } - if ($objp->nature == 4 && !empty($conf->banque->enabled)) { + if ($objp->nature == 4 && isModEnabled('banque')) { $nature="bank"; } - if ($objp->nature == 5 && !empty($conf->expensereport->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) { + if ($objp->nature == 5 && isModEnabled('expensereport') && !getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS')) { $nature="expensereports"; } - if ($objp->nature == 1 && !empty($conf->asset->enabled)) { + if ($objp->nature == 1 && isModEnabled('asset')) { $nature = "various"; } if ($objp->nature == 8) { @@ -1832,13 +1780,13 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta } // To enable when page exists - if (empty($conf->global->ACCOUNTANCY_SHOW_DEVELOP_JOURNAL)) + if (!getDolGlobalString('ACCOUNTANCY_SHOW_DEVELOP_JOURNAL')) { if ($nature == 'hasnew' || $nature == 'inventory') $nature=''; } // Remove all type when treasury accounting is on - if (! empty($conf->treasuryaccounting->enabled)) { + if (isModEnabled('treasuryaccounting')) { if ($nature == 'sells' || $nature == 'purchases' || $nature == 'bank' || $nature == 'expensereports') $nature=''; } @@ -1849,13 +1797,13 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta $key = $langs->trans("AccountingJournalType".strtoupper($objp->nature)); $transferlabel = ($objp->nature && $key != "AccountingJournalType".strtoupper($langs->trans($objp->nature)) ? $key.($journallabel != $key ? ' '.$journallabel : ''): $journallabel); - $newmenu->add('/accountancy/journal/'.$nature.'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal='.$objp->rowid, $transferlabel, 2, $user->rights->accounting->comptarapport->lire); + $newmenu->add('/accountancy/journal/'.$nature.'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal='.$objp->rowid, $transferlabel, 2, $user->hasRight('accounting', 'comptarapport', 'lire')); } $i++; } } else { // Should not happened. Entries are added - $newmenu->add('',$langs->trans("NoJournalDefined"), 2, $user->rights->accounting->comptarapport->lire); + $newmenu->add('',$langs->trans("NoJournalDefined"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); } } else { dol_print_error($db); @@ -1867,218 +1815,205 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta $newmenu->add("/accountancy/index.php?leftmenu=accountancy",$langs->trans("MenuAccountancy"), 0, $permtoshowmenu, '', $mainmenu, 'accountancy'); // Balance - $newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_balance",$langs->trans("AccountBalance"),1,$user->rights->accounting->mouvements->lire); + $newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_balance",$langs->trans("AccountBalance"),1,$user->hasRight('accounting', 'mouvements', 'lire')); // General Ledger - $newmenu->add("/accountancy/bookkeeping/listbyaccount.php?mainmenu=accountancy&leftmenu=accountancy_ledger",$langs->trans("Bookkeeping"),1,$user->rights->accounting->mouvements->lire); + $newmenu->add("/accountancy/bookkeeping/listbyaccount.php?mainmenu=accountancy&leftmenu=accountancy_ledger",$langs->trans("Bookkeeping"),1,$user->hasRight('accounting', 'mouvements', 'lire')); // Journals - $newmenu->add("/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_journals",$langs->trans("Journals"),1,$user->rights->accounting->mouvements->lire); + $newmenu->add("/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_journals",$langs->trans("Journals"),1,$user->hasRight('accounting', 'mouvements', 'lire')); // Export accountancy - if ((float) $conf->global->EASYA_VERSION >= 2022.5 || (float) DOL_VERSION >= 18.0) { - $newmenu->add("/accountancy/bookkeeping/export.php?mainmenu=accountancy&leftmenu=accountancy_export",$langs->trans("MenuExportAccountancy"),1,$user->rights->accounting->mouvements->lire); + if (getDolGlobalFloat('EASYA_VERSION') >= 2022.5 || (float) DOL_VERSION >= 18.0) { + $newmenu->add("/accountancy/bookkeeping/export.php?mainmenu=accountancy&leftmenu=accountancy_export",$langs->trans("MenuExportAccountancy"),1,$user->hasRight('accounting', 'mouvements', 'lire')); } // Files - if (empty($conf->global->ACCOUNTANCY_HIDE_EXPORT_FILES_MENU)) + if (!getDolGlobalString('ACCOUNTANCY_HIDE_EXPORT_FILES_MENU')) { - $newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 1, $user->rights->accounting->mouvements->lire); + $newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); } // Closure - $newmenu->add("/accountancy/closure/index.php?mainmenu=accountancy&leftmenu=accountancy_closure", $langs->trans("MenuAccountancyClosure"), 1, $user->rights->accounting->fiscalyear->write, '', $mainmenu, 'closure'); + $newmenu->add("/accountancy/closure/index.php?mainmenu=accountancy&leftmenu=accountancy_closure", $langs->trans("MenuAccountancyClosure"), 1, $user->hasRight('accounting', 'fiscalyear', 'write'), '', $mainmenu, 'closure'); // Reports - $newmenu->add("/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report", $langs->trans("Reportings"), 1, $user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca'); + $newmenu->add("/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report", $langs->trans("Reportings"), 1, $user->hasRight('accounting', 'comptarapport', 'lire'), '', $mainmenu, 'ca'); if (! empty($menu_invert)) $leftmenu= 'accountancy_report'; if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { - $newmenu->add("/compta/resultat/index.php?leftmenu=accountancy_report", $langs->trans("MenuReportInOut"), 2, $user->rights->accounting->comptarapport->lire); - $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=accountancy_report", $langs->trans("ByPredefinedAccountGroups"), 3, $user->rights->accounting->comptarapport->lire); - $newmenu->add("/compta/resultat/result.php?leftmenu=accountancy_report", $langs->trans("ByPersonalizedAccountGroups"), 3, $user->rights->accounting->comptarapport->lire); + $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')); + $newmenu->add("/compta/resultat/result.php?leftmenu=accountancy_report", $langs->trans("ByPersonalizedAccountGroups"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); } $modecompta='CREANCES-DETTES'; - if(! empty($conf->accounting->enabled) && ! empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { + if(isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') { $modecompta='BOOKKEEPING'; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED } if ($modecompta) { if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { - $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnover"), 2, $user->rights->accounting->comptarapport->lire); - $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->rights->accounting->comptarapport->lire); - $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 3, $user->rights->accounting->comptarapport->lire); - $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 3, $user->rights->accounting->comptarapport->lire); - $newmenu->add("/compta/stats/byratecountry.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByVatRate"), 3, $user->rights->accounting->comptarapport->lire); + $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')); } } $modecompta='RECETTES-DEPENSES'; - //if (! empty($conf->accounting->enabled) && ! empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') $modecompta=''; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED if ($modecompta) { if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { - $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnoverCollected"), 2, $user->rights->accounting->comptarapport->lire); - $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->rights->accounting->comptarapport->lire); - $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 3, $user->rights->accounting->comptarapport->lire); - //$newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"),3,$user->rights->accounting->comptarapport->lire); - //$newmenu->add("/compta/stats/byratecountry.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByVatRate"),3,$user->rights->accounting->comptarapport->lire); + $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')); } } $modecompta = 'CREANCES-DETTES'; - if (!empty($conf->accounting->enabled) && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { + if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') { $modecompta = 'BOOKKEEPING'; // Not yet implemented. } - if ($modecompta && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled))) { + if ($modecompta && ((!empty($conf->fournisseur->enabled) && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || !empty($conf->supplier_invoice->enabled))) { if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { - $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnover"), 2, $user->rights->accounting->comptarapport->lire); - $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->rights->accounting->comptarapport->lire); - $newmenu->add("/compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 3, $user->rights->accounting->comptarapport->lire); + $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')); } } $modecompta = 'RECETTES-DEPENSES'; - if (!empty($conf->accounting->enabled) && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { + if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') { $modecompta = 'BOOKKEEPINGCOLLECTED'; // Not yet implemented. } - if ($modecompta && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled))) { + if ($modecompta && ((isModEnabled('fournisseur') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || isModEnabled('supplier_invoice'))) { if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { - $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnoverCollected"), 2, $user->rights->accounting->comptarapport->lire); - $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->rights->accounting->comptarapport->lire); + $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')); } } // Configuration - $newmenu->add("/accountancy/index.php?leftmenu=accountancy_admin", $langs->trans("Setup"), 0, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin', 1); + $newmenu->add("/accountancy/index.php?leftmenu=accountancy_admin", $langs->trans("Setup"), 0, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin', 1); if (! empty($menu_invert)) $leftmenu= 'accountancy_admin'; if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/', $leftmenu)) { - $newmenu->add("/accountancy/admin/index.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("General"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_general', 10); - $newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("FiscalPeriod"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'fiscalyear', 20); - $newmenu->add("/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingJournals"), 1, $user->rights->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->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chartmodel', 40); - $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 41); - $newmenu->add("/accountancy/admin/subaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ChartOfSubaccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 42); - $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->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 50); - $newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 60); - if (! empty($conf->banque->enabled)) { - $newmenu->add("/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans("MenuBankAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_bank', 70); + $newmenu->add("/accountancy/admin/index.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("General"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_general', 10); + $newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("FiscalPeriod"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'fiscalyear', 20); + $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', 42); + $newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 60); + if (isModEnabled('banque')) { + $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); + } + if (isModEnabled('facture') || isModEnabled('fournisseur')) { + $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); } - if (! empty($conf->facture->enabled) || ! empty($conf->fournisseur->enabled)) { - $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->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 80); + if (isModEnabled('tax')) { + $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); } - if (! empty($conf->tax->enabled)) { - $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->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 90); + if (isModEnabled('expensereport')) { + $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); } - if (! empty($conf->expensereport->enabled)) { - $newmenu->add("/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuExpenseReportAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 100); + $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); + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2 && (float) DOL_VERSION >= 21.0) { + $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); + } + $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); + + if ((float) DOL_VERSION < 21.0) { + $newmenu->add("/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ExportOptions"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_export', 130); } - $newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_product', 110); - $newmenu->add("/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuClosureAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_closure', 120); - $newmenu->add("/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ExportOptions"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_export', 130); } } // Accountancy (simple) - if (! empty($conf->comptabilite->enabled)) { + if (isModEnabled('comptabilite')) { // Files - if (empty($conf->global->ACCOUNTANCY_HIDE_EXPORT_FILES_MENU)) { - $newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 0, $user->rights->compta->resultat->lire, '', $mainmenu, 'files'); + if (!getDolGlobalString('ACCOUNTANCY_HIDE_EXPORT_FILES_MENU')) { + $newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 0, $user->hasRight('compta', 'resultat', 'lire'), '', $mainmenu, 'files'); } // Bilan, resultats - $newmenu->add("/compta/resultat/index.php?leftmenu=report&mainmenu=accountancy", $langs->trans("Reportings"), 0, $user->rights->compta->resultat->lire, '', $mainmenu, 'ca'); + $newmenu->add("/compta/resultat/index.php?leftmenu=report&mainmenu=accountancy", $langs->trans("Reportings"), 0, $user->hasRight('compta', 'resultat', 'lire'), '', $mainmenu, 'ca'); if (! empty($menu_invert)) $leftmenu= 'report'; if ($usemenuhider || empty($leftmenu) || preg_match('/report/', $leftmenu)) { - $newmenu->add("/compta/resultat/index.php?leftmenu=report", $langs->trans("MenuReportInOut"), 1, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=report", $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); - // $newmenu->add("/compta/resultat/compteres.php?leftmenu=report","Compte de resultat",2,$user->rights->compta->resultat->lire); - // $newmenu->add("/compta/resultat/bilan.php?leftmenu=report","Bilan",2,$user->rights->compta->resultat->lire); - - // $newmenu->add("/compta/stats/cumul.php?leftmenu=report","Cumule",2,$user->rights->compta->resultat->lire); - // if (! empty($conf->propal->enabled)) { - // $newmenu->add("/compta/stats/prev.php?leftmenu=report","Previsionnel",2,$user->rights->compta->resultat->lire); - // $newmenu->add("/compta/stats/comp.php?leftmenu=report","Transforme",2,$user->rights->compta->resultat->lire); - // } + $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("ByCompanies"), 2, $user->hasRight('compta', 'resultat', 'lire')); $modecompta = 'CREANCES-DETTES'; - $newmenu->add("/compta/stats/index.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ReportTurnover"), 1, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/casoc.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/cabyuser.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByUsers"), 2, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 2, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/byratecountry.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByVatRate"), 2, $user->rights->compta->resultat->lire); + $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')); $modecompta = 'RECETTES-DEPENSES'; - $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnoverCollected"), 1, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 2, $user->rights->compta->resultat->lire); + $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')); //Achats $modecompta = 'CREANCES-DETTES'; - $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnover"), 1, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 2, $user->rights->compta->resultat->lire); - - /* - $modecompta = 'RECETTES-DEPENSES'; - $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnoverCollected"), 1, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 2, $user->rights->compta->resultat->lire); - */ + $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')); // Journaux - $newmenu->add("/compta/journal/sellsjournal.php?leftmenu=report", $langs->trans("SellsJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 50); - $newmenu->add("/compta/journal/purchasesjournal.php?leftmenu=report", $langs->trans("PurchasesJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 51); + $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); } - //if ($leftmenu=="ca") $newmenu->add("/compta/journaux/index.php?leftmenu=ca",$langs->trans("Journaux"),1,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire); } // Intracomm report - if (! empty($conf->intracommreport->enabled)) { + if (isModEnabled('intracommreport')) { $langs->load("intracommreport"); - $newmenu->add("/intracommreport/list.php?leftmenu=intracommreport", $langs->trans("MenuIntracommReport"), 0, $user->rights->intracommreport->read, '', $mainmenu, 'intracommreport', 60, '', '', '', img_picto('', 'intracommreport', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/intracommreport/list.php?leftmenu=intracommreport", $langs->trans("MenuIntracommReport"), 0, $user->hasRight('intracommreport', 'read'), '', $mainmenu, 'intracommreport', 60, '', '', '', img_picto('', 'intracommreport', 'class="paddingright pictofixedwidth"')); if (! empty($menu_invert)) $leftmenu= 'intracommreport'; if ($usemenuhider || empty($leftmenu) || preg_match('/intracommreport/', $leftmenu)) { // DEB / DES - $newmenu->add("/intracommreport/card.php?action=create&leftmenu=intracommreport", $langs->trans("MenuIntracommReportNew"), 1, $user->rights->intracommreport->write, '', $mainmenu, 'intracommreport', 1); - $newmenu->add("/intracommreport/list.php?leftmenu=intracommreport", $langs->trans("MenuIntracommReportList"), 1, $user->rights->intracommreport->read, '', $mainmenu, 'intracommreport', 1); + $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); } } // Assets - if (! empty($conf->asset->enabled)) + if (isModEnabled('asset')) { $langs->load("assets"); - if ((float) $conf->global->EASYA_VERSION >= 2022.5 || (float) DOL_VERSION >= 16.0) { - $newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuAssets"), 0, $user->rights->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->rights->asset->write); - $newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuListAssets"), 1, $user->rights->asset->read); - $newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuAssetModels"), 1, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->asset->read) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->asset->model_advance->read)), '', $mainmenu, 'asset_model'); + if (getDolGlobalFloat('EASYA_VERSION') >= 2022.5 || (float) DOL_VERSION >= 16.0) { + $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')); + $newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuAssetModels"), 1, (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'read')) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'model_advance', 'read')), '', $mainmenu, 'asset_model'); if (!empty($menu_invert)) $leftmenu = 'asset_model'; if ($usemenuhider || empty($leftmenu) || preg_match('/asset_model/', $leftmenu)) { - $newmenu->add("/asset/model/card.php?leftmenu=asset_model&action=create", $langs->trans("MenuNewAssetModel"), 2, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->asset->write) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->asset->model_advance->write))); - $newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuListAssetModels"), 2, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->asset->read) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->asset->model_advance->read))); + $newmenu->add("/asset/model/card.php?leftmenu=asset_model&action=create", $langs->trans("MenuNewAssetModel"), 2, (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'write')) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'model_advance', 'write'))); + $newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuListAssetModels"), 2, (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'read')) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'model_advance', 'read'))); } } elseif ((float) DOL_VERSION >= 17.0) { - $newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuAssets"), 0, $user->rights->asset->read, '', $mainmenu, 'asset'); - $newmenu->add("/asset/card.php?leftmenu=asset&action=create", $langs->trans("MenuNewAsset"), 1, $user->rights->asset->write); - $newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuListAssets"), 1, $user->rights->asset->read); - $newmenu->add("/asset/type.php?leftmenu=asset_type", $langs->trans("MenuTypeAssets"), 1, $user->rights->asset->read, '', $mainmenu, 'asset_type'); + $newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuAssets"), 0, $user->hasRight('asset', 'read'), '', $mainmenu, 'asset'); + $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')); + $newmenu->add("/asset/type.php?leftmenu=asset_type", $langs->trans("MenuTypeAssets"), 1, $user->hasRight('asset', 'read'), '', $mainmenu, 'asset_type'); if (!empty($menu_invert)) $leftmenu = 'asset_type'; if ($usemenuhider || empty($leftmenu) || preg_match('/asset_type/', $leftmenu)) { - $newmenu->add("/asset/type.php?leftmenu=asset_type&action=create", $langs->trans("MenuNewTypeAssets"), 2, $user->rights->asset->configurer); - $newmenu->add("/asset/type.php?leftmenu=asset_type", $langs->trans("MenuListTypeAssets"), 2, $user->rights->asset->read); + $newmenu->add("/asset/type.php?leftmenu=asset_type&action=create", $langs->trans("MenuNewTypeAssets"), 2, $user->hasRight('asset', 'configurer')); + $newmenu->add("/asset/type.php?leftmenu=asset_type", $langs->trans("MenuListTypeAssets"), 2, $user->hasRight('asset', 'read')); } } } @@ -2088,75 +2023,76 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta * Menu TOOLS */ 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); - } + 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); + } - if (!empty($conf->mailing->enabled)) { - $newmenu->add("/comm/mailing/index.php?leftmenu=mailing", $langs->trans("EMailings"), 0, $user->rights->mailing->lire, '', $mainmenu, 'mailing', 0); - $newmenu->add("/comm/mailing/card.php?leftmenu=mailing&action=create", $langs->trans("NewMailing"), 1, $user->rights->mailing->creer); - $newmenu->add("/comm/mailing/list.php?leftmenu=mailing", $langs->trans("List"), 1, $user->rights->mailing->lire); - } + if (isModEnabled('mailing')) { + $newmenu->add("/comm/mailing/index.php?leftmenu=mailing", $langs->trans("EMailings"), 0, $user->hasRight('mailing', 'lire'), '', $mainmenu, 'mailing', 0); + $newmenu->add("/comm/mailing/card.php?leftmenu=mailing&action=create", $langs->trans("NewMailing"), 1, $user->hasRight('mailing', 'creer')); + $newmenu->add("/comm/mailing/list.php?leftmenu=mailing", $langs->trans("List"), 1, $user->hasRight('mailing', 'lire')); + } - if (!empty($conf->import->enabled)) { + if (isModEnabled('import')) { $langs->load("exports"); - $newmenu->add("/imports/index.php?leftmenu=import", $langs->trans("FormatedImport"), 0, $user->rights->import->run, '', $mainmenu, 'import', 0); - $newmenu->add("/imports/import.php?leftmenu=import", $langs->trans("NewImport"), 1, $user->rights->import->run); + $newmenu->add("/imports/index.php?leftmenu=import", $langs->trans("FormatedImport"), 0, $user->hasRight('import', 'run'), '', $mainmenu, 'import', 0); + $newmenu->add("/imports/import.php?leftmenu=import", $langs->trans("NewImport"), 1, $user->hasRight('import', 'run')); } - if (!empty($conf->export->enabled)) { - $langs->load("exports"); - $newmenu->add("/exports/index.php?leftmenu=export", $langs->trans("FormatedExport"), 0, $user->rights->export->lire, '', $mainmenu, 'export', 0); - $newmenu->add("/exports/export.php?leftmenu=export", $langs->trans("NewExport"), 1, $user->rights->export->creer); - //$newmenu->add("/exports/export.php?leftmenu=export",$langs->trans("List"),1, $user->rights->export->lire); - } - } + if (isModEnabled('export')) { + $langs->load("exports"); + $newmenu->add("/exports/index.php?leftmenu=export", $langs->trans("FormatedExport"), 0, $user->hasRight('export', 'lire'), '', $mainmenu, 'export', 0); + $newmenu->add("/exports/export.php?leftmenu=export", $langs->trans("NewExport"), 1, $user->hasRight('export', 'lire')); + //$newmenu->add("/exports/export.php?leftmenu=export",$langs->trans("List"),1, $user->hasRight('export', 'lire')); + } + + if ((float) DOL_VERSION >= 21.0) { + $newmenu->add("/core/customreports.php?leftmenu=customreports", $langs->trans("CustomReports"), 0, 1, '', $mainmenu, 'customreports', 0, '', '', '', img_picto('', 'graph', 'class="paddingright pictofixedwidth"')); + } + } /* * Menu MEMBERS */ if ($mainmenu == 'members') { - if (!empty($conf->adherent->enabled)) { + if (isModEnabled('adherent')) { // Load translation files required by the page $langs->loadLangs(array("members", "compta")); - $newmenu->add("/adherents/index.php?leftmenu=members&mainmenu=members", $langs->trans("Members"), 0, $user->rights->adherent->lire, '', $mainmenu, 'members', 0); - $newmenu->add("/adherents/card.php?leftmenu=members&action=create", $langs->trans("NewMember"), 1, $user->rights->adherent->creer); - $newmenu->add("/adherents/list.php?leftmenu=members", $langs->trans("List"), 1, $user->rights->adherent->lire); - $newmenu->add("/adherents/list.php?leftmenu=members&statut=-1", $langs->trans("MenuMembersToValidate"), 2, $user->rights->adherent->lire); - $newmenu->add("/adherents/list.php?leftmenu=members&statut=1", $langs->trans("MenuMembersValidated"), 2, $user->rights->adherent->lire); - $newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=withoutsubscription", $langs->trans("WithoutSubscription"), 3, $user->rights->adherent->lire); - $newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=uptodate", $langs->trans("UpToDate"), 3, $user->rights->adherent->lire); - $newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=outofdate", $langs->trans("OutOfDate"), 3, $user->rights->adherent->lire); - $newmenu->add("/adherents/list.php?leftmenu=members&statut=0", $langs->trans("MenuMembersResiliated"), 2, $user->rights->adherent->lire); - $newmenu->add("/adherents/stats/index.php?leftmenu=members", $langs->trans("MenuMembersStats"), 1, $user->rights->adherent->lire); + $newmenu->add("/adherents/index.php?leftmenu=members&mainmenu=members", $langs->trans("Members"), 0, $user->hasRight('adherent', 'lire'), '', $mainmenu, 'members', 0); + $newmenu->add("/adherents/card.php?leftmenu=members&action=create", $langs->trans("NewMember"), 1, $user->hasRight('adherent', 'creer')); + $newmenu->add("/adherents/list.php?leftmenu=members", $langs->trans("List"), 1, $user->hasRight('adherent', 'lire')); + $newmenu->add("/adherents/list.php?leftmenu=members&statut=-1", $langs->trans("MenuMembersToValidate"), 2, $user->hasRight('adherent', 'lire')); + $newmenu->add("/adherents/list.php?leftmenu=members&statut=1", $langs->trans("MenuMembersValidated"), 2, $user->hasRight('adherent', 'lire')); + $newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=withoutsubscription", $langs->trans("WithoutSubscription"), 3, $user->hasRight('adherent', 'lire')); + $newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=uptodate", $langs->trans("UpToDate"), 3, $user->hasRight('adherent', 'lire')); + $newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=outofdate", $langs->trans("OutOfDate"), 3, $user->hasRight('adherent', 'lire')); + $newmenu->add("/adherents/list.php?leftmenu=members&statut=0", $langs->trans("MenuMembersResiliated"), 2, $user->hasRight('adherent', 'lire')); + $newmenu->add("/adherents/stats/index.php?leftmenu=members", $langs->trans("MenuMembersStats"), 1, $user->hasRight('adherent', 'lire')); - $newmenu->add("/adherents/cartes/carte.php?leftmenu=export", $langs->trans("MembersCards"), 1, $user->rights->adherent->export); + $newmenu->add("/adherents/cartes/carte.php?leftmenu=export", $langs->trans("MembersCards"), 1, $user->hasRight('adherent', 'export')); if (! empty($menu_invert)) $leftmenu= '$leftmenu == "none"'; - if (!empty($conf->global->MEMBER_LINK_TO_HTPASSWDFILE) && ($usemenuhider || empty($leftmenu) || $leftmenu == 'none' || $leftmenu == "members" || $leftmenu == "export")) { - $newmenu->add("/adherents/htpasswd.php?leftmenu=export", $langs->trans("Filehtpasswd"), 1, $user->rights->adherent->export); + if (getDolGlobalString('MEMBER_LINK_TO_HTPASSWDFILE') && ($usemenuhider || empty($leftmenu) || $leftmenu == 'none' || $leftmenu == "members" || $leftmenu == "export")) { + $newmenu->add("/adherents/htpasswd.php?leftmenu=export", $langs->trans("Filehtpasswd"), 1, $user->hasRight('adherent', 'export')); } - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { $langs->load("categories"); - $newmenu->add("/categories/index.php?leftmenu=cat&type=3", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); + $newmenu->add("/categories/index.php?leftmenu=cat&type=3", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); } - $newmenu->add("/adherents/index.php?leftmenu=members&mainmenu=members", $langs->trans("Subscriptions"), 0, $user->rights->adherent->cotisation->lire, '', $mainmenu, 'members', 0); - $newmenu->add("/adherents/list.php?leftmenu=members&statut=-1,1&mainmenu=members", $langs->trans("NewSubscription"), 1, $user->rights->adherent->cotisation->creer); - $newmenu->add("/adherents/subscription/list.php?leftmenu=members", $langs->trans("List"), 1, $user->rights->adherent->cotisation->lire); - $newmenu->add("/adherents/stats/index.php?leftmenu=members", $langs->trans("MenuMembersStats"), 1, $user->rights->adherent->lire); - - //$newmenu->add("/adherents/index.php?leftmenu=export&mainmenu=members",$langs->trans("Tools"),0,$user->rights->adherent->export, '', $mainmenu, 'export'); - //if (! empty($conf->export->enabled) && ($usemenuhider || empty($leftmenu) || $leftmenu=="export")) $newmenu->add("/exports/index.php?leftmenu=export",$langs->trans("Datas"),1,$user->rights->adherent->export); + $newmenu->add("/adherents/index.php?leftmenu=members&mainmenu=members", $langs->trans("Subscriptions"), 0, $user->hasRight('adherent', 'cotisation', 'lire'), '', $mainmenu, 'members', 0); + $newmenu->add("/adherents/list.php?leftmenu=members&statut=-1,1&mainmenu=members", $langs->trans("NewSubscription"), 1, $user->hasRight('adherent', 'cotisation', 'creer')); + $newmenu->add("/adherents/subscription/list.php?leftmenu=members", $langs->trans("List"), 1, $user->hasRight('adherent', 'cotisation', 'lire')); + $newmenu->add("/adherents/stats/index.php?leftmenu=members", $langs->trans("MenuMembersStats"), 1, $user->hasRight('adherent', 'lire')); // Type - $newmenu->add("/adherents/type.php?leftmenu=setup&mainmenu=members", $langs->trans("MembersTypes"), 0, $user->rights->adherent->configurer, '', $mainmenu, 'setup', 0); - $newmenu->add("/adherents/type.php?leftmenu=setup&mainmenu=members&action=create", $langs->trans("New"), 1, $user->rights->adherent->configurer); - $newmenu->add("/adherents/type.php?leftmenu=setup&mainmenu=members", $langs->trans("List"), 1, $user->rights->adherent->configurer); + $newmenu->add("/adherents/type.php?leftmenu=setup&mainmenu=members", $langs->trans("MembersTypes"), 0, $user->hasRight('adherent', 'configurer'), '', $mainmenu, 'setup', 0); + $newmenu->add("/adherents/type.php?leftmenu=setup&mainmenu=members&action=create", $langs->trans("New"), 1, $user->hasRight('adherent', 'configurer')); + $newmenu->add("/adherents/type.php?leftmenu=setup&mainmenu=members", $langs->trans("List"), 1, $user->hasRight('adherent', 'configurer')); } } @@ -2164,22 +2100,22 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta $menuArbo = new Menubase($db,'oblyon'); $newmenu = $menuArbo->menuLeftCharger($newmenu, $mainmenu, $leftmenu, (empty($user->socid) ? 0 : 1), 'oblyon', $tabMenu); - if (!empty($conf->ftp->enabled) && $mainmenu == 'ftp') { // Entry for FTP + if (isModEnabled('ftp') && $mainmenu == 'ftp') { // Entry for FTP $MAXFTP = 20; $i = 1; while ($i <= $MAXFTP) { $paramkey = 'FTP_NAME_'.$i; //print $paramkey; - if (!empty($conf->global->$paramkey)) { + if (getDolGlobalString($paramkey)) { $link = "/ftp/index.php?idmenu=".$_SESSION["idmenu"]."&numero_ftp=".$i; - $newmenu->add($link, dol_trunc($conf->global->$paramkey, 24)); + $newmenu->add($link, dol_trunc(getDolGlobalString($paramkey), 24)); } $i++; } } // We update newmenu for special dynamic menus - if (!empty($user->rights->banque->lire) && $mainmenu == 'bank' && !empty($conf->global->OBLYON_ENABLE_MENU_BANK_RECONCILIATE)) // Entry for each bank account + if ($user->hasRight('banque', 'lire') && $mainmenu == 'bank' && getDolGlobalString('OBLYON_ENABLE_MENU_BANK_RECONCILIATE')) // Entry for each bank account { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; @@ -2194,15 +2130,15 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta $numr = $db->num_rows($resql); $i = 0; - if ($numr > 0) $newmenu->add('/compta/bank/list.php',$langs->trans("BankAccounts"),0,$user->rights->banque->lire, '', $mainmenu, 'bank'); + if ($numr > 0) $newmenu->add('/compta/bank/list.php',$langs->trans("BankAccounts"),0,$user->hasRight('banque', 'lire'), '', $mainmenu, 'bank'); while ($i < $numr) { $objp = $db->fetch_object($resql); - $newmenu->add('/compta/bank/card.php?id='.$objp->rowid,$objp->label,1,$user->rights->banque->lire); + $newmenu->add('/compta/bank/card.php?id='.$objp->rowid,$objp->label,1,$user->hasRight('banque', 'lire')); if ($objp->rappro && $objp->courant != Account::TYPE_CASH && empty($objp->clos)) // If not cash account and not closed and can be reconciliate { - $newmenu->add('/compta/bank/bankentries_list.php?action=reconcile&contextpage=banktransactionlist-'.$objp->rowid.'&account='.$objp->rowid.'&id='.$objp->rowid.'&search_conciliated=0',$langs->trans("Conciliate"),2,$user->rights->banque->consolidate); + $newmenu->add('/compta/bank/bankentries_list.php?action=reconcile&contextpage=banktransactionlist-'.$objp->rowid.'&account='.$objp->rowid.'&id='.$objp->rowid.'&search_conciliated=0',$langs->trans("Conciliate"),2,$user->hasRight('banque', 'consolidate')); } $i++; } @@ -2212,18 +2148,18 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta } // FTP - if (!empty($conf->ftp->enabled) && $mainmenu == 'ftp') { + if (isModEnabled('ftp') && $mainmenu == 'ftp') { $MAXFTP=20; $i=1; while ($i <= $MAXFTP) { $paramkey='FTP_NAME_'.$i; //print $paramkey; - if (! empty($conf->global->$paramkey)) + if (getDolGlobalString($paramkey)) { $link="/ftp/index.php?idmenu=".$_SESSION["idmenu"]."&numero_ftp=".$i; - $newmenu->add($link, dol_trunc($conf->global->$paramkey,24)); + $newmenu->add($link, dol_trunc(getDolGlobalString($paramkey), 24)); } $i++; } @@ -2260,25 +2196,9 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta } elseif ($reshook == 1) { $menu_array = $hookmanager->results; // replace } - - // @todo Sort menu items by 'position' value - // $position = array(); - // foreach ($menu_array as $key => $row) { - // $position[$key] = $row['position']; - // } - // array_multisort($position, SORT_ASC, $menu_array); } // TODO Use the position property in menu_array to reorder the $menu_array - //var_dump($menu_array); - /*$new_menu_array = array(); - $level=0; $cusor=0; $position=0; - $nbentry = count($menu_array); - while (findNextEntryForLevel($menu_array, $cursor, $position, $level)) - { - - $cursor++; - }*/ // Show menu $invert=empty($menu_invert)?"":" is-inverted"; @@ -2293,7 +2213,7 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta $showmenu=true; $level= $menu_array[$i]['level']; - if (! empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED) && empty($menu_array[$i]['enabled'])) $showmenu=false; + if (getDolGlobalString('MAIN_MENU_HIDE_UNAUTHORIZED') && empty($menu_array[$i]['enabled'])) $showmenu=false; $alt++; @@ -2325,8 +2245,6 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta $url=preg_replace('/__LOGIN__/',$user->login,$url); $url=preg_replace('/__USERID__/',$user->id,$url); - //print ''."\n"; - // Level Menu = 0 if ($level == 0){ if ($menu_array[$i]['enabled']) { @@ -2382,8 +2300,6 @@ function print_left_oblyon_menu($db, $menu_array_before, $menu_array_after, &$ta function dol_oblyon_showmenu($type_user, &$menuentry, &$listofmodulesforexternal) { global $conf; - //print 'type_user='.$type_user.' module='.$menuentry['module'].' enabled='.$menuentry['enabled'].' perms='.$menuentry['perms']; - //print 'ok='.in_array($menuentry['module'], $listofmodulesforexternal); if (empty($menuentry['enabled'])) return 0; // Entry disabled by condition if ($type_user && $menuentry['module']) { @@ -2398,7 +2314,7 @@ function dol_oblyon_showmenu($type_user, &$menuentry, &$listofmodulesforexternal if (! $found) return 0; // Entry is for menus all excluded to external users } if (! $menuentry['perms'] && $type_user) return 0; // No permissions and user is external - if (! $menuentry['perms'] && ! empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED)) return 0; // No permissions and option to hide when not allowed, even for internal user, is on + if (! $menuentry['perms'] && getDolGlobalString('MAIN_MENU_HIDE_UNAUTHORIZED')) return 0; // No permissions and option to hide when not allowed, even for internal user, is on if (! $menuentry['perms']) return 2; // No permissions and user is external return 1; } diff --git a/core/menus/standard/oblyon_menu.php b/core/menus/standard/oblyon_menu.php index 036be5f..94c6253 100644 --- a/core/menus/standard/oblyon_menu.php +++ b/core/menus/standard/oblyon_menu.php @@ -121,7 +121,7 @@ public function showmenu($mode, $moredata=null) require_once DOL_DOCUMENT_ROOT.'/core/class/menu.class.php'; $this->menu=new Menu(); - if(empty($conf->global->MAIN_MENU_INVERT)) + if(!getDolGlobalString('MAIN_MENU_INVERT')) { if ($mode == 'top') { print_oblyon_menu($this->db, $this->atarget, $this->type_user, $this->tabMenu, $this->menu, 0, $mode); @@ -152,7 +152,6 @@ public function showmenu($mode, $moredata=null) print ''."\n"; foreach($this->menu->liste as $key => $val) { - // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu' print '
    '; print '
  • '; if ($val['enabled'] == 1) @@ -191,7 +190,6 @@ public function showmenu($mode, $moredata=null) } foreach($submenu->liste as $key2 => $val2) { - // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'] $relurl2=dol_buildpath($val2['url'],1); $relurl2=preg_replace('/__LOGIN__/',$user->login,$relurl2); $relurl2=preg_replace('/__USERID__/',$user->id,$relurl2); diff --git a/core/modules/modOblyon.class.php b/core/modules/modOblyon.class.php index f4ce339..6976626 100644 --- a/core/modules/modOblyon.class.php +++ b/core/modules/modOblyon.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015-2024 Alexandre Spangaro - * Copyright (C) 2022 Sylvain Legrand + * Copyright (C) 2022-2025 Sylvain Legrand * * 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 @@ -28,6 +28,7 @@ // Libraries ************************************ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; + dol_include_once('/oblyon/backport/v21/core/lib/functions.lib.php'); dol_include_once('/oblyon/lib/oblyon.lib.php'); // Description and activation class ************* @@ -43,47 +44,46 @@ function __construct($db) $langs->loadLangs(array('oblyon@oblyon', 'inovea@oblyon')); - $easyaVersion = (float) !empty($conf->global->EASYA_VERSION) ? $conf->global->EASYA_VERSION : ''; - + $easyaVersion = getDolGlobalFloat('EASYA_VERSION', 0); $this->db = $db; - $this->numero = 432573; // Unique Id for module + $this->numero = 432573; // Unique Id for module $this->name = preg_replace('/^mod/i', '', get_class($this)); // Module label (no space allowed) $this->editor_name = 'Inovea Conseil'; $this->editor_web = 'https://www.inovea-conseil.com'; $this->editor_url = "https://www.inovea-conseil.com"; $this->editor_email = 'support@inovea-conseil.com'; $this->url_last_version = 'https://raw.githubusercontent.com/aspangaro/oblyon/14.0/htdocs/custom/oblyon/VERSION'; - $this->rights_class = $this->name; // Key text used to identify module (for permissions, menus, etc...) - $this->family = 'Inovea Conseil'; // used to group modules in module setup page + $this->rights_class = $this->name; // Key text used to identify module (for permissions, menus, etc...) + $this->family = 'Inovea Conseil'; // used to group modules in module setup page $this->module_position = 10; $this->module_position = 1; - $this->description = $langs->trans('Module432573Desc'); // Module description - $this->version = file_get_contents(__DIR__.'/../../VERSION'); // Version : 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version - $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // llx_const table to save module status enabled/disabled - $this->special = 0; // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) - $this->picto = 'inovea@'.$this->name; // Name of image file used for this module. If in theme => 'pictovalue' ; if in module => 'pictovalue@module' under name object_pictovalue.png + $this->description = $langs->trans('Module432573Desc'); // Module description + $this->version = file_get_contents(__DIR__.'/../../VERSION'); // Version : 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version + $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // llx_const table to save module status enabled/disabled + $this->special = 0; // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) + $this->picto = 'inovea@'.$this->name; // Name of image file used for this module. If in theme => 'pictovalue' ; if in module => 'pictovalue@module' under name object_pictovalue.png $this->module_parts = array('menus' => 1, 'js' => array('js' => '/'.$this->name.'/js/pushy.js'), - 'css' => array('css' => ('/'.$this->name.'/css/'.$this->name.'.css'), ('/theme/'.$this->name.'/custom.css.php')), + 'css' => array('css' => ('/'.$this->name.'/css/'.$this->name.'.css'), ('/theme/'.$this->name.'/custom.css.php'), ('/'.$this->name.'/css/font.css')), 'tpl' => 0, - 'hooks' => array('data' => array('main'),'entity' => '0',), + 'hooks' => array('data' => array('main'), 'entity' => '0') ); - $this->dirs = array('/'.$this->name.'/sql'); // Data directories to create when module is enabled. Example: this->dirs = array("/mymodule/temp"); - $this->config_page_url = array('menus.php@'.$this->name); // List of php page, stored into mymodule/admin directory, to use to setup module. + $this->dirs = array('/'.$this->name.'/sql'); // Data directories to create when module is enabled. Example: this->dirs = array("/mymodule/temp"); + $this->config_page_url = array('menus.php@'.$this->name); // List of php page, stored into mymodule/admin directory, to use to setup module. // Dependencies - $this->hidden = false; // A condition to hide module - $this->depends = array(); // List of modules id that must be enabled if this module is enabled - $this->requiredby = array(); // List of modules id to disable if this one is disabled - $this->conflictwith = array(); // List of modules id this module is in conflict with - $this->phpmin = array(7, 1); // Minimum version of PHP required by module - $this->need_dolibarr_version = array(14,0); // Minimum version of Dolibarr required by module + $this->hidden = false; // A condition to hide module + $this->depends = array(); // List of modules id that must be enabled if this module is enabled + $this->requiredby = array(); // List of modules id to disable if this one is disabled + $this->conflictwith = array("modQuickUX"); // List of modules id this module is in conflict with + $this->phpmin = array(7,1); // Minimum version of PHP required by module + $this->need_dolibarr_version = array(14,0); // Minimum version of Dolibarr required by module if ($easyaVersion >= '2024') { $easya_info = json_decode(file_get_contents(__DIR__ . '/../../.easya_info.json')); - $this->phpmin = explode('.', $easya_info->php_min_version); // Minimum version of PHP required by module - $this->need_dolibarr_version = explode('.', $easya_info->dlb_min_version); // Minimum version of Dolibarr required by module + $this->phpmin = explode('.', $easya_info->php_min_version); // Minimum version of PHP required by module + $this->need_dolibarr_version = explode('.', $easya_info->dlb_min_version); // Minimum version of Dolibarr required by module } $this->langfiles = array($this->name.'@'.$this->name); - $this->const = array(); // List of particular constants to add when module is enabled + $this->const = array(); // List of particular constants to add when module is enabled // WIP - Remove classic Dolibarr tabs to avoid a theme change problem (Only available > 15.0.x) @@ -95,7 +95,7 @@ function __construct($db) //'ihm_admin:+template_oblyon:Colors:oblyon@oblyon::/oblyon/admin/colors.php', ); } - if (! isset($conf->oblyon->enabled)) { + if (!isModEnabled('oblyon')) { $conf->oblyon = new stdClass(); $conf->oblyon->enabled = 0; } @@ -134,6 +134,18 @@ function init($options = '') setEventMessage($langs->trans('OblyonCopyThemeError'), 'errors'); return 0; } + // Get highest font awesome directory + $path = dol_buildpath('/theme/common/', 0); + $listdir = dol_dir_list($path, 'directories', 0, '^fontawesome-', null, 'name', SORT_ASC, 0, 0, '', 0); + $listFontawesome = array(); + foreach ($listdir as $dir) { + if (empty($dir['name'])) continue; + if (preg_match('/^fontawesome-([0-9])$/', $dir['name'], $reg)) { + $listFontawesome[$reg[1]] = $dir['name']; + } + } + $fontawesome_directory = count($listFontawesome) > 1 ? $listFontawesome[max(array_keys($listFontawesome))] : (!empty($listFontawesome) ? reset($listFontawesome) : 'fontawesome-5'); + dolibarr_set_const($this->db, 'MAIN_FONTAWESOME_DIRECTORY', '/theme/common/'.$fontawesome_directory, 'chaine', 0, 'module Oblyon', 0); // delete old menu manager if (file_exists(dol_buildpath('/core/menus/standard/oblyon_menu.php'))) unlink(dol_buildpath('/core/menus/standard/oblyon_menu.php')); if (file_exists(dol_buildpath('/core/menus/standard/oblyon.lib.php'))) unlink(dol_buildpath('/core/menus/standard/oblyon.lib.php')); @@ -195,4 +207,3 @@ function remove($options = '') return $this->_remove($sql, $options); } } -?> diff --git a/css/font.css b/css/font.css new file mode 100644 index 0000000..33cb86e --- /dev/null +++ b/css/font.css @@ -0,0 +1,12 @@ +@font-face { + font-family: 'puentebold'; + src: url('/theme/oblyon/fonts/puentebold.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} +@font-face { + font-family: 'NeuropolRegular'; + src: url('/theme/oblyon/fonts/NeuropolRegular.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} diff --git a/langs/en_US/inovea.lang b/langs/en_US/inovea.lang index 1ee3998..5a67aa5 100644 --- a/langs/en_US/inovea.lang +++ b/langs/en_US/inovea.lang @@ -1,6 +1,6 @@ # Dolibarr language file - en_US - Inovea CHARSET=UTF-8 -InoveaAboutDesc1=This module is developed by Inovea Conseil

    For any question or feedback, contact us on support@open-dsi.fr

    For any question or feedback, file a support demand at -InoveaAboutDesc2=our support ticket -InoveaAboutDesc3=or contact us on support@inovea-conseil.com or at +33 3 29 66 95 78

    Find our other modules on Dolistore +InoveaAboutDesc1=This module is developed by Inovea Conseil. Your Dolibarr partner (developpement, hosting and training).

    You can find the documentation for your module in our documentation area

    For any question or feedback, contact us on support@open-dsi.fr

    For any question or feedback, file a support demand at our +InoveaAboutDesc2=support area Inovea Conseil +InoveaAboutDesc3=or contact us on support@inovea-conseil.com or at +33 3 29 66 95 78

    Discorver our modules and services on our website www.dolibiz.com or on the Dolistore InoveaLog=ChangeLog file diff --git a/langs/en_US/oblyon.lang b/langs/en_US/oblyon.lang index 1b72e4b..c239843 100644 --- a/langs/en_US/oblyon.lang +++ b/langs/en_US/oblyon.lang @@ -66,13 +66,25 @@ OblyonLogin = Login page LoginRight = Offset the connection block to the right of the screen CardBehavior = Behavior of the cards FixAreaRefAndTabAction = Fix the reference banner and action buttons during vertical scrolling +FixStickyTabsCard = Fix tab banner when scrolling vertically SwitchColunmOnLeft = Toggle selection / search / mass action column to the left RemoveKanbanViewInList = Remove the "Kanban view" button at the top right of the lists FixStickyTableHeadersColumns = Fix the table column header on the elements during vertical scrolling +FixStickyFirstColumn = Fix first column of tables when scrolling horizontally +FixStickyLastColumn = Fix last column of tables when scrolling horizontally General = General parameters OblyonFontSize = Basic text size in pixels (must be between 10 and 16) +OblyonFontFamily = Change Font family for Dolibarr interface MainStatusUseImages = The different statuses of the elements will be displayed as icons with or without explanatory text (otherwise a colored label will be used) +# +# Warnings +# +ResetCacheDisclaimer=For some options to take effect, it is necessary to clear the browser's cache.
    CTRL + F5 will suffice in most cases immediately after applying an option below. +WIP=Caution! Function under development - May cause unexpected display behavior +NotAvailableOnAllLists=Not available on all lists +WarningActivationOption1Enabled=Not recommended when %s is enabled + # # Colors page # @@ -85,9 +97,11 @@ OBLYON_COLOR_LOGO_BCKGRD = Logo background color OBLYON_COLOR_LOGIN_BCKGRD = Login background color OBLYON_COLOR_BTITLE = Title background color OBLYON_COLOR_FTITLE = Text color of the titles +OBLYON_COLOR_STITLE = Text color of the Main titles OBLYON_COLOR_BLINE = Lines background color OBLYON_COLOR_BLINE_HOVER = Background color of the hovered lines -OBLYON_COLOR_FDATE_DEFAULT = Default date color (today's date) in choice calendars +OBLYON_COLOR_FDATE_DEFAULT = Default date color (today's date) in date picker +OBLYON_COLOR_FDATE_SELECTED = Selected date color in date picker OBLYON_COLOR_FLINE = Lines text color OBLYON_COLOR_FLINE_HOVER = Lines text hover color OBLYON_COLOR_TOPMENU_BCKGRD = Topmenu background color @@ -123,6 +137,7 @@ OBLYON_COLOR_TEXTTABACTIVE = Color text of active tabs OBLYON_COLOR_INPUT_BCKGRD = Background color of inputs OBLYON_COLOR_INFOBOX_BCKGRD1 = Background color 1 of active kanban cards (applications / modules) OBLYON_COLOR_INFOBOX_BCKGRD2 = Background color 2 of active kanban cards (applications / modules) +OBLYON_COLOR_BORDER_ACTIONCOLUMN = Border color of the 'action' column of the tables InvertRatioDesc = Color Inversion Filter Ratio (Applicable to icons based on PNG image files) Eldys = Basic colors THEME_ELDY_TOPBORDER_TITLE1 = Title border color @@ -155,6 +170,8 @@ OblyonDashboardTitle = Oblyon configurator - Dashboard OblyonDashboardDisableBlocks =Thumbs of open objects (to process or late) on main dashboard DisableGlobalBoxStats = Disable the global statistics widget (number of items in database) InfoboxColorOnBackground = Invert the colors of the icons and the background of the thumbnails +OblyonInfoboxSingleWidth = Standardize the width of the thumbnails (Dolibarr standard 280px) +OblyonInfoboxSingleWidthHelp = Otherwise the width will adapt to the length of the information presented (the minimum width is 260px) ColorIntensity = Color intensity ColorIntensityDesc = Set the intensity to the colors below (Currently %s) ColorMoreDarker = Less intense @@ -206,13 +223,42 @@ OBLYON_SOCIAL_GITHUB = Github # # Options page # -OblyonOptionsTitle = Options -OblyonMainUseQuickAddDropdown = Add the quick action menu (in top right) -OblyonMainUseBookmarkDropdown = Add the bookmark menu (in top right) -OblyonImageHeightTable = Maximum height of images in lists (tables) -OblyonDisableVersion = Don't show the version number of Dolibarr (in top right) -OblyonPaddingRightBottom = Display a margin at the bottom of the page on the right side +OblyonOptionsTitle = Oblyon Configurator - Options +OptionsGeneral = General options +OblyonOptions = Options +OblyonMainUseQuickAddDropdown = Add the quick action menu (in top right) +OblyonMainUseSearchDropdown = Add the search menu (in top right) +OblyonMainUseBookmarkDropdown = Add the bookmark menu (in top right) +OblyonImageHeightTable = Maximum height of images in lists (tables) +OblyonDisableVersion = Don't show the version number of Dolibarr (in top right) +OblyonPaddingRightBottom = Display a margin at the bottom of the page on the right side + +# List +OptionsList = List options +SwitchColumnOnLeft = Flip the selection / search / mass action column to the left +FixTitleInList = Sticky list title bar so that title, mass action, pagination and “Add” element are always visible +RemoveKanbanViewInList = Remove the “Kanban view” button at the top right of lists +FixStickyTableHeadersColumns = Sticky table column headers on elements when scrolling vertically +FixStickyFirstColumn = Sticky first column of tables when scrolling horizontally +FixStickyLastColumn = Sticky last table column when scrolling horizontally +FixStickyTotalBar = Sticky total bar at the bottom of the page +ShowGrandTotalList = Display grand totals without pagination if amounts differ from classic totals +FixStickyGrandTotalBar = Sticky grand total bar at the bottom of the page + +# Card +OptionsCard = Card options +FixStickyTabsCard = Sticky tab banner when scrolling vertically +FixAreaRefCard = Sticky area ref when scrolling vertically. (Disabled on mobiles phones) +MainMaxTabsInCard = Maximum number of tabs visible. Others are grouped into a combo list +LimitTabLineToOne = (Allows you to limit the tabs to a single line => necessary when the 2 previous options are active simultaneously) +FixAbsoluteButtonsActionCard = Sticky action buttons at bottom of the page +ShowLineNumberCard = Show line number (Invoice, proposal, etc) +# CKEditor +OptionsCKEditor = WYSIWYG Text Editor and Label Options +FckeditorAllowAnyContent = Allows you to enter any content into the text editor. Be careful, this will completely disable content filtering, one of CKEditor's most important features (useful for preserving all your HTML tags and attributes) +FckeditorEnableScaytAutostartup = Enables the text editor's SpellCheckAsYouType (SCAYT) features (automatic spell checking) +MainSecurityAllowUnsecuredLabelsWithHtml = Allow HTML tags in article labels # # Icons page # diff --git a/langs/fr_FR/inovea.lang b/langs/fr_FR/inovea.lang index 637110e..3dc163e 100644 --- a/langs/fr_FR/inovea.lang +++ b/langs/fr_FR/inovea.lang @@ -1,6 +1,6 @@ # Dolibarr language file - fr_FR - Inovea CHARSET=UTF-8 -InoveaAboutDesc1=Ce module a été développé par Inovea Conseil

    Pour toute question technique ou retour, déposez une demande de support sur -InoveaAboutDesc2=notre support -InoveaAboutDesc3=ou contactez-nous sur support@inovea-conseil.com

    Pour toute question commerciale, contactez-nous sur info@inovea-conseil.com ou au +33 3 29 66 95 78

    Retrouvez nos autres modules sur Dolistore +InoveaAboutDesc1=Ce module a été développé par Inovea Conseil. Votre partenaire Dolibarr pour tout développement de modules sur-mesure, de la formation et de l'hébergement Dolibarr.

    Retrouvez la documentation de votre module sur notre espace de documentation

    Pour toute question technique ou retour, déposez une demande de support sur +InoveaAboutDesc2=Espace support Inovea Conseil +InoveaAboutDesc3=ou contactez-nous sur support@inovea-conseil.com

    Pour toute question commerciale, contactez-nous sur info@inovea-conseil.com ou au +33 3 29 66 95 78

    Vous pourrez découvrir nos autres modules et services sur notre site Dolibiz.com ou le Dolistore InoveaChangeLog=Fichier de log diff --git a/langs/fr_FR/oblyon.lang b/langs/fr_FR/oblyon.lang index 712bc94..8b635c8 100644 --- a/langs/fr_FR/oblyon.lang +++ b/langs/fr_FR/oblyon.lang @@ -1,14 +1,14 @@ # < Oblyon Control Panel - French translation > # Copyright (C) 2015 Nicolas Rivera # Copyright (C) 2015-2024 Alexandre Spangaro +# Copyright (C) 2015-2025 Sylvain Legrand # -Module432573Name = Oblyon -Module432573Desc = Panneau d'options qui vous permet de personnaliser le thème Oblyon - -OblyonParamAction1 = Sauvegarder / Restaurer l'ensemble des paramètres du module -OblyonParamAction2 =
    (après une restauration rafraichissez la page (F5) pour visualiser le résultat) -OblyonParamBkup = Sauvegarder -OblyonParamRestore = Restaurer +Module432573Name = Oblyon +Module432573Desc = Panneau d'options qui vous permet de personnaliser le thème Oblyon +OblyonParamAction1 = Sauvegarder / Restaurer l'ensemble des paramètres du module +OblyonParamAction2 =
    (après une restauration rafraichissez la page (F5) pour visualiser le résultat) +OblyonParamBkup = Sauvegarder +OblyonParamRestore = Restaurer OblyonDeleteThemeError = Une erreur s'est produite lors de la suppression du thème Oblyon OblyonCopyThemeError = Une erreur s'est produite lors de la copie du thème Oblyon @@ -74,12 +74,16 @@ FixStickyFirstColumn = Fixer la première colonne des tableaux l FixStickyLastColumn = Fixer la dernière colonne des tableaux lors d'un défilement horizontal General = Paramètres généraux OblyonFontSize = Taille du texte de base en pixels (doit être entre 10 et 16) +OblyonFontFamily = Police de caractères utilisée pour l'interface Dolibarr MainStatusUseImages = Les différents statuts des éléments seront affichés sous forme d'icône avec ou sans texte explicatif (sinon un libellé coloré sera utilisé) # # Warnings # -WIP = Attention ! Fonction en cours de développement - Peut provoquer un comportement inattendu au niveau de l'affichage +ResetCacheDisclaimer = Pour que certaines options soient effectives, il est nécessaire de vider le cache du navigateur.
    CTRL + F5 suffira dans la plupart des cas juste après avoir appliqué une option ci-dessous. +WIP = Attention ! Fonction en cours de développement - Peut provoquer un comportement inattendu au niveau de l'affichage +NotAvailableOnAllLists = Non disponible sur toutes les listes +WarningActivationOption1Enabled = Activation déconseillée lorsque l'option %s est activée # # Colors page @@ -93,9 +97,11 @@ OBLYON_COLOR_LOGO_BCKGRD = Couleur de fond du logo OBLYON_COLOR_LOGIN_BCKGRD = Couleur de fond de la page de connexion OBLYON_COLOR_BTITLE = Couleur de fond des titres OBLYON_COLOR_FTITLE = Couleur de texte des titres +OBLYON_COLOR_STITLE = Couleur de texte du titre principal OBLYON_COLOR_BLINE = Couleur de fond des lignes OBLYON_COLOR_BLINE_HOVER = Couleur de fond des lignes survolées -OBLYON_COLOR_FDATE_DEFAULT = Couleur de la date par défaut (date du jour) dans les calendriers de choix +OBLYON_COLOR_FDATE_DEFAULT = Couleur de date par défaut (date du jour) dans le sélecteur de date +OBLYON_COLOR_FDATE_SELECTED = Couleur de date sélectionnée dans le sélecteur de date OBLYON_COLOR_FLINE = Couleur de texte des lignes OBLYON_COLOR_FLINE_HOVER = Couleur du texte survolé des lignes OBLYON_COLOR_TOPMENU_BCKGRD = Couleur de fond du menu haut @@ -131,6 +137,7 @@ OBLYON_COLOR_TEXTTABACTIVE = Couleur de texte des onglets actifs OBLYON_COLOR_INPUT_BCKGRD = Couleur de fond des zones de saisie OBLYON_COLOR_INFOBOX_BCKGRD1 = Couleur de fond 1 des cartes kanban active (applications / modules) OBLYON_COLOR_INFOBOX_BCKGRD2 = Couleur de fond 2 des cartes kanban active (applications / modules) +OBLYON_COLOR_BORDER_ACTIONCOLUMN = Couleur de bordure de la colonne 'action' des tableaux InvertRatioDesc = Ratio du filtre d'inversion des couleurs (Applicable aux icones basées sur des fichiers images PNG) Eldys = Couleurs de base THEME_ELDY_TOPBORDER_TITLE1 = Couleur des bordures de titre @@ -163,6 +170,8 @@ OblyonDashboardTitle = Configurateur Oblyon - Tableau de bord OblyonDashboardDisableBlocks = Vignette des éléments ouverts (à traiter ou en retard) sur le tableau de bord principal DisableGlobalBoxStats = Désactiver le widget des statistiques globales (nombres d'éléments en base de données) InfoboxColorOnBackground = Inverser les couleurs des icônes et du fond des vignettes +OblyonInfoboxSingleWidth = Uniformiser la largeur des vignettes (standard Dolibarr 280px) +OblyonInfoboxSingleWidthHelp = Sinon la largeur s'adaptera à la longueur des informations présentées (la largeur minimum est de 260px) ColorIntensity = Intensité des couleurs ColorIntensityDesc = Définir l'intensité sur les couleurs ci-dessous (Actuellement %s) ColorMoreDarker = Moins intense @@ -214,12 +223,42 @@ OBLYON_SOCIAL_GITHUB = URL Github # # Options page # -OblyonOptionsTitle = Options -OblyonMainUseQuickAddDropdown = Utiliser le menu d'ajout rapide des éléments (En haut à droite) -OblyonMainUseBookmarkDropdown = Utiliser le menu des marques pages (En haut à droite) -OblyonImageHeightTable = Hauteur maximale des images dans les listes (tables) -OblyonDisableVersion = Ne pas afficher le numéro de version de Dolibarr (En haut à droite) -OblyonPaddingRightBottom = Afficher une marge en bas de page sur la partie droite +OblyonOptionsTitle = Configurateur Oblyon - Options +OptionsGeneral = Options générales +OblyonOptions = Options +OblyonMainUseQuickAddDropdown = Utiliser le menu d'ajout rapide des éléments (En haut à droite) +OblyonMainUseSearchDropdown = Utiliser le menu de recherche (En haut à droite) +OblyonMainUseBookmarkDropdown = Utiliser le menu des marques pages (En haut à droite) +OblyonImageHeightTable = Hauteur maximale des images dans les listes (tables) +OblyonDisableVersion = Ne pas afficher le numéro de version de Dolibarr (En haut à droite) +OblyonPaddingRightBottom = Afficher une marge en bas de page sur la partie droite + +# List +OptionsList = Options des listes +SwitchColumnOnLeft = Basculer la colonne de sélection / recherche / action en masse à gauche +FixTitleInList = Fixer la barre de titre des listes de manière à toujours voir le titre, l'action en masse, la pagination et l'élément "Ajouter" +RemoveKanbanViewInList = Retirer le bouton "Vue kanban" en haut à droite des listes +FixStickyTableHeadersColumns = Fixer l'entête de colonne des tableaux sur les éléments lors d'un défilement vertical +FixStickyFirstColumn = Fixer la première colonne des tableaux lors d'un défilement horizontal +FixStickyLastColumn = Fixer la dernière colonne des tableaux lors d'un défilement horizontal +FixStickyTotalBar = Fixer la barre des totaux des tableaux en bas de page +ShowGrandTotalList = Afficher les totaux généraux hors pagination si les montants sont différents des totaux classiques +FixStickyGrandTotalBar = Fixer la barre des totaux généraux des tableaux en bas de page + +# Card +OptionsCard = Options des fiches +FixStickyTabsCard = Fixer le bandeau des onglets lors d'un défilement vertical +FixAreaRefCard = Fixer l'espace référence de la fiche lors d'un défilement vertical. (Désactivé sur les téléphones portables) +MainMaxTabsInCard = Nombre maximal d'onglets visibles. Les autres onglets sont regroupés dans une liste déroulante +LimitTabLineToOne = (Permet de limiter les onglets à une seule ligne => fortement conseillé quand les 2 options précédentes sont activées simultanément) +FixAbsoluteButtonsActionCard = Fixer les boutons d'actions en bas de page +ShowLineNumberCard = Afficher le numéro des lignes (Facture, proposition commerciale, etc) + +# CKEditor +OptionsCKEditor = Options de l'éditeur de texte WYSIWYG et des libellés +FckeditorAllowAnyContent = Permet de saisir n'importe quel contenu dans l'éditeur de texte. Attention, cela désactivera totalement le filtrage de contenu, l'une des fonctionnalités les plus importantes de CKEditor (utile pour conserver toutes vos balises et attributs HTML) +FckeditorEnableScaytAutostartup = Permet d'activer les fonctions SpellCheckAsYouType (SCAYT) de l'éditeur de texte (vérification orthographique automatique) +MainSecurityAllowUnsecuredLabelsWithHtml = Autoriser les balises HTML dans le libellé des articles # # Icons page diff --git a/lib/inovea_common.lib.php b/lib/inovea_common.lib.php index 32cab76..80f478a 100644 --- a/lib/inovea_common.lib.php +++ b/lib/inovea_common.lib.php @@ -65,7 +65,7 @@ function inovea_common_getChangeLog($moduleName) @include_once DOL_DOCUMENT_ROOT . '/core/lib/parsemd.lib.php'; $content = dolMd2Html($content, 'parsedown', array('doc/' => $moduleUrlPath . '/doc/')); } else { - $content = inovea_common_dolMd2Html('codenaf', $content, 'parsedown', array('doc/' => $moduleUrlPath . '/doc/')); + $content = inovea_common_dolMd2Html('oblyon', $content, 'parsedown', array('doc/' => $moduleUrlPath . '/doc/')); } } diff --git a/lib/oblyon.lib.php b/lib/oblyon.lib.php index 6042e45..793d73a 100644 --- a/lib/oblyon.lib.php +++ b/lib/oblyon.lib.php @@ -1,7 +1,7 @@ - * Copyright (C) 2022 Sylvain Legrand + * Copyright (C) 2022-2025 Sylvain Legrand * * 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 @@ -44,14 +44,14 @@ function oblyon_admin_prepare_head() $head[$h][2] = 'menus'; $h++; - if(!empty($conf->global->EASYA_VERSION)) { - if ((float)$conf->global->EASYA_VERSION >= 2022.5) { - $head[$h][0] = dol_buildpath("/oblyon/admin/icons.php", 1); - $head[$h][1] = $langs->trans("Icons"); - $head[$h][2] = 'icons'; - $h++; - } - } + $fontawesomeFamily = explode(' ', getDolGlobalString('MAIN_FONTAWESOME_FAMILY', '')); + dol_syslog('ici $fontawesomeFamily[3] = '. $fontawesomeFamily[3]); + if (!empty($fontawesomeFamily[3]) && $fontawesomeFamily[3] != 'Free') { + $head[$h][0] = dol_buildpath("/oblyon/admin/icons.php", 1); + $head[$h][1] = $langs->trans("Icons"); + $head[$h][2] = 'icons'; + $h++; + } $head[$h][0] = dol_buildpath("/oblyon/admin/colors.php", 1); $head[$h][1] = $langs->trans("Colors"); @@ -64,14 +64,14 @@ function oblyon_admin_prepare_head() $h++; $head[$h][0] = dol_buildpath("/oblyon/admin/options.php", 1); - $head[$h][1] = $langs->trans("Options"); + $head[$h][1] = $langs->trans("OblyonOptions"); $head[$h][2] = 'options'; $h++; - $head[$h][0] = dol_buildpath("/oblyon/admin/customcss.php", 1); - $head[$h][1] = $langs->trans("CustomCSS"); - $head[$h][2] = 'customcss'; - $h++; + $head[$h][0] = dol_buildpath("/oblyon/admin/customcss.php", 1); + $head[$h][1] = $langs->trans("CustomCSS"); + $head[$h][2] = 'customcss'; + $h++; // Show more tabs from modules // Entries must be declared in modules descriptor with line @@ -83,17 +83,17 @@ function oblyon_admin_prepare_head() //); // to remove a tab complete_head_from_modules($conf, $langs, null, $head, $h, 'admin_oblyon'); - complete_head_from_modules($conf, $langs, null, $head, $h, 'admin_oblyon', 'remove'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'admin_oblyon', 'remove'); $head[$h][0] = dol_buildpath("/oblyon/admin/about.php", 1); - $head[$h][1] = $langs->trans("About") . " / " . $langs->trans("Support"); + $head[$h][1] = $langs->trans("About") . " / " . $langs->trans("Support"); $head[$h][2] = 'about'; $h++; - $head[$h][0] = dol_buildpath("/oblyon/admin/changelog.php", 1); - $head[$h][1] = $langs->trans("InoveaChangeLog"); - $head[$h][2] = 'changelog'; - $h++; + $head[$h][0] = dol_buildpath("/oblyon/admin/changelog.php", 1); + $head[$h][1] = $langs->trans("InoveaChangeLog"); + $head[$h][2] = 'changelog'; + $h++; return $head; } @@ -107,16 +107,11 @@ function oblyon_admin_prepare_head() function oblyon_bkup_module ($appliname) { global $db, $conf, $langs, $errormsg; - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - // Set to UTF-8 - if (is_a($db, 'DoliDBMysqli')) $db->db->set_charset('utf8'); - else { - $db->query('SET NAMES utf8'); - $db->query('SET CHARACTER SET utf8'); - } + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + // Control dir and file - $path = DOL_DATA_ROOT.'/'.(empty($conf->global->MAIN_MODULE_MULTICOMPANY) || $conf->entity == 1 ? '' : $conf->entity.'/').$appliname.'/sql'; + $path = DOL_DATA_ROOT.'/'.(!isModEnabled('multicompany') || $conf->entity == 1 ? '' : $conf->entity.'/').$appliname.'/sql'; $bkpfile = $path.'/update.'.$conf->entity; if (! file_exists($path)) { if (dol_mkdir($path) < 0) { @@ -134,7 +129,7 @@ function oblyon_bkup_module ($appliname) // Print headers and global mysql config vars $sqlhead = '-- '.$db::LABEL.' dump via php with Dolibarr '.DOL_VERSION.' -- --- Host: '.$db->db->host_info.' Database: '.$db->database_name.' +-- Host: '.$db->db->host_info.' Database: '.$db->database_name.' -- ------------------------------------------------------ -- Server version '.$db->db->server_info.' -- Dolibarr version '.DOL_VERSION.' @@ -156,7 +151,7 @@ function oblyon_bkup_module ($appliname) $sql_const .= ')'; $sql_const .= ' AND entity = "'.$conf->entity.'"'; $sql_const .= ' ORDER BY name'; - fwrite($handle, oblyon_bkup_table ('const', $sql_const, $cols_const, $duplicate_constduplicate_const)); + fwrite($handle, oblyon_bkup_table ('const', $sql_const, $cols_const, $duplicate_const)); // Enabling back the keys/index checking $sqlfooter = ' SET FOREIGN_KEY_CHECKS = 1; @@ -173,9 +168,9 @@ function oblyon_bkup_module ($appliname) /************************************************ * Recherche d'un fichier contenant un code langue dans son nom à partir d'une liste * - * @param string $table table name to backup + * @param string $table table name to back up * @param string $sql sql query to prepare data for backup - * @param array $listeCols list of columns to backup on the table + * @param array $listeCols list of columns to back up on the table * @param array $duplicate values for 'ON DUPLICATE KEY UPDATE' * [0] = column to update * [1] = column name to update @@ -235,17 +230,22 @@ function oblyon_bkup_table ($table, $sql, $listeCols, $duplicate = array (), $tr function oblyon_restore_module ($appliname) { global $conf; - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $pathsql = DOL_DATA_ROOT.'/'.(empty($conf->global->MAIN_MODULE_MULTICOMPANY) || $conf->entity == 1 ? '' : $conf->entity.'/').$appliname.'/sql'; + $pathsql = DOL_DATA_ROOT.'/'.(!getDolGlobalString('MAIN_MODULE_MULTICOMPANY') || $conf->entity == 1 ? '' : $conf->entity.'/').$appliname.'/sql'; $handle = @opendir($pathsql); if (is_resource($handle)) { - $filesql = $pathsql.'/'.'update.'.$conf->entity; - $moved = dol_copy($filesql, $filesql.'.sql'); - if (is_file($filesql.'.sql')) $result = run_sql($filesql.'.sql', (empty($conf->global->MAIN_DISPLAY_SQL_INSTALL_LOG) ? 1 : 0), $conf->entity, 1); - $delete = dol_delete_file($filesql.'.sql'); + $filesql = $pathsql.'/'.'update.'.$conf->entity; + $moved = dol_copy($filesql, $filesql.'.sql'); + if (is_file($filesql.'.sql')) { + $result = run_sql($filesql.'.sql', (getDolGlobalString('MAIN_DISPLAY_SQL_INSTALL_LOG') ? 1 : 0), $conf->entity, 1); + } + $delete = dol_delete_file($filesql.'.sql'); + dol_syslog('oblyon.Lib::oblyon_restore_module appliname = '.$appliname.' filesql = '.$filesql.' moved = '.$moved.' result = '.$result.' delete = '.$delete); - if ($result > 0) return 1; + if ($result > 0) { + return 1; + } } return -1; } @@ -258,17 +258,17 @@ function oblyon_print_backup_restore() { global $conf, $langs; - print ' '; + print '
    '; $metas = array('*', '90px', '156px', '120px'); oblyon_print_colgroup($metas); - print ' - - - - -
    - '.$langs->trans('OblyonParamAction1').' '.$langs->trans('Module432573Name').' '.$langs->trans('OblyonParamAction2').' -
    '; + print ''; + print ''; + print ''.$langs->trans('OblyonParamAction1').' '.$langs->trans('Module432573Name').' '.$langs->trans('OblyonParamAction2').''; + print ''; + print ''; + print ''; + print ''; + print ''; } /************************************************ @@ -279,9 +279,9 @@ function oblyon_print_backup_restore() ************************************************/ function oblyon_print_colgroup($metas = array()) { - print ' '; - foreach ($metas as $values) print ' '; - print ' '; + print ''; + foreach ($metas as $values) print ' '; + print ''; } /************************************************ @@ -294,10 +294,10 @@ function oblyon_print_liste_titre($metas = array()) { global $langs; - print ' '; + print ''; for ($i = 1 ; $i < count($metas) ; $i++) - print ' '.$langs->trans($metas[$i]).''; - print ' '; + print ''.$langs->trans($metas[$i]).''; + print ''; } /************************************************ @@ -310,31 +310,31 @@ function oblyon_print_btn_action($action) { global $langs; - print '
    - -
    '; + print '
    '; + print ''; + print '
    '; } /************************************************ * Print HTML HR line * - * @param int $cs1 first colspan + * @param int $cs1 first colspan * @return void ************************************************/ function oblyon_print_hr($cs1 = 3) { - print '
    '; + print '
    '; } /************************************************ * Print HTML final line * - * @param int $cs1 first colspan + * @param int $cs1 first colspan * @return void ************************************************/ function oblyon_print_final($cs1 = 3) { - print '  '; + print ' '; } /************************************************ @@ -344,7 +344,7 @@ function oblyon_print_final($cs1 = 3) * @param string $tag input type (on/off button, input, textarea, color select, select, range, select_types_paiements, selectTypeContact) * @param string $desc Description of action * @param string $help Help description => active tooltip - * @param array $metas list of HTML parameters and values (example : 'type'=>'text' and/or 'class'=>'flat center', etc...) + * @param array $metas list of HTML parameters and values (example: 'type'=>'text' and/or 'class'=>'flat center', etc...) * @param int $cs1 first colspan * @param int $cs2 second colspan * @param string $begin if input element string to be added before or empty td to begin the line @@ -359,53 +359,65 @@ function oblyon_print_input($confkey, $tag = 'on_off', $desc = '', $help = '', $ $formother = new FormOther($db); $formcompany = new FormCompany($db); $formactions = new FormActions($db); - print ' '; + print ''; if ($tag != 'textarea') { - print ' '; - if (!empty($help)) print $form->textwithtooltip(($desc ? $desc : $langs->trans($confkey)), $langs->trans($help), 2, 1, img_help(1, '')); - else print $desc ? $desc : $langs->trans($confkey); - - if (in_array($tag, ['color', 'input']) && preg_match('/(TXT|TEXT)/i', $confkey) && $conf->global->$confkey == '#FFFFFF') print ' ' . $form->textwithpicto('', $langs->trans('OblyonWarningColorWhiteHelp'), 1, 'warning'); - print ' - '; - } - else { - print ' '; - if (!empty($help)) print $form->textwithpicto(($desc ? $desc : $langs->trans($confkey)), $langs->trans($help), 1, 'help', '', 0, 2, ''); - else print $desc; - if (!empty($desc) || !empty($help)) print '
    '; + print ''; + if (!empty($help)) { + print $form->textwithtooltip(($desc ? $desc : $langs->trans($confkey)), $langs->trans($help), 2, 1, img_help(1, '')); + } else { + print $desc ? $desc : $langs->trans($confkey); + } + if (in_array($tag, ['color', 'input']) && preg_match('/(TXT|TEXT)/i', $confkey) && getDolGlobalString($confkey) == '#FFFFFF') { + print ' ' . $form->textwithpicto('', $langs->trans('OblyonWarningColorWhiteHelp'), 1, 'warning'); + } + print ''; + print ''; + } else { + print ''; + if (!empty($help)) { + print $form->textwithpicto(($desc ? $desc : $langs->trans($confkey)), $langs->trans($help), 1, 'help', '', 0, 2, ''); + } else { + print $desc; + } + if (!empty($desc) || !empty($help)) { + print '
    '; + } } - print (!empty($begin) && !preg_match('/ - '.(strpos($conf->global->$confkey, $metas) !== false ? img_picto($langs->trans('Activated'), 'switch_on') : img_picto($langs->trans('Disabled'), 'switch_off')).' - '; - elseif ($tag == 'input') { - $constantKey = !empty($conf->global->$confkey) ? $conf->global->$confkey : 0; - $defaultMetas = array('type' => 'text', 'class' => 'flat quatrevingtpercent', 'style' => 'padding: 0; font-size: inherit;', 'name' => $confkey, 'id' => $confkey, 'value' => $constantKey); - $metas = array_merge ($defaultMetas, $metas); - $metascompil = ''; - foreach ($metas as $key => $value) $metascompil .= ' '.$key.($key == 'enabled' || $key == 'disabled' ? '' : ' = "'.$value.'"'); + if ($tag == 'on_off2') { + print ''; + print (str_contains(getDolGlobalString($confkey), $metas) ? img_picto($langs->trans('Activated'), 'switch_on') : img_picto($langs->trans('Disabled'), 'switch_off')); + print ''; + } elseif ($tag == 'input') { + $constantKey = getDolGlobalString($confkey, 0); + $defaultMetas = array('type' => 'text', 'class' => 'flat quatrevingtpercent', 'style' => 'padding: 0; font-size: inherit;', 'name' => $confkey, 'id' => $confkey, 'value' => $constantKey); + $metas = array_merge ($defaultMetas, $metas); + $metascompil = ''; + foreach ($metas as $key => $value) { + $metascompil .= ' '.$key.($key == 'enabled' || $key == 'disabled' ? '' : ' = "'.$value.'"'); + } print ' <'.$tag.' '.$metascompil.'>'.(!preg_match('/global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) print ''; + if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) { + print ''; + } else { - $doleditor = new DolEditor($confkey, $conf->global->$confkey, '', 80, 'dolibarr_notes'); + $doleditor = new DolEditor($confkey, getDolGlobalString($confkey), '', 80, 'dolibarr_notes'); print $doleditor->Create(); } } elseif ($tag == 'color') print $formother->selectColor($metas, $confkey); elseif ($tag == 'select' || $tag == 'range') print $metas; - elseif ($tag == 'select_types_paiements') $form->select_types_paiements($conf->global->$confkey, $confkey, $metas[0], $metas[1], $metas[2], $metas[3], $metas[4]); + elseif ($tag == 'select_types_paiements') $form->select_types_paiements(getDolGlobalString($confkey), $confkey, $metas[0], $metas[1], $metas[2], $metas[3], $metas[4]); elseif ($tag == 'selectTypeContact') print $formcompany->selectTypeContact($metas[0], $metas[1], $confkey, $metas[2], $metas[3], $metas[4], $metas[5]); - elseif ($tag == 'select_type_actions') $formactions->select_type_actions($conf->global->$confkey, $confkey, $metas[0], $metas[1], $metas[2]); + elseif ($tag == 'select_type_actions') $formactions->select_type_actions(getDolGlobalString($confkey), $confkey, $metas[0], $metas[1], $metas[2]); if (!preg_match('/'; + print ''; if (preg_match('/'; + print ''; } ?> \ No newline at end of file diff --git a/sql/data.sql b/sql/data.sql index 319a5c5..3151ca4 100644 --- a/sql/data.sql +++ b/sql/data.sql @@ -26,147 +26,157 @@ SET FOREIGN_KEY_CHECKS = 0; SET SQL_MODE = 'NO_AUTO_VALUE_ON_ZERO'; -- Data for table llx_const -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_MENU_STANDARD_FORCED', '__ENTITY__', 'oblyon_menu.php', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_MENUFRONT_STANDARD_FORCED', '__ENTITY__', 'oblyon_menu.php', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_MENU_SMARTPHONE_FORCED', '__ENTITY__', 'oblyon_menu.php', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_MENUFRONT_SMARTPHONE_FORCED', '__ENTITY__', 'oblyon_menu.php', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_ELDY_ENABLE_PERSONALIZED', '__ENTITY__', '1', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_MENU_STANDARD_FORCED', '__ENTITY__', 'oblyon_menu.php', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_MENUFRONT_STANDARD_FORCED', '__ENTITY__', 'oblyon_menu.php', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_MENU_SMARTPHONE_FORCED', '__ENTITY__', 'oblyon_menu.php', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_MENUFRONT_SMARTPHONE_FORCED', '__ENTITY__', 'oblyon_menu.php', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_ELDY_ENABLE_PERSONALIZED', '__ENTITY__', '1', 'chaine', '0', 'Oblyon module'); -- Menus -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_MENU_INVERT', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_MENU_INVERT', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); -- Menus - top -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_FULLSIZE_TOPBAR', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_SHOW_LOGO', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_STICKY_TOPBAR', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_HIDE_TOPICONS', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_FULLSIZE_TOPBAR', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_SHOW_LOGO', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_STICKY_TOPBAR', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_HIDE_TOPICONS', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module'); -- Menus - left -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_SHOW_COMPNAME', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_STICKY_LEFTBAR', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_HIDE_LEFTMENU', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_EFFECT_LEFTMENU', '__ENTITY__', 'slide', 'chaine', '0', 'Oblyon leftmenu effect behavior'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_HIDE_LEFTICONS', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_REDUCE_LEFTMENU', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_EFFECT_REDUCE_LEFTMENU', '__ENTITY__', 'only', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_SHOW_COMPNAME', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_STICKY_LEFTBAR', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_HIDE_LEFTMENU', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_EFFECT_LEFTMENU', '__ENTITY__', 'slide', 'chaine', '0', 'Oblyon leftmenu effect behavior'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_HIDE_LEFTICONS', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_REDUCE_LEFTMENU', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_EFFECT_REDUCE_LEFTMENU', '__ENTITY__', 'only', 'chaine', '0', 'Oblyon module'); -- Color - use Oblyon Green by default -- Color - top -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_TOPMENU_BCKGRD', '__ENTITY__', '#34495E', 'chaine', '0', 'Oblyon background topmenu color'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_TOPMENU_BCKGRD_HOVER', '__ENTITY__', '#2C3E50', 'chaine', '0', 'Oblyon background topmenu hover color'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_TOPMENU_TXT', '__ENTITY__', '#FFFFFF', 'chaine', '0', 'Oblyon topmenu text color'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_TOPMENU_TXT_ACTIVE', '__ENTITY__', '#FFFFFF', 'chaine', '0', 'Oblyon text top menu active'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_TOPMENU_TXT_HOVER', '__ENTITY__', '#FFFFFF', 'chaine', '0', 'Oblyon text top menu hover'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_TOPMENU_BCKGRD', '__ENTITY__', '#34495E', 'chaine', '0', 'Oblyon background topmenu color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_TOPMENU_BCKGRD_HOVER', '__ENTITY__', '#2C3E50', 'chaine', '0', 'Oblyon background topmenu hover color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_TOPMENU_TXT', '__ENTITY__', '#FFFFFF', 'chaine', '0', 'Oblyon topmenu text color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_TOPMENU_TXT_ACTIVE', '__ENTITY__', '#FFFFFF', 'chaine', '0', 'Oblyon text top menu active'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_TOPMENU_TXT_HOVER', '__ENTITY__', '#FFFFFF', 'chaine', '0', 'Oblyon text top menu hover'); -- Color - left -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_LEFTMENU_BCKGRD', '__ENTITY__', '#2ECC71', 'chaine', '0', 'Oblyon background leftmenu color'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_LEFTMENU_BCKGRD_HOVER', '__ENTITY__', '#29B564', 'chaine', '0', 'Oblyon background leftmenu hover color'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_LEFTMENU_TXT', '__ENTITY__', '#FFFFFF', 'chaine', '0', 'Oblyon foreground leftmenu color'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_LEFTMENU_TXT_ACTIVE', '__ENTITY__', '#FFFFFF', 'chaine', '0', 'Oblyon foreground leftmenu hover color'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_LEFTMENU_TXT_HOVER', '__ENTITY__', '#222222', 'chaine', '0', 'Oblyon foreground leftmenu hover color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_LEFTMENU_BCKGRD', '__ENTITY__', '#2ECC71', 'chaine', '0', 'Oblyon background leftmenu color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_LEFTMENU_BCKGRD_HOVER', '__ENTITY__', '#29B564', 'chaine', '0', 'Oblyon background leftmenu hover color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_LEFTMENU_TXT', '__ENTITY__', '#FFFFFF', 'chaine', '0', 'Oblyon foreground leftmenu color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_LEFTMENU_TXT_ACTIVE', '__ENTITY__', '#FFFFFF', 'chaine', '0', 'Oblyon foreground leftmenu hover color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_LEFTMENU_TXT_HOVER', '__ENTITY__', '#222222', 'chaine', '0', 'Oblyon foreground leftmenu hover color'); -- Color - button -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_BUTTON_ACTION1', '__ENTITY__', '#0088CC', 'chaine', '0', 'Oblyon button action color 1'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_BUTTON_ACTION2', '__ENTITY__', '#0044CC', 'chaine', '0', 'Oblyon button action color 2'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_BUTTON_DELETE1', '__ENTITY__', '#CC8800', 'chaine', '0', 'Oblyon button delete color 1'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_BUTTON_DELETE2', '__ENTITY__', '#CC4400', 'chaine', '0', 'Oblyon button delete color 2'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_BUTTON_ACTION1', '__ENTITY__', '#0088CC', 'chaine', '0', 'Oblyon button action color 1'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_BUTTON_ACTION2', '__ENTITY__', '#0044CC', 'chaine', '0', 'Oblyon button action color 2'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_BUTTON_DELETE1', '__ENTITY__', '#CC8800', 'chaine', '0', 'Oblyon button delete color 1'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_BUTTON_DELETE2', '__ENTITY__', '#CC4400', 'chaine', '0', 'Oblyon button delete color 2'); -- Color - message -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_INFO_BORDER', '__ENTITY__', '#87CFD2', 'chaine', '0', 'Oblyon border info message'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_INFO_BCKGRD', '__ENTITY__', '#EFF8FC', 'chaine', '0', 'Oblyon background info message'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_INFO_TEXT', '__ENTITY__', '#222222', 'chaine', '0', 'Oblyon text info message'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_WARNING_BORDER', '__ENTITY__', '#F2CF87', 'chaine', '0', 'Oblyon border warning message'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_WARNING_BCKGRD', '__ENTITY__', '#FCF8E3', 'chaine', '0', 'Oblyon background warning message'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_WARNING_TEXT', '__ENTITY__', '#222222', 'chaine', '0', 'Oblyon text warning message'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_ERROR_BORDER', '__ENTITY__', '#E0796E', 'chaine', '0', 'Oblyon border error message'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_ERROR_BCKGRD', '__ENTITY__', '#F07B6E', 'chaine', '0', 'Oblyon background error message'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_ERROR_TEXT', '__ENTITY__', '#222222', 'chaine', '0', 'Oblyon text error message'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_NOTIF_INFO_BCKGRD', '__ENTITY__', '#D9E5D1', 'chaine', '0', 'Oblyon background info notification'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_NOTIF_INFO_TEXT', '__ENTITY__', '#446548', 'chaine', '0', 'Oblyon text info notification'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_NOTIF_WARNING_BCKGRD', '__ENTITY__', '#FFF7D1', 'chaine', '0', 'Oblyon background warning notification'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_NOTIF_WARNING_TEXT', '__ENTITY__', '#A28918', 'chaine', '0', 'Oblyon text warning notification'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_NOTIF_ERROR_BCKGRD', '__ENTITY__', '#D79EAC', 'chaine', '0', 'Oblyon background error notification'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_NOTIF_ERROR_TEXT', '__ENTITY__', '#A72947', 'chaine', '0', 'Oblyon text error notification'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_INFO_BORDER', '__ENTITY__', '#87CFD2', 'chaine', '0', 'Oblyon border info message'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_INFO_BCKGRD', '__ENTITY__', '#EFF8FC', 'chaine', '0', 'Oblyon background info message'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_INFO_TEXT', '__ENTITY__', '#222222', 'chaine', '0', 'Oblyon text info message'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_WARNING_BORDER', '__ENTITY__', '#F2CF87', 'chaine', '0', 'Oblyon border warning message'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_WARNING_BCKGRD', '__ENTITY__', '#FCF8E3', 'chaine', '0', 'Oblyon background warning message'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_WARNING_TEXT', '__ENTITY__', '#222222', 'chaine', '0', 'Oblyon text warning message'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_ERROR_BORDER', '__ENTITY__', '#E0796E', 'chaine', '0', 'Oblyon border error message'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_ERROR_BCKGRD', '__ENTITY__', '#F07B6E', 'chaine', '0', 'Oblyon background error message'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_ERROR_TEXT', '__ENTITY__', '#222222', 'chaine', '0', 'Oblyon text error message'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_NOTIF_INFO_BCKGRD', '__ENTITY__', '#D9E5D1', 'chaine', '0', 'Oblyon background info notification'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_NOTIF_INFO_TEXT', '__ENTITY__', '#446548', 'chaine', '0', 'Oblyon text info notification'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_NOTIF_WARNING_BCKGRD', '__ENTITY__', '#FFF7D1', 'chaine', '0', 'Oblyon background warning notification'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_NOTIF_WARNING_TEXT', '__ENTITY__', '#A28918', 'chaine', '0', 'Oblyon text warning notification'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_NOTIF_ERROR_BCKGRD', '__ENTITY__', '#D79EAC', 'chaine', '0', 'Oblyon background error notification'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_NOTIF_ERROR_TEXT', '__ENTITY__', '#A72947', 'chaine', '0', 'Oblyon text error notification'); -- Color - options -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_MAIN', '__ENTITY__', '#0083A2', 'chaine', '0', 'Oblyon maincolor'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_BCKGRD', '__ENTITY__', '#F4F4F4', 'chaine', '0', 'Oblyon background color'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_LOGO_BCKGRD', '__ENTITY__', '#FFFFFF', 'chaine', '0', 'Oblyon background logo color'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_LOGIN_BCKGRD', '__ENTITY__', '#F4F4F4', 'chaine', '0', 'Oblyon background login color'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_BTITLE', '__ENTITY__', '#0083A2', 'chaine', '0', 'Oblyon background title'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_FTITLE', '__ENTITY__', '#222222', 'chaine', '0', 'Oblyon text title'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_BLINE', '__ENTITY__', '#FFFFFF', 'chaine', '0', 'Oblyon background line color'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_BLINE_HOVER', '__ENTITY__', '#E0E0E0', 'chaine', '0', 'Oblyon background line color hover'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_FLINE', '__ENTITY__', '#444444', 'chaine', '0', 'Oblyon text line'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_FLINE_HOVER', '__ENTITY__', '#222222', 'chaine', '0', 'Oblyon text line color hover'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_FDATE_DEFAULT', '__ENTITY__', '#FF0000', 'chaine', '0', 'Oblyon text default date (today) color'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_TEXTTABACTIVE', '__ENTITY__', '#222222', 'chaine', '0', 'Oblyon text tab active'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_INPUT_BCKGRD', '__ENTITY__', '#FFFFFF', 'chaine', '0', 'Oblyon background imput color'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_INFOBOX_BCKGRD1', '__ENTITY__', '#444444', 'chaine', '0', 'Oblyon Background color 1 of active kanban cards'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_INFOBOX_BCKGRD2', '__ENTITY__', '#E4EFE8', 'chaine', '0', 'Oblyon Background color 1 of active kanban cards'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_INVERT_RATIO_FILTER', '__ENTITY__', '0', 'chaine', '0', 'Oblyon Ratio for invert filter'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_MAIN', '__ENTITY__', '#0083A2', 'chaine', '0', 'Oblyon maincolor'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_BCKGRD', '__ENTITY__', '#F4F4F4', 'chaine', '0', 'Oblyon background color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_LOGO_BCKGRD', '__ENTITY__', '#FFFFFF', 'chaine', '0', 'Oblyon background logo color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_LOGIN_BCKGRD', '__ENTITY__', '#F4F4F4', 'chaine', '0', 'Oblyon background login color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_BTITLE', '__ENTITY__', '#0083A2', 'chaine', '0', 'Oblyon background title'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_FTITLE', '__ENTITY__', '#222222', 'chaine', '0', 'Oblyon text title'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_STITLE', '__ENTITY__', '#222222', 'chaine', '0', 'Oblyon text title'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_BLINE', '__ENTITY__', '#FFFFFF', 'chaine', '0', 'Oblyon background line color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_BLINE_HOVER', '__ENTITY__', '#E0E0E0', 'chaine', '0', 'Oblyon background line color hover'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_FLINE', '__ENTITY__', '#444444', 'chaine', '0', 'Oblyon text line'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_FLINE_HOVER', '__ENTITY__', '#222222', 'chaine', '0', 'Oblyon text line color hover'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_FDATE_DEFAULT', '__ENTITY__', '#FF0000', 'chaine', '0', 'Oblyon text default date (today) color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_FDATE_SELECTED', '__ENTITY__', '#FF0000', 'chaine', '0', 'Oblyon date color selected in the date picker'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_TEXTTABACTIVE', '__ENTITY__', '#222222', 'chaine', '0', 'Oblyon text tab active'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_INPUT_BCKGRD', '__ENTITY__', '#FFFFFF', 'chaine', '0', 'Oblyon background imput color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_INFOBOX_BCKGRD1', '__ENTITY__', '#444444', 'chaine', '0', 'Oblyon Background color 1 of active kanban cards'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_INFOBOX_BCKGRD2', '__ENTITY__', '#E4EFE8', 'chaine', '0', 'Oblyon Background color 2 of active kanban cards'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_COLOR_BORDER_ACTIONCOLUMN', '__ENTITY__', '#BBBBBB', 'chaine', '0', 'Oblyon Border color of the "action" column of the tables'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_INVERT_RATIO_FILTER', '__ENTITY__', '0', 'chaine', '0', 'Oblyon Ratio for invert filter'); -- Color - Default Eldy values -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_ELDY_TOPBORDER_TITLE1', '__ENTITY__', '#D4D4D4', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_ELDY_BACKTITLE1', '__ENTITY__', '#2ECC71', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_ELDY_BACKTABACTIVE', '__ENTITY__', '#FFFFFF', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_ELDY_LINEPAIR1', '__ENTITY__', '#FDFDFD', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_ELDY_LINEPAIR2', '__ENTITY__', '#FDFDFD', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_ELDY_LINEIMPAIR1', '__ENTITY__', '#F0F0F0', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_ELDY_LINEIMPAIR2', '__ENTITY__', '#F0F0F0', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_ELDY_LINEBREAK', '__ENTITY__', '#FFFFFF', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_ELDY_TEXTTITLENOTAB', '__ENTITY__', '#222222', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_ELDY_TEXTTITLE', '__ENTITY__', '#222222', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_ELDY_TEXT', '__ENTITY__', '#222222', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_ELDY_TEXTLINK', '__ENTITY__', '#000000', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_ELDY_TOPBORDER_TITLE1', '__ENTITY__', '#D4D4D4', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_ELDY_BACKTITLE1', '__ENTITY__', '#2ECC71', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_ELDY_BACKTABACTIVE', '__ENTITY__', '#FFFFFF', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_ELDY_LINEPAIR1', '__ENTITY__', '#FDFDFD', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_ELDY_LINEPAIR2', '__ENTITY__', '#FDFDFD', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_ELDY_LINEIMPAIR1', '__ENTITY__', '#F0F0F0', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_ELDY_LINEIMPAIR2', '__ENTITY__', '#F0F0F0', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_ELDY_LINEBREAK', '__ENTITY__', '#FFFFFF', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_ELDY_TEXTTITLENOTAB', '__ENTITY__', '#222222', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_ELDY_TEXTTITLE', '__ENTITY__', '#222222', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_ELDY_TEXT', '__ENTITY__', '#222222', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_ELDY_TEXTLINK', '__ENTITY__', '#000000', 'chaine', '0', 'Oblyon module'); -- Dashboard - infobox -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_DISABLE_GLOBAL_WORKBOARD', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_DISABLE_GLOBAL_BOXSTATS', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_INFOBOX_COLOR_ON_BACKGROUND', '__ENTITY__', '0', 'chaine', '0', 'Oblyon dashboard invert color icon'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_DISABLE_METEO', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_DISABLE_BLOCK_AGENDA', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_DISABLE_BLOCK_PROJECT', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_DISABLE_BLOCK_CUSTOMER', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_DISABLE_BLOCK_SUPPLIER', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_DISABLE_BLOCK_CONTRACT', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_DISABLE_BLOCK_BANK', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_DISABLE_BLOCK_ADHERENT', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_DISABLE_BLOCK_EXPENSEREPORT', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_DISABLE_BLOCK_HOLIDAY', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_DISABLE_BLOCK_TICKET', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_DISABLE_GLOBAL_WORKBOARD', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_DISABLE_GLOBAL_BOXSTATS', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_INFOBOX_COLOR_ON_BACKGROUND', '__ENTITY__', '0', 'chaine', '0', 'Oblyon dashboard invert color icon'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_DISABLE_METEO', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_DISABLE_BLOCK_AGENDA', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_DISABLE_BLOCK_PROJECT', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_DISABLE_BLOCK_CUSTOMER', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_DISABLE_BLOCK_SUPPLIER', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_DISABLE_BLOCK_CONTRACT', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_DISABLE_BLOCK_BANK', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_DISABLE_BLOCK_ADHERENT', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_DISABLE_BLOCK_EXPENSEREPORT', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_DISABLE_BLOCK_HOLIDAY', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_DISABLE_BLOCK_TICKET', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_SINGLE_WIDTH', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module'); -- Dashboard - color -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_AGRESSIVENESS_RATIO', '__ENTITY__', '-50', 'chaine', '0', 'Oblyon dashboard agressiveness ratio'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_BACKGROUND', '__ENTITY__', '#FFFFFF', 'chaine', '0', 'Oblyon infobox background color'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_WEATHER_COLOR', '__ENTITY__', '#BDBDBD', 'chaine', '0', 'Oblyon weather background color'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_ACTION_COLOR', '__ENTITY__', '#AB4DA1', 'chaine', '0', 'Oblyon action background color'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_PROJECT_COLOR', '__ENTITY__', '#6C6A98', 'chaine', '0', 'Oblyon project background color'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_CUSTOMER_PROPAL_COLOR', '__ENTITY__', '#49CC29', 'chaine', '0', 'Oblyon customer proposal background color'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_CUSTOMER_ORDER_COLOR', '__ENTITY__', '#49CC29', 'chaine', '0', 'Oblyon customer order background color'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_CUSTOMER_INVOICE_COLOR', '__ENTITY__', '#49CC29', 'chaine', '0', 'Oblyon customer invoice background color'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_SUPPLIER_PROPAL_COLOR', '__ENTITY__', '#599CAF', 'chaine', '0', 'Oblyon supplier proposal background color'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_SUPPLIER_ORDER_COLOR', '__ENTITY__', '#599CAF', 'chaine', '0', 'Oblyon supplier order background color'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_SUPPLIER_INVOICE_COLOR', '__ENTITY__', '#599CAF', 'chaine', '0', 'Oblyon supplier invoice background color'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_CONTRAT_COLOR', '__ENTITY__', '#8C5545', 'chaine', '0', 'Oblyon contract background color'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_BANK_COLOR', '__ENTITY__', '#3333CC', 'chaine', '0', 'Oblyon bank background color'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_ADHERENT_COLOR', '__ENTITY__', '#79631C', 'chaine', '0', 'Oblyon member background color'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_EXPENSEREPORT_COLOR', '__ENTITY__', '#D1D12A', 'chaine', '0', 'Oblyon expense report background color'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_HOLIDAY_COLOR', '__ENTITY__', '#E0A01F', 'chaine', '0', 'Oblyon Dashboard holiday background color'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_TICKET_COLOR', '__ENTITY__', '#C93E28', 'chaine', '0', 'Oblyon Dashboard ticket background color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('THEME_AGRESSIVENESS_RATIO', '__ENTITY__', '-50', 'chaine', '0', 'Oblyon dashboard agressiveness ratio'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_BACKGROUND', '__ENTITY__', '#FFFFFF', 'chaine', '0', 'Oblyon infobox background color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_WEATHER_COLOR', '__ENTITY__', '#BDBDBD', 'chaine', '0', 'Oblyon weather background color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_ACTION_COLOR', '__ENTITY__', '#AB4DA1', 'chaine', '0', 'Oblyon action background color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_PROJECT_COLOR', '__ENTITY__', '#6C6A98', 'chaine', '0', 'Oblyon project background color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_CUSTOMER_PROPAL_COLOR', '__ENTITY__', '#49CC29', 'chaine', '0', 'Oblyon customer proposal background color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_CUSTOMER_ORDER_COLOR', '__ENTITY__', '#49CC29', 'chaine', '0', 'Oblyon customer order background color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_CUSTOMER_INVOICE_COLOR', '__ENTITY__', '#49CC29', 'chaine', '0', 'Oblyon customer invoice background color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_SUPPLIER_PROPAL_COLOR', '__ENTITY__', '#599CAF', 'chaine', '0', 'Oblyon supplier proposal background color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_SUPPLIER_ORDER_COLOR', '__ENTITY__', '#599CAF', 'chaine', '0', 'Oblyon supplier order background color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_SUPPLIER_INVOICE_COLOR', '__ENTITY__', '#599CAF', 'chaine', '0', 'Oblyon supplier invoice background color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_CONTRAT_COLOR', '__ENTITY__', '#8C5545', 'chaine', '0', 'Oblyon contract background color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_BANK_COLOR', '__ENTITY__', '#3333CC', 'chaine', '0', 'Oblyon bank background color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_ADHERENT_COLOR', '__ENTITY__', '#79631C', 'chaine', '0', 'Oblyon member background color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_EXPENSEREPORT_COLOR', '__ENTITY__', '#D1D12A', 'chaine', '0', 'Oblyon expense report background color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_HOLIDAY_COLOR', '__ENTITY__', '#E0A01F', 'chaine', '0', 'Oblyon Dashboard holiday background color'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_INFOXBOX_TICKET_COLOR', '__ENTITY__', '#C93E28', 'chaine', '0', 'Oblyon Dashboard ticket background color'); -- Options - general -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_FONT_SIZE', '__ENTITY__', '14', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_IMAGE_HEIGHT_TABLE', '__ENTITY__', '24', 'chaine', '0', 'Oblyon max height for image on tables'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_DISABLE_VERSION', '__ENTITY__', '1', 'yesno', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_STATUS_USES_IMAGES', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_USE_TOP_MENU_BOOKMARK_DROPDOWN', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_PADDING_RIGHT_BOTTOM', '__ENTITY__', '1', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_FONT_FAMILY', '__ENTITY__', 'Arial', 'chaine', '0', 'Oblyon module') ON DUPLICATE KEY UPDATE value = 'Arial'; +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_FONT_SIZE', '__ENTITY__', '14', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_IMAGE_HEIGHT_TABLE', '__ENTITY__', '24', 'chaine', '0', 'Oblyon max height for image on tables'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_DISABLE_VERSION', '__ENTITY__', '1', 'yesno', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_STATUS_USES_IMAGES', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_USE_TOP_MENU_BOOKMARK_DROPDOWN', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_PADDING_RIGHT_BOTTOM', '__ENTITY__', '1', 'chaine', '0', 'Oblyon module'); --Options - page de connexion -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_LOGIN_RIGHT', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_LOGIN_RIGHT', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); -- Options - comportement des fiches -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('FIX_AREAREF_TABACTION', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('FIX_AREAREF_TABACTION', '__ENTITY__', '0', 'chaine', '0', 'Oblyon module'); -- Options - liste -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_CHECKBOX_LEFT_COLUMN', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module'); -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('FIX_STICKY_HEADER_CARD', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_CHECKBOX_LEFT_COLUMN', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('FIX_STICKY_HEADER_CARD', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module'); + +-- Options - CKEditor +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('FCKEDITOR_ALLOW_ANY_CONTENT', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module - Allow to enter any content. However, this will totally disable content filtering which is one of the most important CKEditor features. You can use this to keep all your tags and attributes in the html content'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('FCKEDITOR_ENABLE_SCAYT_AUTOSTARTUP', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module - Allow to activate the SpellCheckAsYouType (SCAYT) plugins of CKEditor i.e an automatic spell checking'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('MAIN_SECURITY_ALLOW_UNSECURED_LABELS_WITH_HTML', '__ENTITY__', '0', 'yesno', '0', 'Oblyon module - Allow HTML tags into products label'); -- Custom CSS -INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_CUSTOM_CSS', '__ENTITY__', '', 'yesno', '0', 'Oblyon module'); +INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('OBLYON_CUSTOM_CSS', '__ENTITY__', '', 'yesno', '0', 'Oblyon module'); SET FOREIGN_KEY_CHECKS = 1; \ No newline at end of file diff --git a/themeoblyon/badges.inc.php b/themeoblyon/badges.inc.php index f246315..88252e5 100644 --- a/themeoblyon/badges.inc.php +++ b/themeoblyon/badges.inc.php @@ -1,29 +1,30 @@ -/*