本文整理汇总了PHP中ProjectSettings::getLookupTable方法的典型用法代码示例。如果您正苦于以下问题:PHP ProjectSettings::getLookupTable方法的具体用法?PHP ProjectSettings::getLookupTable怎么用?PHP ProjectSettings::getLookupTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectSettings
的用法示例。
在下文中一共展示了ProjectSettings::getLookupTable方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: strlen
}
$hasWhere = false;
$fieldsArr = $gSettings->getFieldsList();
$lwLinkField = '';
$lookupField = '';
$lwDisplayField = '';
$lookupConnection = $cman->getDefault();
foreach ($fieldsArr as $f) {
$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);
if ($LookupType == LT_QUERY) {
$lookupConnection = $cman->byTable($lookupTable);
} else {
$connId = $gSettings->getNotProjectLookupTableConnId($f);
$lookupConnection = strlen($connId) ? $cman->byId($connId) : $cman->getDefault();
}
$linkFieldName = $gSettings->getLinkField($f);
$displayFieldName = $gSettings->getDisplayField($f);
$linkAndDisplaySame = $displayFieldName == $linkFieldName;
$lookupOrderBy = $gSettings->getLookupOrderBy($f);
$lwDisplayField = RunnerPage::sqlFormattedDisplayField($f, $lookupConnection, $gSettings);
if ($lookupConnection->dbType == nDATABASE_MSSQLServer) {
$strUniqueOrderBy = $lookupOrderBy;
}
if ($LookupType == LT_QUERY) {
示例2: update_report_totals
function update_report_totals()
{
$root =& $_SESSION["webreports"];
// ensure all fields in reports are listed in the tables
$tables = getReportTablesList();
if (is_wr_custom()) {
$fields = WRGetFieldsList('');
}
$arr_unset = array();
foreach ($root["totals"] as $idx => $fld) {
if (array_search($fld["table"], $tables) !== false || is_null($fld["table"]) && is_wr_custom()) {
if (!is_wr_custom()) {
$fields = WRGetFieldsList($fld["table"]);
}
if (array_search($fld["name"], $fields) !== false) {
continue;
}
}
// remove $total if found
$arr_unset[] = $idx;
}
foreach ($arr_unset as $idx => $fld) {
unset($root["totals"][$fld]);
}
// ensure all fields appear in the totals
$all_fields = array();
foreach ($tables as $t) {
$fields = WRGetFieldsList($t);
foreach ($fields as $f) {
if (is_wr_db()) {
$all_fields[] = $t . "." . $f;
} else {
$all_fields[] = $f;
}
}
}
// ensure all series fields appear in the totals
foreach ($all_fields as $fieldItem) {
$f = $fieldItem;
$table = "";
$fld = "";
if (is_wr_db()) {
WRSplitFieldName($f, $table, $fld);
} else {
$table = $tables[0];
$fld = $f;
$f = $table . "_" . $f;
}
if (array_key_exists(GoodFieldName($f), $root["totals"])) {
continue;
}
$pSet = new ProjectSettings($table, PAGE_LIST);
$root['totals'][GoodFieldName($f)] = array();
$root['totals'][GoodFieldName($f)]["name"] = $fld;
$root['totals'][GoodFieldName($f)]["table"] = $table;
$root['totals'][GoodFieldName($f)]["label"] = $pSet->label($fld);
$root['totals'][GoodFieldName($f)]["show"] = "true";
$root['totals'][GoodFieldName($f)]["min"] = "false";
$root['totals'][GoodFieldName($f)]["max"] = "false";
$root['totals'][GoodFieldName($f)]["sum"] = "false";
$root['totals'][GoodFieldName($f)]["avg"] = "false";
$root['totals'][GoodFieldName($f)]["curr"] = "false";
$root['totals'][GoodFieldName($f)]["search"] = "";
$root['totals'][GoodFieldName($f)]["view_format"] = GetGenericViewFormat($table, $fld);
$root['totals'][GoodFieldName($f)]["edit_format"] = GetGenericEditFormat($table, $fld);
$root['totals'][GoodFieldName($f)]["display_field"] = $pSet->getDisplayField($fld);
$root['totals'][GoodFieldName($f)]["linkfield"] = $pSet->getLinkField($fld);
$root['totals'][GoodFieldName($f)]["show_thumbnail"] = $pSet->showThumbnail($fld);
$root['totals'][GoodFieldName($f)]["need_encode"] = $pSet->NeedEncode($fld);
$root['totals'][GoodFieldName($f)]["thumbnail"] = $pSet->getStrThumbnail($fld);
$root['totals'][GoodFieldName($f)]["listformatobj_imgwidth"] = $pSet->getImageWidth($fld);
$root['totals'][GoodFieldName($f)]["listformatobj_imgheight"] = $pSet->getImageHeight($fld);
$root['totals'][GoodFieldName($f)]["hlprefix"] = $pSet->getLinkPrefix($fld);
$root['totals'][GoodFieldName($f)]["listformatobj_filename"] = $pSet->getFilenameField($fld);
$root['totals'][GoodFieldName($f)]["lookupobj_lookuptype"] = $pSet->getLookupType($fld);
$root['totals'][GoodFieldName($f)]["editformatobj_lookupobj_customdispaly"] = $pSet->getDisplayField($fld);
$root['totals'][GoodFieldName($f)]["editformatobj_lookupobj_table"] = $pSet->getLookupTable($fld);
$root['totals'][GoodFieldName($f)]["editformatobj_lookupobj_where"] = GetLWWhere($fld, PAGE_REPORT);
}
$_SESSION["webreports"] = $root;
}
示例3: loadSelectContent
function loadSelectContent($pageType, $childFieldName, $parentVal, $doCategoryFilter = true, $childVal = "", $initialLoad = true)
{
global $conn, $LookupSQL, $strTableName;
$pSet = new ProjectSettings($strTableName, $pageType);
$response = array();
$lookupType = $pSet->getLookupType($childFieldName);
$isUnique = $pSet->isLookupUnique($childFieldName);
if ($pSet->useCategory($childFieldName) && $doCategoryFilter) {
if ($lookupType == LT_QUERY) {
$lookupTable = $pSet->getLookupTable($childFieldName);
$cipherer = new RunnerCipherer($lookupTable);
$tempParentVal = $cipherer->MakeDBValue($pSet->getCategoryControl($childFieldName), $parentVal, "", $lookupTable, true);
} else {
$tempParentVal = make_db_value($childFieldName, $parentVal);
}
if ($tempParentVal === "null") {
return $response;
}
}
$LookupSQL = buildLookupSQL($pageType, $childFieldName, $strTableName, $parentVal, $childVal, $doCategoryFilter, $pSet->fastType($childFieldName) && $initialLoad);
$lookupIndexes = GetLookupFieldsIndexes($pSet, $childFieldName);
$rs = db_query($LookupSQL, $conn);
if (!$pSet->fastType($childFieldName)) {
while ($data = db_fetch_numarray($rs)) {
if ($lookupType == LT_QUERY && $isUnique) {
if (!isset($uniqueArray)) {
$uniqueArray = array();
}
if (in_array($data[$lookupIndexes["displayFieldIndex"]], $uniqueArray)) {
continue;
}
$uniqueArray[] = $data[$lookupIndexes["displayFieldIndex"]];
}
$response[] = $data[$lookupIndexes["linkFieldIndex"]];
$response[] = $data[$lookupIndexes["displayFieldIndex"]];
}
} else {
$data = db_fetch_numarray($rs);
// one record only
if ($data && (strlen($childVal) || !db_fetch_numarray($rs))) {
$response[] = $data[$lookupIndexes["linkFieldIndex"]];
$response[] = $data[$lookupIndexes["displayFieldIndex"]];
}
}
return $response;
}
示例4: comlete_report_session_default_values
function comlete_report_session_default_values($isedit = "")
{
$root =& $_SESSION["webreports"];
$table = $root['tables'][0];
$arr_fields = WRGetNBFieldsList($table);
$arr_fields_all = WRGetFieldsList($table);
$gfield = $arr_fields[0];
if (is_wr_db()) {
$gfield = $table . "." . $arr_fields[0];
}
$garrfield = array("name" => $gfield, "int_type" => "0", "ss" => "true", "group_order" => "1", "color1" => "FF0000", "color2" => "CC0000");
$garrSummary = array();
$garrSummary["name"] = "Summary";
$garrSummary["crosstable"] = "false";
$garrSummary["sps"] = "true";
$garrSummary["sds"] = "true";
$garrSummary["sgs"] = "true";
$garrSummary["sum_x"] = "true";
$garrSummary["sum_y"] = "true";
$garrSummary["sum_total"] = "true";
$root['group_fields'] = array($garrfield, $garrSummary);
$root['totals'] = array();
$pSet = new ProjectSettings($table);
foreach ($arr_fields_all as $fld) {
$root['totals'][GoodFieldName($table . "." . $fld)] = array();
$root['totals'][GoodFieldName($table . "." . $fld)]["name"] = $fld;
$root['totals'][GoodFieldName($table . "." . $fld)]["table"] = $table;
$root['totals'][GoodFieldName($table . "." . $fld)]["label"] = $pSet->label($fld);
$root['totals'][GoodFieldName($table . "." . $fld)]["show"] = "true";
$root['totals'][GoodFieldName($table . "." . $fld)]["min"] = "false";
$root['totals'][GoodFieldName($table . "." . $fld)]["max"] = "false";
$root['totals'][GoodFieldName($table . "." . $fld)]["sum"] = "false";
$root['totals'][GoodFieldName($table . "." . $fld)]["avg"] = "false";
$root['totals'][GoodFieldName($table . "." . $fld)]["curr"] = "false";
$root['totals'][GoodFieldName($table . "." . $fld)]["search"] = "";
$root['totals'][GoodFieldName($table . "." . $fld)]["view_format"] = GetGenericViewFormat($table, $fld);
$root['totals'][GoodFieldName($table . "." . $fld)]["edit_format"] = GetGenericEditFormat($table, $fld);
$root['totals'][GoodFieldName($table . "." . $fld)]["display_field"] = $pSet->getDisplayField($fld);
if (is_wr_project()) {
$root['totals'][GoodFieldName($table . "." . $fld)]["linkfield"] = $pSet->getLinkField($fld);
} else {
$root['totals'][GoodFieldName($table . "." . $fld)]["linkfield"] = "";
}
$root['totals'][GoodFieldName($table . "." . $fld)]["show_thumbnail"] = $pSet->showThumbnail($fld);
$root['totals'][GoodFieldName($table . "." . $fld)]["need_encode"] = $pSet->NeedEncode($fld);
$root['totals'][GoodFieldName($table . "." . $fld)]["thumbnail"] = $pSet->getStrThumbnail($fld);
$root['totals'][GoodFieldName($table . "." . $fld)]["listformatobj_imgwidth"] = $pSet->getImageWidth($fld);
$root['totals'][GoodFieldName($table . "." . $fld)]["listformatobj_imgheight"] = $pSet->getImageHeight($fld);
$root['totals'][GoodFieldName($table . "." . $fld)]["hlprefix"] = $pSet->getLinkPrefix($fld);
$root['totals'][GoodFieldName($table . "." . $fld)]["listformatobj_filename"] = $pSet->getFilenameField($fld);
$root['totals'][GoodFieldName($table . "." . $fld)]["lookupobj_lookuptype"] = $pSet->getLookupType($fld);
$root['totals'][GoodFieldName($table . "." . $fld)]["editformatobj_lookupobj_customdispaly"] = $pSet->getDisplayField($fld);
$root['totals'][GoodFieldName($table . "." . $fld)]["editformatobj_lookupobj_table"] = $pSet->getLookupTable($fld);
$root['totals'][GoodFieldName($table . "." . $fld)]["editformatobj_lookupobj_where"] = GetLWWhere($fld, PAGE_REPORT);
}
$root['sort_fields'] = array(array("name" => $gfield, "desc" => "false"));
if (!$isedit) {
$root['miscellaneous'] = array("type" => "stepped", "print_friendly" => "true", "lines_num" => "30");
$root['settings'] = array("name" => GoodFieldName($root['tables'][0]) . '_' . CheckLastID('report'), "title" => $root['tables'][0] . ' Report ' . CheckLastID('report'), "status" => "private");
$_SESSION["webobject"]["name"] = GoodFieldName($root['tables'][0]) . '_' . CheckLastID('report');
$root['owner'] = $_SESSION["UserID"];
$_SESSION['webreports']['tmp_active'] = "x";
}
$root['table_name'] = $root['tables'][0];
$root['short_table_name'] = GetTableURL($root['tables'][0]);
}
示例5: addFieldsSettings
function addFieldsSettings($arrFields, $pageBased, $pageType)
{
$dashSearchFields = $this->pSet->getDashboardSearchFields();
foreach ($arrFields as $fieldName) {
$pSet = new ProjectSettings($dashSearchFields[$fieldName][0]["table"]);
$tableFieldName = $dashSearchFields[$fieldName][0]["field"];
if (!array_key_exists($fieldName, $this->jsSettings['tableSettings'][$this->tName]['fieldSettings'])) {
$this->jsSettings['tableSettings'][$this->tName]['fieldSettings'][$fieldName] = array();
}
if (!array_key_exists($pageType, $this->jsSettings['tableSettings'][$this->tName]['fieldSettings'][$fieldName])) {
$this->jsSettings['tableSettings'][$this->tName]['fieldSettings'][$fieldName][$pageType] = array();
}
foreach ($this->settingsMap["fieldSettings"] as $key => $val) {
$fData = $pSet->getFieldData($tableFieldName, $key);
if ($key == "validateAs") {
if ($pageType == PAGE_ADD || $pageType == PAGE_EDIT || $pageType == PAGE_REGISTER) {
$this->fillValidation($fData, $val, $this->jsSettings['tableSettings'][$this->tName]['fieldSettings'][$fieldName][$pageType]);
}
continue;
}
if ($key == "RTEType") {
$fData = $pSet->getRTEType($tableFieldName);
if ($fData == "RTECK") {
$this->isUseCK = true;
$this->jsSettings['tableSettings'][$this->tName]['fieldSettings'][$fieldName][$pageType]['nWidth'] = $pSet->getNCols($tableFieldName);
$this->jsSettings['tableSettings'][$this->tName]['fieldSettings'][$fieldName][$pageType]['nHeight'] = $pSet->getNRows($tableFieldName);
}
} elseif ($key == "autoCompleteFields") {
$fData = $pSet->getAutoCompleteFields($tableFieldName);
}
$isDefault = false;
if (is_array($fData)) {
$isDefault = !count($fData);
} else {
if (!is_array($val['default'])) {
$isDefault = $fData === $val['default'];
}
}
if (!$isDefault) {
$this->jsSettings['tableSettings'][$this->tName]['fieldSettings'][$fieldName][$pageType][$val['jsName']] = $fData;
}
}
$this->jsSettings['tableSettings'][$this->tName]['isUseCK'] = $this->isUseCK;
if (count($this->googleMapCfg) != 0 && $this->googleMapCfg['isUseGoogleMap']) {
$this->jsSettings['tableSettings'][$this->tName]['isUseGoogleMap'] = true;
$this->jsSettings['tableSettings'][$this->tName]['googleMapCfg'] = $this->googleMapCfg;
}
$lookupTableName = $pSet->getLookupTable($tableFieldName);
if ($lookupTableName) {
$this->jsSettings['global']['shortTNames'][$lookupTableName] = GetTableURL($lookupTableName);
}
if ($pSet->getEditFormat($tableFieldName) == 'Time') {
$this->fillTimePickSettings($tableFieldName, "", $pSet, $pageType);
}
}
}
示例6: GetGenericEditFormat
<td align="center" ' . $class . $blobClass . '"><input ' . $blobDisabled . ' type="checkbox" name="'.$val_curr.'" ></td>
<td style="display:none;">
<input type="text" id="vf' . $cnt . '" name="vf' . $cnt . '" value="' . $vf . '" >
<input type="text" id="ef' . $cnt . '" name="ef' . $cnt . '" value="' . GetGenericEditFormat( $arr['table'], $arr['field'] ) . '" >
<input type="text" id="display_field_' . $cnt . '" name="display_field_' . $cnt . '" value="' . $pSet->getLWDisplayField( $arr['field'] ) . '" >
<input type="text" id="linkfield_' . $cnt . '" name="linkfield_' . $cnt . '" value="' . $pSet->getLWLinkField( $arr['field'] ) . '" >
<input type="text" id="show_thumbnail_' . $cnt . '" name="show_thumbnail_' . $cnt . '" value="' . $pSet->showThumbnail( $arr['field'] ) . '" >
<input type="text" id="need_encode_' . $cnt . '" name="need_encode_' . $cnt . '" value="' . $pSet->NeedEncode($arr['field']) . '" >
<input type="text" id="thumbnail_' . $cnt . '" name="thumbnail_' . $cnt . '" value="' . $pSet->getStrThumbnail( $arr['field'] ) . '" >
<input type="text" id="listformatobj_imgwidth_' . $cnt . '" name="listformatobj_imgwidth_' . $cnt . '" value="' . $pSet->getImageWidth( $arr['field'] ) . '" >
<input type="text" id="listformatobj_imgheight_' . $cnt . '" name="listformatobj_imgheight_' . $cnt . '" value="' . $pSet->getImageHeight( $arr['field'] ) . '" >
<input type="text" id="hlprefix_' . $cnt . '" name="hlprefix_' . $cnt . '" value="' . $pSet->getLinkPrefix($arr['field']) . '" >
<input type="text" id="listformatobj_filename_' . $cnt . '" name="listformatobj_filename_' . $cnt . '" value="' . $pSet->getFilenameField( $arr['field']) . '" >
<input type="text" id="lookupobj_lookuptype_' . $cnt . '" name="lookupobj_lookuptype_' . $cnt . '" value="' . $pSet->getLookupType( $arr['field'] ) . '" >
<input type="text" id="editformatobj_lookupobj_customdispaly_' . $cnt . '" name="editformatobj_lookupobj_customdispaly_' . $cnt . '" value="' . $pSet->getLWDisplayField( $arr['field'] ) . '" >
<input type="text" id="editformatobj_lookupobj_table_' . $cnt . '" name="editformatobj_lookupobj_table_' . $cnt . '" value="' . $pSet->getLookupTable( $arr['field'] ) . '" >
<input type="text" id="editformatobj_lookupobj_where_' . $cnt . '" name="editformatobj_lookupobj_where_' . $cnt . '" value="' . GetLWWhere($arr['field'],PAGE_REPORT) . '" >
</td>
</tr>';
}
$arr = $_SESSION['webreports']['totals'];
if ( !empty( $arr ) ) {
$b_includes .= '<script type="text/javascript">
$(document).ready(function(){'."\n";
foreach ($arr as $id => $totals) {
if(!is_wr_custom())
$b_includes .= "$('tr[id=".$id."]', '#trt').find('td').eq(1).text('" . jsreplace($totals["table"].".".$totals["name"]) . "');"."\n";