public function executeAddObjectiveForm(sfWebRequest $request) { $this->forward404unless($request->isXmlHttpRequest()); $number = intval($request->getParameter("num")); if ($aoc = AreaOfConcernPeer::retrieveByPk($request->getParameter('id'))) { $form = new AreaOfConcernForm($aoc); } else { $form = new AreaOfConcernForm(null); } $form->addObjective($number); return $this->renderPartial('AddObjective', array('form' => $form, 'num' => $number)); }
public function executeAjaxGetObjectives(sfWebRequest $request) { $aoc = AreaOfConcernPeer::retrieveByPK($request->getParameter('id')); $objectives = $aoc->getObjectives(); $objectives = nckTools::asArray($objectives); $result = array('target' => $request->getParameter('target'), 'options' => $objectives); return $this->jsonify($result); }