diff --git a/CHANGELOG.md b/ChangeLog.md similarity index 78% rename from CHANGELOG.md rename to ChangeLog.md index 1d6db4b..dd9494e 100644 --- a/CHANGELOG.md +++ b/ChangeLog.md @@ -1,87 +1,114 @@ -## 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 18.0.x - 23.0.x (2025/11/08) + +### Added +- Option to change the Dolibarr font family +- In admin, new tab "Icons". If you want to use other FontAwesome Pack Free Or Pro, you can select easily your new pack to apply +- In admin, add possibility to disable thumb production (MRP) on the dashboard (v23+) +- Compatibility v21 / v22 / v23 + +### Fixed +- CSS +- Menu (Remove categories/tags in v22 -> move to tools) + +### 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 +- Move to version v18 minimum + +### [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 +116,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 +163,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 +250,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 +272,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 +283,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 +294,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 +323,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 +340,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 +366,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 +375,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 +392,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..f3508f7 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'), '', 'mod-oblyon page-admin-colors'); +$linkback = ''.$langs->trans('BackToModuleList').''; +print load_fiche_titre($page_name, $linkback, 'object_inovea.png@oblyon'); - // 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', $page_name, -1); - // 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..64ffd4f 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')); @@ -67,9 +77,9 @@ '/includes/ace/src/ace.js', '/includes/ace/src/ext-statusbar.js', '/includes/ace/src/ext-language_tools.js', - ), array()); + ), array(), 'mod-oblyon page-admin-customcss'); $linkback = ''.$langs->trans('BackToModuleList').''; -print load_fiche_titre($page_name, $linkback); +print load_fiche_titre($page_name, $linkback, 'object_inovea.png@oblyon'); // Configuration header ************************* $head = oblyon_admin_prepare_head(); @@ -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..7d479e6 100644 --- a/admin/dashboard.php +++ b/admin/dashboard.php @@ -1,178 +1,195 @@ - * 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 + if ((float) DOL_VERSION >= 23.0) oblyon_print_input('MAIN_DISABLE_BLOCK_MRP', 'on_off', $langs->trans('DashboardDisableBlockMrp'), '', $metas, 2, 1); // mrp 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..c05fc52 100644 --- a/admin/icons.php +++ b/admin/icons.php @@ -1,100 +1,205 @@ - * 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/icons.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 ******************************* - $list = array ('fas' => '900', 'far' => '400', 'fal' => '300', 'fat' => '100', 'fad' => '900'); - - // Actions ************************************** - $action = GETPOST('action','alpha'); - $result = ''; - // Sauvegarde / Restauration - if ($action == 'bkupParams') $result = oblyon_bkup_module ('oblyon'); - if ($action == 'restoreParams') $result = oblyon_restore_module ('oblyon'); - // links management - if (preg_match('/set_(.*)/', $action, $reg)) { - $confkey = $reg[1]; - $result = dolibarr_set_const($db, 'MAIN_FONTAWESOME_ICON_STYLE', $confkey, 'chaine', 0, 'Oblyon module', $conf->entity); - $result = dolibarr_set_const($db, 'MAIN_FONTAWESOME_WEIGHT', $list[$confkey], 'chaine', 0, 'Oblyon module', $conf->entity); - } - // Retour => message Ok ou Ko - if ($result == 1) setEventMessages($langs->trans('IconApplied').' : '.$langs->trans('Icon'.$confkey), 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('OblyonIconsTitle'); - llxHeader('', $page_name); - $linkback = ''.$langs->trans('BackToModuleList').''; - print load_fiche_titre($page_name, $linkback); - - // Configuration header ************************* - $head = oblyon_admin_prepare_head(); - print dol_get_fiche_head($head, 'icons', $langs->trans('Module432573Name'), 0, 'inovea@oblyon'); - - // setup page goes here ************************* - print '
- '; - // Sauvegarde / Restauration - oblyon_print_backup_restore(); - clearstatcache(); - print '
- '; - $larg = !empty($list) && count($list) > 0 ? 100 / count($list) : 100; - $metas = array(); - for ($i = 0; $i < count($list); $i++) $metas[] = $larg.'%'; - oblyon_print_colgroup($metas); - $metas = array(array(count($list)), 'IconsStyle'); - oblyon_print_liste_titre($metas); - print ' '; - foreach ($list as $name => $weight) - print ' '; - print ' -
- '.img_picto($langs->trans('Icon'.$name), 'icon'.$name.'.png@oblyon', 'width = "50%"').' -
'.$langs->trans('Icon'.$name).' -
-
-
'; - print dol_get_fiche_end(); - print '
-
'; - // End of page - llxFooter(); - $db->close(); -?> \ No newline at end of file +/************************************************ +* Copyright (C) 2015-2025 Alexandre Spangaro +* 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 +* 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/icons.php + * \ingroup oblyon + * \brief Options Page < Oblyon Theme Configurator > + */ + +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'; + +/** + * @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')); + +// Access control ******************************* +if (! $user->admin) accessforbidden(); + +// init variables +$style_weights = array( + 'fas' => '900', + 'far' => '400', + 'fal' => '300', + 'fat' => '100', + 'fad' => '900' +); + +// Actions +$backtopage = GETPOST('backtopage', 'alpha'); +$action = GETPOST('action','alpha'); +$result = ''; + +// Sauvegarde / Restauration +if ($action == 'bkupParams') { + $result = oblyon_bkup_module ('oblyon'); +} +if ($action == 'restoreParams') { + $result = oblyon_restore_module ('oblyon'); +} + +if (!empty($_POST['select_fa'])) { + $selected_dir = GETPOST('selected_version', 'alpha'); + $selected_family = GETPOST('selected_family_' . $selected_dir, 'alpha'); + $selected_style = GETPOST('selected_style_' . $selected_dir, 'alpha'); + + if ($selected_dir && $selected_family && $selected_style) { + $full_dir_path = '/theme/common/' . $selected_dir; + $weight = $style_weights[$selected_style] ?? '900'; + + dolibarr_set_const($db, 'MAIN_FONTAWESOME_DIRECTORY', $full_dir_path, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, 'MAIN_FONTAWESOME_FAMILY', $selected_family, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, 'MAIN_FONTAWESOME_ICON_STYLE', $selected_style, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, 'MAIN_FONTAWESOME_WEIGHT', $weight, 'chaine', 0, '', $conf->entity); + + setEventMessages($langs->trans("FontAwesomeSuccessMessage", $selected_family, $selected_style, $weight, $full_dir_path), null, 'mesgs'); + $_SESSION['dol_resetcache'] = dol_print_date(dol_now(), 'dayhourlog'); // Reset cache + } +} + +/* + * View + */ +$help_url = ''; +$title = $langs->trans("OblyonSetupIcons"); + +llxHeader('', $title, $help_url, '', 0, 0, '', '', 'mod-oblyon page-admin-icons'); + +// Lecture des dossiers +$theme_dir = DOL_DOCUMENT_ROOT.'/theme/common/'; +$fa_dirs = []; + +if (is_dir($theme_dir)) { + foreach (scandir($theme_dir) as $entry) { + if (preg_match('/^fontawesome-(.+)$/', $entry) && is_dir($theme_dir . $entry)) { + $version = 'Unknown'; + $family = 'Font Awesome 5 Free'; // par défaut + $css_path = $theme_dir . $entry . '/css/all.css'; + if (file_exists($css_path)) { + $css = file_get_contents($css_path); + if (preg_match('/Font Awesome (Free|Pro) ([\d\.]+)/', $css, $ver_match)) { + $family = 'Font Awesome ' . intval($ver_match[2]) . ' ' . $ver_match[1]; + $version = $ver_match[2]; + } + } + + $fa_dirs[] = array( + 'dir' => $entry, + 'version' => $version, + 'family' => $family + ); + } + } +} + +$current_dir = $conf->global->MAIN_FONTAWESOME_DIRECTORY ?? '/theme/common/fontawesome-5'; +$current_style = $conf->global->MAIN_FONTAWESOME_ICON_STYLE ?? 'fas'; +$current_family = $conf->global->MAIN_FONTAWESOME_FAMILY ?? 'Font Awesome 5 Free'; + +// Subheader +$linkback = ''.$langs->trans('BackToModuleList').''; +print load_fiche_titre($title, $linkback, 'object_inovea.png@oblyon'); + +$head = oblyon_admin_prepare_head(); +print dol_get_fiche_head($head, 'icons', $title, -1); + +print '
'; +print ''; +print ''; +print ''; + +// Sauvegarde / Restauration +oblyon_print_backup_restore(); +clearstatcache(); + +print '
'; +print $langs->trans("FontAwesomeSelectPack"); +print '

