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


PHP CSaleOrder::UnsetMark方法代码示例

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


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

示例1: GetMessage

					if (($arOldOrder["MARKED"] != $MARKED) || ($arOldOrder["MARKED"] == "Y" && $arOldOrder["REASON_MARKED"] != $REASON_MARKED))
					{
						$bUserCanMarkOrder = CSaleOrder::CanUserMarkOrder($ID, $arUserGroups, $intUserID);

						$errorMessageTmp = "";

						if (!$bUserCanMarkOrder)
						{
							$errorMessageTmp .= GetMessage("SOD_NO_PERMS2MARK").". ";
						}
						else
						{
							if ($MARKED == "Y")
								$rs = CSaleOrder::SetMark($ID, $REASON_MARKED, $intUserID);
							else
								$rs = CSaleOrder::UnsetMark($ID, $intUserID);

							if (!$rs)
							{
								if ($ex = $APPLICATION->GetException())
								{
									if ($ex->GetID() != "ALREADY_FLAG")
										$errorMessageTmp .= $ex->GetString();
								}
								else
									$errorMessageTmp .= GetMessage("ERROR_MARK_ORDER").". ";
							}
						}

						if ($errorMessageTmp != "")
							$arErrors[] = $errorMessageTmp;
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:31,代码来源:order_new.php

示例2: ReserveOrder

 function ReserveOrder($ID, $val, $recurringID = 0)
 {
     global $DB, $USER;
     $ID = IntVal($ID);
     $val = $val != "Y" ? "N" : "Y";
     $recurringID = IntVal($recurringID);
     if ($ID <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGO_NO_ORDER_ID"), "NO_ORDER_ID");
         return false;
     }
     $arOrder = CSaleOrder::GetByID($ID);
     if (!$arOrder) {
         $GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $ID, GetMessage("SKGO_NO_ORDER")), "NO_ORDER");
         return false;
         //TODO - UnsetMark?
     }
     if ($arOrder["RESERVED"] == $val) {
         $GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $ID, GetMessage("SKGO_DUB_RESERVATION")), "ALREADY_FLAG");
         return false;
     }
     foreach (GetModuleEvents("sale", "OnSaleBeforeReserveOrder", true) as $arEvent) {
         if (ExecuteModuleEventEx($arEvent, array($ID, $val, $recurringID, $arAdditionalFields)) === false) {
             return false;
         }
     }
     unset($GLOBALS["SALE_ORDER"]["SALE_ORDER_CACHE_" . $ID]);
     if ($recurringID <= 0) {
         if (IntVal($arOrder["RECURRING_ID"]) > 0) {
             $recurringID = IntVal($arOrder["RECURRING_ID"]);
         }
     }
     //TODO - recurring?
     $res = CSaleOrder::Update($ID, array("RESERVED" => $val));
     $arRes = CSaleBasket::OrderReservation($ID, $val == "N" ? true : false, $recurringID);
     if (array_key_exists("ERROR", $arRes)) {
         foreach ($arRes["ERROR"] as $productId => $arError) {
             $errorMessage .= " " . $arError["MESSAGE"];
         }
         CSaleOrder::SetMark($ID, GetMessage("SKGB_RESERVE_ERROR", array("#MESSAGE#" => $errorMessage)));
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGB_RESERVE_ERROR", array("#MESSAGE#" => $errorMessage)), "RESERVATION_ERROR");
         return false;
     } else {
         //don't unset if not set yet
         CSaleOrder::UnsetMark($ID);
     }
     foreach (GetModuleEvents("sale", "OnSaleReserveOrder", true) as $arEvent) {
         ExecuteModuleEventEx($arEvent, array($ID, $val));
     }
     return $res;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:50,代码来源:order.php

示例3: trim

		{
			$MARKED = trim($_REQUEST["MARKED"]);
			$REASON_MARKED = trim($_REQUEST["REASON_MARKED"]);
			if ($MARKED != "Y")
				$MARKED = "N";

			if ($MARKED != "Y" && $MARKED != "N")
				$errorMessageTmp .= GetMessage("SOD_WRONG_MARK_FLAG").". ";
		}

		if (strlen($errorMessageTmp) <= 0 && !CSaleOrder::IsLocked($ID, $lockedBY, $dateLock))
		{
			if ($MARKED == "Y")
				$rs = CSaleOrder::SetMark($ID, $REASON_MARKED, (0 < $intUserID ? $intUserID : 0));
			else
				$rs = CSaleOrder::UnsetMark($ID, (0 < $intUserID ? $intUserID : 0));

			if (!$rs)
			{
				if ($ex = $APPLICATION->GetException())
				{
					if ($ex->GetID() != "ALREADY_FLAG")
						$errorMessageTmp .= $ex->GetString();
				}
				else
					$errorMessageTmp .= GetMessage("ERROR_MARK_ORDER").". ";
			}
		}

		$arResult["message"] = "ok";
		if (strlen($errorMessageTmp) > 0)
