|
|
@@ -52,9 +52,8 @@ class TableAjax extends ViewAjax {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public function setSyncUrl($syncUrl) {
|
|
|
- $this->syncUrl = $syncUrl;
|
|
|
- }
|
|
|
+ public function setSyncUrl($syncUrl) { $this->syncUrl = $syncUrl; }
|
|
|
+ public function setRootUrl($rootUrl) { $this->rootUrl = $rootUrl; }
|
|
|
|
|
|
private function _hasStateFilterInit() {
|
|
|
return array_key_exists($this->_htmlID, $_SESSION['TableAjax_Cache']) && array_key_exists('_filterInit', $_SESSION['TableAjax_Cache'][$this->_htmlID]);
|
|
|
@@ -122,6 +121,10 @@ class TableAjax extends ViewAjax {
|
|
|
$this->_pageSizes = $pageSizes;
|
|
|
}
|
|
|
|
|
|
+ public function setBackRefFilter($backRefFilter) {
|
|
|
+ $this->_backRefFilter = $backRefFilter;
|
|
|
+ }
|
|
|
+
|
|
|
public function setFilterInit($filterInit) {
|
|
|
if ($this->_hasStateFilterInit()) {
|
|
|
return;
|
|
|
@@ -455,6 +458,23 @@ class TableAjax extends ViewAjax {
|
|
|
<a class="pull-right" style="padding:0 20px 0 0;" href="<?= "index.php?_route=GeoreferencesManager"; ?>"><i class="glyphicon glyphicon glyphicon-wrench"></i> Zarządzaj punktami</a>
|
|
|
<?php endif; ?>
|
|
|
</ul>
|
|
|
+ <?php
|
|
|
+ if ($this->_backRefFilter) {
|
|
|
+ echo UI::h('div', [ 'class' => "container" ], [
|
|
|
+ UI::h('div', [ 'class' => "alert alert-info" ], [
|
|
|
+ "Rekordy powiązane z rekordem {$this->_backRefFilter['primaryKey']} z ",
|
|
|
+ UI::h('a', [
|
|
|
+ 'href' => "index.php?_route=ViewTableAjax&namespace={$this->_backRefFilter['namespace']}",
|
|
|
+ ], $this->_backRefFilter['namespace']),
|
|
|
+ " - ",
|
|
|
+ UI::h('a', [
|
|
|
+ 'href' => $this->rootUrl,
|
|
|
+ 'style' => "color:red",
|
|
|
+ ], "usuń filtr"),
|
|
|
+ ]),
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+ ?>
|
|
|
<div id="<?= $this->_htmlID; ?>"></div>
|
|
|
</div>
|
|
|
<?php
|
|
|
@@ -1136,6 +1156,13 @@ class TableAjax extends ViewAjax {
|
|
|
}
|
|
|
if ('ref' === columnProps.type) showTooltip = false;
|
|
|
if ('ref' === columnProps.type) cellNode.css('padding', "3px")
|
|
|
+ if ('ref' === columnProps.type) console.log('renderRow rowPK('+rowPK+') columnProps', columnProps)
|
|
|
+ if ('ref' === columnProps.type) cellNode.html('<a href="index.php?_route=ViewTableAjax' +
|
|
|
+ '&namespace=' + columnProps.xsdRefNsPrefix.replace('__x3A__', '/') + '/' + columnProps.xsdRefType +
|
|
|
+ '&backRefNS=' + priv.options.namespace +
|
|
|
+ '&backRefPK=' + rowPK +
|
|
|
+ '&backRefField=' + columnProps.column +
|
|
|
+ '">przeglądaj</a>')
|
|
|
|
|
|
if (i > 1 && priv.options.longDesc) {// TODO: use better check for columns: functions and pk
|
|
|
cellNode.addClass('tbl-short-txt');
|
|
|
@@ -5474,6 +5501,11 @@ jQuery(document).ready(function(){
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if ($this->_backRefFilter) {
|
|
|
+ $params['__backRef'] = $this->_backRefFilter;
|
|
|
+ DBG::log($params, 'array', '$params __backRef');
|
|
|
+ }
|
|
|
+
|
|
|
$filters = new stdClass();
|
|
|
$filters->currSortCol = $currSortCol;
|
|
|
$filters->currSortFlip = $currSortFlip;
|