Skip to content

MelisSmallBusiness ​

Backoffice collaboration features for the CMS — page versioning, a validation workflow, page comments, page locking, user roles and a TinyMCE media library. Package melisplatform/melis-small-business.

Purpose ​

MelisSmallBusiness layers small-team / small-business collaboration tooling on top of the CMS page editor. It keeps versions of published pages (so a page can be restored or previewed at an earlier state), drives a content workflow where an editor asks for validation and a reviewer validates or refuses it, attaches comments to pages, prevents two users from editing the same page at once through a page lock, manages a custom user role tool, and ships a TinyMCE-based media library (MoxieManager) for browsing and uploading files. Most of its behaviour is wired through CMS editor events (see Modules).

Enable it ​

This is a standard Laminas module. Add it to config/melis.module.load.php:

php
return [
    // …
    'MelisSmallBusiness',
];

It depends on melis-core, melis-engine, melis-front and melis-cms (see composer.json), and its tables are created via dbdeploy (extra.dbdeploy = true). The module's Module::init() attaches MelisSBAddModuleConfigListener and, on backoffice routes, a set of CMS-editor listeners (versioning save, page-lock, workflow, rights tree, TinyMCE config…).

Key services ​

Service aliasRole
MelisEnginePageThe module overrides the engine's page service with MelisSBPageService (extends MelisPageService). Its getDatasPage($idPage, $type = 'published') lets the editor read page data from the versioning store as well as the live page.
MelisSBPageCommentServicePage comments: getPageComments($idPage, $newsId, $blogId), setPageComments(array $data, $commentType = 1), getPageCommentForm().

Table gateways are also registered as services: MelisPageComment, MelisPageCommentType, MelisPageLockTable, MelisPageVersioningTable, MelisUserRole, MelisWorkflowTable, MelisWorkflowEventsTable.

WARNING

By aliasing MelisEnginePage to its own class, this module replaces the core page service for the whole application while it is enabled. Keep that in mind when ordering modules.

Backoffice ​

Tools and interfaces are declared in config/app.tools.php and config/app.interface.php (controllers are plain invokables under MelisSmallBusiness\Controller\…).

Tool / tab (melisKey)Controller / actionRole
melissb_tool_userroleToolUserRole::render-tool-user-role (data: getRolesData)Custom user role tool under Admin in the tools tree; CRUD over roles, plus a MelisUserRoleSelect field injected into the core user form.
melissb_page_versioningPageVersioning::render-page-versioningVersioning tab on the page editor — list of archived versions with edit / save / view (preview) actions.
melissb_page_commentsPageComments::render-page-commentsComments tab on the page editor (add + timeline).
melissb_medialibMediaLibrary::renderPageMediaLibraryMedia library tool (TinyMCE MoxieManager) for browsing/uploading files.
melissb_workflow_modal_contentMelisWorkflow::render-workflow-modal-contentWorkflow modal: ask for validation, validate, refuse, and view the historic.

The module also adds a MelisMediaUpload (melis-media-upload) form element with its factory, view helper and MelisMediaUploadValidator.

Page locking has no dedicated tool: it is enforced by listeners (MelisSBPageLockListener, …TreeListener, …InfoListener, …PageActionButtonsAndTabsListener, …LogoutListener) that mark a page as locked in melis_sb_page_locked while a user edits it.

Front office ​

TypeNameRole
Dashboard pluginMelisSBWorkflowPluginBackoffice dashboard widget (workflow action) listing pending workflow demands / recent activity. Declared under meliscore_dashboard (melissb_dashboard_workflow); see Plugins.

There is also a small front-office asset (front.pagelock.js) registered under melisfront, but the module has no front-office templating plugin — its surface is the backoffice.

Database tables ​

Created by install/dbdeploy/126618_melis_sb_install.sql (mirrored in install/sql/setup_structure.sql).

TableRole
melis_sb_page_versioningArchived copies of published pages (page_v_version_number, page_v_version_name, page_content, page_edit_date, …).
melis_sb_workflowWorkflow records per page.
melis_sb_workflow_eventsWorkflow events (ask / validate / refuse).
melis_sb_page_commentComments attached to a page.
melis_sb_page_comment_typeComment types (PAGE, WORKFLOW).
melis_sb_page_lockedActive page locks (which user is editing which page).

Example ​

Read and add a page comment via the public service:

php
$commentService = $serviceManager->get('MelisSBPageCommentService');

// list comments on page 42
$comments = $commentService->getPageComments(42);

// add a PAGE-type comment (commentType 1 = PAGE, 2 = WORKFLOW)
$commentService->setPageComments(
    ['pcom_page_id' => 42, 'pcom_comment' => 'Looks good to publish.'],
    1
);

Key files ​

ConcernPath
Module bootstrap & listenersvendor/melisplatform/melis-small-business/src/Module.php
Routing, services, controllersvendor/melisplatform/melis-small-business/config/module.config.php
Tools (userrole, versioning)vendor/melisplatform/melis-small-business/config/app.tools.php
Backoffice interface treevendor/melisplatform/melis-small-business/config/app.interface.php
Page service (engine override)vendor/melisplatform/melis-small-business/src/Service/MelisSBPageService.php
Comment servicevendor/melisplatform/melis-small-business/src/Service/MelisSBPageCommentService.php
Workflow / versioning / lock controllersvendor/melisplatform/melis-small-business/src/Controller/
Dashboard pluginvendor/melisplatform/melis-small-business/src/Controller/DashboardPlugins/MelisSBWorkflowPlugin.php
CMS-editor listenersvendor/melisplatform/melis-small-business/src/Listener/
Install SQLvendor/melisplatform/melis-small-business/install/dbdeploy/126618_melis_sb_install.sql