本文整理汇总了PHP中CSaleStatus::Add方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleStatus::Add方法的具体用法?PHP CSaleStatus::Add怎么用?PHP CSaleStatus::Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSaleStatus
的用法示例。
在下文中一共展示了CSaleStatus::Add方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: InstallDB
function InstallDB()
{
global $DB, $DBType, $APPLICATION;
$this->errors = false;
if (!$DB->Query("SELECT 'x' FROM b_sale_basket", true)) {
$this->errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sale/install/db/" . $DBType . "/install.sql");
}
if ($this->errors !== false) {
$APPLICATION->ThrowException(implode("", $this->errors));
return false;
}
ModuleManager::registerModule('sale');
$eventManager = \Bitrix\Main\EventManager::getInstance();
$eventManager->registerEventHandlerCompatible('main', 'OnUserLogout', 'sale', '\\Bitrix\\Sale\\DiscountCouponsManager', 'logout');
RegisterModuleDependences("main", "OnUserLogin", "sale", "CSaleUser", "OnUserLogin");
RegisterModuleDependences("main", "OnUserLogout", "sale", "CSaleUser", "OnUserLogout");
RegisterModuleDependences("main", "OnBeforeLangDelete", "sale", "CSalePersonType", "OnBeforeLangDelete");
RegisterModuleDependences("main", "OnLanguageDelete", "sale", "CSaleLocation", "OnLangDelete");
RegisterModuleDependences("main", "OnLanguageDelete", "sale", "CSaleLocationGroup", "OnLangDelete");
RegisterModuleDependences("main", "OnUserDelete", "sale", "CSaleOrderUserProps", "OnUserDelete");
RegisterModuleDependences("main", "OnUserDelete", "sale", "CSaleUserAccount", "OnUserDelete");
RegisterModuleDependences("main", "OnUserDelete", "sale", "CSaleAuxiliary", "OnUserDelete");
RegisterModuleDependences("main", "OnUserDelete", "sale", "CSaleUser", "OnUserDelete");
RegisterModuleDependences("main", "OnUserDelete", "sale", "CSaleRecurring", "OnUserDelete");
RegisterModuleDependences("main", "OnUserDelete", "sale", "CSaleUserCards", "OnUserDelete");
RegisterModuleDependences("main", "OnBeforeUserDelete", "sale", "CSaleOrder", "OnBeforeUserDelete");
RegisterModuleDependences("main", "OnBeforeUserDelete", "sale", "CSaleAffiliate", "OnBeforeUserDelete");
RegisterModuleDependences("main", "OnBeforeUserDelete", "sale", "CSaleUserAccount", "OnBeforeUserDelete");
RegisterModuleDependences("main", "OnBeforeProlog", "main", "", "", 100, "/modules/sale/affiliate.php");
RegisterModuleDependences("main", "OnEventLogGetAuditTypes", "sale", "CSaleYMHandler", 'OnEventLogGetAuditTypes');
RegisterModuleDependences("main", "OnEventLogGetAuditTypes", "sale", "CSalePaySystemAction", 'OnEventLogGetAuditTypes');
RegisterModuleDependences("currency", "OnBeforeCurrencyDelete", "sale", "CSaleOrder", "OnBeforeCurrencyDelete");
RegisterModuleDependences("currency", "OnBeforeCurrencyDelete", "sale", "CSaleLang", "OnBeforeCurrencyDelete");
RegisterModuleDependences("currency", "OnModuleUnInstall", "sale", "", "CurrencyModuleUnInstallSale");
RegisterModuleDependences("catalog", "OnSaleOrderSumm", "sale", "CSaleOrder", "__SaleOrderCount");
RegisterModuleDependences("mobileapp", "OnBeforeAdminMobileMenuBuild", "sale", "CSaleMobileOrderUtils", "buildSaleAdminMobileMenu");
RegisterModuleDependences("sender", "OnConnectorList", "sale", "\\Bitrix\\Sale\\SenderEventHandler", "onConnectorListBuyer");
RegisterModuleDependences("sale", "OnCondSaleControlBuildList", "sale", "CSaleCondCtrlGroup", "GetControlDescr", 100);
RegisterModuleDependences("sale", "OnCondSaleControlBuildList", "sale", "CSaleCondCtrlBasketGroup", "GetControlDescr", 200);
RegisterModuleDependences("sale", "OnCondSaleControlBuildList", "sale", "CSaleCondCtrlBasketFields", "GetControlDescr", 300);
RegisterModuleDependences("sale", "OnCondSaleControlBuildList", "sale", "CSaleCondCtrlOrderFields", "GetControlDescr", 1000);
RegisterModuleDependences("sale", "OnCondSaleControlBuildList", "sale", "CSaleCondCtrlCommon", "GetControlDescr", 10000);
RegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", "sale", "CSaleActionCtrlGroup", "GetControlDescr", 100);
RegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", "sale", "CSaleActionCtrlDelivery", "GetControlDescr", 200);
RegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", "sale", "CSaleActionCtrlBasketGroup", "GetControlDescr", 300);
RegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", "sale", "CSaleActionCtrlSubGroup", "GetControlDescr", 1000);
RegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", "sale", "CSaleActionCondCtrlBasketFields", "GetControlDescr", 1100);
//pulling for mobile orders
RegisterModuleDependences("sale", "OnOrderDelete", "sale", "CSaleMobileOrderPull", "onOrderDelete", 100);
RegisterModuleDependences("sale", "OnOrderAdd", "sale", "CSaleMobileOrderPull", "onOrderAdd", 100);
RegisterModuleDependences("sale", "OnOrderUpdate", "sale", "CSaleMobileOrderPull", "onOrderUpdate", 100);
// sale product2product
RegisterModuleDependences("sale", "OnBasketOrder", "sale", "\\Bitrix\\Sale\\Product2ProductTable", "onSaleOrderAdd", 100);
RegisterModuleDependences("sale", "OnSaleStatusOrder", "sale", "\\Bitrix\\Sale\\Product2ProductTable", "onSaleStatusOrderHandler", 100);
RegisterModuleDependences("sale", "OnSaleDeliveryOrder", "sale", "\\Bitrix\\Sale\\Product2ProductTable", "onSaleDeliveryOrderHandler", 100);
RegisterModuleDependences("sale", "OnSaleDeductOrder", "sale", "\\Bitrix\\Sale\\Product2ProductTable", "onSaleDeductOrderHandler", 100);
RegisterModuleDependences("sale", "OnSaleCancelOrder", "sale", "\\Bitrix\\Sale\\Product2ProductTable", "onSaleCancelOrderHandler", 100);
RegisterModuleDependences("sale", "OnSalePayOrder", "sale", "\\Bitrix\\Sale\\Product2ProductTable", "onSalePayOrderHandler", 100);
CAgent::AddAgent("\\Bitrix\\Sale\\Product2ProductTable::deleteOldProducts(10);", "sale", "N", 10 * 24 * 3600, "", "Y");
COption::SetOptionString("sale", "viewed_capability", "N");
COption::SetOptionString("sale", "viewed_count", 10);
COption::SetOptionString("sale", "viewed_time", 5);
COption::SetOptionString("sale", "p2p_status_list", serialize(array("N", "P", "F", "F_CANCELED", "F_DELIVERY", "F_PAY", "F_OUT")));
CAgent::AddAgent("CSaleRecurring::AgentCheckRecurring();", "sale", "N", 7200, "", "Y");
CAgent::AddAgent("CSaleOrder::RemindPayment();", "sale", "N", 86400, "", "Y");
CAgent::AddAgent("CSaleViewedProduct::ClearViewed();", "sale", "N", 86400, "", "Y");
CAgent::AddAgent("CSaleOrder::ClearProductReservedQuantity();", "sale", "N", 259200, "", "Y");
COption::SetOptionString("sale", "product_reserve_clear_period", "3");
if (CModule::IncludeModule("sale")) {
$dbStatusList = CSaleStatus::GetList(array(), array(), false, false, array());
if (!($arStatusList = $dbStatusList->Fetch())) {
$arLandDataN = array();
$arLandDataF = array();
$languageIterator = LanguageTable::getList(array('select' => array('ID'), 'filter' => array('=ACTIVE' => 'Y')));
while ($language = $languageIterator->fetch()) {
IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sale/status.php", $language['ID']);
$arLandDataN[] = array("LID" => $language['ID'], "NAME" => GetMessage("SIM_ACCEPTED"), "DESCRIPTION" => GetMessage("SIM_ACCEPTED_DESCR"));
$arLandDataF[] = array("LID" => $language['ID'], "NAME" => GetMessage("SIM_FINISHED"), "DESCRIPTION" => GetMessage("SIM_FINISHED_DESCR"));
}
unset($language, $languageIterator);
CSaleStatus::Add(array("ID" => "N", "SORT" => 100, "LANG" => $arLandDataN));
CSaleStatus::Add(array("ID" => "F", "SORT" => 200, "LANG" => $arLandDataF));
}
// enabling location pro
COption::SetOptionString("sale", "sale_locationpro_migrated", "Y");
COption::SetOptionString("sale", "sale_locationpro_enabled", "Y");
if (\Bitrix\Main\ModuleManager::isModuleInstalled('bitrix24')) {
// this will create at least base types if we are at Bitrix24
include_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/sale/lib/location/migration/migrate.php";
\Bitrix\Sale\Location\Migration\CUpdaterLocationPro::createBaseTypes();
}
CSaleYMHandler::install();
}
return true;
}
示例2: addOStatus
protected function addOStatus()
{
$lang_er = array();
foreach ($this->lang_ids as $lang) {
$lang_er[] = array("LID" => $lang, "NAME" => Loc::getMessage("DEVTM_ERIP_STATUS_ER_NAME"), "DESCRIPTION" => Loc::getMessage("DEVTM_ERIP_STATUS_ER_DESC"));
}
if (empty($lang_er)) {
return false;
}
return CSaleStatus::Add(array("ID" => "ER", "SORT" => 100, "LANG" => $lang_er, "NOTIFY" => "N"));
}
示例3: InstallDB
function InstallDB()
{
global $DB, $DBType, $APPLICATION;
$this->errors = false;
if(!$DB->Query("SELECT 'x' FROM b_sale_basket", true))
{
$this->errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/sale/install/db/".$DBType."/install.sql");
}
if($this->errors !== false)
{
$APPLICATION->ThrowException(implode("", $this->errors));
return false;
}
RegisterModule("sale");
RegisterModuleDependences("main", "OnUserLogin", "sale", "CSaleUser", "OnUserLogin");
RegisterModuleDependences("main", "OnUserLogout", "sale", "CSaleUser", "OnUserLogout");
RegisterModuleDependences("main", "OnBeforeLangDelete", "sale", "CSalePersonType", "OnBeforeLangDelete");
RegisterModuleDependences("main", "OnLanguageDelete", "sale", "CSaleLocation", "OnLangDelete");
RegisterModuleDependences("main", "OnLanguageDelete", "sale", "CSaleLocationGroup", "OnLangDelete");
RegisterModuleDependences("main", "OnUserDelete", "sale", "CSaleOrderUserProps", "OnUserDelete");
RegisterModuleDependences("main", "OnUserDelete", "sale", "CSaleUserAccount", "OnUserDelete");
RegisterModuleDependences("main", "OnUserDelete", "sale", "CSaleAuxiliary", "OnUserDelete");
RegisterModuleDependences("main", "OnUserDelete", "sale", "CSaleUser", "OnUserDelete");
RegisterModuleDependences("main", "OnUserDelete", "sale", "CSaleRecurring", "OnUserDelete");
RegisterModuleDependences("main", "OnUserDelete", "sale", "CSaleUserCards", "OnUserDelete");
RegisterModuleDependences("main", "OnBeforeUserDelete", "sale", "CSaleOrder", "OnBeforeUserDelete");
RegisterModuleDependences("main", "OnBeforeUserDelete", "sale", "CSaleAffiliate", "OnBeforeUserDelete");
RegisterModuleDependences("main", "OnBeforeUserDelete", "sale", "CSaleUserAccount", "OnBeforeUserDelete");
RegisterModuleDependences("main", "OnBeforeProlog", "main", "", "", 100, "/modules/sale/affiliate.php");
RegisterModuleDependences("main", "OnEventLogGetAuditTypes", "sale", "CSaleYMHandler", 'OnEventLogGetAuditTypes');
RegisterModuleDependences("currency", "OnBeforeCurrencyDelete", "sale", "CSaleOrder", "OnBeforeCurrencyDelete");
RegisterModuleDependences("currency", "OnBeforeCurrencyDelete", "sale", "CSaleLang", "OnBeforeCurrencyDelete");
RegisterModuleDependences("currency", "OnModuleUnInstall", "sale", "", "CurrencyModuleUnInstallSale");
RegisterModuleDependences("catalog", "OnSaleOrderSumm", "sale", "CSaleOrder", "__SaleOrderCount");
RegisterModuleDependences("mobileapp", "OnBeforeAdminMobileMenuBuild", "sale", "CSaleMobileOrderUtils", "buildSaleAdminMobileMenu");
RegisterModuleDependences("sale", "OnCondSaleControlBuildList", "sale", "CSaleCondCtrlGroup", "GetControlDescr", 100);
RegisterModuleDependences("sale", "OnCondSaleControlBuildList", "sale", "CSaleCondCtrlBasketGroup", "GetControlDescr", 200);
RegisterModuleDependences("sale", "OnCondSaleControlBuildList", "sale", "CSaleCondCtrlBasketFields", "GetControlDescr", 300);
RegisterModuleDependences("sale", "OnCondSaleControlBuildList", "sale", "CSaleCondCtrlOrderFields", "GetControlDescr", 1000);
RegisterModuleDependences("sale", "OnCondSaleControlBuildList", "sale", "CSaleCondCtrlCommon", "GetControlDescr", 10000);
RegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", "sale", "CSaleActionCtrlGroup", "GetControlDescr", 100);
RegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", "sale", "CSaleActionCtrlDelivery", "GetControlDescr", 200);
RegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", "sale", "CSaleActionCtrlBasketGroup", "GetControlDescr", 300);
RegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", "sale", "CSaleActionCtrlSubGroup", "GetControlDescr", 1000);
RegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", "sale", "CSaleActionCondCtrlBasketFields", "GetControlDescr", 1100);
//pulling for mobile orders
RegisterModuleDependences("sale", "OnOrderDelete", "sale", "CSaleMobileOrderPull", "onOrderDelete", 100);
RegisterModuleDependences("sale", "OnOrderAdd", "sale", "CSaleMobileOrderPull", "onOrderAdd", 100);
RegisterModuleDependences("sale", "OnOrderUpdate", "sale", "CSaleMobileOrderPull", "onOrderUpdate", 100);
// sale product2product
RegisterModuleDependences("sale", "OnBasketOrder", "sale", "\\Bitrix\\Sale\\Product2ProductTable", "onSaleOrderAdd", 100);
RegisterModuleDependences("sale", "OnSaleStatusOrder", "sale", "\\Bitrix\\Sale\\Product2ProductTable", "onSaleStatusOrderHandler", 100);
RegisterModuleDependences("sale", "OnSaleDeliveryOrder", "sale", "\\Bitrix\\Sale\\Product2ProductTable", "onSaleDeliveryOrderHandler", 100);
RegisterModuleDependences("sale", "OnSaleDeductOrder", "sale", "\\Bitrix\\Sale\\Product2ProductTable", "onSaleDeductOrderHandler", 100);
RegisterModuleDependences("sale", "OnSaleCancelOrder", "sale", "\\Bitrix\\Sale\\Product2ProductTable", "onSaleCancelOrderHandler", 100);
RegisterModuleDependences("sale", "OnSalePayOrder", "sale", "\\Bitrix\\Sale\\Product2ProductTable", "onSalePayOrderHandler", 100);
CAgent::AddAgent("\\Bitrix\\Sale\\Product2ProductTable::deleteOldProducts(10);", "sale", "N", 10 * 24 * 3600, "", "Y");
COption::SetOptionString("sale", "viewed_capability", "N");
COption::SetOptionString("sale", "viewed_count", 10);
COption::SetOptionString("sale", "viewed_time", 5);
COption::SetOptionString("sale", "p2p_status_list", serialize(array(
"N", "P", "F", "F_CANCELED", "F_DELIVERY", "F_PAY", "F_OUT"
)));
CAgent::AddAgent("CSaleRecurring::AgentCheckRecurring();", "sale", "N", 7200, "", "Y");
CAgent::AddAgent("CSaleOrder::RemindPayment();", "sale", "N", 86400, "", "Y");
CAgent::AddAgent("CSaleViewedProduct::ClearViewed();", "sale", "N", 86400, "", "Y");
CAgent::AddAgent("CSaleOrder::ClearProductReservedQuantity();", "sale", "N", 259200, "", "Y");
COption::SetOptionString("sale", "product_reserve_clear_period", "3");
if (CModule::IncludeModule("sale"))
{
$dbStatusList = CSaleStatus::GetList(array(), array(), false, false, array());
if (!($arStatusList = $dbStatusList->Fetch()))
{
$arLandDataN = array();
$arLandDataF = array();
$dbLangs = CLanguage::GetList(($b = ""), ($o = ""), array("ACTIVE" => "Y"));
while ($arLangs = $dbLangs->Fetch())
{
IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/sale/status.php", $arLangs["LID"]);
//.........这里部分代码省略.........
示例4: array
}
$oneLang = array('LID' => $language);
if ($nameExist) {
$oneLang['NAME'] = $statusLangFiles[$language]['CRM_STATUS_' . $statusId];
}
if ($descrExist) {
$oneLang['DESCRIPTION'] = $statusLangFiles[$language]['CRM_STATUS_' . $statusId . '_DESCR'];
}
$langData[] = $oneLang;
unset($oneLang, $descrExist, $nameExist);
}
unset($language);
if ($statusId === 'N' && isset($arExistStatuses[$statusId])) {
CSaleStatus::Update($statusId, array('SORT' => $statusSort, 'LANG' => $langData));
} else {
CSaleStatus::Add(array('ID' => $statusId, 'SORT' => $statusSort, 'LANG' => $langData));
}
}
unset($statusLangFiles);
}
//Create person types
$companyPTID = $contactPTID = 0;
$dbPerson = CSalePersonType::GetList(array(), array("LID" => $currentSiteID, "PERSON_TYPE_ID" => array('CRM_COMPANY', 'CRM_CONTACT')));
while ($arPerson = $dbPerson->Fetch()) {
if ($arPerson["NAME"] == 'CRM_COMPANY') {
$companyPTID = $arPerson["ID"];
} elseif ($arPerson["NAME"] == 'CRM_CONTACT') {
$contactPTID = $arPerson["ID"];
}
}
if ($companyPTID <= 0) {
示例5: InstallDB
function InstallDB()
{
global $DB, $DBType, $APPLICATION;
$this->errors = false;
if (!$DB->Query("SELECT 'x' FROM b_sale_basket", true)) {
$this->errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sale/install/db/" . $DBType . "/install.sql");
}
if ($this->errors !== false) {
$APPLICATION->ThrowException(implode("", $this->errors));
return false;
}
RegisterModule("sale");
RegisterModuleDependences("main", "OnUserLogin", "sale", "CSaleUser", "OnUserLogin");
RegisterModuleDependences("main", "OnUserLogout", "sale", "CSaleUser", "OnUserLogout");
RegisterModuleDependences("main", "OnBeforeLangDelete", "sale", "CSalePersonType", "OnBeforeLangDelete");
RegisterModuleDependences("main", "OnLanguageDelete", "sale", "CSaleLocation", "OnLangDelete");
RegisterModuleDependences("main", "OnLanguageDelete", "sale", "CSaleLocationGroup", "OnLangDelete");
RegisterModuleDependences("main", "OnUserDelete", "sale", "CSaleOrderUserProps", "OnUserDelete");
RegisterModuleDependences("main", "OnUserDelete", "sale", "CSaleUserAccount", "OnUserDelete");
RegisterModuleDependences("main", "OnUserDelete", "sale", "CSaleAuxiliary", "OnUserDelete");
RegisterModuleDependences("main", "OnUserDelete", "sale", "CSaleUser", "OnUserDelete");
RegisterModuleDependences("main", "OnUserDelete", "sale", "CSaleRecurring", "OnUserDelete");
RegisterModuleDependences("main", "OnUserDelete", "sale", "CSaleUserCards", "OnUserDelete");
RegisterModuleDependences("main", "OnBeforeUserDelete", "sale", "CSaleOrder", "OnBeforeUserDelete");
RegisterModuleDependences("main", "OnBeforeUserDelete", "sale", "CSaleAffiliate", "OnBeforeUserDelete");
RegisterModuleDependences("main", "OnBeforeUserDelete", "sale", "CSaleUserAccount", "OnBeforeUserDelete");
RegisterModuleDependences("main", "OnBeforeProlog", "main", "", "", 100, "/modules/sale/affiliate.php");
RegisterModuleDependences("currency", "OnBeforeCurrencyDelete", "sale", "CSaleOrder", "OnBeforeCurrencyDelete");
RegisterModuleDependences("currency", "OnBeforeCurrencyDelete", "sale", "CSaleLang", "OnBeforeCurrencyDelete");
RegisterModuleDependences("currency", "OnModuleUnInstall", "sale", "", "CurrencyModuleUnInstallSale");
RegisterModuleDependences("catalog", "OnSaleOrderSumm", "sale", "CSaleOrder", "__SaleOrderCount");
RegisterModuleDependences("mobileapp", "OnBeforeAdminMobileMenuBuild", "sale", "CSaleMobileOrderUtils", "buildSaleAdminMobileMenu");
RegisterModuleDependences("sale", "OnCondSaleControlBuildList", "sale", "CSaleCondCtrlGroup", "GetControlDescr", 100);
RegisterModuleDependences("sale", "OnCondSaleControlBuildList", "sale", "CSaleCondCtrlBasketGroup", "GetControlDescr", 200);
RegisterModuleDependences("sale", "OnCondSaleControlBuildList", "sale", "CSaleCondCtrlBasketFields", "GetControlDescr", 300);
// RegisterModuleDependences("sale", "OnCondSaleControlBuildList", "sale", "CSaleCondCtrlBasketProps", "GetControlDescr", 400);
RegisterModuleDependences("sale", "OnCondSaleControlBuildList", "sale", "CSaleCondCtrlOrderFields", "GetControlDescr", 1000);
// RegisterModuleDependences("sale", "OnCondSaleControlBuildList", "sale", "CSaleCondCtrlBasketProductFields", "GetControlDescr", 1100);
// RegisterModuleDependences("sale", "OnCondSaleControlBuildList", "sale", "CSaleCondCtrlBasketProductProps", "GetControlDescr", 1200);
RegisterModuleDependences("sale", "OnCondSaleControlBuildList", "sale", "CSaleCondCtrlCommon", "GetControlDescr", 10000);
RegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", "sale", "CSaleActionCtrlGroup", "GetControlDescr", 100);
RegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", "sale", "CSaleActionCtrlDelivery", "GetControlDescr", 200);
RegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", "sale", "CSaleActionCtrlBasketGroup", "GetControlDescr", 300);
// RegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", "sale", "CSaleActionCtrlGiftsGroup", "GetControlDescr", 400);
RegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", "sale", "CSaleActionCtrlSubGroup", "GetControlDescr", 1000);
RegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", "sale", "CSaleActionCondCtrlBasketFields", "GetControlDescr", 1100);
// RegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", "sale", "CSaleActionCtrlBasketProductFields", "GetControlDescr", 1200);
// RegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", "sale", "CSaleActionCtrlBasketProductProps", "GetControlDescr", 1300);
//pulling for mobile orders
RegisterModuleDependences("sale", "OnOrderDelete", "sale", "CSaleMobileOrderPull", "onOrderDelete", 100);
RegisterModuleDependences("sale", "OnOrderAdd", "sale", "CSaleMobileOrderPull", "onOrderAdd", 100);
RegisterModuleDependences("sale", "OnOrderUpdate", "sale", "CSaleMobileOrderPull", "onOrderUpdate", 100);
CAgent::AddAgent("CSaleRecurring::AgentCheckRecurring();", "sale", "N", 7200, "", "Y");
CAgent::AddAgent("CSaleOrder::RemindPayment();", "sale", "N", 86400, "", "Y");
CAgent::AddAgent("CSaleViewedProduct::ClearViewed();", "sale", "N", 86400, "", "Y");
if (CModule::IncludeModule("sale")) {
$dbStatusList = CSaleStatus::GetList(array(), array(), false, false, array());
if (!($arStatusList = $dbStatusList->Fetch())) {
$arLandDataN = array();
$arLandDataF = array();
$dbLangs = CLanguage::GetList($b = "", $o = "", array("ACTIVE" => "Y"));
while ($arLangs = $dbLangs->Fetch()) {
IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sale/status.php", $arLangs["LID"]);
$arLandDataN[] = array("LID" => $arLangs["LID"], "NAME" => GetMessage("SIM_ACCEPTED"), "DESCRIPTION" => GetMessage("SIM_ACCEPTED_DESCR"));
$arLandDataF[] = array("LID" => $arLangs["LID"], "NAME" => GetMessage("SIM_FINISHED"), "DESCRIPTION" => GetMessage("SIM_FINISHED_DESCR"));
}
CSaleStatus::Add(array("ID" => "N", "SORT" => 100, "LANG" => $arLandDataN));
CSaleStatus::Add(array("ID" => "F", "SORT" => 200, "LANG" => $arLandDataF));
}
}
return true;
}
示例6: Add
/**
* Adds new sale order status
* @param array $arFields Array with status properties.
* @return int|bool Returns the new status id or false if addition failed.
*/
public function Add($arFields)
{
if (!CModule::IncludeModule('sale')) {
return false;
}
if (!isset($arFields['NAME'])) {
return false;
}
$arStatus = array('ID' => self::getNewId(), 'LANG' => self::getStatusLang($arFields['NAME']));
if (isset($arFields['SORT'])) {
$arStatus['SORT'] = $arFields['SORT'];
}
return CSaleStatus::Add($arStatus);
}