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

This commit is contained in:
Kevin Granger
2013-10-04 19:13:13 +02:00
31 changed files with 349 additions and 187 deletions
@@ -142,9 +142,9 @@ class AdminCarrierWizardControllerCore extends AdminController
$bread_extended = array_unique($this->breadcrumbs);
if (Tools::getValue('id_carrier'))
$bread_extended[1] = $this->l('Edit');
$bread_extended[2] = $this->l('Edit');
else
$bread_extended[1] = $this->l('Add new');
$bread_extended[2] = $this->l('Add new');
$this->toolbar_title = $bread_extended;
}
+8 -8
View File
@@ -208,14 +208,14 @@ class AdminGroupsControllerCore extends AdminController
$this->bulk_actions = false;
$this->no_link = true;
$this->fields_list = (array(
'id_customer' => array('title' => $this->l('ID'), 'width' => 15, 'align' => 'center', 'filter_key' => 'c!id_customer'),
'id_gender' => array('title' => $this->l('Titles'), 'align' => 'center', 'width' => 50,'icon' => $genders_icon, 'list' => $genders),
'firstname' => array('title' => $this->l('First name'), 'align' => 'center'),
'lastname' => array('title' => $this->l('Last name'), 'align' => 'center'),
'email' => array('title' => $this->l('Email address'), 'width' => 150, 'align' => 'center', 'filter_key' => 'c!email', 'orderby' => true),
'birthday' => array('title' => $this->l('Birth date'), 'width' => 150, 'align' => 'right', 'type' => 'date'),
'date_add' => array('title' => $this->l('Register date'), 'width' => 150, 'align' => 'right', 'type' => 'date'),
'active' => array('title' => $this->l('Enabled'),'align' => 'center','width' => 20, 'active' => 'status','type' => 'bool')
'id_customer' => array('title' => $this->l('ID'), 'align' => 'center', 'filter_key' => 'c!id_customer', 'class' => 'fixed-width-xs'),
'id_gender' => array('title' => $this->l('Titles'), 'icon' => $genders_icon, 'list' => $genders),
'firstname' => array('title' => $this->l('First name')),
'lastname' => array('title' => $this->l('Last name')),
'email' => array('title' => $this->l('Email address'), 'filter_key' => 'c!email', 'orderby' => true),
'birthday' => array('title' => $this->l('Birth date'), 'type' => 'date', 'class' => 'fixed-width-md', 'align' => 'center'),
'date_add' => array('title' => $this->l('Register date'), 'type' => 'date', 'class' => 'fixed-width-md', 'align' => 'center'),
'active' => array('title' => $this->l('Enabled'),'align' => 'center', 'class' => 'fixed-width-sm', 'active' => 'status','type' => 'bool')
));
$this->_select = 'c.*';
$this->_join = 'LEFT JOIN `'._DB_PREFIX_.'customer` c ON (a.`id_customer` = c.`id_customer`)';
@@ -2212,6 +2212,9 @@ class AdminProductsControllerCore extends AdminController
public function initContent($token = null)
{
//Required for Features Textarea autosize
$this->addJS(_PS_JS_DIR_.'jquery/plugins/jquery.autosize.min.js');
if ($this->display == 'edit' || $this->display == 'add')
{
$this->fields_form = array();
@@ -159,6 +159,7 @@ class AdminStockMvtControllerCore extends AdminController
LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac ON (pac.id_product_attribute = stock.id_product_attribute)
LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al ON (
al.id_attribute = pac.id_attribute
AND pac.id_product_attribute <> 0
AND al.id_lang = '.(int)$this->context->language->id.'
)';
// overrides group
+39 -41
View File
@@ -34,6 +34,7 @@ class AdminTabsControllerCore extends AdminController
$this->context = Context::getContext();
$this->multishop_context = Shop::CONTEXT_ALL;
$this->table = 'tab';
$this->list_id = 'tab';
$this->className = 'Tab';
$this->lang = true;
@@ -85,11 +86,19 @@ class AdminTabsControllerCore extends AdminController
public function initPageHeaderToolbar()
{
$this->page_header_toolbar_title = $this->l('Menus');
$this->page_header_toolbar_btn['new_menu'] = array(
'href' => self::$currentIndex.'&amp;addtab&amp;token='.$this->token,
'desc' => $this->l('Add new menu'),
'icon' => 'process-icon-new'
);
if ($this->display == 'details')
$this->page_header_toolbar_btn['back_to_list'] = array(
'href' => Context::getContext()->link->getAdminLink('AdminTabs'),
'desc' => $this->l('Back to list'),
'icon' => 'process-icon-back'
);
else
$this->page_header_toolbar_btn['new_menu'] = array(
'href' => self::$currentIndex.'&amp;addtab&amp;token='.$this->token,
'desc' => $this->l('Add new menu'),
'icon' => 'process-icon-new'
);
parent::initPageHeaderToolbar();
}
@@ -212,53 +221,42 @@ class AdminTabsControllerCore extends AdminController
return parent::renderList();
}
/**
* method call when ajax request is made with the details row action
* @see AdminController::postProcess()
*/
public function ajaxProcessDetails()
public function initProcess()
{
if (($id = Tools::getValue('id')))
if (Tools::getIsset('details'.$this->table))
{
// override attributes
$this->display = 'list';
$this->lang = false;
$this->list_id = 'details';
if (isset($_POST['submitReset'.$this->list_id]))
$this->processResetFilters();
}
else
$this->list_id = 'tab';
return parent::initProcess();
}
public function renderDetails()
{
if (($id = Tools::getValue('id_tab')))
{
$this->lang = false;
$this->list_id = 'details';
$this->addRowAction('edit');
$this->addRowAction('delete');
$this->toolbar_btn = array();
$tab = $this->loadObject($id);
$this->toolbar_title = $tab->name[$this->context->employee->id_lang];
$this->_select = 'b.*';
$this->_join = 'LEFT JOIN `'._DB_PREFIX_.'tab_lang` b ON (b.`id_tab` = a.`id_tab` AND b.`id_lang` = '.$this->context->language->id.')';
$this->_where = 'AND a.`id_parent` = '.(int)$id;
$this->_orderBy = 'position';
// get list and force no limit clause in the request
$this->getList($this->context->language->id);
// Render list
$helper = new HelperList();
$helper->actions = $this->actions;
$helper->list_skip_actions = $this->list_skip_actions;
$helper->no_link = true;
$helper->shopLinkType = '';
$helper->identifier = $this->identifier;
$helper->imageType = $this->imageType;
$helper->toolbar_scroll = false;
$helper->show_toolbar = false;
$helper->orderBy = 'position';
$helper->orderWay = 'ASC';
$helper->currentIndex = self::$currentIndex;
$helper->token = $this->token;
$helper->table = $this->table;
$helper->position_identifier = $this->position_identifier;
// Force render - no filter, form, js, sorting ...
$helper->simple_header = true;
$content = $helper->generateList($this->_list, $this->fields_list);
echo Tools::jsonEncode(array('use_parent_structure' => false, 'data' => $content));
self::$currentIndex = self::$currentIndex.'&details'.$this->table;
$this->processFilter();
return parent::renderList();
}
die;
}
public function postProcess()
+4 -2
View File
@@ -44,6 +44,7 @@ class AddressControllerCore extends FrontController
{
parent::setMedia();
$this->addJS(_THEME_JS_DIR_.'tools/statesManagement.js');
$this->addJS(_PS_JS_DIR_.'validate.js');
}
/**
@@ -268,6 +269,7 @@ class AddressControllerCore extends FrontController
// Assign common vars
$this->context->smarty->assign(array(
'address_validation' => Address::$definition['fields'],
'one_phone_at_least' => (int)Configuration::get('PS_ONE_PHONE_AT_LEAST'),
'onr_phone_at_least' => (int)Configuration::get('PS_ONE_PHONE_AT_LEAST'), //retro compat
'ajaxurl' => _MODULE_DIR_,
@@ -339,8 +341,8 @@ class AddressControllerCore extends FrontController
protected function assignAddressFormat()
{
$id_country = is_null($this->_address)? 0 : (int)$this->_address->id_country;
$dlv_adr_fields = AddressFormat::getOrderedAddressFields($id_country, true, true);
$this->context->smarty->assign('ordered_adr_fields', $dlv_adr_fields);
$ordered_adr_fields = AddressFormat::getOrderedAddressFields($id_country, true, true);
$this->context->smarty->assign('ordered_adr_fields', $ordered_adr_fields);
}
/**
+6
View File
@@ -65,6 +65,7 @@ class CompareControllerCore extends FrontController
die('1');
}
die('0');
}
/**
@@ -73,6 +74,8 @@ class CompareControllerCore extends FrontController
*/
public function initContent()
{
if (Tools::getValue('ajax'))
return;
parent::initContent();
//Clean compare product table
@@ -86,7 +89,10 @@ class CompareControllerCore extends FrontController
if (($product_list = Tools::getValue('compare_product_list')) && ($postProducts = (isset($product_list) ? rtrim($product_list, '|') : '')))
$ids = array_unique(explode('|', $postProducts));
else if (isset($this->context->cookie->id_compare))
{
$ids = CompareProduct::getCompareProducts($this->context->cookie->id_compare);
Tools::redirect($this->context->link->getPageLink('products-comparison', null, $this->context->language->id, array('compare_product_list' => implode('|', $ids))));
}
else
$ids = null;