- Removed /core from URL

- If UDf are not set in DB UDF view will not display them
- Removed placeholder from multiple dropdown widget
- Dropdown widget has null value as placeholder
- Added permission system/udf to checksystem
This commit is contained in:
Paolo
2017-08-01 18:25:23 +02:00
parent bba27f75e0
commit 66de1e18f8
8 changed files with 216 additions and 85 deletions
+30
View File
@@ -62,6 +62,7 @@ class UDF_model extends DB_Model
$this->load->model('person/Person_model', 'PersonModel');
$udfs = $this->_fillMissingChkboxUDF($udfs, 'public', 'tbl_person');
$udfs = $this->_fillMissingDropdownUDF($udfs, 'public', 'tbl_person');
$resultPerson = $this->PersonModel->update($person_id, $udfs);
}
@@ -73,6 +74,7 @@ class UDF_model extends DB_Model
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
$udfs = $this->_fillMissingChkboxUDF($udfs, 'public', 'tbl_prestudent');
$udfs = $this->_fillMissingDropdownUDF($udfs, 'public', 'tbl_prestudent');
$resultPrestudent = $this->PrestudentModel->update($prestudent_id, $udfs);
}
@@ -119,4 +121,32 @@ class UDF_model extends DB_Model
return $_fillMissingChkboxUDF;
}
/**
*
*/
private function _fillMissingDropdownUDF($udfs, $schema, $table)
{
$_fillMissingDropdownUDF = $udfs;
$result = $this->load(array($schema, $table));
if (isSuccess($result) && count($result->retval) == 1)
{
$jsons = json_decode($result->retval[0]->jsons);
foreach($jsons as $udfDescription)
{
if ($udfDescription->{DB_Model::UDF_TYPE_NAME} == DB_Model::UDF_DROPDOWN_TYPE
|| $udfDescription->{DB_Model::UDF_TYPE_NAME} == DB_Model::UDF_MULTIPLEDROPDOWN_TYPE)
{
if (!isset($_fillMissingDropdownUDF[$udfDescription->{DB_Model::UDF_ATTRIBUTE_NAME}]))
{
$_fillMissingDropdownUDF[$udfDescription->{DB_Model::UDF_ATTRIBUTE_NAME}] = DB_Model::STRING_NULL;
}
}
}
}
return $_fillMissingDropdownUDF;
}
}