- Changed controller system/FAS_UDF, less busy now

- Method execReadOnlyQuery of DB_Model less strict check against SQL statements
- Added new public method setup to DB_Model to setup the model after initialization
- Added new constants to UDFLib
- Added new private method _printEndUDFBlock and _printEndUDFBlock to UDFLib
- Added new public methods setUDFUniqueId, getSession, getSessionElement, setSession, setSessionElement, saveUDFs and isAllowed to UDFLib
- Removed model system/FAS_UDF_model
- View views/system/fas_udf now uses the view templates/FHC-Header
- Added new parameter udfs to view templates/FHC-Header
- Added new properties to UDFWidget
- Added new private methods _initUDFWidget, _checkParameters and _startUDFWidget to UDFWidget
This commit is contained in:
Paolo
2019-12-17 13:35:41 +01:00
parent fc2d26e96d
commit 719f2d7314
10 changed files with 686 additions and 451 deletions
+17 -3
View File
@@ -60,6 +60,20 @@ class DB_Model extends CI_Model
// ------------------------------------------------------------------------------------------
// Public methods
/**
* This method provides a way to setup a database model without declaring one
*/
public function setup($schema, $table, $primaryKey, $hasSequence = true)
{
//
if (!isEmptyString($schema) && !isEmptyString($table) && !isEmptyString($primaryKey) && is_bool($hasSequence))
{
$this->dbTable = $schema.'.'.$table;
$this->pk = $primaryKey;
$this->hasSequence = $hasSequence;
}
}
/**
* Insert Data into DB-Table
*
@@ -690,7 +704,7 @@ class DB_Model extends CI_Model
*/
public function hasUDF()
{
if($this->fieldExists(UDFLib::COLUMN_NAME))
if ($this->fieldExists(UDFLib::COLUMN_NAME))
{
$resultUDFsDefinitions = $this->UDFModel->getUDFsDefinitions($this->dbTable);
if (hasData($resultUDFsDefinitions))
@@ -727,8 +741,8 @@ class DB_Model extends CI_Model
$cleanedQuery = trim(preg_replace('/\t|\n|\r|;/', '', $query)); //
//
if (stripos($cleanedQuery, 'SELECT') == 0
&& (stripos($cleanedQuery, 'INSERT') > 0 || stripos($cleanedQuery, 'INSERT') == false)
if (
(stripos($cleanedQuery, 'INSERT') > 0 || stripos($cleanedQuery, 'INSERT') == false)
&& (stripos($cleanedQuery, 'UPDATE') > 0 || stripos($cleanedQuery, 'UPDATE') == false)
&& (stripos($cleanedQuery, 'CREATE') > 0 || stripos($cleanedQuery, 'CREATE') == false)
&& (stripos($cleanedQuery, 'DELETE') > 0 || stripos($cleanedQuery, 'DELETE') == false)