本文整理汇总了PHP中Vtiger_Date_UIType::getDisplayValue方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Date_UIType::getDisplayValue方法的具体用法?PHP Vtiger_Date_UIType::getDisplayValue怎么用?PHP Vtiger_Date_UIType::getDisplayValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Date_UIType
的用法示例。
在下文中一共展示了Vtiger_Date_UIType::getDisplayValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
public function process(Vtiger_Request $request)
{
$log = vglobal('log');
$log->debug('Start ' . __CLASS__ . ':' . __FUNCTION__);
$db = PearDatabase::getInstance();
$qualifiedModule = $request->getModule(false);
$moduleModel = Settings_CurrencyUpdate_Module_Model::getCleanInstance();
$currentUser = Users_Record_Model::getCurrentUserModel();
// synchronise bank list
$moduleModel->refreshBanks();
$downloadBtn = !$request->isEmpty('download') ? $request->get('download') : false;
$date = !$request->isEmpty('duedate') ? Vtiger_Datetime_UIType::getDBInsertedValue($request->get('duedate')) : false;
$dateCur = '';
if ($date) {
// if its future date change it to present one
if (strtotime($date) > strtotime(date('Y-m-d'))) {
$date = date('Y-m-d');
}
$dateCur = $date;
} else {
$dateCur = date('Y-m-d');
}
// take currency rates for yesterday
if (strcmp(date('Y-m-d'), $dateCur) == 0) {
$dateCur = strtotime("-1 day", strtotime($dateCur));
$dateCur = date('Y-m-d', $dateCur);
}
$dateCur = Vtiger_Functions::getLastWorkingDay($dateCur);
// get currency if not already archived
if ($downloadBtn) {
$moduleModel->fetchCurrencyRates($dateCur);
}
$selectBankId = $moduleModel->getActiveBankId();
$history = $moduleModel->getRatesHistory($selectBankId, $dateCur, $request);
$bankTab = array();
$bankSQL = "SELECT * FROM yetiforce_currencyupdate_banks";
$bankResult = $db->query($bankSQL, true);
$i = 0;
while ($row = $db->fetchByAssoc($bankResult)) {
$bankTab[$i]['id'] = $row['id'];
$bankName = $row['bank_name'];
$bankTab[$i]['bank_name'] = $bankName;
$bankTab[$i]['active'] = $row['active'];
$i++;
}
// number of currencies
$curr_num = $moduleModel->getCurrencyNum();
// get info about main currency
$mainCurrencyInfo = Vtiger_Functions::getDefaultCurrencyInfo();
$viewer = $this->getViewer($request);
$viewer->assign('QUALIFIED_MODULE', $qualifiedModule);
$viewer->assign('USER_MODEL', $currentUser);
$viewer->assign('MODULE_MODEL', $moduleModel);
$viewer->assign('MODULENAME', 'CurrencyUpdate');
$viewer->assign('DATE', $request->has('duedate') ? Vtiger_Date_UIType::getDisplayValue($dateCur) : '');
$viewer->assign('CURRNUM', $curr_num);
$viewer->assign('BANK', $bankTab);
$viewer->assign('HISTORIA', $history);
$viewer->assign('MAINCURR', $mainCurrencyInfo);
$viewer->assign('SUPPORTED_CURRENCIES', $moduleModel->getSupportedCurrencies());
$viewer->assign('UNSUPPORTED_CURRENCIES', $moduleModel->getUnSupportedCurrencies());
$viewer->view('Index.tpl', $qualifiedModule);
$log->debug('End ' . __CLASS__ . ':' . __FUNCTION__);
}