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
/
counter.js
/
/
BX.namespace("BX.Crm"); if(typeof BX.Crm.EntityCounterManager === "undefined") { BX.Crm.EntityCounterManager = function() { this._id = ""; this._settings = {}; this._entityTypeId = 0; this._codes = null; this._extras = null; this._counterData = null; this._serviceUrl = ""; this._isRequestRunning = false; }; BX.Crm.EntityCounterManager.prototype = { initialize: function(id, settings) { this._id = BX.type.isNotEmptyString(id) ? id : BX.util.getRandomString(4); this._settings = settings ? settings : {}; this._entityTypeId = BX.prop.getInteger(this._settings, "entityTypeId", 0); this._codes = BX.prop.getArray(this._settings, "codes", []); this._extras = BX.prop.getObject(this._settings, "extras", {}); this._serviceUrl = BX.prop.getString(this._settings, "serviceUrl", ""); this._counterData = {}; BX.addCustomEvent("onPullEvent-main", BX.delegate(this.onPullEvent, this)); }, getId: function() { return this._id; }, getEntityTypeId: function() { return this._entityTypeId; }, getEntityTypeName: function() { return BX.CrmEntityType.resolveName(this._entityTypeId); }, getCounterData: function() { return this._counterData; }, setCounterData: function(data) { this._counterData = data; }, onPullEvent: function(command, params) { if (command !== "user_counter") { return; } var enableRecalculation = false; var counterData = BX.prop.getObject(params, BX.message("SITE_ID"), {}); for (var counterId in counterData) { if (!counterData.hasOwnProperty(counterId)) { continue; } if(this._codes.indexOf(counterId) < 0) { continue; } if(BX.prop.getInteger(counterData, counterId, 0) < 0) { enableRecalculation = true; break; } } if(enableRecalculation) { this.startRecalculationRequest(); } }, startRecalculationRequest: function() { if(this._isRequestRunning) { return; } this._isRequestRunning = true; BX.ajax( { url: this._serviceUrl, method: "POST", dataType: "json", data: { "ACTION": "RECALCULATE", "ENTITY_TYPES": [ BX.CrmEntityType.resolveName(this._entityTypeId) ], "EXTRAS": this._extras }, onsuccess: BX.delegate(this.onRecalculationSuccess, this) } ); }, onRecalculationSuccess: function(result) { this._isRequestRunning = false; var data = BX.prop.getObject(result, "DATA", null); if(!data) { return; } this.setCounterData( BX.prop.getObject( data, BX.CrmEntityType.resolveName(this._entityTypeId), {} ) ); } }; BX.Crm.EntityCounterManager.instances = {}; BX.Crm.EntityCounterManager.create = function(id, settings) { var self = new BX.Crm.EntityCounterManager(); self.initialize(id, settings); this.instances[self.getId()] = self; return self; } }
/var/www/axolotl/data/www/axolotl.ru/www/bitrix/js/crm/counter.js