本文整理汇总了PHP中Bitrix\Sale\Location\LocationTable::getPathToNodeByCode方法的典型用法代码示例。如果您正苦于以下问题:PHP LocationTable::getPathToNodeByCode方法的具体用法?PHP LocationTable::getPathToNodeByCode怎么用?PHP LocationTable::getPathToNodeByCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bitrix\Sale\Location\LocationTable
的用法示例。
在下文中一共展示了LocationTable::getPathToNodeByCode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetMessage
if ($saleModulePermissions >= 'W') {
?>
<tr>
<td><strong><?php
echo GetMessage("COMPANY_LOCATION_ID");
?>
</strong></td>
<td>
<?php
$APPLICATION->IncludeComponent("bitrix:sale.location.selector." . \Bitrix\Sale\Location\Admin\LocationHelper::getWidgetAppearance(), "", array("ID" => "", "CODE" => $fields['LOCATION_ID'], "INPUT_NAME" => "LOCATION_ID", "PROVIDE_LINK_BY" => "code", "SHOW_ADMIN_CONTROLS" => 'Y', "SELECT_WHEN_SINGLE" => 'N', "FILTER_BY_SITE" => 'Y', "FILTER_SITE_ID" => Application::getInstance()->getContext()->getSite(), "SHOW_DEFAULT_LOCATIONS" => 'N', "SEARCH_BY_PRIMARY" => 'Y'), false);
?>
</td>
</tr>
<?php
} else {
$res = \Bitrix\Sale\Location\LocationTable::getPathToNodeByCode($fields['LOCATION_ID'], array('select' => array('CHAIN' => 'NAME.NAME'), 'filter' => array('NAME.LANGUAGE_ID' => $lang)));
$path = array();
while ($item = $res->fetch()) {
$path[] = $item['CHAIN'];
}
$path = implode(', ', array_reverse($path));
?>
<tr>
<td><?php
echo GetMessage("COMPANY_LOCATION");
?>
</td>
<td><?php
echo $path;
?>
</td>
示例2: getLocationPathDisplay
public static function getLocationPathDisplay($code)
{
if(!strlen($code))
return '';
$parameters = array(
'select' => array('LNAME' => 'NAME.NAME'),
'filter' => array('NAME.LANGUAGE_ID' => LANGUAGE_ID)
);
try
{
$res = Location\LocationTable::getPathToNodeByCode($code, $parameters);
}
catch(\Exception $e)
{
return $code;
}
$path = array();
while($item = $res->fetch())
$path[] = $item['LNAME'];
return implode(', ', array_reverse($path));
}
示例3: getViewHtmlSingle
protected static function getViewHtmlSingle(array $input, $value)
{
if ((string) $value == '') {
return '';
}
try {
$result = \Bitrix\Sale\Location\LocationTable::getPathToNodeByCode($value, array('select' => array('CHAIN' => 'NAME.NAME'), 'filter' => array('NAME.LANGUAGE_ID' => LANGUAGE_ID)));
$path = array();
while ($row = $result->fetch()) {
$path[] = $row['CHAIN'];
}
return htmlspecialcharsbx(implode(', ', $path));
} catch (\Bitrix\Main\SystemException $e) {
return '';
}
}
示例4: foreach
foreach ($fields as $field) {
$select[] = $field['FIELD_NAME'];
}
$params = array('select' => $select, 'filter' => $filter, 'order' => array($by => $order));
$company = CompanyTable::getList($params);
$dbResultList = new CAdminResult($company, $sTableID);
$dbResultList->NavStart();
$lAdmin->NavText($dbResultList->GetNavPrint(Loc::getMessage("SALE_COMPANY")));
$headers = array(array("id" => "ID", "content" => "ID", "sort" => "ID", "default" => true), array("id" => "ACTIVE", "content" => Loc::getMessage("SALE_COMPANY_ACTIVE"), "sort" => "ACTIVE", "default" => true), array("id" => "NAME", "content" => Loc::getMessage("SALE_COMPANY_NAME"), "sort" => "NAME", "default" => true), array("id" => "LOCATION_ID", "content" => Loc::getMessage("SALE_COMPANY_LOCATION_ID"), "sort" => "LOCATION_ID", "default" => true), array("id" => "CODE", "content" => Loc::getMessage("SALE_COMPANY_CODE"), "sort" => "CODE", "default" => true));
$USER_FIELD_MANAGER->AdminListAddHeaders(CompanyTable::getUfId(), $headers);
$lAdmin->AddHeaders($headers);
$allSelectedFields = array("ID" => false, "ACTIVE" => false, "NAME" => false, "LOCATION_ID" => false, "CODE" => false);
$selectedFields = $lAdmin->GetVisibleHeaderColumns();
$allSelectedFields = array_merge($allSelectedFields, array_fill_keys($selectedFields, true));
while ($company = $dbResultList->NavNext(true, "f_")) {
$res = \Bitrix\Sale\Location\LocationTable::getPathToNodeByCode($company['LOCATION_ID'], array('select' => array('CHAIN' => 'NAME.NAME'), 'filter' => array('NAME.LANGUAGE_ID' => Application::getInstance()->getContext()->getLanguage())));
$path = array();
while ($item = $res->fetch()) {
$path[] = $item['CHAIN'];
}
$company['LOCATION_ID'] = implode(', ', array_reverse($path));
$row =& $lAdmin->AddRow($f_ID, $company, "sale_company_edit.php?ID=" . $f_ID . "&lang=" . $lang, Loc::getMessage("SALE_COMPANY_EDIT_DESCR"));
$row->AddField("ID", "<a href=\"sale_company_edit.php?ID=" . $f_ID . "&lang=" . $lang . GetFilterParams("filter_") . "\">" . $f_ID . "</a>");
$row->AddCheckField("ACTIVE");
$row->AddInputField("NAME");
$row->AddField("LOCATION_ID", $company['LOCATION_ID']);
$row->AddInputField("CODE");
$USER_FIELD_MANAGER->AddUserFields(CompanyTable::getUfId(), $company, $row);
$arActions = array(array("ICON" => "edit", "TEXT" => Loc::getMessage("SALE_COMPANY_EDIT"), "TITLE" => Loc::getMessage("SALE_COMPANY_EDIT_DESCR"), "ACTION" => $lAdmin->ActionRedirect("sale_company_edit.php?ID=" . $f_ID . "&lang=" . $lang), "DEFAULT" => true));
if ($saleModulePermissions >= "W") {
$arActions[] = array("SEPARATOR" => true);
示例5: obtainDataLocation
protected function obtainDataLocation()
{
$parameters = $this->getLocationListParameters();
$this->dbResult['PATH'] = array();
$this->dbResult['LOCATION'] = array();
$toBeFound = false;
$res = false;
try
{
if($this->arParams['ID'])
{
$toBeFound = true;
$res = Location\LocationTable::getPathToNode($this->arParams['ID'], $parameters);
}
elseif(strlen($this->arParams['CODE']))
{
$toBeFound = true;
$res = Location\LocationTable::getPathToNodeByCode($this->arParams['CODE'], $parameters);
}
if($res)
{
$res->addReplacedAliases(array('LNAME' => 'NAME'));
while($item = $res->Fetch())
$this->dbResult['PATH'][intval($item['ID'])] = $this->forceToType($item);
end($this->dbResult['PATH']);
$this->dbResult['LOCATION'] = current($this->dbResult['PATH']);
}
}
catch(Main\SystemException $e)
{
}
if(empty($this->dbResult['PATH']) && $toBeFound)
$this->errors['NONFATAL'][] = Loc::getMessage('SALE_SLS_SELECTED_NODE_NOT_FOUND');
}