|
@@ -16,15 +16,15 @@ Lib::loadClass('Core_AclHelper');
|
|
|
|
|
|
|
|
class TableAjax extends ViewAjax {
|
|
class TableAjax extends ViewAjax {
|
|
|
|
|
|
|
|
- private $_cnf = '';// Column
|
|
|
|
|
- private $_htmlID = '';
|
|
|
|
|
- private $_rowFunctions = array();
|
|
|
|
|
- private $_pageSize = 10;
|
|
|
|
|
- private $_pageSizes = array();
|
|
|
|
|
- private $_filterInit = null;
|
|
|
|
|
- private $_forceFilterInit = null;
|
|
|
|
|
- private $_showProcesInit = true;
|
|
|
|
|
- private $_useUserTableFilter = false;
|
|
|
|
|
|
|
+ public $_cnf = '';// Column
|
|
|
|
|
+ public $_htmlID = '';
|
|
|
|
|
+ public $_rowFunctions = array();
|
|
|
|
|
+ public $_pageSize = 10;
|
|
|
|
|
+ public $_pageSizes = array();
|
|
|
|
|
+ public $_filterInit = null;
|
|
|
|
|
+ public $_forceFilterInit = null;
|
|
|
|
|
+ public $showProcesInitFiltr = false;
|
|
|
|
|
+ public $useUserTableFilter = false;
|
|
|
public $syncUrl = null;
|
|
public $syncUrl = null;
|
|
|
|
|
|
|
|
public function __construct($tblAcl) {
|
|
public function __construct($tblAcl) {
|
|
@@ -55,14 +55,6 @@ class TableAjax extends ViewAjax {
|
|
|
$this->syncUrl = $syncUrl;
|
|
$this->syncUrl = $syncUrl;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function showProcesInit($bool = true) {
|
|
|
|
|
- $this->_showProcesInit = $bool;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public function showUserTableFilter($url = null) {
|
|
|
|
|
- $this->_useUserTableFilter = $url;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
private function _hasStateFilterInit() {
|
|
private function _hasStateFilterInit() {
|
|
|
return array_key_exists($this->_htmlID, $_SESSION['TableAjax_Cache']) && array_key_exists('_filterInit', $_SESSION['TableAjax_Cache'][$this->_htmlID]);
|
|
return array_key_exists($this->_htmlID, $_SESSION['TableAjax_Cache']) && array_key_exists('_filterInit', $_SESSION['TableAjax_Cache'][$this->_htmlID]);
|
|
|
}
|
|
}
|
|
@@ -413,167 +405,56 @@ class TableAjax extends ViewAjax {
|
|
|
?>
|
|
?>
|
|
|
<div class="AjaxTableCont">
|
|
<div class="AjaxTableCont">
|
|
|
<ul class="breadcrumb">
|
|
<ul class="breadcrumb">
|
|
|
- <li><a href="#" onclick="return tableAjaxBackToTable();"><?php echo $this->getLabelHtml(); ?></a></li>
|
|
|
|
|
- <!-- TODO: if has perm 'C' then add btn to create new record -->
|
|
|
|
|
- <?php if ($hasPermCreate) : ?>
|
|
|
|
|
- <li><a title="Dodaj nowy rekord"
|
|
|
|
|
- class=""
|
|
|
|
|
- href="#CREATE"><span class="glyphicon glyphicon-plus"></span> Dodaj nowy rekord</a></li>
|
|
|
|
|
- <?php endif; ?>
|
|
|
|
|
- <?php if ($this->_showProcesInit) : ?>
|
|
|
|
|
- <div class="btn-group pull-right">
|
|
|
|
|
- <a class="btn btn-xs btn-info dropdown-toggle"
|
|
|
|
|
- data-toggle="dropdown"
|
|
|
|
|
- href="#"
|
|
|
|
|
- title="Uruchom filtr procesu powiązanego z tabelą <?php echo $this->getLabel(); ?>"
|
|
|
|
|
- onclick="return <?php echo $jsToogleFiltrProcesuFunctionName; ?>(this);">
|
|
|
|
|
- Filtr procesu <span class="caret"></span>
|
|
|
|
|
- </a>
|
|
|
|
|
- <ul class="dropdown-menu pull-left" style="max-height:250px;overflow:auto;">
|
|
|
|
|
- <li class="disabled"><a href="#" onclick="return false;"> loading ... </a></li>
|
|
|
|
|
- </ul>
|
|
|
|
|
- </div>
|
|
|
|
|
- <?php endif; ?>
|
|
|
|
|
|
|
+ <?php
|
|
|
|
|
+ echo UI::h('li', [], [
|
|
|
|
|
+ UI::h('a', [ 'href' => "#", 'onclick' => "return tableAjaxBackToTable();" ], $this->getLabelHtml() ),
|
|
|
|
|
+ ]);
|
|
|
|
|
+ if ($hasPermCreate) {
|
|
|
|
|
+ echo UI::h('li', [], [
|
|
|
|
|
+ UI::h('a', [ 'title' => "Dodaj nowy rekord", 'class' => "", 'href' => "#CREATE" ], [
|
|
|
|
|
+ UI::h('span', [ 'class' => "glyphicon glyphicon-plus" ]),
|
|
|
|
|
+ " Dodaj nowy rekord",
|
|
|
|
|
+ ]),
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($this->showProcesInitFiltr) {
|
|
|
|
|
+ echo UI::h('div', [ 'class' => "btn-group pull-right" ], [
|
|
|
|
|
+ UI::h('a', [ 'class' => "btn btn-xs btn-info dropdown-toggle",
|
|
|
|
|
+ 'data-toggle' => "dropdown",
|
|
|
|
|
+ 'href' => "#",
|
|
|
|
|
+ 'title' => "Uruchom filtr procesu powiązanego z tabelą " . $this->getLabel(),
|
|
|
|
|
+ 'onclick' => "return {$jsToogleFiltrProcesuFunctionName}(this);",
|
|
|
|
|
+ ], "Filtr procesu <span class=\"caret\"></span>"),
|
|
|
|
|
+ UI::h('ul', [ 'class' => "dropdown-menu pull-left", 'style' => "max-height:250px;overflow:auto;" ], [
|
|
|
|
|
+ UI::h('li', [ 'class' => "disabled" ], [
|
|
|
|
|
+ UI::h('a', [ 'href' => "#", 'onclick' => "return false;" ], " loading ... "),
|
|
|
|
|
+ ]),
|
|
|
|
|
+ ]),
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }
|
|
|
|
|
+ ?>
|
|
|
<?php if ($this->_tbl == 'IN7_MK_BAZA_DYSTRYBUCJI') : ?>
|
|
<?php if ($this->_tbl == 'IN7_MK_BAZA_DYSTRYBUCJI') : ?>
|
|
|
- <a class="pull-right" style="padding:0 20px 0 0;" href="<?php echo "index.php?MENU_INIT=TREEJS&ZASOB_ID={$this->_zasobID}"; ?>"><i class="glyphicon glyphicon-eye-open"></i> Drzewo</a>
|
|
|
|
|
|
|
+ <a class="pull-right" style="padding:0 20px 0 0;" href="<?= "index.php?MENU_INIT=TREEJS&ZASOB_ID={$this->_zasobID}"; ?>"><i class="glyphicon glyphicon-eye-open"></i> Drzewo</a>
|
|
|
<?php elseif ($this->allowTreeView()) : ?>
|
|
<?php elseif ($this->allowTreeView()) : ?>
|
|
|
- <a class="pull-right" style="padding:0 20px 0 0;" href="<?php echo "index.php?MENU_INIT=VIEWTREE_AJAX&ZASOB_ID={$this->_zasobID}"; ?>"><i class="glyphicon glyphicon-eye-open"></i> Drzewo</a>
|
|
|
|
|
|
|
+ <a class="pull-right" style="padding:0 20px 0 0;" href="<?= "index.php?MENU_INIT=VIEWTREE_AJAX&ZASOB_ID={$this->_zasobID}"; ?>"><i class="glyphicon glyphicon-eye-open"></i> Drzewo</a>
|
|
|
<?php endif; ?>
|
|
<?php endif; ?>
|
|
|
<?php if ($this->_tbl == 'WMS_MAP_GEOREFERENCES') : ?>
|
|
<?php if ($this->_tbl == 'WMS_MAP_GEOREFERENCES') : ?>
|
|
|
- <a class="pull-right" style="padding:0 20px 0 0;" href="<?php echo "index.php?_route=GeoreferencesManager"; ?>"><i class="glyphicon glyphicon glyphicon-wrench"></i> Zarządzaj punktami</a>
|
|
|
|
|
|
|
+ <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; ?>
|
|
<?php endif; ?>
|
|
|
</ul>
|
|
</ul>
|
|
|
- <div id="<?php echo $this->_htmlID; ?>"></div>
|
|
|
|
|
|
|
+ <div id="<?= $this->_htmlID; ?>"></div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ UI::inlineJS(__FILE__ . '.generateFunctionNode.js');
|
|
|
|
|
+ UI::inlineJS(__FILE__ . '.GeomField.js');
|
|
|
|
|
+ $clsName = __CLASS__;
|
|
|
|
|
+ UI::inlineJS(__FILE__ . '.procesInitFiltr.js', [
|
|
|
|
|
+ 'JS_FUNCTION_NAME' => $jsToogleFiltrProcesuFunctionName,
|
|
|
|
|
+ 'URL_GET_PROCES_INIT_FILTR' => "index-ajax.php?_zasobID={$this->_zasobID}&_cls={$clsName}&_hash={$this->_htmlID}&_task=PROCES_INIT_FILTR",
|
|
|
|
|
+ 'ID_ZASOB' => $this->_zasobID,
|
|
|
|
|
+ ]);
|
|
|
|
|
+ ?>
|
|
|
<script>
|
|
<script>
|
|
|
-
|
|
|
|
|
-var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
|
|
- var defaultsProps = {
|
|
|
|
|
- ico: true,
|
|
|
|
|
- label: false
|
|
|
|
|
- },
|
|
|
|
|
- props = $.extend({}, defaultsProps, props);
|
|
|
|
|
- funcNode = $('<a href="#" style="margin:0 2px;"></a>')
|
|
|
|
|
- ;
|
|
|
|
|
- if ('href' in funObj) funcNode.attr('href', p5Utils__format(funObj.href, [rowPK]));
|
|
|
|
|
- if (props.ico) {
|
|
|
|
|
- if ('ico' in funObj) funcNode.append('<span class="' + funObj.ico + '"></span>');
|
|
|
|
|
- }
|
|
|
|
|
- if ('onclick' in funObj) funcNode.attr('onclick', p5Utils__format(funObj.onclick, [rowPK]));
|
|
|
|
|
- if ('title' in funObj) funcNode.attr('title', funObj.title);
|
|
|
|
|
- if ('target' in funObj) funcNode.attr('target', funObj.target);
|
|
|
|
|
-
|
|
|
|
|
- if (props.label) {
|
|
|
|
|
- if ('label' in funObj) {
|
|
|
|
|
- funcNode.append(' ' + funObj.label);
|
|
|
|
|
- } else if ('title' in funObj) {
|
|
|
|
|
- funcNode.append(' ' + funObj.title);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- return funcNode;
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-(function($) {
|
|
|
|
|
- var TableAjaxGeomField = function() {
|
|
|
|
|
- var priv = {}; //private api
|
|
|
|
|
- var publ = {}; //public api
|
|
|
|
|
-
|
|
|
|
|
- priv.options = {};
|
|
|
|
|
- var defaults = {
|
|
|
|
|
- recordID: '',
|
|
|
|
|
- fieldValue: '',
|
|
|
|
|
- hasValueClassName: 'TableAjaxGeomField-hasValue',
|
|
|
|
|
- linkClassNamePrefix: 'TableAjaxGeomField',
|
|
|
|
|
- linkSelectClassName: 'select',
|
|
|
|
|
- linkSelectAddClassNames: '', // 'glyphicon glyphicon-map-marker'
|
|
|
|
|
- linkRemoveClassName: 'remove',
|
|
|
|
|
- linkRemoveAddClassNames: '', // 'glyphicon glyphicon-remove'
|
|
|
|
|
- removeUrl: '',
|
|
|
|
|
- onSelect: null,
|
|
|
|
|
- onRemove: null,
|
|
|
|
|
- debug: false
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- priv.init = function() {
|
|
|
|
|
- priv.render();
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- priv.render = function() {
|
|
|
|
|
- var state = priv.options;
|
|
|
|
|
- var cellMapSelect = jQuery('<i title="Pokaż/utwórz obiekt na mapie"></i>');
|
|
|
|
|
- cellMapSelect.addClass(state.linkClassNamePrefix + '-' + state.linkSelectClassName);
|
|
|
|
|
- if (state.linkSelectAddClassNames) {
|
|
|
|
|
- cellMapSelect.addClass(state.linkSelectAddClassNames);
|
|
|
|
|
- }
|
|
|
|
|
- cellMapSelect.on('click', {recordID: priv.options.recordID, fieldValue: priv.options.fieldValue}, function(e) {
|
|
|
|
|
- if (typeof state.onSelect == "function") {
|
|
|
|
|
- state.onSelect.call(this, e.data.recordID, e.data.fieldValue);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- var cellMapRemove = jQuery('<i title="Usuń obiekt z mapy"></i>');
|
|
|
|
|
- cellMapRemove.addClass(state.linkClassNamePrefix + '-' + state.linkRemoveClassName);
|
|
|
|
|
- if (state.linkRemoveAddClassNames) {
|
|
|
|
|
- cellMapRemove.addClass(state.linkRemoveAddClassNames);
|
|
|
|
|
- }
|
|
|
|
|
- cellMapRemove.on('click', {recordID: state.recordID, fieldValue: state.fieldValue}, function(e) {
|
|
|
|
|
- if (typeof state.onRemove == "function") {
|
|
|
|
|
- state.onRemove.call(this, publ, e.data.recordID, e.data.fieldValue);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- var node = $(state.id);
|
|
|
|
|
- node.empty();
|
|
|
|
|
- node.addClass(state.linkClassNamePrefix);
|
|
|
|
|
- node.removeClass(state.hasValueClassName);
|
|
|
|
|
- if (state.fieldValue) {
|
|
|
|
|
- node.addClass(state.hasValueClassName);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- node.append(cellMapSelect);
|
|
|
|
|
- node.append(cellMapRemove);
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- publ.setValue = function(value) {
|
|
|
|
|
- if (priv.options.debug) console.log('TEST setValue: ', value, 'this', this);
|
|
|
|
|
- priv.options.fieldValue = value;
|
|
|
|
|
- priv.render();
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- publ.init = function(options) {
|
|
|
|
|
- if (priv.options.debug) console.log('TableAjaxGeomField initialization...', options);
|
|
|
|
|
- //merge supplied options with defaults
|
|
|
|
|
- $.extend(priv.options, defaults, options);
|
|
|
|
|
- priv.init();
|
|
|
|
|
- return publ;
|
|
|
|
|
- };
|
|
|
|
|
- return publ;
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- $.fn.TableAjaxGeomFieldSetValue = function(value) {
|
|
|
|
|
- return this.each(function() {
|
|
|
|
|
- var tblAjaxMapGeomFld = $(this).data('TableAjaxGeomField');
|
|
|
|
|
- if (tblAjaxMapGeomFld) {
|
|
|
|
|
- tblAjaxMapGeomFld.setValue(value);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- return this;
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- $.fn.TableAjaxGeomField = function(options) {
|
|
|
|
|
- options = options || {};
|
|
|
|
|
- return this.each(function() {
|
|
|
|
|
- options.id = this;
|
|
|
|
|
- if (!$(this).data('TableAjaxGeomField')) {
|
|
|
|
|
- $(this).data('TableAjaxGeomField', new TableAjaxGeomField().init(options));
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- return this;
|
|
|
|
|
- };
|
|
|
|
|
-}(jQuery));
|
|
|
|
|
-
|
|
|
|
|
(function($, undefined) {
|
|
(function($, undefined) {
|
|
|
var TableAjax = function() {
|
|
var TableAjax = function() {
|
|
|
var priv = {}; //private api
|
|
var priv = {}; //private api
|
|
@@ -781,7 +662,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
/// console.log('renderTable:: _uiNode$Table', _uiNode$Table);//TODO:DBG:RMME
|
|
/// console.log('renderTable:: _uiNode$Table', _uiNode$Table);//TODO:DBG:RMME
|
|
|
|
|
|
|
|
//create the header which will later hold both sorting and filtering
|
|
//create the header which will later hold both sorting and filtering
|
|
|
- /// console.log('L.<?php echo __LINE__; ?> renderTable:: _head', _head);//TODO:DBG:RMME
|
|
|
|
|
|
|
+ /// console.log('renderTable:: _head', _head);//TODO:DBG:RMME
|
|
|
if (!_head) {
|
|
if (!_head) {
|
|
|
_headSort = _headFilter = _headSpecialFilter = undefined;
|
|
_headSort = _headFilter = _headSpecialFilter = undefined;
|
|
|
//_head = $('<thead></thead>');
|
|
//_head = $('<thead></thead>');
|
|
@@ -792,13 +673,13 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
|
|
|
|
|
//create the header sorting row
|
|
//create the header sorting row
|
|
|
if (!_headSort) {
|
|
if (!_headSort) {
|
|
|
- /// console.log('L.<?php echo __LINE__; ?> renderTable::renderTableTheadSort...');//TODO:DBG:RMME
|
|
|
|
|
|
|
+ /// console.log('renderTable::renderTableTheadSort...');//TODO:DBG:RMME
|
|
|
priv.renderTableTheadSort();
|
|
priv.renderTableTheadSort();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//create the header filtering row
|
|
//create the header filtering row
|
|
|
if (!_headFilter && priv.options.filter) {
|
|
if (!_headFilter && priv.options.filter) {
|
|
|
- /// console.log('L.<?php echo __LINE__; ?> renderTable::renderTableTheadFilter...');//TODO:DBG:RMME
|
|
|
|
|
|
|
+ /// console.log('renderTable::renderTableTheadFilter...');//TODO:DBG:RMME
|
|
|
priv.renderTableTheadFilter();
|
|
priv.renderTableTheadFilter();
|
|
|
_headFilter = true;
|
|
_headFilter = true;
|
|
|
}
|
|
}
|
|
@@ -883,7 +764,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
if (_data.total == 0 && priv.options.hidePagerOnEmpty) {
|
|
if (_data.total == 0 && priv.options.hidePagerOnEmpty) {
|
|
|
$('.btn-toolbar', _foot).remove();
|
|
$('.btn-toolbar', _foot).remove();
|
|
|
}
|
|
}
|
|
|
- if (priv.options.debug) console.log('table created L.<?php echo __LINE__; ?>');
|
|
|
|
|
|
|
+ if (priv.options.debug) console.log('table created');
|
|
|
if (typeof priv.options.tableCreated == 'function') {
|
|
if (typeof priv.options.tableCreated == 'function') {
|
|
|
priv.options.tableCreated.call(_uiNode$Table.get(0), {table: _uiNode$Table.get(0)});
|
|
priv.options.tableCreated.call(_uiNode$Table.get(0), {table: _uiNode$Table.get(0)});
|
|
|
}
|
|
}
|
|
@@ -1076,7 +957,6 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
recordID: fieldPK,
|
|
recordID: fieldPK,
|
|
|
fieldValue: val,
|
|
fieldValue: val,
|
|
|
hasValueClassName: 'cell-mapfld-hasValue',
|
|
hasValueClassName: 'cell-mapfld-hasValue',
|
|
|
- //removeUrl: 'index-ajax.php?_zasobID=<?php echo $this->_zasobID; ?>&_cls=<?php echo __CLASS__; ?>&_hash=<?php echo $this->_htmlID; ?>&_task=THE_GEOM_REMOVE&ID=' + rowPK,
|
|
|
|
|
linkClassNamePrefix: 'cell-mapfld',
|
|
linkClassNamePrefix: 'cell-mapfld',
|
|
|
linkSelectClassName: 'select',
|
|
linkSelectClassName: 'select',
|
|
|
linkSelectAddClassNames: 'glyphicon glyphicon-map-marker',
|
|
linkSelectAddClassNames: 'glyphicon glyphicon-map-marker',
|
|
@@ -2883,7 +2763,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
},
|
|
},
|
|
|
credentials: 'same-origin',// add cookies
|
|
credentials: 'same-origin',// add cookies
|
|
|
body: JSON.stringify({
|
|
body: JSON.stringify({
|
|
|
- namespace: '<?= $acl->getNamespace(); ?>',
|
|
|
|
|
|
|
+ namespace: priv.options.namespace,
|
|
|
})
|
|
})
|
|
|
}).then(function (response) {
|
|
}).then(function (response) {
|
|
|
return response.json()
|
|
return response.json()
|
|
@@ -3689,7 +3569,7 @@ jQuery(document).ready(function(){
|
|
|
jQuery('#<?php echo $this->_htmlID; ?>').TableAjax({
|
|
jQuery('#<?php echo $this->_htmlID; ?>').TableAjax({
|
|
|
namespace: '<?= $acl->getNamespace(); ?>',
|
|
namespace: '<?= $acl->getNamespace(); ?>',
|
|
|
url: '<?= $this->syncUrl; ?>&_hash=<?= $this->_htmlID; ?>&_task=loadDataAjax',// priv.options.url
|
|
url: '<?= $this->syncUrl; ?>&_hash=<?= $this->_htmlID; ?>&_task=loadDataAjax',// priv.options.url
|
|
|
- userTableFilterUrl: '<?= ($this->_useUserTableFilter) ? $this->_useUserTableFilter : ''; ?>',
|
|
|
|
|
|
|
+ userTableFilterUrl: '<?= ($this->useUserTableFilter) ? $this->useUserTableFilter : ''; ?>',
|
|
|
columnPicker: true,
|
|
columnPicker: true,
|
|
|
filter: true,
|
|
filter: true,
|
|
|
filterInit: <?php echo json_encode($filterInit); ?>,
|
|
filterInit: <?php echo json_encode($filterInit); ?>,
|
|
@@ -4011,112 +3891,6 @@ function hidePopover() {
|
|
|
}
|
|
}
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-function <?php echo $jsToogleFiltrProcesuFunctionName; ?>(n) {
|
|
|
|
|
- var $n = jQuery(n);
|
|
|
|
|
- var $ul = $n.next();
|
|
|
|
|
- if ($n.data('fetched')) return false;
|
|
|
|
|
-
|
|
|
|
|
- function parseProcesInitData(pInitData) {
|
|
|
|
|
- var procesInitMapHtml = '';
|
|
|
|
|
- if (!pInitData) {
|
|
|
|
|
- return '<li><a href="#">' + "Brak danych" + '</a></li>';
|
|
|
|
|
- } else {
|
|
|
|
|
- function _viewProcesInitListItem(pInitId, gotoIds, pInitList) {
|
|
|
|
|
- var label = pInitList[pInitId];
|
|
|
|
|
- var jsInfo = "window.open('procesy5.php?task=PROCES_VIEW_LIST&id_proces=" + pInitId + "&HIDE_PANEL=0&show_big_img=1&group_stanowiska=1');return false;";
|
|
|
|
|
- var out = '<a href="index.php?FUNCTION_INIT=MENU_SELECT_PROCES&_action=setPermsByProces&id_proces=' + pInitId + '&MENU_INIT=VIEWTABLE_AJAX&ZASOB_ID=<?php echo $this->_zasobID; ?>" title="' + "{" + pInitId + "} " + label + '">';// TODO: change to _route=ViewTableAjax&typeName=p5_default_db:{tblName}
|
|
|
|
|
- out += ' <i class="glyphicon glyphicon-info-sign"';
|
|
|
|
|
- out += ' onclick="' + jsInfo + '"';
|
|
|
|
|
- out += ' style="color:#aaa;"';
|
|
|
|
|
- out += ' onmouseover="' + "this.style.color='#337AB7'" + '"';
|
|
|
|
|
- out += ' onmouseout="' + "this.style.color='#aaa'" + '"></i>';
|
|
|
|
|
- out += " {" + pInitId + "} " + label;
|
|
|
|
|
- out += '</a>';
|
|
|
|
|
- return out;
|
|
|
|
|
- }
|
|
|
|
|
- function _viewProcesGotoAndRetListItem(gotoId, pInitList) {
|
|
|
|
|
- var label = pInitList[gotoId];
|
|
|
|
|
- var jsInfo = "window.open('procesy5.php?task=PROCES_VIEW_LIST&id_proces=" + gotoId + "&HIDE_PANEL=0&show_big_img=1&group_stanowiska=1');return false;";
|
|
|
|
|
- var out = '';
|
|
|
|
|
- out += '<a href="index.php?FUNCTION_INIT=MENU_SELECT_PROCES&_action=setPermsByProces&id_proces=' + gotoId + '&MENU_INIT=VIEWTABLE_AJAX&ZASOB_ID=<?php echo $this->_zasobID; ?>" title="' + "{" + gotoId + "} " + label + '">';// TODO: change to _route=ViewTableAjax&typeName=p5_default_db:{tblName}
|
|
|
|
|
- out += ' <span style="padding:10px;"></span>';
|
|
|
|
|
- out += ' <i class="glyphicon glyphicon-arrow-right" style="color:#aaa"></i>';
|
|
|
|
|
- out += ' <i class="glyphicon glyphicon-info-sign"';
|
|
|
|
|
- out += ' onclick="' + jsInfo + '"';
|
|
|
|
|
- out += ' style="color:#aaa;"';
|
|
|
|
|
- out += ' onmouseover="' + "this.style.color='#337AB7'" + '"';
|
|
|
|
|
- out += ' onmouseout="' + "this.style.color='#aaa'" + '"></i>';
|
|
|
|
|
- out += " {" + gotoId + "} " + label;
|
|
|
|
|
- out += '</a>';
|
|
|
|
|
- return out;
|
|
|
|
|
- }
|
|
|
|
|
- function _viewProcesGotoAndRetLvl2ListItem(gotoLvl2Id, pInitList) {
|
|
|
|
|
- var label = pInitList[gotoLvl2Id];
|
|
|
|
|
- var jsInfo = "window.open('procesy5.php?task=PROCES_VIEW_LIST&id_proces=" + gotoLvl2Id + "&HIDE_PANEL=0&show_big_img=1&group_stanowiska=1');return false;";
|
|
|
|
|
- var out = '';
|
|
|
|
|
- out += '<a href="index.php?FUNCTION_INIT=MENU_SELECT_PROCES&_action=setPermsByProces&id_proces=' + gotoLvl2Id + '&MENU_INIT=VIEWTABLE_AJAX&ZASOB_ID=<?php echo $this->_zasobID; ?>" title="' + "{" + gotoLvl2Id + "} " + label + '">';// TODO: change to _route=ViewTableAjax&typeName=p5_default_db:{tblName}
|
|
|
|
|
- out += ' <span style="padding:20px;"></span>';
|
|
|
|
|
- out += ' <i class="glyphicon glyphicon-arrow-right" style="color:#aaa"></i>';
|
|
|
|
|
- out += ' <i class="glyphicon glyphicon-info-sign"';
|
|
|
|
|
- out += ' onclick="' + jsInfo + '"';
|
|
|
|
|
- out += ' style="color:#aaa;"';
|
|
|
|
|
- out += ' onmouseover="' + "this.style.color='#337AB7'" + '"';
|
|
|
|
|
- out += ' onmouseout="' + "this.style.color='#aaa'" + '"></i>';
|
|
|
|
|
- out += " {" + gotoLvl2Id + "} " + label;
|
|
|
|
|
- out += '</a>';
|
|
|
|
|
- return out;
|
|
|
|
|
- }
|
|
|
|
|
- var sel = '',
|
|
|
|
|
- liStyle = "white-space:nowrap; overflow:hidden; max-width:500px; /* text-overflow:ellipsis; */";
|
|
|
|
|
- $.map(pInitData.mapTree, function(gotoIds, vInitId) {
|
|
|
|
|
- sel = (pInitData.pInitListSelected && pInitData.pInitListSelected == vInitId)? ' class="disabled"' : '';
|
|
|
|
|
- procesInitMapHtml += '<li' + sel + ' style="' + liStyle + '">';
|
|
|
|
|
- procesInitMapHtml += _viewProcesInitListItem(vInitId, gotoIds, pInitData.pInitList);
|
|
|
|
|
- procesInitMapHtml += '</li>' + "\n";
|
|
|
|
|
- $.map(gotoIds, function(gotoLvl2Ids, gotoId) {
|
|
|
|
|
- sel = (pInitData.pInitListSelected && pInitData.pInitListSelected == vInitId)? ' class="disabled"' : '';
|
|
|
|
|
- procesInitMapHtml += '<li' + sel + ' style="' + liStyle + '">';
|
|
|
|
|
- procesInitMapHtml += _viewProcesGotoAndRetListItem(gotoId, pInitData.pInitList);
|
|
|
|
|
- procesInitMapHtml += '</li>' + "\n";
|
|
|
|
|
- $.map(gotoLvl2Ids, function(vBool, gotoLvl2Id) {
|
|
|
|
|
- sel = (pInitData.pInitListSelected && pInitData.pInitListSelected == vInitId)? ' class="disabled"' : '';
|
|
|
|
|
- procesInitMapHtml += '<li' + sel + ' style="' + liStyle + '">';
|
|
|
|
|
- procesInitMapHtml += _viewProcesGotoAndRetLvl2ListItem(gotoLvl2Id, pInitData.pInitList);
|
|
|
|
|
- procesInitMapHtml += '</li>' + "\n";
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- return procesInitMapHtml;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- jQuery.ajax({
|
|
|
|
|
- data: null,
|
|
|
|
|
- dataType: 'json',
|
|
|
|
|
- type: "GET",
|
|
|
|
|
- async: true,
|
|
|
|
|
- url: 'index-ajax.php?_zasobID=<?php echo $this->_zasobID; ?>&_cls=<?php echo __CLASS__; ?>&_hash=<?php echo $this->_htmlID; ?>&_task=PROCES_INIT_FILTR',
|
|
|
|
|
- })
|
|
|
|
|
- .always(function(data, textStatus, jqXHR) {
|
|
|
|
|
- var type = data.type || null,
|
|
|
|
|
- msg = data.msg || "Error",
|
|
|
|
|
- pInitData = data.pInitData || null;
|
|
|
|
|
- if (type) {
|
|
|
|
|
- if ('success' == type) {
|
|
|
|
|
- $ul.html(parseProcesInitData(pInitData));
|
|
|
|
|
- } else if ('error' == type) {
|
|
|
|
|
- $ul.html('<li><a href="#">' + msg + '</a></li>');
|
|
|
|
|
- } else {
|
|
|
|
|
- $ul.html('<li><a href="#">Wystapił błąd podczas pobierania listy procesów</a></li>');
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- $ul.html('<li><a href="#">Wystapił błąd podczas pobierania listy procesów</a></li>');
|
|
|
|
|
- }
|
|
|
|
|
- $n.data('fetched', true);
|
|
|
|
|
- });
|
|
|
|
|
- return false;
|
|
|
|
|
-}
|
|
|
|
|
</script>
|
|
</script>
|
|
|
<?php
|
|
<?php
|
|
|
UI::inlineJS(__FILE__ . '.upload.js', [
|
|
UI::inlineJS(__FILE__ . '.upload.js', [
|
|
@@ -5462,7 +5236,6 @@ jQuery(document).ready(function(){
|
|
|
UI::h('div', [
|
|
UI::h('div', [
|
|
|
'id' => "FILES_MULTIPLE_UPLOAD_{$this->_htmlID}",
|
|
'id' => "FILES_MULTIPLE_UPLOAD_{$this->_htmlID}",
|
|
|
'style' => "width:86%; margin:10px auto; padding:40px 100px; background-color:#eee; border-radius:4px; text-align:center",
|
|
'style' => "width:86%; margin:10px auto; padding:40px 100px; background-color:#eee; border-radius:4px; text-align:center",
|
|
|
- // 'ondrop' => "p5TA_onDrop(event, '{$id}', '{$namespace}')",
|
|
|
|
|
'ondrop' => "p5TAFiles_onDropMultiple(event, this, '{$id}', '{$namespace}')",
|
|
'ondrop' => "p5TAFiles_onDropMultiple(event, this, '{$id}', '{$namespace}')",
|
|
|
'ondragover' => "p5TAFiles_onDragOverMultiple(event, this)", // "event.preventDefault(); this.style.backgroundColor='#D9EDF7'",
|
|
'ondragover' => "p5TAFiles_onDragOverMultiple(event, this)", // "event.preventDefault(); this.style.backgroundColor='#D9EDF7'",
|
|
|
'ondragleave' => "p5TAFiles_onDragLeaveMultiple(event, this)", // "event.preventDefault(); this.style.backgroundColor='#eee'",
|
|
'ondragleave' => "p5TAFiles_onDragLeaveMultiple(event, this)", // "event.preventDefault(); this.style.backgroundColor='#eee'",
|
|
@@ -6150,18 +5923,15 @@ jQuery(document).ready(function(){
|
|
|
$response = new stdClass();
|
|
$response = new stdClass();
|
|
|
|
|
|
|
|
$pInitList = array();// [proces_init_id] => label (DESC)
|
|
$pInitList = array();// [proces_init_id] => label (DESC)
|
|
|
- if (!$this->_showProcesInit) {
|
|
|
|
|
- $response->type = 'error';
|
|
|
|
|
- return $response;
|
|
|
|
|
- }
|
|
|
|
|
$userAcl = User::getAcl();
|
|
$userAcl = User::getAcl();
|
|
|
$pInitList = $userAcl->getTableProcesInitList($this->_zasobID);
|
|
$pInitList = $userAcl->getTableProcesInitList($this->_zasobID);
|
|
|
|
|
|
|
|
|
|
+ DBG::log($pInitList, 'array', "\$pInitList");
|
|
|
if (!empty($pInitList)) {
|
|
if (!empty($pInitList)) {
|
|
|
$procesIds = array_keys($pInitList);
|
|
$procesIds = array_keys($pInitList);
|
|
|
$mapTree = ACL::getProcesInitMapTreeOnlyIds($procesIds);
|
|
$mapTree = ACL::getProcesInitMapTreeOnlyIds($procesIds);
|
|
|
- DBG::_('DBG_MAP', '1', "mapTree", $mapTree, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
|
|
- DBG::_('DBG_MAP', '1', "pInitList", $pInitList, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
|
|
|
|
+ DBG::log($mapTree, 'array', "\$mapTree");
|
|
|
|
|
+ DBG::log($pInitList, 'array', "\$pInitList");
|
|
|
$pInitListSelected = $this->getProcesInitSelected();
|
|
$pInitListSelected = $this->getProcesInitSelected();
|
|
|
$response->pInitData = new stdClass();
|
|
$response->pInitData = new stdClass();
|
|
|
$response->pInitData->pInitList = $pInitList;
|
|
$response->pInitData->pInitList = $pInitList;
|