8namespace Bitrix\Sender\Internals;
10use Bitrix\Main\Application;
11use Bitrix\Main\Loader;
12use Bitrix\Main\Localization\Loc;
13use Bitrix\Main\ModuleManager;
14use Bitrix\Main\UserTable;
16use Bitrix\Sender\Internals\Model\QueueTable;
18Loc::loadMessages(__FILE__);
59 $this->isAutoSaveEnabled =
false;
81 $this->isUserCheckEnabled =
true;
126 $this->previousStack = [];
145 public function delete()
147 QueueTable::delete([
'ENTITY_TYPE' => $this->type,
'ENTITY_ID' => $this->
id]);
158 return ModuleManager::isModuleInstalled(
'timeman');
168 if (!$this->isLastItemRestored)
171 $this->isLastItemRestored =
true;
184 $sqlHelper = Application::getConnection()->getSqlHelper();
192 'LAST_ITEM' => $item,
195 'LAST_ITEM' => $item,
199 Application::getConnection()->query($queries[0]);
216 $row = QueueTable::getRow([
217 'select' => [
'LAST_ITEM'],
218 'filter' => [
'=ENTITY_TYPE' => $this->type,
'=ENTITY_ID' => $this->
id]
220 $this->
setLastItem($row ? $row[
'LAST_ITEM'] :
null);
235 if (
count($this->list) == 0)
241 $reservedItem =
null;
243 foreach (
$list as $item)
245 if ($this->isUserCheckEnabled && !$this->
checkUser($item))
254 $reservedItem = $item;
266 $nextItem = $reservedItem ? $reservedItem :
$list[0];
271 if ($this->isAutoSaveEnabled)
287 if (
count($this->previousStack) === 0)
289 $this->isLastItemRestored =
false;
290 $this->lastItem =
null;
294 $this->lastItem = array_pop($this->previousStack);
304 if (
count($this->previousStack) >= 3)
306 array_shift($this->previousStack);
308 array_push($this->previousStack, $this->lastItem);
310 $this->lastItem = $item;
317 if (!$this->
current() || !in_array($this->
current(), $this->list))
322 $lastPosition = array_search($this->
current(), $this->list);
324 if ($lastPosition >=
count($this->list))
328 $list = array_slice($this->list, $lastPosition);
329 if ($lastPosition > 0)
333 array_slice($this->list, 0, $lastPosition)
347 $row = UserTable::getRowById(
$userId);
348 return is_array($row);
353 if (!self::isSupportedWorkTime())
358 if (!Loader::includeModule(
'timeman'))
363 $timeManUser = new \CTimeManUser(
$userId);
364 $timeManSettings = $timeManUser->GetSettings(Array(
'UF_TIMEMAN'));
365 if (!$timeManSettings[
'UF_TIMEMAN'])
371 $timeManUser->GetCurrentInfo(
true);
373 if ($timeManUser->State() ==
'OPENED')
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
static getConflictFields()
__construct($type, $id, array $list=[])
static checkUserWorkTime($userId)
static isSupportedWorkTime()
static checkUser($userId)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"