// Normalize adminRequestController

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9006 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-10-04 08:08:43 +00:00
parent 61d80451da
commit d2a0cf76ee
@@ -187,6 +187,7 @@ class AdminRequestSqlControllerCore extends AdminController
else else
$this->_errors[] = Tools::DisplayError($this->l('Error')); $this->_errors[] = Tools::DisplayError($this->l('Error'));
break; break;
case 'checkedSelect': case 'checkedSelect':
if (isset($e[$key]['table'])) if (isset($e[$key]['table']))
$this->_errors[] = Tools::DisplayError($this->l('The Table ').' "'.$e[$key]['table'].'" '.$this->l(' doesn\'t exist.')); $this->_errors[] = Tools::DisplayError($this->l('The Table ').' "'.$e[$key]['table'].'" '.$this->l(' doesn\'t exist.'));
@@ -198,6 +199,7 @@ class AdminRequestSqlControllerCore extends AdminController
else else
$this->_errors[] = Tools::DisplayError($this->l('Error')); $this->_errors[] = Tools::DisplayError($this->l('Error'));
break; break;
case 'checkedWhere': case 'checkedWhere':
if (isset($e[$key]['operator'])) if (isset($e[$key]['operator']))
$this->_errors[] = Tools::DisplayError($this->l('The operator ').' "'.$e[$key]['operator'].'" '.$this->l(' used is incorrect.')); $this->_errors[] = Tools::DisplayError($this->l('The operator ').' "'.$e[$key]['operator'].'" '.$this->l(' used is incorrect.'));
@@ -207,6 +209,7 @@ class AdminRequestSqlControllerCore extends AdminController
else else
$this->_errors[] = Tools::DisplayError($this->l('Error')); $this->_errors[] = Tools::DisplayError($this->l('Error'));
break; break;
case 'checkedHaving': case 'checkedHaving':
if (isset($e[$key]['operator'])) if (isset($e[$key]['operator']))
$this->_errors[] = Tools::DisplayError($this->l('The operator ').' "'.$e[$key]['operator'].'" '.$this->l(' used is incorrect.')); $this->_errors[] = Tools::DisplayError($this->l('The operator ').' "'.$e[$key]['operator'].'" '.$this->l(' used is incorrect.'));
@@ -216,6 +219,7 @@ class AdminRequestSqlControllerCore extends AdminController
else else
$this->_errors[] = Tools::DisplayError($this->l('Error')); $this->_errors[] = Tools::DisplayError($this->l('Error'));
break; break;
case 'checkedOrder': case 'checkedOrder':
if (isset($e[$key]['attribut'])) if (isset($e[$key]['attribut']))
$this->_errors[] = Tools::DisplayError($this->l('The attribute ').' "'. $this->_errors[] = Tools::DisplayError($this->l('The attribute ').' "'.
@@ -223,6 +227,7 @@ class AdminRequestSqlControllerCore extends AdminController
else else
$this->_errors[] = Tools::DisplayError($this->l('Error')); $this->_errors[] = Tools::DisplayError($this->l('Error'));
break; break;
case 'checkedGroupBy': case 'checkedGroupBy':
if (isset($e[$key]['attribut'])) if (isset($e[$key]['attribut']))
$this->_errors[] = Tools::DisplayError($this->l('The attribute ').' "'. $this->_errors[] = Tools::DisplayError($this->l('The attribute ').' "'.
@@ -230,9 +235,11 @@ class AdminRequestSqlControllerCore extends AdminController
else else
$this->_errors[] = Tools::DisplayError($this->l('Error')); $this->_errors[] = Tools::DisplayError($this->l('Error'));
break; break;
case 'checkedLimit': case 'checkedLimit':
$this->_errors[] = Tools::DisplayError($this->l('The LIMIT clause must contain numeric arguments.')); $this->_errors[] = Tools::DisplayError($this->l('The LIMIT clause must contain numeric arguments.'));
break; break;
case 'returnNameTable': case 'returnNameTable':
if (isset($e[$key]['reference'])) if (isset($e[$key]['reference']))
$this->_errors[] = Tools::DisplayError($this->l('The reference ').'"'. $this->_errors[] = Tools::DisplayError($this->l('The reference ').'"'.
@@ -240,15 +247,14 @@ class AdminRequestSqlControllerCore extends AdminController
else else
$this->_errors[] = Tools::DisplayError($this->l('When multiple tables are used, each attribute must be referenced to a table.')); $this->_errors[] = Tools::DisplayError($this->l('When multiple tables are used, each attribute must be referenced to a table.'));
break; break;
case 'testedRequired': case 'testedRequired':
$this->_errors[] = Tools::DisplayError($e[$key].' '.$this->l(' doesn\'t exist.')); $this->_errors[] = Tools::DisplayError($e[$key].' '.$this->l(' doesn\'t exist.'));
break; break;
case 'testedUnauthorized': case 'testedUnauthorized':
$this->_errors[] = Tools::DisplayError($e[$key].' '.$this->l(' is a unauthorized keyword.')); $this->_errors[] = Tools::DisplayError($e[$key].' '.$this->l(' is a unauthorized keyword.'));
break; break;
default:
break;
} }
} }
} }
@@ -261,11 +267,13 @@ class AdminRequestSqlControllerCore extends AdminController
return; return;
$smarty = $this->context->smarty; $smarty = $this->context->smarty;
$smarty->assign('tab_form', array('current' => self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token, $smarty->assign('tab_form', array(
'current' => self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token,
'id' => $obj->id, 'id' => $obj->id,
'table' => $this->table, 'table' => $this->table,
'name' => $this->getFieldValue($obj, 'name'), 'name' => $this->getFieldValue($obj, 'name'),
'sql' => $this->getFieldValue($obj, 'sql'))); 'sql' => $this->getFieldValue($obj, 'sql')
));
} }
public function init() public function init()
@@ -298,8 +306,10 @@ class AdminRequestSqlControllerCore extends AdminController
break; break;
} }
$smarty->assign('info', $this->info); $smarty->assign(array(
$smarty->assign('warning', $this->warning); 'info' => $this->info,
'warning' =>$this->warning,
));
parent::initContent(); parent::initContent();
} }