Skip to content
This repository was archived by the owner on May 10, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
182d410
filter workflow associations
YatharthVyas Jul 22, 2021
07e5992
add module workflow menu tab
YatharthVyas Jul 22, 2021
c42485e
language constants
YatharthVyas Jul 22, 2021
964805b
modules access perms xml
YatharthVyas Jul 22, 2021
833b07f
show integrations tag in options
YatharthVyas Jul 22, 2021
a9b75c0
filter by stage
YatharthVyas Jul 22, 2021
e06a805
show workflows field in a new tab in com_modules
YatharthVyas Jul 22, 2021
07fcb40
functions used by workflow plugins
YatharthVyas Jul 22, 2021
688e0f3
workflows in modules helper
YatharthVyas Jul 22, 2021
c353e35
call workflow events on save and delete
YatharthVyas Jul 22, 2021
42c5a02
include workflows in modules query
YatharthVyas Jul 22, 2021
4743efb
call workflow plugin
YatharthVyas Jul 22, 2021
fe456fb
display workflow field in batch_body
YatharthVyas Jul 22, 2021
6ef70a3
fix the language constant for sidebar
YatharthVyas Jul 22, 2021
0f2f9c5
display workflow in all modules view
YatharthVyas Jul 23, 2021
3c642db
installation sql
YatharthVyas Jul 23, 2021
6a73cf9
Merge branch 'feature-module-workflow' of https://github.com/Yatharth…
YatharthVyas Jul 23, 2021
3e974bc
misc workflow bug fixes in modules view
YatharthVyas Jul 24, 2021
6561003
merge PR https://github.com/joomla/joomla-cms/pull/34882
YatharthVyas Jul 24, 2021
af79676
correct the to_stage_id in installation sql
YatharthVyas Jul 24, 2021
4bf5e7e
indent conditional statement
YatharthVyas Jul 24, 2021
bf8533a
add functionality conditions
YatharthVyas Jul 24, 2021
6942e71
make WorkflowBehaviourTrait lang const global
YatharthVyas Jul 26, 2021
170da42
display workflow transition field
YatharthVyas Jul 26, 2021
729d73a
fix bug in saving new modules
YatharthVyas Jul 27, 2021
6ea571a
rename default workflow for modules
YatharthVyas Jul 27, 2021
50c1d64
rephrase workflows to workflow
YatharthVyas Jul 27, 2021
ab406a3
filter extension in workflow field
YatharthVyas Jul 27, 2021
3f72de5
return inital stage depending on workflow_id param
YatharthVyas Jul 28, 2021
5d22125
display workflow field for new modules and transition for editing exi…
YatharthVyas Jul 28, 2021
51dda5c
Remove transition field for new modules
YatharthVyas Jul 28, 2021
923dc24
make transition_ids camelcase
YatharthVyas Jul 29, 2021
199a11b
camel casing
YatharthVyas Jul 29, 2021
f6ae871
revert changes to library function
YatharthVyas Jul 29, 2021
4158bf6
improve the logic for conditionally adding transition field
YatharthVyas Jul 29, 2021
3bb2d6e
phpcs
YatharthVyas Jul 29, 2021
324a71f
Load Language file for workflows
YatharthVyas Jul 29, 2021
1d1d3f3
correct the name of default module workflow
YatharthVyas Jul 30, 2021
ccbd30e
workflow update sql script
YatharthVyas Jul 30, 2021
fe17365
fix parent id for modules workflow asset
YatharthVyas Jul 30, 2021
c8987c6
remove backticks for postgresql
YatharthVyas Jul 30, 2021
a4c2b9c
replace backticks by quotes in postgresql update
YatharthVyas Jul 30, 2021
09ede64
remove extra space and format the query
YatharthVyas Jul 30, 2021
1b9acca
improve readability
YatharthVyas Jul 30, 2021
2d97d4e
fix lft and rgt values of the assets
YatharthVyas Aug 1, 2021
bbc741e
Update installation/sql/postgresql/base.sql
YatharthVyas Aug 1, 2021
055a0b3
Update installation/sql/mysql/base.sql
YatharthVyas Aug 1, 2021
6098e27
Update installation/sql/postgresql/base.sql
YatharthVyas Aug 1, 2021
c649585
Update installation/sql/postgresql/base.sql
YatharthVyas Aug 1, 2021
e6031bd
Update installation/sql/postgresql/base.sql
YatharthVyas Aug 1, 2021
044681d
place where clause after the end of all joins
YatharthVyas Aug 1, 2021
7c7e347
update the workflow stage name
YatharthVyas Aug 1, 2021
a376c38
remove duplicate query in updates
YatharthVyas Aug 1, 2021
a7e3e6c
show default option in workflow field
YatharthVyas Aug 2, 2021
581f3fa
remove unused function
YatharthVyas Aug 2, 2021
89418b1
add the use default option in workflow dropdown
YatharthVyas Aug 2, 2021
f31b70e
change workflow to workflows
YatharthVyas Aug 2, 2021
a186a36
phpcs
YatharthVyas Aug 3, 2021
6a3e71e
Update administrator/components/com_content/src/Model/ArticlesModel.php
YatharthVyas Aug 8, 2021
6dc35c6
Update administrator/components/com_modules/src/Model/ModuleModel.php
YatharthVyas Aug 8, 2021
14ed567
Escape string quotes in query
YatharthVyas Aug 8, 2021
2799599
Update administrator/components/com_modules/src/Model/ModulesModel.php
YatharthVyas Aug 8, 2021
b0431be
Update administrator/components/com_modules/src/Model/ModuleModel.php
YatharthVyas Aug 8, 2021
182410c
Update administrator/components/com_content/src/Model/ArticlesModel.php
YatharthVyas Aug 8, 2021
dde3803
use modules component helper for workflow field
YatharthVyas Aug 11, 2021
8dd00e7
create workflow association on duplicating modules
YatharthVyas Aug 11, 2021
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,37 @@
--
-- Insert a new workflow for com_modules
--
INSERT INTO `#__workflows` (`id`, `asset_id`, `published`, `title`, `description`, `extension`, `default`, `ordering`, `created`, `created_by`, `modified`, `modified_by`, `checked_out_time`, `checked_out`) VALUES
(NULL, 0, 1, 'COM_WORKFLOW_BASIC_WORKFLOW_MODULES', '', 'com_modules.module', 1, 1, CURRENT_TIMESTAMP(), 0, CURRENT_TIMESTAMP(), 0, NULL, 0);

