// Context part 25
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7794 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -29,7 +29,7 @@ class AdminDiscounts extends AdminTab
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$context = Context::getContext();
|
||||
$this->context = Context::getContext();
|
||||
$this->table = 'discount';
|
||||
$this->className = 'Discount';
|
||||
$this->lang = true;
|
||||
@@ -42,10 +42,10 @@ class AdminDiscounts extends AdminTab
|
||||
$this->_join = 'LEFT JOIN `'._DB_PREFIX_.'currency` c ON (c.`id_currency` = a.`id_currency`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'discount_type` dt ON (dt.`id_discount_type` = a.`id_discount_type`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'shop` s ON (s.`id_shop` = a.`id_shop`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'discount_type_lang` dtl ON (dt.`id_discount_type` = dtl.`id_discount_type` AND dtl.`id_lang` = '.(int)$context->language->id.')';
|
||||
LEFT JOIN `'._DB_PREFIX_.'discount_type_lang` dtl ON (dt.`id_discount_type` = dtl.`id_discount_type` AND dtl.`id_lang` = '.(int)$this->context->language->id.')';
|
||||
|
||||
$typesArray = array();
|
||||
$types = Discount::getDiscountTypes($context->language->id);
|
||||
$types = Discount::getDiscountTypes($this->context->language->id);
|
||||
foreach ($types AS $type)
|
||||
$typesArray[$type['id_discount_type']] = $type['name'];
|
||||
|
||||
@@ -179,7 +179,6 @@ class AdminDiscounts extends AdminTab
|
||||
|
||||
public function displayForm($isMainTab = true)
|
||||
{
|
||||
$context = Context::getContext();
|
||||
parent::displayForm();
|
||||
|
||||
if (!($obj = $this->loadObject(true)))
|
||||
@@ -231,7 +230,7 @@ class AdminDiscounts extends AdminTab
|
||||
<div class="margin-form">
|
||||
<select name="id_discount_type" id="id_discount_type" onchange="free_shipping()">
|
||||
<option value="0">'.$this->l('-- Choose --').'</option>';
|
||||
$discountTypes = Discount::getDiscountTypes($context->language->id);
|
||||
$discountTypes = Discount::getDiscountTypes($this->context->language->id);
|
||||
foreach ($discountTypes AS $discountType)
|
||||
echo '<option value="'.(int)($discountType['id_discount_type']).'"'.
|
||||
(($this->getFieldValue($obj, 'id_discount_type') == $discountType['id_discount_type']) ? ' selected="selected"' : '').'>'.$discountType['name'].'</option>';
|
||||
@@ -283,7 +282,7 @@ class AdminDiscounts extends AdminTab
|
||||
$done = array();
|
||||
$index = array();
|
||||
$indexedCategories = isset($_POST['categoryBox']) ? $_POST['categoryBox'] : ($obj->id ? Discount::getCategories($obj->id) : array());
|
||||
$categories = Category::getCategories($context->language->id, false);
|
||||
$categories = Category::getCategories($this->context->language->id, false);
|
||||
foreach ($indexedCategories AS $k => $row)
|
||||
$index[] = $row['id_category'];
|
||||
$this->recurseCategoryForInclude((int)(Tools::getValue($this->identifier)), $index, $categories, $categories[0][1], 1, $obj->id);
|
||||
|
||||
Reference in New Issue
Block a user