Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
--
-- Insert the entry of workflow_category plugin to extensions
--

INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `locked`, `manifest_cache`, `params`, `custom_data`, `ordering`, `state`)
SELECT 0, 'plg_workflow_category', 'plugin', 'category', 'workflow', 0, 1, 1, 0, 1, '', '{}', '', -1, 0
WHERE NOT EXISTS (SELECT * FROM `#__extensions` e WHERE e.`type` = 'plugin' AND e.`element` = 'category' AND e.`folder` = 'workflow' AND e.`client_id` = 0);
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
--
-- Insert the entry of workflow_category plugin to extensions
--

INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "locked", "manifest_cache", "params", "custom_data", "ordering", "state")
SELECT 0, 'plg_workflow_category', 'plugin', 'category', 'workflow', 0, 1, 1, 0, 1, '', '{}', '', -1, 0
WHERE NOT EXISTS (SELECT * FROM "#__extensions" e WHERE e."type" = 'plugin' AND e."element" = 'category' AND e."folder" = 'workflow' AND e."client_id" = 0);
15 changes: 15 additions & 0 deletions administrator/language/en-GB/plg_workflow_category.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
; Joomla! Project
; (C) 2025 Open Source Matters, Inc. <https://www.joomla.org>
; License GNU General Public License version 2 or later; see LICENSE.txt
; Note : All ini files need to be saved as UTF-8

PLG_WORKFLOW_CATEGORY_DESC="A plugin to assign categories during workflow transitions."
PLG_WORKFLOW_CATEGORY_FIELD_CATEGORY_LABEL="Category"
PLG_WORKFLOW_CATEGORY_FIELD_CATEGORY_DESC="Select the category to assign during this transition."
PLG_WORKFLOW_CATEGORY_LABEL="Select Category"
PLG_WORKFLOW_CATEGORY_NO_PRIMARY_KEY="No primary key found for the selected category."
PLG_WORKFLOW_CATEGORY_ERRORS="Encountered errors with %d articles."
PLG_WORKFLOW_CATEGORY_INVALID_TRANSITION="This transition does not contain a valid category setting."
PLG_WORKFLOW_CATEGORY_ARTICLE_NOT_FOUND="Article %d not found for the selected transition."
PLG_WORKFLOW_CATEGORY_ARTICLE_UPDATE_FAILED="Failed to update article ID %d with category ID %d."
PLG_WORKFLOW_CATEGORY_ARTICLE_UPDATE_ERROR="Error updating article ID %d with category."
7 changes: 7 additions & 0 deletions administrator/language/en-GB/plg_workflow_category.sys.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
; Joomla! Project
; (C) 2025 Open Source Matters, Inc. <https://www.joomla.org>
; License GNU General Public License version 2 or later; see LICENSE.txt
; Note : All ini files need to be saved as UTF-8

PLG_WORKFLOW_CATEGORY="Workflow - Category"
PLG_WORKFLOW_CATEGORY_DESC="A plugin to assign categories during workflow transitions."
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* @copyright (C) 2025 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