--
-- Inserting the default stage for the new worklfow
--
INSERT INTO `#__workflow_stages` (`id`, `asset_id`, `ordering`, `workflow_id`, `published`, `title`, `description`, `default`, `checked_out_time`, `checked_out`)
SELECT NULL, 0, 1, `id`, 1, 'COM_WORKFLOW_BASIC_STAGE', '', 1, NULL, 0 FROM `#__workflows` WHERE `title` = 'COM_WORKFLOW_BASIC_WORKFLOW_MODULES';

--
-- Inserting the transitions for the new worklfow
--
INSERT INTO `#__workflow_transitions` (`id`, `asset_id`, `published`, `ordering`, `workflow_id`, `title`, `description`, `from_stage_id`, `to_stage_id`, `options`)
SELECT NULL, 0, 1, NULL, `w`.`id`, 'Unpublish', '', -1, `s`.`id`, '{"publishing":"0"}' FROM `#__workflows` as `w` INNER JOIN `#__workflow_stages` as `s` ON `w`.`title` = 'COM_WORKFLOW_BASIC_WORKFLOW_MODULES' AND `s`.`title` = 'COM_WORKFLOW_BASIC_STAGE' AND `s`.`extension` = 'com_modules.module';

INSERT INTO `#__workflow_transitions` (`id`, `asset_id`, `published`, `ordering`, `workflow_id`, `title`, `description`, `from_stage_id`, `to_stage_id`, `options`)
SELECT NULL, 0, 1, NULL, `w`.`id`, 'Publish', '', -1, `s`.`id`, '{"publishing":"1"}' FROM `#__workflows` as `w` INNER JOIN `#__workflow_stages` as `s` ON `w`.`title` = 'COM_WORKFLOW_BASIC_WORKFLOW_MODULES' AND `s`.`title` = 'COM_WORKFLOW_BASIC_STAGE' AND `s`.`extension` = 'com_modules.module';

