当前位置: 首页>>代码示例>>PHP>>正文


PHP CSaleStatus::GetByID方法代码示例

本文整理汇总了PHP中CSaleStatus::GetByID方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleStatus::GetByID方法的具体用法?PHP CSaleStatus::GetByID怎么用?PHP CSaleStatus::GetByID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CSaleStatus的用法示例。


在下文中一共展示了CSaleStatus::GetByID方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: CreateMailTemplate

 public static function CreateMailTemplate($ID)
 {
     $ID = trim($ID);
     if ('' == $ID) {
         return false;
     }
     if (!($arStatus = CSaleStatus::GetByID($ID, LANGUAGE_ID))) {
         return false;
     }
     $eventType = new CEventType();
     $eventMessage = new CEventMessage();
     $eventType->Delete("SALE_STATUS_CHANGED_" . $ID);
     $b = 'sort';
     $o = 'asc';
     $dbSiteList = CSite::GetList($b, $o);
     while ($arSiteList = $dbSiteList->Fetch()) {
         IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sale/general/status.php", $arSiteList["LANGUAGE_ID"]);
         $arStatusLang = CSaleStatus::GetLangByID($ID, $arSiteList["LANGUAGE_ID"]);
         $dbEventType = $eventType->GetList(array("EVENT_NAME" => "SALE_STATUS_CHANGED_" . $ID, "LID" => $arSiteList["LANGUAGE_ID"]));
         if (!($arEventType = $dbEventType->Fetch())) {
             $str = "";
             $str .= "#ORDER_ID# - " . GetMessage("SKGS_ORDER_ID") . "\n";
             $str .= "#ORDER_DATE# - " . GetMessage("SKGS_ORDER_DATE") . "\n";
             $str .= "#ORDER_STATUS# - " . GetMessage("SKGS_ORDER_STATUS") . "\n";
             $str .= "#EMAIL# - " . GetMessage("SKGS_ORDER_EMAIL") . "\n";
             $str .= "#ORDER_DESCRIPTION# - " . GetMessage("SKGS_STATUS_DESCR") . "\n";
             $str .= "#TEXT# - " . GetMessage("SKGS_STATUS_TEXT") . "\n";
             $str .= "#SALE_EMAIL# - " . GetMessage("SKGS_SALE_EMAIL") . "\n";
             $eventTypeID = $eventType->Add(array("LID" => $arSiteList["LANGUAGE_ID"], "EVENT_NAME" => "SALE_STATUS_CHANGED_" . $ID, "NAME" => GetMessage("SKGS_CHANGING_STATUS_TO") . " \"" . $arStatusLang["NAME"] . "\"", "DESCRIPTION" => $str));
         }
         $dbEventMessage = $eventMessage->GetList($b = "", $o = "", array("EVENT_NAME" => "SALE_STATUS_CHANGED_" . $ID, "SITE_ID" => $arSiteList["LID"]));
         if (!($arEventMessage = $dbEventMessage->Fetch())) {
             $subject = GetMessage("SKGS_STATUS_MAIL_SUBJ");
             $message = GetMessage("SKGS_STATUS_MAIL_BODY1");
             $message .= "------------------------------------------\n\n";
             $message .= GetMessage("SKGS_STATUS_MAIL_BODY2");
             $message .= GetMessage("SKGS_STATUS_MAIL_BODY3");
             $message .= "#ORDER_STATUS#\n";
             $message .= "#ORDER_DESCRIPTION#\n";
             $message .= "#TEXT#\n\n";
             $message .= "#SITE_NAME#\n";
             $arFields = array("ACTIVE" => "Y", "EVENT_NAME" => "SALE_STATUS_CHANGED_" . $ID, "LID" => $arSiteList["LID"], "EMAIL_FROM" => "#SALE_EMAIL#", "EMAIL_TO" => "#EMAIL#", "SUBJECT" => $subject, "MESSAGE" => $message, "BODY_TYPE" => "text");
             $eventMessageID = $eventMessage->Add($arFields);
         }
     }
     return true;
 }
开发者ID:rasuldev,项目名称:torino,代码行数:47,代码来源:status.php

