[+] MO : multi-shop allow the removal of a shop if it has no order and no customer

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9722 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
hAitmansour
2011-10-28 14:19:13 +00:00
parent c5dd56aa5f
commit cff9554dda
2 changed files with 37 additions and 2 deletions
+15 -1
View File
@@ -34,7 +34,7 @@ class AdminShop extends AdminTab
$this->table = 'shop';
$this->className = 'Shop';
$this->edit = true;
$this->delete = false;
$this->delete = true;
$this->deleted = false;
$this->_select = 'gs.name group_shop_name, cl.name category_name';
@@ -73,6 +73,20 @@ class AdminShop extends AdminTab
$newShop->copyShopData((int)Tools::getValue('importFromShop'), $importData);
}
public function getList($id_lang, $orderBy = NULL, $orderWay = NULL, $start = 0, $limit = NULL, $id_lang_shop = false)
{
parent::getList($id_lang, $orderBy, $orderWay, $start, $limit, $id_lang_shop);
$shop_delete_list = array();
// test store authorized to remove
foreach($this->_list as $shop)
{
if(Shop::has_dependency($shop['id_shop']))
$shop_delete_list[] = $shop['id_shop'];
}
$this->_listSkipDelete = $shop_delete_list;
}
public function postProcess()
{
if ((Tools::isSubmit('status') || Tools::isSubmit('status'.$this->table) || (Tools::isSubmit('submitAdd'.$this->table) && Tools::getValue($this->identifier) && !Tools::getValue('active'))) && $this->loadObject() && $this->loadObject()->active)