|
|
@@ -858,18 +858,23 @@ jQuery('#typeahead-{$fName}').typeahead({
|
|
|
DBG::log(['msg'=>"this", $this]);
|
|
|
Lib::loadClass('ACL');
|
|
|
Lib::loadClass('AclQueryFeatures');
|
|
|
- $andSql = array_map(
|
|
|
- function ($tableName, $idTable) {
|
|
|
- $tableAcl = User::getAcl()->getObjectAcl('default_db', $tableName);
|
|
|
- return ACL::query($tableAcl, "t_{$idTable}")
|
|
|
+ try {
|
|
|
+ $andSql = array_map(
|
|
|
+ function ($tableName, $idTable) {
|
|
|
+ $tableAcl = User::getAcl()->getObjectAcl('default_db', $tableName);
|
|
|
+ return ACL::query($tableAcl, "t_{$idTable}")
|
|
|
->where( (new AclQueryFeatures($tableAcl, $params = []))->parseSpecialFilterAccess() )
|
|
|
->generateWhereSql()
|
|
|
- ;
|
|
|
- },
|
|
|
- $this->tblAliasList, array_keys($this->tblAliasList)
|
|
|
- );
|
|
|
- $andSql = array_filter($andSql, ['V', 'filterNotEmpty']);
|
|
|
- if (!empty($andSql)) $sqlWhereAdd .= "\n" . " and " . implode(" and ", $andSql);
|
|
|
+ ;
|
|
|
+ },
|
|
|
+ $this->tblAliasList, array_keys($this->tblAliasList)
|
|
|
+ );
|
|
|
+ $andSql = array_filter($andSql, ['V', 'filterNotEmpty']);
|
|
|
+ if (!empty($andSql)) $sqlWhereAdd .= "\n" . " and " . implode(" and ", $andSql);
|
|
|
+ } catch (Exception $e) {
|
|
|
+ DBG::log($e);
|
|
|
+ return [];
|
|
|
+ }
|
|
|
$sqlLimit = V::get('limit', 0, $this->sqlQuery, 'int');
|
|
|
$sqlLimit = ($sqlLimit > 0) ? $sqlLimit : 20;
|
|
|
|