// Merge -> 10309

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10333 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-11-21 11:05:10 +00:00
parent 2537c72189
commit 9d10de0848
365 changed files with 11185 additions and 1571 deletions
+3 -1
View File
@@ -115,11 +115,13 @@ class TabCore extends ObjectModel
');
if (!$profiles || empty($profiles))
return false;
/* Query definition */
// note : insert ignore should be avoided
$query = 'INSERT IGNORE INTO `'._DB_PREFIX_.'access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`) VALUES ';
// default admin
$query .= '(1, '.(int)$id_tab.', 1, 1, 1, 1),';
foreach ($profiles as $profile)
{
// no cast needed for profile[id_profile], which cames from db
@@ -251,7 +253,7 @@ class TabCore extends ObjectModel
public static function getNewLastPosition($id_parent)
{
return (Db::getInstance()->getValue('
SELECT MAX(position)+1
SELECT IFNULL(MAX(position),0)+1
FROM `'._DB_PREFIX_.'tab`
WHERE `id_parent` = '.(int)$id_parent
));