本文整理汇总了PHP中Vtiger_Util_Helper::getOwnerName方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Util_Helper::getOwnerName方法的具体用法?PHP Vtiger_Util_Helper::getOwnerName怎么用?PHP Vtiger_Util_Helper::getOwnerName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Util_Helper
的用法示例。
在下文中一共展示了Vtiger_Util_Helper::getOwnerName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sanitizeValues
/**
* this function takes in an array of values for an user and sanitizes it for export
* @param array $arr - the array of values
*/
function sanitizeValues($arr)
{
$db = PearDatabase::getInstance();
$currentUser = Users_Record_Model::getCurrentUserModel();
$roleid = $currentUser->get('roleid');
if (empty($this->fieldArray)) {
$this->fieldArray = $this->moduleFieldInstances;
foreach ($this->fieldArray as $fieldName => $fieldObj) {
//In database we have same column name in two tables. - inventory modules only
if ($fieldObj->get('table') == 'vtiger_inventoryproductrel' && ($fieldName == 'discount_amount' || $fieldName == 'discount_percent')) {
$fieldName = 'item_' . $fieldName;
$this->fieldArray[$fieldName] = $fieldObj;
} else {
$columnName = $fieldObj->get('column');
$this->fieldArray[$columnName] = $fieldObj;
}
}
}
$moduleName = $this->moduleInstance->getName();
foreach ($arr as $fieldName => &$value) {
if (isset($this->fieldArray[$fieldName])) {
$fieldInfo = $this->fieldArray[$fieldName];
} else {
unset($arr[$fieldName]);
continue;
}
$value = trim(decode_html($value), "\"");
$uitype = $fieldInfo->get('uitype');
$fieldname = $fieldInfo->get('name');
if (!$this->fieldDataTypeCache[$fieldName]) {
$this->fieldDataTypeCache[$fieldName] = $fieldInfo->getFieldDataType();
}
$type = $this->fieldDataTypeCache[$fieldName];
if ($fieldname != 'hdnTaxType' && ($uitype == 15 || $uitype == 16 || $uitype == 33)) {
if (empty($this->picklistValues[$fieldname])) {
$this->picklistValues[$fieldname] = $this->fieldArray[$fieldname]->getPicklistValues();
}
// If the value being exported is accessible to current user
// or the picklist is multiselect type.
if ($uitype == 33 || $uitype == 16 || array_key_exists($value, $this->picklistValues[$fieldname])) {
// NOTE: multipicklist (uitype=33) values will be concatenated with |# delim
$value = trim($value);
} else {
$value = '';
}
} elseif ($uitype == 52 || $type == 'owner') {
$value = Vtiger_Util_Helper::getOwnerName($value);
} elseif ($type == 'reference') {
$value = trim($value);
if (!empty($value)) {
$parent_module = getSalesEntityType($value);
$displayValueArray = getEntityName($parent_module, $value);
if (!empty($displayValueArray)) {
foreach ($displayValueArray as $k => $v) {
$displayValue = $v;
}
}
if (!empty($parent_module) && !empty($displayValue)) {
$value = $parent_module . "::::" . $displayValue;
} else {
$value = "";
}
} else {
$value = '';
}
} elseif ($uitype == 72 || $uitype == 71) {
$value = CurrencyField::convertToUserFormat($value, null, true, true);
} elseif ($uitype == 7 && $fieldInfo->get('typeofdata') == 'N~O' || $uitype == 9) {
$value = decimalFormat($value);
} else {
if ($type == 'date' || $type == 'datetime') {
$value = DateTimeField::convertToUserFormat($value);
}
}
if ($moduleName == 'Documents' && $fieldname == 'description') {
$value = strip_tags($value);
$value = str_replace(' ', '', $value);
array_push($new_arr, $value);
}
}
return $arr;
}