|
|
@@ -9,6 +9,7 @@ Lib::loadClass('FileUploader');
|
|
|
Lib::loadClass('UserProfile');
|
|
|
Lib::loadClass('ProcesHelper');
|
|
|
Lib::loadClass('Router');
|
|
|
+Lib::loadClass('Route_UrlAction');
|
|
|
|
|
|
class TableAjax extends ViewAjax {
|
|
|
|
|
|
@@ -1123,6 +1124,7 @@ class TableAjax extends ViewAjax {
|
|
|
};
|
|
|
|
|
|
priv.ajaxLoadMoreFunctionsCell = function(rowPK) {
|
|
|
+ var dbg = priv.options.debug;
|
|
|
if (_popoverCellAjaxXhr) {
|
|
|
_popoverCellAjaxXhr.abort();
|
|
|
}
|
|
|
@@ -1166,16 +1168,16 @@ class TableAjax extends ViewAjax {
|
|
|
popoverRowFuncNode = popoverNode.find('.popoverRowFunctions');
|
|
|
;
|
|
|
{// fix generated row Functions by loaded from ajax call
|
|
|
- console.log('popoverRowFunctions. popoverRowFuncNode', popoverRowFuncNode);
|
|
|
- console.log('popoverRowFunctions. funcNodesToUpdate', funcNodesToUpdate);
|
|
|
+ if(dbg) console.log('popoverRowFunctions. popoverRowFuncNode', popoverRowFuncNode);
|
|
|
+ if(dbg) console.log('popoverRowFunctions. funcNodesToUpdate', funcNodesToUpdate);
|
|
|
funcNodesToUpdate.forEach(function(funcNodeInfo) {
|
|
|
var className = 'func_name-' + funcNodeInfo.id,
|
|
|
foundRowFuncNode = null
|
|
|
;
|
|
|
- console.log('popoverRowFunctions. funcNodesToUpdate loop:', funcNodeInfo);
|
|
|
+ if(dbg) console.log('popoverRowFunctions. funcNodesToUpdate loop:', funcNodeInfo);
|
|
|
popoverRowFuncNode.find('li > a').each(function(ind, n) {
|
|
|
var n$ = $(n);
|
|
|
- console.log('popoverRowFunctions loop(',ind,'):', n, 'data(func_name)', n$.data('func_name'), 'data', n$.data());
|
|
|
+ if(dbg) console.log('popoverRowFunctions loop(',ind,'):', n, 'data(func_name)', n$.data('func_name'), 'data', n$.data());
|
|
|
if (n$.hasClass(className)) {
|
|
|
foundRowFuncNode = n$;
|
|
|
}
|
|
|
@@ -6063,6 +6065,33 @@ jQuery(document).ready(function(){
|
|
|
$response->rowFunctions[] = $rowFunc;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ $acl = $this->_acl;
|
|
|
+ if ($urlFunctions = Route_UrlAction::getTableFunctions($acl->getID(), $id, $acl->getName())) {
|
|
|
+ foreach ($urlFunctions as $urlFunction) {
|
|
|
+ $rowFunction = array();
|
|
|
+ $rowFunction['href'] = $urlFunction['baseLink'];
|
|
|
+ $rowFunction['ico'] = V::get('ico', 'glyphicon glyphicon-share', $urlFunction);
|
|
|
+ $rowFunction['label'] = $urlFunction['label'];
|
|
|
+ $rowFunction['title'] = V::get('title', $urlFunction['label'], $urlFunction);
|
|
|
+ if (!empty($urlFunction['cell_id_params'])) {
|
|
|
+ $record = $acl->getItem($id);
|
|
|
+ $urlParams = array();// [ "{$urlParamName}={$paramValue}" ]
|
|
|
+ foreach ($urlFunction['cell_id_params'] as $idField => $urlParamName) {
|
|
|
+ $paramValue = '';
|
|
|
+ $fld = $acl->getField($idField);
|
|
|
+ if ($fld) {
|
|
|
+ $fldName = $fld['name'];
|
|
|
+ $paramValue = V::get($fldName, '', $record);
|
|
|
+ $urlParams[] = "{$urlParamName}={$paramValue}";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!empty($urlParams)) $rowFunction['href'] .= "&" . implode("&", $urlParams);
|
|
|
+ }
|
|
|
+ $response->rowFunctions[] = $rowFunction;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return $response;
|
|
|
}
|
|
|
|