diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..0322038 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,437 @@ +# CLAUDE.md — Contexte module oblyon + +## Aperçu (Overview) + +`oblyon` est un module externe Dolibarr de thème graphique et de personnalisation de l'interface utilisateur : + +- thème CSS complet remplaçant le thème Dolibarr par défaut (eldy), +- gestionnaire de menus personnalisé (top, left, inversé, réduit), +- personnalisation avancée des couleurs (menus, boutons, messages, dashboard, lignes), +- sélection de packs d'icônes FontAwesome (Free/Pro), +- options de layout (sticky bars, menu caché/réduit, effets slide/push), +- personnalisation du dashboard (couleurs infobox, activation/désactivation des blocs), +- éditeur CSS personnalisé intégré (avec support CKEditor/Ace), +- compatibilité Easya. + +Informations module (issues du code et du changelog local) : + +- Éditeur : Inovea Conseil (Alexandre Spangaro) +- Contributeur : InfraS (Sylvain Legrand) +- Numéro module : `432573` +- Licence : GPL v3+ +- Compatibilité Dolibarr : `18.0.0` à `23.0.x` +- Compatibilité PHP : `7.1` à `8.4` +- Dernière version locale : `3.2.0` (2026-06) +- Dépendances obligatoires : aucune +- Conflits : `modQuickUX` +- Emplacement : `htdocs/custom/oblyon/` + +Convention de lecture du descripteur : + +- Explications fonctionnelles en français +- Identifiants techniques conservés en anglais (`hooks`, classes, méthodes, constantes, clés de configuration) + +## Structure (Summary) + +```text +htdocs/custom/oblyon/ +├── CLAUDE.md +├── CHANGELOG.md +├── README.md +├── VERSION +├── license.txt +├── metapackage.conf +├── .easya_info.json +├── admin/ +│ ├── about.php # Page À propos / Support +│ ├── changelog.php # Page Changelog (Parsedown) +│ ├── colors.php # Configuration des couleurs (~100 constantes) +│ ├── customcss.php # Éditeur CSS personnalisé (Ace/CKEditor) +│ ├── dashboard.php # Configuration du dashboard (infobox, blocs) +│ ├── icons.php # Sélection pack FontAwesome +│ ├── menus.php # Configuration des menus (inversé, réduit, effets) +│ └── options.php # Options générales (police, taille, comportement) +├── backport/ +│ └── v21/ # Backport fonctions Dolibarr v21 +├── class/ +│ └── actions_oblyon.class.php # Hook class (contexte main, quasi vide) +├── config.php # Chargeur main.inc.php standard +├── core/ +│ ├── menus/ +│ │ └── standard/ +│ │ ├── oblyon_menu.php # Gestionnaire de menus (MenuManager) +│ │ └── oblyon.lib.php # Bibliothèque menus (~2400 lignes) +│ └── modules/ +│ └── modOblyon.class.php # Descripteur module +├── css/ +│ ├── oblyon.css # CSS module admin +│ ├── as_style.min.css # CSS minifié complémentaire +│ └── font.css # Polices personnalisées +├── img/ # Images (logos, thèmes, icônes FA) +├── includes/ +│ └── parsedown/ # Bibliothèque Parsedown (Markdown → HTML) +├── js/ +│ ├── oblyon.js # JS module (mode tactile des menus : tap-to-toggle) +│ ├── pushy.js # Effet push menu latéral +│ ├── jscolor.js # Sélecteur de couleurs +│ └── range-slider.js # Curseur de plage +├── langs/ +│ ├── en_US/oblyon.lang +│ ├── fr_FR/oblyon.lang +│ ├── fr_FR/inovea.lang +│ └── fr_FR/oldauthors.lang +├── lib/ +│ ├── oblyon.lib.php # Bibliothèque admin (onglets, backup/restore, helpers HTML) +│ └── inovea_common.lib.php # Fonctions communes Inovea (changelog Parsedown) +├── sql/ +│ └── data.sql # Constantes initiales (~120 INSERT) +└── themeoblyon/ # Répertoire du thème CSS + ├── style.css.php # Point d'entrée CSS (~344 lignes) + ├── global.inc.php # Feuille de style principale (~11000 lignes) + ├── custom.css.php # CSS personnalisé utilisateur + ├── theme_vars.inc.php # Variables du thème (couleurs, polices) + ├── font.css # Polices embarquées + ├── manifest.json.php # Manifeste PWA dynamique + ├── graph-color.php # Couleurs des graphiques + ├── badges.inc.php # Styles badges + ├── btn.inc.php # Styles boutons + ├── dropdown.inc.php # Styles dropdown + ├── touchmenu.inc.php # Styles mode tactile des menus (classe .is-touch-open) + ├── info-box.inc.php # Styles infobox dashboard + ├── login.inc.php # Styles page de connexion + ├── main_menu_fa_icons.inc.php # Icônes FA menus + ├── modules.inc.php # Styles pages modules + ├── modules/ # Extensions CSS modules externes + │ ├── quicklist.inc.php + │ ├── scaninvoices.inc.php + │ └── subtotal.inc.php + ├── progress.inc.php # Styles barres de progression + ├── timeline.inc.php # Styles timeline + ├── tpl/ # Templates + ├── img/ # Images du thème + └── fonts/ # Polices du thème +``` + +## Descripteur module (Module descriptor : `modOblyon`) + +Dans `core/modules/modOblyon.class.php` : + +- **Module parts** : + - `menus` : gestionnaire de menus Oblyon + - `hooks` : contexte `main` (entité `0`, toutes les pages) + - JS : `/oblyon/js/pushy.js`, `/oblyon/js/oblyon.js` (mode tactile) + - CSS : `/oblyon/css/oblyon.css`, `/theme/oblyon/custom.css.php`, `/oblyon/css/font.css` +- **Dépendances** : aucune +- **Conflits** : `modQuickUX` +- **Dictionnaires** : aucun +- **Boxes** : aucune +- **Cron** : aucune tâche +- **Permissions** : aucune (accès réservé aux administrateurs via `$user->admin`) +- **Menus** : aucun (gérés directement par le `MenuManager` Oblyon) + +### Initialisation (Lifecycle : `init()`) + +`init()` effectue : + +1. Chargement SQL (`_load_tables('/oblyon/sql/')`) +2. Restauration des constantes module (`oblyon_restore_module`) +3. Détection du répertoire FontAwesome le plus récent (`fontawesome-N`) et enregistrement dans `MAIN_FONTAWESOME_DIRECTORY` +4. Suppression des anciens fichiers menu manager du core (`core/menus/standard/oblyon_menu.php`, `oblyon.lib.php`) +5. Activation du thème Oblyon (`MAIN_THEME` = `oblyon`) +6. Restauration de `MAIN_MENU_INVERT` depuis sauvegarde +7. Suppression de `OBLYON_SHOW_COMPNAME` (incompatible menu inversé) + +### Désactivation (Lifecycle : `remove()`) + +`remove()` effectue : + +- Sauvegarde module (`oblyon_bkup_module`) +- Restauration du thème par défaut (`MAIN_THEME` = `eldy`) +- Sauvegarde de `MAIN_MENU_INVERT` pour restauration future +- Nettoyage des constantes de menus forcés (`MAIN_MENU*_FORCED`) +- Nettoyage des constantes `THEME_ELDY_*` (couleurs Dolibarr) +- Nettoyage des constantes FontAwesome (`MAIN_FONTAWESOME_*`) + +## Fonctionnement principal (Core behavior) + +Le module s'appuie sur : + +- `modOblyon.class.php` pour l'activation/désactivation du thème et la gestion du cycle de vie, +- `oblyon_menu.php` (`MenuManager`) pour le gestionnaire de menus complet (top + left), +- `oblyon.lib.php` (lib menus, ~2400 lignes) pour la construction des entrées de menus, +- `oblyon.lib.php` (lib admin) pour les onglets d'administration, backup/restore et helpers HTML, +- `inovea_common.lib.php` pour l'affichage du changelog via Parsedown, +- `actions_oblyon.class.php` pour les hooks (actuellement quasi vide, hook `addHtmlHeader` commenté), +- `themeoblyon/` pour l'ensemble du rendu CSS. + +### Architecture du thème + +Le thème est structuré en plusieurs couches : + +1. **`style.css.php`** : point d'entrée principal, charge `theme_vars.inc.php` puis inclut tous les fichiers `.inc.php` +2. **`theme_vars.inc.php`** : lit les constantes `OBLYON_*` et `THEME_ELDY_*` pour définir les variables PHP utilisées dans le CSS +3. **`global.inc.php`** : feuille de style principale (~11000 lignes), définit les variables CSS `:root` et l'ensemble des règles +4. **Fichiers `.inc.php` spécialisés** : badges, boutons, dropdowns, infobox, login, menus FA, modules, progress, timeline +5. **`custom.css.php`** : CSS personnalisé saisi par l'utilisateur (constante `OBLYON_CUSTOM_CSS`) + +### Gestionnaire de menus + +Le module remplace le gestionnaire de menus standard de Dolibarr : + +- Classe `MenuManager` dans `oblyon_menu.php` +- Force les constantes `MAIN_MENU_STANDARD_FORCED`, `MAIN_MENUFRONT_STANDARD_FORCED`, `MAIN_MENU_SMARTPHONE_FORCED` → `oblyon_menu.php` +- Support du mode inversé (`MAIN_MENU_INVERT`) : le menu gauche passe en barre horizontale en haut +- Support du menu réduit (`OBLYON_REDUCE_LEFTMENU`) avec effets hover +- Support du menu caché (`OBLYON_HIDE_LEFTMENU`) avec effets slide/push (`OBLYON_EFFECT_LEFTMENU`) +- Bibliothèque complète des entrées de menus dans `oblyon.lib.php` (~2400 lignes) couvrant tous les modules Dolibarr + +## Hooks et comportement (Hook behavior) + +La classe `ActionsOblyon` (dans `class/actions_oblyon.class.php`) est actuellement quasi vide : + +- Contexte déclaré : `main` (toutes les pages, entité `0`) +- Hook `addHtmlHeader()` commenté (injectait le CSS personnalisé `OBLYON_CUSTOM_CSS`) +- La logique CSS personnalisé est désormais gérée directement par `custom.css.php` dans le thème + +## Données / SQL (Data model) + +Le module ne crée aucune table SQL propre. Toute la configuration est stockée dans `llx_const`. + +Fichier SQL : + +- `data.sql` : ~120 constantes initiales couvrant toutes les catégories de personnalisation + +Le mécanisme de backup/restore sauvegarde et restaure les constantes `OBLYON_*`, `THEME_*`, `MAIN_*`, `FIX_*`, `DISABLE_*` dans `DOL_DATA_ROOT//oblyon/sql/update.`. + +## Constantes de configuration (Key settings) + +Le module utilise un grand nombre de constantes (~120) organisées par catégorie : + +### Menus + +| Constante | Description | Valeur par défaut | +|-----------|-------------|-------------------| +| `MAIN_MENU_INVERT` | Menu inversé (horizontal) | `0` | +| `OBLYON_FULLSIZE_TOPBAR` | Barre supérieure pleine largeur | `0` | +| `MAIN_SHOW_LOGO` | Afficher le logo dans le menu | `0` | +| `OBLYON_STICKY_TOPBAR` | Barre supérieure collante | `0` | +| `OBLYON_HIDE_TOPICONS` | Masquer les icônes du menu supérieur | `0` | +| `OBLYON_STICKY_LEFTBAR` | Menu gauche collant | `0` | +| `OBLYON_HIDE_LEFTMENU` | Masquer le menu gauche | `0` | +| `OBLYON_EFFECT_LEFTMENU` | Effet du menu caché (`slide`/`push`) | `slide` | +| `OBLYON_HIDE_LEFTICONS` | Masquer les icônes du menu gauche | `0` | +| `OBLYON_REDUCE_LEFTMENU` | Réduire le menu gauche | `0` | +| `OBLYON_EFFECT_REDUCE_LEFTMENU` | Effet du menu réduit (`only`/`hover`) | `only` | +| `OBLYON_TOUCH_MENU` | Forcer le mode tactile des menus (tap-to-toggle) | `0` | + +### Couleurs — Menus + +- `OBLYON_COLOR_TOPMENU_BCKGRD`, `_BCKGRD_HOVER`, `_TXT`, `_TXT_ACTIVE`, `_TXT_HOVER` +- `OBLYON_COLOR_LEFTMENU_BCKGRD`, `_BCKGRD_HOVER`, `_TXT`, `_TXT_ACTIVE`, `_TXT_HOVER` + +### Couleurs — Boutons + +- `OBLYON_COLOR_BUTTON_ACTION1`, `_ACTION2`, `_DELETE1`, `_DELETE2` + +### Couleurs — Messages + +- `OBLYON_COLOR_INFO_BORDER`, `_BCKGRD`, `_TEXT` +- `OBLYON_COLOR_WARNING_BORDER`, `_BCKGRD`, `_TEXT` +- `OBLYON_COLOR_ERROR_BORDER`, `_BCKGRD`, `_TEXT` +- `OBLYON_COLOR_NOTIF_*_BCKGRD`, `_TEXT` (info, warning, error) + +### Couleurs — Options générales + +- `OBLYON_COLOR_MAIN`, `_BCKGRD`, `_LOGO_BCKGRD`, `_LOGIN_BCKGRD` +- `OBLYON_COLOR_BTITLE`, `_FTITLE`, `_STITLE` +- `OBLYON_COLOR_BLINE`, `_BLINE_HOVER`, `_FLINE`, `_FLINE_HOVER` +- `OBLYON_COLOR_FDATE_DEFAULT`, `_FDATE_SELECTED` +- `OBLYON_COLOR_TEXTTABACTIVE`, `_INPUT_BCKGRD` +- `OBLYON_COLOR_INFOBOX_BCKGRD1`, `_BCKGRD2`, `_BORDER_ACTIONCOLUMN` +- `THEME_INVERT_RATIO_FILTER` + +### Couleurs — Dolibarr core (THEME_ELDY_*) + +- `THEME_ELDY_TOPBORDER_TITLE1`, `_BACKTITLE1`, `_BACKTABACTIVE` +- `THEME_ELDY_LINEPAIR1`, `_LINEPAIR2`, `_LINEIMPAIR1`, `_LINEIMPAIR2`, `_LINEBREAK` +- `THEME_ELDY_TEXTTITLENOTAB`, `_TEXTTITLE`, `_TEXT`, `_TEXTLINK` +- `THEME_ELDY_ENABLE_PERSONALIZED` + +### Dashboard — Infobox + +- `MAIN_DISABLE_GLOBAL_WORKBOARD`, `_GLOBAL_BOXSTATS`, `_METEO` +- `MAIN_DISABLE_BLOCK_*` (AGENDA, PROJECT, CUSTOMER, SUPPLIER, CONTRACT, BANK, ADHERENT, EXPENSEREPORT, HOLIDAY, TICKET, BOM) +- `THEME_INFOBOX_COLOR_ON_BACKGROUND` +- `OBLYON_INFOXBOX_SINGLE_WIDTH` +- `THEME_AGRESSIVENESS_RATIO` + +### Dashboard — Couleurs infobox + +- `OBLYON_INFOXBOX_BACKGROUND`, `_WEATHER_COLOR` +- `OBLYON_INFOXBOX_ACTION_COLOR`, `_PROJECT_COLOR` +- `OBLYON_INFOXBOX_CUSTOMER_PROPAL_COLOR`, `_ORDER_COLOR`, `_INVOICE_COLOR` +- `OBLYON_INFOXBOX_SUPPLIER_PROPAL_COLOR`, `_ORDER_COLOR`, `_INVOICE_COLOR` +- `OBLYON_INFOXBOX_CONTRAT_COLOR`, `_BANK_COLOR`, `_ADHERENT_COLOR` +- `OBLYON_INFOXBOX_EXPENSEREPORT_COLOR`, `_HOLIDAY_COLOR`, `_TICKET_COLOR`, `_MRP_COLOR` + +### Options générales + +| Constante | Description | Valeur par défaut | +|-----------|-------------|-------------------| +| `OBLYON_FONT_FAMILY` | Famille de police | `Arial` | +| `OBLYON_FONT_SIZE` | Taille de police | `14` | +| `OBLYON_IMAGE_HEIGHT_TABLE` | Hauteur max des images dans les tableaux | `24` | +| `MAIN_MAXTABS_IN_CARD` | Nombre max d'onglets par fiche | — | +| `OBLYON_DISABLE_VERSION` | Masquer la version Dolibarr | `1` | +| `MAIN_STATUS_USES_IMAGES` | Utiliser des images pour les statuts | `0` | +| `MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN` | Menu rapide dropdown | `0` | +| `MAIN_USE_TOP_MENU_BOOKMARK_DROPDOWN` | Favoris dropdown | `0` | +| `OBLYON_PADDING_RIGHT_BOTTOM` | Padding en bas à droite | `1` | +| `MAIN_LOGIN_RIGHT` | Login à droite | `0` | +| `FIX_AREAREF_TABACTION` | Fixer la bannière de référence au scroll | `0` | +| `MAIN_CHECKBOX_LEFT_COLUMN` | Colonne de sélection à gauche | `0` | +| `FIX_STICKY_HEADER_CARD` | En-tête de tableau collant | `0` | +| `OBLYON_CUSTOM_CSS` | CSS personnalisé | — | + +### FontAwesome + +| Constante | Description | +|-----------|-------------| +| `MAIN_FONTAWESOME_DIRECTORY` | Répertoire du pack FA (`/theme/common/fontawesome-N`) | +| `MAIN_FONTAWESOME_FAMILY` | Famille FA sélectionnée | +| `MAIN_FONTAWESOME_ICON_STYLE` | Style d'icônes (`fas`, `far`, `fal`, `fat`, `fad`) | +| `MAIN_FONTAWESOME_WEIGHT` | Poids de police FA (`100`-`900`) | + +### CKEditor + +- `FCKEDITOR_ALLOW_ANY_CONTENT`, `FCKEDITOR_ENABLE_SCAYT_AUTOSTARTUP` +- `MAIN_SECURITY_ALLOW_UNSECURED_LABELS_WITH_HTML` + +Point de vigilance : les constantes `OBLYON_*` sont très nombreuses (~80+) ; éviter les changements massifs sans test visuel. + +## Conventions de développement (Development conventions) + +Respecter les règles Dolibarr du dépôt parent : + +- compatibilité PHP (code base : 7.1–8.4), +- pas de framework lourd / pas de Composer en core (Parsedown vendorisé dans `includes/`), +- entrées utilisateur via `GETPOST*` avec type approprié, +- constantes via `getDolGlobalString()`, `getDolGlobalInt()`, `getDolGlobalBool()`, +- SQL sécurisé : cast `int`, échappement `$db->escape()` / `$db->escapeforlike()`, +- gestion multi-entité via `entity` / `getEntity()`, +- protection XSS : `dol_escape_htmltag()` sur `$_SERVER['PHP_SELF']` dans les formulaires, +- validation whitelist sur les constantes modifiées via regex `set_(.*)`. + +## Workflow recommandé après changements structurels (Recommended workflow) + +Si modification SQL / descripteur / thème CSS / menus / constantes : + +1. Désactiver puis réactiver le module +2. Vérifier que le thème `oblyon` est bien actif (`MAIN_THEME`) +3. Vérifier les constantes de couleurs dans l'onglet Colors +4. Vider le cache navigateur (les CSS sont mis en cache) +5. Vérifier le rendu du menu (inversé / standard / réduit) +6. Vérifier le dashboard (couleurs infobox, blocs activés) +7. Vérifier la page de connexion +8. Si modification de `oblyon.lib.php` (menus) : tester toutes les entrées de menu principales + +## Points d'attention (Watchpoints) + +- Le thème est servi depuis `htdocs/custom/oblyon/themeoblyon/` et non depuis `htdocs/theme/oblyon/` (le mécanisme de copie a été désactivé par InfraS) +- Le fichier `global.inc.php` fait ~11000 lignes ; les modifications CSS doivent être ciblées +- La version est lue depuis le fichier `VERSION` à la racine du module (pas de `changelog.xml`) +- Le changelog est affiché via Parsedown (`CHANGELOG.md`) +- Le module force le gestionnaire de menus (`MAIN_MENU*_FORCED` → `oblyon_menu.php`) +- La désactivation du module restaure le thème `eldy` et nettoie toutes les constantes de thème +- Les constantes de backup/restore utilisent un pattern de LIKE SQL : `OBLYON_%`, `THEME_%`, `MAIN_%`, `FIX_%` +- L'extension CSS pour modules externes est dans `themeoblyon/modules/` (quicklist, scaninvoices, subtotal) +- Le backport `v21` contient des fonctions rétro-compatibles pour les anciennes versions de Dolibarr +- Compatibilité Easya : si `EASYA_VERSION >= 2024`, les versions min PHP/Dolibarr sont lues depuis `.easya_info.json` +- Le `config.php` remonte les répertoires parents pour trouver `main.inc.php` (compatibilité multi-déploiement) + +## Dernières mises à jour (Recent updates) + +- `3.2.0` (2026-06) : mode tactile des menus (tap-to-toggle) — corrige le repli incontrôlé des dropdowns sur écran tactile (dépendance au `:hover`). Auto-détection + option `OBLYON_TOUCH_MENU` ; nouveaux fichiers `themeoblyon/touchmenu.inc.php` et `js/oblyon.js` +- `3.1.0` (2025-11) : compatibilité Dolibarr v21/v22/v23 +- `3.1.0` (2025-11) : ajout de l'onglet « Icons » pour sélection du pack FontAwesome +- `3.1.0` (2025-11) : option de changement de famille de police (`OBLYON_FONT_FAMILY`) +- `3.1.0` (2025-11) : séparation des options de couleur titres principaux/titres de lignes +- `3.1.0` (2025-11) : suppression du CSS Cashdesk, passage à Dolibarr v18 minimum +- `3.1.0` (2025-11) : CSS fixes divers, déplacement menu catégories (v22 → outils) +- `3.0.6` (2024-09) : fix CSS badges, `FIX_AREAREF_TABACTION`, `print_oblyon_menu` avec `$noout=1` +- `3.0.5` (2024-09) : fix Z-index, ajout landing page spécifique, fix dropdown action +- `3.0.4` (2024-07) : CSS drag & drop, fix ordres menu, détection Easya `.easya_info.json` +- Entrées du changelog par version au format Keep a Changelog + +## Notes techniques (Technical notes) + +### Mécanisme de thème + +Oblyon est un thème « externe » : il est chargé depuis `htdocs/custom/oblyon/themeoblyon/` au lieu du répertoire standard `htdocs/theme/`. Le descripteur module force `MAIN_THEME=oblyon` et Dolibarr recherche d'abord dans les répertoires alternatifs (`$dolibarr_main_url_root_alt`) avant le répertoire standard. + +### Flux de chargement CSS + +``` +Dolibarr charge le thème actif + ↓ +style.css.php est appelé (NOLOGIN, NOCSRFCHECK, NOTOKENRENEWAL) + ↓ +theme_vars.inc.php lit les constantes OBLYON_* et THEME_ELDY_* + → Définit les variables PHP ($colorbackhmenu1, $fontlist, etc.) + ↓ +global.inc.php génère le CSS principal + → Définit les variables CSS :root (--colorbackhmenu1, --fontawesomeFamily, etc.) + → Inclut toutes les règles CSS (~11000 lignes) + ↓ +Fichiers .inc.php spécialisés (badges, btn, dropdown, info-box, login, etc.) + ↓ +custom.css.php injecte le CSS personnalisé (OBLYON_CUSTOM_CSS) +``` + +### Mécanisme de backup/restore + +Le module implémente un système de sauvegarde/restauration des constantes : + +1. **Sauvegarde** (`oblyon_bkup_module`) : génère un fichier SQL de type dump dans `DOL_DATA_ROOT//oblyon/sql/update.` contenant tous les `INSERT ... ON DUPLICATE KEY UPDATE` pour les constantes `OBLYON_%`, `THEME_%`, `MAIN_%`, `FIX_%` +2. **Restauration** (`oblyon_restore_module`) : exécute le fichier SQL sauvegardé via `run_sql()` +3. Une copie horodatée est conservée dans `DOL_DATA_ROOT//admin/` + +### Gestionnaire de menus (MenuManager) + +Le `MenuManager` Oblyon remplace le gestionnaire standard de Dolibarr : + +- **Classe** : `MenuManager` dans `core/menus/standard/oblyon_menu.php` +- **Chargement** : `loadMenu()` charge les menus depuis la base via `Menubase` et `require_once` la bibliothèque `oblyon.lib.php` +- **Rendu top** : `showmenu()` génère le menu horizontal supérieur avec support dropdown +- **Rendu left** : affiche le menu latéral avec support des niveaux 0-3 +- **Bibliothèque** : `oblyon.lib.php` (~2400 lignes) définit toutes les entrées de menus (home, thirdparties, products, commercial, compta, bank, projects, HRM, tools, members, admin) +- Le menu respecte les droits utilisateur (`$user->hasRight(...)`) et les modules activés (`isModEnabled(...)`) + +### Pages d'administration + +Toutes les pages d'administration suivent le même pattern : + +1. Inclusion de `config.php` → charge `main.inc.php` +2. Contrôle d'accès : `if (!$user->admin) accessforbidden();` +3. Actions : `GETPOST('action', 'alpha')` avec support backup/restore, on/off (`set_*`), update (`update_*`) +4. Whitelist sur les constantes modifiables : `preg_match('/^(OBLYON_|THEME_|MAIN_|FIX_|DISABLE_)/', $confkey)` +5. Reset du cache : `$_SESSION['dol_resetcache']` +6. Rendu : `llxHeader()`, onglets via `oblyon_admin_prepare_head()`, `llxFooter()` + +### Helpers HTML de la bibliothèque admin + +La bibliothèque `lib/oblyon.lib.php` fournit des fonctions utilitaires pour les pages d'administration : + +| Fonction | Description | +|----------|-------------| +| `oblyon_admin_prepare_head()` | Génère les onglets (Options, Menus, Icons, Colors, Dashboard, Custom CSS, About, Changelog) | +| `oblyon_bkup_module($name)` | Sauvegarde les constantes module en SQL | +| `oblyon_bkup_table($table, ...)` | Génère le SQL de backup d'une table | +| `oblyon_restore_module($name)` | Restaure les constantes depuis le fichier SQL | +| `oblyon_print_backup_restore()` | Affiche la section backup/restore HTML | +| `oblyon_print_colgroup($metas)` | Affiche un `` HTML | +| `oblyon_print_liste_titre($metas)` | Affiche un titre de liste HTML | +| `oblyon_print_btn_action($action)` | Affiche un bouton d'action (submit) | +| `oblyon_print_hr($cs1)` | Affiche un séparateur horizontal | +| `oblyon_print_final($cs1)` | Affiche une ligne finale | +| `oblyon_print_input($confkey, $tag, ...)` | Affiche un champ de formulaire (on/off, input, textarea, color, select, range) | \ No newline at end of file diff --git a/CHANGELOG.md b/ChangeLog.md similarity index 75% rename from CHANGELOG.md rename to ChangeLog.md index 1d6db4b..101fd7a 100644 --- a/CHANGELOG.md +++ b/ChangeLog.md @@ -1,87 +1,119 @@ -## Changelog ## - -### Version 3.0.5 - Compatibility 14.0.x - 20.0.x (2024/09/01) +# CHANGELOG OBLYON FOR [DOLIBARR ERP CRM](https://www.dolibarr.org) +All notable changes to this project will be documented in this file. + +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.2.0] - Compatibility 18.0.x - 23.0.x (2026/06/19) +### Added +- Touch screen menu mode (tap-to-toggle): drop-down menus open on tap instead of :hover. Auto-detected on touch devices, plus a new option to force it (Menus tab) +### Fixed +- Drop-down menus (inverted top menu, reduced left menu) collapsing uncontrollably on touch screens because they relied on :hover. A tap now opens the sub-menu and keeps it open without loading the parent page +### [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 +121,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 +168,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 +255,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 +277,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 +288,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 +299,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 +328,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 +345,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 +371,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 +380,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 +397,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..8debe38 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,583 @@ * 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', + 'THEME_ELDY_PROSPECTBACK', + 'THEME_ELDY_CUSTOMERBACK', + 'THEME_ELDY_VENDORBACK', + 'THEME_ELDY_USERBACK', + 'THEME_ELDY_COLORNATURE', + 'THEME_ELDY_MEMBER_COMPANYBACK', + 'THEME_ELDY_MEMBER_INDIVIDUALBACK', + 'THEME_ELDY_COLORMENBER', + ) + ); +$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', + 'THEME_ELDY_PROSPECTBACK' => '#A7C5B0', + 'THEME_ELDY_CUSTOMERBACK' => '#55955D', + 'THEME_ELDY_VENDORBACK' => '#599CAF', + 'THEME_ELDY_USERBACK' => '#79633F', + 'THEME_ELDY_COLORNATURE' => '#FFFFFF', + 'THEME_ELDY_MEMBER_COMPANYBACK' => '#E4E4E4', + 'THEME_ELDY_MEMBER_INDIVIDUALBACK' => '#E4E4E4', + 'THEME_ELDY_COLORMENBER' => '#666666' + ), + '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', + 'THEME_ELDY_PROSPECTBACK' => '#A7C5B0', + 'THEME_ELDY_CUSTOMERBACK' => '#55955D', + 'THEME_ELDY_VENDORBACK' => '#599CAF', + 'THEME_ELDY_USERBACK' => '#79633F', + 'THEME_ELDY_COLORNATURE' => '#FFFFFF', + 'THEME_ELDY_MEMBER_COMPANYBACK' => '#E4E4E4', + 'THEME_ELDY_MEMBER_INDIVIDUALBACK' => '#E4E4E4', + 'THEME_ELDY_COLORMENBER' => '#666666' + ), + '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', + 'THEME_ELDY_PROSPECTBACK' => '#A7C5B0', + 'THEME_ELDY_CUSTOMERBACK' => '#55955D', + 'THEME_ELDY_VENDORBACK' => '#599CAF', + 'THEME_ELDY_USERBACK' => '#79633F', + 'THEME_ELDY_COLORNATURE' => '#FFFFFF', + 'THEME_ELDY_MEMBER_COMPANYBACK' => '#E4E4E4', + 'THEME_ELDY_MEMBER_INDIVIDUALBACK' => '#E4E4E4', + 'THEME_ELDY_COLORMENBER' => '#666666' + ), + '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', + 'THEME_ELDY_PROSPECTBACK' => '#A7C5B0', + 'THEME_ELDY_CUSTOMERBACK' => '#55955D', + 'THEME_ELDY_VENDORBACK' => '#599CAF', + 'THEME_ELDY_USERBACK' => '#79633F', + 'THEME_ELDY_COLORNATURE' => '#FFFFFF', + 'THEME_ELDY_MEMBER_COMPANYBACK' => '#E4E4E4', + 'THEME_ELDY_MEMBER_INDIVIDUALBACK' => '#E4E4E4', + 'THEME_ELDY_COLORMENBER' => '#666666' + ), + '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', + 'THEME_ELDY_PROSPECTBACK' => '#A7C5B0', + 'THEME_ELDY_CUSTOMERBACK' => '#55955D', + 'THEME_ELDY_VENDORBACK' => '#599CAF', + 'THEME_ELDY_USERBACK' => '#79633F', + 'THEME_ELDY_COLORNATURE' => '#FFFFFF', + 'THEME_ELDY_MEMBER_COMPANYBACK' => '#E4E4E4', + 'THEME_ELDY_MEMBER_INDIVIDUALBACK' => '#E4E4E4', + 'THEME_ELDY_COLORMENBER' => '#666666' + ) + ); + +// 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]; + if (preg_match('/^(OBLYON_|THEME_|MAIN_|FIX_|DISABLE_)/', $confkey)) { + $result = dolibarr_set_const($db, $confkey, GETPOST('value', 'alphanohtml'), '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; +} +// 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; } - // 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 +619,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 +653,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..78f57f9 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(); @@ -79,7 +89,7 @@ $formfile = new FormFile($db); // setup page goes here ************************* -print ''; +print ''; print ''; print ''; print ''; @@ -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..4ecb3ba 100644 --- a/admin/dashboard.php +++ b/admin/dashboard.php @@ -1,178 +1,197 @@ - * 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); +/************************************************ +* 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/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'; +dol_include_once('/oblyon/lib/oblyon.lib.php'); +dol_include_once('/oblyon/backport/v21/core/lib/functions.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 ******************************* +$result = !getDolGlobalString('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 + 'OBLYON_INFOXBOX_MRP_COLOR', // #212529 MRP + ); + +// 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]; + if (preg_match('/^(OBLYON_|THEME_|MAIN_|FIX_|DISABLE_)/', $confkey)) { + $result = dolibarr_set_const($db, $confkey, GETPOST('value', 'alphanohtml'), '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 - - // 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%"').' + '.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..7142ca8 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 (GETPOST('select_fa', 'alpha')) { + $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..41919b6 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,91 +17,107 @@ * 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); +// 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]; + if (preg_match('/^(OBLYON_|THEME_|MAIN_|FIX_|DISABLE_)/', $confkey)) { + $result = dolibarr_set_const($db, $confkey, GETPOST('value', 'alphanohtml'), '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 +} +// 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 = 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) : ''; - // 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) : ''; +// View ***************************************** +$page_name = $langs->trans('OblyonMenusTitle'); +$help_url = ''; +llxHeader('', $page_name, $help_url, '', 0, 0, '', '', '', 'mod-oblyon page-admin_menus'); - // View ***************************************** - $page_name = $langs->trans('OblyonMenusTitle'); - llxHeader('', $page_name); - $linkback = ''.$langs->trans('BackToModuleList').''; - print load_fiche_titre($page_name, $linkback); +$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, 'menus', $langs->trans('Module432573Name'), 0, 'inovea@oblyon'); +// Configuration header ************************* +$head = oblyon_admin_prepare_head(); +print dol_get_fiche_head($head, 'menus', $langs->trans('Module432573Name'), -1, "title_setup"); - // 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 '
- '; + +// Sauvegarde / Restauration +oblyon_print_backup_restore(); +clearstatcache(); +print '
'; +print '
'; $metas = array('*', '156px', '300px'); oblyon_print_colgroup($metas); $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'menus'); @@ -110,69 +126,74 @@ oblyon_print_final(); $metas = array(array(3), 'TopMenu'); oblyon_print_liste_titre($metas); - // Option only if invert menu is on - if (!empty($conf->global->MAIN_MENU_INVERT)) { - $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'menus'); - $warning = empty($conf->global->OBLYON_FULLSIZE_TOPBAR) ? '
'.$langs->trans('FullsizeTopBarWarning').'' : ''; - oblyon_print_input('OBLYON_FULLSIZE_TOPBAR', 'on_off', $langs->trans('FullsizeTopBar').$warning, '', $metas, 2, 1); // Fullsize top bar - } - $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'menus'); - oblyon_print_input('MAIN_SHOW_LOGO', 'on_off', $langs->trans('OblyonEnableShowLogo'), '', $metas, 2, 1); // Show Company Logo - $warning = !empty($conf->global->OBLYON_STICKY_TOPBAR) ? '
'.$langs->trans('StickyTopBarWarning').''.(!empty($conf->global->MAIN_MENU_INVERT) ? '
'.$langs->trans('StickyTopBarInvertedWarning').'' : '') : ''; - $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'menus'); - oblyon_print_input('OBLYON_STICKY_TOPBAR', 'on_off', $langs->trans('StickyTopBar').$warning, '', $metas, 2, 1); // Sticky top bar - $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'menus'); - oblyon_print_input('OBLYON_HIDE_TOPICONS', 'on_off', $langs->trans('HideTopIcons'), '', $metas, 2, 1); // Hide top icons - // Left menu - $metas = array(array(3), 'LeftMenu'); - oblyon_print_liste_titre($metas); - $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'menus'); - if (!empty($conf->global->MAIN_MENU_INVERT)) { - //oblyon_print_input('OBLYON_SHOW_COMPNAME', 'on_off', $langs->trans('ShowCompanyName'), '', $metas, 2, 1); // Show Company name - } else { - oblyon_print_input('OBLYON_SHOW_COMPNAME', 'on_off', $langs->trans('ShowCompanyName'), '', $metas, 2, 1); // Show Company name - } - $warning = !empty($conf->global->OBLYON_STICKY_LEFTBAR) ? '
'.$langs->trans('StickyLeftBarWarning').''.(!empty($conf->global->MAIN_MENU_INVERT) ? '
'.$langs->trans('StickyLeftBarInvertedWarning').'' : '') : ''; - $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'menus'); - oblyon_print_input('OBLYON_STICKY_LEFTBAR', 'on_off', $langs->trans('StickyLeftBar').$warning, '', $metas, 2, 1); // Sticky left bar + +// Option only if invert menu is on +if (getDolGlobalString('MAIN_MENU_INVERT')) { $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'menus'); - oblyon_print_input('OBLYON_HIDE_LEFTMENU', 'on_off', $langs->trans('HideLeftMenu'), '', $metas, 2, 1); // Hide left menu - // Effect open leftmenu - if (getDolGlobalInt('OBLYON_HIDE_LEFTMENU')) { - print ' - - - '; - } + $warning = !getDolGlobalString('OBLYON_FULLSIZE_TOPBAR') ? '
'.$langs->trans('FullsizeTopBarWarning').'' : ''; + oblyon_print_input('OBLYON_FULLSIZE_TOPBAR', 'on_off', $langs->trans('FullsizeTopBar').$warning, '', $metas, 2, 1); // Fullsize top bar +} +$metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'menus'); +oblyon_print_input('MAIN_SHOW_LOGO', 'on_off', $langs->trans('OblyonEnableShowLogo'), '', $metas, 2, 1); // Show Company Logo +$warning = getDolGlobalString('OBLYON_STICKY_TOPBAR') ? '
'.$langs->trans('StickyTopBarWarning').''.(getDolGlobalString('MAIN_MENU_INVERT') ? '
'.$langs->trans('StickyTopBarInvertedWarning').'' : '') : ''; +$metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'menus'); +oblyon_print_input('OBLYON_STICKY_TOPBAR', 'on_off', $langs->trans('StickyTopBar').$warning, '', $metas, 2, 1); // Sticky top bar +$metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'menus'); +oblyon_print_input('OBLYON_HIDE_TOPICONS', 'on_off', $langs->trans('HideTopIcons'), '', $metas, 2, 1); // Hide top icons +// Left menu +$metas = array(array(3), 'LeftMenu'); +oblyon_print_liste_titre($metas); +$metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'menus'); +if (getDolGlobalString('MAIN_MENU_INVERT')) { + //oblyon_print_input('OBLYON_SHOW_COMPNAME', 'on_off', $langs->trans('ShowCompanyName'), '', $metas, 2, 1); // Show Company name +} else { + oblyon_print_input('OBLYON_SHOW_COMPNAME', 'on_off', $langs->trans('ShowCompanyName'), '', $metas, 2, 1); // Show Company name +} +$warning = getDolGlobalString('OBLYON_STICKY_LEFTBAR') ? '
'.$langs->trans('StickyLeftBarWarning').''.(getDolGlobalString('MAIN_MENU_INVERT') ? '
'.$langs->trans('StickyLeftBarInvertedWarning').'' : '') : ''; +$metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'menus'); +oblyon_print_input('OBLYON_STICKY_LEFTBAR', 'on_off', $langs->trans('StickyLeftBar').$warning, '', $metas, 2, 1); // Sticky left bar +$metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'menus'); +oblyon_print_input('OBLYON_HIDE_LEFTMENU', 'on_off', $langs->trans('HideLeftMenu'), '', $metas, 2, 1); // Hide left menu +// Effect open leftmenu +if (getDolGlobalInt('OBLYON_HIDE_LEFTMENU')) { + print ' + + + '; +} +$metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'menus'); +oblyon_print_input('OBLYON_HIDE_LEFTICONS', 'on_off', $langs->trans('HideLeftIcons'), '', $metas, 2, 1); // Hide left icons +if (getDolGlobalString('MAIN_MENU_INVERT')) { $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'menus'); - oblyon_print_input('OBLYON_HIDE_LEFTICONS', 'on_off', $langs->trans('HideLeftIcons'), '', $metas, 2, 1); // Hide left icons - if (!empty($conf->global->MAIN_MENU_INVERT)) { - $metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'menus'); - $warning = !empty($conf->global->OBLYON_REDUCE_LEFTMENU) ? '
'.$langs->trans('MicroMenuLeftBarHideLeftIconsWarning').'
'.$langs->trans('MicroMenuLeftBarCompanyNameWarning').'' : ''; - oblyon_print_input('OBLYON_REDUCE_LEFTMENU', 'on_off', $langs->trans('ReduceLeftMenu').$warning, '', $metas, 2, 1); // Micro left menu - // Effect hover leftmenu - if (!empty($conf->global->OBLYON_REDUCE_LEFTMENU)) { - print ' - - - '; - } + $warning = getDolGlobalString('OBLYON_REDUCE_LEFTMENU') ? '
'.$langs->trans('MicroMenuLeftBarHideLeftIconsWarning').'
'.$langs->trans('MicroMenuLeftBarCompanyNameWarning').'' : ''; + oblyon_print_input('OBLYON_REDUCE_LEFTMENU', 'on_off', $langs->trans('ReduceLeftMenu').$warning, '', $metas, 2, 1); // Micro left menu + // Effect hover leftmenu + if (getDolGlobalInt('OBLYON_REDUCE_LEFTMENU')) { + print ' + + + '; } - print '
'.$langs->trans('OpenEffect').' - global->OBLYON_EFFECT_LEFTMENU == "slide" ? ' checked = "checked"' : '').'">  -
- global->OBLYON_EFFECT_LEFTMENU == "push" ? ' checked = "checked"' : '').'">  -
'.$langs->trans('OpenEffect').' +   +
+   +
'.$langs->trans('OpenEffect').' - global->OBLYON_EFFECT_REDUCE_LEFTMENU == "hover" ? ' checked = "checked"' : '').'">  -
- global->OBLYON_EFFECT_REDUCE_LEFTMENU == "only" ? ' checked = "checked"' : '').'">  -
'.$langs->trans('OpenEffect').' +   +
+   +
-
'; - print dol_get_fiche_end(); - oblyon_print_btn_action('Gen'); - print '
-
'; - // End of page - llxFooter(); - $db->close(); -?> \ No newline at end of file +} +// InfraS add begin +$metas = array(array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'menus'); +oblyon_print_input('OBLYON_TOUCH_MENU', 'on_off', $langs->trans('TouchMenu').'
'.$langs->trans('TouchMenuHelp').'', '', $metas, 2, 1); // Touch screen menu mode +// InfraS add end +print ' + '; +print dol_get_fiche_end(); +oblyon_print_btn_action('Gen'); +print ' +
'; + +// End of page +llxFooter(); +$db->close(); diff --git a/admin/options.php b/admin/options.php index 7f5050f..0dcc3df 100644 --- a/admin/options.php +++ b/admin/options.php @@ -1,164 +1,417 @@ - * 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/options.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(); - - // 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); +/************************************************ +* 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/options.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'; +dol_include_once('/oblyon/lib/oblyon.lib.php'); +dol_include_once('/oblyon/backport/v21/core/lib/functions.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(); + +// 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]; + if (preg_match('/^(OBLYON_|THEME_|MAIN_|FIX_|DISABLE_)/', $confkey)) { + $result = dolibarr_set_const($db, $confkey, GETPOST('value', 'alphanohtml'), 'chaine', 0, 'Oblyon module', $conf->entity); } +} // Update buttons management - if (preg_match('/update_(.*)/', $action, $reg)) { - $list = array ('Gen' => array('OBLYON_FONT_SIZE', 'OBLYON_IMAGE_HEIGHT_TABLE')); - $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 +if (preg_match('/update_(.*)/', $action, $reg)) { + $list = array('Card' => array('OBLYON_FONT_SIZE', 'OBLYON_IMAGE_HEIGHT_TABLE', 'OBLYON_FONT', 'OBLYON_FONT_FAMILY', 'MAIN_MAXTABS_IN_CARD')); + $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 ******************************* +// Liste des polices web standards +$font_options = array ('Arial' => 'Arial', + 'Arial Black' => 'Arial Black', + 'Arial Narrow' => 'Arial Narrow', + 'Calibri' => 'Calibri', + 'Cambria' => 'Cambria', + 'Candara' => 'Candara', + 'Century Gothic' => 'Century Gothic', + 'Comic Sans MS' => 'Comic Sans MS', + 'Consolas' => 'Consolas', + 'Courier New' => 'Courier New', + 'Copperplate Gothic' => 'Copperplate Gothic', + 'Franklin Gothic' => 'Franklin Gothic', + 'Georgia' => 'Georgia', + 'Gill Sans' => 'Gill Sans', + 'Helvetica' => 'Helvetica', + 'Impact' => 'Impact', + 'Lucida Console' => 'Lucida Console', + 'Lucida Sans' => 'Lucida Sans', + 'Microsoft Sans Serif' => 'Microsoft Sans Serif', + 'Open Sans' => 'Open Sans', + 'Palatino Linotype' => 'Palatino Linotype', + 'Sans-serif' => 'Sans-serif', + 'Segoe UI' => 'Segoe UI', + 'Tahoma' => 'Tahoma', + 'Times New Roman' => 'Times New Roman', + 'Trebuchet MS' => 'Trebuchet MS', + 'Verdana' => 'Verdana', + ); +$currentFont = getDolGlobalString('OBLYON_FONT_FAMILY', 'Arial'); - // init variables ******************************* +// View ***************************************** +$help_url = ''; +$title = $langs->trans('OblyonOptionsTitle'); - // View ***************************************** - $page_name = $langs->trans('OblyonOptionsTitle'); - llxHeader('', $page_name); - $linkback = ''.$langs->trans('BackToModuleList').''; - print load_fiche_titre($page_name, $linkback); +llxHeader('', $title, $help_url, '', 0, 0, '', '', 'mod-oblyon page-admin-options'); - // Configuration header ************************* - $head = oblyon_admin_prepare_head(); - print dol_get_fiche_head($head, 'options', $langs->trans('Module432573Name'), 0, 'inovea@oblyon'); +$linkback = ''.$langs->trans('BackToModuleList').''; +print load_fiche_titre($title, $linkback, 'object_inovea.png@oblyon'); - // setup page goes here ************************* - $easyaVersion = (float) !empty($conf->global->EASYA_VERSION) ? $conf->global->EASYA_VERSION : ''; +// Configuration header ************************* +$head = oblyon_admin_prepare_head(); - $labs_picto = ' '.img_picto($langs->trans('WIP'), 'fa-flask', '', false, 0, 0, '', 'error '); +print dol_get_fiche_head($head, 'options', $title, -1); - 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 '