// Context part 12
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7649 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -95,5 +95,4 @@ $context->link = $link;
|
||||
$context->language = $language;
|
||||
$context->currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
|
||||
$context->country = $defaultCountry;
|
||||
$context->smarty = $smarty;
|
||||
$context->shop = new Shop(Shop::getContextID());
|
||||
@@ -550,7 +550,7 @@ class AdminCustomerThreads extends AdminTab
|
||||
<td align="center"><a href="?tab=AdminOrders&id_order='.$order['id_order'].'&vieworder&token='.$tokenOrders.'"><img src="../img/admin/details.gif" /></a></td>
|
||||
</tr>';
|
||||
echo '</table>
|
||||
<h3 style="color:green;font-weight:700;margin-top:10px">'.$this->l('Validated Orders:').' '.$countOK.' '.$this->l('for').' '.Tools::displayPrice($totalOK, new Currency(Configuration::get('PS_CURRENCY_DEFAULT'))).'</h3>
|
||||
<h3 style="color:green;font-weight:700;margin-top:10px">'.$this->l('Validated Orders:').' '.$countOK.' '.$this->l('for').' '.Tools::displayPrice($totalOK, $context->currency).'</h3>
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -330,7 +330,7 @@ class AdminOrders extends AdminTab
|
||||
$this->_errors[] = Tools::displayError('Cannot generate voucher');
|
||||
else
|
||||
{
|
||||
$currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
|
||||
$currency = $context->currency;
|
||||
$params['{voucher_amount}'] = Tools::displayPrice($voucher->value, $currency, false);
|
||||
$params['{voucher_num}'] = $voucher->name;
|
||||
@Mail::Send((int)($order->id_lang), 'voucher', Mail::l('New voucher regarding your order'), $params, $customer->email, $customer->firstname.' '.$customer->lastname);
|
||||
@@ -472,7 +472,7 @@ class AdminOrders extends AdminTab
|
||||
$messages = Message::getMessagesByOrderId($order->id, true);
|
||||
$states = OrderState::getOrderStates($context->language->id);
|
||||
$currency = new Currency($order->id_currency);
|
||||
$currentLanguage = new Language($context->language->id);
|
||||
$currentLanguage = $context->language;
|
||||
$currentState = OrderHistory::getLastOrderState($order->id);
|
||||
$sources = ConnectionsSource::getOrderSources($order->id);
|
||||
$cart = Cart::getCartByOrderId($order->id);
|
||||
|
||||
@@ -451,8 +451,7 @@ class AdminPreferences extends AdminTab
|
||||
break;
|
||||
|
||||
case 'price':
|
||||
$default_currency = new Currency((int)(Configuration::get("PS_CURRENCY_DEFAULT")));
|
||||
echo $default_currency->getSign('left').'<input type="'.$field['type'].'" size="'.(isset($field['size']) ? (int)($field['size']) : 5).'" name="'.$key.'" value="'.($field['type'] == 'password' ? '' : htmlentities($val, ENT_COMPAT, 'UTF-8')).'" '.(($isDisabled) ? 'disabled="disabled"' : '').' />'.$default_currency->getSign('right').' '.$this->l('(tax excl.)');
|
||||
echo $context->currency->getSign('left').'<input type="'.$field['type'].'" size="'.(isset($field['size']) ? (int)($field['size']) : 5).'" name="'.$key.'" value="'.($field['type'] == 'password' ? '' : htmlentities($val, ENT_COMPAT, 'UTF-8')).'" '.(($isDisabled) ? 'disabled="disabled"' : '').' />'.$context->currency->getSign('right').' '.$this->l('(tax excl.)');
|
||||
break;
|
||||
|
||||
case 'textLang':
|
||||
|
||||
@@ -1522,7 +1522,7 @@ class AdminProducts extends AdminTab
|
||||
if (!($obj = $this->loadObject(true)))
|
||||
return;
|
||||
|
||||
$currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
|
||||
$currency = $context->currency;
|
||||
|
||||
if ($obj->id)
|
||||
self::$currentIndex .= '&id_product='.$obj->id;
|
||||
@@ -3126,7 +3126,7 @@ class AdminProducts extends AdminTab
|
||||
$attributes = Attribute::getAttributes($context->language->id, true);
|
||||
foreach ($attributes AS $k => $attribute)
|
||||
$attributeJs[$attribute['id_attribute_group']][$attribute['id_attribute']] = $attribute['name'];
|
||||
$currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
|
||||
$currency = $context->currency;
|
||||
$attributes_groups = AttributeGroup::getAttributesGroups($context->language->id);
|
||||
|
||||
|
||||
|
||||
@@ -440,8 +440,8 @@ class AdminReferrers extends AdminTab
|
||||
|
||||
public function displayListContent($token = NULL)
|
||||
{
|
||||
$context = Context::getContext();
|
||||
$irow = 0;
|
||||
$currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
|
||||
if ($this->_list)
|
||||
foreach ($this->_list AS $tr)
|
||||
{
|
||||
@@ -452,7 +452,7 @@ class AdminReferrers extends AdminTab
|
||||
{
|
||||
echo '<td onclick="showProductLines('.$id.');" class="pointer '.(isset($params['align']) ? $params['align'] : '').'">'.(isset($params['prefix']) ? $params['prefix'] : '');
|
||||
if (isset($tr[$key]) AND isset($params['price']))
|
||||
echo Tools::displayPrice($tr[$key], $currency);
|
||||
echo Tools::displayPrice($tr[$key], $context->currency);
|
||||
elseif (isset($tr[$key]))
|
||||
echo $tr[$key];
|
||||
else
|
||||
|
||||
@@ -190,7 +190,6 @@ class AdminSearch extends AdminTab
|
||||
{
|
||||
$context = Context::getContext();
|
||||
self::$currentIndex = 'index.php';
|
||||
$currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
|
||||
$query = trim(Tools::getValue('bo_query'));
|
||||
$nbCategories = $nbProducts = $nbCustomers = 0;
|
||||
|
||||
@@ -223,7 +222,7 @@ class AdminSearch extends AdminTab
|
||||
<td align="center">'.($product['manufacturer_name'] != NULL ? stripslashes($product['manufacturer_name']) : '--').'</td>
|
||||
<td>'.$product['reference'].'</td>
|
||||
<td><a href="'.self::$currentIndex.'?tab=AdminCatalog&id_product='.$product['id_product'].'&addproduct&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)$context->employee->id).'">'.stripslashes($product['nameh']).'</a></td>
|
||||
<td>'.Tools::displayPrice($product['price'], $currency).'</td>
|
||||
<td>'.Tools::displayPrice($product['price'], $context->currency).'</td>
|
||||
<td>'.stripslashes($product['tax_name']).'</td>
|
||||
<td align="center">'.$product['quantity'].'</td>
|
||||
<td align="center">'.$product['weight'].' '.Configuration::get('PS_WEIGHT_UNIT').'</td>
|
||||
|
||||
@@ -33,11 +33,9 @@ class AdminShipping extends AdminTab
|
||||
public function __construct()
|
||||
{
|
||||
$this->table = 'delivery';
|
||||
$currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
|
||||
|
||||
$this->_fieldsHandling = array(
|
||||
'PS_SHIPPING_HANDLING' => array('title' => $this->l('Handling charges'), 'suffix' => $currency, 'validation' => 'isPrice', 'cast' => 'floatval'),
|
||||
'PS_SHIPPING_FREE_PRICE' => array('title' => $this->l('Free shipping starts at'), 'suffix' => $currency, 'validation' => 'isPrice', 'cast' => 'floatval'),
|
||||
'PS_SHIPPING_HANDLING' => array('title' => $this->l('Handling charges'), 'suffix' => $context->currency, 'validation' => 'isPrice', 'cast' => 'floatval'),
|
||||
'PS_SHIPPING_FREE_PRICE' => array('title' => $this->l('Free shipping starts at'), 'suffix' => $context->currency, 'validation' => 'isPrice', 'cast' => 'floatval'),
|
||||
'PS_SHIPPING_FREE_WEIGHT' => array('title' => $this->l('Free shipping starts at'), 'suffix' => Configuration::get('PS_WEIGHT_UNIT'), 'validation' => 'isUnsignedFloat', 'cast' => 'floatval'),
|
||||
'PS_SHIPPING_METHOD' => array('title' => $this->l('Billing'), 'validation' => 'isBool', 'cast' => 'intval'));
|
||||
|
||||
@@ -193,7 +191,7 @@ class AdminShipping extends AdminTab
|
||||
{
|
||||
$carrierArray = array();
|
||||
$id_carrier = Tools::getValue('id_carrier');
|
||||
$carriers = Carrier::getCarriers((int)(Configuration::get('PS_LANG_DEFAULT')), true , false,false, NULL, PS_CARRIERS_AND_CARRIER_MODULES_NEED_RANGE);
|
||||
$carriers = Carrier::getCarriers(Configuration::get('PS_LANG_DEFAULT'), true , false,false, NULL, PS_CARRIERS_AND_CARRIER_MODULES_NEED_RANGE);
|
||||
foreach ($carriers AS $carrier)
|
||||
if (!$carrier['is_free'])
|
||||
$carrierArray[] = array(
|
||||
@@ -227,8 +225,7 @@ class AdminShipping extends AdminTab
|
||||
<tr>
|
||||
<th>'.$this->l('Zone / Range').'</th>';
|
||||
|
||||
$currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
|
||||
|
||||
$currency = $context->currency;
|
||||
$rangeObj = $carrierSelected->getRangeObject();
|
||||
$rangeTable = $carrierSelected->getRangeTable();
|
||||
$suffix = $carrierSelected->getRangeSuffix();
|
||||
|
||||
@@ -149,7 +149,6 @@ class AdminTracking extends AdminTab
|
||||
'status' => array('title' => $this->l('Status')),
|
||||
'action' => array('title' => $this->l('Actions'))
|
||||
));
|
||||
$currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
|
||||
echo '
|
||||
<table class="table" cellpadding="0" cellspacing="0">
|
||||
<tr>';
|
||||
@@ -169,7 +168,7 @@ class AdminTracking extends AdminTab
|
||||
<td align="center">'.($product->manufacturer_name != NULL ? stripslashes($product->manufacturer_name) : '--').'</td>
|
||||
<td>'.$product->reference.'</td>
|
||||
<td><a href="index.php?tab=AdminCatalog&id_product='.$product->id.'&addproduct&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)$context->employee->id).'">'.stripslashes($product->name).'</a></td>
|
||||
<td>'.Tools::displayPrice($product->getPrice(), $currency).'</td>
|
||||
<td>'.Tools::displayPrice($product->getPrice(), $context->currency).'</td>
|
||||
<td>'.(float)$taxrate.'% </td>
|
||||
<td align="center">'.$product->quantity.'</td>
|
||||
<td align="center">'.$product->weight.' '.Configuration::get('PS_WEIGHT_UNIT').'</td>
|
||||
@@ -209,7 +208,6 @@ class AdminTracking extends AdminTab
|
||||
'action' => array('title' => $this->l('Actions'))
|
||||
));
|
||||
|
||||
$currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
|
||||
echo '
|
||||
<table class="table" cellpadding="0" cellspacing="0">
|
||||
<tr>';
|
||||
@@ -241,7 +239,7 @@ class AdminTracking extends AdminTab
|
||||
<td align="center">'.($prod['manufacturer_name'] != NULL ? stripslashes($prod['manufacturer_name']) : '--').'</td>
|
||||
<td>'.$prod['reference'].'</td>
|
||||
<td><a href="index.php?tab=AdminCatalog&id_product='.$prod['id_product'].'&addproduct&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)$context->employee->id).'">'.stripslashes($prod['name']).' ('.$prod['combination_name'].')'.'</a></td>
|
||||
<td>'.Tools::displayPrice(Product::getPriceStatic((int)($prod['id_product']), true, $prod['id_product_attribute']), $currency).'</td>
|
||||
<td>'.Tools::displayPrice(Product::getPriceStatic((int)($prod['id_product']), true, $prod['id_product_attribute']), $context->currency).'</td>
|
||||
<td>'.(float)$taxrate.'% </td>
|
||||
<td align="center">'.$prod['quantity'].'</td>
|
||||
<td align="center">'.($prod['weight'] + $prod['product_weight']).' '.Configuration::get('PS_WEIGHT_UNIT').'</td>
|
||||
|
||||
Reference in New Issue
Block a user