INSERT INTO `#__workflow_transitions` (`id`, `asset_id`, `published`, `ordering`, `workflow_id`, `title`, `description`, `from_stage_id`, `to_stage_id`, `options`)
SELECT NULL, 0, 1, NULL, `w`.`id`, 'Trash', '', -1, `s`.`id`, '{"publishing":"-2"}' FROM `#__workflows` as `w` INNER JOIN `#__workflow_stages` as `s` ON `w`.`title` = 'COM_WORKFLOW_BASIC_WORKFLOW_MODULES' AND `s`.`title` = 'COM_WORKFLOW_BASIC_STAGE' AND `s`.`workflow_id` = `w`.`id`;

--
-- Creating Associations for existing modules
--
INSERT INTO `#__workflow_associations` (`item_id`, `stage_id`, `extension`)
SELECT `m`.`id`, `s`.`id`, 'com_modules.module'
FROM `#__modules` as `m` ,
(
`#__workflow_stages` as `s`
INNER JOIN `#__workflows` as `w`
ON `w`.`title` = 'COM_WORKFLOW_BASIC_WORKFLOW_MODULES'
AND `s`.`title` = 'COM_WORKFLOW_BASIC_STAGE'
AND `s`.`workflow_id` = `w`.`id`
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
--
-- Insert a new workflow for com_modules
--
INSERT INTO "#__workflows" ("id", "asset_id", "published", "title", "description", "extension", "default", "ordering", "created", "created_by", "modified", "modified_by", "checked_out_time", "checked_out") VALUES
(NULL, 0, 1, 'COM_WORKFLOW_BASIC_WORKFLOW_MODULES', '', 'com_modules.module', 1, 1, CURRENT_TIMESTAMP(), 0, CURRENT_TIMESTAMP(), 0, NULL, 0);

--
-- Inserting the default stage for the new worklfow
--
INSERT INTO "#__workflow_stages" ("id", "asset_id", "ordering", "workflow_id", "published", "title", "description", "default", "checked_out_time", "checked_out")
SELECT NULL, 0, 1, "id", 1, 'COM_WORKFLOW_BASIC_STAGE', '', 1, NULL, 0 FROM "#__workflows" WHERE "title" = 'COM_WORKFLOW_BASIC_WORKFLOW_MODULES';

--
-- Inserting the transitions for the new worklfow
--
INSERT INTO "#__workflow_transitions" ("id", "asset_id", "published", "ordering", "workflow_id", "title", "description", "from_stage_id", "to_stage_id", "options")
SELECT NULL, 0, 1, NULL, "w"."id", 'Unpublish', '', -1, "s"."id", '{"publishing":"0"}' FROM "#__workflows" as "w" INNER JOIN "#__workflow_stages" as "s" ON "w"."title" = 'COM_WORKFLOW_BASIC_WORKFLOW_MODULES' AND "s"."title" = 'COM_WORKFLOW_BASIC_STAGE' AND "s"."extension" = 'com_modules.module';

INSERT INTO "#__workflow_transitions" ("id", "asset_id", "published", "ordering", "workflow_id", "title", "description", "from_stage_id", "to_stage_id", "options")
SELECT NULL, 0, 1, NULL, "w"."id", 'Publish', '', -1, "s"."id", '{"publishing":"1"}' FROM "#__workflows" as "w" INNER JOIN "#__workflow_stages" as "s" ON "w"."title" = 'COM_WORKFLOW_BASIC_WORKFLOW_MODULES' AND "s"."title" = 'COM_WORKFLOW_BASIC_STAGE' AND "s"."extension" = 'com_modules.module';

INSERT INTO "#__workflow_transitions" ("id", "asset_id", "published", "ordering", "workflow_id", "title", "description", "from_stage_id", "to_stage_id", "options")
SELECT NULL, 0, 1, NULL, "w"."id", 'Trash', '', -1, "s"."id", '{"publishing":"-2"}' FROM "#__workflows" as "w" INNER JOIN "#__workflow_stages" as "s" ON "w"."title" = 'COM_WORKFLOW_BASIC_WORKFLOW_MODULES' AND "s"."title" = 'COM_WORKFLOW_BASIC_STAGE' AND "s"."workflow_id" = "w"."id";

--
-- Creating Associations for existing modules
--
INSERT INTO "#__workflow_associations" ("item_id", "stage_id", "extension")
SELECT "m"."id", "s"."id", 'com_modules.module'
FROM "#__modules" as "m",
(
"#__workflow_stages" as "s"
INNER JOIN "#__workflows" as "w"
ON "w"."title" = 'COM_WORKFLOW_BASIC_WORKFLOW_MODULES'
AND "s"."title" = 'COM_WORKFLOW_BASIC_STAGE'
AND "s"."workflow_id" = "w"."id"
);
2 changes: 1 addition & 1 deletion administrator/components/com_content/forms/category.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
size="1"
sql_select="id, title"
sql_from="#__workflows"
sql_where="published = 1"
sql_where="published = 1 AND extension = 'com_content.article'"
sql_order="ordering"
key_field="id"
value_field="title"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,8 @@ protected function getListQuery()
->join('LEFT', $db->quoteName('#__users', 'ua'), $db->quoteName('ua.id') . ' = ' . $db->quoteName('a.created_by'))
->join('INNER', $db->quoteName('#__workflow_associations', 'wa'), $db->quoteName('wa.item_id') . ' = ' . $db->quoteName('a.id'))
->join('INNER', $db->quoteName('#__workflow_stages', 'ws'), $db->quoteName('ws.id') . ' = ' . $db->quoteName('wa.stage_id'))
->join('INNER', $db->quoteName('#__workflows', 'w'), $db->quoteName('w.id') . ' = ' . $db->quoteName('ws.workflow_id'));
->join('INNER', $db->quoteName('#__workflows', 'w'), $db->quoteName('w.id') . ' = ' . $db->quoteName('ws.workflow_id'))
->where($db->quoteName('wa.extension') . ' = ' . $db->quote('com_content.article'));

if (PluginHelper::isEnabled('content', 'vote'))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@
'transitions' => $transitions,
'title' => Text::_($item->stage_title),
'tip_content' => Text::sprintf('JWORKFLOW', Text::_($item->workflow_title)),
'id' => 'workflow-' . $item->id
'id' => 'workflow-' . $item->id,
'task' => 'articles.runTransition'
];

