Module Modern Template EN: Difference between revisions

From Dolibarr ERP CRM Wiki
Jump to navigation Jump to search
(Created page with "=== '''ModernTemplate — Modernized Interface for Dolibarr''' === '''Version:''' 1.9.2 · '''License:''' GPL v3 · '''Author:''' KSI 30 ---- === '''Overview''' === ModernTem...")
Tag: 2017 source edit
 
No edit summary
Line 1: Line 1:
=== '''ModernTemplate — Modernized Interface for Dolibarr''' ===
==='''ModernTemplate — Modernized Interface for Dolibarr'''===
'''Version:''' 1.9.2 · '''License:''' GPL v3 · '''Author:''' KSI 30
'''Version:''' 1.9.2 · '''License:''' GPL v3 · '''Author:''' KSI 30
----
----


=== '''Overview''' ===
==='''Overview'''===
ModernTemplate provides a full-screen shell for Dolibarr: compact toolbar, reorderable tile column, left sidebar with submenus, and smart search.
ModernTemplate provides a full-screen shell for Dolibarr: compact toolbar, reorderable tile column, left sidebar with submenus, and smart search.


Line 9: Line 9:
----
----


=== '''Highlights''' ===
==='''Highlights'''===


* Centralized navigation using tiles + synchronized submenus
*Centralized navigation using tiles + synchronized submenus
* Drag & Drop tiles, with global or per-user saving
*Drag & Drop tiles, with global or per-user saving
* Multi-object search (exact refs + third parties/contacts + fallback to global search)
*Multi-object search (exact refs + third parties/contacts + fallback to global search)
* Quick customization: colors, start page, help URL, tab visibility
*Quick customization: colors, start page, help URL, tab visibility
* Built-in ModernTemplate pages
*Built-in ModernTemplate pages


----
----


=== '''Translations''' ===
==='''Translations'''===
Available in:
Available in:


Line 25: Line 25:
----
----


=== '''Requirements''' ===
==='''Requirements'''===


* Dolibarr 22.x (recommended)
*Dolibarr 22.x (recommended)
* PHP 7.4+
*PHP 7.4+
* Write access to database and <code>/custom/moderntemplate</code> directory
*Write access to database and <code>/custom/moderntemplate</code> directory


----
----


=== '''Installation''' ===
==='''Installation'''===


# Copy the <code>moderntemplate/</code> folder to <code>htdocs/custom/</code>
#Copy the <code>moderntemplate/</code> folder to <code>htdocs/custom/</code>
# In Dolibarr: go to '''Setup → Modules/Applications''' and enable '''ModernTemplate'''
#In Dolibarr: go to '''Setup → Modules/Applications''' and enable '''ModernTemplate'''
# Visit <code>/custom/moderntemplate/admin/setup.php</code> and click '''Install/Repair''' if prompted
#Visit <code>/custom/moderntemplate/admin/setup.php</code> and click '''Install/Repair''' if prompted
# Tip: a “ModernTemplate” menu will appear at the top and opens the shell at <code>/custom/moderntemplate/shell.php</code>
#Tip: a “ModernTemplate” menu will appear at the top and opens the shell at <code>/custom/moderntemplate/shell.php</code>


----
----


=== '''Configuration''' ===
==='''Configuration'''===


==== '''Tools Tab''' ====
===='''Tools Tab'''====


* '''Start page''' (<code>MODERNTEMPLATE_START_PAGE</code>): default URL to open (e.g. <code>/custom/moderntemplate/home.php?fs=1</code>)
*'''Start page''' (<code>MODERNTEMPLATE_START_PAGE</code>): default URL to open (e.g. <code>/custom/moderntemplate/home.php?fs=1</code>)
* '''Post-login redirection''' (<code>MODERNTEMPLATE_AUTO_REDIRECT</code>, <code>MODERNTEMPLATE_REDIRECT_SCOPE</code>): always or only when no <code>urlfrom</code> is set
*'''Post-login redirection''' (<code>MODERNTEMPLATE_AUTO_REDIRECT</code>, <code>MODERNTEMPLATE_REDIRECT_SCOPE</code>): always or only when no <code>urlfrom</code> is set
* '''Auto full screen''' (<code>MODERNTEMPLATE_AUTO_FULLSCREEN</code>) and permission mask (<code>MODERNTEMPLATE_HIDE_FS_OVERLAY</code>)
*'''Auto full screen''' (<code>MODERNTEMPLATE_AUTO_FULLSCREEN</code>) and permission mask (<code>MODERNTEMPLATE_HIDE_FS_OVERLAY</code>)
* '''Help and bugreport URLs''' (<code>MODERNTEMPLATE_HELP_URL</code>, <code>MODERNTEMPLATE_BUGREPORT_URL</code>)
*'''Help and bugreport URLs''' (<code>MODERNTEMPLATE_HELP_URL</code>, <code>MODERNTEMPLATE_BUGREPORT_URL</code>)
* '''External tiles''' (<code>MODERNTEMPLATE_INCLUDE_EXT_TILES</code>): include non-Dolibarr links
*'''External tiles''' (<code>MODERNTEMPLATE_INCLUDE_EXT_TILES</code>): include non-Dolibarr links


