本文整理汇总了PHP中VTCacheUtils::lookupFieldInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP VTCacheUtils::lookupFieldInfo方法的具体用法?PHP VTCacheUtils::lookupFieldInfo怎么用?PHP VTCacheUtils::lookupFieldInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VTCacheUtils
的用法示例。
在下文中一共展示了VTCacheUtils::lookupFieldInfo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: vtlib_purify
$focus->id = '';
$focus->mode = '';
}
$focus->preEditCheck($_REQUEST, $smarty);
if (!empty($_REQUEST['save_error']) and $_REQUEST['save_error'] == "true") {
if (!empty($_REQUEST['encode_val'])) {
global $current_user;
$encode_val = vtlib_purify($_REQUEST['encode_val']);
$decode_val = base64_decode($encode_val);
$explode_decode_val = explode('&', trim($decode_val, '&'));
$tabid = getTabid($currentModule);
foreach ($explode_decode_val as $fieldvalue) {
$value = explode("=", $fieldvalue);
$field_name_val = $value[0];
$field_value = urldecode($value[1]);
$finfo = VTCacheUtils::lookupFieldInfo($tabid, $field_name_val);
if ($finfo !== false) {
if ($finfo['uitype'] == '56') {
$field_value = $field_value == 'on' ? '1' : '0';
}
if ($finfo['uitype'] == '71' or $finfo['uitype'] == '72') {
$currencyField = new CurrencyField($field_value);
$field_value = CurrencyField::convertToDBFormat($field_value, $current_user);
}
if ($finfo['uitype'] == '33' or $finfo['uitype'] == '3313') {
if (is_array($field_value)) {
$field_value = implode(' |##| ', $field_value);
}
}
}
$focus->column_fields[$field_name_val] = $field_value;
示例2: getFieldid
/**
* Function to get the fieldid
*
* @param Integer $tabid
* @param Boolean $onlyactive
*/
function getFieldid($tabid, $fieldname, $onlyactive = true)
{
global $adb;
// Look up information at cache first
$fieldinfo = VTCacheUtils::lookupFieldInfo($tabid, $fieldname);
if ($fieldinfo === false) {
$query = "SELECT fieldid, fieldlabel, columnname, tablename, uitype, typeofdata, presence \n\t\t\tFROM vtiger_field WHERE tabid=? AND fieldname=?";
$result = $adb->pquery($query, array($tabid, $fieldname));
if ($adb->num_rows($result)) {
$resultrow = $adb->fetch_array($result);
// Update information to cache for re-use
VTCacheUtils::updateFieldInfo($tabid, $fieldname, $resultrow['fieldid'], $resultrow['fieldlabel'], $resultrow['columnname'], $resultrow['tablename'], $resultrow['uitype'], $resultrow['typeofdata'], $resultrow['presence']);
$fieldinfo = VTCacheUtils::lookupFieldInfo($tabid, $fieldname);
}
}
// Get the field id based on required criteria
$fieldid = false;
if ($fieldinfo) {
$fieldid = $fieldinfo['fieldid'];
if ($onlyactive && !in_array($fieldinfo['presence'], array('0', '2'))) {
$fieldid = false;
}
}
return $fieldid;
}
示例3: getFieldid
/**
* Function to get the fieldid
*
* @param Integer $tabid
* @param Boolean $onlyactive
*/
function getFieldid($tabid, $fieldname, $onlyactive = true)
{
global $adb;
// Look up information at cache first
$fieldinfo = VTCacheUtils::lookupFieldInfo($tabid, $fieldname);
if ($fieldinfo === false) {
getColumnFields(getTabModuleName($tabid));
$fieldinfo = VTCacheUtils::lookupFieldInfo($tabid, $fieldname);
}
// Get the field id based on required criteria
$fieldid = false;
if ($fieldinfo) {
$fieldid = $fieldinfo['fieldid'];
if ($onlyactive && !in_array($fieldinfo['presence'], array('0', '2'))) {
$fieldid = false;
}
}
return $fieldid;
}
示例4: getFieldRelatedInfo
function getFieldRelatedInfo($tabId, $fieldName)
{
$fieldInfo = VTCacheUtils::lookupFieldInfo($tabId, $fieldName);
if ($fieldInfo === false) {
getColumnFields(getTabModuleName($tabid));
$fieldInfo = VTCacheUtils::lookupFieldInfo($tabId, $fieldName);
}
return $fieldInfo;
}