public function runConfigureWorkflowStep(framework\Request $request) { $this->workflow = null; $this->step = null; try { $this->workflow = entities\Workflow::getB2DBTable()->selectById($request['workflow_id']); if ($request['mode'] == 'edit' && !$request->hasParameter('step_id')) { $this->step = new entities\WorkflowStep(); $this->step->setWorkflow($this->workflow); } else { $this->step = entities\WorkflowStep::getB2DBTable()->selectById($request['step_id']); } if ($request->isPost() && $request['mode'] == 'delete_outgoing_transitions') { $this->step->deleteOutgoingTransitions(); $this->forward(framework\Context::getRouting()->generate('configure_workflow_steps', array('workflow_id' => $this->workflow->getID()))); } if ($request->isPost() && $request['mode'] == 'delete' && !$this->step->hasIncomingTransitions()) { $this->step->deleteOutgoingTransitions(); $this->step->delete(); $this->forward(framework\Context::getRouting()->generate('configure_workflow_steps', array('workflow_id' => $this->workflow->getID()))); } elseif ($request->isPost() && ($request->hasParameter('edit') || $request['mode'] == 'edit')) { $this->step->setName($request['name']); $this->step->setDescription($request['description']); $this->step->setLinkedStatusID($request['status_id']); $this->step->setIsEditable((bool) $request['is_editable']); $this->step->setIsClosed((bool) ($request['state'] == entities\Issue::STATE_CLOSED)); $this->step->save(); $this->forward(framework\Context::getRouting()->generate('configure_workflow_step', array('workflow_id' => $this->workflow->getID(), 'step_id' => $this->step->getID()))); } } catch (\Exception $e) { $this->error = $this->getI18n()->__('This workflow / step does not exist'); } }
public function associateIssuetypeWithWorkflow(\thebuggenie\core\entities\Issuetype $issuetype, \thebuggenie\core\entities\Workflow $workflow) { tables\WorkflowIssuetype::getTable()->setWorkflowIDforIssuetypeIDwithSchemeID($workflow->getID(), $issuetype->getID(), $this->getID()); }
<div class="content faded_out"> <p> <?php echo __('Workflow lets you define the lifecycle of an issue. You can define steps, transitions and more, that makes an issue move through its defined lifecycle.'); ?> <?php echo __('You can read more about how the workflow in The Bug Genie works and is set up in %link_to_wiki_workflow.', array('%link_to_wiki_workflow' => link_tag(make_url('publish_article', array('article_name' => 'TheBugGenie:Workflow')), 'TheBugGenie:Workflow'))); ?> </p> </div> <?php if (\thebuggenie\core\framework\Context::getScope()->getMaxWorkflowsLimit()) { ?> <div class="faded_out dark" style="margin: 12px 0;"> <?php echo __('This instance is currently using %num of max %max custom workflows', array('%num' => '<b id="current_workflow_num_count">' . \thebuggenie\core\entities\Workflow::getCustomWorkflowsCount() . '</b>', '%max' => '<b>' . \thebuggenie\core\framework\Context::getScope()->getMaxWorkflowsLimit() . '</b>')); ?> </div> <?php } ?> <br style="clear: both;"> <div class="tab_menu inset"> <ul id="workflow_menu"> <li<?php if ($selected_tab == 'workflows') { ?> class="selected"<?php } ?> ><?php
public function hasCustomWorkflowsAvailable() { if ($this->isCustomWorkflowsEnabled()) { return $this->getMaxWorkflowsLimit() ? Workflow::getCustomWorkflowsCount() < $this->getMaxWorkflowsLimit() : true; } else { return false; } }
<select name="workflow_id[<?php echo $issuetype->getID(); ?> ]"> <option value=""<?php if (!$workflow_scheme->hasWorkflowAssociatedWithIssuetype($issuetype)) { ?> selected<?php } ?> ><?php echo __('No workflow selected - will use default workflow'); ?> </option> <?php foreach (\thebuggenie\core\entities\Workflow::getAll() as $workflow) { ?> <option value="<?php echo $workflow->getID(); ?> "<?php if ($workflow_scheme->hasWorkflowAssociatedWithIssuetype($issuetype) && $workflow_scheme->getWorkflowForIssuetype($issuetype)->getID() == $workflow->getID()) { ?> selected<?php } ?> ><?php echo $workflow->getName(); ?> </option> <?php