mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-23 09:52:22 +00:00
- Bugfix UDF dropdown, wrong check for selected value
- UDF checkbox now is only one value, no multiple checkbox anymore - Added method saveUDFs to model UDF_model - Added new constants to resolve json schema parameters
This commit is contained in:
@@ -60,6 +60,64 @@ class UDF extends APIv1_Controller
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function postUDF()
|
||||
{
|
||||
$udfs = $this->post();
|
||||
$validation = $this->_validate($udfs);
|
||||
|
||||
var_dump($udfs);exit;
|
||||
|
||||
if (isSuccess($validation))
|
||||
{
|
||||
$caller = null;
|
||||
if (isset($udfs['caller']))
|
||||
{
|
||||
$caller = $udfs['caller'];
|
||||
unset($udfs['caller']);
|
||||
}
|
||||
|
||||
$result = $this->UDFModel->saveUDFs($udfs);
|
||||
|
||||
if ($caller != null)
|
||||
{
|
||||
$res = 'ERR';
|
||||
if (isSuccess($result))
|
||||
{
|
||||
$res = 'OK';
|
||||
}
|
||||
|
||||
redirect($caller.'&res='.$res);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->response($validation, REST_Controller::HTTP_OK);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function _validate($udfs)
|
||||
{
|
||||
$validation = error('person_id or prestudent_id is missing');
|
||||
|
||||
if((isset($udfs['person_id']) && !(is_null($udfs['person_id'])) && ($udfs['person_id'] != ''))
|
||||
|| (isset($udfs['prestudent_id']) && !(is_null($udfs['prestudent_id'])) && ($udfs['prestudent_id'] != '')))
|
||||
{
|
||||
$validation = success(true);
|
||||
}
|
||||
|
||||
return $validation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode to json the column jsons for every result set
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user