((document, Joomla) => {
'use strict';

const disableCategory = () => {
var dropdown = document.getElementById('toolbar-status-group');
if (!dropdown) {
return;
}
var batchButton = document.getElementById('status-group-children-batch');
if (batchButton) {
batchButton.addEventListener('click', function () {
var observer = new MutationObserver(function (mutations, observer) {
var categorySelector = document.getElementById('batch-category-id');
if (categorySelector) {
categorySelector.disabled = true;
observer.disconnect();
}
});

observer.observe(document.body, {childList: true, subtree: true});
});
}
}

document.addEventListener('DOMContentLoaded', () => {
disableCategory();
});
})(document, Joomla);
7 changes: 4 additions & 3 deletions installation/sql/mysql/base.sql
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,10 @@ INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`,
(0, 'plg_webservices_tags', 'plugin', 'tags', 'webservices', 0, 1, 1, 0, 1, '', '{}', '', 16, 0),
(0, 'plg_webservices_templates', 'plugin', 'templates', 'webservices', 0, 1, 1, 0, 1, '', '{}', '', 17, 0),
(0, 'plg_webservices_users', 'plugin', 'users', 'webservices', 0, 1, 1, 0, 1, '', '{}', '', 18, 0),
(0, 'plg_workflow_featuring', 'plugin', 'featuring', 'workflow', 0, 1, 1, 0, 1, '', '{}', '', 1, 0),
(0, 'plg_workflow_notification', 'plugin', 'notification', 'workflow', 0, 1, 1, 0, 1, '', '{}', '', 2, 0),
(0, 'plg_workflow_publishing', 'plugin', 'publishing', 'workflow', 0, 1, 1, 0, 1, '', '{}', '', 3, 0),
(0, 'plg_workflow_category', 'plugin', 'category', 'workflow', 0, 1, 1, 0, 1, '', '{}', '', 1, 0),
(0, 'plg_workflow_featuring', 'plugin', 'featuring', 'workflow', 0, 1, 1, 0, 1, '', '{}', '', 2, 0),
(0, 'plg_workflow_notification', 'plugin', 'notification', 'workflow', 0, 1, 1, 0, 1, '', '{}', '', 3, 0),
(0, 'plg_workflow_publishing', 'plugin', 'publishing', 'workflow', 0, 1, 1, 0, 1, '', '{}', '', 4, 0),
(0, 'plg_system_guidedtours', 'plugin', 'guidedtours', 'system', 0, 1, 1, 0, 1, '', '{}', '', 15, 0);

-- Templates
Expand Down
7 changes: 4 additions & 3 deletions installation/sql/postgresql/base.sql
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,10 @@ INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder",
(0, 'plg_webservices_tags', 'plugin', 'tags', 'webservices', 0, 1, 1, 0, 1, '', '{}', '', 16, 0),
(0, 'plg_webservices_templates', 'plugin', 'templates', 'webservices', 0, 1, 1, 0, 1, '', '{}', '', 17, 0),
(0, 'plg_webservices_users', 'plugin', 'users', 'webservices', 0, 1, 1, 0, 1, '', '{}', '', 18, 0),
(0, 'plg_workflow_featuring', 'plugin', 'featuring', 'workflow', 0, 1, 1, 0, 1, '', '{}', '', 1, 0),
(0, 'plg_workflow_notification', 'plugin', 'notification', 'workflow', 0, 1, 1, 0, 1, '', '{}', '', 2, 0),
(0, 'plg_workflow_publishing', 'plugin', 'publishing', 'workflow', 0, 1, 1, 0, 1, '', '{}', '', 3, 0),
(0, 'plg_workflow_category', 'plugin', 'category', 'workflow', 0, 1, 1, 0, 1, '', '{}', '', 1, 0),
(0, 'plg_workflow_featuring', 'plugin', 'featuring', 'workflow', 0, 1, 1, 0, 1, '', '{}', '', 2, 0),
(0, 'plg_workflow_notification', 'plugin', 'notification', 'workflow', 0, 1, 1, 0, 1, '', '{}', '', 3, 0),
(0, 'plg_workflow_publishing', 'plugin', 'publishing', 'workflow', 0, 1, 1, 0, 1, '', '{}', '', 4, 0),
(0, 'plg_system_guidedtours', 'plugin', 'guidedtours', 'system', 0, 1, 1, 0, 1, '', '{}', '', 15, 0);

-- Templates
Expand Down
1 change: 1 addition & 0 deletions libraries/src/Extension/ExtensionHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ class ExtensionHelper
['plugin', 'users', 'webservices', 0],

// Core plugin extensions - workflow
['plugin', 'category', 'workflow', 0],
['plugin', 'featuring', 'workflow', 0],
['plugin', 'notification', 'workflow', 0],
['plugin', 'publishing', 'workflow', 0],
Expand Down
46 changes: 46 additions & 0 deletions plugins/workflow/category/category.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<extension type="plugin" group="workflow" method="upgrade">
<name>plg_workflow_category</name>
<author>Joomla! Project</author>
<creationDate>2025-08</creationDate>
<copyright>(C) 2025 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>[email protected]</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
<version>6.0.0</version>
<description>PLG_WORKFLOW_CATEGORY_DESC</description>
<namespace path="src">Joomla\Plugin\Workflow\Category</namespace>
<files>
<folder>forms</folder>
<folder>language</folder>
<folder>layouts</folder>
<folder>src</folder>
<folder plugin="category">services</folder>
</files>
<languages>
<language tag="en-GB">language/en-GB/plg_workflow_category.ini</language>
<language tag="en-GB">language/en-GB/plg_workflow_category.sys.ini</language>
</languages>
<config>
<fields name="params">
<fieldset name="basic">
<field
name="allowedlist"
type="WorkflowComponentSections"
label="JWORKFLOW_EXTENSION_ALLOWED_LABEL"
description="JWORKFLOW_EXTENSION_ALLOWED_DESCRIPTION"
multiple="multiple"
layout="joomla.form.field.list-fancy-select"
/>
<field
name="forbiddenlist"
type="WorkflowComponentSections"
label="JWORKFLOW_EXTENSION_FORBIDDEN_LABEL"
description="JWORKFLOW_EXTENSION_FORBIDDEN_DESCRIPTION"
multiple="multiple"
layout="joomla.form.field.list-fancy-select"
/>
</fieldset>
</fields>
</config>
</extension>
22 changes: 22 additions & 0 deletions plugins/workflow/category/forms/action.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<form>
<fields name="options">
<fieldset
name="actions"
label="COM_WORKFLOW_TRANSITION_ACTIONS_LABEL"
>
<field
name="category_id"
type="category"
label="PLG_WORKFLOW_CATEGORY_FIELD_CATEGORY_LABEL"
description="PLG_WORKFLOW_CATEGORY_FIELD_CATEGORY_DESC"
extension="com_content"
filter="integer"
default=""
hide_all="true"
>
<option value="">JOPTION_DO_NOT_USE</option>
</field>
</fieldset>
</fields>
</form>
45 changes: 45 additions & 0 deletions plugins/workflow/category/services/provider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

/**
* @package Joomla.Plugin
* @subpackage Workflow.category
*
* @copyright (C) 2025 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

\defined('_JEXEC') or die;

use Joomla\CMS\Extension\PluginInterface;
use Joomla\CMS\Factory;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Plugin\Workflow\Category\Extension\Category;

return new class () implements ServiceProviderInterface {
/**
* Registers the service provider with a DI container.
*
* @param Container $container The DI container.
*
* @return void
*
* @since __DEPLOY_VERSION__
*/
public function register(Container $container): void
{
$container->set(
PluginInterface::class,
function () {
$plugin = new Category(
(array) PluginHelper::getPlugin('workflow', 'category')
);

$plugin->setApplication(Factory::getApplication());

return $plugin;
}
);
}
};
Loading
Loading