本文整理汇总了PHP中CSaleOrder::CanUserViewOrder方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleOrder::CanUserViewOrder方法的具体用法?PHP CSaleOrder::CanUserViewOrder怎么用?PHP CSaleOrder::CanUserViewOrder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSaleOrder
的用法示例。
在下文中一共展示了CSaleOrder::CanUserViewOrder方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ShowError
<?php
if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) {
die;
}
if (!CModule::IncludeModule('sale')) {
ShowError(GetMessage("SMOT_SALE_NOT_INSTALLED"));
return;
}
if (!CModule::IncludeModule('mobileapp')) {
ShowError("SMOT_MOBILEAPP_NOT_INSTALLED");
return;
}
if (isset($_REQUEST['id'])) {
$orderId = $_REQUEST['id'];
} else {
return;
}
$bUserCanViewOrder = CSaleOrder::CanUserViewOrder($orderId, $GLOBALS["USER"]->GetUserGroupArray(), $GLOBALS["USER"]->GetID());
if (!$bUserCanViewOrder) {
echo ShowError(GetMessage("SMOT_NO_PERMS2VIEW"));
return;
}
$arResult["ORDER"] = CSaleMobileOrderUtils::getOrderInfoDetail($orderId);
$arResult["TYPES"] = array("ORDER_PAY" => GetMessage("SMOT_TR_TYPE_PAYMENT"), "CC_CHARGE_OFF" => GetMessage("SMOT_TR_TYPE_FROM_CARD"), "OUT_CHARGE_OFF" => GetMessage("SMOT_TR_TYPE_INPUT"), "ORDER_UNPAY" => GetMessage("SMOT_TR_TYPE_CANCEL_PAYMENT"), "ORDER_CANCEL_PART" => GetMessage("SMOT_TR_TYPE_CANCEL_SEMIPAYMENT"), "MANUAL" => GetMessage("SMOT_TR_TYPE_HAND"), "DEL_ACCOUNT" => GetMessage("SMOT_TR_TYPE_DELETE"), "AFFILIATE" => GetMessage("SMOT_MOBILEAPP_NOT_INSTALLED"));
$dbTransact = CSaleUserTransact::GetList(array("TRANSACT_DATE" => "DESC"), array("ORDER_ID" => $orderId), false, false, array("ID", "USER_ID", "AMOUNT", "CURRENCY", "DEBIT", "ORDER_ID", "DESCRIPTION", "NOTES", "TIMESTAMP_X", "TRANSACT_DATE"));
while ($arTransact = $dbTransact->Fetch()) {
$arTransact["AMOUNT_PREPARED"] = ($arTransact["DEBIT"] == "Y" ? "+" : "-") . SaleFormatCurrency($arTransact["AMOUNT"], $arTransact["CURRENCY"]);
$arResult["TRANSACTS"][] = $arTransact;
}
$this->IncludeComponentTemplate();
示例2: array
)
);
}
if ($boolLocked && $saleModulePermissions >= 'W')
{
$aMenu[] = array(
"TEXT" => GetMessage("SOE_TO_UNLOCK"),
"LINK" => "/bitrix/admin/sale_order_new.php?ID=".$ID."&unlock=Y&lang=".LANGUAGE_ID.GetFilterParams("filter_"),
);
}
$link = urlencode(DeleteParam(array("mode")));
$link = urlencode($APPLICATION->GetCurPage())."?mode=settings".($link <> "" ? "&".$link: "");
$bUserCanViewOrder = CSaleOrder::CanUserViewOrder($ID, $arUserGroups, $intUserID);
$bUserCanEditOrder = CSaleOrder::CanUserUpdateOrder($ID, $arUserGroups, $LID);
$bUserCanDeleteOrder = CSaleOrder::CanUserDeleteOrder($ID, $arUserGroups, $intUserID);
$bUserCanCancelOrder = CSaleOrder::CanUserCancelOrder($ID, $arUserGroups, $intUserID);
$bUserCanDeductOrder = CSaleOrder::CanUserChangeOrderFlag($ID, "PERM_DEDUCTION", $arUserGroups);
$bUserCanMarkOrder = CSaleOrder::CanUserMarkOrder($ID, $arUserGroups, $intUserID);
$bUserCanPayOrder = CSaleOrder::CanUserChangeOrderFlag($ID, "P", $arUserGroups);
$bUserCanDeliverOrder = CSaleOrder::CanUserChangeOrderFlag($ID, "D", $arUserGroups);
if ($bUserCanViewOrder && $ID > 0)
{
$aMenu[] = array(
"TEXT" => GetMessage("NEWO_DETAIL"),
"TITLE"=>GetMessage("NEWO_DETAIL_TITLE"),
"LINK" => "/bitrix/admin/sale_order_detail.php?ID=".$ID."&lang=".LANGUAGE_ID.GetFilterParams("filter_")
);
示例3: checkRights
private static function checkRights($userId, $eventId, $arParams)
{
$orderId = $arParams["ORDER_ID"];
$arUserGroups = CUser::GetUserGroup($userId);
return CSaleOrder::CanUserViewOrder($orderId, $arUserGroups, $userId);
}