Skip to content

Commit

Permalink
Merge branch '1.6' of https://github.com/PrestaShop/PrestaShop into 1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Shipow committed Feb 25, 2014
2 parents e5f16d3 + 1531cd9 commit 33c900e
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
{/if}
{if $add_permission eq '1'}
<li>
<a id="desc-module-new" class="toolbar_btn" href="#top_container" onclick="$('#module_install').slideToggle();" title="{l s='Add a new module'}">
<a id="desc-module-new" class="toolbar_btn" href="#module_install" onclick="$('#module_install').slideToggle();" title="{l s='Add a new module'}">
<i class="process-icon-new" ></i>
<div>{l s='Add a new module'}</div>
</a>
Expand Down
3 changes: 2 additions & 1 deletion classes/AddressFormat.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ protected function _checkValidateClassField($className, $fieldName, $isIdField)
{
$propertyName = $property->getName();
if (($propertyName == $fieldName) && ($isIdField ||
(!preg_match('#id|id_\w#', $propertyName))))
(!preg_match('/\bid\b|id_\w+|\bid[A-Z]\w+/', $propertyName))))
$isValide = true;
}

Expand Down Expand Up @@ -227,6 +227,7 @@ public function checkFormatFields()
}
}
}

return (count($this->_errorFormatList)) ? false : true;
}

Expand Down
2 changes: 1 addition & 1 deletion controllers/admin/AdminCartsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ public function displayDeleteLink($token = null, $id, $name = null)
{
// don't display ordered carts
foreach ($this->_list as $row)
if ($row['id_cart'] == $id && isset($row['id_order']) && $row['id_order'])
if ($row['id_cart'] == $id && isset($row['id_order']) && is_numeric($row['id_order']))
return ;

return $this->helper->displayDeleteLink($token, $id, $name);
Expand Down
1 change: 1 addition & 0 deletions controllers/admin/AdminCategoriesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public function __construct()
$this->lang = true;
$this->deleted = false;
$this->explicitSelect = true;
$this->_defaultOrderBy = 'position';
$this->allow_export = true;

$this->context = Context::getContext();
Expand Down
19 changes: 9 additions & 10 deletions controllers/admin/AdminCountriesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -425,14 +425,14 @@ public function postProcess()
if (Tools::isSubmit('standardization'))
Configuration::updateValue('PS_TAASC', (bool)Tools::getValue('standardization', false));

return parent::postProcess();
}

public function processSave()
{
if (!count($this->errors))
$res = parent::postProcess();
else
return false;

if (Tools::getValue('submitAdd'.$this->table) && $res)
{
$id_country = ($id_country = Tools::getValue('id_country')) ? $id_country : $res['id'];
$id_country = Tools::getValue('id_country');
$tmp_addr_format = new AddressFormat($id_country);

$save_status = false;
Expand All @@ -445,25 +445,24 @@ public function postProcess()
}

$tmp_addr_format->format = Tools::getValue('address_layout');

if (strlen($tmp_addr_format->format) > 0)
{
if ($tmp_addr_format->checkFormatFields())
$save_status = ($is_new) ? $tmp_addr_format->save(): $tmp_addr_format->update();
$address_format_result = $tmp_addr_format->save();
else
{
$error_list = $tmp_addr_format->getErrorList();
foreach ($error_list as $num_error => $error)
$this->errors[] = $error;
}

if (!$save_status)
if (!isset($address_format_result) || !$address_format_result)
$this->errors[] = Tools::displayError('Invalid address layout '.Db::getInstance()->getMsgError());
}
unset($tmp_addr_format);
}

return $res;
return parent::processSave();
}

public function processStatus()
Expand Down
2 changes: 1 addition & 1 deletion controllers/front/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function init()
public function setMedia()
{
parent::setMedia();
if (Context::getContext()->getMobileDevice() === false)
if (!$this->useMobileTheme())
$this->addCSS(_THEME_CSS_DIR_.'authentication.css');
$this->addJqueryPlugin('typewatch');
$this->addJS(array(
Expand Down
2 changes: 1 addition & 1 deletion controllers/front/CategoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function setMedia()
{
parent::setMedia();

if ($this->context->getMobileDevice() == false)
if (!$this->useMobileTheme())
{
//TODO : check why cluetip css is include without js file
$this->addCSS(array(
Expand Down
1 change: 0 additions & 1 deletion controllers/front/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class IndexControllerCore extends FrontController
public function initContent()
{
parent::initContent();

$this->addJS(_THEME_JS_DIR_.'index.js');

$this->context->smarty->assign(array('HOOK_HOME' => Hook::exec('displayHome'),
Expand Down
2 changes: 1 addition & 1 deletion controllers/front/OrderOpcController.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ public function setMedia()
{
parent::setMedia();

if ($this->context->getMobileDevice() == false)
if (!$this->useMobileTheme())
{
// Adding CSS style sheet
$this->addCSS(_THEME_CSS_DIR_.'order-opc.css');
Expand Down
4 changes: 2 additions & 2 deletions controllers/front/ParentOrderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function init()

$this->nbProducts = $this->context->cart->nbProducts();

if (!$this->context->customer->isLogged(true) && $this->context->getMobileDevice() && Tools::getValue('step'))
if (!$this->context->customer->isLogged(true) && $this->useMobileTheme() && Tools::getValue('step'))
Tools::redirect($this->context->link->getPageLink('authentication', true, (int)$this->context->language->id));

// Redirect to the good order process
Expand Down Expand Up @@ -142,7 +142,7 @@ public function setMedia()
{
parent::setMedia();

if ($this->context->getMobileDevice() === false)
if (!$this->useMobileTheme())
// Adding CSS style sheet
$this->addCSS(_THEME_CSS_DIR_.'addresses.css');

Expand Down
2 changes: 1 addition & 1 deletion controllers/front/ProductController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function setMedia()
if (count($this->errors))
return ;

if ($this->context->getMobileDevice() == false)
if (!$this->useMobileTheme())
{
$this->addCSS(_THEME_CSS_DIR_.'product.css');
$this->addJqueryPlugin(array('fancybox', 'idTabs', 'scrollTo', 'serialScroll', 'bxslider'));
Expand Down

0 comments on commit 33c900e

Please sign in to comment.