Example #1
0
 /**
  * Set Join type for report part
  */
 public function setjoinAction()
 {
     $this->_checkCanEdit();
     $parentPart = Request::post('parentpart', 'string', '');
     $parentField = Request::post('parentfield', 'string', '');
     $childField = Request::post('childfield', 'string', '');
     $object = Request::post('object', 'string', false);
     $joinType = Request::post('jointype', 'integer', 1);
     if (!$object) {
         Response::jsonError($this->_lang->WRONG_REQUEST . ' code 1');
     }
     $this->_checkLoaded();
     $query = $this->_session->get('query');
     /**
      * @var Db_Query_Part 
      */
     $part = $query->getPart(Db_Query_Part::findId($parentPart, $parentField, $childField, $object));
     if (!$part) {
         Response::jsonError($this->_lang->WRONG_REQUES);
     }
     $part->setJoinType($joinType);
     $this->_session->set('query', $query);
     Response::jsonSuccess();
 }