[*] BO : #PSFV-94 - changes to helpers
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9500 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -46,7 +46,6 @@
|
|||||||
<li>{l s='Always check your data.'}</li>
|
<li>{l s='Always check your data.'}</li>
|
||||||
<li>{l s='Never restore a Backup on a live site.'}</li>
|
<li>{l s='Never restore a Backup on a live site.'}</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
{if $show_form}
|
{if $show_form}
|
||||||
<form action="{$current}&add{$table}&token={$token}" method="post" style="text-align: center;">
|
<form action="{$current}&add{$table}&token={$token}" method="post" style="text-align: center;">
|
||||||
<input type="submit" class="button" value="{l s='I read the disclaimer - Create a new Backup'}" style="padding: 10px; font-weight: bold; border: 1px solid;" />
|
<input type="submit" class="button" value="{l s='I read the disclaimer - Create a new Backup'}" style="padding: 10px; font-weight: bold; border: 1px solid;" />
|
||||||
|
|||||||
+102
-101
@@ -77,7 +77,11 @@ class AdminControllerCore extends Controller
|
|||||||
/** @var array Errors displayed after post processing */
|
/** @var array Errors displayed after post processing */
|
||||||
public $_errors = array();
|
public $_errors = array();
|
||||||
|
|
||||||
protected $list_display;
|
/** @var array list to be generated */
|
||||||
|
protected $fieldsDisplay;
|
||||||
|
|
||||||
|
/** @var array edit form to be generated */
|
||||||
|
protected $fields_form;
|
||||||
|
|
||||||
/** @var array list of option forms to be generated */
|
/** @var array list of option forms to be generated */
|
||||||
protected $options;
|
protected $options;
|
||||||
@@ -187,6 +191,9 @@ class AdminControllerCore extends Controller
|
|||||||
/** @var string Image type */
|
/** @var string Image type */
|
||||||
public $imageType = 'jpg';
|
public $imageType = 'jpg';
|
||||||
|
|
||||||
|
/** @var instanciation of the class associated with the AdminController */
|
||||||
|
protected $object;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
// retro-compatibility : className for admin without controller
|
// retro-compatibility : className for admin without controller
|
||||||
@@ -271,7 +278,7 @@ class AdminControllerCore extends Controller
|
|||||||
// no need to use displayConf() here
|
// no need to use displayConf() here
|
||||||
if (!empty($action) && method_exists($this, 'ajaxProcess'.Tools::toCamelCase($action)))
|
if (!empty($action) && method_exists($this, 'ajaxProcess'.Tools::toCamelCase($action)))
|
||||||
$this->{'ajaxProcess'.Tools::toCamelCase($action)}();
|
$this->{'ajaxProcess'.Tools::toCamelCase($action)}();
|
||||||
else if (method_exists($this, 'ajaxProcess'))
|
else if (method_exists($this, 'ajaxProcess'))
|
||||||
$this->ajaxProcess();
|
$this->ajaxProcess();
|
||||||
|
|
||||||
// @TODO We should use a displayAjaxError
|
// @TODO We should use a displayAjaxError
|
||||||
@@ -290,6 +297,7 @@ class AdminControllerCore extends Controller
|
|||||||
|
|
||||||
// Sub included tab postProcessing
|
// Sub included tab postProcessing
|
||||||
$this->includeSubTab('postProcess', array('status', 'submitAdd1', 'submitDel', 'delete', 'submitFilter', 'submitReset'));
|
$this->includeSubTab('postProcess', array('status', 'submitAdd1', 'submitDel', 'delete', 'submitFilter', 'submitReset'));
|
||||||
|
|
||||||
switch ($this->action)
|
switch ($this->action)
|
||||||
{
|
{
|
||||||
/* Delete object image */
|
/* Delete object image */
|
||||||
@@ -1009,111 +1017,26 @@ class AdminControllerCore extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* initContent
|
* Assign smarty variables for all default views, list and form, then call other init functions
|
||||||
* Assign smarty variables for all default views, list and form
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public function initContent()
|
public function initContent()
|
||||||
{
|
{
|
||||||
$this->context->smarty->assign(array(
|
|
||||||
'current' => self::$currentIndex,
|
|
||||||
'token' => $this->token,
|
|
||||||
'table' => $this->table
|
|
||||||
));
|
|
||||||
|
|
||||||
if ($this->display == 'edit' || $this->display == 'add')
|
if ($this->display == 'edit' || $this->display == 'add')
|
||||||
{
|
{
|
||||||
if (!($obj = $this->loadObject(true)))
|
if (!($this->object = $this->loadObject(true)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// init form declaration
|
|
||||||
$this->initForm();
|
$this->initForm();
|
||||||
|
|
||||||
if (isset($this->fields_form))
|
|
||||||
{
|
|
||||||
$this->getlanguages();
|
|
||||||
$helper = new HelperForm();
|
|
||||||
// Check if form template has been overriden
|
|
||||||
if (file_exists($this->context->smarty->template_dir[0].'/'.$this->tpl_folder.'form.tpl'))
|
|
||||||
$helper->tpl = $this->tpl_folder.'form.tpl';
|
|
||||||
$helper->currentIndex = self::$currentIndex;
|
|
||||||
$helper->token = $this->token;
|
|
||||||
$helper->table = $this->table;
|
|
||||||
$helper->identifier = $this->identifier;
|
|
||||||
$helper->id = $obj->id;
|
|
||||||
$helper->languages = $this->_languages;
|
|
||||||
$helper->default_form_language = $this->default_form_language;
|
|
||||||
$helper->allow_employee_form_lang = $this->allow_employee_form_lang;
|
|
||||||
$helper->fields_value = $this->getFieldsValue($obj);
|
|
||||||
$this->content .= $helper->generateForm($this->fields_form);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
// TODO delete when all forms use the helper
|
|
||||||
$this->content .= $this->displayForm();
|
|
||||||
|
|
||||||
if ($this->tabAccess['view'])
|
|
||||||
{
|
|
||||||
if (Tools::getValue('back'))
|
|
||||||
$this->context->smarty->assign('back', Tools::safeOutput(Tools::getValue('back')));
|
|
||||||
else
|
|
||||||
$this->context->smarty->assign('back', Tools::safeOutput(Tools::getValue(self::$currentIndex.'&token='.$this->token)));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if ($this->display == 'list')
|
else if ($this->display != 'view')
|
||||||
{
|
{
|
||||||
// init list declaration
|
|
||||||
$this->initList();
|
$this->initList();
|
||||||
|
|
||||||
$this->getList($this->context->language->id);
|
|
||||||
|
|
||||||
$helper = new HelperList();
|
|
||||||
// Check if list templates have been overriden
|
|
||||||
if (file_exists($this->context->smarty->template_dir[0].'/'.$this->tpl_folder.'list_header.tpl'))
|
|
||||||
$helper->header_tpl = $this->tpl_folder.'list_header.tpl';
|
|
||||||
if (file_exists($this->context->smarty->template_dir[0].'/'.$this->tpl_folder.'list_content.tpl'))
|
|
||||||
$helper->header_tpl = $this->tpl_folder.'list_content.tpl';
|
|
||||||
if (file_exists($this->context->smarty->template_dir[0].'/'.$this->tpl_folder.'list_footer.tpl'))
|
|
||||||
$helper->header_tpl = $this->tpl_folder.'list_footer.tpl';
|
|
||||||
|
|
||||||
// For compatibility reasons, we have to check standard actions in class attributes
|
|
||||||
foreach ($this->actions_available as $action)
|
|
||||||
{
|
|
||||||
if (!in_array($action, $this->actions) && isset($this->$action) && $this->$action)
|
|
||||||
$this->actions[] = $action;
|
|
||||||
}
|
|
||||||
|
|
||||||
$helper->actions = $this->actions;
|
|
||||||
$helper->bulk_actions = $this->bulk_actions;
|
|
||||||
$helper->currentIndex = self::$currentIndex;
|
|
||||||
$helper->className = $this->className;
|
|
||||||
$helper->table = $this->table;
|
|
||||||
$helper->_orderBy = $this->_orderBy;
|
|
||||||
$helper->_orderWay = $this->_orderWay;
|
|
||||||
$helper->_listTotal = $this->_listTotal;
|
|
||||||
$helper->shopLink = $this->shopLink;
|
|
||||||
$helper->shopLinkType = $this->shopLinkType;
|
|
||||||
$helper->identifier = $this->identifier;
|
|
||||||
$helper->token = $this->token;
|
|
||||||
$helper->imageType = $this->imageType;
|
|
||||||
$helper->no_add = isset($this->no_add) ? $this->no_add : false;
|
|
||||||
$helper->colorOnBackground = $this->colorOnBackground;
|
|
||||||
|
|
||||||
// For each action, try to add the corresponding skip elements list
|
|
||||||
$helper->list_skip_actions = $this->list_skip_actions;
|
|
||||||
$this->content .= $helper->generateList($this->_list, $this->fieldsDisplay);
|
|
||||||
|
|
||||||
// init options declaration
|
|
||||||
$this->initOptions();
|
$this->initOptions();
|
||||||
|
|
||||||
if ($this->options)
|
|
||||||
{
|
|
||||||
$helper = new HelperOptions();
|
|
||||||
$helper->id = $this->id;
|
|
||||||
$helper->currentIndex = self::$currentIndex;
|
|
||||||
$this->content .= $helper->generateOptions($this->options);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
$this->context->smarty->assign(array(
|
||||||
|
'table' => $this->table,
|
||||||
|
'current' => self::$currentIndex,
|
||||||
|
'token' => $this->token,
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1141,6 +1064,48 @@ class AdminControllerCore extends Controller
|
|||||||
*/
|
*/
|
||||||
public function initList()
|
public function initList()
|
||||||
{
|
{
|
||||||
|
if (!($this->fieldsDisplay && is_array($this->fieldsDisplay)))
|
||||||
|
return false;
|
||||||
|
$this->getList($this->context->language->id);
|
||||||
|
|
||||||
|
if (!($this->_list && is_array($this->_list)))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
$helper = new HelperList();
|
||||||
|
// Check if list templates have been overriden
|
||||||
|
if (file_exists($this->context->smarty->template_dir[0].'/'.$this->tpl_folder.'list_header.tpl'))
|
||||||
|
$helper->header_tpl = $this->tpl_folder.'list_header.tpl';
|
||||||
|
if (file_exists($this->context->smarty->template_dir[0].'/'.$this->tpl_folder.'list_content.tpl'))
|
||||||
|
$helper->header_tpl = $this->tpl_folder.'list_content.tpl';
|
||||||
|
if (file_exists($this->context->smarty->template_dir[0].'/'.$this->tpl_folder.'list_footer.tpl'))
|
||||||
|
$helper->header_tpl = $this->tpl_folder.'list_footer.tpl';
|
||||||
|
|
||||||
|
// For compatibility reasons, we have to check standard actions in class attributes
|
||||||
|
foreach ($this->actions_available as $action)
|
||||||
|
{
|
||||||
|
if (!in_array($action, $this->actions) && isset($this->$action) && $this->$action)
|
||||||
|
$this->actions[] = $action;
|
||||||
|
}
|
||||||
|
|
||||||
|
$helper->actions = $this->actions;
|
||||||
|
$helper->bulk_actions = $this->bulk_actions;
|
||||||
|
$helper->currentIndex = self::$currentIndex;
|
||||||
|
$helper->className = $this->className;
|
||||||
|
$helper->table = $this->table;
|
||||||
|
$helper->orderBy = $this->_orderBy;
|
||||||
|
$helper->orderWay = $this->_orderWay;
|
||||||
|
$helper->listTotal = $this->_listTotal;
|
||||||
|
$helper->shopLink = $this->shopLink;
|
||||||
|
$helper->shopLinkType = $this->shopLinkType;
|
||||||
|
$helper->identifier = $this->identifier;
|
||||||
|
$helper->token = $this->token;
|
||||||
|
$helper->imageType = $this->imageType;
|
||||||
|
$helper->no_add = isset($this->no_add) ? $this->no_add : false;
|
||||||
|
$helper->colorOnBackground = $this->colorOnBackground;
|
||||||
|
|
||||||
|
// For each action, try to add the corresponding skip elements list
|
||||||
|
$helper->list_skip_actions = $this->list_skip_actions;
|
||||||
|
$this->content .= $helper->generateList($this->_list, $this->fieldsDisplay);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1148,6 +1113,35 @@ class AdminControllerCore extends Controller
|
|||||||
*/
|
*/
|
||||||
public function initForm()
|
public function initForm()
|
||||||
{
|
{
|
||||||
|
if ($this->fields_form && is_array($this->fields_form))
|
||||||
|
{
|
||||||
|
$this->getlanguages();
|
||||||
|
$helper = new HelperForm();
|
||||||
|
// Check if form template has been overriden
|
||||||
|
if (file_exists($this->context->smarty->template_dir[0].'/'.$this->tpl_folder.'form.tpl'))
|
||||||
|
$helper->tpl = $this->tpl_folder.'form.tpl';
|
||||||
|
$helper->currentIndex = self::$currentIndex;
|
||||||
|
$helper->token = $this->token;
|
||||||
|
$helper->table = $this->table;
|
||||||
|
$helper->identifier = $this->identifier;
|
||||||
|
$helper->id = $this->object->id;
|
||||||
|
$helper->languages = $this->_languages;
|
||||||
|
$helper->default_form_language = $this->default_form_language;
|
||||||
|
$helper->allow_employee_form_lang = $this->allow_employee_form_lang;
|
||||||
|
$helper->fields_value = $this->getFieldsValue($this->object);
|
||||||
|
if ($this->tabAccess['view'])
|
||||||
|
{
|
||||||
|
if (Tools::getValue('back'))
|
||||||
|
$this->context->smarty->assign('back', Tools::safeOutput(Tools::getValue('back')));
|
||||||
|
else
|
||||||
|
$this->context->smarty->assign('back', Tools::safeOutput(Tools::getValue(self::$currentIndex.'&token='.$this->token)));
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->content .= $helper->generateForm($this->fields_form);
|
||||||
|
}
|
||||||
|
// TODO delete when all forms use the helper
|
||||||
|
else
|
||||||
|
$this->content .= $this->displayForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1155,6 +1149,14 @@ class AdminControllerCore extends Controller
|
|||||||
*/
|
*/
|
||||||
public function initOptions()
|
public function initOptions()
|
||||||
{
|
{
|
||||||
|
if ($this->options && is_array($this->options))
|
||||||
|
{
|
||||||
|
$helper = new HelperOptions();
|
||||||
|
$helper->id = $this->id;
|
||||||
|
$helper->token = $this->token;
|
||||||
|
$helper->currentIndex = self::$currentIndex;
|
||||||
|
$this->content .= $helper->generateOptions($this->options);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setMedia()
|
public function setMedia()
|
||||||
@@ -1250,7 +1252,7 @@ class AdminControllerCore extends Controller
|
|||||||
$protocol_content = (isset($useSSL) && $useSSL && Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://';
|
$protocol_content = (isset($useSSL) && $useSSL && Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://';
|
||||||
$link = new Link($protocol_link, $protocol_content);
|
$link = new Link($protocol_link, $protocol_content);
|
||||||
$this->context->link = $link;
|
$this->context->link = $link;
|
||||||
// @todo : put the definitions in Controller class
|
// @todo : put the definitions in Controller class
|
||||||
if (!defined('_PS_BASE_URL_'))
|
if (!defined('_PS_BASE_URL_'))
|
||||||
define('_PS_BASE_URL_', Tools::getShopDomain(true));
|
define('_PS_BASE_URL_', Tools::getShopDomain(true));
|
||||||
if (!defined('_PS_BASE_URL_SSL_'))
|
if (!defined('_PS_BASE_URL_SSL_'))
|
||||||
@@ -1386,7 +1388,7 @@ class AdminControllerCore extends Controller
|
|||||||
else if (isset($_POST['submitReset'.$this->table]))
|
else if (isset($_POST['submitReset'.$this->table]))
|
||||||
$this->action = 'reset_filters';
|
$this->action = 'reset_filters';
|
||||||
/* Submit options list */
|
/* Submit options list */
|
||||||
else if (Tools::getValue('submitOptions'.$this->table))
|
else if (Tools::getValue('submitOptions'.$this->table) || Tools::getValue('submitOptions'))
|
||||||
$this->action = 'update_options';
|
$this->action = 'update_options';
|
||||||
else if (Tools::isSubmit('submitFields') && $this->requiredDatabase && $this->tabAccess['add'] === '1' && $this->tabAccess['delete'] === '1')
|
else if (Tools::isSubmit('submitFields') && $this->requiredDatabase && $this->tabAccess['add'] === '1' && $this->tabAccess['delete'] === '1')
|
||||||
$this->action = 'update_fields';
|
$this->action = 'update_fields';
|
||||||
@@ -1440,7 +1442,6 @@ class AdminControllerCore extends Controller
|
|||||||
$orderBy = $this->context->cookie->__get($this->table.'Orderby') ? $this->context->cookie->__get($this->table.'Orderby') : $this->_defaultOrderBy;
|
$orderBy = $this->context->cookie->__get($this->table.'Orderby') ? $this->context->cookie->__get($this->table.'Orderby') : $this->_defaultOrderBy;
|
||||||
if (empty($orderWay))
|
if (empty($orderWay))
|
||||||
$orderWay = $this->context->cookie->__get($this->table.'Orderway') ? $this->context->cookie->__get($this->table.'Orderway') : 'ASC';
|
$orderWay = $this->context->cookie->__get($this->table.'Orderway') ? $this->context->cookie->__get($this->table.'Orderway') : 'ASC';
|
||||||
|
|
||||||
$limit = (int)Tools::getValue('pagination', $limit);
|
$limit = (int)Tools::getValue('pagination', $limit);
|
||||||
$this->context->cookie->{$this->table.'_pagination'} = $limit;
|
$this->context->cookie->{$this->table.'_pagination'} = $limit;
|
||||||
|
|
||||||
@@ -1780,7 +1781,7 @@ class AdminControllerCore extends Controller
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the associations of shops
|
* Update the associations of shops
|
||||||
*
|
*
|
||||||
* @param int $id_object
|
* @param int $id_object
|
||||||
* @param int $new_id_object
|
* @param int $new_id_object
|
||||||
*/
|
*/
|
||||||
@@ -1840,10 +1841,10 @@ class AdminControllerCore extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* displayAssoShop
|
* displayAssoShop
|
||||||
* @todo : create assoshop.tpl and use smarty var asso_shop in pages
|
* @todo : create assoshop.tpl and use smarty var asso_shop in pages
|
||||||
*
|
*
|
||||||
* @param string $type
|
* @param string $type
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function displayAssoShop($type = 'shop')
|
protected function displayAssoShop($type = 'shop')
|
||||||
|
|||||||
+12
-12
@@ -31,7 +31,7 @@ class HelperListCore extends Helper
|
|||||||
protected $_list = array();
|
protected $_list = array();
|
||||||
|
|
||||||
/** @var integer Number of results in list */
|
/** @var integer Number of results in list */
|
||||||
public $_listTotal = 0;
|
public $listTotal = 0;
|
||||||
|
|
||||||
/** @var array WHERE clause determined by filter fields */
|
/** @var array WHERE clause determined by filter fields */
|
||||||
protected $_filter;
|
protected $_filter;
|
||||||
@@ -43,13 +43,13 @@ class HelperListCore extends Helper
|
|||||||
protected $_pagination = array(20, 50, 100, 300);
|
protected $_pagination = array(20, 50, 100, 300);
|
||||||
|
|
||||||
/** @var string ORDER BY clause determined by field/arrows in list header */
|
/** @var string ORDER BY clause determined by field/arrows in list header */
|
||||||
public $_orderBy;
|
public $orderBy;
|
||||||
|
|
||||||
/** @var string Default ORDER BY clause when $_orderBy is not defined */
|
/** @var string Default ORDER BY clause when $orderBy is not defined */
|
||||||
public $_defaultOrderBy = false;
|
public $_defaultOrderBy = false;
|
||||||
|
|
||||||
/** @var string Order way (ASC, DESC) determined by arrows in list header */
|
/** @var string Order way (ASC, DESC) determined by arrows in list header */
|
||||||
public $_orderWay;
|
public $orderWay;
|
||||||
|
|
||||||
public $identifier;
|
public $identifier;
|
||||||
|
|
||||||
@@ -425,14 +425,14 @@ class HelperListCore extends Helper
|
|||||||
else
|
else
|
||||||
$default_pagination = $this->_pagination[0];
|
$default_pagination = $this->_pagination[0];
|
||||||
|
|
||||||
$total_pages = ceil($this->_listTotal / Tools::getValue('pagination', ($default_pagination)));
|
$total_pages = ceil($this->listTotal / Tools::getValue('pagination', ($default_pagination)));
|
||||||
|
|
||||||
if (!$total_pages) $total_pages = 1;
|
if (!$total_pages) $total_pages = 1;
|
||||||
|
|
||||||
$identifier = Tools::getIsset($this->identifier) ? '&'.$this->identifier.'='.(int)Tools::getValue($this->identifier) : '';
|
$identifier = Tools::getIsset($this->identifier) ? '&'.$this->identifier.'='.(int)Tools::getValue($this->identifier) : '';
|
||||||
$order = '';
|
$order = '';
|
||||||
if (Tools::getIsset($this->table.'Orderby'))
|
if (Tools::getIsset($this->table.'Orderby'))
|
||||||
$order = '&'.$this->table.'Orderby='.urlencode($this->_orderBy).'&'.$this->table.'Orderway='.urlencode(strtolower($this->_orderWay));
|
$order = '&'.$this->table.'Orderby='.urlencode($this->orderBy).'&'.$this->table.'Orderway='.urlencode(strtolower($this->orderWay));
|
||||||
|
|
||||||
$action = $this->currentIndex.$identifier.'&token='.$token.$order.'#'.$this->table;
|
$action = $this->currentIndex.$identifier.'&token='.$token.$order.'#'.$this->table;
|
||||||
|
|
||||||
@@ -455,7 +455,7 @@ class HelperListCore extends Helper
|
|||||||
substr($this->identifier,3,strlen($this->identifier)))
|
substr($this->identifier,3,strlen($this->identifier)))
|
||||||
}
|
}
|
||||||
.' class="table'.(
|
.' class="table'.(
|
||||||
if ($is_dnd_identifier AND ($this->_orderBy != 'position 'AND $this->_orderWay != 'DESC'))
|
if ($is_dnd_identifier AND ($this->orderBy != 'position 'AND $this->orderWay != 'DESC'))
|
||||||
' tableDnD'
|
' tableDnD'
|
||||||
.'" cellpadding="0" cellspacing="0">*/
|
.'" cellpadding="0" cellspacing="0">*/
|
||||||
|
|
||||||
@@ -466,7 +466,7 @@ class HelperListCore extends Helper
|
|||||||
if (array_key_exists($this->identifier, $this->identifiersDnd) && (int)Tools::getValue($this->identifiersDnd[$this->identifier], 1))
|
if (array_key_exists($this->identifier, $this->identifiersDnd) && (int)Tools::getValue($this->identifiersDnd[$this->identifier], 1))
|
||||||
$table_id = substr($this->identifier, 3, strlen($this->identifier));
|
$table_id = substr($this->identifier, 3, strlen($this->identifier));
|
||||||
|
|
||||||
if (array_key_exists($this->identifier, $this->identifiersDnd) && ($this->_orderBy != 'position' && $this->_orderWay != 'DESC'))
|
if (array_key_exists($this->identifier, $this->identifiersDnd) && ($this->orderBy != 'position' && $this->orderWay != 'DESC'))
|
||||||
$table_dnd = true;
|
$table_dnd = true;
|
||||||
|
|
||||||
foreach ($this->fieldsDisplay as $key => $params)
|
foreach ($this->fieldsDisplay as $key => $params)
|
||||||
@@ -517,10 +517,10 @@ class HelperListCore extends Helper
|
|||||||
'total_pages' => $total_pages,
|
'total_pages' => $total_pages,
|
||||||
'selected_pagination' => $selected_pagination,
|
'selected_pagination' => $selected_pagination,
|
||||||
'pagination' => $this->_pagination,
|
'pagination' => $this->_pagination,
|
||||||
'list_total' => $this->_listTotal,
|
'list_total' => $this->listTotal,
|
||||||
'is_order_position' => array_key_exists($this->identifier, $this->identifiersDnd) && $this->_orderBy == 'position',
|
'is_order_position' => array_key_exists($this->identifier, $this->identifiersDnd) && $this->orderBy == 'position',
|
||||||
'order_way' => $this->_orderWay,
|
'order_way' => $this->orderWay,
|
||||||
'order_by' => $this->_orderBy,
|
'order_by' => $this->orderBy,
|
||||||
'token' => $this->token,
|
'token' => $this->token,
|
||||||
'fields_display' => $this->fieldsDisplay,
|
'fields_display' => $this->fieldsDisplay,
|
||||||
'delete' => in_array('delete', $this->actions),
|
'delete' => in_array('delete', $this->actions),
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ class HelperOptionsCore extends Helper
|
|||||||
'option_list' => $option_list,
|
'option_list' => $option_list,
|
||||||
'current_id_lang' => $this->context->language->id,
|
'current_id_lang' => $this->context->language->id,
|
||||||
'required_fields' => isset($required_fields) ? $required_fields : false,
|
'required_fields' => isset($required_fields) ? $required_fields : false,
|
||||||
'languages' => isset($languages) ? $languages : false
|
'languages' => isset($languages) ? $languages : null,
|
||||||
));
|
));
|
||||||
return $this->context->smarty->fetch(_PS_ADMIN_DIR_.'/themes/template/'.$this->tpl);
|
return $this->context->smarty->fetch(_PS_ADMIN_DIR_.'/themes/template/'.$this->tpl);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,6 +48,21 @@ class AdminAddressesControllerCore extends AdminController
|
|||||||
|
|
||||||
if (!Tools::getValue('realedit'))
|
if (!Tools::getValue('realedit'))
|
||||||
$this->deleted = true;
|
$this->deleted = true;
|
||||||
|
|
||||||
|
$this->fieldsDisplay = array(
|
||||||
|
'id_address' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
|
||||||
|
'firstname' => array('title' => $this->l('First name'), 'width' => 80, 'filter_key' => 'a!firstname'),
|
||||||
|
'lastname' => array('title' => $this->l('Last name'), 'width' => 100, 'filter_key' => 'a!lastname'),
|
||||||
|
'address1' => array('title' => $this->l('Address'), 'width' => 200),
|
||||||
|
'postcode' => array('title' => $this->l('Postcode/ Zip Code'), 'align' => 'right', 'width' => 50),
|
||||||
|
'city' => array('title' => $this->l('City'), 'width' => 150),
|
||||||
|
'country' => array('title' => $this->l('Country'), 'width' => 100, 'type' => 'select', 'select' => $this->countriesArray, 'filter_key' => 'cl!id_country'));
|
||||||
|
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function initList()
|
||||||
|
{
|
||||||
$this->_select = 'cl.`name` as country';
|
$this->_select = 'cl.`name` as country';
|
||||||
$this->_join = 'LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON
|
$this->_join = 'LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON
|
||||||
(cl.`id_country` = a.`id_country` AND cl.`id_lang` = '.(int)$this->context->language->id.')';
|
(cl.`id_country` = a.`id_country` AND cl.`id_lang` = '.(int)$this->context->language->id.')';
|
||||||
@@ -57,15 +72,11 @@ 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'];
|
||||||
|
|
||||||
$this->fieldsDisplay = array(
|
parent::initList();
|
||||||
'id_address' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
|
}
|
||||||
'firstname' => array('title' => $this->l('First name'), 'width' => 80, 'filter_key' => 'a!firstname'),
|
|
||||||
'lastname' => array('title' => $this->l('Last name'), 'width' => 100, 'filter_key' => 'a!lastname'),
|
|
||||||
'address1' => array('title' => $this->l('Address'), 'width' => 200),
|
|
||||||
'postcode' => array('title' => $this->l('Postcode/ Zip Code'), 'align' => 'right', 'width' => 50),
|
|
||||||
'city' => array('title' => $this->l('City'), 'width' => 150),
|
|
||||||
'country' => array('title' => $this->l('Country'), 'width' => 100, 'type' => 'select', 'select' => $this->countriesArray, 'filter_key' => 'cl!id_country'));
|
|
||||||
|
|
||||||
|
public function initForm()
|
||||||
|
{
|
||||||
$this->fields_form = array(
|
$this->fields_form = array(
|
||||||
'legend' => array(
|
'legend' => array(
|
||||||
'title' => $this->l('Addresses'),
|
'title' => $this->l('Addresses'),
|
||||||
@@ -125,7 +136,143 @@ class AdminAddressesControllerCore extends AdminController
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
parent::__construct();
|
if (Validate::isLoadedObject($this->object))
|
||||||
|
{
|
||||||
|
$customer = new Customer($this->object->id_customer);
|
||||||
|
$tokenCustomer = Tools::getAdminToken('AdminCustomers'.(int)(Tab::getIdFromClassName('AdminCustomers')).(int)$this->context->employee->id);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Configuration::get('VATNUMBER_MANAGEMENT'))
|
||||||
|
if (file_exists(_PS_MODULE_DIR_.'vatnumber/vatnumber.php') && VatNumber::isApplicable(Configuration::get('PS_COUNTRY_DEFAULT')))
|
||||||
|
$vat = 'is_applicable';
|
||||||
|
else
|
||||||
|
$vat = 'management';
|
||||||
|
|
||||||
|
$this->context->smarty->assign(array(
|
||||||
|
'vat' => isset($vat) ? $vat : null,
|
||||||
|
'customer' => isset($customer) ? $customer : null,
|
||||||
|
'tokenCustomer' => isset ($tokenCustomer) ? $tokenCustomer : null
|
||||||
|
));
|
||||||
|
|
||||||
|
// Order address fields depending on country format
|
||||||
|
$addresses_fields = $this->processAddressFormat();
|
||||||
|
$addresses_fields = $addresses_fields["dlv_all_fields"]; // we use delivery address
|
||||||
|
|
||||||
|
$temp_fields = array();
|
||||||
|
|
||||||
|
foreach($addresses_fields as $addr_field_item)
|
||||||
|
{
|
||||||
|
if ($addr_field_item == 'company')
|
||||||
|
{
|
||||||
|
$temp_fields[] = array(
|
||||||
|
'type' => 'text',
|
||||||
|
'label' => $this->l('Company'),
|
||||||
|
'name' => 'company',
|
||||||
|
'size' => 33,
|
||||||
|
'required' => false,
|
||||||
|
'p' => '<span class="hint" name="help_box">'.$this->l('Invalid characters:').' <>;=#{}<span class="hint-pointer"> </span></span>'
|
||||||
|
);
|
||||||
|
$temp_fields[] = array(
|
||||||
|
'type' => 'text',
|
||||||
|
'label' => $this->l('VAT number'),
|
||||||
|
'name' => 'vat_number',
|
||||||
|
'size' => 33,
|
||||||
|
''
|
||||||
|
);
|
||||||
|
}
|
||||||
|
elseif ($addr_field_item == 'lastname')
|
||||||
|
{
|
||||||
|
$temp_fields[] = array(
|
||||||
|
'type' => 'text',
|
||||||
|
'label' => $this->l('Last name'),
|
||||||
|
'name' => 'lastname',
|
||||||
|
'size' => 33,
|
||||||
|
'required' => true,
|
||||||
|
'p' => '<span class="hint" name="help_box">'.$this->l('Invalid characters:').' 0-9!<>,;?=+()@#"�{}_$%:<span class="hint-pointer"> </span></span>'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
elseif ($addr_field_item == 'firstname')
|
||||||
|
{
|
||||||
|
$temp_fields[] = array(
|
||||||
|
'type' => 'text',
|
||||||
|
'label' => $this->l('First name'),
|
||||||
|
'name' => 'firstname',
|
||||||
|
'size' => 33,
|
||||||
|
'required' => true,
|
||||||
|
'p' => '<span class="hint" name="help_box">'.$this->l('Invalid characters:').' 0-9!<>,;?=+()@#"�{}_$%:<span class="hint-pointer"> </span></span>'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
elseif ($addr_field_item == 'address1')
|
||||||
|
{
|
||||||
|
$temp_fields[] = array(
|
||||||
|
'type' => 'text',
|
||||||
|
'label' => $this->l('Address'),
|
||||||
|
'name' => 'address1',
|
||||||
|
'size' => 33,
|
||||||
|
'required' => true,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
elseif ($addr_field_item == 'address2')
|
||||||
|
{
|
||||||
|
$temp_fields[] = array(
|
||||||
|
'type' => 'text',
|
||||||
|
'label' => $this->l('Address').' (2)',
|
||||||
|
'name' => 'address2',
|
||||||
|
'size' => 33,
|
||||||
|
'required' => false,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
elseif ($addr_field_item == 'postcode')
|
||||||
|
{
|
||||||
|
$temp_fields[] = array(
|
||||||
|
'type' => 'text',
|
||||||
|
'label' => $this->l('Postcode/ Zip Code'),
|
||||||
|
'name' => 'postcode',
|
||||||
|
'size' => 33,
|
||||||
|
'required' => false,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
elseif ($addr_field_item == 'city')
|
||||||
|
{
|
||||||
|
$temp_fields[] = array(
|
||||||
|
'type' => 'text',
|
||||||
|
'label' => $this->l('City'),
|
||||||
|
'name' => 'city',
|
||||||
|
'size' => 33,
|
||||||
|
'required' => true,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
elseif ($addr_field_item == 'country' || $addr_field_item == 'Country:name')
|
||||||
|
{
|
||||||
|
$temp_fields[] = array(
|
||||||
|
'type' => 'select',
|
||||||
|
'label' => $this->l('Country:'),
|
||||||
|
'name' => 'id_country',
|
||||||
|
'required' => false,
|
||||||
|
'options' => array(
|
||||||
|
'query' => Country::getCountries($this->context->language->id),
|
||||||
|
'id' => 'id_country',
|
||||||
|
'name' => 'name'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$temp_fields[] = array(
|
||||||
|
'type' => 'select',
|
||||||
|
'label' => $this->l('State'),
|
||||||
|
'name' => 'id_state',
|
||||||
|
'required' => false,
|
||||||
|
'options' => array(
|
||||||
|
'id' => 'id_state',
|
||||||
|
'name' => 'name'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// merge address format with the rest of the form
|
||||||
|
array_splice($this->fields_form['input'], 3, 0, $temp_fields);
|
||||||
|
|
||||||
|
parent::initForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function postProcess()
|
public function postProcess()
|
||||||
@@ -241,152 +388,4 @@ class AdminAddressesControllerCore extends AdminController
|
|||||||
|
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function initContent()
|
|
||||||
{
|
|
||||||
if ($this->display == 'edit' || $this->display == 'add')
|
|
||||||
{
|
|
||||||
if (!($address = $this->loadObject(true)))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (Validate::isLoadedObject($address))
|
|
||||||
{
|
|
||||||
$customer = new Customer($address->id_customer);
|
|
||||||
$tokenCustomer = Tools::getAdminToken('AdminCustomers'.(int)(Tab::getIdFromClassName('AdminCustomers')).(int)$this->context->employee->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Configuration::get('VATNUMBER_MANAGEMENT'))
|
|
||||||
if (file_exists(_PS_MODULE_DIR_.'vatnumber/vatnumber.php') && VatNumber::isApplicable(Configuration::get('PS_COUNTRY_DEFAULT')))
|
|
||||||
$vat = 'is_applicable';
|
|
||||||
else
|
|
||||||
$vat = 'management';
|
|
||||||
|
|
||||||
$this->context->smarty->assign(array(
|
|
||||||
'vat' => isset($vat) ? $vat : null,
|
|
||||||
'customer' => isset($customer) ? $customer : null,
|
|
||||||
'tokenCustomer' => isset ($tokenCustomer) ? $tokenCustomer : null
|
|
||||||
));
|
|
||||||
|
|
||||||
// Order address fields depending on country format
|
|
||||||
$addresses_fields = $this->processAddressFormat();
|
|
||||||
$addresses_fields = $addresses_fields["dlv_all_fields"]; // we use delivery address
|
|
||||||
|
|
||||||
$temp_fields = array();
|
|
||||||
|
|
||||||
foreach($addresses_fields as $addr_field_item)
|
|
||||||
{
|
|
||||||
if ($addr_field_item == 'company')
|
|
||||||
{
|
|
||||||
$temp_fields[] = array(
|
|
||||||
'type' => 'text',
|
|
||||||
'label' => $this->l('Company'),
|
|
||||||
'name' => 'company',
|
|
||||||
'size' => 33,
|
|
||||||
'required' => false,
|
|
||||||
'p' => '<span class="hint" name="help_box">'.$this->l('Invalid characters:').' <>;=#{}<span class="hint-pointer"> </span></span>'
|
|
||||||
);
|
|
||||||
$temp_fields[] = array(
|
|
||||||
'type' => 'text',
|
|
||||||
'label' => $this->l('VAT number'),
|
|
||||||
'name' => 'vat_number',
|
|
||||||
'size' => 33,
|
|
||||||
''
|
|
||||||
);
|
|
||||||
}
|
|
||||||
elseif ($addr_field_item == 'lastname')
|
|
||||||
{
|
|
||||||
$temp_fields[] = array(
|
|
||||||
'type' => 'text',
|
|
||||||
'label' => $this->l('Last name'),
|
|
||||||
'name' => 'lastname',
|
|
||||||
'size' => 33,
|
|
||||||
'required' => true,
|
|
||||||
'p' => '<span class="hint" name="help_box">'.$this->l('Invalid characters:').' 0-9!<>,;?=+()@#"�{}_$%:<span class="hint-pointer"> </span></span>'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
elseif ($addr_field_item == 'firstname')
|
|
||||||
{
|
|
||||||
$temp_fields[] = array(
|
|
||||||
'type' => 'text',
|
|
||||||
'label' => $this->l('First name'),
|
|
||||||
'name' => 'firstname',
|
|
||||||
'size' => 33,
|
|
||||||
'required' => true,
|
|
||||||
'p' => '<span class="hint" name="help_box">'.$this->l('Invalid characters:').' 0-9!<>,;?=+()@#"�{}_$%:<span class="hint-pointer"> </span></span>'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
elseif ($addr_field_item == 'address1')
|
|
||||||
{
|
|
||||||
$temp_fields[] = array(
|
|
||||||
'type' => 'text',
|
|
||||||
'label' => $this->l('Address'),
|
|
||||||
'name' => 'address1',
|
|
||||||
'size' => 33,
|
|
||||||
'required' => true,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
elseif ($addr_field_item == 'address2')
|
|
||||||
{
|
|
||||||
$temp_fields[] = array(
|
|
||||||
'type' => 'text',
|
|
||||||
'label' => $this->l('Address').' (2)',
|
|
||||||
'name' => 'address2',
|
|
||||||
'size' => 33,
|
|
||||||
'required' => false,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
elseif ($addr_field_item == 'postcode')
|
|
||||||
{
|
|
||||||
$temp_fields[] = array(
|
|
||||||
'type' => 'text',
|
|
||||||
'label' => $this->l('Postcode/ Zip Code'),
|
|
||||||
'name' => 'postcode',
|
|
||||||
'size' => 33,
|
|
||||||
'required' => false,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
elseif ($addr_field_item == 'city')
|
|
||||||
{
|
|
||||||
$temp_fields[] = array(
|
|
||||||
'type' => 'text',
|
|
||||||
'label' => $this->l('City'),
|
|
||||||
'name' => 'city',
|
|
||||||
'size' => 33,
|
|
||||||
'required' => true,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
elseif ($addr_field_item == 'country' || $addr_field_item == 'Country:name')
|
|
||||||
{
|
|
||||||
$temp_fields[] = array(
|
|
||||||
'type' => 'select',
|
|
||||||
'label' => $this->l('Country:'),
|
|
||||||
'name' => 'id_country',
|
|
||||||
'required' => false,
|
|
||||||
'options' => array(
|
|
||||||
'query' => Country::getCountries($this->context->language->id),
|
|
||||||
'id' => 'id_country',
|
|
||||||
'name' => 'name'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$temp_fields[] = array(
|
|
||||||
'type' => 'select',
|
|
||||||
'label' => $this->l('State'),
|
|
||||||
'name' => 'id_state',
|
|
||||||
'required' => false,
|
|
||||||
'options' => array(
|
|
||||||
'id' => 'id_state',
|
|
||||||
'name' => 'name'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// merge address format with the rest of the form
|
|
||||||
array_splice($this->fields_form['input'], 3, 0, $temp_fields);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
$this->display = 'list';
|
|
||||||
|
|
||||||
parent::initContent();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -85,6 +85,13 @@ class AdminAliasesControllerCore extends AdminController
|
|||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function initForm()
|
||||||
|
{
|
||||||
|
$this->fields_value = array('alias' => $this->object->getAliases());
|
||||||
|
|
||||||
|
parent::initForm();
|
||||||
|
}
|
||||||
|
|
||||||
public function postProcess()
|
public function postProcess()
|
||||||
{
|
{
|
||||||
if (isset($_POST['submitAdd'.$this->table]))
|
if (isset($_POST['submitAdd'.$this->table]))
|
||||||
@@ -112,20 +119,6 @@ class AdminAliasesControllerCore extends AdminController
|
|||||||
else
|
else
|
||||||
parent::postProcess();
|
parent::postProcess();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function initContent()
|
|
||||||
{
|
|
||||||
if (!($obj = $this->loadObject(true)))
|
|
||||||
return;
|
|
||||||
|
|
||||||
$this->fields_value = array('alias' => $obj->getAliases());
|
|
||||||
|
|
||||||
if ($this->display != 'edit' && $this->display != 'add')
|
|
||||||
$this->display = 'list';
|
|
||||||
|
|
||||||
parent::initContent();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -36,12 +36,13 @@ class AdminBackupControllerCore extends AdminController
|
|||||||
$this->className = 'Backup';
|
$this->className = 'Backup';
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
$this->addRowAction('delete');
|
|
||||||
$this->addRowAction('view');
|
$this->addRowAction('view');
|
||||||
|
$this->addRowAction('delete');
|
||||||
|
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
|
||||||
|
|
||||||
$this->deleted = false;
|
$this->deleted = false;
|
||||||
|
|
||||||
$this->requiredDatabase = false;
|
$this->requiredDatabase = false;
|
||||||
|
$this->identifier = 'filename';
|
||||||
|
|
||||||
$this->fieldsDisplay = array (
|
$this->fieldsDisplay = array (
|
||||||
'date' => array('title' => $this->l('Date'), 'type' => 'datetime', 'width' => 120, 'align' => 'right'),
|
'date' => array('title' => $this->l('Date'), 'type' => 'datetime', 'width' => 120, 'align' => 'right'),
|
||||||
@@ -62,7 +63,6 @@ class AdminBackupControllerCore extends AdminController
|
|||||||
'submit' => array()
|
'submit' => array()
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
$this->identifier = 'filename';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -107,7 +107,6 @@ class AdminBackupControllerCore extends AdminController
|
|||||||
$this->display = 'list';
|
$this->display = 'list';
|
||||||
$show_form = true;
|
$show_form = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->context->smarty->assign(array(
|
$this->context->smarty->assign(array(
|
||||||
'current' => self::$currentIndex,
|
'current' => self::$currentIndex,
|
||||||
'show_form' => $show_form,
|
'show_form' => $show_form,
|
||||||
@@ -115,6 +114,7 @@ class AdminBackupControllerCore extends AdminController
|
|||||||
'how_to' => true,
|
'how_to' => true,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
parent::initContent();
|
parent::initContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -154,7 +154,6 @@ class AdminBackupControllerCore extends AdminController
|
|||||||
|
|
||||||
public function getList($id_lang, $orderBy = NULL, $orderWay = NULL, $start = 0, $limit = NULL, $id_lang_shop = NULL)
|
public function getList($id_lang, $orderBy = NULL, $orderWay = NULL, $start = 0, $limit = NULL, $id_lang_shop = NULL)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!Validate::isTableOrIdentifier($this->table))
|
if (!Validate::isTableOrIdentifier($this->table))
|
||||||
die('filter is corrupted');
|
die('filter is corrupted');
|
||||||
if (empty($orderBy))
|
if (empty($orderBy))
|
||||||
|
|||||||
@@ -43,20 +43,11 @@ class AdminContactsControllerCore extends AdminController
|
|||||||
'description' => array('title' => $this->l('Description'), 'width' => 150),
|
'description' => array('title' => $this->l('Description'), 'width' => 150),
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->options = array(
|
parent::__construct();
|
||||||
'general' => array(
|
}
|
||||||
'title' => $this->l('Contact options'),
|
|
||||||
'fields' => array(
|
|
||||||
'PS_CUSTOMER_SERVICE_FILE_UPLOAD' => array('title' => $this->l('Allow file upload'), 'desc' => $this->l('Allow customers to upload file using contact page'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'value', 'list' => array(
|
|
||||||
'0' => array('value' => 0, 'name' => $this->l('No')),
|
|
||||||
'1' => array('value' => 1, 'name' => $this->l('Yes'))
|
|
||||||
)),
|
|
||||||
'PS_CUSTOMER_SERVICE_SIGNATURE' => array('title' => $this->l('Pre-defined message'), 'desc' => $this->l('Please fill the message that appears by default when you answer a thread on the customer service page'), 'cast' => 'pSQL', 'type' => 'textareaLang', 'identifier' => 'value', 'cols' => 40, 'rows' => 8),
|
|
||||||
),
|
|
||||||
'submit' => array()
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
|
public function initForm()
|
||||||
|
{
|
||||||
$this->fields_form = array(
|
$this->fields_form = array(
|
||||||
'legend' => array(
|
'legend' => array(
|
||||||
'title' => $this->l('Contacts'),
|
'title' => $this->l('Contacts'),
|
||||||
@@ -120,16 +111,9 @@ class AdminContactsControllerCore extends AdminController
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
parent::__construct();
|
parent::initForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function initContent()
|
|
||||||
{
|
|
||||||
if ($this->display != 'edit')
|
|
||||||
$this->display = 'list';
|
|
||||||
|
|
||||||
parent::initContent();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -274,13 +274,5 @@ class AdminCurrenciesControllerCore extends AdminController
|
|||||||
Configuration::updateValue('PS_CURRENCY_DEFAULT', $value);
|
Configuration::updateValue('PS_CURRENCY_DEFAULT', $value);
|
||||||
Currency::refreshCurrencies();
|
Currency::refreshCurrencies();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function initContent()
|
|
||||||
{
|
|
||||||
if ($this->display != 'edit' && $this->display != 'add')
|
|
||||||
$this->display = 'list';
|
|
||||||
|
|
||||||
parent::initContent();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -90,18 +90,6 @@ class AdminEmailsControllerCore extends AdminController
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function initContent()
|
|
||||||
{
|
|
||||||
$helper = new HelperOptions();
|
|
||||||
$helper->id = $this->id;
|
|
||||||
$helper->currentIndex = self::$currentIndex;
|
|
||||||
$helper->table = $this->table;
|
|
||||||
$helper->token = $this->token;
|
|
||||||
$this->content .= $helper->generateOptions($this->options);
|
|
||||||
|
|
||||||
parent::initContent();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function beforeUpdateOptions()
|
public function beforeUpdateOptions()
|
||||||
{
|
{
|
||||||
/* PrestaShop demo mode */
|
/* PrestaShop demo mode */
|
||||||
|
|||||||
@@ -527,17 +527,7 @@ class AdminImagesController extends AdminController
|
|||||||
public function initContent()
|
public function initContent()
|
||||||
{
|
{
|
||||||
if ($this->display != 'edit' && $this->display != 'add')
|
if ($this->display != 'edit' && $this->display != 'add')
|
||||||
$this->display = 'list';
|
|
||||||
|
|
||||||
parent::initContent();
|
|
||||||
|
|
||||||
if ($this->display == 'list')
|
|
||||||
{
|
{
|
||||||
$helper = new HelperOptions();
|
|
||||||
$helper->id = $this->id;
|
|
||||||
$helper->currentIndex = self::$currentIndex;
|
|
||||||
$this->content .= $helper->generateOptions($this->options);
|
|
||||||
|
|
||||||
$this->initRegenerate();
|
$this->initRegenerate();
|
||||||
$this->initMoveImages();
|
$this->initMoveImages();
|
||||||
|
|
||||||
@@ -549,5 +539,7 @@ class AdminImagesController extends AdminController
|
|||||||
|
|
||||||
if ($this->display == 'edit')
|
if ($this->display == 'edit')
|
||||||
$this->warnings[] = $this->l('After modification, do not forget to regenerate thumbnails');
|
$this->warnings[] = $this->l('After modification, do not forget to regenerate thumbnails');
|
||||||
|
|
||||||
|
parent::initContent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user