|
|
@@ -15,7 +15,7 @@ Lib::loadClass('UserProfile');
|
|
|
|
|
|
class Route_ViewTableAjax extends RouteBase {
|
|
|
|
|
|
- public function getTableAjaxWidget($acl, $backRefFilter = []) {
|
|
|
+ public function getTableAjaxWidget($acl, $backRefFilter = [], $childRefFilter = []) {
|
|
|
$syncUrl = $this->getLink('', [ 'namespace' => $acl->getNamespace() ]);
|
|
|
$tbl = new TableAjax($acl);
|
|
|
$tbl->setRootUrl($syncUrl);
|
|
|
@@ -28,6 +28,14 @@ class Route_ViewTableAjax extends RouteBase {
|
|
|
'backRefField' => $backRefFilter['fieldName'],
|
|
|
]);
|
|
|
}
|
|
|
+ if (!empty($childRefFilter['namespace']) && !empty($childRefFilter['primaryKey'])) {
|
|
|
+ $tbl->setChildRefFilter($childRefFilter);
|
|
|
+ $syncUrl = $this->getLink('', [
|
|
|
+ 'namespace' => $acl->getNamespace(),
|
|
|
+ 'childRefNS' => $childRefFilter['namespace'],
|
|
|
+ 'childRefPK' => $childRefFilter['primaryKey'],
|
|
|
+ ]);
|
|
|
+ }
|
|
|
$tblLabel = $acl->getNamespace();
|
|
|
if ('default_db' == $acl->getSourceName()) {
|
|
|
$tblLabel = array();
|
|
|
@@ -84,7 +92,11 @@ class Route_ViewTableAjax extends RouteBase {
|
|
|
'primaryKey' => V::get('backRefPK', '', $_GET),
|
|
|
'fieldName' => V::get('backRefField', '', $_GET),
|
|
|
];
|
|
|
- $tbl = $this->getTableAjaxWidget($acl, $backRefFilter);
|
|
|
+ $childRefFilter = [
|
|
|
+ 'namespace' => V::get('childRefNS', '', $_GET),
|
|
|
+ 'primaryKey' => V::get('childRefPK', '', $_GET),
|
|
|
+ ];
|
|
|
+ $tbl = $this->getTableAjaxWidget($acl, $backRefFilter, $childRefFilter);
|
|
|
$tbl->setFilterInit($filterInit);
|
|
|
if (!empty($forceFilterInit)) $tbl->setForceFilterInit($forceFilterInit);
|
|
|
echo $tbl->render();
|
|
|
@@ -743,7 +755,11 @@ class Route_ViewTableAjax extends RouteBase {
|
|
|
'primaryKey' => V::get('backRefPK', '', $_REQUEST),
|
|
|
'fieldName' => V::get('backRefField', '', $_REQUEST),
|
|
|
];
|
|
|
- $tbl = $this->getTableAjaxWidget($acl, $backRefFilter);
|
|
|
+ $childRefFilter = [
|
|
|
+ 'namespace' => V::get('childRefNS', '', $_GET),
|
|
|
+ 'primaryKey' => V::get('childRefPK', '', $_GET),
|
|
|
+ ];
|
|
|
+ $tbl = $this->getTableAjaxWidget($acl, $backRefFilter, $childRefFilter);
|
|
|
Response::sendTryCatchJson(array($tbl, 'ajaxData'), $args = $_GET);
|
|
|
}
|
|
|
|