uawdijnntqw1x1x1
IP : 3.138.124.167
Hostname : axolotl
Kernel : Linux axolotl 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
OS : Linux
PATH:
/
var
/
www
/
axolotl
/
data
/
www
/
axolotl.ru
/
www
/
local
/
..
/
bitrix
/
js
/
tasks
/
core_planner_handler.min.js
/
/
(function(){if(!!window.BX.CTasksPlannerHandler)return;var t=window.BX,e={"-1":"overdue","-2":"new",1:"new",2:"accepted",3:"in-progress",4:"waiting",5:"completed",6:"delayed",7:"declined"},s=null;t.addTaskToPlanner=function(t){s.addTask({id:t})};t.CTasksPlannerHandler=function(){this.TASKS=null;this.TASKS_LIST=null;this.ADDITIONAL={};this.MANDATORY_UFS=null;this.TASK_CHANGES={add:[],remove:[]};this.TASK_CHANGES_TIMEOUT=null;this.TASKS_WND=null;this.DATA_TASKS=null;this.PLANNER=null;this.taskTimerSwitch=false;this.timerTaskId=0;this.onTimeManDataRecievedEventDetected=false;t.addCustomEvent("onPlannerDataRecieved",t.proxy(this.draw,this));t.addCustomEvent("onTaskTimerChange",t.proxy(this.onTaskTimerChange,this))};t.CTasksPlannerHandler.prototype.formatTime=function(t,e){var s="00";var a="";var i="";var n=""+t%60;var r=["","",""];if(t>=0){a+=Math.floor(t/3600);i+=Math.floor(t/60)%60;var o=[a,i,n]}else{a+=Math.ceil(t/3600);i+=Math.ceil(t/60)%60;o=[a,i,n];Object.keys(o).forEach(function(t){o[t]=o[t].replace("-","");if(o[t]!=="0"){r[t]="-"}})}var T=r[0]+s.substring(0,2-o[0].length)+o[0]+":"+r[1]+s.substring(0,2-o[1].length)+o[1];if(e){T+=":"+r[2]+s.substring(0,2-o[2].length)+o[2]}return T};t.CTasksPlannerHandler.prototype.draw=function(e,s){if(typeof s.MANDATORY_UFS!=="undefined"){this.MANDATORY_UFS=s.MANDATORY_UFS}if(typeof s.TASK_ADD_URL!=="undefined"){this.TASK_ADD_URL=s.TASK_ADD_URL}if(!s.TASKS_ENABLED){return}this.PLANNER=e;if(null==this.TASKS){this.TASKS=t.create("DIV");this.TASKS.appendChild(t.create("DIV",{props:{className:"tm-popup-section tm-popup-section-tasks"},children:[t.create("SPAN",{props:{className:"tm-popup-section-text"},text:t.message("JS_CORE_PL_TASKS")}),t.create("span",{props:{className:"tm-popup-section-right-link"},events:{click:t.proxy(this.showTasks,this)},text:t.message("JS_CORE_PL_TASKS_CHOOSE")})]}));this.TASKS.appendChild(t.create("DIV",{props:{className:"tm-popup-tasks"},children:[this.TASKS_LIST=t.create("div",{props:{className:"tm-task-list"}}),this.drawTasksForm(t.proxy(this.addTask,this))]}))}else{t.cleanNode(this.TASKS_LIST)}if(s.TASKS&&s.TASKS.length>0){var a=null;var i="";var n=[];var r=0;var o=0;var T="";var l=null;t.removeClass(this.TASKS,"tm-popup-tasks-empty");for(var S=0,d=s.TASKS.length;S<d;S++){l=s.TASKS[S].STATUS==4||s.TASKS[S].STATUS==5;if(l)i=" tm-task-item-done";else i="";n=[];n.push(t.create("input",{props:{className:"tm-task-checkbox",type:"checkbox",checked:l},events:{click:function(e){return function(){var s=new t.CJSTask.Item(e.ID);if(this.checked){s.complete({callbackOnSuccess:function(){if(t.TasksTimerManager)t.TasksTimerManager.reLoadInitTimerDataFromServer()}})}else{s.startExecutionOrRenewAndStart({callbackOnSuccess:function(){if(t.TasksTimerManager)t.TasksTimerManager.reLoadInitTimerDataFromServer()}})}}}(s.TASKS[S])}}));var p=s.TASKS[S];if(p.ALLOW_TIME_TRACKING=="Y"&&(s.TASKS[S].TIME_SPENT_IN_LOGS>0||s.TASKS[S].TIME_ESTIMATE>0)){r=parseInt(s.TASKS[S].TIME_SPENT_IN_LOGS);o=parseInt(s.TASKS[S].TIME_ESTIMATE);if(isNaN(r)){r=0}if(isNaN(o)){o=0}T=this.formatTime(r,true);if(o>0){T=T+" / "+this.formatTime(o)}}else{T=""}n.push(t.create("a",{attrs:{href:s.TASKS[S].URL},props:{className:"tm-task-name"+(T===""?" tm-task-no-timer":"")},text:s.TASKS[S].TITLE}));if(T!==""){n.push(t.create("SPAN",{props:{className:"tm-task-time",id:"tm-task-time-"+s.TASKS[S].ID},text:T}))}n.push(t.create("SPAN",{props:{className:"tm-task-item-menu"},events:{click:function(e,s,a){return function(){var i=[];var n="task-tm-item-entry-menu-"+e.ID;if(s&&s.TASK_ID==e.ID&&s.TIMER_STARTED_AT>0){i.push({text:t.message("JS_CORE_PL_TASKS_STOP_TIMER"),className:"menu-popup-item-hold",onclick:function(s){t.TasksTimerManager.stop(e.ID);this.popupWindow.close()}})}else{if(e.ALLOW_TIME_TRACKING==="Y"){i.push({text:t.message("JS_CORE_PL_TASKS_START_TIMER"),className:"menu-popup-item-begin",onclick:function(s){t.TasksTimerManager.start(e.ID);this.popupWindow.close()}})}}i.push({text:t.message("JS_CORE_PL_TASKS_MENU_REMOVE_FROM_PLAN"),className:"menu-popup-item-decline",onclick:function(t){a.removeTask(t,e.ID);this.popupWindow.close()}});var r=t.PopupMenu.getMenuById(n);if(r!==null){t.PopupMenu.destroy(n)}else{r=t.PopupMenu.show("task-tm-item-entry-menu-"+e.ID,this,i,{autoHide:true,offsetTop:4,events:{onPopupClose:function(t){}}})}}}(s.TASKS[S],s.TASKS_TIMER,this)}}));var h=this.TASKS_LIST.appendChild(t.create("div",{props:{id:"tm-task-item-"+s.TASKS[S].ID,className:"tm-task-item "+i,bx_task_id:s.TASKS[S].ID},children:n}));if(s.TASK_LAST_ID&&s.TASKS[S].ID==s.TASK_LAST_ID){a=h}}if(a){setTimeout(t.delegate(function(){if(a.offsetTop<this.TASKS_LIST.scrollTop||a.offsetTop+a.offsetHeight>this.TASKS_LIST.scrollTop+this.TASKS_LIST.offsetHeight){this.TASKS_LIST.scrollTop=a.offsetTop-parseInt(this.TASKS_LIST.offsetHeight/2)}},this),10)}}else{t.addClass(this.TASKS,"tm-popup-tasks-empty")}this.DATA_TASKS=t.clone(s.TASKS);e.addBlock(this.TASKS,200);e.addAdditional(this.drawAdditional())};t.CTasksPlannerHandler.prototype.drawAdditional=function(){if(!this.TASK_ADDITIONAL){this.ADDITIONAL.TASK_TEXT=t.create("SPAN",{props:{className:"tm-info-bar-text-inner"}});this.ADDITIONAL.TASK_TIMER=t.create("SPAN",{props:{className:"tm-info-bar-time"}});this.TASK_ADDITIONAL=t.create("DIV",{props:{className:"tm-info-bar"},children:[t.create("SPAN",{props:{title:t.message("JS_CORE_PL_TASKS_START_TIMER"),className:"tm-info-bar-btn tm-info-bar-btn-play"},events:{click:t.proxy(this.timerStart,this)}}),t.create("SPAN",{props:{title:t.message("JS_CORE_PL_TASKS_STOP_TIMER"),className:"tm-info-bar-btn tm-info-bar-btn-pause"},events:{click:t.proxy(this.timerStop,this)}}),t.create("SPAN",{props:{title:t.message("JS_CORE_PL_TASKS_FINISH"),className:"tm-info-bar-btn tm-info-bar-btn-flag"},events:{click:t.proxy(this.timerFinish,this)}}),this.ADDITIONAL.TASK_TIMER,t.create("SPAN",{props:{className:"tm-info-bar-text"},children:[this.ADDITIONAL.TASK_TEXT]})]});t.hide(this.TASK_ADDITIONAL)}return this.TASK_ADDITIONAL};t.CTasksPlannerHandler.prototype.timerStart=function(){if(this.timerTaskId>0){t.TasksTimerManager.start(this.timerTaskId)}};t.CTasksPlannerHandler.prototype.timerStop=function(){if(this.timerTaskId>0){t.TasksTimerManager.stop(this.timerTaskId)}};t.CTasksPlannerHandler.prototype.timerFinish=function(){if(this.timerTaskId>0){var e=new t.CJSTask.Item(this.timerTaskId);e.complete({callbackOnSuccess:function(){if(t.TasksTimerManager)t.TasksTimerManager.reLoadInitTimerDataFromServer()}})}};t.CTasksPlannerHandler.prototype.onTaskTimerChange=function(e){if(e.action==="refresh_daemon_event"){this.timerTaskId=e.taskId;if(this.PLANNER&&!!this.PLANNER.WND&&this.PLANNER.WND.isShown()&&e.taskId>0){var s=this.drawAdditional();if(!!this.taskTimerSwitch){s.style.display="";this.taskTimerSwitch=false}var a=parseInt(e.data.TIMER.RUN_TIME||0)+parseInt(e.data.TASK.TIME_SPENT_IN_LOGS||0),i=parseInt(e.data.TASK.TIME_ESTIMATE||0);if(i>0&&a>i){t.addClass(s,"tm-info-bar-overdue")}else{t.removeClass(s,"tm-info-bar-overdue")}var n="";n+=this.formatTime(a,true);if(i>0){n+=" / "+this.formatTime(i)}this.ADDITIONAL.TASK_TIMER.innerHTML=n;this.ADDITIONAL.TASK_TEXT.innerHTML=t.util.htmlspecialchars(e.data.TASK.TITLE);var r=t("tm-task-time-"+this.timerTaskId);if(r)r.innerHTML=n}}else if(e.action==="start_timer"){if(this.isClosed(e.taskData)){t.addClass(this.drawAdditional(),"tm-info-bar-closed")}else{t.removeClass(this.drawAdditional(),"tm-info-bar-closed")}this.timerTaskId=e.taskData.ID;this.taskTimerSwitch=true;t.addClass(this.drawAdditional(),"tm-info-bar-active");t.removeClass(this.drawAdditional(),"tm-info-bar-pause")}else if(e.action==="stop_timer"){this.timerTaskId=e.taskData.ID;if(this.isClosed(e.taskData)){t.hide(this.drawAdditional())}else{t.addClass(this.drawAdditional(),"tm-info-bar-pause");t.removeClass(this.drawAdditional(),"tm-info-bar-active")}}else if(e.action==="init_timer_data"){if(e.data.TIMER&&e.data.TASK.ID>0&&e.data.TIMER.TASK_ID==e.data.TASK.ID){this.timerTaskId=e.data.TASK.ID;if(this.isClosed(e.data.TASK)){t.addClass(this.drawAdditional(),"tm-info-bar-closed")}else{t.removeClass(this.drawAdditional(),"tm-info-bar-closed")}if(e.data.TIMER.TIMER_STARTED_AT==0){if(this.isClosed(e.data.TASK)){t.hide(this.drawAdditional())}else{this.taskTimerSwitch=true;t.addClass(this.drawAdditional(),"tm-info-bar-pause");t.removeClass(this.drawAdditional(),"tm-info-bar-active")}}else{this.taskTimerSwitch=true;t.addClass(this.drawAdditional(),"tm-info-bar-active");t.removeClass(this.drawAdditional(),"tm-info-bar-pause")}}else{t.hide(this.drawAdditional())}this.onTaskTimerChange({action:"refresh_daemon_event",taskId:+e.data.TASK.ID,data:e.data})}};t.CTasksPlannerHandler.prototype.isClosed=function(t){return t.STATUS==5||t.STATUS==4};t.CTasksPlannerHandler.prototype.addTask=function(e){if(!!this.TASKS_LIST){this.TASKS_LIST.appendChild(t.create("LI",{props:{className:"tm-popup-task"},text:e.name}));t.removeClass(this.TASKS,"tm-popup-tasks-empty")}var s={action:"add"};if(typeof e.id!="undefined")s.id=e.id;if(typeof e.name!="undefined")s.name=e.name;this.query(s)};t.CTasksPlannerHandler.prototype.removeTask=function(e,s){this.query({action:"remove",id:s});t.cleanNode(t("tm-task-item-"+s),true);if(!this.TASKS_LIST.firstChild){t.addClass(this.TASKS,"tm-popup-tasks-empty")}};t.CTasksPlannerHandler.prototype.showTasks=function(){if(!this.TASKS_WND){this.TASKS_WND=new t.CTasksPlannerSelector({node:t.proxy_context,onselect:t.proxy(this.addTask,this)})}else{this.TASKS_WND.setNode(t.proxy_context)}this.TASKS_WND.Show()};t.CTasksPlannerHandler.prototype.showTask=function(e){var s=t.proxy_context.parentNode.bx_task_id;var a=this.DATA_TASKS;if(a.length>0){var i="";a.forEach(function(t){if(Number(t.ID)===Number(s)){i=t.URL}});if(i!==""){t.SidePanel.Instance.open(i)}}return false};t.CTasksPlannerHandler.prototype.drawTasksForm=function(e){var s=null;var a=null;var i=null;if(this.MANDATORY_UFS!=="Y"){s=t.delegate(function(s,i){a.value=t.util.trim(a.value);if(a.value&&a.value!=t.message("JS_CORE_PL_TASKS_ADD")){e({name:a.value});if(!i){t.addClass(a.parentNode,"tm-popup-task-form-disabled");a.value=t.message("JS_CORE_PL_TASKS_ADD")}else{a.value=""}}return t.PreventDefault(s)},this);var a=t.create("INPUT",{props:{type:"text",className:"tm-popup-task-form-textbox",value:t.message("JS_CORE_PL_TASKS_ADD")},events:{keypress:function(t){return t.keyCode==13?s(t,true):true},blur:function(){if(this.value==""){t.addClass(this.parentNode,"tm-popup-task-form-disabled");this.value=t.message("JS_CORE_PL_TASKS_ADD")}},focus:function(){t.removeClass(this.parentNode,"tm-popup-task-form-disabled");if(this.value==t.message("JS_CORE_PL_TASKS_ADD"))this.value=""}}});t.focusEvents(a);i=[a,t.create("SPAN",{props:{className:"tm-popup-task-form-submit"},events:{click:s}})]}else{i=[t.create("A",{text:t.message("JS_CORE_PL_TASKS_CREATE"),attrs:{href:this.TASK_ADD_URL}})]}return t.create("DIV",{props:{className:"tm-popup-task-form tm-popup-task-form-disabled"},children:i})};t.CTasksPlannerHandler.prototype.query=function(e,s){if(this.TASK_CHANGES_TIMEOUT){clearTimeout(this.TASK_CHANGES_TIMEOUT)}if(typeof e=="object"){if(!!e.id){this.TASK_CHANGES[e.action].push(e.id)}if(e.action=="add"){if(!e.id){this.TASK_CHANGES.name=e.name}this.query()}else{this.TASK_CHANGES_TIMEOUT=setTimeout(t.proxy(this.query,this),1e3)}}else{if(!!this.PLANNER){this.DATA_TASKS=[];this.PLANNER.query("task",this.TASK_CHANGES)}else{window.top.BX.CPlanner.query("task",this.TASK_CHANGES)}this.TASK_CHANGES={add:[],remove:[]}}};t.CTasksPlannerSelector=function(e){this.params=e;this.isReady=false;this.WND=t.PopupWindowManager.create("planner_tasks_selector_"+parseInt(Math.random()*1e4),this.params.node,{autoHide:true,closeByEsc:true,content:this.content=t.create("DIV"),buttons:[new t.PopupWindowButtonLink({text:t.message("JS_CORE_WINDOW_CLOSE"),className:"popup-window-button-link-cancel",events:{click:function(e){this.popupWindow.close();return t.PreventDefault(e)}}})]})};t.CTasksPlannerSelector.prototype.Show=function(){if(!this.isReady){var e=parseInt(Math.random()*1e4);window["PLANNER_ADD_TASK_"+e]=t.proxy(this.setValue,this);return t.ajax.get("/bitrix/tools/tasks_planner.php",{action:"list",suffix:e,sessid:t.bitrix_sessid(),site_id:t.message("SITE_ID")},t.proxy(this.Ready,this))}return this.WND.show()};t.CTasksPlannerSelector.prototype.Hide=function(){this.WND.close()};t.CTasksPlannerSelector.prototype.Ready=function(t){this.content.innerHTML=t;this.isReady=true;this.Show()};t.CTasksPlannerSelector.prototype.setValue=function(t){this.params.onselect(t);this.WND.close()};t.CTasksPlannerSelector.prototype.setNode=function(t){this.WND.setBindElement(t)};s=new t.CTasksPlannerHandler})(); //# sourceMappingURL=core_planner_handler.map.js
/var/www/axolotl/data/www/axolotl.ru/www/local/../bitrix/js/tasks/core_planner_handler.min.js