Skip to content
This repository has been archived by the owner on Nov 12, 2019. It is now read-only.

Commit

Permalink
[-] BO : remove deprecated parameter when call Tools::displayDate()
Browse files Browse the repository at this point in the history
  • Loading branch information
vAugagneur committed May 20, 2013
1 parent ec87deb commit 3328c7a
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions classes/AdminTab.php
Expand Up @@ -1676,9 +1676,9 @@ public function displayListContent($token = NULL)
elseif (isset($params['float']))
echo rtrim(rtrim($tr[$key], '0'), '.');
elseif (isset($params['type']) && $params['type'] == 'date')
echo Tools::displayDate($tr[$key], $this->context->language->id);
echo Tools::displayDate($tr[$key]);
elseif (isset($params['type']) && $params['type'] == 'datetime')
echo Tools::displayDate($tr[$key], $this->context->language->id, true);
echo Tools::displayDate($tr[$key],null , true);
elseif (isset($tr[$key]))
{
if ($key == 'price')
Expand Down
2 changes: 1 addition & 1 deletion classes/PaymentModule.php
Expand Up @@ -595,7 +595,7 @@ public function validateOrder($id_cart, $id_order_state, $amount_paid, $payment_
'{invoice_phone}' => ($invoice->phone) ? $invoice->phone : $invoice->phone_mobile,
'{invoice_other}' => $invoice->other,
'{order_name}' => $order->getUniqReference(),
'{date}' => Tools::displayDate(date('Y-m-d H:i:s'), (int)$order->id_lang, 1),
'{date}' => Tools::displayDate(date('Y-m-d H:i:s'),null , 1),
'{carrier}' => $virtual_product ? Tools::displayError('No carrier') : $carrier->name,
'{payment}' => Tools::substr($order->payment, 0, 32),
'{products}' => $this->formatProductAndVoucherForEmail($products_list),
Expand Down
4 changes: 2 additions & 2 deletions classes/Tools.php
Expand Up @@ -598,7 +598,7 @@ public static function convertPriceFull($amount, Currency $currency_from = null,
*/
public static function dateFormat($params, &$smarty)
{
return Tools::displayDate($params['date'], Context::getContext()->language->id, (isset($params['full']) ? $params['full'] : false));
return Tools::displayDate($params['date'], null, (isset($params['full']) ? $params['full'] : false));
}

/**
Expand Down Expand Up @@ -1852,7 +1852,7 @@ public static function displayParameterAsDeprecated($parameter)
{
$backtrace = debug_backtrace();
$callee = next($backtrace);
$error = 'Parameter <b>'.$parameter.'</b> in function <b>'.$callee['function'].'()</b> is deprecated in <b>'.$callee['file'].'</b> on line <b>'.$callee['Line'].'</b><br />';
$error = 'Parameter <b>'.$parameter.'</b> in function <b>'.(isset($callee['function']) ? $callee['function'] : '').'()</b> is deprecated in <b>'.$callee['file'].'</b> on line <b>'.$callee['Line'].'</b><br />';
$message = 'The parameter '.$parameter.' in function '.$callee['function'].' (Line '.$callee['Line'].') is deprecated and will be removed in the next major version.';
$class = isset($callee['class']) ? $callee['class'] : null;

Expand Down
4 changes: 2 additions & 2 deletions classes/helper/HelperList.php
Expand Up @@ -282,9 +282,9 @@ public function displayListContent()
$this->_list[$index][$key] = Tools::displayPrice($tr[$key], $currency, false);
}
elseif (isset($params['type']) && $params['type'] == 'date')
$this->_list[$index][$key] = Tools::displayDate($tr[$key], $this->context->language->id);
$this->_list[$index][$key] = Tools::displayDate($tr[$key]);
elseif (isset($params['type']) && $params['type'] == 'datetime')
$this->_list[$index][$key] = Tools::displayDate($tr[$key], $this->context->language->id, true);
$this->_list[$index][$key] = Tools::displayDate($tr[$key],null , true);
elseif (isset($tr[$key]))
{
$echo = $tr[$key];
Expand Down
2 changes: 1 addition & 1 deletion classes/order/OrderHistory.php
Expand Up @@ -123,7 +123,7 @@ public function changeIdOrderState($new_order_state, $id_order, $use_existing_pa
.'&secure_key='.$order->secure_key;
$assign[$key]['link'] = $dl_link;
if (isset($virtual_product['date_expiration']) && $virtual_product['date_expiration'] != '0000-00-00 00:00:00')
$assign[$key]['deadline'] = Tools::displayDate($virtual_product['date_expiration '], $order->id_lang);
$assign[$key]['deadline'] = Tools::displayDate($virtual_product['date_expiration ']);
if ($product_download->nb_downloadable != 0)
$assign[$key]['downloadable'] = (int)$product_download->nb_downloadable;
}
Expand Down
2 changes: 1 addition & 1 deletion classes/pdf/HTMLTemplateDeliverySlip.php
Expand Up @@ -38,7 +38,7 @@ public function __construct(OrderInvoice $order_invoice, $smarty)
$this->smarty = $smarty;

// header informations
$this->date = Tools::displayDate($this->order->invoice_date, (int)$this->order->id_lang);
$this->date = Tools::displayDate($this->order->invoice_date);
$this->title = HTMLTemplateDeliverySlip::l('Delivery').' #'.Configuration::get('PS_DELIVERY_PREFIX', Context::getContext()->language->id).sprintf('%06d', $this->order_invoice->delivery_number);

// footer informations
Expand Down
2 changes: 1 addition & 1 deletion classes/pdf/HTMLTemplateInvoice.php
Expand Up @@ -39,7 +39,7 @@ public function __construct(OrderInvoice $order_invoice, $smarty)
$this->smarty = $smarty;

// header informations
$this->date = Tools::displayDate($order_invoice->date_add, (int)$this->order->id_lang);
$this->date = Tools::displayDate($order_invoice->date_add);

$id_lang = Context::getContext()->language->id;
$this->title = HTMLTemplateInvoice::l('Invoice ').' #'.Configuration::get('PS_INVOICE_PREFIX', $id_lang, null, (int)$this->order->id_shop).sprintf('%06d', $order_invoice->number);
Expand Down
2 changes: 1 addition & 1 deletion classes/pdf/HTMLTemplateOrderReturn.php
Expand Up @@ -39,7 +39,7 @@ public function __construct(OrderReturn $order_return, $smarty)
$this->order = new Order($order_return->id_order);

// header informations
$this->date = Tools::displayDate($this->order->invoice_date, (int)$this->order->id_lang);
$this->date = Tools::displayDate($this->order->invoice_date);
$this->title = HTMLTemplateOrderReturn::l('Order Return ').sprintf('%06d', $this->order_return->id);

// footer informations
Expand Down
4 changes: 2 additions & 2 deletions controllers/admin/AdminCustomerThreadsController.php
Expand Up @@ -557,7 +557,7 @@ public function renderView()
$products = $customer->getBoughtProducts();
if ($products && count($products))
foreach ($products as $key => $product)
$products[$key]['date_add'] = Tools::displayDate($product['date_add'], $this->context->language->id, true);
$products[$key]['date_add'] = Tools::displayDate($product['date_add'],null , true);
}

foreach ($messages as $key => $message)
Expand Down Expand Up @@ -595,7 +595,7 @@ protected function displayMessage($message, $email = false, $id_employee = null)
if (!empty($message['id_product']) && empty($message['employee_name']))
$id_order_product = Order::getIdOrderProduct((int)$message['id_customer'], (int)$message['id_product']);
}
$message['date_add'] = Tools::displayDate($message['date_add'], $this->context->language->id, true);
$message['date_add'] = Tools::displayDate($message['date_add'],null , true);
$message['user_agent'] = strip_tags($message['user_agent']);
$message['message'] = preg_replace(
'/(https?:\/\/[a-z0-9#%&_=\(\)\.\? \+\-@\/]{6,1000})([\s\n<])/Uui',
Expand Down
18 changes: 9 additions & 9 deletions controllers/admin/AdminCustomersController.php
Expand Up @@ -555,7 +555,7 @@ public function renderView()
$total_orders = count($orders);
for ($i = 0; $i < $total_orders; $i++)
{
$orders[$i]['date_add'] = Tools::displayDate($orders[$i]['date_add'], $this->context->language->id);
$orders[$i]['date_add'] = Tools::displayDate($orders[$i]['date_add']);
$orders[$i]['total_paid_real_not_formated'] = $orders[$i]['total_paid_real'];
$orders[$i]['total_paid_real'] = Tools::displayPrice($orders[$i]['total_paid_real'], new Currency((int)$orders[$i]['id_currency']));
}
Expand All @@ -565,7 +565,7 @@ public function renderView()
for ($i = 0; $i < $total_messages; $i++)
{
$messages[$i]['message'] = substr(strip_tags(html_entity_decode($messages[$i]['message'], ENT_NOQUOTES, 'UTF-8')), 0, 75);
$messages[$i]['date_add'] = Tools::displayDate($messages[$i]['date_add'], $this->context->language->id, true);
$messages[$i]['date_add'] = Tools::displayDate($messages[$i]['date_add'], null, true);
}

$groups = $customer->getGroups();
Expand Down Expand Up @@ -598,7 +598,7 @@ public function renderView()
$products = $customer->getBoughtProducts();
$total_products = count($products);
for ($i = 0; $i < $total_products; $i++)
$products[$i]['date_add'] = Tools::displayDate($products[$i]['date_add'], $this->default_form_language, true);
$products[$i]['date_add'] = Tools::displayDate($products[$i]['date_add'], null, true);

$carts = Cart::getCustomerCarts($customer->id);
$total_carts = count($carts);
Expand All @@ -610,7 +610,7 @@ public function renderView()
$currency = new Currency((int)$carts[$i]['id_currency']);
$carrier = new Carrier((int)$carts[$i]['id_carrier']);
$carts[$i]['id_cart'] = sprintf('%06d', $carts[$i]['id_cart']);
$carts[$i]['date_add'] = Tools::displayDate($carts[$i]['date_add'], $this->default_form_language, true);
$carts[$i]['date_add'] = Tools::displayDate($carts[$i]['date_add'], null, true);
$carts[$i]['total_price'] = Tools::displayPrice($summary['total_price'], $currency);
$carts[$i]['name'] = $carrier->name;
}
Expand Down Expand Up @@ -646,7 +646,7 @@ public function renderView()
$total_connections = count($connections);
for ($i = 0; $i < $total_connections; $i++)
{
$connections[$i]['date_add'] = Tools::displayDate($connections[$i]['date_add'], $this->default_form_language, true);
$connections[$i]['date_add'] = Tools::displayDate($connections[$i]['date_add'],null , true);
$connections[$i]['http_referer'] = $connections[$i]['http_referer'] ?
preg_replace('/^www./', '', parse_url($connections[$i]['http_referer'], PHP_URL_HOST)) :
$this->l('Direct link');
Expand All @@ -655,22 +655,22 @@ public function renderView()
$referrers = Referrer::getReferrers($customer->id);
$total_referrers = count($referrers);
for ($i = 0; $i < $total_referrers; $i++)
$referrers[$i]['date_add'] = Tools::displayDate($referrers[$i]['date_add'], $this->default_form_language, true);
$referrers[$i]['date_add'] = Tools::displayDate($referrers[$i]['date_add'],null , true);

$shop = new Shop($customer->id_shop);
$this->tpl_view_vars = array(
'customer' => $customer,
'gender_image' => $gender_image,

// General information of the customer
'registration_date' => Tools::displayDate($customer->date_add, $this->default_form_language, true),
'registration_date' => Tools::displayDate($customer->date_add,null , true),
'customer_stats' => $customer_stats,
'last_visit' => Tools::displayDate($customer_stats['last_visit'], $this->default_form_language, true),
'last_visit' => Tools::displayDate($customer_stats['last_visit'],null , true),
'count_better_customers' => $count_better_customers,
'shop_is_feature_active' => Shop::isFeatureActive(),
'name_shop' => $shop->name,
'customer_birthday' => Tools::displayDate($customer->birthday, $this->default_form_language),
'last_update' => Tools::displayDate($customer->date_upd, $this->default_form_language, true),
'last_update' => Tools::displayDate($customer->date_upd,null , true),
'customer_exists' => Customer::customerExists($customer->email),
'id_lang' => $customer->id_lang,
'customerLanguage' => (new Language($customer->id_lang)),
Expand Down
6 changes: 3 additions & 3 deletions controllers/admin/AdminSupplyOrdersController.php
Expand Up @@ -1877,9 +1877,9 @@ public function renderView()
'supply_order_warehouse' => (Validate::isLoadedObject($warehouse) ? $warehouse->name : ''),
'supply_order_reference' => $supply_order->reference,
'supply_order_supplier_name' => $supply_order->supplier_name,
'supply_order_creation_date' => Tools::displayDate($supply_order->date_add, $lang_id, false),
'supply_order_last_update' => Tools::displayDate($supply_order->date_upd, $lang_id, false),
'supply_order_expected' => Tools::displayDate($supply_order->date_delivery_expected, $lang_id, false),
'supply_order_creation_date' => Tools::displayDate($supply_order->date_add,null , false),
'supply_order_last_update' => Tools::displayDate($supply_order->date_upd,null , false),
'supply_order_expected' => Tools::displayDate($supply_order->date_delivery_expected,null , false),
'supply_order_discount_rate' => Tools::ps_round($supply_order->discount_rate, 2),
'supply_order_total_te' => Tools::displayPrice($supply_order->total_te, $currency),
'supply_order_discount_value_te' => Tools::displayPrice($supply_order->discount_value_te, $currency),
Expand Down
2 changes: 1 addition & 1 deletion controllers/front/ContactController.php
Expand Up @@ -281,7 +281,7 @@ protected function assignOrderList()
$tmp = $order->getProducts();
foreach ($tmp as $key => $val)
$products[$row['id_order']][$val['product_id']] = array('value' => $val['product_id'], 'label' => $val['product_name']);
$orders[] = array('value' => $order->id, 'label' => $order->getUniqReference().' - '.Tools::displayDate($date[0], $this->context->language->id), 'selected' => (int)Tools::getValue('id_order') == $order->id);
$orders[] = array('value' => $order->id, 'label' => $order->getUniqReference().' - '.Tools::displayDate($date[0],null , 'selected' => (int)Tools::getValue('id_order') == $order->id);
}

$this->context->smarty->assign('orderList', $orders);
Expand Down
2 changes: 1 addition & 1 deletion modules/blocklayered/blocklayered.php
Expand Up @@ -1757,7 +1757,7 @@ public function getContent()
<td>'.(int)$filters_template['id_layered_filter'].'</td>
<td style="text-align: left; padding-left: 10px; width: 270px;">'.$filters_template['name'].'</td>
<td style="text-align: center;">'.(int)$filters_template['n_categories'].'</td>
<td>'.Tools::displayDate($filters_template['date_add'], (int)$cookie->id_lang, true).'</td>
<td>'.Tools::displayDate($filters_template['date_add'],null , true).'</td>
<td>
<a href="#" onclick="return updElements('.($filters_template['n_categories'] ? 0 : 1).', '.(int)$filters_template['id_layered_filter'].');">
<img src="../img/admin/edit.gif" alt="" title="'.$this->l('Edit').'" /></a>
Expand Down
2 changes: 1 addition & 1 deletion modules/referralprogram/referralprogram.php
Expand Up @@ -580,7 +580,7 @@ public function hookAdminCustomers($params)
<td class="center">'.((int)($friend['id_customer']) ? $friend['id_customer'] : '--').'</td>
<td>'.$friend['firstname'].' '.$friend['lastname'].'</td>
<td>'.$friend['email'].'</td>
<td>'.Tools::displayDate($friend['date_add'], $this->context->language->id, true).'</td>
<td>'.Tools::displayDate($friend['date_add'],null , true).'</td>
<td align="right">'.sizeof(ReferralProgramModule::getSponsorFriend($friend['id_customer'])).'</td>
<td align="right">'.($orders ? sizeof($orders) : 0).'</td>
<td align="center">'.((int)$friend['id_customer'] ? '<img src="'._PS_ADMIN_IMG_.'enabled.gif" />' : '<img src="'._PS_ADMIN_IMG_.'disabled.gif" />').'</td>
Expand Down
2 changes: 1 addition & 1 deletion modules/statsproduct/statsproduct.php
Expand Up @@ -200,7 +200,7 @@ public function hookAdminStatsModules($params)
foreach ($sales as $sale)
$this->html .= '
<tr>
<td>'.Tools::displayDate($sale['date_add'], (int)$this->context->language->id, false).'</td>
<td>'.Tools::displayDate($sale['date_add'],null , false).'</td>
<td align="center"><a href="?tab=AdminOrders&id_order='.$sale['id_order'].'&vieworder&token='.$tokenOrder.'">'.(int)($sale['id_order']).'</a></td>
<td align="center"><a href="?tab=AdminCustomers&id_customer='.$sale['id_customer'].'&viewcustomer&token='.$tokenCustomer.'">'.(int)($sale['id_customer']).'</a></td>
'.($hasAttribute ? '<td>'.$sale['product_name'].'</td>' : '').'
Expand Down

0 comments on commit 3328c7a

Please sign in to comment.