开发者ID:akniyev,项目名称:arteva.ru,代码行数:31,代码来源:order_detail.php

示例4: ReserveOrder

 function ReserveOrder($ID, $val)
 {
     global $APPLICATION;
     $ID = IntVal($ID);
     $val = $val != "Y" ? "N" : "Y";
     $errorMessage = "";
     $isOrderConverted = \Bitrix\Main\Config\Option::get("main", "~sale_converted_15", 'N');
     if ($ID <= 0) {
         $APPLICATION->ThrowException(Loc::getMessage("SKGO_NO_ORDER_ID"), "NO_ORDER_ID");
         return false;
     }
     $arOrder = CSaleOrder::GetByID($ID);
     if (!$arOrder) {
         $APPLICATION->ThrowException(str_replace("#ID#", $ID, Loc::getMessage("SKGO_NO_ORDER")), "NO_ORDER");
         return false;
     }
     if ($arOrder["RESERVED"] == $val) {
         $APPLICATION->ThrowException(str_replace("#ID#", $ID, Loc::getMessage("SKGO_DUB_RESERVATION")), "ALREADY_FLAG");
         return false;
     }
     foreach (GetModuleEvents("sale", "OnSaleBeforeReserveOrder", true) as $arEvent) {
         if (ExecuteModuleEventEx($arEvent, array($ID, $val)) === false) {
             return false;
         }
     }
     unset($GLOBALS["SALE_ORDER"]["SALE_ORDER_CACHE_" . $ID]);
     if ($isOrderConverted == "Y") {
         /** @var \Bitrix\Sale\Result $r */
         $r = \Bitrix\Sale\Compatible\OrderCompatibility::reserve($ID, $val);
         if (!$r->isSuccess(true)) {
             foreach ($r->getErrorMessages() as $error) {
                 $errorMessage .= " " . $error;
             }
             $APPLICATION->ThrowException(Loc::getMessage("SKGB_RESERVE_ERROR", array("#MESSAGE#" => $errorMessage)), "RESERVATION_ERROR");
             return false;
         }
         $res = true;
     } else {
         $res = CSaleOrder::Update($ID, array("RESERVED" => $val), false);
         $arRes = CSaleBasket::OrderReservation($ID, $val == "N" ? true : false);
         if (array_key_exists("ERROR", $arRes)) {
             foreach ($arRes["ERROR"] as $arError) {
                 $errorMessage .= " " . $arError["MESSAGE"];
             }
             CSaleOrder::SetMark($ID, Loc::getMessage("SKGB_RESERVE_ERROR", array("#MESSAGE#" => $errorMessage)));
             $APPLICATION->ThrowException(Loc::getMessage("SKGB_RESERVE_ERROR", array("#MESSAGE#" => $errorMessage)), "RESERVATION_ERROR");
             return false;
         } else {
             if ($arOrder["MARKED"] == "Y") {
                 CSaleOrder::UnsetMark($ID);
             }
         }
     }
     foreach (GetModuleEvents("sale", "OnSaleReserveOrder", true) as $arEvent) {
         ExecuteModuleEventEx($arEvent, array($ID, $val));
     }
     return $res;
 }
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:58,代码来源:order.php

