本文整理汇总了PHP中Bitrix\Sale\Order::getLockedStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP Order::getLockedStatus方法的具体用法?PHP Order::getLockedStatus怎么用?PHP Order::getLockedStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bitrix\Sale\Order
的用法示例。
在下文中一共展示了Order::getLockedStatus方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: intval
}
$ID = intval($_REQUEST["ID"]);
$intLockUserID = 0;
$strLockTime = '';
if (isset($_REQUEST['dontsave']) && $_REQUEST['dontsave'] == 'Y') {
if (!\Bitrix\Sale\Order::isLocked($ID)) {
\Bitrix\Sale\Order::unlock($ID);
}
\Bitrix\Sale\DiscountCouponsManager::clearByOrder($ID);
LocalRedirect("sale_order.php?lang=" . LANGUAGE_ID . GetFilterParams("filter_", false));
}
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sale/lib/helpers/admin/orderedit.php";
//load order
$boolLocked = \Bitrix\Sale\Order::isLocked($ID);
if ($boolLocked) {
$r = \Bitrix\Sale\Order::getLockedStatus($ID);
if ($r->isSuccess()) {
$lockResult = $r->getData();
if (array_key_exists('LOCKED_BY', $lockResult) && intval($lockResult['LOCKED_BY']) > 0) {
$intLockUserID = intval($lockResult['LOCKED_BY']);
}
if (array_key_exists('DATE_LOCK', $lockResult) && $lockResult['DATE_LOCK'] instanceof \Bitrix\Main\Type\DateTime) {
$strLockTime = $lockResult['DATE_LOCK']->toString();
}
}
$strLockUser = $intLockUserID;
$strLockUserInfo = $intLockUserID;
$userIterator = \Bitrix\Main\UserTable::getList(array('select' => array('ID', 'LOGIN', 'NAME', 'LAST_NAME', 'SECOND_NAME', 'EMAIL'), 'filter' => array('=ID' => $intLockUserID)));
if ($arOneUser = $userIterator->fetch()) {
$strLockUser = CUser::FormatName($strNameFormat, $arOneUser);
$strLockUserInfo = '<a href="/bitrix/admin/user_edit.php?lang=' . LANGUAGE_ID . '&ID=' . $intLockUserID . '">' . $strLockUser . '</a>';
示例2: LocalRedirect
$boolLocked = false;
if ($saleModulePermissions == "D") {
$APPLICATION->AuthForm(Loc::getMessage("ACCESS_DENIED"));
}
/** @var \Bitrix\Sale\Order $order */
if (!isset($_REQUEST["ID"]) || intval($_REQUEST["ID"]) <= 0) {
LocalRedirect("/bitrix/admin/sale_order.php?lang=" . LANGUAGE_ID . GetFilterParams("filter_", false));
}
$ID = intval($_REQUEST["ID"]);
$boolLocked = \Bitrix\Sale\Order::isLocked($ID);
if ($boolLocked) {
LocalRedirect("sale_order_view.php?ID=" . $ID . "&lang=" . LANGUAGE_ID . GetFilterParams("filter_", false));
}
//Unlocking if we leave this page
if (isset($_REQUEST['unlock']) && 'Y' == $_REQUEST['unlock']) {
$lockStatusRes = \Bitrix\Sale\Order::getLockedStatus($ID);
if ($lockStatusRes->isSuccess()) {
$lockStatusData = $lockStatusRes->getData();
}
if (isset($lockStatusData['LOCK_STATUS']) && ($lockStatusData['LOCK_STATUS'] != \Bitrix\Sale\Order::SALE_ORDER_LOCK_STATUS_RED || !isset($_REQUEST['target']))) {
$res = \Bitrix\Sale\Order::unlock($ID);
if ($res->isSuccess()) {
\Bitrix\Sale\DiscountCouponsManager::clearByOrder($ID);
}
}
if (isset($_REQUEST['target']) && 'list' == $_REQUEST['target']) {
LocalRedirect("sale_order.php?lang=" . LANGUAGE_ID . GetFilterParams("filter_", false));
} else {
LocalRedirect("sale_order_edit.php?ID=" . $ID . "&lang=" . LANGUAGE_ID . GetFilterParams("filter_", false));
}
}