==== '''Colors Tab''' ====
===='''Colors Tab'''====


* '''Banner''': <code>MODERNTEMPLATE_COLOR_BANNER_BG</code>, <code>…FG</code>
*'''Banner''': <code>MODERNTEMPLATE_COLOR_BANNER_BG</code>, <code>…FG</code>
* '''Primary/accent UI''': <code>MODERNTEMPLATE_COLOR_UI_PRIMARY</code>, <code>…ACCENT</code>
*'''Primary/accent UI''': <code>MODERNTEMPLATE_COLOR_UI_PRIMARY</code>, <code>…ACCENT</code>
* '''Tiles''': <code>MODERNTEMPLATE_COLOR_TILE_BG</code>, <code>…TEXT</code>
*'''Tiles''': <code>MODERNTEMPLATE_COLOR_TILE_BG</code>, <code>…TEXT</code>


==== '''Tiles Tab''' ====
===='''Tiles Tab'''====


* Reorder via drag & drop, add sections/links, auto-suggestions from menus
*Reorder via drag & drop, add sections/links, auto-suggestions from menus
* SQL backup/restore (<code>tiles-backup.sql</code>), import/export
*SQL backup/restore (<code>tiles-backup.sql</code>), import/export
* Per-user mode (<code>MODERNTEMPLATE_TILES_PERUSER</code>), ACLs for tiles and sections
*Per-user mode (<code>MODERNTEMPLATE_TILES_PERUSER</code>), ACLs for tiles and sections


==== '''ACL Tab''' ====
===='''ACL Tab'''====


* User-based matrix: tile and section visibility, saved in the database
*User-based matrix: tile and section visibility, saved in the database


==== '''Languages Tab''' ====
===='''Languages Tab'''====


* i18n keys scanned from menus; add/edit manually
*i18n keys scanned from menus; add/edit manually
* Force language option (<code>MODERNTEMPLATE_FORCE_LANG</code>)
*Force language option (<code>MODERNTEMPLATE_FORCE_LANG</code>)


==== '''Access Tab''' ====
===='''Access Tab'''====


* Control access to configuration tabs by profile (admins vs users)
*Control access to configuration tabs by profile (admins vs users)


----
----


=== '''Usage''' ===
==='''Usage'''===


* Click the '''ModernTemplate''' menu to open the shell
*Click the '''ModernTemplate''' menu to open the shell
* Open a tile: content displays in the center; the '''Submenus''' button toggles the contextual left panel
*Open a tile: content displays in the center; the '''Submenus''' button toggles the contextual left panel
* Drag tiles to reorder them (changes are persistent)
*Drag tiles to reorder them (changes are persistent)
* Use the search (magnifying glass icon): type an exact reference (<code>fac-xxx</code>, <code>cmd-xxx</code>, <code>prop-xxx</code>, <code>prod-xxx</code>, etc.) or a third party/contact name or number
*Use the search (magnifying glass icon): type an exact reference (<code>fac-xxx</code>, <code>cmd-xxx</code>, <code>prop-xxx</code>, <code>prod-xxx</code>, etc.) or a third party/contact name or number
* Click '''Help''' to open the configured help URL
*Click '''Help''' to open the configured help URL
* Click '''Exit Shell''' (<code>/custom/moderntemplate/shell/exit.php</code>) to restore the native Dolibarr menus
*Click '''Exit Shell''' (<code>/custom/moderntemplate/shell/exit.php</code>) to restore the native Dolibarr menus


