Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
62e1c94
filter workflow associations
YatharthVyas Jul 22, 2021
95de9b4
add module workflow menu tab
YatharthVyas Jul 22, 2021
f35b594
language constants
YatharthVyas Jul 22, 2021
d1a77f7
modules access perms xml
YatharthVyas Jul 22, 2021
8f63595
show integrations tag in options
YatharthVyas Jul 22, 2021
f5eeb55
filter by stage
YatharthVyas Jul 22, 2021
e0fc65a
show workflows field in a new tab in com_modules
YatharthVyas Jul 22, 2021
11fa022
functions used by workflow plugins
YatharthVyas Jul 22, 2021
b96214f
workflows in modules helper
YatharthVyas Jul 22, 2021
84fb8a1
call workflow events on save and delete
YatharthVyas Jul 22, 2021
ee651ea
include workflows in modules query
YatharthVyas Jul 22, 2021
2796744
call workflow plugin
YatharthVyas Jul 22, 2021
821bdb2
display workflow field in batch_body
YatharthVyas Jul 22, 2021
925cece
fix the language constant for sidebar
YatharthVyas Jul 22, 2021
4df016f
display workflow in all modules view
YatharthVyas Jul 23, 2021
d783a50
installation sql
YatharthVyas Jul 23, 2021
8280296
Update signature
bembelimen Jun 23, 2021
c374921
misc workflow bug fixes in modules view
YatharthVyas Jul 24, 2021
61b11f6
merge PR https://github.com/joomla/joomla-cms/pull/34882
YatharthVyas Jul 24, 2021
a99f5cc
correct the to_stage_id in installation sql
YatharthVyas Jul 24, 2021
9d40944
indent conditional statement
YatharthVyas Jul 24, 2021
669b71a
add functionality conditions
YatharthVyas Jul 24, 2021
3b1e167
make WorkflowBehaviourTrait lang const global
YatharthVyas Jul 26, 2021
7261bba
display workflow transition field
YatharthVyas Jul 26, 2021
1fc34fb
fix bug in saving new modules
YatharthVyas Jul 27, 2021
00bb45e
rename default workflow for modules
YatharthVyas Jul 27, 2021
61578c9
rephrase workflows to workflow
YatharthVyas Jul 27, 2021
b3d7bf1
filter extension in workflow field
YatharthVyas Jul 27, 2021
2ad7590
return inital stage depending on workflow_id param
YatharthVyas Jul 28, 2021
1c3ad76
display workflow field for new modules and transition for editing exi…
YatharthVyas Jul 28, 2021
cf23886
Remove transition field for new modules
YatharthVyas Jul 28, 2021
82135ca
make transition_ids camelcase
YatharthVyas Jul 29, 2021
8465dd3
camel casing
YatharthVyas Jul 29, 2021
f4be178
revert changes to library function
YatharthVyas Jul 29, 2021
eff4c8f
improve the logic for conditionally adding transition field
YatharthVyas Jul 29, 2021
4cecc7b
phpcs
YatharthVyas Jul 29, 2021
00a6708
Load Language file for workflows
YatharthVyas Jul 29, 2021
3d7c0a3
correct the name of default module workflow
YatharthVyas Jul 30, 2021
4a69c3c
workflow update sql script
YatharthVyas Jul 30, 2021
d47849a
fix parent id for modules workflow asset
YatharthVyas Jul 30, 2021
b9f1350
remove backticks for postgresql
YatharthVyas Jul 30, 2021
9f8b6d7
replace backticks by quotes in postgresql update
YatharthVyas Jul 30, 2021
87e5b26
remove extra space and format the query
YatharthVyas Jul 30, 2021
65b86de
improve readability
YatharthVyas Jul 30, 2021
682448a
fix lft and rgt values of the assets
YatharthVyas Aug 1, 2021
f9cd0cb
Update installation/sql/postgresql/base.sql
YatharthVyas Aug 1, 2021
0a10868
Update installation/sql/mysql/base.sql
YatharthVyas Aug 1, 2021
3368025
Update installation/sql/postgresql/base.sql
YatharthVyas Aug 1, 2021
786ec92
Update installation/sql/postgresql/base.sql
YatharthVyas Aug 1, 2021
fd143ad
Update installation/sql/postgresql/base.sql
YatharthVyas Aug 1, 2021
28d888a
place where clause after the end of all joins
YatharthVyas Aug 1, 2021
82d8f31
update the workflow stage name
YatharthVyas Aug 1, 2021
c57d348
remove duplicate query in updates
YatharthVyas Aug 1, 2021
01630fe
show default option in workflow field
YatharthVyas Aug 2, 2021
eac7462
remove unused function
YatharthVyas Aug 2, 2021
674cd33
add the use default option in workflow dropdown
YatharthVyas Aug 2, 2021
0c561cf
change workflow to workflows
YatharthVyas Aug 2, 2021
00bebf5
phpcs
YatharthVyas Aug 3, 2021
cccb214
Update administrator/components/com_content/src/Model/ArticlesModel.php
YatharthVyas Aug 8, 2021
5d24546
Update administrator/components/com_modules/src/Model/ModuleModel.php
YatharthVyas Aug 8, 2021
0a3f1c8
Escape string quotes in query
YatharthVyas Aug 8, 2021
e4c3523
Update administrator/components/com_modules/src/Model/ModulesModel.php
YatharthVyas Aug 8, 2021
22583e8
Update administrator/components/com_modules/src/Model/ModuleModel.php
YatharthVyas Aug 8, 2021
d31d625
Update administrator/components/com_content/src/Model/ArticlesModel.php
YatharthVyas Aug 8, 2021
5d07965
use modules component helper for workflow field
YatharthVyas Aug 11, 2021
8a4a83c
create workflow association on duplicating modules
YatharthVyas Aug 11, 2021
9ecd0f0
declare the new abstract method
YatharthVyas Aug 12, 2021
4310cde
remove required as we have a default
YatharthVyas Aug 12, 2021
a2779e1
Update administrator/components/com_modules/src/Model/ModuleModel.php
YatharthVyas Aug 12, 2021
d552411
Update administrator/components/com_modules/src/Model/ModulesModel.php
YatharthVyas Aug 12, 2021
0c45a0b
Update administrator/language/en-GB/com_modules.ini
YatharthVyas Aug 12, 2021
1287c8f
Correct typo in workflow
YatharthVyas Aug 20, 2021
d80da65
Apply suggestions from code review
YatharthVyas Aug 20, 2021
8d07459
comment formatting
YatharthVyas Aug 20, 2021
86c04ff
phpcs
YatharthVyas Sep 23, 2021
af6dc87
revert drone signature change
YatharthVyas Apr 2, 2022
7c2f68e
fix asset ids
YatharthVyas Apr 2, 2022
762ad21
fix asset id foreign keys
YatharthVyas Apr 2, 2022
3777ecd
correct the assets_id_seq value
YatharthVyas Apr 2, 2022
5d09d6a
s/ModuleHelper/ModulesHelper
YatharthVyas Apr 2, 2022
8cad5b3
s/seperately/separately
YatharthVyas Apr 2, 2022
8cd0c7d
remove indentation before delimiter
YatharthVyas Apr 2, 2022
f0408fb
add missing import for ModulesHelper
YatharthVyas Apr 2, 2022
c39765e
Merge branch '4.2-dev' into feature-module-workflow
roland-d Apr 19, 2022
1f5ef45
Merge tag 'psr12anchor' into psr12/merge/35101
joomla-bot Jun 27, 2022
41d4252
Phase 1 convert BRANCH to PSR-12
joomla-bot Jun 27, 2022
ab22bb7
Phase 2 convert BRANCH to PSR-12
joomla-bot Jun 27, 2022
2ca5536
Merge tag 'psr12final' into psr12/merge/35101
joomla-bot Jun 27, 2022
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 workflow
--
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 workflow
--
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 workflow
--
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 workflow
--
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
Expand Up @@ -294,7 +294,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')) {
$query->select(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
'title' => Text::_($item->stage_title),
'tip_content' => Text::sprintf('JWORKFLOW', Text::_($item->workflow_title)),
'id' => 'workflow-' . $item->id,
'task' => 'articles.runTransitions'
'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 @@ -187,6 +187,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 @@ -54,4 +54,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
18 changes: 18 additions & 0 deletions administrator/components/com_modules/forms/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,22 @@
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"
default="use_default"
translate="true"
/>
</fieldset>
</form>
18 changes: 18 additions & 0 deletions administrator/components/com_modules/forms/moduleadmin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,22 @@
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"
default="use_default"
translate="true"
/>
</fieldset>
</form>
Loading