[-] BO : BugFix : #PSTEST-1054 : Employees and permission updated

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@14401 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
vChabot
2012-04-02 10:05:24 +00:00
parent a606f14f76
commit 3c8af49bdb
5 changed files with 117 additions and 10 deletions
+19
View File
@@ -464,4 +464,23 @@ class TabCore extends ObjectModel
return parent::update($null_values);
}
public static function getTabByIdProfile($id_parent, $id_profile)
{
return Db::getInstance()->executeS('
SELECT t.`id_tab`, t.`id_parent`, tl.`name`, a.`id_profile`
FROM `'._DB_PREFIX_.'tab` t
LEFT JOIN `'._DB_PREFIX_.'access` a
ON (a.`id_tab` = t.`id_tab`)
LEFT JOIN `'._DB_PREFIX_.'tab_lang` tl
ON (t.`id_tab` = tl.`id_tab` AND tl.`id_lang` = '.(int)Context::getContext()->language->id.')
WHERE a.`id_profile` = '.(int)$id_profile.'
AND t.`id_parent` = '.(int)$id_parent.'
AND a.`view` = 1
AND a.`edit` = 1
AND a.`delete` = 1
AND a.`add` = 1
ORDER BY t.`id_parent` ASC
');
}
}