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


PHP CSalePersonType::Add方法代码示例

本文整理汇总了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/');
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:32,代码来源:step1.php

示例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);
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:sale_link.php

示例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()) {
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:step1.php

示例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));
        }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:person_type_edit.php


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