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


PHP Currency::getDefaultCurrencySymbol方法代码示例

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


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

示例1: populateCurrency

 function populateCurrency()
 {
     global $mod_strings;
     require_once 'modules/Currencies/Currency.php';
     $currency = new Currency();
     $currText = '';
     if (isset($this->bean->currency_id) && !empty($this->bean->currency_id)) {
         $currency->retrieve($this->bean->currency_id);
         if ($currency->deleted != 1) {
             $currText = $currency->iso4217 . ' ' . $currency->symbol;
         } else {
             $currText = $currency->getDefaultISO4217() . ' ' . $currency->getDefaultCurrencySymbol();
         }
     } else {
         $currText = $currency->getDefaultISO4217() . ' ' . $currency->getDefaultCurrencySymbol();
     }
     $javascript = "<script language='javascript'>\n";
     $javascript .= "var CurrencyText = new Array(); \n";
     $javascript .= "CurrencyText['-99'] = '" . $currency->getDefaultISO4217() . ' ' . $currency->getDefaultCurrencySymbol() . "';\n";
     $sql = "SELECT id, iso4217, symbol FROM currencies";
     $res = $this->bean->db->query($sql);
     while ($row = $this->bean->db->fetchByAssoc($res)) {
         $javascript .= "CurrencyText['" . $row['id'] . "'] = '" . $row['iso4217'] . ' ' . $row['symbol'] . "';\n";
     }
     $javascript .= "</script>";
     echo $javascript;
     $this->ss->assign('CURRENCY', "<div id =curr_symbol>{$currText}</div>");
     $mod_strings['LBL_LIST_PRICE'] .= " (" . $currText . ")";
     $mod_strings['LBL_UNIT_PRICE'] .= " (" . $currText . ")";
     $mod_strings['LBL_VAT_AMT'] .= " (" . $currText . ")";
     $mod_strings['LBL_TOTAL_PRICE'] .= " (" . $currText . ")";
     $mod_strings['LBL_SERVICE_PRICE'] .= " (" . $currText . ")";
 }
开发者ID:santara12,项目名称:advanced-opensales,代码行数:33,代码来源:view.edit.php

示例2: display

 function display()
 {
     $currency = new Currency();
     if (isset($this->bean->currency_id) && !empty($this->bean->currency_id)) {
         $currency->retrieve($this->bean->currency_id);
         if ($currency->deleted != 1) {
             $this->ss->assign('CURRENCY', $currency->iso4217 . ' ' . $currency->symbol);
         } else {
             $this->ss->assign('CURRENCY', $currency->getDefaultISO4217() . ' ' . $currency->getDefaultCurrencySymbol());
         }
     } else {
         $this->ss->assign('CURRENCY', $currency->getDefaultISO4217() . ' ' . $currency->getDefaultCurrencySymbol());
     }
     parent::display();
 }
开发者ID:butschster,项目名称:sugarcrm_dev,代码行数:15,代码来源:view.detail.php

示例3: populateCurrency

 function populateCurrency()
 {
     require_once 'modules/Currencies/Currency.php';
     $currency = new Currency();
     if (isset($this->bean->currency_id) && !empty($this->bean->currency_id)) {
         $currency->retrieve($focus->currency_id);
         if ($currency->deleted != 1) {
             $this->currSymbol = $currency->symbol;
         } else {
             $this->currSymbol = $currency->getDefaultCurrencySymbol();
         }
     } else {
         $this->currSymbol = $currency->getDefaultCurrencySymbol();
     }
 }
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:15,代码来源:view.detail.php

示例4: display

 function display()
 {
     global $app_list_strings;
     $this->ss->assign('APP_LIST', $app_list_strings);
     if (isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'set_target') {
         require_once 'modules/Campaigns/utils.php';
         //call function to create campaign logs
         $mess = track_campaign_prospects($this->bean);
         $confirm_msg = "var ajax_C_LOG_Status = new SUGAR.ajaxStatusClass(); \n            window.setTimeout(\"ajax_C_LOG_Status.showStatus('" . $mess . "')\",1000); \n            window.setTimeout('ajax_C_LOG_Status.hideStatus()', 1500); \n            window.setTimeout(\"ajax_C_LOG_Status.showStatus('" . $mess . "')\",2000); \n            window.setTimeout('ajax_C_LOG_Status.hideStatus()', 5000); ";
         $this->ss->assign("MSG_SCRIPT", $confirm_msg);
     }
     if ($this->bean->campaign_type == 'Email' || $this->bean->campaign_type == 'NewsLetter') {
         $this->ss->assign("ADD_BUTTON_STATE", "submit");
         $this->ss->assign("TARGET_BUTTON_STATE", "hidden");
     } else {
         $this->ss->assign("ADD_BUTTON_STATE", "hidden");
         $this->ss->assign("DISABLE_LINK", "display:none");
         $this->ss->assign("TARGET_BUTTON_STATE", "submit");
     }
     $currency = new Currency();
     if (isset($this->bean->currency_id) && !empty($this->bean->currency_id)) {
         $currency->retrieve($this->bean->currency_id);
         if ($currency->deleted != 1) {
             $this->ss->assign('CURRENCY', $currency->iso4217 . ' ' . $currency->symbol);
         } else {
             $this->ss->assign('CURRENCY', $currency->getDefaultISO4217() . ' ' . $currency->getDefaultCurrencySymbol());
         }
     } else {
         $this->ss->assign('CURRENCY', $currency->getDefaultISO4217() . ' ' . $currency->getDefaultCurrencySymbol());
     }
     parent::display();
     //We want to display subset of available, panels, so we will call subpanel
     //object directly instead of using sugarview.
     $GLOBALS['focus'] = $this->bean;
     require_once 'include/SubPanel/SubPanelTiles.php';
     $subpanel = new SubPanelTiles($this->bean, $this->module);
     //get available list of subpanels
     $alltabs = $subpanel->subpanel_definitions->get_available_tabs();
     if (!empty($alltabs)) {
         //iterate through list, and filter out all but 3 subpanels
         foreach ($alltabs as $key => $name) {
             if ($name != 'prospectlists' && $name != 'emailmarketing' && $name != 'tracked_urls') {
                 //exclude subpanels that are not prospectlists, emailmarketing, or tracked urls
                 $subpanel->subpanel_definitions->exclude_tab($name);
             }
         }
         //only show email marketing subpanel for email/newsletter campaigns
         if ($this->bean->campaign_type != 'Email' && $this->bean->campaign_type != 'NewsLetter') {
             //exclude emailmarketing subpanel if not on an email or newsletter campaign
             $subpanel->subpanel_definitions->exclude_tab('emailmarketing');
             // Bug #49893  - 20120120 - Captivea (ybi) - Remove trackers subpanels if not on an email/newsletter campaign (useless subpannl)
             $subpanel->subpanel_definitions->exclude_tab('tracked_urls');
         }
     }
     //show filtered subpanel list
     echo $subpanel->display();
 }
开发者ID:butschster,项目名称:sugarcrm_dev,代码行数:57,代码来源:view.detail.php

示例5: tearDown

 public function tearDown()
 {
     global $sugar_config;
     $this->currency_system->symbol = $this->backupSymbol;
     $this->currency_system->save(false);
     $sugar_config['default_currency_symbol'] = $this->backupSymbol;
     format_number(0, 0, 0, array('currency_id' => $this->currency_51568->id, 'currency_symbol' => $this->currency_51568->symbol));
     format_number(0, 0, 0, array('currency_id' => -99, 'currency_symbol' => $this->currency_51568->getDefaultCurrencySymbol()));
     $this->currency_51568->mark_deleted($this->currency_51568->id);
     SugarTestHelper::tearDown();
     get_number_seperators(true);
 }
开发者ID:thsonvt,项目名称:sugarcrm_dev,代码行数:12,代码来源:Bug51568Test.php

示例6: populateCurrency

 function populateCurrency()
 {
     global $mod_strings;
     require_once 'modules/Currencies/Currency.php';
     $currency = new Currency();
     $currText = '';
     if (isset($this->bean->currency_id) && !empty($this->bean->currency_id)) {
         $currency->retrieve($focus->currency_id);
         if ($currency->deleted != 1) {
             $currText = $currency->iso4217 . ' ' . $currency->symbol;
         } else {
             $currText = $currency->getDefaultISO4217() . ' ' . $currency->getDefaultCurrencySymbol();
         }
     } else {
         $currText = $currency->getDefaultISO4217() . ' ' . $currency->getDefaultCurrencySymbol();
     }
     $this->ss->assign('CURRENCY', $currText);
     $mod_strings['LBL_LIST_PRICE'] .= " (" . $currText . ")";
     $mod_strings['LBL_UNIT_PRICE'] .= " (" . $currText . ")";
     $mod_strings['LBL_VAT_AMT'] .= " (" . $currText . ")";
     $mod_strings['LBL_TOTAL_PRICE'] .= " (" . $currText . ")";
 }
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:22,代码来源:view.edit.php

