// Fix bulk deletion of attributes

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13327 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean committed 2012-02-14 17:34:08 +00:00
1 parent 3bf25c8205
commit 8897f81335
3 files changed
+26 -1

No files matched your search

@@ -28,7 +28,7 @@
{if $bulk_actions} {if $bulk_actions}
<p> <p>
{foreach $bulk_actions as $key => $params} {foreach $bulk_actions as $key => $params}
<input type="submit" class="button" name="submitBulk{$key}{$table}" value="{$params.text}" {if isset($params.confirm)}onclick="return confirm('{$params.confirm}');"{/if} /> <input type="submit" class="button" name="submitBulk{$key}" value="{$params.text}" {if isset($params.confirm)}onclick="return confirm('{$params.confirm}');"{/if} />
{/foreach} {/foreach}
</p> </p>
{/if} {/if}
+1
View File
@@ -2413,6 +2413,7 @@ class AdminControllerCore extends Controller
if (is_array($this->boxes) && !empty($this->boxes)) if (is_array($this->boxes) && !empty($this->boxes))
{ {
$object = new $this->className(); $object = new $this->className();
if (isset($object->noZeroObject)) if (isset($object->noZeroObject))
{ {
$objects_count = count(call_user_func(array($this->className, $object->noZeroObject))); $objects_count = count(call_user_func(array($this->className, $object->noZeroObject)));
@@ -660,4 +660,28 @@ class AdminAttributesGroupsControllerCore extends AdminController
} }
} }
/**
* Overrides parent to delete items from sublist
*
* @param $token
* @return mixed
*/
public function processBulkDelete($token)
{
// If we are deleting attributes instead of attribute_groups
if (Tools::getIsset('attributeBox'))
{
$this->className = 'Attribute';
$this->table = 'attribute';
$this->boxes = Tools::getValue($this->table.'Box');
}
$result = parent::processBulkDelete($token);
// Restore vars
$this->className = 'AttributeGroup';
$this->table = 'attribute_group';
return $result;
}
} }