_tbl = $tblAcl->getName(); $this->_acl = $tblAcl; $this->_zasobID = $tblAcl->getID(); $this->_pageSize = 10; { UserProfile::load(); $tableAjaxSettings = UserProfile::getTableAjaxSettings(); $this->_pageSize = V::get('pageSize', 10, $tableAjaxSettings, 'int'); } $this->_pageSizes = array(10, 20, 50, 100);// default page sizes $this->_filterInit = new stdClass(); $hash = V::get('_hash', '', $_GET); if ($hash) { $this->_htmlID = $hash; $this->_readState(); } else { $this->_htmlID = $this->generateHtmlID(); $this->_readState(); } } 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]) && !empty((array)$_SESSION['TableAjax_Cache'][$this->_htmlID]['_filterInit']) ); } // TODO: read state from cache by key $this->_htmlID // TODO: load filters and state: table, edit, add, etc. // TODO: save this data in Workspace 1, 2, 3, etc. // TODO: default filters in VIEWTABLE_AJAX // $tbl->setLabel($zasobObj->OPIS); // $tbl->setFilterInit($filterInit); // $tbl->addRowFunction('edit'); // $tbl->addRowFunction('hist'); // $tbl->addRowFunction('files'); // $tbl->addRowFunction('cp'); private function _readState() { if (!array_key_exists('TableAjax_Cache', $_SESSION)) { $_SESSION['TableAjax_Cache'] = array(); } //trigger_error("F." . __FUNCTION__ . " (" . (array_key_exists($this->_htmlID, $_SESSION['TableAjax_Cache'])) . ")", E_USER_NOTICE); //trigger_error("F." . __FUNCTION__ . " (".basename($_SERVER['SCRIPT_FILENAME'])."::_filterInit: " . json_encode($_SESSION['TableAjax_Cache'][$this->_htmlID]['_filterInit']) . ")", E_USER_NOTICE); if (array_key_exists($this->_htmlID, $_SESSION['TableAjax_Cache'])) { foreach ($_SESSION['TableAjax_Cache'][$this->_htmlID] as $k => $v) { //trigger_error("F." . __FUNCTION__ . " key: ({$k})", E_USER_NOTICE); switch ($k) { case '_label': $this->_label = $v; break; case '_filterInit': // DBG::log([ '$this->_filterInit' => $this->_filterInit ], 'array', "TODO:BUG?:filters"); $this->_filterInit = $v; break; case '_rowFunctions': $this->_rowFunctions = $v; break; default: } } } } protected function _saveState($key = null) { if (!array_key_exists('TableAjax_Cache', $_SESSION)) { $_SESSION['TableAjax_Cache'] = array(); } if (!array_key_exists($this->_htmlID, $_SESSION['TableAjax_Cache'])) { $_SESSION['TableAjax_Cache'][$this->_htmlID] = array(); } if (!$key) { $_SESSION['TableAjax_Cache'][$this->_htmlID]['_label'] = $this->_label; $_SESSION['TableAjax_Cache'][$this->_htmlID]['_filterInit'] = $this->_filterInit; $_SESSION['TableAjax_Cache'][$this->_htmlID]['_rowFunctions'] = $this->_rowFunctions; } else if ($key == '_label') { $_SESSION['TableAjax_Cache'][$this->_htmlID]['_label'] = $this->_label; } else if ($key == '_filterInit') { $_SESSION['TableAjax_Cache'][$this->_htmlID]['_filterInit'] = $this->_filterInit; } else if ($key == '_rowFunctions') { $_SESSION['TableAjax_Cache'][$this->_htmlID]['_rowFunctions'] = $this->_rowFunctions; } } public function setPageSizes($pageSizes) { $this->_pageSizes = $pageSizes; } public function setBackRefFilter($backRefFilter) { $this->_backRefFilter = $backRefFilter; } public function setChildRefFilter($childRefFilter) { $this->_childRefFilter = $childRefFilter; } public function setFilterInit($filterInit) { // DBG::log([ '$this->_filterInit' => $this->_filterInit, 'hasFiltersInit' => $this->_hasStateFilterInit() ], 'array', "TODO:BUG?:filters - setFilterInit"); if ($this->_hasStateFilterInit()) { return; } $this->_filterInit = (object)$filterInit; $this->_saveState(); } /** * @param array $forceFilterInit */ public function setForceFilterInit($forceFilterInit) { $this->_forceFilterInit = (object)$forceFilterInit; } private function setFilters($filterInit) { $this->_filterInit = (object)$filterInit; // DBG::log([ '$this->_filterInit' => $this->_filterInit ], 'array', "TODO:BUG?:filters - setFilters"); $this->_saveState(); } function getFilters() { return (array)$this->_filterInit; } public function setRowFunctions($functions) { $this->_rowFunctions = []; $defaultRowFunction = array(); $defaultRowFunction['edit'] = [ 'href'=>'#EDIT/{0}', 'ico'=>'glyphicon glyphicon-pencil', 'title'=>'Edytuj rekord', 'class' => "btn btn-xs btn-link" ]; $defaultRowFunction['hist'] = [ 'href'=>'#HIST/{0}', 'ico'=>'glyphicon glyphicon-book', 'title'=>'Historia', 'class' => "btn btn-xs btn-link" ]; $defaultRowFunction['files'] = [ 'href'=>'#FILES/{0}', 'ico'=>'glyphicon glyphicon-folder-open', 'title'=>'Pliki', 'class' => "btn btn-xs btn-link" ]; $defaultRowFunction['cp'] = [ 'href'=>'#', 'ico'=>'glyphicon glyphicon-plus-sign', 'title'=>'Kopiuj rekord', 'onclick'=>'return tableAjaxCopy({0});', 'class' => "btn btn-xs btn-link" ]; $defaultRowFunction['msgs'] = [ 'href'=>"index.php?_route=TableMsgs&_task=tableRow&idTable={$this->_zasobID}&idRow={0}", 'ico'=>'glyphicon glyphicon-envelope', 'title'=>'Wiadomości', 'class' => "btn btn-xs btn-link" ]; foreach ($functions as $funName => $params) { if (true === $params) { if (array_key_exists($funName, $defaultRowFunction)) { $this->_rowFunctions[$funName] = $defaultRowFunction[$funName]; } else { throw new Exception("Row function not defined '{$funName}'"); } } if (is_array($params)) { $this->_rowFunctions[$funName] = $params; } } $this->_saveState('_rowFunctions'); } public function addRowFunction($funName, $funParams = array()) { $defaultRowFunction = array(); //$defaultRowFunction['edit'] = ''; //$defaultRowFunction['hist'] = ''; //$defaultRowFunction['files'] = ''; //$defaultRowFunction['cp'] = ''; $defaultRowFunction['edit'] = [ 'href'=>'#EDIT/{0}', 'ico'=>'glyphicon glyphicon-pencil', 'title'=>'Edytuj rekord', 'class' => "btn btn-xs btn-link" ]; $defaultRowFunction['hist'] = [ 'href'=>'#HIST/{0}', 'ico'=>'glyphicon glyphicon-book', 'title'=>'Historia', 'class' => "btn btn-xs btn-link" ]; $defaultRowFunction['files'] = [ 'href'=>'#FILES/{0}', 'ico'=>'glyphicon glyphicon-folder-open', 'title'=>'Pliki', 'class' => "btn btn-xs btn-link" ]; $defaultRowFunction['cp'] = [ 'href'=>'#', 'ico'=>'glyphicon glyphicon-plus-sign', 'title'=>'Kopiuj rekord', 'onclick'=>'return tableAjaxCopy({0});', 'class' => "btn btn-xs btn-link" ]; $defaultRowFunction['msgs'] = [ 'href'=>"index.php?_route=TableMsgs&_task=tableRow&idTable={$this->_zasobID}&idRow={0}", 'ico'=>'glyphicon glyphicon-envelope', 'title'=>'Wiadomości', 'class' => "btn btn-xs btn-link" ]; if (array_key_exists($funName, $defaultRowFunction)) { $this->_rowFunctions[$funName] = $defaultRowFunction[$funName]; } else { $this->_rowFunctions[$funName] = $funParams; } $this->_saveState('_rowFunctions'); } private function _parseRowFunctions($idRecord = null, $pomin = array(), $showLabel = false) { $rowFunctions = array(); foreach ($this->_rowFunctions as $kFunName => $vParams) { if (in_array($kFunName, $pomin)) continue; //$rowFunctionsOut .= str_replace('{0}', $idRecord, $vUrl); $attrs = array(); // $defaultRowFunction['cp'] = (object)array('href'=>'#', 'ico'=>'glyphicon glyphicon-plus-sign', 'title'=>'Kopiuj rekord', 'onclick'=>'return tableAjaxCopy({0});'); $label = ''; $ico = ''; foreach ($vParams as $kParamName => $v) { if ($kParamName == 'ico') { $ico = ''; continue; } $attr = $v; if ($idRecord > 0) { $attr = str_replace('{0}', $idRecord, $attr); } if ($showLabel && $kParamName == 'title') { $label = $attr; } $attr = $kParamName . '="' . $attr . '"'; $attrs[] = $attr; } $rowFunctions[$kFunName] = '' . "{$ico} {$label} " . ''; } return $rowFunctions; } private function _showRowFunctions($idRecord = null, $pomin = array(), $showLabel = false) { $rowFunctionsOut = $this->_parseRowFunctions($idRecord, $pomin, $showLabel); $rowFunctionsOut = implode('', $rowFunctionsOut); return $rowFunctionsOut; } private function _showRowFunctionsJson($idRecord = null, $pomin = array(), $showLabel = false) { $rowFunctions = $this->_parseRowFunctions($idRecord, $pomin, $showLabel); $rowFunctions = (object)$rowFunctions; return $rowFunctions; } public function allowTreeView() { if ($this->_tbl == 'CRM_LISTA_ZASOBOW') return true; if ($this->_tbl == 'CRM_PROCES') return true; return false; } public function renderStatic($tblAjaxMap = null) { static $_rendered = false; if ($_rendered) return; if ($tblAjaxMap) $tblAjaxMap->printCSS(); if ($tblAjaxMap) $tblAjaxMap->printJS(); echo UI::h('script', ['src'=>"static/sweetalert2.min.js"]); echo UI::h('script', ['src'=>"static/jquery.doubleScroll.js"]); echo UI::h('link', ['rel'=>"stylesheet", 'type'=>"text/css", 'href'=>"static/jquery-ui-smoothness/jquery-ui-1.10.4.custom.min.css"]); echo UI::h('link', ['rel'=>"stylesheet", 'type'=>"text/css", 'href'=>"static/sweetalert2.min.css"]); UI::inlineCSS( __FILE__ . '.style.css' ); echo UI::h('script', [ 'src' => "static/vendor.js" ]); // window.p5VendorJs: {React, ReactDOM, createReactClass, Redux} echo UI::h('script', [ 'src' => "static/p5UI/buildDom.js" ]); $_rendered = true; } public function render() { $acl = $this->_acl; $hasGeomFlds = Core_AclHelper::hasGeomFields($acl); // $tblAjaxMap = ($hasGeomFlds) ? new TableAjaxMap($acl, 512, 400) : null; $tblAjaxMap = new TableAjaxMap($acl, 512, 400); $hasPermCreate = Core_AclHelper::hasCreatePerms($acl); $jsToogleFiltrProcesuFunctionName = 'tableAjaxToggleFiltrProcesInit'; $jsToogleTableToolsFunctionName = 'tableAjaxToggleTableTools'; ob_start(); $this->renderStatic($tblAjaxMap); UI::startContainer(); UI::showMessagesForTable($this->_tbl); UI::endContainer(); $namespace = $acl->getNamespace(); { $nsSiblings = ACL::getNamespaceSiblings($namespace); $siblingSelected = $namespace; $baseUrl = Router::getRoute('ViewTableAjax')->getLink(); } echo UI::h('div', [ 'class' => "AjaxTableCont" ], [ UI::h('div', [ 'class' => "AjaxTable--header" ], [ // breadcrumb UI::h('div', [ 'class' => "pull-left", 'style' => "margin-right:12px" ], [ UI::h('a', [ 'href' => "#", 'onclick' => "return tableAjaxBackToTable();", 'class' => "AjaxTable--title", ], $this->getLabelHtml(100) ), ]), ($hasPermCreate) ? UI::h('div', [ 'class' => "btn-group pull-left" ], [ UI::h('a', [ 'title' => "Dodaj nowy rekord", 'class' => "btn btn-xs btn-default", 'href' => "#CREATE" ], [ UI::h('span', [ 'class' => "glyphicon glyphicon-plus" ]), " Dodaj nowy rekord", ]), ]) : '', ($this->showProcesInitFiltr) ? 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 "), 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 ... "), ]), ]), ]) : '', ($this->showTableTools) ? UI::h('div', [ 'class' => "btn-group pull-right" ], [ UI::h('a', [ 'class' => "btn btn-xs btn-default dropdown-toggle", 'style' => "margin-right:16px", 'data-toggle' => "dropdown", 'href' => "#", 'title' => "Narzędzia powiązane z tabelą " . $this->getLabel(), 'onclick' => "return {$jsToogleTableToolsFunctionName}(this);", ], "Narzędzia "), 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 ... "), ]), ]), ]) : '', ($nsSiblings) ? UI::h('div', [ 'class' => "btn-group pull-right" ], [ UI::h('a', [ 'class' => "btn btn-xs btn-default dropdown-toggle", 'style' => "margin-right:16px", 'data-toggle' => "dropdown", 'href' => "#", 'title' => "Powiązane obiekty z " . $this->getLabel(), ], "Obiekty "), UI::h('ul', [ 'class' => "dropdown-menu pull-left", 'style' => "max-height:250px;overflow:auto;" ], array_map(function ($sibling) use ($baseUrl, $siblingSelected) { $siblingLabel = explode('/', $sibling); $siblingLabel = array_pop($siblingLabel); return UI::h('li', [ 'class' => "" ], [ UI::h('a', [ 'href' => "{$baseUrl}&namespace={$sibling}", 'class' => "btn btn-link " . ($siblingSelected === $sibling ? "active" : ""), 'style' => "text-align:left" ], $siblingLabel), ]); }, $nsSiblings)), ]) : '', ($this->_tbl == 'IN7_MK_BAZA_DYSTRYBUCJI') ? UI::h('a', [ 'class' => "pull-right", 'style' => "padding:0 20px 0 0", 'href' => "index.php?MENU_INIT=TREEJS&ZASOB_ID={$this->_zasobID}" ], " Drzewo") : '', ($this->_tbl !== 'IN7_MK_BAZA_DYSTRYBUCJI' && $this->allowTreeView()) ? UI::h('a', [ 'class' => "pull-right", 'style' => "padding:0 20px 0 0", 'href' => "index.php?MENU_INIT=VIEWTREE_AJAX&ZASOB_ID={$this->_zasobID}" ], " Drzewo") : '', ($this->_tbl == 'WMS_MAP_GEOREFERENCES') ? UI::h('a', [ 'class' => "pull-right", 'style' => "padding:0 20px 0 0", 'href' => "index.php?_route=GeoreferencesManager" ], " Zarządzaj punktami") : '', UI::h('div', [ 'style' => "clear:both" ]), ]), ($this->_backRefFilter) ? 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"), ]), ]) : '', ($this->_childRefFilter) ? UI::h('div', [ 'class' => "container" ], [ UI::h('div', [ 'class' => "alert alert-info" ], [ "Rekordy powiązane z rekordem {$this->_childRefFilter['primaryKey']} z ", UI::h('a', [ 'href' => "index.php?_route=ViewTableAjax&namespace={$this->_childRefFilter['namespace']}", ], $this->_childRefFilter['namespace']), " - ", UI::h('a', [ 'href' => $this->rootUrl, 'style' => "color:red", ], "usuń filtr"), ]), ]) : '', UI::h('div', [ 'id' => $this->_htmlID ]), ]); UI::inlineJS(__FILE__ . '.generateFunctionNode.js'); UI::inlineJS(__FILE__ . '.GeomField.js'); if ($this->showProcesInitFiltr) { UI::inlineJS(__FILE__ . '.procesInitFiltr.js', [ 'JS_FUNCTION_NAME' => $jsToogleFiltrProcesuFunctionName, 'URL_GET_PROCES_INIT_FILTR' => $this->showProcesInitFiltr, 'ID_ZASOB' => $this->_zasobID, ]); } if ($this->showTableTools) { UI::inlineJS(__FILE__ . '.tableTools.js', [ 'JS_FUNCTION_NAME' => $jsToogleTableToolsFunctionName, 'URL_GET_TABLE_TOOLS' => $this->showTableTools, ]); } UI::inlineJS(APP_PATH_WWW . '/static/p5UI/FieldCheckboxSearch.js', []); // p5UI__FieldCheckboxSearch UI::inlineCSS(APP_PATH_WWW . '/static/p5UI/FieldCheckboxLoading.css'); UI::inlineJS(APP_PATH_WWW . '/static/p5UI/FieldCheckboxLoading.js', []); // p5UI__FieldCheckboxLoading // echo UI::h('style', [ 'type' => "text/css" ], " // .stickyCol1 { display:none } // "); UI::inlineJS(__FILE__ . '.createTableFiltersStateObject.js', [ 'DBG' => ('1' === V::get('DBG_JS', '', $_GET)), ]); UI::inlineJS(__FILE__ . '.createTableSelectedStateObject.js', [ 'URI_WPS' => Request::getPathUri() . 'wps.php', 'DBG' => ('1' === V::get('DBG_JS', '', $_GET)), ]); UI::inlineJS(__FILE__ . '.createTableDataStateObject.js', [ 'URI_WPS' => Request::getPathUri() . 'wps.php', 'DBG' => ('1' === V::get('DBG_JS', '', $_GET)), ]); UI::inlineJS(__FILE__ . '.p5UI__TableAjax.js', [ 'DBG' => ('1' === V::get('DBG_JS', '', $_GET)), ]); UI::inlineJS(__FILE__ . '.p5UI__TableAjaxSortableLabel.js', [ 'DBG' => ('1' === V::get('DBG_JS', '', $_GET)), ]); UI::inlineJS(__FILE__ . '.p5UI__selected.js', [ 'DBG' => ('1' === V::get('DBG_JS', '', $_GET)), ]); UI::inlineJS(__FILE__ . '.TableAjax.js', [ 'URI_BASE' => Request::getPathUri(), 'URI_WPS' => Request::getPathUri() . 'wps.php', 'RENDER_AS_REACT' => V::get('TEST_RENDER_AS_REACT', '', $_GET), 'SKIP_TOTAL' => true, // TEST: ('1' === V::get('SKIP_TOTAL', '', $_GET)), 'DBG' => ('1' === V::get('DBG_JS', '', $_GET)), ]); $filterInit = $this->_filterInit; $forceFilterInit = $this->_forceFilterInit; $pageSizes = $this->_pageSizes; $pageSize = $this->_pageSize; $rowFunctions = $this->_rowFunctions;//$this->_showRowFunctionsJson(); $exportFields = Core_AclHelper::getExportFieldList($acl); UI::inlineJS(__FILE__ . '.hist.js', [ 'TABLE_AJAX_NODE_ID' => $this->_htmlID, 'TABLE_AJAX_LABEL' => $this->getLabelHtml(), 'URL_HIST_BASE' => "index-ajax.php?_zasobID={$this->_zasobID}&_cls=" . __CLASS__ . "&_hash={$this->_htmlID}&_task=HIST", // &ID=... 'FUNCTION_HIST_ROUTE' => "TableAjax__HIST_Route", ]); UI::inlineJS(__FILE__ . '.create.js', [ 'TABLE_AJAX_NODE_ID' => $this->_htmlID, 'TABLE_AJAX_LABEL' => $this->getLabelHtml(), 'NAMESPACE' => $acl->getNamespace(), 'FIRCE_FILTER_INIT' => $forceFilterInit, 'FUNCTION_CREATE_ROUTE' => "TableAjax__CREATE_Route", 'URL_CREATE_FORM_AJAX' => "{$this->syncUrl}&_hash={$this->_htmlID}&_task=createFormJson", ]); UI::inlineJS(__FILE__ . '.edit.js', [ 'TABLE_AJAX_NODE_ID' => $this->_htmlID, 'TABLE_AJAX_LABEL' => $this->getLabelHtml(), 'NAMESPACE' => $acl->getNamespace(), 'FUNCTION_EDIT_ROUTE' => "TableAjax__EDIT_Route", 'URL_EDIT_FORM_AJAX' => "{$this->syncUrl}&_hash={$this->_htmlID}&_task=editFormJson&_primaryKey=", ]); UI::inlineJS(__FILE__ . '.openRef.js', []); // p5UI__tableAjaxOpenRefCell $specialFilters = (method_exists($acl, 'getSpecialFilters')) ? $acl->getSpecialFilters() : null; $className = __CLASS__; UI::inlineJS(__FILE__ . '.init.js', [ 'GUI_SHOW_CHECKBOXES' => 1, // ('1' === V::get('TEST_CHECKBOX', '', $_GET)), 'CHECKBOX_ID_CONTEXT' => V::get('TEST_CHECKBOX_CONTEXT', '', $_GET), // TODO: test generate @selected context 'TABLE_AJAX_NODE_ID' => $this->_htmlID, 'NAMESPACE' => $acl->getNamespace(), 'FUNCTION_HIST_ROUTE' => 'TableAjax__HIST_Route', 'FUNCTION_EDIT_ROUTE' => 'TableAjax__EDIT_Route', 'URL_LOAD_AJAX_BASE' => $this->syncUrl . '&_hash=' . $this->_htmlID . '&_task=loadDataAjax', 'URL_USER_TABLE_FILTER' => ($this->useUserTableFilter) ? $this->useUserTableFilter : '', 'FILTER_INIT' => $filterInit, 'FIRCE_FILTER_INIT' => $forceFilterInit, 'PAGE_SIZE' => $pageSize, 'PAGE_SIZES' => $pageSizes, 'URL_GET_CSV_THE_GEOM_AJAX' => "{$this->syncUrl}&_hash={$this->_htmlID}&_task=getCsvTheGeomAjax", 'URL_REMOVE_THE_GEOM_AJAX' => "{$this->syncUrl}&_hash={$this->_htmlID}&_task=removeTheGeomAjax", 'URL_MORE_FUNCTIONS_CELL_AJAX' => "{$this->syncUrl}&_hash={$this->_htmlID}&_task=moreFunctionsCellAjax", 'URL_EDIT_INLINE_SAVE' => "index-ajax.php?_zasobID={$this->_zasobID}&_cls={$className}&_hash={$this->_htmlID}&_task=EDIT_INLINE_SAVE", 'URL_THE_GEOM_SAVE' => "index-ajax.php?_zasobID={$this->_zasobID}&_cls={$className}&_hash={$this->_htmlID}&_task=THE_GEOM_SAVE", 'URL_PAGE_SIZE_SAVE' => "index-ajax.php?_zasobID={$this->_zasobID}&_cls={$className}&_hash={$this->_htmlID}&_task=PAGE_SIZE_SAVE", 'URL_HIDDEN_COLS_SAVE' => "index-ajax.php?_zasobID={$this->_zasobID}&_cls={$className}&_hash={$this->_htmlID}&_task=HIDDEN_COLS_SAVE", 'URL_EDIT_INLINE' => "index-ajax.php?_zasobID={$this->_zasobID}&_cls={$className}&_hash={$this->_htmlID}&_task=EDIT_INLINE", 'URL_RECORD_COPY' => "index-ajax.php?_zasobID={$this->_zasobID}&_cls={$className}&_hash={$this->_htmlID}&_task=COPY", 'URL_RECORD_FILES' => "index-ajax.php?_zasobID={$this->_zasobID}&_cls={$className}&_hash={$this->_htmlID}&_task=FILES", 'HAS_ADDITIONAL_LAYERS' => $this->hasAdditionalLayers() ? 1 : 0, 'URL_ADD_USER_TABLE_FILTER_AJAX' => Request::getPathUri() . "index.php?_route=ViewTableAjax&_task=addUserTableFilterAjax", 'URL_RM_USER_TABLE_FILTER_AJAX' => Request::getPathUri() . "index.php?_route=ViewTableAjax&_task=rmUserTableFilterAjax", 'LABEL_HTML' => $this->getLabelHtml(100), 'SPECIAL_FILTER_FUNCTIONS' => (!empty($specialFilters)) ? $specialFilters : false, 'ROW_FUNCTIONS' => $rowFunctions, 'TABLE_FUNCTIONS' => array_merge( [ 'shortdesc' => [ 'icon' => "align-left", 'title' => "Long desc", 'method' => "longTextChanged" ] ], ($hasGeomFlds) ? [ 'mapeditor' => [ 'icon' => "map-marker", 'title' => "Mapa", 'method' => 'mapEditorChanged' ] ] : [], [ 'create' => [ 'href' => '#CREATE', 'icon' => 'plus', 'title' => "Dodaj nowy rekord" ] ], [ 'refresh' => [ 'icon' => 'refresh', 'title' => "Odśwież dane", 'method' => "refresh" ] ] ), 'EXPORT_FIELDS' => $exportFields, ]); UI::inlineJS(__FILE__ . '.upload.js', [ 'URL_UPLOAD_FILES_AJAX' => "index.php?_route=ViewTableAjax&_task=uploadFilesAjax", ]); UI::setTitle($this->_acl->getRawLabel(100) . " - " . UI::getTitle()); return ob_get_clean(); } public function _viewProcesInitListItem($vInitId, $gotoIds, $pInitList) { $vLabel = $pInitList[$vInitId]; $kId = $vInitId; echo UI::h('a', [ 'href' => "index.php?FUNCTION_INIT=MENU_SELECT_PROCES&_action=setPermsByProces&id_proces={$kId}&MENU_INIT=VIEWTABLE_AJAX&ZASOB_ID={$this->_zasobID}", 'title' => htmlspecialchars("{{$kId}} {$vLabel}"), ], [ UI::h('i', [ 'class' => "glyphicon glyphicon-info-sign", 'onclick' => "window.open('procesy5.php?task=PROCES_VIEW_LIST&id_proces={$kId}&HIDE_PANEL=0&show_big_img=1&group_stanowiska=1');return false;", 'style' => "color:#aaa", 'onmouseover' => "this.style.color='#337AB7'", 'onmouseout' => "this.style.color='#aaa'"]), "{{$kId}} {$vLabel}" ]); } public function _viewProcesGotoAndRetListItem($vGotoId, $pInitList) { $vLabel = $pInitList[$vGotoId]; $kId = $vGotoId; // TODO:?: prevent to execute procedure echo UI::h('a', [ 'href' => "index.php?FUNCTION_INIT=MENU_SELECT_PROCES&_action=setPermsByProces&id_proces={$kId}&MENU_INIT=VIEWTABLE_AJAX&ZASOB_ID={$this->_zasobID}", 'title' => htmlspecialchars("{{$kId}} {$vLabel}"), ], [ UI::h('span', [ 'style' => "padding:10px;"]), UI::h('i', [ 'class' => "glyphicon glyphicon-arrow-right", 'style' => "color:#aaa"]), UI::h('i', [ 'class' => "glyphicon glyphicon-info-sign", 'onclick' => "window.open('procesy5.php?task=PROCES_VIEW_LIST&id_proces={$kId}&HIDE_PANEL=0&show_big_img=1&group_stanowiska=1');return false;", 'style' => "color:#aaa", 'onmouseover' => "this.style.color='#337AB7'", 'onmouseout' => "this.style.color='#aaa'"]), "{{$kId}} {$vLabel}", ]); } public function _viewProcesGotoAndRetLvl2ListItem($vGotoLvl2Id, $pInitList) { $vLabel = $pInitList[$vGotoLvl2Id]; $kId = $vGotoLvl2Id; // TODO:?: prevent to execute procedure echo UI::h('a', [ 'href' => "index.php?FUNCTION_INIT=MENU_SELECT_PROCES&_action=setPermsByProces&id_proces={$kId}&MENU_INIT=VIEWTABLE_AJAX&ZASOB_ID={$this->_zasobID}", 'title' => htmlspecialchars("{{$kId}} {$vLabel}"), ], [ UI::h('span', [ 'style' => "padding:20px;" ]), UI::h('i', [ 'class' => "glyphicon glyphicon-arrow-right", 'style' => "color:#aaa" ]), UI::h('i', [ 'class' => "glyphicon glyphicon-info-sign", 'onclick' => "window.open('procesy5.php?task=PROCES_VIEW_LIST&id_proces={$kId}&HIDE_PANEL=0&show_big_img=1&group_stanowiska=1');return false;", 'style' => "color:#aaa", 'onmouseover' => "this.style.color='#337AB7'", 'onmouseout' => "this.style.color='#aaa'"]), "{{$kId}} {$vLabel}", ]); } public function hasAdditionalLayers() { $layers = TableAjaxMap::getAdditionalLayers($this->_zasobID); return !empty($layers); } public function ajaxTask($task) { switch ($task) { case 'EDIT_INLINE': { $this->sendAjaxResponseJson('ajaxInlineEdit', $_REQUEST); break; } case 'EDIT_INLINE_SAVE': { $this->sendAjaxResponseJson('ajaxEditInlineSave', $_REQUEST); break; } case 'COPY': { $this->sendAjaxResponseJson('ajaxCopy', $_REQUEST); break; } case 'CREATE_SAVE': { // TODO: mv to _route = ViewTableAjax & _task = createSaveAjax $this->sendAjaxResponseJson('ajaxCreateSave', $_REQUEST); break; } case 'HIST': { $this->sendAjaxResponseJson('ajaxHist', $_REQUEST); break; } case 'FILES': { try { $id = V::get('ID', 0, $_REQUEST, 'int'); if ($id <= 0) throw new HttpException("404", 404); $this->sendAjaxFiles($id, $_REQUEST); } catch (HttpException $e) { Http::sendHeaderByCode($e->getCode()); echo $e->getMessage(); //UI::alert('danger', $e->getMessage()); } catch (Exception $e) { echo '
Typespecial('.$fieldID.') (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($typeSpecial);echo'';}
$specialValues = $typeSpecial->getEditSelectedValuesByIds($this->_zasobID, $record['ID'], $fieldName, V::get($fieldName, $fieldVal, $record));
if($DBG){echo'Typespecial('.$fieldID.') specialValues (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($specialValues);echo'';}
if (!empty($specialValues)) {
$tsValues[ $record['ID'] ] = implode('' . $fieldVal . '
'; UI::alert('warning', "Brak uprawnień do zapisu"); } } else { echo $this->_acl->showFormItem('W', $fieldID, "f{$fieldID}", $fieldVal, $fieldParams, $record); if ($typeSpecial || $this->_acl->isDateField($fieldName) || $this->_acl->isDateTimeField($fieldName) ) { echo ''; } } $response['legacy_html'] = ob_get_clean(); //$response['legacy_html'] = utf8_encode($response['legacy_html']);// pl chars bug return $response; } private function ajaxEditInlineSave($args) { $primaryKeyField = $this->_acl->getPrimaryKeyField(); $primaryKey = V::get($primaryKeyField, 0, $args, 'int'); $fieldName = V::get('col', '', $_REQUEST); if (empty($primaryKey)) throw new HttpException("Wrong param id!", 400); if (empty($fieldName)) throw new HttpException("Wrong param col!", 400); $fieldID = $this->_acl->getFieldIdByName($fieldName); if (!$fieldID) throw new HttpException("Field not exists!", 404); $item = $this->_acl->buildQuery([])->getItem($primaryKey); if (!$item) throw new HttpException("Item not exists!", 404); $itemFromUser = $this->_acl->convertObjectFromUserInput($args, $type = 'array_by_id', $prefix = 'f'); if (!isset($itemFromUser[$fieldName])) throw new HttpException("Field not set!", 400); $itemPatch = array(); $itemPatch[$fieldName] = V::get($fieldName, null, $itemFromUser); $itemPatch[$primaryKeyField] = $primaryKey; $response = new stdClass(); try { $affected = $this->_acl->updateItem($itemPatch); if ($affected > 0) { $response->type = 'success'; $response->msg = "Rekord zapisany pomyślnie";//"Record saved successfully"; } else if ($affected == 0) { $response->type = 'info'; $response->msg = "Nie wprowadzono żadnych zmian"; } $response->record = $this->_acl->buildQuery([])->getItem($primaryKey); } catch (Exception $e) { $response->type = 'error'; $response->msg = $e->getMessage(); } return $response; } public function sendAjaxEdit($id, $args) { // TODO: not used @see ViewTableAjax::editFormAction header("Content-type: text/plain"); $acl = $this->_acl; $record = $acl->buildQuery([])->getItem($id); if (!$acl->canWriteRecord($record) && !$acl->hasPermSuperWrite()) { UI::alert('danger', "Brak dostępu do rekordu"); return; } $fieldsList = array(); foreach ($acl->getFieldListByIdZasob() as $kID => $fieldName) { if ($fieldName == 'ID') continue; $field['name'] = $fieldName; $field['opis'] = $acl->getFieldOpis($fieldName); $field['label'] = $acl->getFieldLabel($fieldName); if (empty($field['label'])) $field['label'] = str_replace('_', ' ', $fieldName); $fieldsList[$kID] = $field; } $cols = array(); foreach ($fieldsList as $kID => $field) { $cols[$kID] = ''; if ($this->_acl->canReadObjectField($field['name'], $record)) { $cols[$kID] = V::get($field['name'], '', $record); } else { $cols[$kID] = '*****'; } // if ($acl->canReadObjectField($field['name'])) { // $cols[$kID] = V::get($field['name'], '', $record); // } else { // $cols[$kID] = '*****'; // } $cols[$kID] = V::get("f{$kID}", $cols[$kID], $_POST); } $tsValues = array(); if (!empty($fieldsList)) { foreach ($fieldsList as $vColID => $vCol) { $typeSpecial = Typespecial::getInstance($vColID, $vCol['name']); if ($typeSpecial) { $colValue = V::get($vCol['name'], '', $record); $specialValues = $typeSpecial->getEditSelectedValuesByIds($this->_zasobID, $record['ID'], $vCol['name'], $colValue); if (!empty($specialValues)) { $tsValues[$vColID] = implode(' (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($sql);echo'';
//echo' (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($mainDB->get_errors());echo'';
throw new Exception("Nie udało się dodać zadania");
}
// TODO: this blocks browser ajax query
//$limit = 3;
//while ($limit--) {
// sleep(10);
// TODO: check if task is done
//}
$confTblName = "{$tblName}_COLUMN";
$folderConfAll = FoldersConfig::getRawData();
if (!FoldersConfig::hasConfig($confTblName)) {
throw new Exception("Brak danych konfiguracyjnych ({$tblName})", 404);
}
$folderConf = FoldersConfig::getAll($confTblName);
$uploader = new FileUploader($confTblName, (object)$record);
if (!$uploader->setConfig($folderConf)) {
throw new Exception("Błąd danych konfiguracyjnych ({$tblName})", 404);
}
$uploader->findFolder();
$mainFolder = $uploader->getDestFolder();
$files = $uploader->getFilesFromFolder($mainFolder, false, true);
$localPath = $uploader->getLocalPath();
$folderWeb = $uploader->getFolderWeb();
$jsonData = new stdClass();
$jsonData->msg = 'Zadanie dodane';
$jsonData->type = 'success';
$jsonData->files = $this->convertFileListToJson($files, $folderWeb, $localPath, $mainFolder);
return $jsonData;
}
private function sendAjaxFilesConnTblList($id, $args) {
header("Content-type: application/json");
$DBG = ('1' == V::get('DBG', '', $_REQUEST));
$dbID = $this->_acl->getDB();
$db = DB::getDB($dbID);
if (!$db) {
header('HTTP/1.0 406 Not Acceptable');
echo 'No DB (' . $dbID . ')';
exit;
}
$record = $this->_acl->buildQuery([])->getItem($id);
if (!$record) {
header('HTTP/1.0 404 Not Found');
echo 'No item ID(' . $rowID . ')';
exit;
}
$connTblName = '';
$connTblID = V::get('connTblID', 0, $_REQUEST, 'int');
if ($connTblID <= 0) {
header('HTTP/1.0 406 Not Acceptable');
echo 'No conn Table ID';
exit;
}
$connTblTypespecials = $this->getConnectedTblTypespecials($connTblID);
if (empty($connTblTypespecials)) {
header('HTTP/1.0 406 Not Acceptable');
echo "No conn Table (ID={$connTblID})";
exit;
}
if($DBG){echo'connTblTypespecials (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($connTblTypespecials);echo'';}
if(1) {
header('HTTP/1.0 404 Not Found');
echo 'TODO: ...';
exit;
}
$tblName = $this->_acl->getName();
$confTblName = "{$tblName}_COLUMN";
$folderConfAll = FoldersConfig::getRawData();
if (!FoldersConfig::hasConfig($confTblName)) {
header('HTTP/1.0 404 Not Found');
echo '{"type":"ERROR", "string": "Brak danych konfiguracyjnych (' . $tblName . ')"}';
exit;
}
$folderConf = FoldersConfig::getAll($confTblName);
$uploader = new FileUploader($confTblName, (object)$record);
if (!$uploader->setConfig($folderConf)) {
header('HTTP/1.0 404 Not Found');
echo '{"type":"ERROR", "string": "Błąd danych konfiguracyjnych (' . $tblName . ')"}';
exit;
}
$uploader->findFolder();
$mainFolder = $uploader->getDestFolder();
$files = $uploader->getFilesFromFolder($mainFolder, false, true);
$localPath = $uploader->getLocalPath();
$folderWeb = $uploader->getFolderWeb();
$jsonFiles = $this->convertFileListToJson($files, $folderWeb, $localPath, $mainFolder);
echo json_encode($jsonFiles);
exit;
}
public function convertFileListToJson($files, $folderWeb, $localPath, $mainFolder) {
$jsonFiles = array();
if (!is_array($files) || empty($files)) {
return $jsonFiles;
}
sort($files);
foreach ($files as $vFilePath) {
$file = new stdClass();
$file->name = str_replace("{$localPath}/{$mainFolder}/", '', $vFilePath);
//$file->name = explode('/', $vFilePath);
//$file->name = end($file->name);
$file->size = filesize($vFilePath);
$file->sizeStr = V::humanFileSize($file->size);
$file->type = '';
$file->created = date("Y-m-d H:i:s", filectime($vFilePath));
$file->web = str_replace($localPath, $folderWeb, $vFilePath);
$jsonFiles[] = $file;
}
return $jsonFiles;
}
private function getConnectedTables() {
$connTbls = array();
return $connTbls;// TODO: OFF - hardlinki tworzone w bash_sync_perms.php
$fields = $this->_acl->getVirtualFieldListByIdZasob();
if (!empty($fields)) {
foreach ($fields as $vColID => $vCol) {
$typeSpecial = Typespecial::getInstance($vColID);
if ($typeSpecial) {
$tsConnTbls = $typeSpecial->getTblAliasList();
if (!empty($tsConnTbls)) {
foreach ($tsConnTbls as $kID => $vName) {
$connTbls[$kID] = $vName;
}
}
}
}
}
return $connTbls;
}
private function getConnectedTblTypespecials($connTblID) {
$connTblTypespecials = array();
$fields = $this->_acl->getVirtualFieldListByIdZasob();
if (!empty($fields)) {
foreach ($fields as $vColID => $vCol) {
$typeSpecial = Typespecial::getInstance($vColID);
if ($typeSpecial) {
$tsConnTbls = $typeSpecial->getTblAliasList();
if (array_key_exists($connTblID, $tsConnTbls)) {
$connTblTypespecials[] = $typeSpecial;
}
}
}
}
return $connTblTypespecials;
}
private function sendAjaxFiles($id, $args) {
header("Content-type: text/plain");
$DBG = ('1' == V::get('DBG', '', $_REQUEST));
$acl = $this->_acl;
$dbID = $acl->getDB();
$db = DB::getDB($dbID);
if (!$db) throw new HttpException("", 406);
$record = $acl->buildQuery([])->getItem($id);
if (!$record) throw new HttpException("404: No item ID({$rowID})", 404);
if (!$acl->canReadRecord($record)) throw new Exception("Brak uprawnień do odczytu");
$tblName = $acl->getName();
$confTblName = "{$tblName}_COLUMN";
$folderConfAll = FoldersConfig::getRawData();
if (!FoldersConfig::hasConfig($confTblName)) throw new HttpException("Brak danych konfiguracyjnych", 404);
$folderConf = FoldersConfig::getAll($confTblName);
//echo'$folderConf (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($folderConf);echo'';
$uploader = new FileUploader($confTblName, (object)$record);
$errMsg = '';
if (!$uploader->setConfig($folderConf, $errMsg)) throw new HttpException("Błąd danych konfiguracyjnych ({$tblName})" . 'uploader (F.' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($uploader);echo''; } $mainFolder = $uploader->getDestFolder(); if($DBG){ echo'
mainFolder (F.' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($mainFolder);echo''; } if (!$mainFolder) { $destFolderPath = $uploader->getDestLocalPath(true); $folderCreated = $uploader->tryCreateDestFolder($destFolderPath); if ($folderCreated) { //UI::alert('info', "Utworzono katalog"); $uploader->findFolder(); $mainFolder = $uploader->getDestFolder(); } else { UI::alert('warning', "Nie udało się utworzyć katalogu"); } } $files = $uploader->getFilesFromFolder($mainFolder, false, true); if($DBG){ echo'
files (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($files);echo''; }
$sharePoint = V::get('share_point', null, $folderConf);
if ($sharePoint) {
if ('//' == substr($mainFolder, 0, 2)) {
$sharePoint = FoldersConfig::getNfsOsPath() . "{$mainFolder}";
} else {
$sharePoint = FoldersConfig::getNfsOsPath() . "{$sharePoint}/{$mainFolder}";
}
}
$localPath = $uploader->getLocalPath();
$folderWeb = $uploader->getFolderWeb();
$jsonFiles = $this->convertFileListToJson($files, $folderWeb, $localPath, $mainFolder);
if($DBG){ echo'jsonFiles (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($jsonFiles);echo''; }
$folderSkanyConf = FoldersConfig::getAll('SCANS_COLUMN');
$skanyLocalPath = V::get('mount_point', null, $folderSkanyConf);
$skanySharePoint = V::get('share_point', null, $folderSkanyConf);
$skanyFolderWeb = V::get('www_share_point', null, $folderSkanyConf);
$skanyFiles = $uploader->getFilesFromSkany($folderSkanyConf, false);
sort($skanyFiles);
$fileTypes = FoldersConfig::getAll('m_dist_files_types');
$rowFunctionsOut = $this->_showRowFunctions($record['ID'], array('files', 'cp'), true);
$fileIndexField = V::get('DEST_FILE_INDEX_FIELD', 'ID', $folderConf);
$fileIndex = V::get($fileIndexField, $record['ID'], $record);
$namespace = $acl->getNamespace();
echo UI::h('div', [ 'class' => "container" ], [
UI::h('h4', [ 'style' => "margin:20px 0 3px 0;" ], [
"Pliki w katalogu ",
($sharePoint)
? UI::h('a', [ 'href' => $sharePoint ], [
UI::h('span', [ 'class' => "glyphicon glyphicon-folder-open" ]),
UI::h('code', [ 'style' => "margin-left:6px" ], $mainFolder),
])
: UI::h('code', [], $mainFolder),
UI::h('span', [ 'class' => "pull-right valign-btns-bottom" ], [
UI::h('span', [ 'id' => "FILES_LIST_ACTIONS_{$this->_htmlID}" ]),
" {$rowFunctionsOut}",
]),
]),
UI::h('div', [ 'style' => "clear:both; max-height:180px; overflow:auto; border-bottom:1px solid #ddd;" ], [
UI::h('table', [ 'class' => "table table-bordered table-hover" ], [
UI::h('colgroup', [], [
UI::h('col', [ 'style' => "" ]),
UI::h('col', [ 'style' => "width:30px" ]),
($sharePoint)
? UI::h('col', [ 'style' => "width:30px" ])
: '',
UI::h('col', [ 'style' => "width:80px" ]),
UI::h('col', [ 'style' => "width:140px" ]),
]),
UI::h('tbody', [ 'id' => "FILES_LIST_{$this->_htmlID}" ], [
(empty($mainFolder) || empty($files))
? UI::h('tr', [], [
UI::h('td', [ 'colspan' => "5" ], [
(empty($mainFolder))
? UI::h('div', [ 'class' => "alert alert-warning" ], [
UI::h('h4', [], "Brak folderu!"),
"Folder dla tego rekordu nie został utworzony."
])
: UI::h('div', [ 'class' => "alert alert-info" ], [
UI::h('h4', [], "Brak plików!"),
])
]),
])
: '',
]),
]),
]),
UI::h('br'),
UI::h('br'),
(!$this->_acl->canWriteRecord($record))
? UI::h('div', [ 'class' => "alert alert-warning" ], [
"Brak uprawnień do dodawania plików",
])
: UI::h('div', [ 'id' => "FILES_CONN_TBLS_{$this->_htmlID}" ]),
(!$this->_acl->canWriteRecord($record))
? ''
: UI::h('form', [ 'enctype' => "multipart/form-data", 'method' => "POST", 'action' => "", 'id' => "FILES_FRM_{$this->_htmlID}", 'class' => "form-inline" ], [
UI::h('input', [ 'type' => "hidden", 'name' => "M_DIST_UPLOAD_SOURCE", 'value' => "local" ]),
UI::h('ul', [ 'id' => "FILES_TAB_{$this->_htmlID}", 'class' => "nav nav-tabs", 'style' => "margin:0;"], [
UI::h('li', [ 'class' => "active" ], [ UI::h('a', [ 'href' => "#local", 'data-toggle' => "local" ], "Wybierz plik lokalny"), ]),
UI::h('li', [], [ UI::h('a', [ 'href' => "#scan", 'data-toggle' => "scan" ], "Wybierz plik ze skanów" ), ]),
UI::h('li', [], [ UI::h('a', [ 'href' => "#multiple", 'data-toggle' => "multiple" ], "Wgraj wiele plików" ), ]),
]),
UI::h('div', [ 'id' => "myTabContent", 'class' => "tab-content" ], [
UI::h('div', [ 'class' => "tab-pane fade in active", 'id' => "local", 'style' => "text-align: center;" ], [
UI::h('input', [ 'name' => "M_DIST_FILES_NAME", 'type' => "file", 'size' => "60", 'class' => "field-upload btn",
'style' => "width:86%;margin:10px auto;padding:10px 4%;background:#eee;text-align:center",
'ondragover' => "this.style.backgroundColor='#D9EDF7'",
'ondragleave' => "this.style.backgroundColor='#eee'",
'ondragend' => "this.style.backgroundColor='#eee'",
]),
]),
UI::h('div', [ 'class' => "tab-pane fade", 'id' => "multiple" ], [
UI::h('div', [
'id' => "FILES_MULTIPLE_UPLOAD_{$this->_htmlID}",
'style' => "width:86%; margin:10px auto; padding:40px 100px; background-color:#eee; border-radius:4px; text-align:center",
'ondrop' => "p5TAFiles_onDropMultiple(event, this, '{$id}', '{$namespace}')",
'ondragover' => "p5TAFiles_onDragOverMultiple(event, this)", // "event.preventDefault(); this.style.backgroundColor='#D9EDF7'",
'ondragleave' => "p5TAFiles_onDragLeaveMultiple(event, this)", // "event.preventDefault(); this.style.backgroundColor='#eee'",
'ondragend' => "p5TAFiles_onDragEndMultiple(event, this)", // "event.preventDefault(); this.style.backgroundColor='#eee'",
], [
"Upuść pliki tutaj",
]),
]),
UI::h('div', [ 'class' => "tab-pane fade", 'id' => "scan" ], [
(empty($skanyFiles))
? UI::h('div', [ 'class' => "alert alert-info" ], [
UI::h('h4', [], "Brak plików"),
(!empty($skanyFolderWeb))
? "skonfiguruj urządzenie biurowe aby wysyłało skany na ftp://skaner:(h*a*s*l*o)@".$_SERVER['SERVER_NAME']."