本文整理汇总了PHP中CSalePersonType::Add方法的典型用法代码示例。如果您正苦于以下问题:PHP CSalePersonType::Add方法的具体用法?PHP CSalePersonType::Add怎么用?PHP CSalePersonType::Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSalePersonType
的用法示例。
在下文中一共展示了CSalePersonType::Add方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array_search
$personTypeFizUa = ($personType["fiz_ua"] == "Y") ? "Y" : "N";
COption::SetOptionString("eshop", "personTypeFizUa", $personTypeFizUa, false, WIZARD_SITE_ID);
if (in_array(GetMessage("SALE_WIZARD_PERSON_3"), $arPersonTypeNames))
{
$arGeneralInfo["personType"]["fiz_ua"] = array_search(GetMessage("SALE_WIZARD_PERSON_3"), $arPersonTypeNames);
CSalePersonType::Update(array_search(GetMessage("SALE_WIZARD_PERSON_3"), $arPersonTypeNames), Array(
"ACTIVE" => $personType["fiz_ua"] == "Y" ? "Y" : "N",
)
);
}
elseif($personType["fiz_ua"] == "Y")
{
$arGeneralInfo["personType"]["fiz_ua"] = CSalePersonType::Add(Array(
"LID" => WIZARD_SITE_ID,
"NAME" => GetMessage("SALE_WIZARD_PERSON_3"),
"SORT" => "100"
)
);
}
}
if (COption::GetOptionString("eshop", "wizard_installed", "N", WIZARD_SITE_ID) != "Y" || WIZARD_INSTALL_DEMO_DATA)
{
//Set options
COption::SetOptionString('sale','default_currency',$defCurrency);
COption::SetOptionString('sale','delete_after','30');
COption::SetOptionString('sale','order_list_date','30');
COption::SetOptionString('sale','MAX_LOCK_TIME','30');
COption::SetOptionString('sale','GRAPH_WEIGHT','600');
COption::SetOptionString('sale','GRAPH_HEIGHT','600');
COption::SetOptionString('sale','path2user_ps_files','/bitrix/php_interface/include/sale_payment/');
示例2: array
}
//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) {
$companyPTID = CSalePersonType::Add(array("LID" => $currentSiteID, "NAME" => 'CRM_COMPANY', "SORT" => "100", "ACTIVE" => "Y"));
}
if ($contactPTID <= 0) {
$contactPTID = CSalePersonType::Add(array("LID" => $currentSiteID, "NAME" => 'CRM_CONTACT', "SORT" => "110", "ACTIVE" => "Y"));
}
//Order user fields
$obUserField = new CUserTypeEntity();
$arOrderUserFieldDefault = array('ENTITY_ID' => 'ORDER', 'FIELD_NAME' => 'UF_FIELD', 'USER_TYPE_ID' => 'string', 'XML_ID' => 'uf_field', 'SORT' => '2000', 'MULTIPLE' => null, 'MANDATORY' => null, 'SHOW_FILTER' => 'N', 'SHOW_IN_LIST' => 'N', 'EDIT_IN_LIST' => 'N', 'IS_SEARCHABLE' => null, 'SETTINGS' => array('DEFAULT_VALUE' => null, 'SIZE' => '', 'ROWS' => '1', 'MIN_LENGTH' => '0', 'MAX_LENGTH' => '0', 'REGEXP' => ''), 'EDIT_FORM_LABEL' => array('ru' => '', 'en' => ''), 'LIST_COLUMN_LABEL' => array('ru' => '', 'en' => ''), 'LIST_FILTER_LABEL' => array('ru' => '', 'en' => ''), 'ERROR_MESSAGE' => array('ru' => '', 'en' => ''), 'HELP_MESSAGE' => array('ru' => '', 'en' => ''));
$dbRes = $obUserField->GetList(array('SORT' => 'DESC'), array('ENTITY_ID' => 'ORDER'));
$maxUFSort = 0;
$i = 0;
$arUFNames = array();
while ($arUF = $dbRes->Fetch()) {
if ($i++ === 0) {
$maxUFSort = intval($arUF['SORT']);
}
$arUFNames[] = $arUF['FIELD_NAME'];
}
unset($dbRes, $arUF, $i);
示例3: __IncludeLang
if ($arSite = $dbSite->Fetch()) {
$lang = $arSite["LANGUAGE_ID"];
}
if (strlen($lang) <= 0) {
$lang = "ru";
}
$bRus = false;
if ($lang == "ru") {
$bRus = true;
}
__IncludeLang(GetLangFileName(dirname(__FILE__) . "/lang/", "/" . basename(__FILE__), $lang));
$dbPerson = CSalePersonType::GetList(array());
if (!$dbPerson->Fetch()) {
//Person Types
$arGeneralInfo["personType"]["fiz"] = CSalePersonType::Add(array("LID" => $siteID, "NAME" => GetMessage("SALE_WIZARD_PERSON_1"), "SORT" => "100"));
$arGeneralInfo["personType"]["ur"] = CSalePersonType::Add(array("LID" => $siteID, "NAME" => GetMessage("SALE_WIZARD_PERSON_2"), "SORT" => "150"));
//currecny to site
$dbUserAccount = CSaleUserAccount::GetList(array(), array("USER_ID" => 1));
if (!$dbUserAccount->Fetch()) {
if ($bRus) {
CSaleLang::Add(array("LID" => $siteID, "CURRENCY" => "RUB"));
CSaleUserAccount::Add(array("USER_ID" => 1, "CURRENT_BUDGET" => 1000, "CURRENCY" => "RUB"));
} else {
CSaleLang::Add(array("LID" => $siteID, "CURRENCY" => "USD"));
CSaleUserAccount::Add(array("USER_ID" => 1, "CURRENT_BUDGET" => 100, "CURRENCY" => "USD"));
}
}
//Sale administrators
$userGroupID = "";
$dbGroup = CGroup::GetList($by = "", $order = "", array("STRING_ID" => "sale_administrator"));
if ($arGroup = $dbGroup->Fetch()) {
示例4: IntVal
$ID = IntVal($ID);
if ($REQUEST_METHOD == "POST" && strlen($Update) > 0 && $saleModulePermissions >= "W" && check_bitrix_sessid()) {
if ($ACTIVE != "Y") {
$ACTIVE = "N";
}
$arFields = array("LID" => $LID, "NAME" => $NAME, "SORT" => $SORT, "ACTIVE" => $ACTIVE);
if ($ID > 0) {
if (!CSalePersonType::Update($ID, $arFields)) {
if ($ex = $APPLICATION->GetException()) {
$errorMessage .= $ex->GetString() . "<br>";
} else {
$errorMessage .= GetMessage("SPTEN_ERROR_SAVING_PERSON_TYPE") . "<br>";
}
}
} else {
$ID = CSalePersonType::Add($arFields);
$ID = IntVal($ID);
if ($ID <= 0) {
if ($ex = $APPLICATION->GetException()) {
$errorMessage .= $ex->GetString() . "<br>";
} else {
$errorMessage .= GetMessage("SPTEN_ERROR_SAVING_PERSON_TYPE") . "<br>";
}
}
}
if (strlen($errorMessage) <= 0) {
if (strlen($apply) <= 0) {
LocalRedirect("/bitrix/admin/sale_person_type.php?lang=" . LANG . GetFilterParams("filter_", false));
} else {
LocalRedirect("/bitrix/admin/sale_person_type_edit.php?ID=" . $ID . "&lang=" . LANG . GetFilterParams("filter_", false));
}