'; + +print '
'; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + +foreach ($fa_dirs as $fa) { + $dir = $fa['dir']; + $full_path = '/theme/common/' . $dir; + $selected = ($full_path === $current_dir) ? 'checked' : ''; + $is_pro = (strpos($fa['family'], 'Pro') !== false); + $styles = $is_pro ? ['fas', 'far', 'fal', 'fat', 'fad'] : ['fas']; + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; +} + +print '
' . $langs->trans("FontAwesomeAction") . '' . $langs->trans("FontAwesomeFolder") . '' . $langs->trans("FontAwesomeVersion") . '' . $langs->trans("FontAwesomeLicence") . '' . $langs->trans("FontAwesomeAvailableStyles") . '
' . dol_escape_htmltag($dir) . '' . dol_escape_htmltag($fa['version']) . ''; + print ''; + print dol_escape_htmltag($fa['family']); + print ''; + print ''; + print '
'; +print '
'; +print '
'; +print '
'; +print '
'; + +print '

'.$langs->trans("FontAwesomeDirectoryDownload").'

'; + +print ''; + +// End of page +llxFooter(); +$db->close(); 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 '
'; + +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) { + // Select Column on left - MAIN_CHECKBOX_LEFT_COLUMN + $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); + $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') . $labs_picto, '', $metas, 2, 1); + $countl++; +} +if ($easyaVersion >= "2024.0.0" || (float) DOL_VERSION >= 19.0) { + // Remove Kanban view in list - DISABLE_KANBAN_VIEW_IN_LIST + // 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'). ' ('. $langs->trans("NotRecommended") . ')', '', $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..3d56f7d 100644 --- a/core/menus/standard/oblyon.lib.php +++ b/core/menus/standard/oblyon.lib.php @@ -1,11 +1,11 @@ - * Copyright (C) 2015-2024 Alexandre Spangaro + * Copyright (C) 2013-2016 Nicolas Rivera + * Copyright (C) 2015-2025 Alexandre Spangaro * * Copyright (C) 2010-2013 Laurent Destailleur - * Copyright (C) 2010 Regis Houssin - * Copyright (C) 2012-2013 Juanjo Menent + * Copyright (C) 2010 Regis Houssin + * Copyright (C) 2012-2013 Juanjo Menent * * 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 @@ -27,6 +27,15 @@ * \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'); + +/** + * @var Conf $conf + * @var DoliDB $db + * @var HookManager $hookmanager + * @var Translate $langs + * @var User $user + */ // Translations $langs->loadLangs(array('oblyon@oblyon')); @@ -58,99 +67,78 @@ 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 = ''; + $classname = ''; - $menu_invert = getDolGlobalInt('MAIN_MENU_INVERT'); + $menu_invert = getDolGlobalInt('MAIN_MENU_INVERT'); - if (empty($noout)) print_start_menu_array(); + 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); + // Show logo company + 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'; - $logoContainerAdditionalClass = ''; - } - $title=$langs->trans("GoIntoSetupToChangeLogo"); + 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'; + $logoContainerAdditionalClass = ''; + } + $title = $langs->trans("GoIntoSetupToChangeLogo"); - print "\n".''."\n"; - print_start_menu_entry('companylogo', 'class="tmenu tmenucompanylogo"', 1); + print "\n".''."\n"; + print_start_menu_entry('companylogo', 'class="tmenu tmenucompanylogo"', 1); + print ''."\n"; - print ''."\n"; + print_end_menu_entry(1); + } - print_end_menu_entry(1); + 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"; + print '
'."\n"; + print $moredata['searchform']; + print '
'."\n"; + print "\n"; } - // 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 - { - print "\n"; - print "\n"; - print '
'."\n"; - print $moredata['searchform']; - print '
'."\n"; - print "\n"; - } - - if (is_array($moredata) && ! empty($moredata['bookmarks'])) - { - print "\n"; - print "\n"; - print '
'."\n"; - print $moredata['bookmarks']; - print '
'."\n"; - print "\n"; - } - - if ( empty($menu_invert) && (getDolGlobalInt('OBLYON_HIDE_LEFTMENU') || $conf->dol_optimize_smallscreen) ) { + if (is_array($moredata) && ! empty($moredata['bookmarks']) && empty($noout)) + { + print "\n"; + print "\n"; + print '
'."\n"; + print $moredata['bookmarks']; + print '
'."\n"; + print "\n"; + } + + if ( empty($menu_invert) && (getDolGlobalInt('OBLYON_HIDE_LEFTMENU') || $conf->dol_optimize_smallscreen) && empty($noout) ) { print '
'; } // Home $showmode=1; if (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "home") { - $itemsel=TRUE; - $_SESSION['idmenu']=''; - } else { - $itemsel = FALSE; - } - $idsel='home'; + $itemsel=TRUE; + $_SESSION['idmenu']=''; + } else { + $itemsel = FALSE; + } + $idsel='home'; - $chaine=$langs->trans("Home"); + $chaine=$langs->trans("Home"); if (empty($noout)) print_start_menu_entry($idsel,$itemsel,$showmode); if (empty($noout)) print_text_menu_entry($chaine, 1, $landingpage, $id, $idsel, $atarget); @@ -159,52 +147,52 @@ 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; - $_SESSION['idmenu']=''; - } else { - $itemsel = FALSE; - } + $itemsel = TRUE; + $_SESSION['idmenu']=''; + } else { + $itemsel = FALSE; + } $idsel='members'; - $chaine=$langs->trans("MenuMembers"); + $chaine=$langs->trans("MenuMembers"); - if (empty($noout)) print_start_menu_entry($idsel,$itemsel,$showmode); - if (empty($noout)) print_text_menu_entry($chaine, 1, DOL_URL_ROOT.'/adherents/index.php?mainmenu=members&leftmenu=', $id, $idsel, $atarget); - if (empty($noout)) print_end_menu_entry($showmode); - $menu->add('/adherents/index.php?mainmenu=members&leftmenu=', $chaine, 0, $showmode, $atarget, "members", ''); + if (empty($noout)) print_start_menu_entry($idsel,$itemsel,$showmode); + if (empty($noout)) print_text_menu_entry($chaine, 1, DOL_URL_ROOT.'/adherents/index.php?mainmenu=members&leftmenu=', $id, $idsel, $atarget); + if (empty($noout)) print_end_menu_entry($showmode); + $menu->add('/adherents/index.php?mainmenu=members&leftmenu=', $chaine, 0, $showmode, $atarget, "members", ''); } // 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); if ($showmode) { - $langs->loadLangs(array("companies","suppliers")); + $langs->loadLangs(array("companies","suppliers")); if (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "companies") { - $itemsel=TRUE; - $_SESSION['idmenu']=''; - } else { - $itemsel = FALSE; - } + $itemsel = TRUE; + $_SESSION['idmenu']=''; + } else { + $itemsel = FALSE; + } $idsel='companies'; - $chaine=$langs->trans("ThirdParties"); + $chaine=$langs->trans("ThirdParties"); if (empty($noout)) print_start_menu_entry($idsel,$itemsel,$showmode); if (empty($noout)) print_text_menu_entry($chaine, $showmode, DOL_URL_ROOT.'/societe/index.php?mainmenu=companies&leftmenu=', $id, $idsel, $atarget); @@ -214,34 +202,23 @@ 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); if ($showmode) { - $langs->loadLangs(array("products")); + $langs->loadLangs(array("products")); if (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "products") { - $itemsel=TRUE; - $_SESSION['idmenu']=''; - } else { - $itemsel = FALSE; - } + $itemsel=TRUE; + $_SESSION['idmenu']=''; + } else { + $itemsel = FALSE; + } $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,169 +229,167 @@ 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); - if ($showmode) { - $langs->loadLangs(array("mrp")); - - if (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "mrp") { - $itemsel=TRUE; - $_SESSION['idmenu']=''; - } else { - $itemsel=FALSE; - } - $idsel='mrp'; - - $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); - if (empty($noout)) print_end_menu_entry($showmode); - $menu->add('/mrp/index.php?mainmenu=mrp&leftmenu=', $chaine, 0, $showmode, $atarget, "mrp", ''); - } + $showmode = dol_oblyon_showmenu($type_user, $tmpentry, $listofmodulesforexternal); + if ($showmode) { + $langs->loadLangs(array("mrp")); + + if (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "mrp") { + $itemsel=TRUE; + $_SESSION['idmenu']=''; + } else { + $itemsel=FALSE; + } + $idsel='mrp'; + + $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); + if (empty($noout)) print_end_menu_entry($showmode); + $menu->add('/mrp/index.php?mainmenu=mrp&leftmenu=', $chaine, 0, $showmode, $atarget, "mrp", ''); + } // 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) { - $langs->loadLangs(array("projects")); + $langs->loadLangs(array("projects")); if (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "project") { - $itemsel=TRUE; - $_SESSION['idmenu']=''; - } else { - $itemsel = FALSE; - } - $idsel='project'; + $itemsel=TRUE; + $_SESSION['idmenu']=''; + } else { + $itemsel = FALSE; + } + $idsel='project'; if (empty($noout)) print_start_menu_entry($idsel,$itemsel,$showmode); - if (!empty($conf->global->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); - } - if (empty($noout)) print_end_menu_entry($showmode); + 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); + } + 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)) { - $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); - } + 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); + } + } // 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' ); $showmode=dol_oblyon_showmenu($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) { - $langs->loadLangs(array("commercial")); + $langs->loadLangs(array("commercial")); - if (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "commercial") { - $itemsel=TRUE; - $_SESSION['idmenu']=''; - } else { - $itemsel=FALSE; - } - $idsel='commercial'; + if (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "commercial") { + $itemsel=TRUE; + $_SESSION['idmenu']=''; + } else { + $itemsel=FALSE; + } + $idsel='commercial'; - $chaine=$langs->trans("Commercial"); + $chaine=$langs->trans("Commercial"); - if (empty($noout)) print_start_menu_entry($idsel,$itemsel,$showmode); - if (empty($noout)) print_text_menu_entry($chaine, $showmode, DOL_URL_ROOT.'/comm/index.php?mainmenu=commercial&leftmenu=', $id, $idsel, $atarget); - if (empty($noout)) print_end_menu_entry($showmode); - $menu->add('/comm/index.php?mainmenu=commercial&leftmenu=', $chaine, 0, $showmode, $atarget, "commercial", ""); - } + if (empty($noout)) print_start_menu_entry($idsel,$itemsel,$showmode); + if (empty($noout)) print_text_menu_entry($chaine, $showmode, DOL_URL_ROOT.'/comm/index.php?mainmenu=commercial&leftmenu=', $id, $idsel, $atarget); + if (empty($noout)) print_end_menu_entry($showmode); + $menu->add('/comm/index.php?mainmenu=commercial&leftmenu=', $chaine, 0, $showmode, $atarget, "commercial", ""); + } // 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' ); $showmode=dol_oblyon_showmenu($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) { - $langs->loadLangs(array("compta","accountancy")); + $langs->loadLangs(array("compta","accountancy")); if (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "billing") { - $itemsel=TRUE; $_SESSION['idmenu']=''; - } else { - $itemsel = FALSE; - } + $itemsel=TRUE; $_SESSION['idmenu']=''; + } else { + $itemsel = FALSE; + } $idsel='billing'; - $chaine=$langs->trans("MenuFinancial"); + $chaine=$langs->trans("MenuFinancial"); if (empty($noout)) print_start_menu_entry($idsel,$itemsel,$showmode); if (empty($noout)) print_text_menu_entry($chaine, $showmode, DOL_URL_ROOT.'/compta/index.php?mainmenu=billing&leftmenu=', $id, $idsel, $atarget); if (empty($noout)) print_end_menu_entry($showmode); - $menu->add('/compta/index.php?mainmenu=billing&leftmenu=', $chaine, 0, $showmode, $atarget, "billing", ''); + $menu->add('/compta/index.php?mainmenu=billing&leftmenu=', $chaine, 0, $showmode, $atarget, "billing", ''); } // 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); if ($showmode) { - $langs->loadLangs(array("compta","banks")); + $langs->loadLangs(array("compta","banks")); if (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "bank") { - $itemsel=TRUE; $_SESSION['idmenu']=''; - } else { - $itemsel = FALSE; - } + $itemsel=TRUE; $_SESSION['idmenu']=''; + } else { + $itemsel = FALSE; + } $idsel='bank'; - $chaine=$langs->trans("MenuBankCash"); + $chaine=$langs->trans("MenuBankCash"); if (empty($noout)) print_start_menu_entry($idsel,$itemsel,$showmode); if (empty($noout)) print_text_menu_entry($chaine, $showmode, DOL_URL_ROOT.'/compta/bank/list.php?mainmenu=bank&leftmenu=', $id, $idsel, $atarget); @@ -424,24 +399,24 @@ 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); if ($showmode) { - $langs->loadLangs(array("compta", "accountancy", "assets", "intracommreport")); + $langs->loadLangs(array("compta", "accountancy", "assets", "intracommreport")); if (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "accountancy") { - $itemsel=TRUE; - $_SESSION['idmenu']=''; - } else { - $itemsel = FALSE; - } + $itemsel=TRUE; + $_SESSION['idmenu']=''; + } else { + $itemsel = FALSE; + } $idsel='accountancy'; - $chaine=$langs->trans("MenuAccountancy"); + $chaine=$langs->trans("MenuAccountancy"); if (empty($noout)) print_start_menu_entry($idsel,$itemsel,$showmode); if (empty($noout)) print_text_menu_entry($chaine, $showmode, DOL_URL_ROOT.'/accountancy/index.php?mainmenu=accountancy&leftmenu=', $id, $idsel, $atarget); @@ -451,36 +426,36 @@ 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' ); $showmode=dol_oblyon_showmenu($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) { - $langs->loadLangs(array("holiday", "recruitment")); - - if (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "hrm") { - $itemsel=TRUE; - $_SESSION['idmenu']=''; - } else { - $itemsel = FALSE; - } - $idsel='hrm'; - - $chaine=$langs->trans("HRM"); - - if (empty($noout)) print_start_menu_entry($idsel,$itemsel,$showmode); - if (empty($noout)) print_text_menu_entry($chaine, $showmode, DOL_URL_ROOT.'/hrm/index.php?mainmenu=hrm&leftmenu=', $id, $idsel, $atarget); - if (empty($noout)) print_end_menu_entry($showmode); - $menu->add('/hrm/index.php?mainmenu=hrm&leftmenu=', $chaine, 0, $showmode, $atarget, "hrm", ''); + $langs->loadLangs(array("holiday", "recruitment")); + + if (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "hrm") { + $itemsel=TRUE; + $_SESSION['idmenu']=''; + } else { + $itemsel = FALSE; + } + $idsel='hrm'; + + $chaine=$langs->trans("HRM"); + + if (empty($noout)) print_start_menu_entry($idsel,$itemsel,$showmode); + if (empty($noout)) print_text_menu_entry($chaine, $showmode, DOL_URL_ROOT.'/hrm/index.php?mainmenu=hrm&leftmenu=', $id, $idsel, $atarget); + if (empty($noout)) print_end_menu_entry($showmode); + $menu->add('/hrm/index.php?mainmenu=hrm&leftmenu=', $chaine, 0, $showmode, $atarget, "hrm", ''); } // 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' ); @@ -490,17 +465,17 @@ function print_oblyon_menu($db, $atarget, $type_user = 0, &$tabMenu, &$menu, $no $langs->loadLangs(array("other", "ticket")); if (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "ticket") { - $itemsel=TRUE; - $_SESSION['idmenu']=''; - } else { - $itemsel = FALSE; - } + $itemsel=TRUE; + $_SESSION['idmenu']=''; + } else { + $itemsel = FALSE; + } $idsel='ticket'; - $chaine=$langs->trans("Tickets"); + $chaine=$langs->trans("Tickets"); - $link = ''; - if (!empty($conf->ticket->enabled)) { + $link = ''; + if (isModEnabled('ticket')) { $link = '/ticket/index.php?mainmenu=ticket&leftmenu='; } else { $link = '/knowledgemanagement/knowledgerecord_list.php?mainmenu=ticket&leftmenu='; @@ -520,6 +495,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,39 +531,39 @@ 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'], '' ); } - // Show menu tools in last position - // Tools - $tmpentry = array( - 'enabled'=>1, - 'perms'=>1, - 'module'=>'' - ); - $showmode=dol_oblyon_showmenu($type_user, $tmpentry, $listofmodulesforexternal); - - if ($showmode) { - $langs->loadLangs(array("other")); - - if (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "tools") { - $itemsel=TRUE; - $_SESSION['idmenu']=''; - } else { - $itemsel = FALSE; - } - $idsel='tools'; - - $chaine=$langs->trans("Tools"); - - if (empty($noout)) print_start_menu_entry($idsel,$itemsel,$showmode); - if (empty($noout)) print_text_menu_entry($chaine, $showmode, DOL_URL_ROOT.'/core/tools.php?mainmenu=tools&leftmenu=', $id, $idsel, $atarget); - if (empty($noout)) print_end_menu_entry($showmode); - $menu->add('/core/tools.php?mainmenu=tools&leftmenu=', $chaine, 0, $showmode, $atarget, "tools", ''); - } + // Show menu tools in last position + // Tools + $tmpentry = array( + 'enabled'=>1, + 'perms'=>1, + 'module'=>'' + ); + $showmode=dol_oblyon_showmenu($type_user, $tmpentry, $listofmodulesforexternal); + + if ($showmode) { + $langs->loadLangs(array("other")); + + if (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "tools") { + $itemsel=TRUE; + $_SESSION['idmenu']=''; + } else { + $itemsel = FALSE; + } + $idsel='tools'; + + $chaine=$langs->trans("Tools"); + + if (empty($noout)) print_start_menu_entry($idsel,$itemsel,$showmode); + if (empty($noout)) print_text_menu_entry($chaine, $showmode, DOL_URL_ROOT.'/core/tools.php?mainmenu=tools&leftmenu=', $id, $idsel, $atarget); + if (empty($noout)) print_end_menu_entry($showmode); + $menu->add('/core/tools.php?mainmenu=tools&leftmenu=', $chaine, 0, $showmode, $atarget, "tools", ''); + } if (empty($noout)) print_end_menu_array(); @@ -603,9 +579,9 @@ function print_oblyon_menu($db, $atarget, $type_user = 0, &$tabMenu, &$menu, $no function print_start_menu_array() { global $conf; - $menu_invert = getDolGlobalInt('MAIN_MENU_INVERT'); + $menu_invert = getDolGlobalInt('MAIN_MENU_INVERT'); - print '