[+] BO : New Bulk actions button

This commit is contained in:
Jerome Nadaud committed 2013-08-06 19:04:44 +02:00
1 parent 0c4aeb31b8
commit bb4a72f46d
2 files changed
+20 -4

No files matched your search

@@ -25,11 +25,21 @@
</table> </table>
{if $bulk_actions} {if $bulk_actions}
<p> <div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
{l s='Bulk actions'} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href=""><i class="icon-check-sign"></i>&nbsp;{l s='Select all'}</a></li>
<li><a href=""><i class="icon-check-empty"></i>&nbsp;{l s='Unselect all'}</a></li>
<li class="divider"></li>
{foreach $bulk_actions as $key => $params} {foreach $bulk_actions as $key => $params}
<input type="submit" class="btn btn-default" name="submitBulk{$key}{$table}" value="{$params.text}" {if isset($params.confirm)}onclick="return confirm('{$params.confirm}');"{/if} /> <li{if $params.text == 'divider'} class="divider"{/if}>
{if $params.text != 'divider'}<a href=""><i class="{$params.icon}"></i>&nbsp;{$params.text}</a>{/if}
</li>
{/foreach} {/foreach}
</p> </ul>
</div>
{/if} {/if}
{if !$simple_header && $list_total > 20} {if !$simple_header && $list_total > 20}
@@ -38,7 +38,13 @@ class AdminSuppliersControllerCore extends AdminController
$this->addRowAction('delete'); $this->addRowAction('delete');
$this->allow_export = true; $this->allow_export = true;
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'))); $this->bulk_actions = array(
'delete' => array(
'text' => $this->l('Delete selected'),
'icon' => $this->l('icon-trash'),
'confirm' => $this->l('Delete selected items?')
)
);
$this->_select = 'COUNT(DISTINCT ps.`id_product`) AS products'; $this->_select = 'COUNT(DISTINCT ps.`id_product`) AS products';
$this->_join = 'LEFT JOIN `'._DB_PREFIX_.'product_supplier` ps ON (a.`id_supplier` = ps.`id_supplier`)'; $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'product_supplier` ps ON (a.`id_supplier` = ps.`id_supplier`)';