public function executeInformativeWorkflow()
 {
     $this->form = new informativeWorkflowForm(null, array('available_status' => informativeWorkflow::getAvailableStatus($this->getUser()->getDbUserType())));
     $this->informativeWorkflow = Doctrine::getTable('InformativeWorkflow')->findForTable($this->table, $this->eid);
     if (!isset($this->view)) {
         $this->view = false;
     }
 }
 public function configure()
 {
     $this->useFields(array('status'));
     $this->addPagerItems();
     $this->widgetSchema->setNameFormat('searchWorkflows[%s]');
     $status = informativeWorkflow::getAvailableStatus('all');
     $this->widgetSchema['status'] = new sfWidgetFormChoice(array('choices' => $status));
     $this->validatorSchema['status'] = new sfValidatorChoice(array('choices' => array_keys($status), 'required' => true));
 }
 public function executeAdd(sfWebRequest $request)
 {
     if ($request->isXmlHttpRequest()) {
         $form = new InformativeWorkflowForm(null, array('available_status' => informativeWorkflow::getAvailableStatus($this->getUser()->getDbUserType())));
         $form->bind(array('comment' => $request->getParameter('comment'), 'status' => $request->getParameter('status')));
         if ($form->isValid()) {
             $data = array('referenced_relation' => $request->getParameter('table'), 'record_id' => $request->getParameter('id'), 'status' => $request->getParameter('status'), 'comment' => $request->getParameter('comment'), 'user_ref' => $this->getUser()->getId());
             $workflow = new InformativeWorkflow();
             $workflow->fromArray($data);
             $workflow->save();
         }
         // else : nothing append, and it's a good thing
         return $this->renderText('ok');
     }
     $this->redirect('board/index');
 }