From 51913f1ae8f0ec636cb19d8df4dcf4f326abdbcc Mon Sep 17 00:00:00 2001 From: Benjamin Trenkle Date: Fri, 11 Aug 2017 15:34:27 +0200 Subject: [PATCH 1/7] Show workflow menu only if the parameter is activated --- .../com_content/Helper/ContentHelper.php | 38 +++--- .../components/com_content/config.xml | 109 ++++++++++-------- administrator/language/en-GB/en-GB.ini | 1 + .../modules/mod_menu/preset/enabled.php | 19 +-- 4 files changed, 93 insertions(+), 74 deletions(-) diff --git a/administrator/components/com_content/Helper/ContentHelper.php b/administrator/components/com_content/Helper/ContentHelper.php index 3ddd68c685..6fa5cfb661 100644 --- a/administrator/components/com_content/Helper/ContentHelper.php +++ b/administrator/components/com_content/Helper/ContentHelper.php @@ -43,28 +43,32 @@ public static function addSubmenu($vName) 'index.php?option=com_categories&extension=com_content', $vName == 'categories' ); - \JHtmlSidebar::addEntry( - \JText::_('COM_CONTENT_SUBMENU_WORKFLOW'), - 'index.php?option=com_workflow&extension=com_content', - $vName == 'workflows' - ); - if ($vName == 'states' || $vName == 'transitions') + if (\JComponentHelper::isEnabled('com_fields') && \JComponentHelper::getParams('com_content')->get('workflows_enable')) { - $app = Factory::getApplication(); - $workflowID = $app->getUserStateFromRequest('filter.workflow_id', 'workflow_id', 1, 'int'); - \JHtmlSidebar::addEntry( - \JText::_('COM_WORKFLOW_STATE'), - 'index.php?option=com_workflow&view=states&workflow_id=' . $workflowID . "&extension=com_content", - $vName == 'states`' + \JText::_('COM_CONTENT_SUBMENU_WORKFLOW'), + 'index.php?option=com_workflow&extension=com_content', + $vName == 'workflows' ); - \JHtmlSidebar::addEntry( - \JText::_('COM_WORKFLOW_TRANSITION'), - 'index.php?option=com_workflow&view=transitions&workflow_id=' . $workflowID . "&extension=com_content", - $vName == 'transitions' - ); + if ($vName == 'states' || $vName == 'transitions') + { + $app = Factory::getApplication(); + $workflowID = $app->getUserStateFromRequest('filter.workflow_id', 'workflow_id', 1, 'int'); + + \JHtmlSidebar::addEntry( + \JText::_('COM_WORKFLOW_STATE'), + 'index.php?option=com_workflow&view=states&workflow_id=' . $workflowID . "&extension=com_content", + $vName == 'states`' + ); + + \JHtmlSidebar::addEntry( + \JText::_('COM_WORKFLOW_TRANSITION'), + 'index.php?option=com_workflow&view=transitions&workflow_id=' . $workflowID . "&extension=com_content", + $vName == 'transitions' + ); + } } \JHtmlSidebar::addEntry( diff --git a/administrator/components/com_content/config.xml b/administrator/components/com_content/config.xml index ca05982a2a..3ab65e362f 100644 --- a/administrator/components/com_content/config.xml +++ b/administrator/components/com_content/config.xml @@ -349,8 +349,8 @@ -
@@ -518,7 +518,7 @@ > JSHOW - JSHOW - JSHOW - JSHOW - J5 - JSHOW - JSHOW - JSHOW - -
- JSHOW - J5 - JSHOW - JSHOW - -
- - - - - JGLOBAL_ACROSS - -
-
- JSHOW - JTAG - JSHOW - JPUBLISHED - - JSHOW - JSHOW - JSHOW - - - JPUBLISHED - JGLOBAL_AUTO - JSHOW - @@ -972,7 +972,7 @@
-
JYES + + + + +
getParent(); } - $this->addChild( - new MenuNode( - JText::_('MOD_MENU_COM_CONTENT_WORKFLOW_MANAGER'), 'index.php?option=com_workflow&extension=com_content' - ), - $createContent - ); - - if ($createContent) + if ($comWorkflowEnabled && ComponentHelper::getParams('com_content')->get('workflows_enable')) { + $this->addChild( + new MenuNode( + JText::_('MOD_MENU_COM_CONTENT_WORKFLOW_MANAGER'), 'index.php?option=com_workflow&extension=com_content' + ), + $createContent + ); + $this->getParent(); } From 48c41a30ac1300b7c7e33f9bbefe9fc5e30c4e72 Mon Sep 17 00:00:00 2001 From: Jan Jaracz Date: Tue, 5 Sep 2017 23:16:53 +0200 Subject: [PATCH 2/7] Changes default view of com_workflow to visible --- administrator/components/com_content/config.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/components/com_content/config.xml b/administrator/components/com_content/config.xml index 3ab65e362f..3ea10c1706 100644 --- a/administrator/components/com_content/config.xml +++ b/administrator/components/com_content/config.xml @@ -1065,7 +1065,7 @@ type="radio" label="JGLOBAL_WORKFLOWS_ENABLE_LABEL" class="switcher" - default="0" + default="1" > From ef108d2e10533394d3957dad47878ea63264d104 Mon Sep 17 00:00:00 2001 From: Benjamin Trenkle Date: Fri, 8 Sep 2017 14:20:33 +0200 Subject: [PATCH 3/7] enable the workflow by default --- administrator/components/com_content/config.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/components/com_content/config.xml b/administrator/components/com_content/config.xml index 3ea10c1706..3ab65e362f 100644 --- a/administrator/components/com_content/config.xml +++ b/administrator/components/com_content/config.xml @@ -1065,7 +1065,7 @@ type="radio" label="JGLOBAL_WORKFLOWS_ENABLE_LABEL" class="switcher" - default="1" + default="0" > From e13f314bc09404e6676c46839dddb22716518a10 Mon Sep 17 00:00:00 2001 From: Benjamin Trenkle Date: Fri, 8 Sep 2017 14:22:11 +0200 Subject: [PATCH 4/7] Fix wrong enable default value --- administrator/components/com_content/config.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/components/com_content/config.xml b/administrator/components/com_content/config.xml index 3ab65e362f..3ea10c1706 100644 --- a/administrator/components/com_content/config.xml +++ b/administrator/components/com_content/config.xml @@ -1065,7 +1065,7 @@ type="radio" label="JGLOBAL_WORKFLOWS_ENABLE_LABEL" class="switcher" - default="0" + default="1" > From 5cb54a93e5bbde870ab862692c33156edec4ff56 Mon Sep 17 00:00:00 2001 From: Benjamin Trenkle Date: Fri, 8 Sep 2017 14:22:33 +0200 Subject: [PATCH 5/7] Fix enable check --- administrator/components/com_content/Helper/ContentHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/components/com_content/Helper/ContentHelper.php b/administrator/components/com_content/Helper/ContentHelper.php index 6fa5cfb661..ebea654834 100644 --- a/administrator/components/com_content/Helper/ContentHelper.php +++ b/administrator/components/com_content/Helper/ContentHelper.php @@ -44,7 +44,7 @@ public static function addSubmenu($vName) $vName == 'categories' ); - if (\JComponentHelper::isEnabled('com_fields') && \JComponentHelper::getParams('com_content')->get('workflows_enable')) + if (\JComponentHelper::isEnabled('com_workflows') && \JComponentHelper::getParams('com_content')->get('workflows_enable', 1)) { \JHtmlSidebar::addEntry( \JText::_('COM_CONTENT_SUBMENU_WORKFLOW'), From 839c1292571e8140b0ba6b5709d88f36648d93a9 Mon Sep 17 00:00:00 2001 From: Benjamin Trenkle Date: Fri, 8 Sep 2017 14:24:00 +0200 Subject: [PATCH 6/7] Set workflow visibility to 1 as default --- administrator/modules/mod_menu/preset/enabled.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/modules/mod_menu/preset/enabled.php b/administrator/modules/mod_menu/preset/enabled.php index a0fe2b5af0..1b86d3e6cf 100644 --- a/administrator/modules/mod_menu/preset/enabled.php +++ b/administrator/modules/mod_menu/preset/enabled.php @@ -254,7 +254,7 @@ $this->getParent(); } - if ($comWorkflowEnabled && ComponentHelper::getParams('com_content')->get('workflows_enable')) + if ($comWorkflowEnabled && ComponentHelper::getParams('com_content')->get('workflows_enable', 1)) { $this->addChild( new MenuNode( From 30c0353bd2f05c2a32bd6d5c0aee0f73a22b4b19 Mon Sep 17 00:00:00 2001 From: Benjamin Trenkle Date: Fri, 8 Sep 2017 14:32:14 +0200 Subject: [PATCH 7/7] Fix wrong component name com_workflows --- administrator/components/com_content/Helper/ContentHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/components/com_content/Helper/ContentHelper.php b/administrator/components/com_content/Helper/ContentHelper.php index 6d92deef52..e2f4cd6c12 100644 --- a/administrator/components/com_content/Helper/ContentHelper.php +++ b/administrator/components/com_content/Helper/ContentHelper.php @@ -44,7 +44,7 @@ public static function addSubmenu($vName) $vName == 'categories' ); - if (\JComponentHelper::isEnabled('com_workflows') && \JComponentHelper::getParams('com_content')->get('workflows_enable', 1)) + if (\JComponentHelper::isEnabled('com_workflow') && \JComponentHelper::getParams('com_content')->get('workflows_enable', 1)) { \JHtmlSidebar::addEntry( \JText::_('COM_CONTENT_SUBMENU_WORKFLOW'),