示例5: ClearProductReservedQuantity

	/**
	* The agent function. Moves reserved quantity back to the quantity field for each product
	* for orders which were placed earlier than specific date
	*
	* @return agent name string
	*/
	public static function ClearProductReservedQuantity()
	{
		global $DB, $USER;

		if (!is_object($USER))
			$USER = new CUser;

		$days_ago = COption::GetOptionString("sale", "product_reserve_clear_period", "0");

		if (intval($days_ago) > 0)
		{
			$date = date($DB->DateFormatToPHP(CSite::GetDateFormat("FULL")), time() - intval($days_ago)*24*60*60);

			$arFilter = array(
				"<=DATE_INSERT" => $date,
				"RESERVED" => "Y",
				"DEDUCTED" => "N",
				"PAYED" => "N",
				"ALLOW_DELIVERY" => "N",
				"CANCELED" => "N"
			);

			$dbRes = CSaleOrder::GetList(
				array(),
				$arFilter,
				false,
				false,
				array("ID", "RESERVED", "DATE_INSERT", "DEDUCTED", "PAYED", "CANCELED", "MARKED")
			);
			while ($arRes = $dbRes->GetNext())
			{
				foreach(GetModuleEvents("sale", "OnSaleBeforeReserveOrder", true) as $arEvent)
						if (ExecuteModuleEventEx($arEvent, array($arRes["ID"], "N", $arAdditionalFields))===false)
							return false;

				// undoing reservation
				$res = CSaleBasket::OrderReservation($arRes["ID"], true);

				if (array_key_exists("ERROR", $res))
				{
					foreach ($res["ERROR"] as $productId => $arError)
						$errorMessage .= " ".$arError["MESSAGE"];

					CSaleOrder::SetMark($arRes["ID"], GetMessage("SKGB_RESERVE_ERROR", array("#MESSAGE#" => $errorMessage)));
				}
				else
				{
					if ($arOrder["MARKED"] == "Y")
						CSaleOrder::UnsetMark($arRes["ID"]);
				}

				$res = CSaleOrder::Update($arRes["ID"], array("RESERVED" => "N"), false);

				foreach(GetModuleEvents("sale", "OnSaleReserveOrder", true) as $arEvent)
					ExecuteModuleEventEx($arEvent, Array($arRes["ID"], "N"));
			}
		}

		return "CSaleOrder::ClearProductReservedQuantity();";
	}
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:66,代码来源:order.php

