本文整理汇总了PHP中ProjectSettings::getCustomDisplay方法的典型用法代码示例。如果您正苦于以下问题:PHP ProjectSettings::getCustomDisplay方法的具体用法?PHP ProjectSettings::getCustomDisplay怎么用?PHP ProjectSettings::getCustomDisplay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectSettings
的用法示例。
在下文中一共展示了ProjectSettings::getCustomDisplay方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ProjectSettings
$fEditFormat = $gSettings->getEditFormat($f);
if ($fEditFormat != EDIT_FORMAT_LOOKUP_WIZARD || GoodFieldName($f) != $field) {
continue;
}
$lookupField = $f;
$LookupType = $gSettings->getLookupType($f);
if ($LookupType == LT_LOOKUPTABLE || $LookupType == LT_QUERY) {
$lookupTable = $gSettings->getLookupTable($f);
$linkFieldName = $gSettings->getLinkField($f);
$displayFieldName = $gSettings->getDisplayField($f);
$linkAndDisplaySame = $displayFieldName == $linkFieldName;
$lwDisplayField = $gSettings->getLWDisplayField($f);
if ($LookupType == LT_QUERY) {
$lookupPSet = new ProjectSettings($lookupTable, $pageType);
$lookupQueryObj = $lookupPSet->getSQLQuery();
if ($gSettings->getCustomDisplay($f)) {
$lookupQueryObj->AddCustomExpression($displayFieldName, $lookupPSet, $strTableName, $f);
}
$lookupQueryObj->ReplaceFieldsWithDummies($lookupPSet->getBinaryFieldsIndices());
$cipherer->strTableName = $lookupTable;
} else {
$LookupSQLTable = "SELECT ";
$lwLinkField = $gSettings->GetLWLinkField($f, true);
if ($gSettings->isLookupUnique($f)) {
$LookupSQLTable .= "DISTINCT ";
}
$LookupSQLTable .= $cipherer->GetLookupFieldName($lwLinkField, $strTableName, $f, null, true);
if (!$linkAndDisplaySame) {
$LookupSQLTable .= "," . ($lwDisplayField == $lwLinkField ? $cipherer->GetFieldName($lwDisplayField, $f, true) : $lwDisplayField);
}
$LookupSQLTable .= " FROM " . AddTableWrappers($lookupTable) . " ";
示例2: 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;
}
}
//.........这里部分代码省略.........
示例3: initLookupParams
function initLookupParams()
{
$this->parId = postvalue("parId");
$this->firstTime = postvalue("firsttime");
$this->mainField = postvalue("field");
$this->lookupControl = postvalue("control");
$this->lookupCategory = postvalue("category");
$this->mainTable = postvalue("table");
global $tables_data;
include_once getabspath('include/' . GetTableURL($this->mainTable) . '_settings.php');
$this->pSet = new ProjectSettings($this->tName, PAGE_SEARCH);
$this->lookupParams = "mode=lookup&id=" . $this->id . "&parId=" . $this->parId . "&field=" . rawurlencode($this->mainField) . "&control=" . rawurlencode($this->lookupControl) . "&category=" . rawurlencode($this->lookupCategory) . "&table=" . rawurlencode($this->mainTable) . "&editMode=" . postvalue('editMode');
$this->sessionPrefix = $this->tName . "_lookup_" . $this->mainTable . '_' . $this->mainField;
$pageType = postvalue("pageType");
if ($pageType != PAGE_ADD && $pageType != PAGE_EDIT) {
$pageType = PAGE_SEARCH;
}
$lookupPSet = new ProjectSettings($this->mainTable, $pageType);
$this->linkField = $lookupPSet->getLWLinkField($this->mainField, false);
$this->dispField = $lookupPSet->getLWDisplayField($this->mainField, false);
if ($lookupPSet->getCustomDisplay($this->mainField)) {
$this->dispFieldAlias = GetGlobalData("dispFieldAlias", "rrdf1");
$this->pSet->getSQLQuery()->AddCustomExpression($lookupPSet->getDisplayField($this->mainField), $this->pSet, $this->mainTable, $this->mainField, $this->dispFieldAlias);
$this->customField = $this->linkField;
}
$this->outputFieldValue($this->linkField, 2);
$this->outputFieldValue($this->dispField, 2);
if ($lookupPSet->useCategory($this->mainField)) {
$this->categoryField = $lookupPSet->getCategoryFilter($this->mainField);
}
$this->strLookupWhere = GetLWWhere($this->mainField, $this->pageType, $this->mainTable);
if ($this->dispFieldAlias && $this->pSet->appearOnListPage($this->dispField)) {
$this->lookupSelectField = $this->dispField;
} elseif ($this->pSet->appearOnListPage($this->dispField)) {
$this->lookupSelectField = $this->dispField;
} else {
$this->lookupSelectField = $this->listFields[0]['fName'];
}
if ($this->categoryField) {
if (!strlen(GetFullFieldName($this->categoryField))) {
$this->categoryField = "";
}
}
if (!$this->categoryField) {
$this->lookupCategory = "";
}
}