----
----


=== '''Administration & Maintenance''' ===
==='''Administration & Maintenance'''===


* '''Tables''': <code>llx_moderntemplate_pref</code>, <code>llx_moderntemplate_tiles</code> (automatic migration from <code>modernui_*</code>)
*'''Tables''': <code>llx_moderntemplate_pref</code>, <code>llx_moderntemplate_tiles</code> (automatic migration from <code>modernui_*</code>)
* '''Endpoints''':
*'''Endpoints''':
** <code>router/tiles_order.php</code> (tile order)
**<code>router/tiles_order.php</code> (tile order)
** <code>router/left_order.php</code>
**<code>router/left_order.php</code>
** <code>router/search.php</code>
**<code>router/search.php</code>
* '''Key files''':
*'''Key files''':
** <code>shell.php</code>, <code>shell/layout.php</code>, <code>js/shell.js</code>
**<code>shell.php</code>, <code>shell/layout.php</code>, <code>js/shell.js</code>
** <code>core/triggers/interface_99_moderntemplate_redirect.class.php</code>
**<code>core/triggers/interface_99_moderntemplate_redirect.class.php</code>
** <code>core/modules/modModernTemplate.class.php</code>
**<code>core/modules/modModernTemplate.class.php</code>
* '''Backup''': via '''Tiles''' tab → export SQL; restore from <code>.sql</code> file
*'''Backup''': via '''Tiles''' tab → export SQL; restore from <code>.sql</code> file


----
----


=== '''Security & Permissions''' ===
==='''Security & Permissions'''===


* '''Main permission''': Use ModernTemplate (<code>rights_class = moderntemplate</code>, permission <code>use</code>)
*'''Main permission''': Use ModernTemplate (<code>rights_class = moderntemplate</code>, permission <code>use</code>)
* Fully respects Dolibarr rights for tile visibility and link access
*Fully respects Dolibarr rights for tile visibility and link access
* CSRF protection on all write routes
*CSRF protection on all write routes


----
----


=== '''Uninstallation''' ===
==='''Uninstallation'''===


# Disable the module in '''Setup → Modules/Applications'''
#Disable the module in '''Setup → Modules/Applications'''
# (Optional) Use the '''Uninstall''' tab to purge ModernTemplate constants/data
#(Optional) Use the '''Uninstall''' tab to purge ModernTemplate constants/data
# Delete the <code>/custom/moderntemplate</code> folder  ⚠️ If post-login redirection was enabled, make sure to disable it before removing the module
#Delete the <code>/custom/moderntemplate</code> folder  ⚠️ If post-login redirection was enabled, make sure to disable it before removing the module


----
----


=== '''FAQ''' ===
==='''FAQ'''===
'''After login, I'm redirected to the shell — is this normal?'''
'''After login, I'm redirected to the shell — is this normal?'''


Line 132: Line 132:
'''Are third-party modules supported?'''
'''Are third-party modules supported?'''


