403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/calendar/controls/src/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/calendar/controls/src/busyusersdialog.js
import { Loc, Text } from 'main.core';
import { EventEmitter } from 'main.core.events';
import { MessageBox } from 'ui.dialogs.messagebox';
import { Button, ButtonSize, ButtonColor } from 'ui.buttons';

export class BusyUsersDialog extends EventEmitter
{
	DOM = {};
	constructor()
	{
		super();
		this.setEventNamespace('BX.Calendar.Controls.ConfirmStatusDialog');
		this.zIndex = 3200;
		this.id = 'busy-user-dialog-' + Math.round(Math.random() * 10000);
	}

	show(params = {})
	{
		this.plural = params.users.length > 1;

		const userNames = [];
		params.users.forEach((user) => {
			userNames.push(user.DISPLAY_NAME);
		});

		const userNamesPrepared = userNames.join(', ');

		const message = this.plural
			? Loc.getMessage('EC_BUSY_USERS_PLURAL').replace('#USER_LIST#', userNamesPrepared)
			: Loc.getMessage('EC_BUSY_USERS_SINGLE').replace('#USER_NAME#', params.users[0].DISPLAY_NAME)
		;

		this.dialog = new MessageBox({
			title: Loc.getMessage('EC_BUSY_USERS_TITLE'),
			message: Text.encode(message),
			buttons: this.getButtons(),
			popupOptions: {
				autoHide: true,
				closeByEsc: true,
				draggable: false,
				closeIcon: true,
				maxWidth: 700,
				minHeight: 150,
				animation: 'fading-slide',
			},
		});

		this.dialog.show();
	}

	getButtons()
	{
		return [
			new Button({
				size: ButtonSize.SMALL,
				color: ButtonColor.PRIMARY,
				text: Loc.getMessage('EC_BUSY_USERS_BACK2EDIT'),
				events: {
					click: () => {
						this.emit('onContinueEditing');
						this.close();
					},
				},
			}),
			new Button({
				size: ButtonSize.SMALL,
				color: ButtonColor.LIGHT_BORDER,
				text: this.plural
					? Loc.getMessage('EC_BUSY_USERS_EXCLUDE_PLURAL')
					: Loc.getMessage('EC_BUSY_USERS_EXCLUDE_SINGLE')
				,
				events: {
					click : () => {
						this.emit('onSaveWithout');
						this.close();
					},
				},
			}),
		];
	}

	close()
	{
		if (this.dialog)
		{
			this.dialog.close();
		}
	}

	isShown()
	{
		if (this.dialog)
		{
			return this.dialog.getPopupWindow().isShown();
		}

		return false;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit