* @copyright Copyright (C) 1999-2013 eZ Systems AS. All rights reserved. * @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2 * @version 2013.11 * @package kernel */ $Module = $Params['Module']; if (isset($Params["WorkflowGroupID"])) { $WorkflowGroupID = $Params["WorkflowGroupID"]; } else { $WorkflowGroupID = false; } // $execStack = eZExecutionStack::instance(); // $execStack->addEntry( $Module->functionURI( "groupedit" ) . "/" . $WorkflowGroupID, // $Module->attribute( "name" ), "groupedit" ); if (is_numeric($WorkflowGroupID)) { $workflowGroup = eZWorkflowGroup::fetch($WorkflowGroupID, true); } else { $user = eZUser::currentUser(); $user_id = $user->attribute("contentobject_id"); $workflowGroup = eZWorkflowGroup::create($user_id); $workflowGroup->setAttribute("name", ezpI18n::tr('kernel/workflow/groupedit', "New WorkflowGroup")); $WorkflowGroupID = $workflowGroup->attribute("id"); } //$assignedWorkflows = $workflowGroup->fetchWorkflowList(); //$isRemoveTried = false; $http = eZHTTPTool::instance(); if ($http->hasPostVariable("DiscardButton")) { $Module->redirectTo($Module->functionURI("grouplist")); return; } // Validate input
if ($workflow->attribute('id') === $inGroup->attribute('workflow_id')) { $list[] = $workflow; } } } $templist_in_group = eZWorkflowGroupLink::fetchWorkflowList(1, $WorkflowGroupID, $asObject = true); $tempworkflow_list = eZWorkflow::fetchList(1); $temp_list = array(); foreach ($tempworkflow_list as $tmpWorkflow) { foreach ($templist_in_group as $tmpInGroup) { if ($tmpWorkflow->attribute('id') === $tmpInGroup->attribute('workflow_id')) { $temp_list[] = $tmpWorkflow; } } } $Module->setTitle(ezpI18n::tr('kernel/workflow', 'Workflow list of group') . ' ' . $WorkflowGroupID); $WorkflowgroupInfo = eZWorkflowGroup::fetch($WorkflowGroupID); if (!$WorkflowgroupInfo) { return $Module->handleError(eZError::KERNEL_NOT_AVAILABLE, 'kernel'); } $tpl = eZTemplate::factory(); $tpl->setVariable("temp_workflow_list", $temp_list); $tpl->setVariable("group_id", $WorkflowGroupID); $WorkflowGroupName = $WorkflowgroupInfo->attribute("name"); $tpl->setVariable("group", $WorkflowgroupInfo); $tpl->setVariable("group_name", $WorkflowGroupName); $tpl->setVariable('workflow_list', $list); $tpl->setVariable('module', $Module); $Result = array(); $Result['content'] = $tpl->fetch('design:workflow/workflowlist.tpl'); $Result['path'] = array(array('text' => ezpI18n::tr('kernel/workflow', 'Workflow'), 'url' => false), array('text' => ezpI18n::tr('kernel/workflow', 'List'), 'url' => false));