// Fixed revision 13573

This commit is contained in:
bMancone
2012-02-28 13:13:47 +00:00
parent 7b5ddd5039
commit 362258ede6
14 changed files with 85 additions and 45 deletions
+12 -3
View File
@@ -160,11 +160,14 @@ class CMSCore extends ObjectModel
public static function cleanPositions($id_category)
{
$result = Db::getInstance()->executeS('
$sql = '
SELECT `id_cms`
FROM `'._DB_PREFIX_.'cms`
WHERE `id_cms_category` = '.(int)$id_category.'
ORDER BY `position`');
ORDER BY `position`';
$result = Db::getInstance()->executeS($sql);
for ($i = 0, $total = count($result); $i < $total; ++$i)
{
$sql = 'UPDATE `'._DB_PREFIX_.'cms`
@@ -178,7 +181,12 @@ class CMSCore extends ObjectModel
public static function getLastPosition($id_category)
{
return (Db::getInstance()->getValue('SELECT MAX(position)+1 FROM `'._DB_PREFIX_.'cms` WHERE `id_cms_category` = '.(int)$id_category));
$sql = '
SELECT MAX(position) + 1
FROM `'._DB_PREFIX_.'cms`
WHERE `id_cms_category` = '.(int)$id_category;
return (Db::getInstance()->getValue($sql));
}
public static function getCMSPages($id_lang = null, $id_cms_category = null, $active = true)
@@ -207,6 +215,7 @@ class CMSCore extends ObjectModel
LEFT JOIN `'._DB_PREFIX_.'lang` AS l ON c.`id_lang` = l.`id_lang`
WHERE c.`id_cms` = '.(int)$id_cms.'
AND l.`active` = 1';
return Db::getInstance()->executeS($sql);
}
}
+6
View File
@@ -307,6 +307,11 @@ abstract class CacheCore
return isset(Cache::$local[$key]) ? Cache::$local[$key] : null;
}
public static function retrieveAll()
{
return Cache::$local;
}
public static function isStored($key)
{
return isset(Cache::$local[$key]);
@@ -324,4 +329,5 @@ abstract class CacheCore
else
unset(Cache::$local[$key]);
}
}
+2
View File
@@ -165,6 +165,8 @@ class SupplyOrderStateCore extends ObjectModel
if ($ids)
$query->where('s.id_supply_order_state NOT IN('.implode(',', array_map('intval', $ids)).')');
$query->orderBy('sl.name ASC');
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query);
}