Exemplo n.º 1
0
 /**
  * Save SQL condition
  * @todo check incoming values
  */
 public function saveconditionAction()
 {
     $this->_checkCanEdit();
     $this->_checkLoaded();
     $query = $this->_session->get('query');
     $id = Request::post('id', 'integer', -1);
     $object = Request::post('object', 'string', false);
     $field = Request::post('field', 'string', false);
     $operator = Request::post('operator', 'string', false);
     $value = Request::post('value', 'string', false);
     $value2 = Request::post('value2', 'string', false);
     $dbCondition = new Db_Query_Condition();
     $dbCondition->object = $object;
     $dbCondition->field = $field;
     $dbCondition->operator = $operator;
     $dbCondition->value = $value;
     $dbCondition->value2 = $value2;
     if ($id === -1) {
         $query->addCondition($dbCondition);
     } else {
         $query->setCondition($id, $dbCondition);
     }
     $this->_session->set('query', $query);
     Response::jsonSuccess();
 }
Exemplo n.º 2
0
 /**
  * Store project data
  */
 protected function _storeProject()
 {
     $this->_session->set('project', serialize($this->_getProject()));
 }