示例2: StatusOrder

 function StatusOrder($ID, $val)
 {
     global $DB, $USER;
     $ID = IntVal($ID);
     $val = trim($val);
     foreach (GetModuleEvents("sale", "OnSaleBeforeStatusOrder", true) as $arEvent) {
         if (ExecuteModuleEventEx($arEvent, array($ID, $val)) === false) {
             return false;
         }
     }
     $arFields = array("STATUS_ID" => $val, "=DATE_STATUS" => $DB->GetNowFunction(), "EMP_STATUS_ID" => IntVal($USER->GetID()) > 0 ? IntVal($USER->GetID()) : false);
     $res = CSaleOrder::Update($ID, $arFields);
     unset($GLOBALS["SALE_ORDER"]["SALE_ORDER_CACHE_" . $ID]);
     foreach (GetModuleEvents("sale", "OnSaleStatusOrder", true) as $arEvent) {
         ExecuteModuleEventEx($arEvent, array($ID, $val));
     }
     CTimeZone::Disable();
     $arOrder = CSaleOrder::GetByID($ID);
     CTimeZone::Enable();
     $userEmail = "";
     $dbOrderProp = CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $ID, "PROP_IS_EMAIL" => "Y"));
     if ($arOrderProp = $dbOrderProp->Fetch()) {
         $userEmail = $arOrderProp["VALUE"];
     }
     if (strlen($userEmail) <= 0) {
         $dbUser = CUser::GetByID($arOrder["USER_ID"]);
         if ($arUser = $dbUser->Fetch()) {
             $userEmail = $arUser["EMAIL"];
         }
     }
     $dbSite = CSite::GetByID($arOrder["LID"]);
     $arSite = $dbSite->Fetch();
     $arStatus = CSaleStatus::GetByID($arOrder["STATUS_ID"], $arSite["LANGUAGE_ID"]);
     $arFields = array("ORDER_ID" => $ID, "ORDER_DATE" => $arOrder["DATE_INSERT_FORMAT"], "ORDER_STATUS" => $arStatus["NAME"], "EMAIL" => $userEmail, "ORDER_DESCRIPTION" => $arStatus["DESCRIPTION"], "TEXT" => "", "SALE_EMAIL" => COption::GetOptionString("sale", "order_email", "order@" . $_SERVER["SERVER_NAME"]));
     foreach (GetModuleEvents("sale", "OnSaleStatusEMail", true) as $arEvent) {
         $arFields["TEXT"] = ExecuteModuleEventEx($arEvent, array($ID, $arStatus["ID"]));
     }
     $eventName = "SALE_STATUS_CHANGED_" . $arOrder["STATUS_ID"];
     $bSend = true;
     foreach (GetModuleEvents("sale", "OnOrderStatusSendEmail", true) as $arEvent) {
         if (ExecuteModuleEventEx($arEvent, array($ID, &$eventName, &$arFields, $arOrder["STATUS_ID"])) === false) {
             $bSend = false;
         }
     }
     if ($bSend) {
         $eventMessage = new CEventMessage();
         $dbEventMessage = $eventMessage->GetList($b = "", $o = "", array("EVENT_NAME" => $eventName, "SITE_ID" => $arOrder["LID"]));
         if (!($arEventMessage = $dbEventMessage->Fetch())) {
             $eventName = "SALE_STATUS_CHANGED";
         }
         $event = new CEvent();
         $event->Send($eventName, $arOrder["LID"], $arFields, "N");
     }
     return $res;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:55,代码来源:order.php

示例3: GetMessage

    echo "[" . $str_LID . "] ";
    $db_lang = CLang::GetByID($str_LID);
    if ($arLang = $db_lang->GetNext()) {
        echo $arLang["NAME"];
    }
    ?>
			</td>
		</tr>
		<tr>
			<td><?php 
    echo GetMessage("P_ORDER_STATUS");
    ?>
:</td>
			<td>
				<?php 
    $ar_status = CSaleStatus::GetByID($str_STATUS_ID);
    ?>
				[<?php 
    echo $ar_status["ID"];
    ?>
] <?php 
    echo htmlspecialcharsbx($ar_status["NAME"]);
    ?>
			</td>
		</tr>
		<tr>
			<td>
				<?php 
    echo GetMessage("P_ORDER_CANCELED");
    ?>
 / <?php 
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:order_print.php

