uawdijnntqw1x1x1
IP : 3.143.144.95
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
/
bitrix
/
js
/
crm
/
autorun_proc.min.js
/
/
BX.namespace("BX.Crm");if(typeof BX.AutoRunProcessState==="undefined"){BX.AutoRunProcessState={intermediate:0,running:1,completed:2,stopped:3,error:4}}if(typeof BX.AutorunProcessManager==="undefined"){BX.AutorunProcessManager=function(){this._id="";this._settings={};this._serviceUrl="";this._actionName="";this._controllerActionName="";this._params=null;this._container=null;this._panel=null;this._runHandle=0;this._hasLayout=false;this._state=BX.AutoRunProcessState.intermediate;this._processedItemCount=0;this._totalItemCount=0;this._errors=null};BX.AutorunProcessManager.prototype={initialize:function(t,e){this._id=BX.type.isNotEmptyString(t)?t:"crm_lrp_mgr_"+Math.random().toString().substring(2);this._settings=e?e:{};this._serviceUrl=BX.prop.getString(this._settings,"serviceUrl","");this._actionName=BX.prop.getString(this._settings,"actionName","");this._controllerActionName=BX.prop.getString(this._settings,"controllerActionName","");if(this._serviceUrl===""&&this._controllerActionName===""){throw"AutorunProcessManager: Either the serviceUrl or controllerActionName parameter must be specified."}this._container=BX(this.getSetting("container"));if(!BX.type.isElementNode(this._container)){throw"AutorunProcessManager: Could not find container."}this._params=BX.prop.getObject(this._settings,"params",null);if(BX.prop.getBoolean(this._settings,"enableLayout",false)){this.layout()}},getId:function(){return this._id},getSetting:function(t,e){return this._settings.hasOwnProperty(t)?this._settings[t]:e},getTimeout:function(){return BX.prop.getInteger(this._settings,"timeout",2e3)},getMessage:function(t){var e=BX.AutorunProcessManager.messages;return e.hasOwnProperty(t)?e[t]:t},getParams:function(){return this._params},setParams:function(t){this._params=t},isHidden:function(){return!this._hasLayout||this._panel.isHidden()},show:function(){if(this._hasLayout){this._panel.show()}},hide:function(){if(this._hasLayout){this._panel.hide()}},scrollInToView:function(){if(this._panel){this._panel.scrollInToView()}},layout:function(){if(this._hasLayout){return}if(!this._panel){var t=BX.prop.getString(this._settings,"title","");if(t===""){t=this.getMessage("title")}var e=BX.prop.getString(this._settings,"stateTemplate","");if(e===""){e=this.getMessage("stateTemplate")}this._panel=BX.AutorunProcessPanel.create(this._id,{manager:this,container:this._container,enableCancellation:BX.prop.getBoolean(this._settings,"enableCancellation",false),title:t,stateTemplate:e})}this._panel.layout();this._hasLayout=true},clearLayout:function(){if(!this._hasLayout){return}this._panel.clearLayout();this._hasLayout=false},getPanel:function(){return this._panel},setPanel:function(t){this._panel=t;if(this._panel){this._panel.setManager(this);this._hasLayout=this._panel.hasLayout()}else{this._hasLayout=false}},refresh:function(){if(!this._hasLayout){this.layout()}if(this._panel.isHidden()){this._panel.show()}this._panel.onManagerStateChange()},getState:function(){return this._state},getProcessedItemCount:function(){return this._processedItemCount},getTotalItemCount:function(){return this._totalItemCount},getErrorCount:function(){return this._errors?this._errors.length:0},getErrors:function(){return this._errors?this._errors:[]},run:function(){if(this._state===BX.AutoRunProcessState.stopped){this._state=BX.AutoRunProcessState.intermediate}this.startRequest()},runAfter:function(t){this._runHandle=window.setTimeout(BX.delegate(this.run,this),t)},stop:function(){this._state=BX.AutoRunProcessState.stopped;BX.onCustomEvent(this,"ON_AUTORUN_PROCESS_STATE_CHANGE",[this])},reset:function(){if(this._runHandle>0){window.clearTimeout(this._runHandle);this._runHandle=0}if(this._panel&&this._panel.isHidden()){this._panel.show()}this._processedItemCount=this._totalItemCount=0;this._error="";this._errorExtras=null},startRequest:function(){if(this._state===BX.AutoRunProcessState.stopped){return}if(this._requestIsRunning){return}this._requestIsRunning=true;this._state=BX.AutoRunProcessState.running;var t={};if(this._serviceUrl!==""){if(this._actionName!==""){t["ACTION"]=this._actionName}if(this._params){t["PARAMS"]=this._params}BX.ajax({url:this._serviceUrl,method:"POST",dataType:"json",data:t,onsuccess:BX.delegate(this.onRequestSuccess,this),onfailure:BX.delegate(this.onRequestFailure,this)})}else{if(this._params){t["params"]=this._params}BX.ajax.runAction(this._controllerActionName,{data:t}).then(function(t){this.onRequestSuccess(BX.prop.getObject(t,"data",{}))}.bind(this),function(t){this.onRequestFailure(BX.prop.getObject(t,"data",{}))}.bind(this))}},onRequestSuccess:function(t){this._requestIsRunning=false;if(this._state===BX.AutoRunProcessState.stopped){return}if(this._serviceUrl!==""){var e=BX.prop.getString(t,"STATUS","");if(e==="ERROR"){this._state=BX.AutoRunProcessState.error}else if(e==="COMPLETED"){this._state=BX.AutoRunProcessState.completed}if(this._state===BX.AutoRunProcessState.error){this._errors=BX.prop.getArray(t,"ERRORS",[]);if(this._errors.length===0){this._errors.push({message:this.getMessage("requestError")})}}else{this._processedItemCount=BX.prop.getInteger(t,"PROCESSED_ITEMS",0);this._totalItemCount=BX.prop.getInteger(t,"TOTAL_ITEMS",0);this._errors=BX.prop.getArray(t,"ERRORS",[])}}else{e=BX.prop.getString(t,"status","");if(e==="ERROR"){this._state=BX.AutoRunProcessState.error}else if(e==="COMPLETED"){this._state=BX.AutoRunProcessState.completed}if(this._state===BX.AutoRunProcessState.error){this._errors=BX.prop.getArray(t,"errors",[]);if(this._errors.length===0){this._errors.push({message:this.getMessage("requestError")})}}else{this._processedItemCount=BX.prop.getInteger(t,"processedItems",0);this._totalItemCount=BX.prop.getInteger(t,"totalItems",0);this._errors=BX.prop.getArray(t,"errors",[])}}this.refresh();if(this._state===BX.AutoRunProcessState.running){window.setTimeout(BX.delegate(this.startRequest,this),this.getTimeout())}else if(this._state===BX.AutoRunProcessState.completed&&BX.prop.getBoolean(this._settings,"hideAfterComplete",true)){this.hide()}BX.onCustomEvent(this,"ON_AUTORUN_PROCESS_STATE_CHANGE",[this])},onRequestFailure:function(t){this._requestIsRunning=false;this._state=BX.AutoRunProcessState.error;this._error=this.getMessage("requestError");this.refresh();BX.onCustomEvent(this,"ON_AUTORUN_PROCESS_STATE_CHANGE",[this])}};if(typeof BX.AutorunProcessManager.messages==="undefined"){BX.AutorunProcessManager.messages={}}BX.AutorunProcessManager.items={};BX.AutorunProcessManager.create=function(t,e){var s=new BX.AutorunProcessManager;s.initialize(t,e);this.items[s.getId()]=s;return s};BX.AutorunProcessManager.createIfNotExists=function(t,e){if(this.items.hasOwnProperty(t)){return this.items[t]}var s=new BX.AutorunProcessManager;s.initialize(t,e);this.items[s.getId()]=s;return s}}if(typeof BX.AutorunProcessPanel==="undefined"){BX.AutorunProcessPanel=function(){this._id="";this._settings={};this._manager=null;this._container=null;this._wrapper=null;this._stateNode=null;this._progressNode=null;this._hasLayout=false;this._isHidden=false};BX.AutorunProcessPanel.prototype={initialize:function(t,e){this._id=t;this._settings=e?e:{};this._container=BX(this.getSetting("container"));if(!BX.type.isElementNode(this._container)){throw"AutorunProcessPanel: Could not find container."}this._manager=this.getSetting("manager");this._isHidden=this.getSetting("isHidden",false)},getId:function(){return this._id},getSetting:function(t,e){return this._settings.hasOwnProperty(t)?this._settings[t]:e},scrollInToView:function(){if(!this._container){return}var t=BX.pos(this._container);if(window.scrollY>t.top){window.scrollTo(window.scrollX,t.top)}},layout:function(){if(this._hasLayout){return}this._wrapper=BX.create("DIV",{attrs:{className:"crm-view-progress"}});BX.addClass(this._wrapper,this._isHidden?"crm-view-progress-hide":"crm-view-progress-show crm-view-progress-bar-active");this._container.appendChild(this._wrapper);this._wrapper.appendChild(BX.create("DIV",{attrs:{className:"crm-view-progress-info"},text:this.getSetting("title","Please wait...")}));this._progressNode=BX.create("DIV",{attrs:{className:"crm-view-progress-bar-line"}});this._stateNode=BX.create("DIV",{attrs:{className:"crm-view-progress-steps"}});this._wrapper.appendChild(BX.create("DIV",{attrs:{className:"crm-view-progress-inner"},children:[BX.create("DIV",{attrs:{className:"crm-view-progress-bar"},children:[this._progressNode]}),this._stateNode]}));if(BX.prop.getBoolean(this._settings,"enableCancellation",false)){this._wrapper.appendChild(BX.create("a",{attrs:{className:"crm-view-progress-link",href:"#"},text:BX.message("JS_CORE_WINDOW_CANCEL"),events:{click:BX.delegate(this.onCancelButtonClick,this)}}))}this._hasLayout=true},hasLayout:function(){return this._hasLayout},isHidden:function(){return this._isHidden},show:function(){if(!this._isHidden){return}if(!this._hasLayout){return}BX.removeClass(this._wrapper,"crm-view-progress-hide");BX.addClass(this._wrapper,"crm-view-progress-show");this._isHidden=false},hide:function(){if(this._isHidden){return}if(!this._hasLayout){return}BX.removeClass(this._wrapper,"crm-view-progress-show");BX.addClass(this._wrapper,"crm-view-progress-hide");this._isHidden=true},clearLayout:function(){if(!this._hasLayout){return}BX.remove(this._wrapper);this._wrapper=this._stateNode=null;this._hasLayout=false},getManager:function(){return this._manager},setManager:function(t){this._manager=t},onManagerStateChange:function(){if(!(this._hasLayout&&this._manager)){return}var t=this._manager.getState();if(t!==BX.AutoRunProcessState.error){var e=this._manager.getProcessedItemCount();var s=this._manager.getTotalItemCount();var r=0;if(s!==0){r=Math.floor(e/s*100);var i=r%5;if(i!==0){r-=i}}this._stateNode.innerHTML=e>0&&s>0?this.getSetting("stateTemplate","#processed# from #total#").replace("#processed#",e).replace("#total#",s):"";this._progressNode.className="crm-view-progress-bar-line";if(r>0){this._progressNode.className+=" crm-view-progress-line-"+r.toString()}}},onCancelButtonClick:function(t){this._manager.stop();return BX.eventReturnFalse(t)}};BX.AutorunProcessPanel.items={};BX.AutorunProcessPanel.isExists=function(t){return this.items.hasOwnProperty(t)};BX.AutorunProcessPanel.create=function(t,e){var s=new BX.AutorunProcessPanel;s.initialize(t,e);this.items[s.getId()]=s;return s}}if(typeof BX.Crm.ProcessSummaryPanel==="undefined"){BX.Crm.ProcessSummaryPanel=function(){this._id="";this._settings={};this._data=null;this._container=null;this._wrapper=null};BX.Crm.ProcessSummaryPanel.prototype={initialize:function(t,e){this._id=t;this._settings=e?e:{};this._container=BX(BX.prop.get(this._settings,"container"));if(!BX.type.isElementNode(this._container)){throw"BatchConversionPanel: Could not find container."}this._data=BX.prop.getObject(this._settings,"data",{})},getId:function(){return this._id},getMessage:function(t){var e=BX.prop.getObject(this._settings,"messages",BX.Crm.ProcessSummaryPanel.messages);return BX.prop.getString(e,t,t)},layout:function(){if(this._hasLayout){return}this._wrapper=BX.create("DIV",{attrs:{className:"crm-view-progress"}});BX.addClass(this._wrapper,this._isHidden?"crm-view-progress-hide":"crm-view-progress-show");BX.addClass(this._wrapper,"crm-view-progress-row-hidden");this._container.appendChild(this._wrapper);var t=[BX.create("span",{text:this.getMessage("summaryCaption")})];var e=new RegExp(BX.prop.getString(this._settings,"numberSubstitution","#number#"),"ig");var s=BX.prop.getInteger(this._data,"succeededCount",0);if(s>0){t.push(BX.create("span",{attrs:{className:"crm-view-progress-text"},text:this.getMessage("summarySucceeded").replace(e,s)}))}var r=BX.prop.getInteger(this._data,"failedCount",0);if(r>0){t.push(BX.create("span",{attrs:{className:"crm-view-progress-link crm-view-progress-text-button"},text:this.getMessage("summaryFailed").replace(e,r),events:{click:BX.delegate(this.onToggleErrorButtonClick,this)}}))}var i=[];i.push(BX.create("DIV",{attrs:{className:"crm-view-progress-info"},children:t}));i.push(BX.create("a",{attrs:{className:"crm-view-progress-link",href:"#"},text:BX.message("JS_CORE_WINDOW_CLOSE"),events:{click:BX.delegate(this.onCloseButtonClick,this)}}));this._wrapper.appendChild(BX.create("DIV",{attrs:{className:"crm-view-progress-row"},children:i}));var n=BX.prop.getArray(this._data,"errors",[]);if(n.length>0){for(var a=0,o=n.length;a<o;a++){var h=n[a];var u=[];var c=BX.prop.getObject(BX.prop.getObject(h,"customData",{}),"info",null);if(c){var l=BX.prop.getString(c,"title","");var p=BX.prop.getString(c,"showUrl","");if(l!==""&&p!==""){u.push(BX.create("a",{props:{className:"crm-view-progress-link",href:p,target:"_blank"},text:l+":"}))}}u.push(BX.create("span",{attrs:{className:"crm-view-progress-text"},text:h["message"]}));this._wrapper.appendChild(BX.create("DIV",{attrs:{className:"crm-view-progress-row"},children:[BX.create("DIV",{attrs:{className:"crm-view-progress-info"},children:u})]}))}}else{var _=this.getDisplayTimeout();if(_>0){window.setTimeout(function(){this.clearLayout()}.bind(this),_)}}this._hasLayout=true;BX.onCustomEvent(window,"BX.Crm.ProcessSummaryPanel:onLayout",[this])},hasLayout:function(){return this._hasLayout},isHidden:function(){return this._isHidden},show:function(){if(!this._isHidden){return}if(!this._hasLayout){return}BX.removeClass(this._wrapper,"crm-view-progress-hide");BX.addClass(this._wrapper,"crm-view-progress-show");this._isHidden=false},hide:function(){if(this._isHidden){return}if(!this._hasLayout){return}BX.removeClass(this._wrapper,"crm-view-progress-show");BX.addClass(this._wrapper,"crm-view-progress-hide");this._isHidden=true},clearLayout:function(){if(!this._hasLayout){return}BX.remove(this._wrapper);this._wrapper=null;this._hasLayout=false;BX.onCustomEvent(window,"BX.Crm.ProcessSummaryPanel:onClearLayout",[this])},getDisplayTimeout:function(){return BX.prop.getInteger(this._settings,"displayTimeout",0)},onCloseButtonClick:function(t){this.clearLayout();return BX.eventReturnFalse(t)},onToggleErrorButtonClick:function(){BX.toggleClass(this._wrapper,"crm-view-progress-row-hidden")}};if(typeof BX.Crm.ProcessSummaryPanel.messages==="undefined"){BX.Crm.ProcessSummaryPanel.messages={}}BX.Crm.ProcessSummaryPanel.create=function(t,e){var s=new BX.Crm.ProcessSummaryPanel;s.initialize(t,e);return s}} //# sourceMappingURL=autorun_proc.map.js
/var/www/axolotl/data/www/axolotl.ru/www/bitrix/js/crm/autorun_proc.min.js