private function displayTransitionDetails(TrackerManager $engine, Codendi_Request $request, PFUser $current_user, Transition $transition)
 {
     $hp = Codendi_HTMLPurifier::instance();
     $this->displayHeader($engine);
     if ($transition->getFieldValueFrom()) {
         $from_label = $transition->getFieldValueFrom()->getLabel();
     } else {
         $from_label = $GLOBALS['Language']->getText('workflow_admin', 'new_artifact');
     }
     $to_label = $transition->getFieldValueTo()->getLabel();
     echo '<h3>';
     echo $GLOBALS['Language']->getText('workflow_admin', 'title_define_transition_details', array($hp->purify($from_label), $hp->purify($to_label)));
     echo '</h3>';
     $form_action = TRACKER_BASE_URL . '/?' . http_build_query(array('tracker' => (int) $this->tracker->id, 'func' => Workflow::FUNC_ADMIN_TRANSITIONS, 'transition' => $transition->getId()));
     echo '<form action="' . $form_action . '" method="POST">';
     echo '<table><tr><td>';
     $section_conditions = new Widget_Static($GLOBALS['Language']->getText('workflow_admin', 'under_the_following_condition'));
     $section_conditions->setContent($transition->fetchConditions());
     $section_conditions->display();
     $actions = '';
     $actions .= $transition->fetchPostActions();
     $actions .= $this->post_action_factory->fetchPostActions();
     $section_postactions = new Widget_Static($GLOBALS['Language']->getText('workflow_admin', 'following_action_performed'));
     $section_postactions->setContent($actions);
     $section_postactions->display();
     $back_to_transitions_link = TRACKER_BASE_URL . '/?' . http_build_query(array('tracker' => (int) $this->tracker->id, 'func' => Workflow::FUNC_ADMIN_TRANSITIONS));
     echo '<p>';
     echo '<a href="' . $back_to_transitions_link . '">←' . $GLOBALS['Language']->getText('plugin_tracker_admin', 'clean_cancel') . '</a>';
     echo '&nbsp;';
     echo '<input type="submit" name="workflow_details" value="' . $GLOBALS['Language']->getText('global', 'btn_submit') . '" />';
     echo '</p>';
     echo '</td></tr></table>';
     echo '</form>';
     $this->displayFooter($engine);
 }
 /**
  * Creates transition in the database
  * 
  * @param int $workflow_id The workflow_id of the transitions to save
  * @param Transition          $transition The transition
  * 
  * @return void
  */
 public function saveObject($workflow_id, $transition)
 {
     $dao = $this->getDao();
     if ($transition->getFieldValueFrom() == null) {
         $from_id = null;
     } else {
         $from_id = $transition->getFieldValueFrom()->getId();
     }
     $to_id = $transition->getFieldValueTo()->getId();
     $transition_id = $dao->addTransition($workflow_id, $from_id, $to_id);
     $transition->setTransitionId($transition_id);
     //Save postactions
     $postactions = $transition->getPostActions();
     foreach ($postactions as $postaction) {
         $tpaf = new Transition_PostActionFactory();
         $tpaf->saveObject($postaction);
     }
     //Save permissions
     $permissions = $transition->getPermissions();
     $this->addPermissions($permissions, $transition->getTransitionId());
 }