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


PHP ProjectSettings::lookupControlType方法代码示例

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


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

示例1: buildLookupSQL

function buildLookupSQL($pageType, $field, $table, $parentVal, $childVal = "", $doCategoryFilter = true, $doValueFilter = false, $addCategoryField = false, $doWhereFilter = true, $oneRecordMode = false, $doValueFilterByLinkField = false)
{
    global $strTableName;
    if (!strlen($table)) {
        $table = $strTableName;
    }
    $pSet = new ProjectSettings($table, $pageType);
    //	read settings
    $nLookupType = $pSet->getLookupType($field);
    if ($nLookupType != LT_LOOKUPTABLE && $nLookupType != LT_QUERY) {
        return "";
    }
    $lookupTable = $pSet->getLookupTable($field);
    $displayFieldName = $pSet->getDisplayField($field);
    $linkFieldName = $pSet->getLinkField($field);
    $linkAndDisplaySame = $displayFieldName == $linkFieldName;
    $bUnique = $pSet->isLookupUnique($field);
    $strLookupWhere = GetLWWhere($field, $pageType, $table);
    $strOrderBy = $pSet->getLookupOrderBy($field);
    if (strlen($strOrderBy)) {
        $strOrderBy = GetFullFieldName($strOrderBy, $lookupTable);
        if ($pSet->isLookupDesc($field)) {
            $strOrderBy .= ' DESC';
        }
    }
    $bDesc = $pSet->isLookupDesc($field);
    $strCategoryFilter = $pSet->getCategoryFilter($field);
    if ($nLookupType == LT_QUERY) {
        $lookupPSet = new ProjectSettings($lookupTable, $pageType);
        $cipherer = new RunnerCipherer($lookupTable, $lookupPSet);
    } else {
        $cipherer = new RunnerCipherer($table, $pSet);
    }
    if ($doCategoryFilter) {
        if ($nLookupType == LT_QUERY) {
            $parentVal = $cipherer->MakeDBValue($strCategoryFilter, $parentVal, "", $lookupTable, true);
        } else {
            $parentVal = make_db_value($pSet->getCategoryControl($field), $parentVal, '', '', $table);
        }
    }
    if ($doValueFilter) {
        if ($pageType != PAGE_SEARCH || $doValueFilterByLinkField) {
            if ($nLookupType == LT_QUERY) {
                $childWhereField = $pSet->getLWLinkField($field, false);
            } else {
                $childWhereField = $pSet->getLWLinkField($field, true);
            }
        } else {
            if ($nLookupType == LT_QUERY) {
                $childWhereField = $pSet->getLWDisplayField($field, false);
            } else {
                $childWhereField = $pSet->getLWDisplayField($field, true);
            }
        }
        if ($nLookupType == LT_QUERY) {
            $childVal = $cipherer->MakeDBValue($childWhereField, $childVal, "", $lookupTable, true);
        } else {
            if ($linkAndDisplaySame) {
                $childVal = make_db_value($field, $childVal, '', '', $table);
            } else {
                $childVal = add_db_quotes($field, $childVal, $table, 200);
            }
        }
    }
    //	build Where clause
    $categoryWhere = "";
    $childWhere = "";
    if ($pSet->useCategory($field) && $doCategoryFilter) {
        $condition = "=" . $parentVal;
        if ($parentVal === "null") {
            $condition = " is null";
        }
        if ($nLookupType == LT_QUERY) {
            $categoryWhere = $cipherer->GetFieldName(AddFieldWrappers($strCategoryFilter), $strCategoryFilter) . $condition;
        } else {
            $categoryWhere = AddFieldWrappers($strCategoryFilter) . $condition;
        }
    }
    if ($doValueFilter) {
        $condition = "=" . $childVal;
        if ($childVal === "null") {
            $condition = " is null";
        }
        if ($nLookupType == LT_QUERY) {
            if ($pageType != PAGE_SEARCH || $pSet->lookupControlType($field) == LCT_LIST || $doValueFilterByLinkField) {
                $childWhere = GetFullFieldName($pSet->getLinkField($field), $lookupTable, false) . $condition;
            } else {
                if (!$pSet->getCustomDisplay($field)) {
                    $childWhere = $cipherer->GetFieldName($lookupPSet->getFullNameField($displayFieldName), $field) . $condition;
                } else {
                    $childWhere = $pSet->getDisplayField($field) . $condition;
                }
            }
        } else {
            if ($pageType != PAGE_SEARCH || $doValueFilterByLinkField) {
                $childWhere = $pSet->getLWLinkField($field, true) . $condition;
            } else {
                $childWhere = $pSet->getLWDisplayField($field, true) . $condition;
            }
        }
//.........这里部分代码省略.........
开发者ID:aagusti,项目名称:padl-tng,代码行数:101,代码来源:commonfunctions.php

示例2: GetInputElementId

/**
 * @intellisense
 */
function GetInputElementId($field, $id, $ptype)
{
	global $strTableName;
	$pSet = new ProjectSettings($strTableName, $ptype);
	$format = $pSet->getEditFormat($field);
	if($format == EDIT_FORMAT_DATE)
	{
		$type = $pSet->getDateEditType($field);
		if($type==EDIT_DATE_DD || $type==EDIT_DATE_DD_DP)
			return "dayvalue_".GoodFieldName($field)."_".$id;
		else
			return "value_".GoodFieldName($field)."_".$id;
	}
	else if($format==EDIT_FORMAT_RADIO)
		return "radio_".GoodFieldName($field)."_".$id."_0";
	else if($format==EDIT_FORMAT_LOOKUP_WIZARD)	
	{
		$lookuptype=$pSet->lookupControlType($field);
		if($lookuptype==LCT_AJAX || $lookuptype==LCT_LIST)
			return "display_value_".GoodFieldName($field)."_".$id;
		else
			return "value_".GoodFieldName($field)."_".$id;
	}	
	else
		return "value_".GoodFieldName($field)."_".$id;		
}
开发者ID:helbertfurbino,项目名称:sgmofinanceiro,代码行数:29,代码来源:commonfunctions.php


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