示例7: view_settings

 /**
  * Sets up the Payment settings view
  * @param   \Cx\Core\Html\Sigma $objTemplate    The optional Template,
  *                                              by reference
  * @return  boolean                             True on success,
  *                                              false otherwise
  */
 static function view_settings(&$objTemplate = null)
 {
     if (!$objTemplate) {
         $objTemplate = new \Cx\Core\Html\Sigma();
         $objTemplate->loadTemplateFile('module_shop_settings_payment.html');
     } else {
         $objTemplate->addBlockfile('SHOP_SETTINGS_FILE', 'settings_block', 'module_shop_settings_payment.html');
     }
     $i = 0;
     foreach (Payment::getArray() as $payment_id => $arrPayment) {
         $zone_id = Zones::getZoneIdByPaymentId($payment_id);
         $objTemplate->setVariable(array('SHOP_PAYMENT_STYLE' => 'row' . (++$i % 2 + 1), 'SHOP_PAYMENT_ID' => $arrPayment['id'], 'SHOP_PAYMENT_NAME' => $arrPayment['name'], 'SHOP_PAYMENT_HANDLER_MENUOPTIONS' => PaymentProcessing::getMenuoptions($arrPayment['processor_id']), 'SHOP_PAYMENT_COST' => $arrPayment['fee'], 'SHOP_PAYMENT_COST_FREE_SUM' => $arrPayment['free_from'], 'SHOP_ZONE_SELECTION' => Zones::getMenu($zone_id, "zone_id[{$payment_id}]"), 'SHOP_PAYMENT_STATUS' => intval($arrPayment['active']) ? \Html::ATTRIBUTE_CHECKED : ''));
         $objTemplate->parse('shopPayment');
     }
     $objTemplate->setVariable(array('SHOP_PAYMENT_HANDLER_MENUOPTIONS_NEW' => PaymentProcessing::getMenuoptions(-1), 'SHOP_ZONE_SELECTION_NEW' => Zones::getMenu(0, 'zone_id_new')));
     // Payment Service Providers
     $objTemplate->setVariable(array('SHOP_PAYMILL_STATUS' => \Cx\Core\Setting\Controller\Setting::getValue('paymill_active', 'Shop') ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_PAYMILL_TEST_SELECTED' => \Cx\Core\Setting\Controller\Setting::getValue('paymill_use_test_account', 'Shop') == 0 ? \Html::ATTRIBUTE_SELECTED : '', 'SHOP_PAYMILL_LIVE_SELECTED' => \Cx\Core\Setting\Controller\Setting::getValue('paymill_use_test_account', 'Shop') == 1 ? \Html::ATTRIBUTE_SELECTED : '', 'SHOP_PAYMILL_TEST_PRIVATE_KEY' => contrexx_raw2xhtml(\Cx\Core\Setting\Controller\Setting::getValue('paymill_test_private_key', 'Shop')), 'SHOP_PAYMILL_TEST_PUBLIC_KEY' => contrexx_raw2xhtml(\Cx\Core\Setting\Controller\Setting::getValue('paymill_test_public_key', 'Shop')), 'SHOP_PAYMILL_LIVE_PRIVATE_KEY' => contrexx_raw2xhtml(\Cx\Core\Setting\Controller\Setting::getValue('paymill_live_private_key', 'Shop')), 'SHOP_PAYMILL_LIVE_PUBLIC_KEY' => contrexx_raw2xhtml(\Cx\Core\Setting\Controller\Setting::getValue('paymill_live_public_key', 'Shop')), 'SHOP_PAYMILL_PRIVATE_KEY' => contrexx_raw2xhtml(\Cx\Core\Setting\Controller\Setting::getValue('paymill_private_key', 'Shop')), 'SHOP_PAYMILL_PUBLIC_KEY' => contrexx_raw2xhtml(\Cx\Core\Setting\Controller\Setting::getValue('paymill_public_key', 'Shop')), 'SHOP_SAFERPAY_ID' => \Cx\Core\Setting\Controller\Setting::getValue('saferpay_id', 'Shop'), 'SHOP_SAFERPAY_STATUS' => \Cx\Core\Setting\Controller\Setting::getValue('saferpay_active', 'Shop') ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_SAFERPAY_TEST_ID' => \Cx\Core\Setting\Controller\Setting::getValue('saferpay_use_test_account', 'Shop'), 'SHOP_SAFERPAY_TEST_STATUS' => \Cx\Core\Setting\Controller\Setting::getValue('saferpay_use_test_account', 'Shop') ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_SAFERPAY_FINALIZE_PAYMENT' => \Cx\Core\Setting\Controller\Setting::getValue('saferpay_finalize_payment', 'Shop') ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_SAFERPAY_WINDOW_MENUOPTIONS' => \Saferpay::getWindowMenuoptions(\Cx\Core\Setting\Controller\Setting::getValue('saferpay_window_option', 'Shop')), 'SHOP_PAYREXX_INSTANCE_NAME' => \Cx\Core\Setting\Controller\Setting::getValue('payrexx_instance_name', 'Shop'), 'SHOP_PAYREXX_API_SECRET' => \Cx\Core\Setting\Controller\Setting::getValue('payrexx_api_secret', 'Shop'), 'SHOP_PAYREXX_STATUS' => \Cx\Core\Setting\Controller\Setting::getValue('payrexx_active', 'Shop') ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_YELLOWPAY_SHOP_ID' => \Cx\Core\Setting\Controller\Setting::getValue('postfinance_shop_id', 'Shop'), 'SHOP_YELLOWPAY_STATUS' => \Cx\Core\Setting\Controller\Setting::getValue('postfinance_active', 'Shop') ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_YELLOWPAY_HASH_SIGNATURE_IN' => contrexx_raw2xhtml(\Cx\Core\Setting\Controller\Setting::getValue('postfinance_hash_signature_in', 'Shop')), 'SHOP_YELLOWPAY_HASH_SIGNATURE_OUT' => contrexx_raw2xhtml(\Cx\Core\Setting\Controller\Setting::getValue('postfinance_hash_signature_out', 'Shop')), 'SHOP_YELLOWPAY_AUTHORIZATION_TYPE_OPTIONS' => \Yellowpay::getAuthorizationMenuoptions(\Cx\Core\Setting\Controller\Setting::getValue('postfinance_authorization_type', 'Shop')), 'SHOP_YELLOWPAY_USE_TESTSERVER_CHECKED' => \Cx\Core\Setting\Controller\Setting::getValue('postfinance_use_testserver', 'Shop') ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_POSTFINANCE_MOBILE_WEBUSER' => contrexx_raw2xhtml(\Cx\Core\Setting\Controller\Setting::getValue('postfinance_mobile_webuser', 'Shop')), 'SHOP_POSTFINANCE_MOBILE_SIGN' => contrexx_raw2xhtml(\Cx\Core\Setting\Controller\Setting::getValue('postfinance_mobile_sign', 'Shop')), 'SHOP_POSTFINANCE_MOBILE_IJUSTWANTTOTEST_CHECKED' => \Cx\Core\Setting\Controller\Setting::getValue('postfinance_mobile_ijustwanttotest', 'Shop') ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_POSTFINANCE_MOBILE_STATUS' => \Cx\Core\Setting\Controller\Setting::getValue('postfinance_mobile_status', 'Shop') ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_DATATRANS_AUTHORIZATION_TYPE_OPTIONS' => \Datatrans::getReqtypeMenuoptions(\Cx\Core\Setting\Controller\Setting::getValue('datatrans_request_type', 'Shop')), 'SHOP_DATATRANS_MERCHANT_ID' => \Cx\Core\Setting\Controller\Setting::getValue('datatrans_merchant_id', 'Shop'), 'SHOP_DATATRANS_STATUS' => \Cx\Core\Setting\Controller\Setting::getValue('datatrans_active', 'Shop') ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_DATATRANS_USE_TESTSERVER_YES_CHECKED' => \Cx\Core\Setting\Controller\Setting::getValue('datatrans_use_testserver', 'Shop') ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_DATATRANS_USE_TESTSERVER_NO_CHECKED' => \Cx\Core\Setting\Controller\Setting::getValue('datatrans_use_testserver', 'Shop') ? '' : \Html::ATTRIBUTE_CHECKED, 'SHOP_PAYPAL_EMAIL' => contrexx_raw2xhtml(\Cx\Core\Setting\Controller\Setting::getValue('paypal_account_email', 'Shop')), 'SHOP_PAYPAL_STATUS' => \Cx\Core\Setting\Controller\Setting::getValue('paypal_active', 'Shop') ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_PAYPAL_DEFAULT_CURRENCY_MENUOPTIONS' => \PayPal::getAcceptedCurrencyCodeMenuoptions(\Cx\Core\Setting\Controller\Setting::getValue('paypal_default_currency', 'Shop')), 'SHOP_PAYMENT_LSV_STATUS' => \Cx\Core\Setting\Controller\Setting::getValue('payment_lsv_active', 'Shop') ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_PAYMENT_DEFAULT_CURRENCY' => Currency::getDefaultCurrencySymbol(), 'SHOP_CURRENCY_CODE' => Currency::getCurrencyCodeById(Currency::getDefaultCurrencyId())));
     return true;
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:26,代码来源:Payment.class.php

示例8: getOptionMenu

 /**
  * Returns HTML code for the option menu for an Attribute
  *
  * Used in the Backend for selecting and editing.
  * @global  array       $_ARRAYLANG     Language array
  * @param   integer     $attribute_id   The Attribute ID
  * @param   string      $name           The name and ID attribute for the
  *                                      menu
  * @param   integer     $selected_id    The ID of the selected option
  * @param   string      $onchange       The optional Javascript onchange
  *                                      event
  * @param   string      $style          The optional CSS style for the menu
  * @return  string      $menu           The Option menu HTML code
  * @static
  */
 static function getOptionMenu($attribute_id, $name, $selected_id = 0, $onchange = '', $style = '')
 {
     global $_ARRAYLANG;
     $arrOptions = self::getOptionArrayByAttributeId($attribute_id);
     // No options, or an error occurred
     if (!$arrOptions) {
         return '';
     }
     $menu = '<select name="' . $name . '[' . $attribute_id . '][]" ' . 'id="' . $name . '-' . $attribute_id . '" size="1"' . ($onchange ? ' onchange="' . $onchange . '"' : '') . ($style ? ' style="' . $style . '"' : '') . '>' . "\n";
     foreach ($arrOptions as $option_id => $arrValue) {
         $menu .= '<option value="' . $option_id . '"' . ($selected_id == $option_id ? ' selected="selected"' : '') . '>' . $arrValue['value'] . ' (' . $arrValue['price'] . ' ' . Currency::getDefaultCurrencySymbol() . ')</option>' . "\n";
     }
     $menu .= '</select><br /><a href="javascript:{}" ' . 'id="optionMenuLink-' . $attribute_id . '" ' . 'style="display: none;" ' . 'onclick="removeSelectedValues(' . $attribute_id . ')" ' . 'title="' . $_ARRAYLANG['TXT_SHOP_REMOVE_SELECTED_VALUE'] . '" ' . '>' . $_ARRAYLANG['TXT_SHOP_REMOVE_SELECTED_VALUE'] . '</a>' . "\n";
     return $menu;
 }
开发者ID:Niggu,项目名称:cloudrexx,代码行数:30,代码来源:Attributes.class.php

示例9: empty

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'));
    $sugar_smarty->assign("CURRENCY", $currency->iso4217 . ' ' . $currency->symbol);
} else {
    $sugar_smarty->assign("CURRENCY", $currency->getDefaultISO4217() . ' ' . $currency->getDefaultCurrencySymbol());
}
$sugar_smarty->assign('CURRENCY_SIG_DIGITS', $locale->getPrecedentPreference('default_currency_significant_digits', $focus));
$sugar_smarty->assign('NAME_FORMAT', $focus->getLocaleFormatDesc());
$sugar_smarty->assign("DESCRIPTION", nl2br(url2html($focus->description)));
$sugar_smarty->assign("TITLE", $focus->title);
$sugar_smarty->assign("DEPARTMENT", $focus->department);
$sugar_smarty->assign("REPORTS_TO_ID", $focus->reports_to_id);
$sugar_smarty->assign("REPORTS_TO_NAME", $focus->reports_to_name);
$sugar_smarty->assign("PHONE_HOME", $focus->phone_home);
$sugar_smarty->assign("PHONE_MOBILE", $focus->phone_mobile);
$sugar_smarty->assign("PHONE_WORK", $focus->phone_work);
$sugar_smarty->assign("PHONE_OTHER", $focus->phone_other);
$sugar_smarty->assign("PHONE_FAX", $focus->phone_fax);
if (!empty($focus->employee_status)) {
    $sugar_smarty->assign("EMPLOYEE_STATUS", $app_list_strings['employee_status_dom'][$focus->employee_status]);
开发者ID:nartnik,项目名称:sugarcrm_test,代码行数:31,代码来源:DetailView.php

示例10: 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);
     }
     $currencyList = array();
     foreach ($locale->currencies as $id => $val) {
         $currencyList[$id] = $val['symbol'];
     }
     $currencySymbolJSON = json_encode($currencyList);
     $this->ss->assign('currencySymbolJSON', $currencySymbolJSON);
     $currencyDisplay = new Currency();
     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
     $this->ss->assign('default_locale_name_format', $locale->getLocaleFormatMacro($this->bean));
     $this->ss->assign('getNameJs', $locale->getNameJs());
//.........这里部分代码省略.........
开发者ID:BMLP,项目名称:memoryhole-ansible,代码行数:101,代码来源:UserViewHelper.php

示例11: view_statistics


//.........这里部分代码省略.........
         }
         if (is_array($arrayResults)) {
             foreach ($arrayResults as $entry) {
                 $sumColumn2 = $sumColumn2 + $entry['column2'];
                 $sumColumn3 = $sumColumn3 + $entry['column3'];
                 $sumColumn4 = $sumColumn4 + $entry['column4'];
             }
             rsort($arrayResults);
         }
     } elseif ($selectedStat == 3) {
         // Customer statistic
         while (!$objResult->EOF) {
             Currency::setActiveCurrencyId($objResult->fields['currency_id']);
             $key = $objResult->fields['id'];
             if (!isset($arrayResults[$key])) {
                 $objUser = \FWUser::getFWUserObject()->objUser;
                 $objUser = $objUser->getUser($key);
                 $company = '';
                 $name = $_ARRAYLANG['TXT_SHOP_CUSTOMER_NOT_FOUND'];
                 if ($objUser) {
                     $company = $objUser->getProfileAttribute('company');
                     $name = $objUser->getProfileAttribute('firstname') . ' ' . $objUser->getProfileAttribute('lastname');
                 }
                 $arrayResults[$key] = array('column1' => '<a href="index.php?cmd=Shop' . MODULE_INDEX . '&amp;act=customerdetails&amp;customer_id=' . $objResult->fields['id'] . '">' . $name . '</a>', 'column2' => $company, 'column3' => 0, 'column4' => 0);
             }
             $arrayResults[$key]['column3'] += $objResult->fields['shopColumn3'];
             $arrayResults[$key]['column4'] += Currency::getDefaultCurrencyPrice($objResult->fields['sum']);
             $sumColumn3 += $objResult->fields['shopColumn3'];
             $sumColumn4 += Currency::getDefaultCurrencyPrice($objResult->fields['sum']);
             $objResult->MoveNext();
         }
     } else {
         // Order statistic (default)
         $arrayMonths = explode(',', $_ARRAYLANG['TXT_MONTH_ARRAY']);
         while (!$objResult->EOF) {
             $key = $objResult->fields['year'] . '.' . $objResult->fields['month'];
             if (!isset($arrayResults[$key])) {
                 $arrayResults[$key] = array('column1' => '', 'column2' => 0, 'column3' => 0, 'column4' => 0);
             }
             $arrayResults[$key]['column1'] = $arrayMonths[intval($objResult->fields['month']) - 1] . ' ' . $objResult->fields['year'];
             $arrayResults[$key]['column2'] = $arrayResults[$key]['column2'] + 1;
             $arrayResults[$key]['column3'] = $arrayResults[$key]['column3'] + $objResult->fields['shopColumn3'];
             $arrayResults[$key]['column4'] = $arrayResults[$key]['column4'] + Currency::getDefaultCurrencyPrice($objResult->fields['sum']);
             $sumColumn2 = $sumColumn2 + 1;
             $sumColumn3 = $sumColumn3 + $objResult->fields['shopColumn3'];
             $sumColumn4 = $sumColumn4 + Currency::getDefaultCurrencyPrice($objResult->fields['sum']);
             $objResult->MoveNext();
         }
         krsort($arrayResults, SORT_NUMERIC);
     }
     $objTemplate->setCurrentBlock('statisticRow');
     $i = 0;
     if (is_array($arrayResults)) {
         foreach ($arrayResults as $entry) {
             $objTemplate->setVariable(array('SHOP_ROWCLASS' => 'row' . (++$i % 2 + 1), 'SHOP_COLUMN_1' => $entry['column1'], 'SHOP_COLUMN_2' => $entry['column2'], 'SHOP_COLUMN_3' => $entry['column3'], 'SHOP_COLUMN_4' => Currency::formatPrice($entry['column4']) . ' ' . Currency::getDefaultCurrencySymbol()));
             $objTemplate->parse('statisticRow');
         }
     }
     $query_currency = "\n            SELECT currency_id, sum,\n                   DATE_FORMAT(date_time, '%m') AS month,\n                   DATE_FORMAT(date_time, '%Y') AS year\n              FROM " . DBPREFIX . "module_shop" . MODULE_INDEX . "_orders\n             WHERE status=" . Order::STATUS_CONFIRMED . "\n                OR status=" . Order::STATUS_COMPLETED . "\n             ORDER BY date_time DESC";
     $objResult = $objDatabase->Execute($query_currency);
     if (!$objResult) {
         return Order::errorHandler();
     }
     $totalSoldProducts = 0;
     $query_totalproducts = "\n            SELECT sum(A.quantity) AS shopTotalSoldProducts\n              FROM " . DBPREFIX . "module_shop" . MODULE_INDEX . "_order_items AS A,\n                   " . DBPREFIX . "module_shop" . MODULE_INDEX . "_orders AS B\n             WHERE A.order_id=B.id\n               AND (   B.status=" . Order::STATUS_CONFIRMED . "\n                    OR B.status=" . Order::STATUS_COMPLETED . ")";
     $objResult = $objDatabase->SelectLimit($query_totalproducts, 1);
     if ($objResult) {
         if (!$objResult->EOF) {
             $totalSoldProducts = $objResult->fields['shopTotalSoldProducts'];
             $objResult->MoveNext();
         }
     }
     $totalOrderSum = 0;
     $totalOrders = 0;
     $bestMonthSum = 0;
     $bestMonthDate = '';
     $arrShopMonthSum = array();
     $objResult = $objDatabase->Execute($query);
     while (!$objResult->EOF) {
         $orderSum = Currency::getDefaultCurrencyPrice($objResult->fields['sum']);
         if (!isset($arrShopMonthSum[$objResult->fields['year']][$objResult->fields['month']])) {
             $arrShopMonthSum[$objResult->fields['year']][$objResult->fields['month']] = 0;
         }
         $arrShopMonthSum[$objResult->fields['year']][$objResult->fields['month']] += $orderSum;
         $totalOrderSum += $orderSum;
         $totalOrders++;
         $objResult->MoveNext();
     }
     $months = explode(',', $_ARRAYLANG['TXT_MONTH_ARRAY']);
     foreach ($arrShopMonthSum as $year => $arrMonth) {
         foreach ($arrMonth as $month => $sum) {
             if ($bestMonthSum < $sum) {
                 $bestMonthSum = $sum;
                 $bestMonthDate = $months[$month - 1] . ' ' . $year;
             }
         }
     }
     $objTemplate->setVariable(array('SHOP_ROWCLASS' => 'row' . (++$i % 2 + 1), 'SHOP_TOTAL_SUM' => Currency::formatPrice($totalOrderSum) . ' ' . Currency::getDefaultCurrencySymbol(), 'SHOP_MONTH' => $bestMonthDate, 'SHOP_MONTH_SUM' => Currency::formatPrice($bestMonthSum) . ' ' . Currency::getDefaultCurrencySymbol(), 'SHOP_TOTAL_ORDERS' => $totalOrders, 'SHOP_SOLD_ARTICLES' => $totalSoldProducts, 'SHOP_SUM_COLUMN_2' => $sumColumn2, 'SHOP_SUM_COLUMN_3' => $sumColumn3, 'SHOP_SUM_COLUMN_4' => Currency::formatPrice($sumColumn4) . ' ' . Currency::getDefaultCurrencySymbol()));
     return true;
 }
