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/sectioninterface/src/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/calendar/sectioninterface/src/trackingtypesform.js
import { Dom, Loc, Tag, Type } from 'main.core';
import { Util } from 'calendar.util';
import { TrackingUsersForm } from './trackingusersform';

/* eslint-disable @bitrix24/bitrix24-rules/no-native-dom-methods */
export class TrackingTypesForm extends TrackingUsersForm
{
	constructor(options = {})
	{
		super(options);
		this.trackingGroups = options.trackingGroups || [];
		this.interfaceType = 'company';
		this.selectGroups = true;
		this.selectUsers = false;
		this.addLinkMessage = Loc.getMessage('EC_SEC_SLIDER_SELECT_GROUPS');
	}

	show()
	{
		if (!this.isCreated)
		{
			this.create();
		}

		this.updateSectionList();
		this.isOpenedState = true;
		Dom.addClass(this.DOM.outerWrap, 'show');
	}

	create()
	{
		if (!this.DOM.innerWrap)
		{
			this.DOM.innerWrap = this.DOM.outerWrap.appendChild(Tag.render`<div></div>`);
		}

		// List of sections
		this.sectionsWrap = this.DOM.innerWrap.appendChild(
			Tag.render`<div class="calendar-list-slider-sections-wrap"></div>`,
		);

		this.createButtons();

		this.isCreated = true;
	}

	updateSectionList()
	{
		if (this.updateSectionLoader)
		{
			Dom.remove(this.updateSectionLoader);
		}
		this.updateSectionLoader = this.sectionsWrap.appendChild(
			Dom.adjust(Util.getLoader(), { style: { height: '140px' } }),
		);

		if (this.updateSectionTimeout)
		{
			clearTimeout(this.updateSectionTimeout);
			this.updateSectionTimeout = null;
		}

		BX.ajax.runAction('calendar.api.calendarajax.getTrackingSections', {
			data: {
				type: 'company',
			},
		}).then(
			(response) => {
				Dom.clean(this.sectionsWrap);
				this.sectionIndex = {};
				this.checkInnerWrapHeight();

				if (
					Type.isArray(response.data.sections)
					&& response.data.sections.length)
				{
					this.createSectionBlock({
						sectionList: response.data.sections,
						wrap: this.sectionsWrap,
					});
				}
				else
				{
					this.sectionsWrap.appendChild(Tag.render`
						<div>
							<span class="calendar-list-slider-card-section-title-text">
								${Loc.getMessage('EC_SEC_SLIDER_NO_SECTIONS')}
							</span>
						</div>
					`);
				}
			},
			(response) => {
				Util.displayError(response.errors);
			},
		);

		this.checkInnerWrapHeight();
	}

	save()
	{
		BX.ajax.runAction('calendar.api.calendarajax.setTrackingSections', {
			data: {
				sections: this.prepareTrackingSections(),
			},
		}).then(
			() => location.reload(),
			(response) => Util.displayError(response.errors),
		);

		this.close();
	}

	getSelectedSections(): Array<number>
	{
		const sections = [];
		this.superposedSections.forEach((section) => sections.push(parseInt(section.id, 10)));

		return sections;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit