Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development

This commit is contained in:
Rémi Gaillard
2013-06-27 15:41:57 +02:00
8 changed files with 50 additions and 16 deletions
+5 -2
View File
@@ -60,13 +60,16 @@ class HTMLTemplateDeliverySlipCore extends HTMLTemplate
$invoice_address = new Address((int)$this->order->id_address_invoice);
$formatted_invoice_address = AddressFormat::generateAddress($invoice_address, array(), '<br />', ' ');
}
$carrier = new Carrier($this->order->id_carrier);
$carrier->name = ($carrier->name == '0' ? Configuration::get('PS_SHOP_NAME') : $carrier->name);
$this->smarty->assign(array(
'order' => $this->order,
'order_details' => $this->order_invoice->getProducts(),
'delivery_address' => $formatted_delivery_address,
'invoice_address' => $formatted_invoice_address,
'order_invoice' => $this->order_invoice
'order_invoice' => $this->order_invoice,
'carrier' => $carrier
));
return $this->smarty->fetch($this->getTemplate('delivery-slip'));
+4 -2
View File
@@ -89,7 +89,8 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
$tax_exempt = Configuration::get('VATNUMBER_MANAGEMENT')
&& !empty($address->vat_number)
&& $address->id_country != Configuration::get('VATNUMBER_COUNTRY');
$carrier = new Carrier($this->order->id_carrier);
$this->smarty->assign(array(
'tax_exempt' => $tax_exempt,
'use_one_after_another_method' => $this->order_invoice->useOneAfterAnotherTaxComputationMethod(),
@@ -98,7 +99,8 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
'ecotax_tax_breakdown' => $this->order_invoice->getEcoTaxTaxesBreakdown(),
'wrapping_tax_breakdown' => $this->order_invoice->getWrappingTaxesBreakdown(),
'order' => $this->order,
'order_invoice' => $this->order_invoice
'order_invoice' => $this->order_invoice,
'carrier' => $carrier
));
return $this->smarty->fetch($this->getTemplate('invoice.tax-tab'));
+1 -1
View File
@@ -36,7 +36,7 @@ function smartyTranslate($params, &$smarty)
{
$htmlentities = !isset($params['js']);
$pdf = isset($params['pdf']);
$addslashes = isset($params['slashes']);
$addslashes = (isset($params['slashes']) || isset($params['js']));
$sprintf = isset($params['sprintf']) ? $params['sprintf'] : false;
if ($pdf)
+18 -1
View File
@@ -220,11 +220,28 @@ class AdminCmsControllerCore extends AdminController
$this->displayListFooter($token);
}
public function postProcess()
/**
* Modifying initial getList method to display position feature (drag and drop)
*/
public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false)
{
if (Tools::isSubmit($this->table.'Orderby') || Tools::isSubmit($this->table.'Orderway'))
$this->filter = true;
if ($order_by && $this->context->cookie->__get($this->table.'Orderby'))
$order_by = $this->context->cookie->__get($this->table.'Orderby');
else
$order_by = 'position';
if (is_null($order_way))
$order_way = Tools::getValue($this->table.'Orderway', 'ASC');
parent::getList($id_lang, $order_by, $order_way, $start, $limit, $id_lang_shop);
}
public function postProcess()
{
if (Tools::isSubmit('viewcms') && ($id_cms = (int)Tools::getValue('id_cms')) && ($cms = new CMS($id_cms, $this->context->language->id)) && Validate::isLoadedObject($cms))
{
$redir = $this->context->link->getCMSLink($cms);
@@ -404,7 +404,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
$contact = new Contact((int)$ct->id_contact);
if (Validate::isLoadedObject($contact))
{
$from_name = $contact->name;
$from_name = $contact->name[(int)$ct->id_lang];
$from_email = $contact->email;
}
else
@@ -805,4 +805,4 @@ class AdminCustomerThreadsControllerCore extends AdminController
die('{"hasError" : false, "errors" : ["'.$str_errors.$str_error_delete.'"]}');
}
}
}
}
@@ -43,12 +43,14 @@ function p1540_add_missing_columns()
if ($id_module)
{
$list_fields = Db::getInstance()->executeS('SHOW FIELDS FROM `'._DB_PREFIX_.'layered_product_attribute`');
foreach ($list_fields as $k => $field)
$list_fields[$k] = $field['Field'];
if (!in_array('id_shop', $list_fields))
if (!Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'layered_product_attribute` ADD `id_shop` INT( 10 ) UNSIGNED NOT NULL DEFAULT "1" AFTER `id_attribute_group`'))
$errors[] = Db::getInstance()->getMsgError();
if(is_array($list_fields))
{
foreach ($list_fields as $k => $field)
$list_fields[$k] = $field['Field'];
if (!in_array('id_shop', $list_fields))
if (!Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'layered_product_attribute` ADD `id_shop` INT( 10 ) UNSIGNED NOT NULL DEFAULT "1" AFTER `id_attribute_group`'))
$errors[] = Db::getInstance()->getMsgError();
}
}
$key_exists = Db::getInstance()->executeS('SHOW INDEX FROM `'._DB_PREFIX_.'stock_available` WHERE KEY_NAME = "product_sqlstock"');;
+7 -2
View File
@@ -71,7 +71,7 @@
<!-- PRODUCTS TAB -->
<table style="width: 100%">
<tr>
<td style="width: 20%; padding-right: 7px; text-align: right; vertical-align: top">
<td style="width: 22%; padding-right: 7px; text-align: right; vertical-align: top">
<!-- CUSTOMER INFORMATIONS -->
<b>{l s='Order Number:' pdf='true'}</b><br />
{$order->getUniqReference()}<br />
@@ -93,9 +93,14 @@
{/foreach}
</table>
<br />
{if isset($carrier)}
<b>{l s='Carrier:' pdf='true'}</b><br />
{$carrier->name}<br />
<br />
{/if}
<!-- / CUSTOMER INFORMATIONS -->
</td>
<td style="width: 80%; text-align: right">
<td style="width: 78%; text-align: right">
<table style="width: 100%">
<tr style="line-height:6px;">
<td style="text-align: left; background-color: #4D4D4D; color: #FFF; padding-left: 10px; font-weight: bold; width: 60%">{l s='ITEMS TO BE DELIVERED' pdf='true'}</td>
+5
View File
@@ -92,6 +92,11 @@
{/foreach}
</table>
<br />
{if isset($carrier)}
<b>{l s='Carrier:' pdf='true'}</b><br />
{$carrier->name}<br />
<br />
{/if}
<!-- / CUSTOMER INFORMATION -->
</td>
<td style="width: 85%; text-align: right">