pquery($sql, array(1)); $moduleList = array(); while ($row = $adb->fetch_array($result)) { $moduleList[$row['tabid']] = $row['name']; } return $moduleList; } function getCalculateFields($tabid, $type = 'number') { $adb = PearDatabase::getInstance(); $sql = getCalculateFieldsSql() . ' and vtiger_field.tabid != 29 and vtiger_field.tabid =? order by vtiger_field.tabid ASC'; $result = $adb->pquery($sql, array($tabid)); if ($result && $adb->num_rows($result) > 0) { $retval = array(); $numrows = $adb->num_rows($result); for ($i = 0; $i < $numrows; $i++) { $row = $adb->query_result_rowdata($result, $i); $fieldname = $row['fieldname']; if ('9' == $tabid && 'eventstatus' === $fieldname) { continue; } $uitype = $row['uitype']; $fieldlabel = $row['fieldlabel']; $retval[$row['fieldid']] = array( 'fieldname' => $fieldname, 'fieldlabel' => vtranslate($fieldlabel, $row['name']), 'uitype' => $uitype, ); } return $retval; } else { return null; } } /** * @param int $tabid * @param string $type * @return array|null */ function getExtendedCalculateFields($tabid, $type = 'number') { $fields = getCalculateFields($tabid, $type); if(is_array($fields)) { $fields[0] = array( 'fieldname' => 'record_id', 'fieldlabel' => vtranslate('LBL_RECORD_ID', 'ITS4YouCalculateFields'), 'uitype' => 7, ); } return $fields; } function getAddSupportedFieldTypes() { return array( 'Decimal', 'Integer', 'Percent', 'Currency', 'Date' ); }