示例4: empty

					array("ID", "NAME")
				);
			$arStatusList = $dbStatusList->GetNext();
		}

		if ($row->bEditMode !== true
			|| $row->bEditMode && !$arStatusList)
		{
			$fieldValue = "";
			$fieldValueTmp = "";
			if (in_array("STATUS_ID", $arVisibleColumns))
			{
				if (!isset($LOCAL_STATUS_CACHE[$arOrder["STATUS_ID"]])
					|| empty($LOCAL_STATUS_CACHE[$arOrder["STATUS_ID"]]))
				{
					if ($arStatus = CSaleStatus::GetByID($arOrder["STATUS_ID"]))
						$LOCAL_STATUS_CACHE[$arOrder["STATUS_ID"]] = htmlspecialcharsEx($arStatus["NAME"]);
				}

				$fieldValueTmp .= "[";
				if ($saleModulePermissions >= "W")
					$fieldValueTmp .= '<a href="/bitrix/admin/sale_status_edit.php?ID='.$arOrder["STATUS_ID"].'&lang='.LANGUAGE_ID.'">';
				$fieldValueTmp .= $arOrder["STATUS_ID"];
				if ($saleModulePermissions >= "W")
					$fieldValueTmp .= "</a>";

				$fieldValueTmp .= "] ".$LOCAL_STATUS_CACHE[$arOrder["STATUS_ID"]];

				$fieldValue .= '<span id="status_order_'.$arOrder["ID"].'">'.$LOCAL_STATUS_CACHE[$arOrder["STATUS_ID"]].'</span>';

				$fieldValueTmp .= "<br />".$arOrder["DATE_STATUS"];
开发者ID:akniyev,项目名称:arteva.ru,代码行数:31,代码来源:order.php

示例5: onSaleOrderStatusChangeSendEmail

 /**
  * @param Main\Event $event
  *
  * @return Main\EventResult
  * @throws Main\ObjectNotFoundException
  */
 public static function onSaleOrderStatusChangeSendEmail(Main\Event $event)
 {
     $parameters = $event->getParameters();
     /** @var Sale\Order $basketItem */
     $order = $parameters['ENTITY'];
     $value = $parameters['VALUE'];
     $oldValue = $parameters['OLD_VALUE'];
     if (!$order instanceof Sale\Order) {
         return new Main\EventResult(Main\EventResult::ERROR, new Sale\ResultError(Main\Localization\Loc::getMessage('SALE_EVENT_COMPATIBILITY_ORDER_STATUS_CHANGE_WRONG_ORDER'), 'SALE_EVENT_COMPATIBILITY_ORDER_STATUS_CHANGE_WRONG_ORDER'), 'sale');
     }
     $orderFields = array();
     /** @var Sale\Result $resultOrderFields */
     $resultOrderFields = OrderCompatibility::getOrderFields($order);
     if ($resultOrderFields->isSuccess()) {
         if ($orderFieldsResultData = $resultOrderFields->getData()) {
             if (!empty($orderFieldsResultData['ORDER_FIELDS']) && is_array($orderFieldsResultData['ORDER_FIELDS'])) {
                 $orderFields = $orderFieldsResultData['ORDER_FIELDS'];
             }
         }
     }
     \CSaleMobileOrderPush::send(static::EVENT_COMPATIBILITY_MOBILE_PUSH_ORDER_STATUS_CHANGE, array("ORDER" => $orderFields));
     $propertyCollection = $order->getPropertyCollection();
     $userEmail = "";
     /** @var Sale\PropertyValue $userEmailProperty */
     if ($userEmailProperty = $propertyCollection->getUserEmail()) {
         $userEmail = $userEmailProperty->getValue();
     }
     if (strval(trim($userEmail)) == '') {
         $userRes = \CUser::GetByID($order->getUserId());
         if ($userData = $userRes->fetch()) {
             $userEmail = $userData["EMAIL"];
         }
     }
     static $cacheSiteData = array();
     if (!isset($cacheSiteData[$order->getSiteId()])) {
         $siteRes = \CSite::GetByID($order->getSiteId());
         $siteData = $siteRes->Fetch();
     } else {
         $siteData = $cacheSiteData[$order->getSiteId()];
     }
     if (($statusData = \CSaleStatus::GetByID($order->getField("STATUS_ID"), $siteData['LANGUAGE_ID'])) && $statusData['NOTIFY'] == "Y") {
         $fields = array("ORDER_ID" => $order->getField("ACCOUNT_NUMBER"), "ORDER_DATE" => $order->getField("DATE_INSERT")->toString(), "ORDER_STATUS" => $statusData["NAME"], "EMAIL" => $userEmail, "ORDER_DESCRIPTION" => $statusData["DESCRIPTION"], "TEXT" => "", "SALE_EMAIL" => Main\Config\Option::get("sale", "order_email", "order@" . $_SERVER["SERVER_NAME"]));
         foreach (GetModuleEvents("sale", static::EVENT_COMPATIBILITY_ORDER_STATUS_EMAIL, true) as $oldEvent) {
             $fields["TEXT"] = ExecuteModuleEventEx($oldEvent, array($order->getId(), $statusData["ID"]));
         }
         $eventName = "SALE_STATUS_CHANGED_" . $order->getField("STATUS_ID");
         $isSend = true;
         foreach (GetModuleEvents("sale", static::EVENT_COMPATIBILITY_ORDER_STATUS_SEND_EMAIL, true) as $oldEvent) {
             if (ExecuteModuleEventEx($oldEvent, array($order->getId(), &$eventName, &$fields, $order->getField("STATUS_ID"))) === false) {
                 $isSend = false;
             }
         }
         if ($isSend) {
             $b = '';
             $o = '';
             $eventMessage = new \CEventMessage();
             $eventMessageRes = $eventMessage->GetList($b, $o, array("EVENT_NAME" => $eventName, "SITE_ID" => $order->getSiteId(), 'ACTIVE' => 'Y'));
             if (!($eventMessageData = $eventMessageRes->Fetch())) {
                 $eventName = "SALE_STATUS_CHANGED";
             }
             unset($o, $b);
             $event = new \CEvent();
             $event->Send($eventName, $order->getSiteId(), $fields, "N");
         }
     }
     return new Main\EventResult(Main\EventResult::SUCCESS, null, 'sale');
 }
开发者ID:Satariall,项目名称:izurit,代码行数:73,代码来源:eventcompatibility.php

示例6: mapYandexStatusToOrder

 protected function mapYandexStatusToOrder($order, $yandexStatus, $cancelReason = "")
 {
     global $APPLICATION;
     if (!is_array($order) || !isset($order["ID"]) || strlen($yandexStatus) <= 0) {
         return false;
     }
     $settings = $this->getSettingsBySiteId($order["LID"]);
     if (!isset($settings["STATUS_IN"][$yandexStatus]) || strlen($settings["STATUS_IN"][$yandexStatus]) <= 0) {
         return false;
     }
     $result = false;
     $bitrixStatus = $settings["STATUS_IN"][$yandexStatus];
     switch ($bitrixStatus) {
         /* flags */
         case "CANCELED":
             $errorMessageTmp = "";
             $result = CSaleOrder::CancelOrder($order["ID"], "Y", $cancelReason);
             if (!$result) {
                 if ($ex = $APPLICATION->GetException()) {
                     if ($ex->GetID() != "ALREADY_FLAG") {
                         $errorMessageTmp .= $ex->GetString();
                     }
                 } else {
                     $errorMessageTmp .= GetMessage("ERROR_CANCEL_ORDER") . ". ";
                 }
             }
             if ($errorMessageTmp != "") {
                 $this->log(self::LOG_LEVEL_ERROR, "YMARKET_INCOMING_ORDER_STATUS", $order["XML_ID"], $errorMessageTmp);
             } else {
                 $this->log(self::LOG_LEVEL_INFO, "YMARKET_INCOMING_ORDER_STATUS", $order["XML_ID"], GetMessage("SALE_YMH_INCOMING_ORDER_STATUS_CANCELED") . ": " . $order["ID"]);
             }
             break;
         case "ALLOW_DELIVERY":
             $result = CSaleOrder::DeliverOrder($order["ID"], "Y");
             break;
         case "PAYED":
             $result = CSaleOrder::PayOrder($order["ID"], "Y");
             break;
         case "DEDUCTED":
             $result = CSaleOrder::DeductOrder($order["ID"], "Y");
             break;
             /* statuses */
         /* statuses */
         default:
             if (CSaleStatus::GetByID($bitrixStatus)) {
                 $result = CSaleOrder::StatusOrder($order["ID"], $bitrixStatus);
             }
             break;
     }
     $this->log($result ? self::LOG_LEVEL_INFO : self::LOG_LEVEL_ERROR, "YMARKET_ORDER_STATUS_CHANGE", $order["ID"], ($result ? GetMessage("SALE_YMH_LOG_TYPE_ORDER_STATUS_CHANGE_OK") : GetMessage("SALE_YMH_LOG_TYPE_ORDER_STATUS_CHANGE_ERROR")) . " (" . $bitrixStatus . ")");
     return $result;
 }
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:52,代码来源:ym_handler.php

示例7: FormatOrderStatusChanged

 public static function FormatOrderStatusChanged($arData)
 {
     $info = GetMessage("SOC_ORDER_STATUS_CHANGED_INFO");
     foreach ($arData as $param => $value) {
         if ($param == "STATUS_ID") {
             $res = CSaleStatus::GetByID($value);
             $value = "\"" . $res["NAME"] . "\"";
         }
         $info = str_replace("#" . $param . "#", $value, $info);
     }
     return array("NAME" => GetMessage("SOC_ORDER_STATUS_CHANGED"), "INFO" => $info);
 }
开发者ID:rasuldev,项目名称:torino,代码行数:12,代码来源:order_change.php

示例8: GetMessage

        ?>
			</font>
		</td>
	</tr>
	//-->
	<tr>
		<td align="right" width="40%" class="tablebody">
			<font class="tablefieldtext"><?php 
        echo GetMessage("STPOD_ORDER_STATUS");
        ?>
</font>
		</td>
		<td align="left" width="60%" class="tablebody">
			<font class="tablebodytext">
			<?php 
        $arCurrentStatus = CSaleStatus::GetByID($arOrder["STATUS_ID"]);
        echo $arCurrentStatus["NAME"] . GetMessage("STPOD_ORDER_FROM") . $arOrder["DATE_STATUS"] . ")";
        ?>
			</font>
		</td>
	</tr>
	<tr>
		<td align="right" width="40%" class="tablebody">
			<font class="tablefieldtext"><?php 
        echo GetMessage("P_ORDER_PRICE");
        ?>
:</font>
		</td>
		<td align="left" width="60%" class="tablebody">
			<font class="tablebodytext"><?php 
        echo "<b>" . SaleFormatCurrency($arOrder["PRICE"], $arOrder["CURRENCY"]) . "</b>";
开发者ID:rasuldev,项目名称:torino,代码行数:31,代码来源:order_detail.php

示例9: ini_set

<?php

ini_set("session.gc_maxlifetime", 3600);
ini_set("max_execution_time", 3600);
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
$result = 4;
$status_str = "";
$ORDER_ID = (int) $_GET["id"];
if (!($arOrder = CSaleOrder::GetByID($ORDER_ID))) {
    $result = "Заказ с кодом " . $ORDER_ID . " не найден";
} else {
    $result = $arOrder["STATUS_ID"];
    if ($arStatus = CSaleStatus::GetByID($result)) {
        $status_str = $arStatus["NAME"];
    }
}
echo json_encode(array("result" => "asasas", "msg" => $result, "msga" => $status_str));
exit;
开发者ID:akniyev,项目名称:arteva.ru,代码行数:18,代码来源:utro.php

示例10: getByID

 public static function getByID($statusID)
 {
     self::ensureLanguageDefined();
     return CSaleStatus::GetByID($statusID, self::$languageID);
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:5,代码来源:crm_status_invoice.php


注:本文中的CSaleStatus::GetByID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。