Tiles/links are based on active module menus and URLs. For custom URLs, add manual tiles.
Tiles/links are based on active module menus and URLs. For custom URLs, add manual tiles.[[File:Dolistore ksi banner.png|center|thumb|[https://www.dolistore.com/index.php?controller=search&orderby=position&orderway=desc&website=marketplace&search_query=k.s.i&submit_search=]|link=https://wiki.dolibarr.org/index.php/File:Dolistore_ksi_banner.png]]

Revision as of 17:48, 27 October 2025

ModernTemplate — Modernized Interface for Dolibarr

Version: 1.9.2 · License: GPL v3 · Author: KSI 30


Overview

ModernTemplate provides a full-screen shell for Dolibarr: compact toolbar, reorderable tile column, left sidebar with submenus, and smart search.

The module integrates via hooks (menuTop, menuLeft, toprightmenu, login, global) and a trigger (USER_LOGIN) for optional post-login redirection.


Highlights

  • Centralized navigation using tiles + synchronized submenus
  • Drag & Drop tiles, with global or per-user saving
  • Multi-object search (exact refs + third parties/contacts + fallback to global search)
  • Quick customization: colors, start page, help URL, tab visibility
  • Built-in ModernTemplate pages

Translations

Available in:

ar_SA, de_DE, en_US, es_ES, fr_FR, it_IT, ja_JP, nl_NL, pl_PL, pt_BR, pt_PT, ru_RU, tr_TR, zh_CN


Requirements

  • Dolibarr 22.x (recommended)
  • PHP 7.4+
  • Write access to database and /custom/moderntemplate directory

Installation

  1. Copy the moderntemplate/ folder to htdocs/custom/
  2. In Dolibarr: go to Setup → Modules/Applications and enable ModernTemplate
  3. Visit /custom/moderntemplate/admin/setup.php and click Install/Repair if prompted
  4. Tip: a “ModernTemplate” menu will appear at the top and opens the shell at /custom/moderntemplate/shell.php

Configuration

Tools Tab

  • Start page (MODERNTEMPLATE_START_PAGE): default URL to open (e.g. /custom/moderntemplate/home.php?fs=1)
  • Post-login redirection (MODERNTEMPLATE_AUTO_REDIRECT, MODERNTEMPLATE_REDIRECT_SCOPE): always or only when no urlfrom is set
  • Auto full screen (MODERNTEMPLATE_AUTO_FULLSCREEN) and permission mask (MODERNTEMPLATE_HIDE_FS_OVERLAY)
  • Help and bugreport URLs (MODERNTEMPLATE_HELP_URL, MODERNTEMPLATE_BUGREPORT_URL)
  • External tiles (MODERNTEMPLATE_INCLUDE_EXT_TILES): include non-Dolibarr links

Colors Tab

  • Banner: MODERNTEMPLATE_COLOR_BANNER_BG, …FG
  • Primary/accent UI: MODERNTEMPLATE_COLOR_UI_PRIMARY, …ACCENT
  • Tiles: MODERNTEMPLATE_COLOR_TILE_BG, …TEXT

Tiles Tab

  • Reorder via drag & drop, add sections/links, auto-suggestions from menus
  • SQL backup/restore (tiles-backup.sql), import/export
  • Per-user mode (MODERNTEMPLATE_TILES_PERUSER), ACLs for tiles and sections

ACL Tab

  • User-based matrix: tile and section visibility, saved in the database

Languages Tab

  • i18n keys scanned from menus; add/edit manually
  • Force language option (MODERNTEMPLATE_FORCE_LANG)

Access Tab

  • Control access to configuration tabs by profile (admins vs users)

Usage

  • Click the ModernTemplate menu to open the shell
  • Open a tile: content displays in the center; the Submenus button toggles the contextual left panel
  • Drag tiles to reorder them (changes are persistent)
  • Use the search (magnifying glass icon): type an exact reference (fac-xxx, cmd-xxx, prop-xxx, prod-xxx, etc.) or a third party/contact name or number
  • Click Help to open the configured help URL
  • Click Exit Shell (/custom/moderntemplate/shell/exit.php) to restore the native Dolibarr menus

Administration & Maintenance

  • Tables: llx_moderntemplate_pref, llx_moderntemplate_tiles (automatic migration from modernui_*)
  • Endpoints:
    • router/tiles_order.php (tile order)
    • router/left_order.php
    • router/search.php
  • Key files:
    • shell.php, shell/layout.php, js/shell.js
    • core/triggers/interface_99_moderntemplate_redirect.class.php
    • core/modules/modModernTemplate.class.php
  • Backup: via Tiles tab → export SQL; restore from .sql file

Security & Permissions

  • Main permission: Use ModernTemplate (rights_class = moderntemplate, permission use)
  • Fully respects Dolibarr rights for tile visibility and link access
  • CSRF protection on all write routes

Uninstallation

  1. Disable the module in Setup → Modules/Applications
  2. (Optional) Use the Uninstall tab to purge ModernTemplate constants/data
  3. Delete the /custom/moderntemplate folder ⚠️ If post-login redirection was enabled, make sure to disable it before removing the module

FAQ

After login, I'm redirected to the shell — is this normal?

Yes, if MODERNTEMPLATE_AUTO_REDIRECT is enabled. Disable it in the Tools tab or adjust MODERNTEMPLATE_REDIRECT_SCOPE.

I'm missing Dolibarr submenus

In the shell view, native menus are hidden by design. Use the left panel or click Exit Shell to return to standard navigation.

Are third-party modules supported?

Tiles/links are based on active module menus and URLs. For custom URLs, add manual tiles.