mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-21 20:34:57 +09:00
Batch delete implemented for Subscriptions list
This commit is contained in:
1 parent
af51224e61
commit
dfdd542071
2 files changed
+25
-1
No files matched your search
@@ -905,4 +905,25 @@ class Admin extends \Api_Abstract
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes subscriptions with given IDs
|
||||
*
|
||||
* @param array $ids - IDs for deletion
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function batch_delete_subscription($data)
|
||||
{
|
||||
$required = array(
|
||||
'ids' => 'IDs not passed',
|
||||
);
|
||||
$this->di['validator']->checkRequiredParamsForArray($required, $data);
|
||||
|
||||
foreach ($data['ids'] as $id) {
|
||||
$this->subscription_delete(array('id' => $id));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,7 @@
|
||||
<table class="tableStatic wide">
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="width: 2%"><input type="checkbox" class="batch-delete-master-checkbox"/></td>
|
||||
<th colspan="2">{% trans 'ID' %}</th>
|
||||
<th>{% trans 'Status' %}</th>
|
||||
<th>{% trans 'Gateway' %}</th>
|
||||
@@ -33,6 +34,7 @@
|
||||
{% set subscriptions = admin.invoice_subscription_get_list({"per_page":30, "page":request.page}|merge(request)) %}
|
||||
{% for i, subscription in subscriptions.list %}
|
||||
<tr>
|
||||
<td><input type="checkbox" class="batch-delete-checkbox" data-item-id="{{ subscription.id }}"/></td>
|
||||
<td style="width:5%;"><a href="{{ 'client/manage'|alink }}/{{ subscription.client.id }}"><img src="{{ subscription.client.email|gravatar }}?size=20" alt="{{ subscription.client.email }}" title="{{subscription.client.first_name}} {{subscription.client.last_name}}"/></a></td>
|
||||
<td>{{ subscription.sid }}</td>
|
||||
<td>{{ mf.status_name(subscription.status) }}</td>
|
||||
@@ -52,7 +54,8 @@
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% include "partial_batch_delete.phtml" with {'action' : 'admin/invoice/batch_delete_subscription'} %}
|
||||
|
||||
{% include "partial_pagination.phtml" with {'list': subscriptions, 'url':'invoice/subscriptions'} %}
|
||||
</div>
|
||||
|
||||
|
||||
Reference in new issue
Block a user