當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CSaleOrder::CanUserChangeOrderStatus方法代碼示例

本文整理匯總了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;
}
開發者ID:akniyev,項目名稱:arteva.ru,代碼行數:59,代碼來源:admin_tool.php

示例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);
								}
開發者ID:akniyev,項目名稱:arteva.ru,代碼行數:31,代碼來源:order.php

示例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;
}
開發者ID:Satariall,項目名稱:izurit,代碼行數:31,代碼來源:ajax.php

示例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);
             }
         }
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:31,代碼來源:order.php


注:本文中的CSaleOrder::CanUserChangeOrderStatus方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。