开发者ID:Niggu,项目名称:cloudrexx,代码行数:101,代码来源:Orders.class.php

示例12: getProductCatalogVariables

 private function getProductCatalogVariables($productCatalog)
 {
     $rootCategoriesSmarty = $this->getSmartyCategories($productCatalog->getAllCategories());
     $this->insertProducts($rootCategoriesSmarty);
     $description = htmlToLatex(from_html($productCatalog->description));
     //1.7.6 TODO create error handling here
     if ($description == null) {
         $GLOBALS['log']->error('OQC: Product catalog description is null!');
         //return null;
     }
     global $timedate;
     $validfrom = $timedate->to_display_date($productCatalog->validfrom);
     $validto = $timedate->to_display_date($productCatalog->validto);
     $frontpage = null;
     $attachment = null;
     if ($productCatalog->frontpage_id != null || $productCatalog->attachment_id != null) {
         $doc = new Document();
         if ($doc->retrieve($productCatalog->frontpage_id)) {
             $frontpage = str_replace("\\", '/', TMP_DIR . DIRECTORY_SEPARATOR . $doc->document_revision_id . '.pdf');
             copy(getcwd() . DIRECTORY_SEPARATOR . getDocumentFilename($doc->document_revision_id), $frontpage);
         }
         if ($doc->retrieve($productCatalog->attachment_id)) {
             $attachment = str_replace("\\", '/', TMP_DIR . DIRECTORY_SEPARATOR . $doc->document_revision_id . '.pdf');
             copy(getcwd() . DIRECTORY_SEPARATOR . getDocumentFilename($doc->document_revision_id), $attachment);
         }
     }
     //ProductCatalog currency setup
     $currencyArray = array();
     $currency = new Currency();
     $currency_id = $currency->retrieve_id_by_name($productCatalog->currency_id);
     //$GLOBALS['log']->error('Contract variables: currency: '. var_export($currency_id,true));
     if ($currency_id) {
         $currency->retrieve($currency_id);
         $currencyArray['currency_id'] = $currency->iso4217;
         $currencyArray['currency_symbol'] = $currency->symbol;
         $currencyArray['currency_ratio'] = $currency->conversion_rate;
     } else {
         $currencyArray['currency_id'] = $currency->getDefaultISO4217();
         $currencyArray['currency_symbol'] = $currency->getDefaultCurrencySymbol();
         $currencyArray['currency_ratio'] = 1.0;
     }
     $currencyArray['currency_symbol'] = str_replace("€", '\\euro{}', $currencyArray['currency_symbol']);
     $currencyArray['currency_symbol'] = str_replace('$', '\\$', $currencyArray['currency_symbol']);
     $currencyArray['currency_symbol'] = str_replace("£", '{\\pounds}', $currencyArray['currency_symbol']);
     $currencyArray['currency_symbol'] = str_replace("¥", '{Y\\hspace*{-1.4ex}--}', $currencyArray['currency_symbol']);
     $productCatalogVariables = array('name' => $productCatalog->name, 'validfrom' => $validfrom, 'validto' => $validto, 'graphicsDir' => LATEX_GRAPHICS_DIR, 'categoriesAndProducts' => $rootCategoriesSmarty, 'description' => $description, 'frontpage' => $frontpage, 'attachment' => $attachment, 'year' => date('Y'), 'currency' => $currencyArray, 'discount' => 1.0 - $productCatalog->oqc_catalog_discount / 100);
     //$GLOBALS['log']->error('Product Catalog variables: '. var_export($productCatalogVariables,true));
     return $productCatalogVariables;
 }
