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


PHP TimeDate::tzName方法代码示例

本文整理汇总了PHP中TimeDate::tzName方法的典型用法代码示例。如果您正苦于以下问题:PHP TimeDate::tzName方法的具体用法?PHP TimeDate::tzName怎么用?PHP TimeDate::tzName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TimeDate的用法示例。


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

示例1: empty

$sugar_smarty->assign("CHOOSE_WHICH", $mod_strings['LBL_CHOOSE_WHICH']);
if ($focus->receive_notifications) {
    $sugar_smarty->assign("RECEIVE_NOTIFICATIONS", "checked");
}
if ($focus->getPreference('mailmerge_on') == 'on') {
    $sugar_smarty->assign("MAILMERGE_ON", "checked");
}
$sugar_smarty->assign("SETTINGS_URL", $sugar_config['site_url']);
$sugar_smarty->assign("EXPORT_DELIMITER", $focus->getPreference('export_delimiter'));
$sugar_smarty->assign('EXPORT_CHARSET', $locale->getExportCharset('', $focus));
$sugar_smarty->assign('USE_REAL_NAMES', $focus->getPreference('use_real_names'));
global $timedate;
$sugar_smarty->assign("DATEFORMAT", $sugar_config['date_formats'][$timedate->get_date_format()]);
$sugar_smarty->assign("TIMEFORMAT", $sugar_config['time_formats'][$timedate->get_time_format()]);
$userTZ = $focus->getPreference('timezone');
$sugar_smarty->assign("TIMEZONE", TimeDate::tzName($userTZ));
$datef = $focus->getPreference('datef');
$timef = $focus->getPreference('timef');
if (!empty($datef)) {
    $sugar_smarty->assign("DATEFORMAT", $sugar_config['date_formats'][$datef]);
}
if (!empty($timef)) {
    $sugar_smarty->assign("TIMEFORMAT", $sugar_config['time_formats'][$timef]);
}
$num_grp_sep = $focus->getPreference('num_grp_sep');
$dec_sep = $focus->getPreference('dec_sep');
$sugar_smarty->assign("NUM_GRP_SEP", empty($num_grp_sep) ? $sugar_config['default_number_grouping_seperator'] : $num_grp_sep);
$sugar_smarty->assign("DEC_SEP", empty($dec_sep) ? $sugar_config['default_decimal_seperator'] : $dec_sep);
$currency = new Currency();
if ($focus->getPreference('currency')) {
    $currency->retrieve($focus->getPreference('currency'));
开发者ID:nartnik,项目名称:sugarcrm_test,代码行数:31,代码来源:DetailView.php

示例2: getUserDateTimePreferences

 /**
  * Loads users timedate preferences
  *
  * @return array 'date' - date format for user ; 'time' - time format for user
  */
 public function getUserDateTimePreferences()
 {
     global $sugar_config, $db, $timedate, $current_user;
     $user = $this->_userFocus;
     $prefDate = array();
     if (!empty($user) && $this->loadPreferences('global')) {
         // forced to set this to a variable to compare b/c empty() wasn't working
         $timeZone = TimeDate::userTimezone($user);
         $timeFormat = $user->getPreference("timef");
         $dateFormat = $user->getPreference("datef");
         // cn: bug xxxx cron.php fails because of missing preference when admin hasn't logged in yet
         $timeZone = empty($timeZone) ? 'America/Los_Angeles' : $timeZone;
         if (empty($timeFormat)) {
             $timeFormat = $sugar_config['default_time_format'];
         }
         if (empty($dateFormat)) {
             $dateFormat = $sugar_config['default_date_format'];
         }
         $prefDate['date'] = $dateFormat;
         $prefDate['time'] = $timeFormat;
         $prefDate['userGmt'] = TimeDate::tzName($timeZone);
         $prefDate['userGmtOffset'] = $timedate->getUserUTCOffset($user);
         return $prefDate;
     } else {
         $prefDate['date'] = $timedate->get_date_format();
         $prefDate['time'] = $timedate->get_time_format();
         if (!empty($user) && $user->object_name == 'User') {
             $timeZone = TimeDate::userTimezone($user);
             // cn: bug 9171 - if user has no time zone, cron.php fails for InboundEmail
             if (!empty($timeZone)) {
                 $prefDate['userGmt'] = TimeDate::tzName($timeZone);
                 $prefDate['userGmtOffset'] = $timedate->getUserUTCOffset($user);
             }
         } else {
             $timeZone = TimeDate::userTimezone($current_user);
             if (!empty($timeZone)) {
                 $prefDate['userGmt'] = TimeDate::tzName($timeZone);
                 $prefDate['userGmtOffset'] = $timedate->getUserUTCOffset($current_user);
             }
         }
         return $prefDate;
     }
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:48,代码来源:UserPreference.php

示例3: setupAdvancedTabLocaleSettings

 protected function setupAdvancedTabLocaleSettings()
 {
     global $locale, $sugar_config, $app_list_strings;
     ///////////////////////////////////////////////////////////////////////////////
     ////	LOCALE SETTINGS
     ////	Date/time format
     $dformat = $locale->getPrecedentPreference($this->bean->id ? 'datef' : 'default_date_format', $this->bean);
     $tformat = $locale->getPrecedentPreference($this->bean->id ? 'timef' : 'default_time_format', $this->bean);
     $nformat = $locale->getPrecedentPreference('default_locale_name_format', $this->bean);
     if (!array_key_exists($nformat, $sugar_config['name_formats'])) {
         $nformat = $sugar_config['default_locale_name_format'];
     }
     $timeOptions = get_select_options_with_id($sugar_config['time_formats'], $tformat);
     $dateOptions = get_select_options_with_id($sugar_config['date_formats'], $dformat);
     $nameOptions = get_select_options_with_id($locale->getUsableLocaleNameOptions($sugar_config['name_formats']), $nformat);
     $this->ss->assign('TIMEOPTIONS', $timeOptions);
     $this->ss->assign('DATEOPTIONS', $dateOptions);
     $this->ss->assign('NAMEOPTIONS', $nameOptions);
     $this->ss->assign('DATEFORMAT', $sugar_config['date_formats'][$dformat]);
     $this->ss->assign('TIMEFORMAT', $sugar_config['time_formats'][$tformat]);
     $this->ss->assign('NAMEFORMAT', $sugar_config['name_formats'][$nformat]);
     //// Timezone
     if (empty($this->bean->id)) {
         // remove default timezone for new users(set later)
         $this->bean->user_preferences['timezone'] = '';
     }
     $userTZ = $this->bean->getPreference('timezone');
     if (empty($userTZ) && !$this->bean->is_group && !$this->bean->portal_only) {
         $userTZ = TimeDate::guessTimezone();
         $this->bean->setPreference('timezone', $userTZ);
     }
     if (!$this->bean->getPreference('ut')) {
         $this->ss->assign('PROMPTTZ', ' checked');
     }
     $this->ss->assign('TIMEZONE_CURRENT', $userTZ);
     $this->ss->assign('TIMEZONEOPTIONS', TimeDate::getTimezoneList());
     $this->ss->assign("TIMEZONE", TimeDate::tzName($userTZ));
     // FG - Bug 4236 - Managed First Day of Week
     $fdowDays = array();
     foreach ($app_list_strings['dom_cal_day_long'] as $d) {
         if ($d != "") {
             $fdowDays[] = $d;
         }
     }
     $this->ss->assign("FDOWOPTIONS", $fdowDays);
     $currentFDOW = $this->bean->get_first_day_of_week();
     if (!isset($currentFDOW)) {
         $currentFDOW = 0;
     }
     $this->ss->assign("FDOWCURRENT", $currentFDOW);
     $this->ss->assign("FDOWDISPLAY", $fdowDays[$currentFDOW]);
     //// Numbers and Currency display
     require_once 'modules/Currencies/ListCurrency.php';
     $currency = new ListCurrency();
     // 10/13/2006 Collin - Changed to use Localization.getConfigPreference
     // This was the problem- Previously, the "-99" currency id always assumed
     // to be defaulted to US Dollars.  However, if someone set their install to use
     // Euro or other type of currency then this setting would not apply as the
     // default because it was being overridden by US Dollars.
     $cur_id = $locale->getPrecedentPreference('currency', $this->bean);
     if ($cur_id) {
         $selectCurrency = $currency->getSelectOptions($cur_id);
         $this->ss->assign("CURRENCY", $selectCurrency);
     } else {
         $selectCurrency = $currency->getSelectOptions();
         $this->ss->assign("CURRENCY", $selectCurrency);
     }
     // convert base currency values to user preferred
     $this->ss->assign("currency_show_preferred", $locale->getPrecedentPreference('currency_show_preferred', $this->bean));
     $currencyList = array();
     foreach ($locale->currencies as $id => $val) {
         $currencyList[$id] = $val['symbol'];
     }
     $currencySymbolJSON = json_encode($currencyList);
     $this->ss->assign('currencySymbolJSON', $currencySymbolJSON);
     $currencyDisplay = BeanFactory::getBean('Currencies');
     if (isset($cur_id)) {
         $currencyDisplay->retrieve($cur_id);
         $this->ss->assign('CURRENCY_DISPLAY', $currencyDisplay->iso4217 . ' ' . $currencyDisplay->symbol);
     } else {
         $this->ss->assign("CURRENCY_DISPLAY", $currencyDisplay->getDefaultISO4217() . ' ' . $currencyDisplay->getDefaultCurrencySymbol());
     }
     // fill significant digits dropdown
     $significantDigits = $locale->getPrecedentPreference('default_currency_significant_digits', $this->bean);
     $sigDigits = '';
     for ($i = 0; $i <= 6; $i++) {
         if ($significantDigits == $i) {
             $sigDigits .= "<option value=\"{$i}\" selected=\"true\">{$i}</option>";
         } else {
             $sigDigits .= "<option value=\"{$i}\">{$i}</option>";
         }
     }
     $this->ss->assign('sigDigits', $sigDigits);
     $this->ss->assign('CURRENCY_SIG_DIGITS', $significantDigits);
     $num_grp_sep = $this->bean->getPreference('num_grp_sep');
     $dec_sep = $this->bean->getPreference('dec_sep');
     $this->ss->assign("NUM_GRP_SEP", empty($num_grp_sep) ? $GLOBALS['sugar_config']['default_number_grouping_seperator'] : $num_grp_sep);
     $this->ss->assign("DEC_SEP", empty($dec_sep) ? $GLOBALS['sugar_config']['default_decimal_seperator'] : $dec_sep);
     $this->ss->assign('getNumberJs', $locale->getNumberJs());
     //// Name display format
//.........这里部分代码省略.........
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:101,代码来源:UserViewHelper.php


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