echo (new TransitionButton($options))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@
'transitions' => $transitions,
'title' => Text::_($item->stage_title),
'tip_content' => Text::sprintf('JWORKFLOW', Text::_($item->workflow_title)),
'id' => 'workflow-' . $item->id
'id' => 'workflow-' . $item->id,
'task' => 'articles.runTransition'
];

echo (new TransitionButton($options))
Expand Down
8 changes: 8 additions & 0 deletions administrator/components/com_menus/presets/default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@
link="index.php?option=com_modules&view=modules&client_id=1"
quicktask="index.php?option=com_modules&view=select&client_id=1"
/>

<menuitem
title="MOD_MENU_EXTENSIONS_MODULE_WORKFLOWS"
type="component"
element="com_workflow"
link="index.php?option=com_workflow&amp;view=workflows&amp;extension=com_modules.module"
permission="core.manage.workflow;com_modules"
/>
</menuitem>

<menuitem
Expand Down
8 changes: 8 additions & 0 deletions administrator/components/com_menus/presets/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,14 @@
link="index.php?option=com_modules&amp;view=modules&amp;client_id=1"
permission="core.manage;com_modules"
/>

<menuitem
title="MOD_MENU_EXTENSIONS_MODULE_WORKFLOWS"
type="component"
element="com_workflow"
link="index.php?option=com_workflow&amp;view=workflows&amp;extension=com_modules.module"
permission="core.manage.workflow;com_modules"
/>
</menuitem>

