//added bulk action for enable or disable item

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15822 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
vAugagneur
2012-06-04 12:00:09 +00:00
parent 71d8a9ff92
commit 4179bc4d74
11 changed files with 147 additions and 37 deletions
+40
View File
@@ -2527,6 +2527,46 @@ class AdminControllerCore extends Controller
else
return false;
}
/**
* Enable multiple items
*
* @return boolean true if succcess
*/
protected function processBulkEnableSelection()
{
return $this->processBulkStatusSelection(1);
}
/**
* Disable multiple items
*
* @return boolean true if succcess
*/
protected function processBulkDisableSelection()
{
return $this->processBulkStatusSelection(0);
}
/**
* Toggle status of multiple items
*
* @return boolean true if succcess
*/
protected function processBulkStatusSelection($status)
{
$result = true;
if (is_array($this->boxes) && !empty($this->boxes))
{
foreach ($this->boxes as $id)
{
$object = new $this->className((int)$id);
$object->active = (int)$status;
$result &= $object->update();
}
}
return $result;
}
protected function processBulkAffectZone()
{