Page MenuHomeIn-Portal Phabricator

in-commerce
No OneTemporary

File Metadata

Created
Wed, Feb 26, 1:45 PM

in-commerce

Index: branches/5.2.x/units/gateways/gw_classes/gw_base.php
===================================================================
--- branches/5.2.x/units/gateways/gw_classes/gw_base.php (revision 14838)
+++ branches/5.2.x/units/gateways/gw_classes/gw_base.php (revision 14839)
@@ -1,256 +1,258 @@
<?php
/**
* @version $Id$
* @package In-Commerce
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license Commercial License
* This software is protected by copyright law and international treaties.
* Unauthorized reproduction or unlicensed usage of the code of this program,
* or any portion of it may result in severe civil and criminal penalties,
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
class kGWBase extends kBase
{
/**
* gateway received responce
*
* @var string
*/
var $gw_responce = '';
var $parsed_responce = Array();
/**
* Returns payment form submit url
*
* @return string
*/
function getFormAction($gw_params)
{
return $this->Application->ProcessParsedTag('m', 'FormAction', Array() );
}
/**
* Processed input data and convets it to fields understandable by gateway
*
* @param Array $item_data
* @param Array $tag_params additional params for gateway passed through tag
* @param Array $gw_params gateway params from payment type config
* @return Array
*/
function getHiddenFields($item_data, $tag_params, $gw_params)
{
return Array( 'events[ord]' => 'OnCompleteOrder',
'success_template' => $tag_params['return_template'],
'failure_template' => $tag_params['cancel_template']);
}
function NeedPlaceButton($item_data, $tag_params, $gw_params)
{
return true;
}
/**
* Process notification about payment from payment gateway
*
*/
function processNotification()
{
}
/**
* Perform PREAUTH/SALE type transaction direct from php script wihtout redirecting to 3rd-party website
*
* @param Array $item_data
* @param Array $gw_params
* @return bool
*/
function DirectPayment($item_data, $gw_params)
{
return true;
}
/**
* Perform SALE type transaction direct from php script wihtout redirecting to 3rd-party website
*
* @param Array $item_data
* @param Array $gw_params
* @return bool
*/
function Charge($item_data, $gw_params)
{
return true;
}
/**
* Informs payment gateway, that order has been shipped
*
* @param Array $item_data
* @param Array $gw_params
* @return bool
*/
function OrderShipped($item_data, $gw_params)
{
}
/**
* Informs payment gateway, that order has been declined
*
* @param Array $item_data
* @param Array $gw_params
* @return bool
*/
function OrderDeclined($item_data, $gw_params)
{
}
/**
* Returns gateway responce from last operation
*
* @return string
*/
function getGWResponce()
{
return $this->gw_responce;
}
/**
* Parse previosly saved gw responce into associative array
*
* @param string $gw_responce
* @return Array
*/
function parseGWResponce($gw_responce, $gw_params)
{
return $this->gw_responce;
}
/**
* Returns true if we should use testing mode
*
* @return bool
*/
function IsTestMode()
{
return defined('DEBUG_MODE') && kUtil::constOn('DBG_PAYMENT_GW');
}
/**
* Convery primary currency to selected (if they are the same, converter will just return)
*
* @param double $value
* @param string $iso
* @param bool $format_value
* @return double
*/
function ConvertCurrency($value, $iso, $format_value = true)
{
- $converter =& $this->Application->recallObject('kCurrencyRates');
+ $converter =& $this->Application->recallObject('CurrencyRates');
+ /* @var $converter CurrencyRates */
+
$value = $converter->Convert($value, 'PRIMARY', $iso);
return $format_value ? sprintf('%.2f', $value) : $value;
}
function InstallData()
{
return array();
}
function Install()
{
if ($this->IsInstalled()) {
return;
}
$data = $this->InstallData();
if (!$data) {
return ;
}
// 1. create gateway record
$fields_hash = Array ();
$gw_fields = Array ('Name', 'ClassName', 'ClassFile', 'RequireCCFields');
foreach ($gw_fields as $gw_field) {
$fields_hash[$gw_field] = $data['Gateway'][$gw_field];
}
$this->Conn->doInsert($fields_hash, TABLE_PREFIX.'Gateways');
$gw_id = $this->Conn->getInsertID();
// 2. create DISABLED payment type, that uses this gateway (used for storing configuration properties of gateway)
$payment_type =& $this->Application->recallObject('pt.-item', null, Array ('skip_autoload' => true));
/* @var $payment_type kDBItem */
$payment_type->Clear();
$fields_hash = Array (
'Name' => $data['Gateway']['Name'],
'Description' => $data['Gateway']['Name'],
'BuiltIn' => 1,
'GatewayId' => $gw_id,
);
$payment_type->SetDBFieldsFromHash($fields_hash);
$created = $payment_type->Create();
if (!$created) {
return ;
}
// 3. create gateway configuration fields
foreach ($data['ConfigFields'] as $field => $properties) {
$fields_hash = Array (
'SystemFieldName' => $field,
'GatewayId' => $gw_id,
'FieldName' => $properties['Name'],
'ElementType' => $properties['Type'],
'ValueList' => $properties['ValueList'],
);
$this->Conn->doInsert($fields_hash, TABLE_PREFIX.'GatewayConfigFields');
$fld_id = $this->Conn->getInsertID();
// 4. set default value for configuration property of gateway
$fields_hash = Array (
'GWConfigFieldId' => $fld_id,
'PaymentTypeId' => $payment_type->GetID(),
'Value' => $properties['Default'],
);
$this->Conn->doInsert($fields_hash, TABLE_PREFIX.'GatewayConfigValues');
}
}
function IsInstalled()
{
$data = $this->InstallData();
if (!$data) {
return true;
}
$sql = 'SELECT GatewayId
FROM '.TABLE_PREFIX.'Gateways
WHERE ClassName = '.$this->Conn->qstr($data['Gateway']['ClassName']);
return $this->Conn->GetOne($sql);
}
function getErrorMsg()
{
return '';
}
function gettestccnumbers()
{
return array();
}
function getNotificationUrl($script = 'gw_notify.php', $use_ssl = null)
{
// custom path can be: units/gateways/gw_classes/notify_scripts/google_checkout_shippings.php'
$ret = MODULES_PATH . '/in-commerce/' . $script;
$ret = preg_replace('/^' . preg_quote(FULL_PATH . '/', '/') . '/', $this->Application->BaseURL('', $use_ssl), $ret);
return str_replace(DIRECTORY_SEPARATOR, '/', $ret);
}
}
\ No newline at end of file
Index: branches/5.2.x/units/pricing/pricing_tag_processor.php
===================================================================
--- branches/5.2.x/units/pricing/pricing_tag_processor.php (revision 14838)
+++ branches/5.2.x/units/pricing/pricing_tag_processor.php (revision 14839)
@@ -1,164 +1,166 @@
<?php
/**
* @version $Id$
* @package In-Commerce
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license Commercial License
* This software is protected by copyright law and international treaties.
* Unauthorized reproduction or unlicensed usage of the code of this program,
* or any portion of it may result in severe civil and criminal penalties,
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
class PricingTagProcessor extends kDBTagProcessor {
function ProductPrice($params)
{
$object =& $this->Application->recallObject($params['PrefixSpecial']);
$price = $object->GetField('Price');
// display selected currency by default
if (!isset($params['currency']) || $params['currency'] == 'selected') {
$iso = $this->Application->RecallVar('curr_iso');
}
elseif ($params['currency'] == 'primary') {
$iso = 'USD';
}
else { //explicit currency
$iso = $params['currency'];
}
// convert primary currency to selected (if they are the same, converter will just return)
- $converter =& $this->Application->recallObject('kCurrencyRates');
+ $converter =& $this->Application->recallObject('CurrencyRates');
+ /* @var $converter CurrencyRates */
+
$price = $converter->Convert($price, 'PRIMARY', $iso);
$currency =& $this->Application->recallObject('curr.-'.$iso, null, Array('skip_autoload' => true));
if( !$currency->isLoaded() ) $currency->Load($iso, 'ISO');
$symbol = $currency->GetDBField('Symbol');
if (!$symbol) $symbol = $currency->GetDBField('ISO');
$formatted = '';
if ($currency->GetDBField('SymbolPosition') == 0) {
$formatted .= $symbol;
}
$formatted .= $price;
if ($currency->GetDBField('SymbolPosition') == 1) {
$formatted .= $symbol;
}
return $formatted;
}
function Product_ListPriceBrackets($params)
{
return $this->PrintList2($params);
}
function Field($params)
{
$field = $this->SelectParam($params, 'name,field');
$value = parent::Field($params);
if (($field == 'MaxQty') && ($value == -1)) {
$value = '&infin;';
}
return $value;
}
function Product_HasQuantityPricing($params)
{
return (int)$this->TotalRecords($params) > 1;
}
function ShowPricingForm($params)
{
$br_object =& $this->getObject( Array('skip_autoload' => true) );
$br_data = $this->Application->GetVar("pr_tang");
$group_id = $this->Application->getVar('group_id');
if($group_id>0){
$where_group=' AND GroupId = '.$group_id.' ';
}
if(!$br_data)
{
$sql = 'SELECT * FROM '.$br_object->TableName.' WHERE ProductId = '.$this->Application->GetVar('p_id').' '.$where_group;
$brackets = $this->Conn->Query($sql, 'PriceId');
usort($brackets, 'pr_bracket_comp');
$dummy =& $this->Application->recallObject($this->Prefix.'.-dummy', null, array('skip_autoload' => true));
/* @var $dummy kDBItem */
foreach($brackets as $id => $values)
{
foreach($values as $value_key=>$value_val){
$dummy->SetDBField($value_key, $value_val);
$brackets[$id][$value_key] = $dummy->GetField($value_key);
}
}
$br_data=$brackets;
$this->Application->SetVar($this->getPrefixSpecial(true), $brackets);
}
else
{
usort($br_data , 'pr_bracket_comp');
}
$ret = '';
if( is_array($br_data) )
{
$block_params=$this->prepareTagParams($params);
$block_params['IdField']='PriceId';
$block_params['name'] = $params['block'];
$first = true;
// this is needed to find next id
$br_data_copy=$br_data;
foreach($br_data as $id => $values)
{
foreach($values as $value_key=>$value_val){
$block_params[$value_key] = $value_val;
}
reset($values);
next($br_data_copy);
$next_bracket=current($br_data_copy);
$block_params['id'] = $values["PriceId"];
$block_params['min'] = ($id == -1) ? ($values['MinQty'] ? $values['MinQty'] : 0) : $values['MinQty'];
$block_params['max'] = ($values['MaxQty'] == -1) ? '&infin;' : $values['MaxQty'];
$block_params['next_min_id']=$next_bracket['PriceId'];
if ($first)
{
$block_params['first'] = 1;
$first = false;
}
else
{
$block_params['first'] = 0;
}
$ret .= $this->Application->ParseBlock($block_params, 1);
}
}
return $ret;
}
function AddToCartLink($params)
{
$value = $this->Field(array('name'=>'PriceId'));
//$this->Application->SetVar('p_id', $this->Application->GetVar($this->getPrefixSpecial().'_id'));
$this->Application->SetVar('pr_id', $value);
return $this->Application->HREF($params['template'], '', Array('pass' => 'm,p,pr,ord', 'ord_event' => 'OnAddToCart'));
}
}
\ No newline at end of file
Index: branches/5.2.x/units/helpers/order_helper.php
===================================================================
--- branches/5.2.x/units/helpers/order_helper.php (revision 14838)
+++ branches/5.2.x/units/helpers/order_helper.php (revision 14839)
@@ -1,232 +1,232 @@
<?php
defined('FULL_PATH') or die('restricted access!');
class OrderHelper extends kHelper
{
/**
* Returns various information about given order
*
* @param OrdersItem $object
* @param string $currency
* @param bool $remove_errors
* @return Array
*/
function getOrderInfo(&$object, $currency, $remove_errors = true)
{
$errors = $this->Application->RecallVar('checkout_errors');
$ret = Array (
'order' => Array (
'CouponId' => (int)$object->GetDBField('CouponId'),
'CouponName' => (string)$object->GetDBField('CouponName'),
'GiftCertificateId' => (int)$object->GetDBField('GiftCertificateDiscount'),
'GiftCertificateDiscount' => $this->convertCurrency($object->GetDBField('GiftCertificateDiscount'), $currency),
'DiscountTotal' => $this->convertCurrency($object->GetDBField('DiscountTotal'), $currency),
'SubTotal' => $this->convertCurrency($object->GetDBField('SubTotal'), $currency),
),
'items' => Array (),
'errors' => $errors ? unserialize($errors) : Array (),
);
$items =& $this->Application->recallObject('orditems', 'orditems_List', Array ('per_page' => -1));
/* @var $items kDBList */
$items->Query();
$items->GoFirst();
$ret['order']['ItemsInCart'] = array_sum( $items->GetCol('Quantity') );
if ( $items->EOL() ) {
return $ret;
}
$product =& $this->Application->recallObject('p', null, Array ('skip_autoload' => true));
/* @var $product kCatDBItem */
$sql = $product->GetSelectSQL() . '
WHERE ' . $product->TableName . '.' . $product->IDField . ' IN (' . implode(',', $items->GetCol('ProductId')) . ')';
$products = $this->Conn->Query($sql, $product->IDField);
while ( !$items->EOL() ) {
// prepare product from order item
$product->LoadFromHash( $products[ $items->GetDBField('ProductId') ] );
$this->Application->SetVar('orditems_id', $items->GetID()); // for edit/delete links using GET
// weird code from orditems:PrintList
$this->Application->SetVar('p_id', $product->GetID());
$this->Application->SetVar('m_cat_id', $product->GetDBField('CategoryId'));
// collect order item info
$url_params = Array (
'p_id' => $product->GetID(),
'm_cat_id' => $product->GetDBField('CategoryId'),
'pass' => 'm,p',
);
$product_url = $this->Application->HREF('__default__', '', $url_params);
$item_data = $items->GetDBField('ItemData');
$item_data = $item_data ? unserialize($item_data) : Array ();
$row_index = $items->GetDBField('ProductId') . ':' . $items->GetDBField('OptionsSalt') . ':' . $items->GetDBField('BackOrderFlag');
$image_helper =& $this->Application->recallObject('ImageHelper');
/* @var $image_helper ImageHelper */
// TODO: find a way to specify thumbnail size & default image
$ret['items'][$row_index] = Array (
'product_url' => $product_url,
'product_type' => $product->GetDBField('Type'),
'options' => isset($item_data['Options']) ? $item_data['Options'] : false,
'free_promo_shipping' => $this->eligibleForFreePromoShipping($items),
'fields' => Array (
'OrderItemId' => $items->GetDBField('OrderItemId'),
'ProductName' => $items->GetDBField('ProductName'),
'PrimaryImage' => $product->GetField('PrimaryImage', 'resize:58x58;default:img/no_picture.gif'),
'BackOrderFlag' => (int)$items->GetDBField('BackOrderFlag'),
'FlatPrice' => $this->convertCurrency($items->GetDBField('FlatPrice'), $currency),
'Price' => $this->convertCurrency($items->GetDBField('Price'), $currency),
'Quantity' => (int)$items->GetDBField('Quantity'),
'Virtual' => (int)$items->GetDBField('Virtual'),
'Type' => (int)$product->GetDBField('Type'),
'cust_Availability' => $product->GetDBField('cust_Availability'),
),
);
$items->GoNext();
}
if ( $remove_errors ) {
$this->Application->RemoveVar('checkout_errors');
}
return $ret;
}
function convertCurrency($amount, $currency)
{
- $converter =& $this->Application->recallObject('kCurrencyRates');
- /* @var $converter kCurrencyRates */
+ $converter =& $this->Application->recallObject('CurrencyRates');
+ /* @var $converter CurrencyRates */
// convert primary currency to selected (if they are the same, converter will just return)
return (float)$converter->Convert($amount, 'PRIMARY', $this->getISO($currency));
}
function getISO($currency)
{
if ($currency == 'selected') {
$iso = $this->Application->RecallVar('curr_iso');
}
elseif ($currency == 'primary' || $currency == '') {
$iso = $this->Application->GetPrimaryCurrency();
}
else { //explicit currency
$iso = strtoupper($currency);
}
return $iso;
}
/**
* Checks, that given order item is eligible for free promo shipping
*
* @param kDBItem|kDBList $order_item
* @return bool
*/
function eligibleForFreePromoShipping(&$order_item)
{
if ( $order_item->GetDBField('Type') != PRODUCT_TYPE_TANGIBLE ) {
return false;
}
$free_shipping = $order_item->GetDBField('MinQtyFreePromoShipping');
return $free_shipping > 0 && $free_shipping <= $order_item->GetDBField('Quantity');
}
/**
* Returns a template, that will be used to continue shopping from "shopping cart" template
*
* @param string $template
* @return string
* @access public
*/
public function getContinueShoppingTemplate($template = '')
{
if ( !$template || $template == '__default__' ) {
$template = $this->Application->RecallVar('continue_shopping');
}
if ( !$template ) {
$template = 'in-commerce/index';
}
return $template;
}
/**
* Detects credit card type by it's number
*
* @param string $number
* @return int
* @access public
*/
public function getCreditCartType($number)
{
// Get rid of any non-digits
$number = preg_replace('/[^\d]/', '', $number);
$mapping = Array (
'/^4.{15}$|^4.{12}$/' => 1, // Visa
'/^5[1-5].{14}$/' => 2, // MasterCard
'/^3[47].{13}$/' => 3, // American Express
'/^6011.{12}$/' => 4, // Discover
'/^30[0-5].{11}$|^3[68].{12}$/' => 5, // Diners Club
'/^3.{15}$|^2131|1800.{11}$/' => 6, // JBC
);
foreach ($mapping as $number_regex => $card_type) {
if ( preg_match($number_regex, $number) ) {
return $card_type;
}
}
return false;
}
/**
* Extracts fields, used to created user from order
*
* @param OrdersItem $order
* @param string $field_prefix
* @return Array
* @access public
*/
public function getUserFields(&$order, $field_prefix = 'Billing')
{
$fields_hash = Array ();
$names = explode(' ', $order->GetDBField($field_prefix . 'To'), 2);
$fields_hash['FirstName'] = (string)getArrayValue($names, 0);
$fields_hash['LastName'] = (string)getArrayValue($names, 1);
$order_fields = Array (
'Company', 'Phone', 'Fax', 'Email', 'Address1' => 'Street',
'Address2' => 'Street2', 'City', 'State', 'Zip', 'Country'
);
foreach ($order_fields as $src_field => $dst_field) {
if ( is_numeric($src_field) ) {
$src_field = $dst_field;
}
$fields_hash[$dst_field] = $order->GetDBField($field_prefix . $src_field);
}
return $fields_hash;
}
}
Index: branches/5.2.x/units/helpers/ecb_currency_rates.php
===================================================================
--- branches/5.2.x/units/helpers/ecb_currency_rates.php (nonexistent)
+++ branches/5.2.x/units/helpers/ecb_currency_rates.php (revision 14839)
@@ -0,0 +1,56 @@
+<?php
+/**
+* @version $Id: currency_rates.php 14258 2011-03-16 21:43:52Z alex $
+* @package In-Commerce
+* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
+* @license Commercial License
+* This software is protected by copyright law and international treaties.
+* Unauthorized reproduction or unlicensed usage of the code of this program,
+* or any portion of it may result in severe civil and criminal penalties,
+* and will be prosecuted to the maximum extent possible under the law
+* See http://www.in-portal.org/commercial-license for copyright notices and details.
+*/
+
+defined('FULL_PATH') or die('restricted access!');
+
+class ECBCurrencyRates extends CurrencyRates {
+
+ public function __construct()
+ {
+ $this->RateSource = 'http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml';
+
+ parent::__construct();
+ }
+
+ function GetRatesData()
+ {
+ $xml_parser = xml_parser_create();
+
+ $curl_helper =& $this->Application->recallObject('CurlHelper');
+ /* @var $curl_helper kCurlHelper */
+
+ $xml = $curl_helper->Send($this->RateSource);
+
+ xml_parse_into_struct($xml_parser, $xml, $struct, $index);
+ $data_res = Array();
+ foreach($struct as $element)
+ {
+ if(isset($element['attributes']) && isset($element['attributes']['CURRENCY']))
+ {
+ $currency = $element['attributes']['CURRENCY'];
+ $data_res[$currency]['ID'] = $currency;
+ $data_res[$currency]['TARGET'] = 'EUR';
+ $data_res[$currency]['UNITS'] = 1;
+ $data_res[$currency]['RATE'] = ($element['attributes']['RATE'] == 0) ? 0 : 1 / $element['attributes']['RATE'];
+ }
+ }
+ if(!$data_res['EUR'])
+ {
+ $data_res['EUR']['ID'] = 'EUR';
+ $data_res['EUR']['UNITS'] = 1;
+ $data_res['EUR']['TARGET'] = 'EUR';
+ $data_res['EUR']['RATE'] = 1;
+ }
+ $this->ExchangeRates = $data_res;
+ }
+}
Index: branches/5.2.x/units/helpers/bank_lv_currency_rates.php
===================================================================
--- branches/5.2.x/units/helpers/bank_lv_currency_rates.php (nonexistent)
+++ branches/5.2.x/units/helpers/bank_lv_currency_rates.php (revision 14839)
@@ -0,0 +1,65 @@
+<?php
+/**
+* @version $Id: currency_rates.php 14258 2011-03-16 21:43:52Z alex $
+* @package In-Commerce
+* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
+* @license Commercial License
+* This software is protected by copyright law and international treaties.
+* Unauthorized reproduction or unlicensed usage of the code of this program,
+* or any portion of it may result in severe civil and criminal penalties,
+* and will be prosecuted to the maximum extent possible under the law
+* See http://www.in-portal.org/commercial-license for copyright notices and details.
+*/
+
+defined('FULL_PATH') or die('restricted access!');
+
+class BankLVCurrencyRates extends CurrencyRates {
+
+ public function __construct()
+ {
+ $this->RateSource = 'http://www.bank.lv/ValutuKursi/XML/xml.cfm';
+
+ parent::__construct();
+ }
+
+ function GetRatesData()
+ {
+ $xml_parser = xml_parser_create();
+
+ $curl_helper =& $this->Application->recallObject('CurlHelper');
+ /* @var $curl_helper kCurlHelper */
+
+ $xml = $curl_helper->Send($this->RateSource);
+
+ xml_parse_into_struct($xml_parser, $xml, $struct, $index);
+ $data_res = Array();
+ $currency = '';
+ foreach($struct as $element)
+ {
+ switch($element['tag'])
+ {
+ case 'ID':
+ $currency = $element['value'];
+ $data_res[$currency]['ID'] = $currency;
+ $data_res[$currency]['TARGET'] = 'LVL';
+ break;
+ case 'UNITS':
+ $data_res[$currency]['UNITS'] = $element['value'];
+ break;
+ case 'RATE':
+ $data_res[$currency]['RATE'] = $element['value'];
+ break;
+ default:
+ }
+ }
+
+ if(!$data_res['LVL'])
+ {
+ $data_res['LVL']['ID'] = 'LVL';
+ $data_res['LVL']['UNITS'] = 1;
+ $data_res['LVL']['TARGET'] = 'LVL';
+ $data_res['LVL']['RATE'] = 1;
+ }
+ $this->ExchangeRates = $data_res;
+ }
+}
Index: branches/5.2.x/units/helpers/frny_currency_rates.php
===================================================================
--- branches/5.2.x/units/helpers/frny_currency_rates.php (nonexistent)
+++ branches/5.2.x/units/helpers/frny_currency_rates.php (revision 14839)
@@ -0,0 +1,86 @@
+<?php
+/**
+* @version $Id: currency_rates.php 14258 2011-03-16 21:43:52Z alex $
+* @package In-Commerce
+* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
+* @license Commercial License
+* This software is protected by copyright law and international treaties.
+* Unauthorized reproduction or unlicensed usage of the code of this program,
+* or any portion of it may result in severe civil and criminal penalties,
+* and will be prosecuted to the maximum extent possible under the law
+* See http://www.in-portal.org/commercial-license for copyright notices and details.
+*/
+
+defined('FULL_PATH') or die('restricted access!');
+
+class FRNYCurrencyRates extends CurrencyRates {
+
+ public function __construct()
+ {
+ $this->RateSource = 'http://www.ny.frb.org/markets/fxrates/FXtoXML.cfm?FEXdate=%s&FEXtime=1200';
+
+ parent::__construct();
+ }
+
+ function GetRatesData()
+ {
+ $curl_helper =& $this->Application->recallObject('CurlHelper');
+ /* @var $curl_helper kCurlHelper */
+
+ for($i = 0; $i < 10; $i++)
+ {
+ $time = adodb_mktime() - $i * 3600 * 24;
+ $source_file = sprintf($this->RateSource, adodb_date('Y-m-d', $time));
+ $xml = $curl_helper->Send($source_file);
+
+ $xml_parser = xml_parser_create();
+ xml_parse_into_struct($xml_parser, $xml, $struct, $index);
+ foreach($struct as $element)
+ {
+ if($element['tag'] == 'FRBNY:DATASET')
+ {
+ break;
+ }
+ }
+ if($element['type'] == 'open')
+ {
+ break;
+ }
+ }
+ if($element['type'] != 'open')
+ {
+ return false;
+ }
+
+ foreach($struct as $element)
+ {
+ switch($element['tag'])
+ {
+ case 'FRBNY:SERIES':
+ $currency = $element['attributes']['UNIT'];
+ if($currency)
+ {
+ $data_res[$currency]['ID'] = $currency;
+ $data_res[$currency]['UNITS'] = 1;
+ }
+ break;
+ case 'FRBNY:CURR':
+ $data_res[$currency]['TARGET'] = $element['value'];
+ break;
+ case 'FRBNY:OBS_VALUE':
+ $data_res[$currency]['RATE'] = ($element['value'] == 0) ? 0 : 1 / $element['value'];
+ break;
+ default:
+ }
+ }
+ if(!$data_res['USD'])
+ {
+ $data_res['USD']['ID'] = 'USD';
+ $data_res['USD']['UNITS'] = 1;
+ $data_res['USD']['TARGET'] = 'USD';
+ $data_res['USD']['RATE'] = 1;
+ }
+ $this->ExchangeRates = $data_res;
+ }
+
+}
Index: branches/5.2.x/units/helpers/helpers_config.php
===================================================================
--- branches/5.2.x/units/helpers/helpers_config.php (revision 14838)
+++ branches/5.2.x/units/helpers/helpers_config.php (revision 14839)
@@ -1,14 +1,18 @@
<?php
defined('FULL_PATH') or die('restricted access!');
$config = Array (
'Prefix' => 'in-commerce-helpers',
'EventHandlerClass' => Array ('class' => 'kEventHandler', 'file' => '', 'build_event' => 'OnBuild'),
'RegisterClasses' => Array (
Array ('pseudo' => 'OrderHelper', 'class' => 'OrderHelper', 'file' => 'order_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'),
+ Array ('pseudo' => 'CurrencyRates', 'class' => 'CurrencyRates', 'file' => 'currency_rates.php', 'build_event' => ''),
+ Array ('pseudo' => 'BankLVCurrencyRates', 'class' => 'BankLVCurrencyRates', 'file' => 'bank_lv_currency_rates.php', 'require_classes' => 'CurrencyRates', 'build_event' => ''),
+ Array ('pseudo' => 'ECBCurrencyRates', 'class' => 'ECBCurrencyRates', 'file' => 'ecb_currency_rates.php', 'require_classes' => 'CurrencyRates', 'build_event' => ''),
+ Array ('pseudo' => 'FRNYCurrencyRates', 'class' => 'FRNYCurrencyRates', 'file' => 'frny_currency_rates.php', 'require_classes' => 'CurrencyRates', 'build_event' => ''),
),
);
Index: branches/5.2.x/units/helpers/currency_rates.php
===================================================================
--- branches/5.2.x/units/helpers/currency_rates.php (nonexistent)
+++ branches/5.2.x/units/helpers/currency_rates.php (revision 14839)
@@ -0,0 +1,118 @@
+<?php
+/**
+* @version $Id: currency_rates.php 14258 2011-03-16 21:43:52Z alex $
+* @package In-Commerce
+* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
+* @license Commercial License
+* This software is protected by copyright law and international treaties.
+* Unauthorized reproduction or unlicensed usage of the code of this program,
+* or any portion of it may result in severe civil and criminal penalties,
+* and will be prosecuted to the maximum extent possible under the law
+* See http://www.in-portal.org/commercial-license for copyright notices and details.
+*/
+
+defined('FULL_PATH') or die('restricted access!');
+
+class CurrencyRates extends kBase {
+
+ var $RateSource;
+ var $ExchangeRates = Array();
+
+ /**
+ * Creates currency rate update class
+ *
+ * @access public
+ */
+ public function __construct()
+ {
+ parent::__construct();
+
+ $this->GetRatesData();
+ }
+
+ function GetRatesData()
+ {
+ $cache_key = 'currency_rates[%CurrSerial%]';
+ $rates = $this->Application->getCache($cache_key);
+ $primary = $this->Application->GetPrimaryCurrency();
+
+ if ($rates === false) {
+ $this->Conn->nextQueryCachable = true;
+ $sql = 'SELECT ISO, RateToPrimary
+ FROM ' . $this->Application->getUnitOption('curr', 'TableName') . '
+ WHERE Status = ' . STATUS_ACTIVE;
+ $rates = $this->Conn->Query($sql);
+
+ $this->Application->setCache($cache_key, $rates);
+ }
+
+ foreach ($rates as $rate) {
+ $this->SetRate($primary, $rate['ISO'], $rate['RateToPrimary']);
+ }
+ }
+
+ function GetRate($source_cur, $target_cur, $units = 1)
+ {
+ $source_cur = ($source_cur == 'PRIMARY') ? $this->Application->GetPrimaryCurrency() : $source_cur;
+ $target_cur = ($target_cur == 'PRIMARY') ? $this->Application->GetPrimaryCurrency() : $target_cur;
+ if($source_cur == $target_cur)
+ {
+ return 1;
+ }
+
+ if($this->ExchangeRates[$target_cur]['TARGET'] == $source_cur)
+ {
+ $rate = ($this->ExchangeRates[$target_cur]['RATE'] == 0) ? false : 1 / $this->ExchangeRates[$target_cur]['RATE'];
+ }
+ elseif($this->ExchangeRates[$source_cur]['TARGET'] == $target_cur)
+ {
+ $rate = $this->ExchangeRates[$source_cur]['RATE'];
+ }
+ else
+ {
+ $rate = ($this->ExchangeRates[$target_cur]['RATE'] == 0) ? false : $this->ExchangeRates[$source_cur]['RATE'] / $this->ExchangeRates[$target_cur]['RATE'];
+ }
+ $rate *= $units;
+ return $rate;
+ }
+
+ function Convert($amount, $source_cur, $target_cur)
+ {
+ return $amount * $this->GetRate($source_cur, $target_cur);
+ }
+
+ function SetRate($source_cur, $target_cur, $rate, $units = 1)
+ {
+ $this->ExchangeRates[$target_cur]['TARGET'] = $source_cur;
+ $this->ExchangeRates[$target_cur]['ID'] = $target_cur;
+ $this->ExchangeRates[$target_cur]['RATE'] = $rate;
+ $this->ExchangeRates[$target_cur]['UNITS'] = $units;
+ }
+
+ function StoreRates($currencies=null)
+ {
+ $curr_object =& $this->Application->recallObject('curr', null, Array ('skip_autoload' => true));
+ /* @var $curr_object kDBItem */
+
+ if ($currencies) {
+ if (!is_array($currencies)) {
+ $currencies = explode(',', $currencies);
+ }
+ }
+ else {
+ $currencies = array_keys($this->ExchangeRates);
+ }
+
+ foreach ($currencies as $id) {
+ $rate = $this->GetRate($id, 'PRIMARY');
+ if ($rate) {
+ $curr_object->Clear();
+ $curr_object->Load($id, 'ISO');
+ $curr_object->SetDBField('RateToPrimary', $rate);
+ $curr_object->SetDBField('Modified_date', adodb_mktime());
+ $curr_object->SetDBField('Modified_time', adodb_mktime());
+ $curr_object->Update();
+ }
+ }
+ }
+}
Index: branches/5.2.x/units/currencies/currency_rates.php
===================================================================
--- branches/5.2.x/units/currencies/currency_rates.php (revision 14838)
+++ branches/5.2.x/units/currencies/currency_rates.php (nonexistent)
@@ -1,286 +0,0 @@
-<?php
-/**
-* @version $Id$
-* @package In-Commerce
-* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
-* @license Commercial License
-* This software is protected by copyright law and international treaties.
-* Unauthorized reproduction or unlicensed usage of the code of this program,
-* or any portion of it may result in severe civil and criminal penalties,
-* and will be prosecuted to the maximum extent possible under the law
-* See http://www.in-portal.org/commercial-license for copyright notices and details.
-*/
-
-defined('FULL_PATH') or die('restricted access!');
-
-class kCurrencyRates extends kBase {
-
- var $RateSource;
- var $ExchangeRates = Array();
-
- /**
- * Creates currency rate update class
- *
- * @access public
- */
- public function __construct()
- {
- parent::__construct();
-
- $this->GetRatesData();
- }
-
- function GetRatesData()
- {
- $cache_key = 'currency_rates[%CurrSerial%]';
- $rates = $this->Application->getCache($cache_key);
- $primary = $this->Application->GetPrimaryCurrency();
-
- if ($rates === false) {
- $this->Conn->nextQueryCachable = true;
- $sql = 'SELECT ISO, RateToPrimary
- FROM ' . $this->Application->getUnitOption('curr', 'TableName') . '
- WHERE Status = ' . STATUS_ACTIVE;
- $rates = $this->Conn->Query($sql);
-
- $this->Application->setCache($cache_key, $rates);
- }
-
- foreach ($rates as $rate) {
- $this->SetRate($primary, $rate['ISO'], $rate['RateToPrimary']);
- }
- }
-
- function GetRate($source_cur, $target_cur, $units = 1)
- {
- $source_cur = ($source_cur == 'PRIMARY') ? $this->Application->GetPrimaryCurrency() : $source_cur;
- $target_cur = ($target_cur == 'PRIMARY') ? $this->Application->GetPrimaryCurrency() : $target_cur;
- if($source_cur == $target_cur)
- {
- return 1;
- }
-
- if($this->ExchangeRates[$target_cur]['TARGET'] == $source_cur)
- {
- $rate = ($this->ExchangeRates[$target_cur]['RATE'] == 0) ? false : 1 / $this->ExchangeRates[$target_cur]['RATE'];
- }
- elseif($this->ExchangeRates[$source_cur]['TARGET'] == $target_cur)
- {
- $rate = $this->ExchangeRates[$source_cur]['RATE'];
- }
- else
- {
- $rate = ($this->ExchangeRates[$target_cur]['RATE'] == 0) ? false : $this->ExchangeRates[$source_cur]['RATE'] / $this->ExchangeRates[$target_cur]['RATE'];
- }
- $rate *= $units;
- return $rate;
- }
-
- function Convert($amount, $source_cur, $target_cur)
- {
- return $amount * $this->GetRate($source_cur, $target_cur);
- }
-
- function SetRate($source_cur, $target_cur, $rate, $units = 1)
- {
- $this->ExchangeRates[$target_cur]['TARGET'] = $source_cur;
- $this->ExchangeRates[$target_cur]['ID'] = $target_cur;
- $this->ExchangeRates[$target_cur]['RATE'] = $rate;
- $this->ExchangeRates[$target_cur]['UNITS'] = $units;
- }
-
- function StoreRates($currencies=null)
- {
- $curr_object =& $this->Application->recallObject('curr', null, Array ('skip_autoload' => true));
- /* @var $curr_object kDBItem */
-
- if ($currencies) {
- if (!is_array($currencies)) {
- $currencies = explode(',', $currencies);
- }
- }
- else {
- $currencies = array_keys($this->ExchangeRates);
- }
-
- foreach ($currencies as $id) {
- $rate = $this->GetRate($id, 'PRIMARY');
- if ($rate) {
- $curr_object->Clear();
- $curr_object->Load($id, 'ISO');
- $curr_object->SetDBField('RateToPrimary', $rate);
- $curr_object->SetDBField('Modified_date', adodb_mktime());
- $curr_object->SetDBField('Modified_time', adodb_mktime());
- $curr_object->Update();
- }
- }
- }
-}
-
-
-class kBankLVCurrencyRates extends kCurrencyRates {
-
- public function __construct()
- {
- $this->RateSource = 'http://www.bank.lv/ValutuKursi/XML/xml.cfm';
-
- parent::__construct();
- }
-
- function GetRatesData()
- {
- $xml_parser = xml_parser_create();
-
- $curl_helper =& $this->Application->recallObject('CurlHelper');
- /* @var $curl_helper kCurlHelper */
-
- $xml = $curl_helper->Send($this->RateSource);
-
- xml_parse_into_struct($xml_parser, $xml, $struct, $index);
- $data_res = Array();
- $currency = '';
- foreach($struct as $element)
- {
- switch($element['tag'])
- {
- case 'ID':
- $currency = $element['value'];
- $data_res[$currency]['ID'] = $currency;
- $data_res[$currency]['TARGET'] = 'LVL';
- break;
- case 'UNITS':
- $data_res[$currency]['UNITS'] = $element['value'];
- break;
- case 'RATE':
- $data_res[$currency]['RATE'] = $element['value'];
- break;
- default:
- }
- }
-
- if(!$data_res['LVL'])
- {
- $data_res['LVL']['ID'] = 'LVL';
- $data_res['LVL']['UNITS'] = 1;
- $data_res['LVL']['TARGET'] = 'LVL';
- $data_res['LVL']['RATE'] = 1;
- }
- $this->ExchangeRates = $data_res;
- }
-}
-
-
-class kECBCurrencyRates extends kCurrencyRates {
-
- public function __construct()
- {
- $this->RateSource = 'http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml';
-
- parent::__construct();
- }
-
- function GetRatesData()
- {
- $xml_parser = xml_parser_create();
-
- $curl_helper =& $this->Application->recallObject('CurlHelper');
- /* @var $curl_helper kCurlHelper */
-
- $xml = $curl_helper->Send($this->RateSource);
-
- xml_parse_into_struct($xml_parser, $xml, $struct, $index);
- $data_res = Array();
- foreach($struct as $element)
- {
- if(isset($element['attributes']) && isset($element['attributes']['CURRENCY']))
- {
- $currency = $element['attributes']['CURRENCY'];
- $data_res[$currency]['ID'] = $currency;
- $data_res[$currency]['TARGET'] = 'EUR';
- $data_res[$currency]['UNITS'] = 1;
- $data_res[$currency]['RATE'] = ($element['attributes']['RATE'] == 0) ? 0 : 1 / $element['attributes']['RATE'];
- }
- }
- if(!$data_res['EUR'])
- {
- $data_res['EUR']['ID'] = 'EUR';
- $data_res['EUR']['UNITS'] = 1;
- $data_res['EUR']['TARGET'] = 'EUR';
- $data_res['EUR']['RATE'] = 1;
- }
- $this->ExchangeRates = $data_res;
- }
-}
-
-
-class kFRNYCurrencyRates extends kCurrencyRates {
-
- public function __construct()
- {
- $this->RateSource = 'http://www.ny.frb.org/markets/fxrates/FXtoXML.cfm?FEXdate=%s&FEXtime=1200';
-
- parent::__construct();
- }
-
- function GetRatesData()
- {
- $curl_helper =& $this->Application->recallObject('CurlHelper');
- /* @var $curl_helper kCurlHelper */
-
- for($i = 0; $i < 10; $i++)
- {
- $time = adodb_mktime() - $i * 3600 * 24;
- $source_file = sprintf($this->RateSource, adodb_date('Y-m-d', $time));
- $xml = $curl_helper->Send($source_file);
-
- $xml_parser = xml_parser_create();
- xml_parse_into_struct($xml_parser, $xml, $struct, $index);
- foreach($struct as $element)
- {
- if($element['tag'] == 'FRBNY:DATASET')
- {
- break;
- }
- }
- if($element['type'] == 'open')
- {
- break;
- }
- }
- if($element['type'] != 'open')
- {
- return false;
- }
-
- foreach($struct as $element)
- {
- switch($element['tag'])
- {
- case 'FRBNY:SERIES':
- $currency = $element['attributes']['UNIT'];
- if($currency)
- {
- $data_res[$currency]['ID'] = $currency;
- $data_res[$currency]['UNITS'] = 1;
- }
- break;
- case 'FRBNY:CURR':
- $data_res[$currency]['TARGET'] = $element['value'];
- break;
- case 'FRBNY:OBS_VALUE':
- $data_res[$currency]['RATE'] = ($element['value'] == 0) ? 0 : 1 / $element['value'];
- break;
- default:
- }
- }
- if(!$data_res['USD'])
- {
- $data_res['USD']['ID'] = 'USD';
- $data_res['USD']['UNITS'] = 1;
- $data_res['USD']['TARGET'] = 'USD';
- $data_res['USD']['RATE'] = 1;
- }
- $this->ExchangeRates = $data_res;
- }
-
-}
\ No newline at end of file
Property changes on: branches/5.2.x/units/currencies/currency_rates.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3.8.1
\ No newline at end of property
Deleted: svn:eol-style
## -1 +0,0 ##
-LF
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: branches/5.2.x/units/currencies/currencies_config.php
===================================================================
--- branches/5.2.x/units/currencies/currencies_config.php (revision 14838)
+++ branches/5.2.x/units/currencies/currencies_config.php (revision 14839)
@@ -1,153 +1,147 @@
<?php
/**
* @version $Id$
* @package In-Commerce
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license Commercial License
* This software is protected by copyright law and international treaties.
* Unauthorized reproduction or unlicensed usage of the code of this program,
* or any portion of it may result in severe civil and criminal penalties,
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
$config = Array (
'Prefix' => 'curr',
'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
'EventHandlerClass' => Array ('class' => 'CurrenciesEventHandler', 'file' => 'currencies_event_handler.php', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array ('class' => 'CurrenciesTagProcessor', 'file' => 'currencies_tag_processor.php', 'build_event' => 'OnBuild'),
- 'RegisterClasses' => Array (
- Array ('pseudo' => 'kCurrencyRates', 'class' => 'kCurrencyRates', 'file' => 'currency_rates.php', 'build_event' => ''),
- Array ('pseudo' => 'BankLVCurrencyRates', 'class' => 'kBankLVCurrencyRates', 'file' => 'currency_rates.php', 'require_classes' => 'kCurrencyRates', 'build_event' => ''),
- Array ('pseudo' => 'ECBCurrencyRates', 'class' => 'kECBCurrencyRates', 'file' => 'currency_rates.php', 'require_classes' => 'kCurrencyRates', 'build_event' => ''),
- Array ('pseudo' => 'FRNYCurrencyRates', 'class' => 'kFRNYCurrencyRates', 'file' => 'currency_rates.php', 'require_classes' => 'kCurrencyRates', 'build_event' => ''),
- ),
'AutoLoad' => true,
'hooks' => Array (),
'QueryString' => Array (
1 => 'id',
2 => 'Page',
3 => 'PerPage',
4 => 'event',
5 => 'mode',
),
/*'Hooks' => Array (
Array (
'Mode' => hBEFORE,
'Conditional' => true,
'HookToPrefix' => 'tax',
'HookToSpecial' => '',
'HookToEvent' => Array ( 'onEdit' ),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnLoadZoneForm',
),
),*/
'IDField' => 'CurrencyId',
'StatusField' => Array ('Status', 'IsPrimary'),
'TitleField' => 'ISO',
'TitlePresets' => Array (
'default' => Array ( 'new_status_labels' => Array ('curr' => '!la_title_AddingCurrency!'),
'edit_status_labels' => Array ('curr' => '!la_title_EditingCurrency!'),
'new_titlefield' => Array ('curr' => '!la_title_NewCurrency!'),
),
'currencies_list' =>Array ( 'prefixes' => Array ('curr_List'),
'format' => "!la_title_Currencies!",
),
'currencies_edit' =>Array ( 'prefixes' => Array ('curr'),
'new_titlefield' => Array ('curr' => '!la_title_NewCurrency!'),
'format' => "#curr_status# '#curr_titlefield#' - !la_title_General!",
),
),
'PermSection' => Array ('main' => 'in-commerce:currencies'),
'Sections' => Array (
'in-commerce:currencies' => Array (
'parent' => 'in-commerce:setting_folder',
'icon' => 'conf_currencies',
'label' => 'la_tab_Currencies',
'url' => Array ('t' => 'in-commerce/currencies/currencies_list', 'pass' => 'm'),
'permissions' => Array ('view', 'add', 'edit', 'delete', 'advanced:move_up', 'advanced:move_down', 'advanced:update_rate', 'advanced:set_primary'),
'priority' => 3,
'type' => stTREE,
),
),
'TableName' => TABLE_PREFIX.'Currencies',
'AutoDelete' => true,
'AutoClone' => true,
'SubItems' => Array (),
'ListSQLs' => Array (
'' => ' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'Phrase phr ON %1$s.Name = phr.Phrase'
),
'CalculatedFields' => Array (
'' => Array (
'Translation' => 'phr.l%4$s_Translation',
),
),
'ListSortings' => Array (
'' => Array (
'ForcedSorting' => Array ('IsPrimary' => 'desc', 'Priority' => 'desc', 'Status' => 'desc'),
'Sorting' => Array ('ISO' => 'asc'),
)
),
'Fields' => Array (
'CurrencyId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'ISO' => Array ('type' => 'string', 'not_null' => '1', 'default' => ''),
'Symbol' => Array ('type' => 'string', 'default' => null),
'SymbolPosition' => Array ('type' => 'int', 'default' => null, 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_Left', 1 => 'la_Right'), 'use_phrases' => '1'),
'Name' => Array ('type' => 'string', 'not_null' => '1', 'default' => ''),
'RateToPrimary' => Array ('type' => 'float', 'not_null' => 1, 'min_value_exc' => 0, 'formatter' => 'kFormatter', 'format' => '%0.4f', 'default' => 1),
'Modified' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'),
'Status' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter',
'options' => Array ( 1 => 'la_Active', 0 => 'la_Disabled' ), 'use_phrases' => 1,
'not_null' => 1, 'default' => 1,
),
'IsPrimary' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter',
'options' => Array ( 0 => 'la_No', 1 => 'la_Yes', ), 'use_phrases' => 1,
'not_null' => 1, 'default' => 0,
),
'Priority' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
),
'VirtualFields' => Array (
'Translation' => Array ('type' => 'string', 'default' => ''),
),
'Grids' => Array (
'Default' => Array (
'Icons' => Array (
'default' => 'icon16_item.png',
'0_0' => 'icon16_disabled.png',
'0_1' => 'icon16_disabled.png',
'1_0' => 'icon16_item.png',
'1_1' => 'icon16_primary.png',
'module' => 'core',
),
'Fields' => Array (
'CurrencyId' => Array ( 'title' => 'column:la_fld_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 70, ),
'ISO' => Array ( 'title' => 'column:la_fld_ISOCode', 'data_block' => 'currency_caption_td', 'filter_block' => 'grid_like_filter', 'width' => 90, ),
'Translation' => Array ( 'title' => 'column:la_fld_CurrencyName', 'use_phrases' => 1, 'filter_block' => 'grid_like_filter', 'width' => 250, ),
'RateToPrimary' => Array ( 'title' => 'column:la_fld_RateToPrimary', 'filter_block' => 'grid_range_filter', 'width' => 130, ),
'Modified' => Array ( 'title' => 'la_col_LastUpdated', 'filter_block' => 'grid_date_range_filter', 'width' => 150, ),
'Status' => Array ( 'filter_block' => 'grid_options_filter', 'width' => 100, ),
),
),
),
);
\ No newline at end of file

Event Timeline