开发者ID:santara12,项目名称:OpenQuotesAndContracts,代码行数:49,代码来源:ProductCatalogPdfCreator.php

示例13: getContractVariables

function getContractVariables($contract)
{
    $contractData = sanatizeBeanArrayForLatex($contract->toArray(true));
    $clientContact = new Contact();
    if ($clientContact->retrieve($contract->clientcontact_id)) {
        $contractData['clientContact'] = sanatizeBeanArrayForLatex($clientContact->toArray(true));
        // Gets data from DB only
        $clientAccount = new Account();
        if ($clientAccount->retrieve($clientContact->account_id)) {
            //$GLOBALS['log']->error('Account variables: variables transferred to latex template: '. var_export($clientAccount->toArray(true),true));
            $contractData['clientContact']['account'] = sanatizeBeanArrayForLatex($clientAccount->toArray(true));
        }
        //gets data from DB only
    }
    // only date is needed (not time) and we have to convert it to the user format
    global $timedate;
    //$GLOBALS['log']->error('Contract variables: date_modified: '. var_export($contract->date_modified,true));
    //$contractData['date_modified'] = $timedate->to_display_date($contract->date_modified);
    $contractData['date_modified'] = $timedate->getDatePart($contract->date_modified);
    //$contractData['startdate'] = $timedate->to_display_date($contract->startdate);
    //$contractData['enddate'] = $timedate->to_display_date($contract->enddate);
    //$contractData['deadline'] = $timedate->to_display_date($contract->deadline);
    // translate
    global $app_list_strings;
    if (isset($contractData['periodofnotice'])) {
        $contractData['periodofnotice'] = $app_list_strings['periodofnotice_list'][$contractData['periodofnotice']];
    }
    //contract currency setup
    $currency = new Currency();
    $currency_id = $currency->retrieve_id_by_name($contract->currency_id);
    //$GLOBALS['log']->error('Contract variables: currency: '. var_export($currency_id,true));
    if ($currency_id) {
        $currency->retrieve($currency_id);
        $contractData['currency_id'] = $currency->iso4217;
        $contractData['currency_symbol'] = $currency->symbol;
    } else {
        $contractData['currency_id'] = $currency->getDefaultISO4217();
        $contractData['currency_symbol'] = $currency->getDefaultCurrencySymbol();
    }
    $contractData['currency_symbol'] = str_replace("€", '\\euro{}', $contractData['currency_symbol']);
    $contractData['currency_symbol'] = str_replace('$', '\\$', $contractData['currency_symbol']);
    $contractData['currency_symbol'] = str_replace("£", '{\\pounds}', $contractData['currency_symbol']);
    $contractData['currency_symbol'] = str_replace("¥", '{Y\\hspace*{-1.4ex}--}', $contractData['currency_symbol']);
    // Get Sugar user information
    $userData = oqc_getUserVariables();
    $contractData = array_merge($contractData, $userData);
    $outputData = array('contract' => $contractData, 'graphicsDir' => LATEX_GRAPHICS_DIR);
    //$GLOBALS['log']->error('Contract variables: variables transferred to latex template: '. var_export($contractData,true));
    return $outputData;
}
开发者ID:santara12,项目名称:OpenQuotesAndContracts,代码行数:50,代码来源:oqc_CreatePdf.php

