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:
@@ -39,4 +39,53 @@ class UDF_model extends DB_Model
|
||||
return error('You are allowed to run only query for reading data');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function saveUDFs($udfs)
|
||||
{
|
||||
$result = error('No way man!');
|
||||
$resultPerson = success('person');
|
||||
$resultPrestudent = success('prestudent');
|
||||
|
||||
//
|
||||
if (isset($udfs['person_id']))
|
||||
{
|
||||
// Load model Person_model
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
|
||||
$person_id = $udfs['person_id'];
|
||||
unset($udfs['person_id']);
|
||||
|
||||
$resultPerson = $this->PersonModel->update($person_id, $udfs);
|
||||
}
|
||||
|
||||
//
|
||||
if (isset($udfs['prestudent_id']))
|
||||
{
|
||||
// Load model Prestudent_model
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
$prestudent_id = $udfs['prestudent_id'];
|
||||
unset($udfs['prestudent_id']);
|
||||
|
||||
$resultPrestudent = $this->PrestudentModel->update($prestudent_id, $udfs);
|
||||
}
|
||||
|
||||
if (isSuccess($resultPerson) && isSuccess($resultPrestudent))
|
||||
{
|
||||
$result = success(array($resultPerson->retval, $resultPrestudent->retval));
|
||||
}
|
||||
else if(isError($resultPerson))
|
||||
{
|
||||
$result = $resultPerson;
|
||||
}
|
||||
else if(isError($resultPrestudent))
|
||||
{
|
||||
$result = $resultPrestudent;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user