|
|
@@ -10,6 +10,7 @@ Lib::loadClass('UserProfile');
|
|
|
Lib::loadClass('ProcesHelper');
|
|
|
Lib::loadClass('Router');
|
|
|
Lib::loadClass('Route_UrlAction');
|
|
|
+Lib::loadClass('Core_AclHelper');
|
|
|
|
|
|
// TODO: change all links: MENU_INIT=VIEWTABLE_AJAX&ZASOB_ID={idZasob} to _route=ViewTableAjax&typeName=p5_default_db:{tableName}
|
|
|
|
|
|
@@ -226,27 +227,11 @@ class TableAjax extends ViewAjax {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- public function hasGeomFields() {
|
|
|
- $hasGeomFields = false;
|
|
|
- $fieldsList = $this->_acl->getFieldListByIdZasob();
|
|
|
- foreach ($fieldsList as $kID => $fieldName) {
|
|
|
- if ($this->_acl->isGeomField($fieldName) && $this->_acl->canReadField($fieldName)) {
|
|
|
- $hasGeomFields = true;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- return $hasGeomFields;
|
|
|
- }
|
|
|
-
|
|
|
public function render() {
|
|
|
- $hasGeomFlds = $this->hasGeomFields();
|
|
|
-
|
|
|
- $tblAjaxMap = null;
|
|
|
- if ($hasGeomFlds) {
|
|
|
- $tblAjaxMap = new TableAjaxMap($this->_acl, 512, 400);
|
|
|
- }
|
|
|
-
|
|
|
- $hasPermCreate = $this->_acl->hasCreatePerms();
|
|
|
+ $acl = $this->_acl;
|
|
|
+ $hasGeomFlds = Core_AclHelper::hasGeomFields($acl);
|
|
|
+ $tblAjaxMap = ($hasGeomFlds) ? new TableAjaxMap($acl, 512, 400) : null;
|
|
|
+ $hasPermCreate = Core_AclHelper::hasCreatePerms($acl);
|
|
|
|
|
|
$jsToogleFiltrProcesuFunctionName = 'tableAjaxToggleFiltrProcesInit';
|
|
|
ob_start();
|
|
|
@@ -1386,7 +1371,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
// currentNode.find('i').tooltip('hide');
|
|
|
node = $('<tr class="sort ' + nodeClass + '"></tr>');
|
|
|
//create the functions column
|
|
|
- if (priv.options.rowFunctions || priv.options.filtersClean) {
|
|
|
+ if (priv.options.tblFunctions || priv.options.filtersClean) {
|
|
|
var headCell = $('<th class="text-right head-info stickyCol1"></th>').appendTo(node);
|
|
|
$.map(priv.options.tblFunctions, function(funObj, funName){
|
|
|
var funHtml = $('<a></a>');
|
|
|
@@ -4554,10 +4539,11 @@ jQuery(document).ready(function(){
|
|
|
}
|
|
|
|
|
|
private function sendAjaxCreate($args) {
|
|
|
+ $acl = $this->_acl;
|
|
|
header("Content-type: text/plain");
|
|
|
$DBG = ('1' == V::get('DBG', '', $_REQUEST));
|
|
|
|
|
|
- if (!$this->_acl->hasCreatePerms()) {
|
|
|
+ if (!Core_AclHelper::hasCreatePerms($acl)) {
|
|
|
?>
|
|
|
<div class="container">
|
|
|
<div class="alert alert-danger">
|