当前位置: 首页>>代码示例>>PHP>>正文


PHP getCurrencyName函数代码示例

本文整理汇总了PHP中getCurrencyName函数的典型用法代码示例。如果您正苦于以下问题:PHP getCurrencyName函数的具体用法?PHP getCurrencyName怎么用?PHP getCurrencyName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getCurrencyName函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getValue


//.........这里部分代码省略.........
                        $pick_query = "select distinct {$fieldname} from vtiger_{$fieldname} inner join vtiger_role2picklist on vtiger_role2picklist.picklistvalueid = vtiger_{$fieldname}.picklist_valueid where roleid in (" . generateQuestionMarks($roleids) . ") and picklistid in (select picklistid from vtiger_{$fieldname}) order by {$fieldname} asc";
                        $params = array($roleids);
                    } else {
                        $pick_query = "select distinct {$fieldname} from vtiger_{$fieldname} inner join vtiger_role2picklist on vtiger_role2picklist.picklistvalueid = vtiger_{$fieldname}.picklist_valueid where picklistid in (select picklistid from vtiger_{$fieldname}) order by {$fieldname} asc";
                        $params = array();
                    }
                    $pickListResult = $adb->pquery($pick_query, $params);
                    $picklistval = array();
                    for ($i = 0; $i < $adb->num_rows($pickListResult); $i++) {
                        $picklistarr[] = $adb->query_result($pickListResult, $i, $fieldname);
                    }
                    $value_temp = array();
                    $string_temp = '';
                    $str_c = 0;
                    foreach ($value_arr as $ind => $val) {
                        $notaccess = '<font color="red">' . $app_strings['LBL_NOT_ACCESSIBLE'] . "</font>";
                        if (!$listview_max_textlength || !(strlen(preg_replace("/(<\\/?)(\\w+)([^>]*>)/i", "", $string_temp)) > $listview_max_textlength)) {
                            $value_temp1 = in_array(trim($val), $picklistarr) ? $val : $notaccess;
                            if ($str_c != 0) {
                                $string_temp .= ' , ';
                            }
                            $string_temp .= $value_temp1;
                            $str_c++;
                        } else {
                            $string_temp .= '...';
                        }
                    }
                    $value = $string_temp;
                }
            }
        } elseif ($uitype == 85) {
            $value = $temp_val != "" ? "<a href='skype:{$temp_val}?call'>{$temp_val}</a>" : "";
        } elseif ($uitype == 116) {
            $value = $temp_val != "" ? getCurrencyName($temp_val) : "";
        } elseif ($uitype == 117) {
            // NOTE: Without symbol the value could be used for filtering/lookup hence avoiding the translation
            $value = $temp_val != "" ? getCurrencyName($temp_val, false) : "";
        } elseif ($uitype == 26) {
            $sql = "select foldername from vtiger_attachmentsfolder where folderid = ?";
            $res = $adb->pquery($sql, array($temp_val));
            $foldername = $adb->query_result($res, 0, 'foldername');
            $value = $foldername;
        } elseif ($uitype == 11) {
            // Fix added for Trac Id: 6139
            if (vtlib_isModuleActive('PBXManager')) {
                $value = "<a href='javascript:;' onclick='startCall(&quot;{$temp_val}&quot;, &quot;{$entity_id}&quot;)'>" . $temp_val . "</a>";
            } else {
                $value = $temp_val;
            }
        } elseif ($uitype == 25) {
            $contactid = $_REQUEST['record'];
            $emailid = $adb->query_result($list_result, $list_result_count, "activityid");
            $result = $adb->pquery("SELECT access_count FROM vtiger_email_track WHERE crmid=? AND mailid=?", array($contactid, $emailid));
            $value = $adb->query_result($result, 0, "access_count");
            if (!$value) {
                $value = 0;
            }
        } elseif ($uitype == 8) {
            if (!empty($temp_val)) {
                $temp_val = html_entity_decode($temp_val, ENT_QUOTES, $default_charset);
                $json = new Zend_Json();
                $value = vt_suppressHTMLTags(implode(',', $json->decode($temp_val)));
            }
        } else {
            if ($fieldname == $focus->list_link_field) {
                if ($mode == "search") {
开发者ID:latechdirect,项目名称:vtiger,代码行数:67,代码来源:ListViewUtils.php

示例2: getCurrencySymbolandCRate

/** This function returns the conversion rate and vtiger_currency symbol
 * in array format for a given id.
 * param $id - vtiger_currency id.
 */
function getCurrencySymbolandCRate($id)
{
    global $log;
    $log->debug("Entering getCurrencySymbolandCRate(" . $id . ") method ...");
    // To initialize the currency information in cache
    getCurrencyName($id);
    $currencyinfo = VTCacheUtils::lookupCurrencyInfo($id);
    $rate_symbol['rate'] = $currencyinfo['rate'];
    $rate_symbol['symbol'] = $currencyinfo['symbol'];
    $log->debug("Exiting getCurrencySymbolandCRate method ...");
    return $rate_symbol;
}
开发者ID:hbsman,项目名称:vtigercrm-5.3.0-ja,代码行数:16,代码来源:CommonUtils.php

示例3: GenerateReport


//.........这里部分代码省略.........
                        $snewvalue = "-";
                    }
                    if ($tnewvalue == "") {
                        $tnewvalue = "-";
                    }
                    $valtemplate .= "<tr>";
                    // Performance Optimization
                    if ($directOutput) {
                        echo $valtemplate;
                        $valtemplate = '';
                    }
                    // END
                    for ($i = 0; $i < $y; $i++) {
                        $fld = $adb->field_name($result, $i);
                        $fld_type = $column_definitions[$i]->type;
                        if (in_array($fld->name, $this->convert_currency)) {
                            if ($custom_field_values[$i] != '') {
                                $fieldvalue = convertFromMasterCurrency($custom_field_values[$i], $current_user->conv_rate);
                            } else {
                                $fieldvalue = getTranslatedString($custom_field_values[$i]);
                            }
                        } elseif (in_array($fld->name, $this->append_currency_symbol_to_value)) {
                            $curid_value = explode("::", $custom_field_values[$i]);
                            $currency_id = $curid_value[0];
                            $currency_value = $curid_value[1];
                            $cur_sym_rate = getCurrencySymbolandCRate($currency_id);
                            if ($custom_field_values[$i] != '') {
                                $fieldvalue = $cur_sym_rate['symbol'] . " " . $currency_value;
                            } else {
                                $fieldvalue = getTranslatedString($custom_field_values[$i]);
                            }
                        } elseif ($fld->name == "PurchaseOrder_Currency" || $fld->name == "SalesOrder_Currency" || $fld->name == "Invoice_Currency" || $fld->name == "Quotes_Currency") {
                            if ($custom_field_values[$i] != '') {
                                $fieldvalue = getCurrencyName($custom_field_values[$i]);
                            } else {
                                $fieldvalue = getTranslatedString($custom_field_values[$i]);
                            }
                        } elseif (in_array($fld->name, $this->ui10_fields) && !empty($custom_field_values[$i])) {
                            $type = getSalesEntityType($custom_field_values[$i]);
                            $tmp = getEntityName($type, $custom_field_values[$i]);
                            foreach ($tmp as $key => $val) {
                                $fieldvalue = $val;
                                break;
                            }
                        } else {
                            if ($custom_field_values[$i] != '') {
                                $fieldvalue = getTranslatedString($custom_field_values[$i]);
                            } else {
                                $fieldvalue = getTranslatedString($custom_field_values[$i]);
                            }
                        }
                        $fieldvalue = str_replace("<", "&lt;", $fieldvalue);
                        $fieldvalue = str_replace(">", "&gt;", $fieldvalue);
                        //check for Roll based pick list
                        $temp_val = $fld->name;
                        if (is_array($picklistarray)) {
                            if (array_key_exists($temp_val, $picklistarray)) {
                                if (!in_array($custom_field_values[$i], $picklistarray[$fld->name]) && $custom_field_values[$i] != '') {
                                    $fieldvalue = $app_strings['LBL_NOT_ACCESSIBLE'];
                                }
                            }
                        }
                        if (is_array($picklistarray[1])) {
                            if (array_key_exists($temp_val, $picklistarray[1])) {
                                $temp = explode(",", str_ireplace(' |##| ', ',', $fieldvalue));
                                $temp_val = array();
开发者ID:vtiger-jp,项目名称:vtigercrm-5.1.x-ja,代码行数:67,代码来源:ReportRun.php

示例4: getFieldDisplayValue


//.........这里部分代码省略.........
             }
             if ($fieldInstance->getFieldDataType() == 'datetime') {
                 $value = $date->getDisplayDateTimeValue();
             }
             if ($fieldInstance->getFieldDataType() == 'time') {
                 $value = $date->getDisplayTime();
             }
         } else {
             $value = '';
         }
     }
     if ($fieldInstance->getFieldDataType() == 'currency') {
         if ($value != '' && $value != 0) {
             if ($fieldInstance->getUIType() == 72) {
                 if ($fieldName == 'unit_price') {
                     $currencyId = getProductBaseCurrency($recordId, $moduleName);
                     $cursym_convrate = getCurrencySymbolandCRate($currencyId);
                     $currencySymbol = $cursym_convrate['symbol'];
                 } else {
                     $currencyInfo = getInventoryCurrencyInfo($moduleName, $recordId);
                     $currencySymbol = $currencyInfo['currency_symbol'];
                 }
                 $currencyValue = CurrencyField::convertToUserFormat($value, null, true);
                 $value = CurrencyField::appendCurrencySymbol($currencyValue, $currencySymbol);
             } else {
                 $currencyField = new CurrencyField($value);
                 $value = $currencyField->getDisplayValueWithSymbol();
             }
         }
     }
     if ($fieldInstance->getFieldDataType() == 'url') {
         $matchPattern = "^[\\w]+:\\/\\/^";
         preg_match($matchPattern, $value, $matches);
         if (!empty($matches[0])) {
             $value = '<a href="' . $value . '" target="_blank">' . $value . '</a>';
         } else {
             $value = '<a href="http://' . $value . '" target="_blank">' . $value . '</a>';
         }
     }
     if ($fieldInstance->getFieldDataType() == 'boolean') {
         if ($value == 1) {
             $value = getTranslatedString('yes', $moduleName);
         } elseif ($value == 0) {
             $value = getTranslatedString('no', $moduleName);
         } else {
             $value = '--';
         }
     }
     if ($fieldInstance->getFieldDataType() == 'multipicklist') {
         $value = $value != "" ? str_replace(' |##| ', ', ', $value) : "";
         $isRoleBased = vtws_isRoleBasedPicklist($fieldName);
         if (!is_admin($current_user) && $value != '' && $isRoleBased) {
             $accessiblePicklistValues = getAssignedPicklistValues($fieldName, $current_user->roleid, $adb);
             $valueArray = $value != "" ? explode(', ', $value) : array();
             $notaccess = '<font color="red">' . getTranslatedString('LBL_NOT_ACCESSIBLE', $moduleName) . "</font>";
             $tmpArray = array();
             foreach ($valueArray as $index => $val) {
                 if (!in_array(trim($val), $accessiblePicklistValues)) {
                     $tmpArray[] = $notaccess;
                 } else {
                     $tmpArray[] = $val;
                 }
             }
             $value = implode(', ', $tmpArray);
         }
     }
     if ($fieldInstance->getFieldDataType() == 'reference') {
         if (!empty($value)) {
             $referenceList = $fieldInstance->getReferenceList();
             if (count($referenceList) > 0) {
                 $firstReferenceModule = $referenceList[0];
                 if ($firstReferenceModule == 'Users') {
                     $value = getUserFullName($value);
                 } elseif ($firstReferenceModule == 'DocumentFolders') {
                     $wsFolderId = vtws_getWebserviceEntityId('DocumentFolders', $value);
                     $value = vtws_getName($wsFolderId, $current_user);
                 } elseif ($firstReferenceModule == 'Currency') {
                     $value = getCurrencyName($value);
                 } else {
                     $referenceModule = getSalesEntityType($value);
                     $entityNames = getEntityName($referenceModule, array($value));
                     $value = $entityNames[$value];
                 }
             } else {
                 $value = '--';
             }
         } else {
             $value = '--';
         }
     }
     if ($fieldInstance->getFieldDataType() == 'owner') {
         $ownerName = trim(getUserFullName($value));
         if (empty($ownerName)) {
             $ownerInfo = getGroupName($value);
             $ownerName = $ownerInfo[0];
         }
         $value = $ownerName;
     }
     return $value;
 }
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:101,代码来源:ModTracker_Field.php

示例5: getDetailViewOutputHtml

/** This function returns the detail view form vtiger_field and and its properties in array format.
 * Param $uitype - UI type of the vtiger_field
 * Param $fieldname - Form vtiger_field name
 * Param $fieldlabel - Form vtiger_field label name
 * Param $col_fields - array contains the vtiger_fieldname and values
 * Param $generatedtype - Field generated type (default is 1)
 * Param $tabid - vtiger_tab id to which the Field belongs to (default is "")
 * Return type is an array
 */
function getDetailViewOutputHtml($uitype, $fieldname, $fieldlabel, $col_fields, $generatedtype, $tabid = '', $module = '')
{
    global $log;
    $log->debug("Entering getDetailViewOutputHtml(" . $uitype . "," . $fieldname . "," . $fieldlabel . "," . $col_fields . "," . $generatedtype . "," . $tabid . ") method ...");
    global $adb;
    global $mod_strings;
    global $app_strings;
    global $current_user;
    global $theme;
    $theme_path = "themes/" . $theme . "/";
    $image_path = $theme_path . "images/";
    $fieldlabel = from_html($fieldlabel);
    $custfld = '';
    $value = '';
    $arr_data = array();
    $label_fld = array();
    $data_fld = array();
    require 'user_privileges/user_privileges_' . $current_user->id . '.php';
    require 'user_privileges/sharing_privileges_' . $current_user->id . '.php';
    // vtlib customization: New uitype to handle relation between modules
    if ($uitype == '10') {
        $fieldlabel = getTranslatedString($fieldlabel, $module);
        $parent_id = $col_fields[$fieldname];
        if (!empty($parent_id)) {
            $parent_module = getSalesEntityType($parent_id);
            $valueTitle = getTranslatedString($parent_module, $parent_module);
            $displayValueArray = getEntityName($parent_module, $parent_id);
            if (!empty($displayValueArray)) {
                foreach ($displayValueArray as $key => $value) {
                    $displayValue = $value;
                }
            }
            // vtlib customization: For listview javascript triggers
            $modMetaInfo = getEntityFieldNames($parent_module);
            $modEName = is_array($modMetaInfo['fieldname']) ? $modMetaInfo['fieldname'][0] : $modMetaInfo['fieldname'];
            $vtlib_metainfo = "<span type='vtlib_metainfo' vtrecordid='{$parent_id}' vtfieldname=" . "'{$modEName}' vtmodule='{$parent_module}' style='display:none;'></span>";
            // END
            $label_fld = array($fieldlabel, "<a href='index.php?module={$parent_module}&action=DetailView&record={$parent_id}' title='{$valueTitle}'>{$displayValue}</a>{$vtlib_metainfo}");
        } else {
            $moduleSpecificMessage = 'MODULE_NOT_SELECTED';
            if ($mod_strings[$moduleSpecificMessage] != "") {
                $moduleSpecificMessage = $mod_strings[$moduleSpecificMessage];
            }
            $label_fld = array($fieldlabel, '');
        }
    } else {
        if ($uitype == 99) {
            $label_fld[] = getTranslatedString($fieldlabel, $module);
            $label_fld[] = $col_fields[$fieldname];
            if ($fieldname == 'confirm_password') {
                return null;
            }
        } elseif ($uitype == 116 || $uitype == 117) {
            $label_fld[] = getTranslatedString($fieldlabel, $module);
            $label_fld[] = getCurrencyName($col_fields[$fieldname]);
            $pick_query = "select * from vtiger_currency_info where currency_status = 'Active' and deleted=0";
            $pickListResult = $adb->pquery($pick_query, array());
            $noofpickrows = $adb->num_rows($pickListResult);
            //Mikecrowe fix to correctly default for custom pick lists
            $options = array();
            $found = false;
            for ($j = 0; $j < $noofpickrows; $j++) {
                $pickListValue = $adb->query_result($pickListResult, $j, 'currency_name');
                $currency_id = $adb->query_result($pickListResult, $j, 'id');
                if ($col_fields[$fieldname] == $currency_id) {
                    $chk_val = "selected";
                    $found = true;
                } else {
                    $chk_val = '';
                }
                $options[$currency_id] = array($pickListValue => $chk_val);
            }
            $label_fld["options"] = $options;
        } elseif ($uitype == 13 || $uitype == 104) {
            $label_fld[] = getTranslatedString($fieldlabel, $module);
            $label_fld[] = $col_fields[$fieldname];
        } elseif ($uitype == 16) {
            $label_fld[] = getTranslatedString($fieldlabel, $module);
            $label_fld[] = getTranslatedString($col_fields[$fieldname], $module);
            $fieldname = $adb->sql_escape_string($fieldname);
            $pick_query = "select {$fieldname} from vtiger_{$fieldname} order by sortorderid";
            $params = array();
            $pickListResult = $adb->pquery($pick_query, $params);
            $noofpickrows = $adb->num_rows($pickListResult);
            $options = array();
            $count = 0;
            $found = false;
            for ($j = 0; $j < $noofpickrows; $j++) {
                $pickListValue = decode_html($adb->query_result($pickListResult, $j, strtolower($fieldname)));
                $col_fields[$fieldname] = decode_html($col_fields[$fieldname]);
                if ($col_fields[$fieldname] == $pickListValue) {
//.........这里部分代码省略.........
开发者ID:jaimeaga84,项目名称:corebos,代码行数:101,代码来源:DetailViewUtils.php


注:本文中的getCurrencyName函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。