// @require variables: if ('undefined' === typeof JS_FUNCTION_NAME) throw "Missing JS_FUNCTION_NAME"; if ('undefined' === typeof URL_GET_PROCES_INIT_FILTR) throw "Missing URL_GET_PROCES_INIT_FILTR"; if ('undefined' === typeof ID_ZASOB) throw "Missing ID_ZASOB"; function p5Utils__convertToHtml(tagName, attributes, childrens) { // ( string tagName, object attributes, array childrens ) return '<' + tagName + ( attributes ? ' ' + p5Utils__convertAttrsToHtml(attributes) : '' ) + '>' + ( childrens || [] ).join("") + '' + tagName + '>'; } function p5Utils__convertAttrsToHtml(attributes) { return Object.keys(attributes).map(function (attrName) { var name = attrName; if ('className' === name) name = 'class'; return '' + name + '="' + attributes[attrName] + '"' }).join(" ") } function _viewDropdown_item_infoLink(id, label) { var h = p5Utils__convertToHtml; var viewProcessLink = "procesy5.php?task=PROCES_VIEW_LIST&id_proces=" + id + "&HIDE_PANEL=0&show_big_img=1&group_stanowiska=1"; return h('i', { className: "glyphicon glyphicon-info-sign", style: "color:#aaa; cursor:help; vertical-align:middle", title: "Przeglądaj proces {" + id + "} " + label, onclick: "window.open('" + viewProcessLink + "');return false;", onmouseover: "this.style.color = '#337AB7'", onmouseout: "this.style.color = '#aaa'" }); } function _viewDropdown_item_setPermsLink(id, label, selected) { var h = p5Utils__convertToHtml; return h('button', { className: "btn btn-link" + (selected ? " disabled" : ""), style: "padding:0 3px", title: "Uruchom filtr procesu {" + id + "}" }, [ " {" + id + "} " + label, ]); } function _viewDropdown_listItem(id, label, selected, deepLevel, showArrowIcon) { // showArrowIcon: if process type === goto_and_return var h = p5Utils__convertToHtml; var marginLeft = 20 * (deepLevel || 0); return h('li', { style: "white-space:nowrap; overflow:hidden; max-width:500px; /* text-overflow:ellipsis; */", onmouseover: "this.style.backgroundColor='#f5f5f5'", onmouseout: "this.style.backgroundColor='#fff'", }, [ h('form', { className: "form-inline", method: "post", action: "", style: "padding:3px 20px; margin-left:" + marginLeft + "px" }, [ h('input', { type: "hidden", name: "_rootPostTask", value: "SetPermsByProces" }), h('input', { type: "hidden", name: "id_proces", value: id }), (showArrowIcon) ? h('i', { className: "glyphicon glyphicon-arrow-right", style: "color:#aaa; vertical-align:middle; margin-right:2px" }) : null, _viewDropdown_item_infoLink(id, label), _viewDropdown_item_setPermsLink(id, label, selected), ]), ]); } function toggleProcesInitFiltr(n) { var $n = jQuery(n); var $ul = $n.next(); if ($n.data('fetched')) return false; function parseProcesInitData(pInitData) { return (!pInitData || !pInitData.mapTree) ? '