![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /var/www/html/tech_preview/hr/theme/mobile/ |
Upload File : |
"use strict"; theme.addEmployeeForm = function (params) { var commands = [{ icon: DOMElement.i({ attrs: { className: "material-icons" }, text: "save" }), cmd: function(){ params.func.save().then(function(){ params.frameList.removeLast(); }); } }]; var header = absol.buildDom({ tag: 'mheaderbar', props: { actionIcon: DOMElement.i({ attrs: { className: "material-icons" }, text: "arrow_back_ios" }), title: params.title, commands: commands }, on: { action: function(){ params.func.close().then(function(){ params.frameList.removeLast(); }); }, command: function(event){ event.commandItem.cmd(); } } }); var singlePage = absol.buildDom({ tag: 'tabframe', child:[ header, DOMElement.div({ attrs: { className: "card-mobile-content" }, children: [params.formContainer] }) ] }); params.frameList.addChild(singlePage); singlePage.requestActive(); }; theme.addDepartmentForm = function (params) { var commands = [{ icon: DOMElement.i({ attrs: { className: "material-icons" }, text: "save" }), cmd: function(){ params.func.save().then(function(){ params.frameList.removeLast(); }); } }]; var header = absol.buildDom({ tag: 'mheaderbar', props: { actionIcon: DOMElement.i({ attrs: { className: "material-icons" }, text: "arrow_back_ios" }), title: params.title, commands: commands }, on: { action: function(){ params.func.close().then(function(){ params.frameList.removeLast(); }); }, command: function(event){ event.commandItem.cmd(); } } }); var singlePage = absol.buildDom({ tag: 'tabframe', child:[ header, DOMElement.div({ attrs: { className: "card-mobile-content" }, children: [params.formContainer] }) ] }); params.frameList.addChild(singlePage); singlePage.requestActive(); }; theme.getRowDepartmentView = function(content){ var childs = []; for (var i = 0; i < content.child.length; i++){ childs.push(theme.getRowDepartmentView(content.child[i])); } var item = absol.buildDom({ tag: "mcabinettree", class: "am-flex-content", props: { content: [ { child: DOMElement.div({ attrs: { onclick: function(){ content.func.redrawEmployee(); } }, text: content.name }) } ] }, child: childs }); var itemsList = []; if (content.func.edit) itemsList.push({ text: LanguageModule.text("txt_edit"), extendClasses: "bsc-quickmenu", icon: DOMElement.i({ attrs: { className: "material-icons" }, text: "create" }), cmd: function(){ content.func.edit(); } }); if (content.func.add_department) itemsList.push({ text: LanguageModule.text("txt_add_sub_department"), extendClasses: "bsc-quickmenu", icon: DOMElement.i({ attrs: { className: "material-icons" }, text: "add" }), cmd: function(){ content.func.add_department(); } }); if (content.func.add_employee) itemsList.push({ text: LanguageModule.text("txt_add_employee"), extendClasses: "bsc-quickmenu", icon: DOMElement.i({ attrs: { className: "material-icons" }, text: "add" }), cmd: function(){ content.func.add_employee(); } }); if (itemsList.length > 0){ item.quickmenu = { props: { extendClasses: 'cd-context-menu', items: itemsList }, onSelect: function (x) { x.cmd(); } }; } return item; }; theme.getRowEmployeeView = function (content, configColumnEmployee) { var qmenuButton = DOMElement.div({ attrs: { className: "card-icon-cover" }, children: [DOMElement.i({ attrs: { className: "material-icons bsc-icon-hover-black" }, text: "more_vert" })] }); var docTypeMemuProps, token, functionX; token = "showMenu"; var functionClickMore = function (event, me, index, parent, data, row) { if (token == absol.QuickMenu._session) { token = "showMenu"; return; } var itemsList = []; if (content.func.open) itemsList.push({ text: LanguageModule.text("txt_open"), value: "open", extendClasses: "bsc-quickmenu", icon: DOMElement.i({ attrs: { className: "material-icons" }, text: "visibility" }) }); docTypeMemuProps = { items: itemsList }; token = absol.QuickMenu.show(me, docTypeMemuProps, [3, 4], function (menuItem) { content.func[menuItem.value](); }); functionX = function (token) { return function () { var x = function (event) { absol.QuickMenu.close(token); document.body.removeEventListener("click", x); } document.body.addEventListener("click", x) } }(token); setTimeout(functionX, 10) } var celldata = []; for (var i = 0; i < configColumnEmployee.length; i++) { if (configColumnEmployee[i].main) { celldata.push(contentModule.getCellTableView(configColumnEmployee[i], content[configColumnEmployee[i].value])); } else { celldata.push(contentModule.getCellTableView(configColumnEmployee[i], content.extrainfo[configColumnEmployee[i].value])); } } for (var i = 0; i < celldata.length; i++) { if (celldata[i].element) { celldata[i].element.classList.add("hr-table-cell-link"); celldata[i].element.onclick = function () { content.func.open(); }; } } celldata.push({ functionClick: functionClickMore, element: DOMElement.div({ attrs: { className: "sortTable-cell-view-cmd" }, children: [qmenuButton] }) }); return celldata; }; theme.formOrgsInit = function (params){ var filterFunc = function(){ theme.modalFormMobile({ title: LanguageModule.text("txt_filter"), bodycontent: DOMElement.div({ children: [ DOMElement.div({ attrs: { className: "card-mobile-label-form-edit-first" }, text: LanguageModule.text("txt_company") }), company_select ] }) }); }; var company_select = absol.buildDom({ tag: "selectmenu", style: { display: "block", width: "100%" }, props: { items: [], enableSearch: true }, on: { change: function(){ params.func.change_company(this.value); } } }); var commands = []; if (params.cmdbutton.add !== undefined){ commands.push({ icon: DOMElement.i({ attrs: { className: "material-icons" }, text: "add" }), cmd: params.cmdbutton.add }); } commands.push({ icon: DOMElement.i({ attrs: { className: "material-icons" }, text: "filter_alt" }), cmd: function(){ filterFunc(); } }); var header = absol.buildDom({ tag: 'mheaderbar', props: { actionIcon: DOMElement.i({ attrs: { className: "material-icons" }, text: "arrow_back_ios" }), title: LanguageModule.text("txt_organizational"), commands: commands }, on: { action: function(){ params.holder.selfRemove(); hr.menu.loadPage(1000); }, command: function(event){ event.commandItem.cmd(); } } }); var data_container = DOMElement.div({ attrs: { className: "card-mobile-content" } }); var singlePage = absol.buildDom({ tag: 'tabframe', child:[ header, data_container ] }); DOMElement.removeAllChildren(params.holder); params.holder.addChild(params.frameList); params.frameList.addChild(singlePage); singlePage.requestActive(); singlePage.updateSelectCompanyMenu = function(list){ var items = []; for (var i = 0; i < list.length; i++){ items.push({ value: list[i].id, text: list[i].name }); } company_select.items = items; }; singlePage.redrawOrgTable = function(ps){ var childs = [], x; for (var i = 0; i < ps.database.orgs.items.length; i++){ if (ps.database.orgs.items[i].id != ps.companyid) continue; x = ps.getRow(ps.database.orgs.items[i]); if (x) childs.push(theme.getRowDepartmentView(x)); } var list = absol.buildDom({ tag: "mcabinettreelist", child: childs }); DOMElement.removeAllChildren(data_container); data_container.appendChild(list); }; singlePage.redrawEmployeeTable = function(ps){ console.log(ps); }; return singlePage; }; ModuleManagerClass.register({ name: "Orgs_view", prerequisites: ["ModalElement"] });