示例6: trim

 $REASON_MARKED = trim($_POST["REASON_MARKED"]);
 if ($MARKED != "Y") {
     $MARKED = "N";
 }
 $arOrder2Update = array();
 if ($arOldOrder["MARKED"] != $MARKED || $arOldOrder["MARKED"] == "Y" && $arOldOrder["REASON_MARKED"] != $REASON_MARKED) {
     $bUserCanMarkOrder = CSaleOrder::CanUserMarkOrder($ID, $GLOBALS["USER"]->GetUserGroupArray(), $GLOBALS["USER"]->GetID());
     $errorMessageTmp = "";
     if (!$bUserCanMarkOrder) {
         $errorMessageTmp .= GetMessage("SOD_NO_PERMS2MARK") . ". ";
     }
     if (strlen($errorMessageTmp) <= 0) {
         if ($MARKED == "Y") {
             $rs = CSaleOrder::SetMark($ID, $REASON_MARKED, intval($GLOBALS["USER"]->GetID()) > 0 ? IntVal($GLOBALS["USER"]->GetID()) : 0);
         } else {
             $rs = CSaleOrder::UnsetMark($ID, intval($GLOBALS["USER"]->GetID()) > 0 ? IntVal($GLOBALS["USER"]->GetID()) : 0);
         }
         if (!$rs) {
             if ($ex = $APPLICATION->GetException()) {
                 if ($ex->GetID() != "ALREADY_FLAG") {
                     $errorMessageTmp .= $ex->GetString();
                 }
             } else {
                 $errorMessageTmp .= GetMessage("ERROR_MARK_ORDER") . ". ";
             }
         }
     }
     if ($errorMessageTmp != "") {
         $arErrors[] = $errorMessageTmp;
     }
 } else {
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:order_new.php

示例7: formAndSendDataToGP


//.........这里部分代码省略.........
				}
			}
		}
		
		// send data to GP server
		if ($options["URL"]) {
		  
		    $arConfig = self::$CONFIG;
            
			$stop_send = false;
			$ch = curl_init();
			
			if (intVal($_POST[$post_key['gp_order_id']]) == 0) {
				$type = "POST";
				//$options["URL"] = COption::GetOptionString(self::$MODULE_ID, 'POST_url');
                $options["URL"] = COption::GetOptionString(self::$MODULE_ID, 'gp_script_url') . $arConfig["POST_URL"];
			}
			
			if ($type == "POST" && !empty($post_data['widget_token'])) {
				$post_data['with_draft'] = true;
			}elseif($type == "POST" && empty($post_data['widget_token'])){
			    $post_data['with_draft'] = false;
			}
			
			// set data for sending to GP server
			$send_data = json_encode($post_data);
            
            			
			if ($type == "POST") {
				curl_setopt($ch, CURLOPT_POST, true);
			} elseif ($type == "PATCH") {
				curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH');
			} else {
				$stop_send = true;
			}
			curl_setopt($ch, CURLOPT_URL, $options["URL"]);
			curl_setopt($ch, CURLOPT_POSTFIELDS, $send_data);
			curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
			if (!$stop_send) {
				$result = json_decode(curl_exec($ch), true);
			}
			curl_close($ch);
            
			if (is_array($result['error_message']) && count($result['error_message']) == 1) {
				$comment = implode("\r\n", $result['error_message']);
                
                $comment = CGPWidget::Translate($comment);
                
				CSaleOrder::SetMark($ID, $comment);
			} elseif (is_array($result['error_message']) && count($result['error_message']) > 1) {
				$comment = $result['error_message'];
                $ar_comment = "";
                
                foreach($comment as $com){
                    $ar_comment .= CGPWidget::Translate($com).". ";
                }
                
				CSaleOrder::SetMark($ID, $ar_comment);
                
			} elseif ($result) {
				if ($order_is_marked) {
					CSaleOrder::UnsetMark($ID);
				}
				if (intVal($_POST[$post_key['gp_order_id_0']]) == 0 && $result['id']/* && intVal($_POST[$post_key['gp_order_id']]) != $result['id']*/) {
					// $_POST[$post_key['gp_order_id']] = $result['id'];
					if ($gp_order_id_prop_id = intVal(str_replace("ORDER_PROP_", "", $post_key['gp_order_id_0']))) {
						$gp_order_id_res = CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $ID, "ORDER_PROPS_ID" => $gp_order_id_prop_id));
						if ($gp_order_id_ar = $gp_order_id_res->Fetch()) {
							$gp_order_id_prop_value_id = $gp_order_id_ar['ID'];
							if ($gp_order_id_prop_value_id) {
								$gp_order_id_add_result = CSaleOrderPropsValue::Update($gp_order_id_prop_value_id, array("ORDER_ID" => $ID, "VALUE" => $result['id']));
							}
						} else {
							$gp_order_id_prop_res = CSaleOrderProps::GetList(array(), array("ID" => $gp_order_id_prop_id));
							if ($gp_order_id_prop_ar = $gp_order_id_prop_res->Fetch()) {
								$gp_order_id_add_result = CSaleOrderPropsValue::Add(array("ORDER_ID" => $ID, "ORDER_PROPS_ID" => $gp_order_id_prop_id, "VALUE" => $result['id'], "NAME" => $gp_order_id_prop_ar['NAME'], "CODE" => $gp_order_id_prop_ar['CODE']));
							}
						}
					}
				}
			}
            /*
            echo "<pre>";
            var_dump($_POST);
            
            var_dump($post_data);
            
            var_dump($result);
            echo "</pre>";
            die();*/
		}

		// log everything
		$filename = $_SERVER['DOCUMENT_ROOT'] . '/templog.log';
		$data = array($type, date('d.m.Y h:i:s'), "ORDER" => $ID, "URL" => $options["URL"], "SEND" => $send_data, "RESULT" => $result, "ARFIELDS" => $arFields);
		// $data = array($type, date('d.m.Y h:i:s'), "ORDER" => $ID, "URL" => $options["URL"], "SEND" => $send_data, "gpid" => array('add' => $m, 'res' => $gp_order_id_add_result, '1' => array($gp_order_id_prop_value_id, array("ORDER_ID" => $ID, "VALUE" => $result['id'])),  'ar' => $gp_order_id_ar, 'val' => $gp_order_id_prop_value_id, 'post_gpoid' => $result['id'], "ORDER_ID" => $ID, 'ORDER_PROPS_ID' => str_replace("ORDER_PROP_", "", $post_key['gp_order_id'])), array($_POST[$post_key['gp_order_id']], $post_key['gp_order_id']), "RESULT" => $result);
		// $data = array($type, date('d.m.Y h:i:s'), $ID, $send_data, $result, $city_name, $city_id, $post_key, $_POST);
		file_put_contents($filename, var_export($data, true), FILE_APPEND | LOCK_EX);
	}
开发者ID:ASDAFF,项目名称:gpbitrix,代码行数:101,代码来源:CGPWidgetEventHandler.php


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