/** * It return dashboard main search field data */ function getDashMainFieldData($field, $key) { if ($this->getTableType() != PAGE_DASHBOARD) { return false; } // get all dashboard search fields $dashFields = $this->getDashboardSearchFields(); // get main field name and table name $dashElemTableName = $dashFields[$field][0]["table"]; $dashElemFieldName = $dashFields[$field][0]["field"]; $dashElemSettings = new ProjectSettings($dashElemTableName, $this->_editPage); return $dashElemSettings->getFieldData($dashElemFieldName, $key); }
function getDashFieldData($field, $key) { $dashSearchFields = $this->getDashboardSearchFields(); $tableSettings = new ProjectSettings($dashSearchFields[$field][0]["table"], $this->_editPage); return $tableSettings->getFieldData($dashSearchFields[$field][0]["field"], $key); }
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); } } }