<menuitem
Expand Down
21 changes: 21 additions & 0 deletions administrator/components/com_modules/access.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<action name="core.delete" title="JACTION_DELETE" />
<action name="core.edit" title="JACTION_EDIT" />
<action name="core.edit.state" title="JACTION_EDITSTATE" />
<action name="core.manage.workflow" title="JACTION_MANAGEWORKFLOW" />
<action name="core.execute.transition" title="JACTION_EXECUTETRANSITION" />
<action name="module.edit.frontend" title="COM_MODULES_ACTION_EDITFRONTEND" />
</section>
<section name="module">
Expand All @@ -15,4 +17,23 @@
<action name="core.edit.state" title="JACTION_EDITSTATE" />
<action name="module.edit.frontend" title="COM_MODULES_ACTION_EDITFRONTEND" />
</section>
<section name="workflow">
<action name="core.create" title="JACTION_CREATE" />
<action name="core.delete" title="JACTION_DELETE" />
<action name="core.edit" title="JACTION_EDIT" />
<action name="core.edit.state" title="JACTION_EDITSTATE" />
<action name="core.edit.own" title="JACTION_EDITOWN" />
<action name="core.execute.transition" title="JACTION_EXECUTETRANSITION" />
</section>
<section name="transition">
<action name="core.delete" title="JACTION_DELETE" />
<action name="core.edit" title="JACTION_EDIT" />
<action name="core.edit.state" title="JACTION_EDITSTATE" />
<action name="core.execute.transition" title="JACTION_EXECUTETRANSITION" />
</section>
<section name="stage">
<action name="core.delete" title="JACTION_DELETE" />
<action name="core.edit" title="JACTION_EDIT" />
<action name="core.edit.state" title="JACTION_EDITSTATE" />
</section>
</access>
22 changes: 22 additions & 0 deletions administrator/components/com_modules/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,26 @@
section="component"
/>
</fieldset>

<fieldset
name="integration"
label="JGLOBAL_INTEGRATION_LABEL"
description="COM_MODULES_CONFIG_INTEGRATION_SETTINGS_DESC"
>
<fieldset
name="integration_workflows"
label="JWORKFLOW_TITLE"
>
<field
name="workflow_enabled"
type="radio"
label="JWORKFLOW_ENABLED_LABEL"
layout="joomla.form.field.radio.switcher"
default="0"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
</fieldset>
</fieldset>
</config>
10 changes: 10 additions & 0 deletions administrator/components/com_modules/forms/filter_modules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@
<option value="">COM_MODULES_OPTION_SELECT_MENU_ITEM</option>
<option value="-1">COM_MODULES_NONE</option>
</field>
<field
name="stage"
type="workflowstage"
label="JOPTION_SELECT_STAGE"
onchange="this.form.submit();"
activeonly="true"
extension="com_modules.module"
>
<option value="">JOPTION_SELECT_STAGE</option>
</field>
<field
name="access"
type="accesslevel"
Expand Down
10 changes: 10 additions & 0 deletions administrator/components/com_modules/forms/filter_modulesadmin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@
>
<option value="">COM_MODULES_OPTION_SELECT_MODULE</option>
</field>
<field
name="stage"
type="workflowstage"
label="JOPTION_SELECT_STAGE"
onchange="this.form.submit();"
activeonly="true"
extension="com_modules.module"
>
<option value="">JOPTION_SELECT_STAGE</option>
</field>
<field
name="access"
type="accesslevel"
Expand Down
19 changes: 19 additions & 0 deletions administrator/components/com_modules/forms/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,23 @@
validate="rules"
/>
</fieldset>

<fieldset name="workflow" label="COM_MODULES_WORKFLOW">
<field
name="workflow_id"
type="sql"
label="COM_MODULES_WORKFLOW"
class="form-select"
size="1"
sql_select="id, title"
sql_from="#__workflows"
sql_where="published = 1 AND extension = 'com_modules.module'"
sql_order="ordering"
key_field="id"
value_field="title"
required="true"
default="use_default"
translate="true"
/>
</fieldset>
</form>
19 changes: 19 additions & 0 deletions administrator/components/com_modules/forms/moduleadmin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,23 @@
validate="rules"
/>
</fieldset>

<fieldset name="workflow" label="COM_MODULES_WORKFLOW">
<field
name="workflow_id"
type="sql"
label="COM_MODULES_WORKFLOW"
class="form-select"
size="1"
sql_select="id, title"
sql_from="#__workflows"
sql_where="published = 1 AND extension = 'com_modules.module'"
sql_order="ordering"
key_field="id"
value_field="title"
required="true"
default="use_default"
translate="true"
/>
</fieldset>
</form>
Loading