示例14: testgetDefaultCurrencySymbol

 public function testgetDefaultCurrencySymbol()
 {
     $currency = new Currency();
     $this->assertEquals('$', $currency->getDefaultCurrencySymbol());
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:5,代码来源:CurrencyTest.php

示例15: view_customer_details

 /**
  * Set up the customer details
  */
 function view_customer_details()
 {
     global $_ARRAYLANG;
     self::$objTemplate->loadTemplateFile("module_shop_customer_details.html");
     if (isset($_POST['store'])) {
         self::storeCustomerFromPost();
     }
     $customer_id = intval($_REQUEST['customer_id']);
     $objCustomer = Customer::getById($customer_id);
     if (!$objCustomer) {
         return \Message::error($_ARRAYLANG['TXT_SHOP_CUSTOMER_ERROR_NOT_FOUND']);
     }
     $customer_type = $objCustomer->is_reseller() ? $_ARRAYLANG['TXT_RESELLER'] : $_ARRAYLANG['TXT_CUSTOMER'];
     $active = $objCustomer->active() ? $_ARRAYLANG['TXT_ACTIVE'] : $_ARRAYLANG['TXT_INACTIVE'];
     self::$objTemplate->setVariable(array('SHOP_CUSTOMERID' => $objCustomer->id(), 'SHOP_GENDER' => $_ARRAYLANG['TXT_SHOP_' . strtoupper($objCustomer->gender())], 'SHOP_LASTNAME' => $objCustomer->lastname(), 'SHOP_FIRSTNAME' => $objCustomer->firstname(), 'SHOP_COMPANY' => $objCustomer->company(), 'SHOP_ADDRESS' => $objCustomer->address(), 'SHOP_CITY' => $objCustomer->city(), 'SHOP_USERNAME' => $objCustomer->username(), 'SHOP_COUNTRY' => \Cx\Core\Country\Controller\Country::getNameById($objCustomer->country_id()), 'SHOP_ZIP' => $objCustomer->zip(), 'SHOP_PHONE' => $objCustomer->phone(), 'SHOP_FAX' => $objCustomer->fax(), 'SHOP_EMAIL' => $objCustomer->email(), 'SHOP_COMPANY_NOTE' => $objCustomer->companynote(), 'SHOP_IS_RESELLER' => $customer_type, 'SHOP_REGISTER_DATE' => date(ASCMS_DATE_FORMAT_DATETIME, $objCustomer->register_date()), 'SHOP_CUSTOMER_STATUS' => $active, 'SHOP_DISCOUNT_GROUP_CUSTOMER' => Discount::getCustomerGroupName($objCustomer->group_id())));
     // TODO: TEST
     $count = NULL;
     $orders = Orders::getArray($count, NULL, array(), \Paging::getPosition(), \Cx\Core\Setting\Controller\Setting::getValue('numof_orders_per_page_backend', 'Shop'));
     $i = 1;
     foreach ($orders as $order) {
         Currency::init($order->currency_id());
         self::$objTemplate->setVariable(array('SHOP_ROWCLASS' => 'row' . (++$i % 2 + 1), 'SHOP_ORDER_ID' => $order->id(), 'SHOP_ORDER_ID_CUSTOM' => ShopLibrary::getCustomOrderId($order->id(), $order->date_time()), 'SHOP_ORDER_DATE' => $order->date_time(), 'SHOP_ORDER_STATUS' => $_ARRAYLANG['TXT_SHOP_ORDER_STATUS_' . $order->status()], 'SHOP_ORDER_SUM' => Currency::getDefaultCurrencySymbol() . ' ' . Currency::getDefaultCurrencyPrice($order->sum())));
         self::$objTemplate->parse('orderRow');
     }
     return true;
 }
开发者ID:Niggu,项目名称:cloudrexx,代码行数:29,代码来源:ShopManager.class.php


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