本文整理汇总了PHP中CSaleOrder::CanUserChangeOrderStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleOrder::CanUserChangeOrderStatus方法的具体用法?PHP CSaleOrder::CanUserChangeOrderStatus怎么用?PHP CSaleOrder::CanUserChangeOrderStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSaleOrder
的用法示例。
在下文中一共展示了CSaleOrder::CanUserChangeOrderStatus方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fChangeOrderStatus
function fChangeOrderStatus($ID, $STATUS_ID)
{
global $APPLICATION;
global $crmMode;
$errorMessageTmp = "";
$STATUS_ID = trim($STATUS_ID);
if (strlen($STATUS_ID) <= 0)
$errorMessageTmp .= GetMessage("ERROR_NO_STATUS").". ";
if ('' == $errorMessageTmp)
{
if (!CSaleOrder::CanUserChangeOrderStatus($ID, $STATUS_ID, $GLOBALS["USER"]->GetUserGroupArray()))
$errorMessageTmp .= GetMessage("SOD_NO_PERMS2STATUS").". ";
}
if ('' == $errorMessageTmp)
{
if (!CSaleOrder::StatusOrder($ID, $STATUS_ID))
{
if ($ex = $APPLICATION->GetException())
{
if ($ex->GetID() != "ALREADY_FLAG")
$errorMessageTmp .= $ex->GetString();
}
else
$errorMessageTmp .= GetMessage("ERROR_CHANGE_STATUS").". ";
}
}
$arResult = array(
'STATUS_ERR' => false,
'STATUS_ERR_MESS' => '',
);
$dbOrder = CSaleOrder::GetList(
array("ID" => "DESC"),
array("ID" => $ID),
false,
false,
array("DATE_STATUS", "EMP_STATUS_ID", "STATUS_ID")
);
if ($arOrder = $dbOrder->Fetch())
{
$arResult["DATE_STATUS"] = $arOrder["DATE_STATUS"];
if (!$crmMode && IntVal($arOrder["EMP_STATUS_ID"]) > 0)
$arResult["EMP_STATUS_ID"] = GetFormatedUserName($arOrder["EMP_STATUS_ID"], false);
$arResult["STATUS_ID"] = $arOrder["STATUS_ID"];
}
if ('' != $errorMessageTmp)
{
$arResult['STATUS_ERR'] = true;
$arResult['STATUS_ERR_MESS'] = $errorMessageTmp;
}
return $arResult;
}
示例2: GetMessage
$lAdmin->AddGroupError(str_replace("#ID#", $ID, GetMessage("SOA_PERMS_CANCEL_GROUP")), $ID);
}
}
else
{
$lAdmin->AddGroupError(str_replace("#ID#", $ID, GetMessage("SOA_PERMS_CANCEL_GROUP_CANCEL_N")), $ID);
}
break;
default:
if(substr($_REQUEST['action'], 0, strlen("status_")) == "status_")
{
$statusID = substr($_REQUEST['action'], strlen("status_"));
if(strlen($statusID) > 0)
{
$arStatus = CSaleStatus::GetByID($statusID);
if(CSaleOrder::CanUserChangeOrderStatus($ID, $statusID, $arUserGroups))
{
if($arAffectedOrders[$ID]["STATUS_ID"] != $statusID)
{
if (!CSaleOrder::StatusOrder($ID, $statusID))
{
if ($ex = $APPLICATION->GetException())
$lAdmin->AddGroupError(GetMessage("SOA_ERROR_STATUS", Array("#ID#" => $ID, "#STATUS#" => $arStatus["NAME"])).": ".$ex->GetString(), $ID);
else
$lAdmin->AddGroupError(GetMessage("SOA_ERROR_STATUS", Array("#ID#" => $ID, "#STATUS#" => $arStatus["NAME"])), $ID);
}
}
else
{
$lAdmin->AddGroupError(GetMessage("SOA_ERROR_STATUS_ALREADY", Array("#ID#" => $ID, "#STATUS#" => $arStatus["NAME"])), $ID);
}
示例3: elseif
if ($deliver) {
$result = CSaleOrder::DeliverOrder($id, $deliver, 0, $arAdditionalFields);
} elseif (!empty($arAdditionalFields)) {
$result = CSaleOrder::Update($id, $arAdditionalFields);
}
break;
case "order_pay":
$bUserCanPayOrder = CSaleOrder::CanUserChangeOrderFlag($id, "PERM_PAYMENT", $GLOBALS["USER"]->GetUserGroupArray());
if (!$bUserCanPayOrder) {
break;
}
$payed = isset($_REQUEST['payed']) ? trim($_REQUEST['payed']) : 'N';
$pay_from_account = isset($_REQUEST['pay_from_account']) ? trim($_REQUEST['pay_from_account']) : 'N';
$pay_from_account_back = isset($_REQUEST['pay_from_account_back']) ? trim($_REQUEST['pay_from_account_back']) : 'N';
$arAdditionalFields = array();
if ($status_id && CSaleOrder::CanUserChangeOrderStatus($id, $status_id, $GLOBALS["USER"]->GetUserGroupArray())) {
$arAdditionalFields = array("STATUS_ID" => $status_id);
}
$bWithdraw = true;
$bPay = true;
if ($_REQUEST["pay_from_account"] == "Y") {
$bPay = false;
}
if ($payed == "N" && $_REQUEST["pay_from_account_back"] != "Y") {
$bWithdraw = false;
}
$result = CSaleOrder::PayOrder($id, $payed, $bWithdraw, $bPay, 0, $arAdditionalFields);
break;
}
echo $result;
}
示例4: GetMessage
$lAdmin->AddGroupError(str_replace("#ID#", $ID, GetMessage("SOA_ERROR_CANCEL_GROUP")), $ID);
}
}
} else {
$lAdmin->AddGroupError(str_replace("#ID#", $ID, GetMessage("SOA_PERMS_CANCEL_GROUP")), $ID);
}
} else {
$lAdmin->AddGroupError(str_replace("#ID#", $ID, GetMessage("SOA_PERMS_CANCEL_GROUP_CANCEL_N")), $ID);
}
break;
default:
if (substr($_REQUEST['action'], 0, strlen("status_")) == "status_") {
$statusID = substr($_REQUEST['action'], strlen("status_"));
if (strlen($statusID) > 0) {
$arStatus = CSaleStatus::GetByID($statusID);
if (CSaleOrder::CanUserChangeOrderStatus($ID, $statusID, $GLOBALS["USER"]->GetUserGroupArray())) {
if ($arAffectedOrders[$ID]["STATUS_ID"] != $statusID) {
if (!CSaleOrder::StatusOrder($ID, $statusID)) {
if ($ex = $APPLICATION->GetException()) {
$lAdmin->AddGroupError(GetMessage("SOA_ERROR_STATUS", array("#ID#" => $ID, "#STATUS#" => $arStatus["NAME"])) . ": " . $ex->GetString(), $ID);
} else {
$lAdmin->AddGroupError(GetMessage("SOA_ERROR_STATUS", array("#ID#" => $ID, "#STATUS#" => $arStatus["NAME"])), $ID);
}
}
} else {
$lAdmin->AddGroupError(GetMessage("SOA_ERROR_STATUS_ALREADY", array("#ID#" => $ID, "#STATUS#" => $arStatus["NAME"])), $ID);
}
} else {
$lAdmin->AddGroupError(GetMessage("SOA_PERMS_STATUS_GROUP", array("#ID#" => $ID, "#STATUS#" => $arStatus["NAME"])), $ID);
}
}