|
|
@@ -234,15 +234,6 @@ class TableAjax extends ViewAjax {
|
|
|
}
|
|
|
|
|
|
public function render() {
|
|
|
- {
|
|
|
- $pInitList = $this->_fetchConnectedProcesInitList();
|
|
|
- $userAcl = User::getAcl();
|
|
|
- $procesIds = array_keys($pInitList);
|
|
|
- $mapTree = $userAcl->getProcesInitMapTreeOnlyIds($procesIds);
|
|
|
- DBG::_('DBG_MAP', '1', "mapTree", $mapTree, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
- DBG::_('DBG_MAP', '1', "pInitList", $pInitList, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
- $pInitListSelected = $this->getProcesInitSelected();
|
|
|
- }
|
|
|
$hasGeomFlds = $this->hasGeomFields();
|
|
|
|
|
|
$tblAjaxMap = null;
|
|
|
@@ -250,6 +241,7 @@ class TableAjax extends ViewAjax {
|
|
|
$tblAjaxMap = new TableAjaxMap($this->_acl, 512, 400);
|
|
|
}
|
|
|
|
|
|
+ $jsToogleFiltrProcesuFunctionName = 'tableAjaxToggleFiltrProcesInit';
|
|
|
ob_start();
|
|
|
?>
|
|
|
|
|
|
@@ -393,44 +385,18 @@ class TableAjax extends ViewAjax {
|
|
|
<div class="AjaxTableCont">
|
|
|
<ul class="breadcrumb">
|
|
|
<li><a href="#" onclick="return tableAjaxBackToTable();"><?php echo $this->getLabelHtml(); ?></a></li>
|
|
|
- <?php if (!empty($pInitList)) : ?>
|
|
|
- <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(); ?>">
|
|
|
- Filtr procesu
|
|
|
- <span class="caret"></span>
|
|
|
- </a>
|
|
|
- <ul class="dropdown-menu pull-left">
|
|
|
- <?php $liStyle = "white-space:nowrap; overflow:hidden; max-width:500px; /* text-overflow:ellipsis; */"; ?>
|
|
|
- <?php foreach ($mapTree as $vInitId => $gotoIds) : ?>
|
|
|
- <?php if ($pInitListSelected && $pInitListSelected == $vInitId) : ?>
|
|
|
- <li class="disabled" style="<?php echo $liStyle; ?>">
|
|
|
- <?php else : ?>
|
|
|
- <li style="<?php echo $liStyle; ?>">
|
|
|
- <?php endif; ?>
|
|
|
- <?php $this->_viewProcesInitListItem($vInitId, $gotoIds, $pInitList); ?>
|
|
|
- </li>
|
|
|
- <?php foreach ($gotoIds as $vGotoId => $gotoLvl2Ids) : ?>
|
|
|
- <?php if ($pInitListSelected && $pInitListSelected == $vGotoId) : ?>
|
|
|
- <li class="disabled" style="<?php echo $liStyle; ?>">
|
|
|
- <?php else : ?>
|
|
|
- <li style="<?php echo $liStyle; ?>">
|
|
|
- <?php endif; ?>
|
|
|
- <?php $this->_viewProcesGotoAndRetListItem($vGotoId, $pInitList); ?>
|
|
|
- </li>
|
|
|
- <?php foreach ($gotoLvl2Ids as $vGotoLvl2Id => $vBool) : ?>
|
|
|
- <?php if ($pInitListSelected && $pInitListSelected == $vGotoLvl2Id) : ?>
|
|
|
- <li class="disabled" style="<?php echo $liStyle; ?>">
|
|
|
- <?php else : ?>
|
|
|
- <li style="<?php echo $liStyle; ?>">
|
|
|
- <?php endif; ?>
|
|
|
- <?php $this->_viewProcesGotoAndRetLvl2ListItem($vGotoLvl2Id, $pInitList); ?>
|
|
|
- </li>
|
|
|
- <?php endforeach; ?>
|
|
|
- <?php endforeach; ?>
|
|
|
- <?php endforeach; ?>
|
|
|
- </ul>
|
|
|
- </div>
|
|
|
- <?php endif; ?>
|
|
|
+ <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">
|
|
|
+ <li class="disabled"><a href="#" onclick="return false;"> loading ... </a></li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
<?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>
|
|
|
<?php elseif ($this->allowTreeView()) : ?>
|
|
|
@@ -2951,6 +2917,112 @@ function hidePopover() {
|
|
|
}
|
|
|
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 + '">';
|
|
|
+ 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 + '">';
|
|
|
+ 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 + '">';
|
|
|
+ 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>
|
|
|
<?php
|
|
|
$out = ob_get_contents();
|
|
|
@@ -3142,6 +3214,10 @@ function hidePopover() {
|
|
|
$this->sendAjaxResponseJson('ajaxTheGeomRemove', $_REQUEST);
|
|
|
break;
|
|
|
}
|
|
|
+ case 'PROCES_INIT_FILTR': {
|
|
|
+ $this->sendAjaxResponseJson('ajaxProcesInitFiltr', $_REQUEST);
|
|
|
+ break;
|
|
|
+ }
|
|
|
default:
|
|
|
$this->sendAjaxResponseJson('ajaxData', $_REQUEST);
|
|
|
}
|
|
|
@@ -5310,4 +5386,24 @@ jQuery(document).ready(function(){
|
|
|
return $response;
|
|
|
}
|
|
|
|
|
|
+ private function ajaxProcesInitFiltr($args) {// ajax task 'PROCES_INIT_FILTR'
|
|
|
+ $response = new stdClass();
|
|
|
+
|
|
|
+ $pInitList = $this->_fetchConnectedProcesInitList();
|
|
|
+ $userAcl = User::getAcl();
|
|
|
+ $procesIds = array_keys($pInitList);
|
|
|
+ $mapTree = $userAcl->getProcesInitMapTreeOnlyIds($procesIds);
|
|
|
+ DBG::_('DBG_MAP', '1', "mapTree", $mapTree, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
+ DBG::_('DBG_MAP', '1', "pInitList", $pInitList, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
+ $pInitListSelected = $this->getProcesInitSelected();
|
|
|
+
|
|
|
+ $response->type = 'success';
|
|
|
+ $response->pInitData = new stdClass();
|
|
|
+ $response->pInitData->pInitList = $pInitList;
|
|
|
+ $response->pInitData->mapTree = $mapTree;
|
|
|
+ $response->pInitData->pInitListSelected = $pInitListSelected;
|
|
|
+
|
|
|
+ return $response;
|
|
|
+ }
|
|
|
+
|
|
|
}
|