[*] BO : #PSFV-94 - added AdminLogsController and changed initX() functions to return their result

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9544 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean
2011-10-21 13:40:41 +00:00
parent 2ee064cd1c
commit 365915cb0e
16 changed files with 175 additions and 131 deletions
@@ -0,0 +1,44 @@
{*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision$
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{if $list}
<fieldset>
<legend>{l s='Severity levels'}</legend>
<p>{l s='Meaning of severity levels:'}</p>
<ol>
<li style="color: green;">{l s='Informative only'}</li>
<li style="color: orange;">{l s='Warning'}</li>
<li style="color: orange;">{l s='Error'}</li>
<li style="color: red;">{l s='Major issue (crash)'}</li>
</ol>
</fieldset>
{/if}
{$list}
<br />
<h2>{l s='Logs by e-mail'}</h2>
{$options}
+13 -15
View File
@@ -659,8 +659,8 @@ class AdminControllerCore extends Controller
*/ */
public function displayForm($firstCall = true) public function displayForm($firstCall = true)
{ {
$this->initForm();
$content = ''; $content = '';
$content .= $this->initForm();
$allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0; $allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0;
if ($allow_employee_form_lang && !$this->context->cookie->employee_form_lang) if ($allow_employee_form_lang && !$this->context->cookie->employee_form_lang)
@@ -781,7 +781,6 @@ class AdminControllerCore extends Controller
{ {
$this->context->smarty->assign('display_header',$this->display_header); $this->context->smarty->assign('display_header',$this->display_header);
$this->context->smarty->assign('display_footer',$this->display_footer); $this->context->smarty->assign('display_footer',$this->display_footer);
$this->context->smarty->assign('content', $this->content);
$this->context->smarty->assign('meta_title', $this->meta_title); $this->context->smarty->assign('meta_title', $this->meta_title);
// Template override // Template override
@@ -1030,17 +1029,18 @@ class AdminControllerCore extends Controller
{ {
if (!($this->object = $this->loadObject(true))) if (!($this->object = $this->loadObject(true)))
return; return;
$this->initForm(); $content .= $this->initForm();
} }
else if ($this->display != 'view') else if ($this->display != 'view')
{ {
$this->initList(); $content .= $this->initList();
$this->initOptions(); $content .= $this->initOptions();
} }
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'table' => $this->table, 'table' => $this->table,
'current' => self::$currentIndex, 'current' => self::$currentIndex,
'token' => $this->token, 'token' => $this->token,
'content', $this->content
)); ));
} }
@@ -1073,7 +1073,8 @@ class AdminControllerCore extends Controller
return false; return false;
$this->getList($this->context->language->id); $this->getList($this->context->language->id);
if (!($this->_list && is_array($this->_list))) // Empty list is ok
if (!is_array($this->_list))
return false; return false;
$helper = new HelperList(); $helper = new HelperList();
@@ -1110,7 +1111,7 @@ class AdminControllerCore extends Controller
// For each action, try to add the corresponding skip elements list // For each action, try to add the corresponding skip elements list
$helper->list_skip_actions = $this->list_skip_actions; $helper->list_skip_actions = $this->list_skip_actions;
$this->content .= $helper->generateList($this->_list, $this->fieldsDisplay); return $helper->generateList($this->_list, $this->fieldsDisplay);
} }
/** /**
@@ -1142,11 +1143,8 @@ class AdminControllerCore extends Controller
$this->context->smarty->assign('back', Tools::safeOutput(Tools::getValue(self::$currentIndex.'&token='.$this->token))); $this->context->smarty->assign('back', Tools::safeOutput(Tools::getValue(self::$currentIndex.'&token='.$this->token)));
} }
$this->content .= $helper->generateForm($this->fields_form); return $helper->generateForm($this->fields_form);
} }
// TODO delete when all forms use the helper
// else
// $this->content .= $this->displayForm();
} }
/** /**
@@ -1164,7 +1162,7 @@ class AdminControllerCore extends Controller
$helper->token = $this->token; $helper->token = $this->token;
$helper->table = $this->table; $helper->table = $this->table;
$helper->currentIndex = self::$currentIndex; $helper->currentIndex = self::$currentIndex;
$this->content .= $helper->generateOptions($this->options); return $helper->generateOptions($this->options);
} }
} }
@@ -1792,7 +1790,7 @@ class AdminControllerCore extends Controller
/** /**
* Returns an array with selected shops and type (group or boutique shop) * Returns an array with selected shops and type (group or boutique shop)
* *
* @param string $table * @param string $table
* @param int $id_object * @param int $id_object
*/ */
@@ -2197,10 +2195,10 @@ EOF;
* @param string $ids Multilingual div ids in form * @param string $ids Multilingual div ids in form
* @param string $id Current div id] * @param string $id Current div id]
* @param boolean $use_vars_instead_of_ids use an js vars instead of ids seperate by "¤" * @param boolean $use_vars_instead_of_ids use an js vars instead of ids seperate by "¤"
* *
* @todo : delete return params : * @todo : delete return params :
* @param return define the return way : false for a display, true for a return * @param return define the return way : false for a display, true for a return
* *
* @return string * @return string
*/ */
public function getTranslationsFlags($languages, $default_language, $ids, $id, $return = false, $use_vars_instead_of_ids = false) public function getTranslationsFlags($languages, $default_language, $ids, $id, $return = false, $use_vars_instead_of_ids = false)
@@ -72,7 +72,7 @@ class AdminAddressesControllerCore extends AdminController
foreach ($countries AS $country) foreach ($countries AS $country)
$this->countriesArray[$country['id_country']] = $country['name']; $this->countriesArray[$country['id_country']] = $country['name'];
parent::initList(); return parent::initList();
} }
public function initForm() public function initForm()
@@ -272,7 +272,7 @@ class AdminAddressesControllerCore extends AdminController
// merge address format with the rest of the form // merge address format with the rest of the form
array_splice($this->fields_form['input'], 3, 0, $temp_fields); array_splice($this->fields_form['input'], 3, 0, $temp_fields);
parent::initForm(); return parent::initForm();
} }
public function postProcess() public function postProcess()
+1 -1
View File
@@ -89,7 +89,7 @@ class AdminAliasesControllerCore extends AdminController
$this->fields_value = array('alias' => $this->object->getAliases()); $this->fields_value = array('alias' => $this->object->getAliases());
parent::initForm(); return parent::initForm();
} }
public function postProcess() public function postProcess()
@@ -136,7 +136,7 @@ class AdminCarriersControllerCore extends AdminController
$this->_join = 'LEFT JOIN `'._DB_PREFIX_.'carrier_lang` b ON a.id_carrier = b.id_carrier'; $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'carrier_lang` b ON a.id_carrier = b.id_carrier';
$this->_where = 'AND b.id_lang = '.$this->context->language->id; $this->_where = 'AND b.id_lang = '.$this->context->language->id;
parent::initList(); return parent::initList();
} }
public function initForm() public function initForm()
@@ -357,7 +357,7 @@ class AdminCarriersControllerCore extends AdminController
'class' => 'button' 'class' => 'button'
); );
parent::initForm(); return parent::initForm();
} }
public function postProcess() public function postProcess()
@@ -111,7 +111,7 @@ class AdminContactsControllerCore extends AdminController
) )
); );
parent::initForm(); return parent::initForm();
} }
} }
@@ -116,7 +116,7 @@ class AdminCountriesControllerCore extends AdminController
$this->_select = 'z.`name` AS zone'; $this->_select = 'z.`name` AS zone';
$this->_join = 'LEFT JOIN `'._DB_PREFIX_.'zone` z ON (z.`id_zone` = a.`id_zone`)'; $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'zone` z ON (z.`id_zone` = a.`id_zone`)';
parent::initList(); return parent::initList();
} }
public function initForm() public function initForm()
@@ -353,7 +353,7 @@ class AdminCountriesControllerCore extends AdminController
'class' => 'button' 'class' => 'button'
); );
parent::initForm(); return parent::initForm();
} }
public function postProcess() public function postProcess()
@@ -102,7 +102,7 @@ class AdminEmployeesControllerCore extends AdminController
$this->_join = 'LEFT JOIN `'._DB_PREFIX_.'profile` p ON a.`id_profile` = p.`id_profile` $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'profile` p ON a.`id_profile` = p.`id_profile`
LEFT JOIN `'._DB_PREFIX_.'profile_lang` pl ON (pl.`id_profile` = p.`id_profile` AND pl.`id_lang` = '.(int)$this->context->language->id.')'; LEFT JOIN `'._DB_PREFIX_.'profile_lang` pl ON (pl.`id_profile` = p.`id_profile` AND pl.`id_lang` = '.(int)$this->context->language->id.')';
parent::initList(); return parent::initList();
} }
public function initForm() public function initForm()
@@ -293,7 +293,7 @@ class AdminEmployeesControllerCore extends AdminController
$this->fields_value['shop'][$row['id_shop']][] = $row[$this->identifier]; $this->fields_value['shop'][$row['id_shop']][] = $row[$this->identifier];
} }
parent::initForm(); return parent::initForm();
} }
protected function _childValidation() protected function _childValidation()
+1 -1
View File
@@ -167,7 +167,7 @@ class AdminGendersController extends AdminController
'image' => $obj->getImage() 'image' => $obj->getImage()
); );
parent::initForm(); return parent::initForm();
} }
public function displayGenderType($value, $tr) public function displayGenderType($value, $tr)
@@ -172,7 +172,7 @@ class AdminGroupShopControllerCore extends AdminController
'defaultGroup' => Shop::getInstance(Configuration::get('PS_SHOP_DEFAULT'))->getGroupID() 'defaultGroup' => Shop::getInstance(Configuration::get('PS_SHOP_DEFAULT'))->getGroupID()
)); ));
parent::initForm(); return parent::initForm();
$import_data = array( $import_data = array(
'attribute_group' => $this->l('Attribute groups'), 'attribute_group' => $this->l('Attribute groups'),
@@ -1,6 +1,6 @@
<?php <?php
/* /*
* 2007-2011 PrestaShop * 2007-2011 PrestaShop
* *
* NOTICE OF LICENSE * NOTICE OF LICENSE
* *
@@ -25,63 +25,61 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*/ */
include_once(_PS_ADMIN_DIR_.'/../classes/AdminTab.php'); class AdminLogsControllerCore extends AdminController
class AdminLogs extends AdminTab
{ {
public function __construct() public function __construct()
{ {
$this->table = 'log'; $this->table = 'log';
$this->className = 'Logger'; $this->className = 'Logger';
$this->lang = false; $this->lang = false;
$this->edit = false;
$this->delete = true;
$this->noLink = true; $this->noLink = true;
$this->view = false;
$this->fieldsDisplay = array(
'id_log' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
'severity' => array('title' => $this->l('Severity (1-4)'), 'align' => 'center', 'width' => 50),
'message' => array('title' => $this->l('Message'), 'width' => 377),
'object_type' => array('title' => $this->l('Object type'), 'width' => 75),
'object_id' => array('title' => $this->l('Object ID'), 'width' => 50),
'error_code' => array('title' => $this->l('Error code'), 'width' => 75, 'prefix' => '0x'),
'date_add' => array('title' => $this->l('Date'), 'width' => 35, 'align' => 'right', 'type' => 'datetime'));
$this->optionsList = array( $this->addRowAction('delete');
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
$this->fieldsDisplay = array(
'id_log' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
'severity' => array('title' => $this->l('Severity (1-4)'), 'align' => 'center', 'width' => 50),
'message' => array('title' => $this->l('Message'), 'width' => 377),
'object_type' => array('title' => $this->l('Object type'), 'width' => 75),
'object_id' => array('title' => $this->l('Object ID'), 'width' => 50),
'error_code' => array('title' => $this->l('Error code'), 'width' => 75, 'prefix' => '0x'),
'date_add' => array('title' => $this->l('Date'), 'width' => 35, 'align' => 'right', 'type' => 'datetime')
);
$this->options = array(
'general' => array( 'general' => array(
'title' => $this->l('Logs by e-mail'), 'title' => $this->l('Logs by e-mail'),
'fields' => array( 'fields' => array(
'PS_LOGS_BY_EMAIL' => array( 'PS_LOGS_BY_EMAIL' => array(
'title' => $this->l('Minimum severity level:'), 'title' => $this->l('Minimum severity level:'),
'desc' => $this->l('Put "5" if you don\'t want to receive any emails.').'<br />'.$this->l('Emails will be sent to the shop owner.'), 'desc' => $this->l('Put "5" if you don\'t want to receive any emails.').'<br />'.$this->l('Emails will be sent to the shop owner.'),
'cast' => 'intval', 'cast' => 'intval',
'type' => 'text', 'type' => 'text',
'size' => 5 'size' => 5
), ),
), ),
'submit' => array()
), ),
); );
parent::__construct(); parent::__construct();
} }
public function displayListHeader($token = NULL) /**
{ * Assign smarty variables for all default views, list and form, then call other init functions
echo ' */
<fieldset> public function initContent()
<legend>'.$this->l('Severity levels').'</legend> {
<p>'.$this->l('Here\'s the meaning of severity levels:').'</p> $this->context->smarty->assign(array(
<ol> 'table' => $this->table,
<li style="color: green;">'.$this->l('Informative only').'</li> 'current' => self::$currentIndex,
<li style="color: orange;">'.$this->l('Warning').'</li> 'token' => $this->token,
<li style="color: orange;">'.$this->l('Error').'</li> 'list' => $this->initList(),
<li style="color: red;">'.$this->l('Major issue (crash)').'</li> 'options' => $this->initOptions()
</ol> ));
</fieldset>';
parent::displayListHeader();
} }
} }
?> ?>
+60 -60
View File
@@ -189,7 +189,7 @@ class AdminProductsController extends AdminController
if (Tools::isSubmit('submitAddproduct') || Tools::isSubmit('submitAddproductAndStay') || Tools::isSubmit('submitAddProductAndPreview')) if (Tools::isSubmit('submitAddproduct') || Tools::isSubmit('submitAddproductAndStay') || Tools::isSubmit('submitAddProductAndPreview'))
{ {
$id_product = Tools::getValue('id_product'); $id_product = Tools::getValue('id_product');
if (($id_product && $this->tabAccess['edit'] === '1') if (($id_product && $this->tabAccess['edit'] === '1')
|| ($this->tabAccess['add'] == 1 && Tools::isSubmit('submitAddproduct') && !$id_product) || ($this->tabAccess['add'] == 1 && Tools::isSubmit('submitAddproduct') && !$id_product)
) )
$this->submitAddproduct($token); $this->submitAddproduct($token);
@@ -1370,50 +1370,50 @@ if (false)
{ {
$this->_errors[] = $this->l('the field').' <b>'.$this->l('expiration date').'</b> '.$this->l('is not valid'); $this->_errors[] = $this->l('the field').' <b>'.$this->l('expiration date').'</b> '.$this->l('is not valid');
return false; return false;
} }
} }
} }
// The oos behavior MUST be "Deny orders" for virtual products // The oos behavior MUST be "Deny orders" for virtual products
if (Tools::getValue('out_of_stock') != 0) if (Tools::getValue('out_of_stock') != 0)
{ {
$this->_errors[] = $this->l('The "when out of stock" behavior selection must be "deny order" for virtual products'); $this->_errors[] = $this->l('The "when out of stock" behavior selection must be "deny order" for virtual products');
return false; return false;
} }
// Trick's // Trick's
if ($edit == 1) if ($edit == 1)
{ {
$id_product_download_attibute = ProductDownload::getIdFromIdAttribute((int) $product->id, $id_product_attribute); $id_product_download_attibute = ProductDownload::getIdFromIdAttribute((int) $product->id, $id_product_attribute);
$id_product_download = ($id_product_download_attibute) ? (int) $id_product_download_attibute : (int) Tools::getValue('virtual_product_id'); $id_product_download = ($id_product_download_attibute) ? (int) $id_product_download_attibute : (int) Tools::getValue('virtual_product_id');
} }
$is_shareable = Tools::getValue('virtual_product_is_shareable'); $is_shareable = Tools::getValue('virtual_product_is_shareable');
$virtual_product_name = Tools::getValue('virtual_product_name'); $virtual_product_name = Tools::getValue('virtual_product_name');
$virtual_product_filename = Tools::getValue('virtual_product_filename'); $virtual_product_filename = Tools::getValue('virtual_product_filename');
$virtual_product_nb_days = Tools::getValue('virtual_product_nb_days'); $virtual_product_nb_days = Tools::getValue('virtual_product_nb_days');
$virtual_product_nb_downloable = Tools::getValue('virtual_product_nb_downloable'); $virtual_product_nb_downloable = Tools::getValue('virtual_product_nb_downloable');
$virtual_product_expiration_date = Tools::getValue('virtual_product_expiration_date'); $virtual_product_expiration_date = Tools::getValue('virtual_product_expiration_date');
$is_shareable_attribute = Tools::getValue('virtual_product_is_shareable_attribute'); $is_shareable_attribute = Tools::getValue('virtual_product_is_shareable_attribute');
$virtual_product_name_attribute = Tools::getValue('virtual_product_name_attribute'); $virtual_product_name_attribute = Tools::getValue('virtual_product_name_attribute');
$virtual_product_filename_attribute = Tools::getValue('virtual_product_filename_attribute'); $virtual_product_filename_attribute = Tools::getValue('virtual_product_filename_attribute');
$virtual_product_nb_days_attribute = Tools::getValue('virtual_product_nb_days_attribute'); $virtual_product_nb_days_attribute = Tools::getValue('virtual_product_nb_days_attribute');
$virtual_product_nb_downloable_attribute = Tools::getValue('virtual_product_nb_downloable_attribute'); $virtual_product_nb_downloable_attribute = Tools::getValue('virtual_product_nb_downloable_attribute');
$virtual_product_expiration_date_attribute = Tools::getValue('virtual_product_expiration_date_attribute'); $virtual_product_expiration_date_attribute = Tools::getValue('virtual_product_expiration_date_attribute');
if (!empty($is_shareable_attribute)) if (!empty($is_shareable_attribute))
$is_shareable = $is_shareable_attribute; $is_shareable = $is_shareable_attribute;
if (!empty($virtual_product_name_attribute)) if (!empty($virtual_product_name_attribute))
$virtual_product_name = $virtual_product_name_attribute; $virtual_product_name = $virtual_product_name_attribute;
if (!empty($virtual_product_nb_days_attribute)) if (!empty($virtual_product_nb_days_attribute))
$virtual_product_nb_days = $virtual_product_nb_days_attribute; $virtual_product_nb_days = $virtual_product_nb_days_attribute;
if (!empty($virtual_product_nb_downloable_attribute)) if (!empty($virtual_product_nb_downloable_attribute))
$virtual_product_nb_downloable = $virtual_product_nb_downloable_attribute; $virtual_product_nb_downloable = $virtual_product_nb_downloable_attribute;
if (!empty($virtual_product_expiration_date_attribute)) if (!empty($virtual_product_expiration_date_attribute))
$virtual_product_expiration_date = $virtual_product_expiration_date_attribute; $virtual_product_expiration_date = $virtual_product_expiration_date_attribute;
@@ -1423,7 +1423,7 @@ if (false)
$filename = $virtual_product_filename; $filename = $virtual_product_filename;
else else
$filename = ProductDownload::getNewFilename(); $filename = ProductDownload::getNewFilename();
$download = new ProductDownload($id_product_download); $download = new ProductDownload($id_product_download);
$download->id_product = (int) $product->id; $download->id_product = (int) $product->id;
$download->id_product_attribute = (int) $id_product_attribute; $download->id_product_attribute = (int) $id_product_attribute;
@@ -1435,7 +1435,7 @@ if (false)
$download->nb_downloadable = (int) $virtual_product_nb_downloable; $download->nb_downloadable = (int) $virtual_product_nb_downloable;
$download->active = 1; $download->active = 1;
$download->is_shareable = (int) $is_shareable; $download->is_shareable = (int) $is_shareable;
if ($download->save()) if ($download->save())
return true; return true;
} }
@@ -1449,7 +1449,7 @@ if (false)
} }
else else
$id_product_download = ProductDownload::getIdFromIdProduct($product->id); $id_product_download = ProductDownload::getIdFromIdProduct($product->id);
if (!empty($id_product_download)) if (!empty($id_product_download))
{ {
$productDownload = new ProductDownload($id_product_download); $productDownload = new ProductDownload($id_product_download);
@@ -1460,7 +1460,7 @@ if (false)
} }
return false; return false;
} }
public function deleteDownloadProduct($id_product_attribute = NULL) public function deleteDownloadProduct($id_product_attribute = NULL)
{ {
if (!empty($id_product_attribute)) if (!empty($id_product_attribute))
@@ -1472,7 +1472,7 @@ if (false)
} }
return false; return false;
} }
/** /**
* Update product accessories * Update product accessories
* *
@@ -1527,7 +1527,7 @@ if (false)
$languages = Language::getLanguages(false); $languages = Language::getLanguages(false);
$defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT'));
$product = new Product((int)(Tools::getValue('id_product'))); $product = new Product((int)(Tools::getValue('id_product')));
$this->initForm(); $content .= $this->initForm();
return $this->{'initForm'.$this->action}($product, $languages, $defaultLanguage); return $this->{'initForm'.$this->action}($product, $languages, $defaultLanguage);
} }
} }
@@ -1557,7 +1557,7 @@ if (false)
{ {
// $all_cats[$categ['id_parent']] // $all_cats[$categ['id_parent']]
$categ = new Category($categ['id_category'],$this->context->language->id); $categ = new Category($categ['id_category'],$this->context->language->id);
$select_child .= '<option value="'.$categ->id.'" '.($this->_category->id_category == $categ->id $select_child .= '<option value="'.$categ->id.'" '.($this->_category->id_category == $categ->id
? 'selected="selected" class="selected level-depth-'.$categ->level_depth.'"' ? 'selected="selected" class="selected level-depth-'.$categ->level_depth.'"'
:'class="level-depth-'.$categ->level_depth.'"') :'class="level-depth-'.$categ->level_depth.'"')
.'>' . str_repeat('&nbsp;-&nbsp;',$categ->level_depth). $categ->name .' ('.$categ->id.')</option>'; .'>' . str_repeat('&nbsp;-&nbsp;',$categ->level_depth). $categ->name .' ('.$categ->id.')</option>';
@@ -1581,7 +1581,7 @@ if (false)
} }
parent::initContent(); parent::initContent();
} }
public function ajaxProcessProductManufacturers() public function ajaxProcessProductManufacturers()
{ {
$manufacturers = Manufacturer::getManufacturers(); $manufacturers = Manufacturer::getManufacturers();
@@ -1707,7 +1707,6 @@ if (false)
public function initForm() public function initForm()
{ {
parent::initForm();
$this->addJqueryUI('ui.datepicker'); $this->addJqueryUI('ui.datepicker');
$this->context->smarty->assign('pos_select', (($tab = Tools::getValue('tabs')) ? $tab : '0')); $this->context->smarty->assign('pos_select', (($tab = Tools::getValue('tabs')) ? $tab : '0'));
$this->context->smarty->assign('token',$this->token); $this->context->smarty->assign('token',$this->token);
@@ -1719,6 +1718,7 @@ if (false)
if (!($obj = $this->loadObject(true))) if (!($obj = $this->loadObject(true)))
throw new Exception('object not loaded'); throw new Exception('object not loaded');
$this->_displayDraftWarning($obj->active); $this->_displayDraftWarning($obj->active);
return parent::initForm();
} }
public function displayForm($isMainTab = true) public function displayForm($isMainTab = true)
@@ -1747,14 +1747,14 @@ if (false)
$currency = Tools::setCurrency($this->context->cookie); $currency = Tools::setCurrency($this->context->cookie);
// if ($obj->id) // if ($obj->id)
// self::$currentIndex .= '&id_product='.$obj->id; // self::$currentIndex .= '&id_product='.$obj->id;
// $this->addJqueryPlugin('tabpane'); // $this->addJqueryPlugin('tabpane');
$action = $this->action; $action = $this->action;
if (empty($action) || !method_exists($this,'initForm'.$action)) if (empty($action) || !method_exists($this,'initForm'.$action))
$action = 'informations'; $action = 'informations';
$this->initForm(); $content .= $this->initForm();
$this->{'initForm'.$action}($obj, null); $this->{'initForm'.$action}($obj, null);
/* Tabs */ /* Tabs */
/* /*
@@ -1767,13 +1767,13 @@ switch ($this->action)
*/ */
if (Combination::isFeatureActive()) if (Combination::isFeatureActive())
$smarty->assign('countAttributes', Db::getInstance()->getValue('SELECT COUNT(id_product) FROM '._DB_PREFIX_.'product_attribute WHERE id_product = '.(int)$obj->id)); $smarty->assign('countAttributes', Db::getInstance()->getValue('SELECT COUNT(id_product) FROM '._DB_PREFIX_.'product_attribute WHERE id_product = '.(int)$obj->id));
$smarty->assign('countAttachments', Db::getInstance()->getValue('SELECT COUNT(id_product) FROM '._DB_PREFIX_.'product_attachment WHERE id_product = '.(int)$obj->id)); $smarty->assign('countAttachments', Db::getInstance()->getValue('SELECT COUNT(id_product) FROM '._DB_PREFIX_.'product_attachment WHERE id_product = '.(int)$obj->id));
if (Tools::getValue('id_category') > 1) if (Tools::getValue('id_category') > 1)
{ {
$productIndex = preg_replace('/(&id_product=[0-9]*)/', '', self::$currentIndex); $productIndex = preg_replace('/(&id_product=[0-9]*)/', '', self::$currentIndex);
/** @TODO /** @TODO
$this->content .= ' $this->content .= '
<br /><br /> <br /><br />
<a href="'.$productIndex.($this->token ? '&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)$this->context->employee->id) : '').'"> <a href="'.$productIndex.($this->token ? '&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)$this->context->employee->id) : '').'">
@@ -2206,7 +2206,7 @@ switch ($this->action)
$content .= parent::displayForm(); $content .= parent::displayForm();
$has_attribute = $obj->hasAttributes(); $has_attribute = $obj->hasAttributes();
// @FIXME Stock, need to use StockManagerFactory // @FIXME Stock, need to use StockManagerFactory
$qty = 0; $qty = 0;
$cover = Product::getCover($obj->id); $cover = Product::getCover($obj->id);
$this->_applyTaxToEcotax($obj); $this->_applyTaxToEcotax($obj);
@@ -2222,18 +2222,18 @@ switch ($this->action)
$this->displayInitInformationAndAttachment(); $this->displayInitInformationAndAttachment();
if(!$productDownload->id || !$productDownload->active) if(!$productDownload->id || !$productDownload->active)
$hidden = 'style="display:none;"'; $hidden = 'style="display:none;"';
$cache_default_attribute = (int) $this->getFieldValue($obj, 'cache_default_attribute'); $cache_default_attribute = (int) $this->getFieldValue($obj, 'cache_default_attribute');
$is_virtual = (int) $this->getFieldValue($obj, 'is_virtual'); $is_virtual = (int) $this->getFieldValue($obj, 'is_virtual');
if($is_virtual && $productDownload->active) if($is_virtual && $productDownload->active)
$check = 'checked="checked"'; $check = 'checked="checked"';
if($is_virtual) if($is_virtual)
$virtual = 1; $virtual = 1;
else else
$virtual = 0; $virtual = 0;
$preview_url = ''; $preview_url = '';
if (isset($obj->id)) if (isset($obj->id))
{ {
@@ -2440,7 +2440,7 @@ switch ($this->action)
} }
$content .= '<input type="radio" value="1" id="virtual_good_file_1" name="is_virtual_file" '.$check_yes.'/>'. $this->l('Yes').' $content .= '<input type="radio" value="1" id="virtual_good_file_1" name="is_virtual_file" '.$check_yes.'/>'. $this->l('Yes').'
<input type="radio" value="0" id="virtual_good_file_2" name="is_virtual_file" '.$check_no.'/>'.$this->l('No').'<br /><br />'; <input type="radio" value="0" id="virtual_good_file_2" name="is_virtual_file" '.$check_no.'/>'.$this->l('No').'<br /><br />';
if (!file_exists($exists_file) && !empty($productDownload->display_filename) && empty($cache_default_attribute)) if (!file_exists($exists_file) && !empty($productDownload->display_filename) && empty($cache_default_attribute))
{ {
@@ -2500,7 +2500,7 @@ switch ($this->action)
</div>'; </div>';
if (!$productDownload->id || !$productDownload->active) if (!$productDownload->id || !$productDownload->active)
$hidden = 'display:none;'; $hidden = 'display:none;';
$nb_downloadable = ($productDownload->id > 0) ? $productDownload->nb_downloadable : htmlentities(Tools::getValue('virtual_product_nb_downloable'), ENT_COMPAT, 'UTF-8'); $nb_downloadable = ($productDownload->id > 0) ? $productDownload->nb_downloadable : htmlentities(Tools::getValue('virtual_product_nb_downloable'), ENT_COMPAT, 'UTF-8');
@@ -2681,8 +2681,8 @@ switch ($this->action)
'.($currency->format % 2 != 0 ? ' '.$currency->sign : '').' <input size="11" maxlength="14" id="priceTI" type="text" value="" onchange="noComma(\'priceTI\');" onkeyup="if (isArrowKey(event)) return; calcPriceTE();" />'.($currency->format % 2 == 0 ? ' '.$currency->sign : '').' '.($currency->format % 2 != 0 ? ' '.$currency->sign : '').' <input size="11" maxlength="14" id="priceTI" type="text" value="" onchange="noComma(\'priceTI\');" onkeyup="if (isArrowKey(event)) return; calcPriceTE();" />'.($currency->format % 2 == 0 ? ' '.$currency->sign : '').'
</td> </td>
</tr>'; </tr>';
} }
else else
$content .= '<input size="11" maxlength="14" id="priceTI" type="hidden" value="" onchange="noComma(\'priceTI\');" onkeyup="if (isArrowKey(event)) return; calcPriceTE();" />'; $content .= '<input size="11" maxlength="14" id="priceTI" type="hidden" value="" onchange="noComma(\'priceTI\');" onkeyup="if (isArrowKey(event)) return; calcPriceTE();" />';
$content .= ' $content .= '
@@ -2795,7 +2795,7 @@ switch ($this->action)
</tr> </tr>
'; ';
} }
$content .= ' $content .= '
<tr><td colspan="2" style="padding-bottom:5px;"><hr style="width:100%;" /></td></tr> <tr><td colspan="2" style="padding-bottom:5px;"><hr style="width:100%;" /></td></tr>
<tr> <tr>
@@ -3672,7 +3672,7 @@ switch ($this->action)
return; return;
} }
$content = ''; $content = '';
$attributeJs = array(); $attributeJs = array();
$attributes = Attribute::getAttributes($this->context->language->id, true); $attributes = Attribute::getAttributes($this->context->language->id, true);
foreach ($attributes as $k => $attribute) foreach ($attributes as $k => $attribute)
@@ -3680,12 +3680,12 @@ switch ($this->action)
$currency = $this->context->currency; $currency = $this->context->currency;
$attributes_groups = AttributeGroup::getAttributesGroups($this->context->language->id); $attributes_groups = AttributeGroup::getAttributesGroups($this->context->language->id);
$default_country = new Country((int)Configuration::get('PS_COUNTRY_DEFAULT')); $default_country = new Country((int)Configuration::get('PS_COUNTRY_DEFAULT'));
$productDownload = new ProductDownload(); $productDownload = new ProductDownload();
$id_product_download = (int) $productDownload->getIdFromIdProduct($this->getFieldValue($obj, 'id')); $id_product_download = (int) $productDownload->getIdFromIdProduct($this->getFieldValue($obj, 'id'));
if (!empty($id_product_download)) if (!empty($id_product_download))
$productDownload = new ProductDownload($id_product_download); $productDownload = new ProductDownload($id_product_download);
$images = Image::getImages($this->context->language->id, $obj->id); $images = Image::getImages($this->context->language->id, $obj->id);
if ($obj->id) if ($obj->id)
{ {
@@ -3696,7 +3696,7 @@ switch ($this->action)
updateMvtStatus($(this).val()); updateMvtStatus($(this).val());
}); });
updateMvtStatus($(this).val()); updateMvtStatus($(this).val());
if ( $("input[name=is_virtual_file]:checked").val() == 1) if ( $("input[name=is_virtual_file]:checked").val() == 1)
{ {
$("#virtual_good_attributes").show(); $("#virtual_good_attributes").show();
@@ -3707,7 +3707,7 @@ switch ($this->action)
$("#virtual_good_attributes").hide(); $("#virtual_good_attributes").hide();
$("#is_virtual_file_product").hide(); $("#is_virtual_file_product").hide();
} }
$("input[name=is_virtual_file]").live("change", function() { $("input[name=is_virtual_file]").live("change", function() {
if($(this).val() == "1") if($(this).val() == "1")
{ {
@@ -3720,7 +3720,7 @@ switch ($this->action)
$("#is_virtual_file_product").hide(); $("#is_virtual_file_product").hide();
} }
}); });
}); });
</script> </script>
<table cellpadding="5"> <table cellpadding="5">
<tr> <tr>
@@ -3759,7 +3759,7 @@ switch ($this->action)
<select id="product_att_list" name="attribute_combinaison_list[]" multiple="multiple" size="4" style="width: 320px;"></select> <select id="product_att_list" name="attribute_combinaison_list[]" multiple="multiple" size="4" style="width: 320px;"></select>
</td> </td>
</tr> </tr>
<tr><td colspan="2"><hr style="width:100%;" /></td></tr> <tr><td colspan="2"><hr style="width:100%;" /></td></tr>
<tr> <tr>
<td style="width:150px;vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;">'.$this->l('Reference:').'</td> <td style="width:150px;vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;">'.$this->l('Reference:').'</td>
@@ -3781,7 +3781,7 @@ switch ($this->action)
<tr><td colspan="2"><hr style="width:100%;" /></td></tr> <tr><td colspan="2"><hr style="width:100%;" /></td></tr>
<table cellpadding="5" id="virtual_good_attributes" style="width:100%;display:none;"> <table cellpadding="5" id="virtual_good_attributes" style="width:100%;display:none;">
<tr> <tr>
<td colspan="2"> <td colspan="2">
<div style="padding:5px;width:50%;float:left;margin-right:20px;border-right:1px solid #E0D0B1"> <div style="padding:5px;width:50%;float:left;margin-right:20px;border-right:1px solid #E0D0B1">
<p>'.$this->l('Your server\'s maximum upload file size is') . ':&nbsp;' . ini_get('upload_max_filesize').'</p> <p>'.$this->l('Your server\'s maximum upload file size is') . ':&nbsp;' . ini_get('upload_max_filesize').'</p>
<label id="virtual_product_file_attribute_label" for="virtual_product_file_attribute" class="t">'.$this->l('Upload a file').'</label> <label id="virtual_product_file_attribute_label" for="virtual_product_file_attribute" class="t">'.$this->l('Upload a file').'</label>
@@ -3790,13 +3790,13 @@ switch ($this->action)
$content .= '<p id="gethtmlink" style="display: none;">'.$this->l('This is the link').':&nbsp;'.$productDownload->getHtmlLink(false, true).' $content .= '<p id="gethtmlink" style="display: none;">'.$this->l('This is the link').':&nbsp;'.$productDownload->getHtmlLink(false, true).'
<a id="make_downloadable_product_attribute" onclick="return confirm(\''.addslashes($this->l('Delete this file')).'\')" href="'.$_SERVER['HTTP_REFERER'].'&deleteVirtualProductAttribute=true'.'" class="red">'.$this->l('Delete this file').'</a></p>'; <a id="make_downloadable_product_attribute" onclick="return confirm(\''.addslashes($this->l('Delete this file')).'\')" href="'.$_SERVER['HTTP_REFERER'].'&deleteVirtualProductAttribute=true'.'" class="red">'.$this->l('Delete this file').'</a></p>';
$content .= '</div> $content .= '</div>
<a id="delete_downloadable_product_attribute" style="display:none;" onclick="return confirm(\''.addslashes($this->l('Delete this file')).'\')" href="'.$_SERVER['HTTP_REFERER'].'&deleteVirtualProductAttribute=true" class="red">'.$this->l('Delete this file').'</a>'; <a id="delete_downloadable_product_attribute" style="display:none;" onclick="return confirm(\''.addslashes($this->l('Delete this file')).'\')" href="'.$_SERVER['HTTP_REFERER'].'&deleteVirtualProductAttribute=true" class="red">'.$this->l('Delete this file').'</a>';
if ($up_filename = strval(Tools::getValue('virtual_product_filename_attribute'))) if ($up_filename = strval(Tools::getValue('virtual_product_filename_attribute')))
$content .= '<input type="hidden" id="virtual_product_filename_attribute" name="virtual_product_filename_attribute" value="'.$up_filename.'" />'; $content .= '<input type="hidden" id="virtual_product_filename_attribute" name="virtual_product_filename_attribute" value="'.$up_filename.'" />';
$content .= '<p class="block"> $content .= '<p class="block">
<label for="virtual_product_name" class="t">'.$this->l('Filename').'</label> <label for="virtual_product_name" class="t">'.$this->l('Filename').'</label>
<input id="virtual_product_name_attribute" name="virtual_product_name_attribute" style="width:200px" value="" type="text"> <input id="virtual_product_name_attribute" name="virtual_product_name_attribute" style="width:200px" value="" type="text">
@@ -3969,7 +3969,7 @@ switch ($this->action)
<th>'.$this->l('UPC').'</th> <th>'.$this->l('UPC').'</th>
<th class="center">'.$this->l('Quantity').'</th>'; <th class="center">'.$this->l('Quantity').'</th>';
if ($id_product_download && !empty($productDownload->display_filename)) if ($id_product_download && !empty($productDownload->display_filename))
{ {
$content .= ' $content .= '
@@ -3978,7 +3978,7 @@ switch ($this->action)
<th class="center virtual_header">'.$this->l('Number of days').'</th> <th class="center virtual_header">'.$this->l('Number of days').'</th>
<th class="center virtual_header">'.$this->l('Share').'</th>'; <th class="center virtual_header">'.$this->l('Share').'</th>';
} }
$content .= '<th class="center">'.$this->l('Actions').'</th> $content .= '<th class="center">'.$this->l('Actions').'</th>
</tr>'; </tr>';
if ($obj->id) if ($obj->id)
@@ -4035,12 +4035,12 @@ switch ($this->action)
$id_product_download = $productDownload->getIdFromIdAttribute((int) $obj->id, (int) $id_product_attribute); $id_product_download = $productDownload->getIdFromIdAttribute((int) $obj->id, (int) $id_product_attribute);
if ($id_product_download) if ($id_product_download)
$productDownload = new ProductDownload($id_product_download); $productDownload = new ProductDownload($id_product_download);
$available_date_attribute = substr($productDownload->date_expiration, 0, -9); $available_date_attribute = substr($productDownload->date_expiration, 0, -9);
if ($available_date_attribute == '0000-00-00') if ($available_date_attribute == '0000-00-00')
$available_date_attribute = ''; $available_date_attribute = '';
if ($productDownload->is_shareable == 1) if ($productDownload->is_shareable == 1)
$is_shareable = $this->l('Yes'); $is_shareable = $this->l('Yes');
else else
@@ -4055,7 +4055,7 @@ switch ($this->action)
<td class="right">'.$product_attribute['ean13'].'</td> <td class="right">'.$product_attribute['ean13'].'</td>
<td class="right">'.$product_attribute['upc'].'</td> <td class="right">'.$product_attribute['upc'].'</td>
<td class="center">'.$product_attribute['quantity'].'</td>'; <td class="center">'.$product_attribute['quantity'].'</td>';
if ($id_product_download && !empty($productDownload->display_filename)) if ($id_product_download && !empty($productDownload->display_filename))
{ {
$content .= '<td class="right">'.$productDownload->getHtmlLink(false, true).'</td> $content .= '<td class="right">'.$productDownload->getHtmlLink(false, true).'</td>
@@ -4063,19 +4063,19 @@ switch ($this->action)
<td class="center">'.$productDownload->nb_downloadable.'</td> <td class="center">'.$productDownload->nb_downloadable.'</td>
<td class="right">'.$is_shareable.'</td>'; <td class="right">'.$is_shareable.'</td>';
} }
$exists_file = realpath(_PS_DOWNLOAD_DIR_).'/'.$productDownload->filename; $exists_file = realpath(_PS_DOWNLOAD_DIR_).'/'.$productDownload->filename;
if ($productDownload->id && file_exists($exists_file)) if ($productDownload->id && file_exists($exists_file))
$filename = $productDownload->filename; $filename = $productDownload->filename;
else else
$filename = ''; $filename = '';
$content .= '<td class="center"> $content .= '<td class="center">
<a style="cursor: pointer;"> <a style="cursor: pointer;">
<img src="../img/admin/edit.gif" alt="'.$this->l('Modify this combination').'" <img src="../img/admin/edit.gif" alt="'.$this->l('Modify this combination').'"
onclick="javascript:fillCombinaison(\''.$product_attribute['wholesale_price'].'\', \''.$product_attribute['price'].'\', \''.$product_attribute['weight'].'\', \''.$product_attribute['unit_impact'].'\', \''.$product_attribute['reference'].'\', \''.$product_attribute['supplier_reference'].'\', \''.$product_attribute['ean13'].'\', onclick="javascript:fillCombinaison(\''.$product_attribute['wholesale_price'].'\', \''.$product_attribute['price'].'\', \''.$product_attribute['weight'].'\', \''.$product_attribute['unit_impact'].'\', \''.$product_attribute['reference'].'\', \''.$product_attribute['supplier_reference'].'\', \''.$product_attribute['ean13'].'\',
\''.$product_attribute['quantity'].'\', \''.($attrImage ? $attrImage->id : 0).'\', Array('.$jsList.'), \''.$id_product_attribute.'\', \''.$product_attribute['default_on'].'\', \''.$product_attribute['ecotax'].'\', \''.$product_attribute['location'].'\', \''.$product_attribute['upc'].'\', \''.$product_attribute['minimal_quantity'].'\', \''.$available_date.'\', \''.$product_attribute['quantity'].'\', \''.($attrImage ? $attrImage->id : 0).'\', Array('.$jsList.'), \''.$id_product_attribute.'\', \''.$product_attribute['default_on'].'\', \''.$product_attribute['ecotax'].'\', \''.$product_attribute['location'].'\', \''.$product_attribute['upc'].'\', \''.$product_attribute['minimal_quantity'].'\', \''.$available_date.'\',
\''.$productDownload->display_filename.'\', \''.$filename.'\', \''.$productDownload->nb_downloadable.'\', \''.$available_date_attribute.'\', \''.$productDownload->nb_days_accessible.'\', \''.$productDownload->is_shareable.'\'); calcImpactPriceTI();" /></a>&nbsp; \''.$productDownload->display_filename.'\', \''.$filename.'\', \''.$productDownload->nb_downloadable.'\', \''.$available_date_attribute.'\', \''.$productDownload->nb_days_accessible.'\', \''.$productDownload->is_shareable.'\'); calcImpactPriceTI();" /></a>&nbsp;
'.(!$product_attribute['default_on'] ? '<a href="'.self::$currentIndex.'&defaultProductAttribute&id_product_attribute='.$id_product_attribute.'&id_product='.$obj->id.'&'.(Tools::isSubmit('id_category') ? 'id_category='.(int)(Tools::getValue('id_category')).'&' : '&').'token='.Tools::getAdminToken('AdminProducts'.(int)(Tab::getIdFromClassName('AdminProducts')).$this->context->employee->id).'"> '.(!$product_attribute['default_on'] ? '<a href="'.self::$currentIndex.'&defaultProductAttribute&id_product_attribute='.$id_product_attribute.'&id_product='.$obj->id.'&'.(Tools::isSubmit('id_category') ? 'id_category='.(int)(Tools::getValue('id_category')).'&' : '&').'token='.Tools::getAdminToken('AdminProducts'.(int)(Tab::getIdFromClassName('AdminProducts')).$this->context->employee->id).'">
<img src="../img/admin/asterisk.gif" alt="'.$this->l('Make this the default combination').'" title="'.$this->l('Make this combination the default one').'"></a>' : '').' <img src="../img/admin/asterisk.gif" alt="'.$this->l('Make this the default combination').'" title="'.$this->l('Make this combination the default one').'"></a>' : '').'
+2 -2
View File
@@ -63,7 +63,7 @@ class AdminShopUrlControllerCore extends AdminController
$this->_select = 's.name AS shop_name, CONCAT(a.physical_uri, a.virtual_uri) AS uri'; $this->_select = 's.name AS shop_name, CONCAT(a.physical_uri, a.virtual_uri) AS uri';
$this->_join = 'LEFT JOIN `'._DB_PREFIX_.'shop` s ON (s.id_shop = a.id_shop)'; $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'shop` s ON (s.id_shop = a.id_shop)';
parent::initList(); return parent::initList();
} }
public function initForm() public function initForm()
@@ -194,7 +194,7 @@ class AdminShopUrlControllerCore extends AdminController
'physical_uri' => Validate::isLoadedObject($obj) ? $this->getFieldValue($obj, 'physical_uri') : $current_shop->physical_uri 'physical_uri' => Validate::isLoadedObject($obj) ? $this->getFieldValue($obj, 'physical_uri') : $current_shop->physical_uri
); );
parent::initForm(); return parent::initForm();
} }
public function postProcess() public function postProcess()
+2 -2
View File
@@ -59,7 +59,7 @@ class AdminStatesControllerCore extends AdminController
$this->_select = 'z.`name` AS zone'; $this->_select = 'z.`name` AS zone';
$this->_join = 'LEFT JOIN `'._DB_PREFIX_.'zone` z ON (z.`id_zone` = a.`id_zone`)'; $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'zone` z ON (z.`id_zone` = a.`id_zone`)';
parent::initList(); return parent::initList();
} }
public function initForm() public function initForm()
@@ -143,7 +143,7 @@ class AdminStatesControllerCore extends AdminController
) )
); );
parent::initForm(); return parent::initForm();
} }
public function postProcess() public function postProcess()
+2 -2
View File
@@ -126,7 +126,7 @@ class AdminStoresControllerCore extends AdminController
LEFT JOIN `'._DB_PREFIX_.'state` st LEFT JOIN `'._DB_PREFIX_.'state` st
ON (st.`id_state` = a.`id_state`)'; ON (st.`id_state` = a.`id_state`)';
parent::initList(); return parent::initList();
} }
public function initForm() public function initForm()
@@ -291,7 +291,7 @@ class AdminStoresControllerCore extends AdminController
'hours' => isset($hours_unserialized) ? $hours_unserialized : false 'hours' => isset($hours_unserialized) ? $hours_unserialized : false
); );
parent::initForm(); return parent::initForm();
} }
public function postProcess() public function postProcess()
@@ -79,6 +79,8 @@ class AdminWarehousesControllerCore extends AdminController
$this->_join = 'LEFT JOIN `'._DB_PREFIX_.'employee` e ON (e.id_employee = a.id_employee) $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'employee` e ON (e.id_employee = a.id_employee)
LEFT JOIN `'._DB_PREFIX_.'address` ad ON (ad.id_address = a.id_address) LEFT JOIN `'._DB_PREFIX_.'address` ad ON (ad.id_address = a.id_address)
LEFT JOIN `'._DB_PREFIX_.'country` c ON (c.id_country = ad.id_country)'; LEFT JOIN `'._DB_PREFIX_.'country` c ON (c.id_country = ad.id_country)';
return parent::initList();
} }
public function initForm() public function initForm()
@@ -262,6 +264,8 @@ class AdminWarehousesControllerCore extends AdminController
'class' => 'button' 'class' => 'button'
) )
); );
return parent::initForm();
} }
public function postProcess() public function postProcess()