mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-21 20:34:57 +09:00
Batch delete implemented for Tickets list
This commit is contained in:
1 parent
936c5e211b
commit
891fd99fed
2 files changed
+25
No files matched your search
@@ -793,4 +793,25 @@ class Admin extends \Api_Abstract
|
||||
return $this->getService()->ticketTaskComplete($model);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes tickets with given IDs
|
||||
*
|
||||
* @param array $ids - IDs for deletion
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function batch_delete($data)
|
||||
{
|
||||
$required = array(
|
||||
'ids' => 'IDs not passed',
|
||||
);
|
||||
$this->di['validator']->checkRequiredParamsForArray($required, $data);
|
||||
|
||||
foreach ($data['ids'] as $id) {
|
||||
$this->ticket_delete(array('id' => $id));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -120,6 +120,7 @@
|
||||
<table class="tableStatic wide">
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="width: 2%"><input type="checkbox" class="batch-delete-master-checkbox"/></td>
|
||||
<td colspan="2">{% trans 'Client' %}</td>
|
||||
<td>{% trans 'Subject' %}</td>
|
||||
<td>{% trans 'Status' %}</td>
|
||||
@@ -132,6 +133,7 @@
|
||||
{% set tickets = admin.support_ticket_get_list({"per_page":30, "page":request.page}|merge(request)) %}
|
||||
{% for i, ticket in tickets.list %}
|
||||
<tr class="priority_{{ ticket.priority }}">
|
||||
<td><input type="checkbox" class="batch-delete-checkbox" data-item-id="{{ ticket.id }}"/></td>
|
||||
<td style="width:5%"><a href="{{ 'client/manage'|alink }}/{{ ticket.client_id }}"><img src="{{ ticket.client.email|gravatar }}?size=20" alt="gravatar" /></a></td>
|
||||
<td style="width:20%"><a href="{{ 'client/manage'|alink }}/{{ ticket.client_id }}">{{ ticket.client.first_name|truncate(1, null, '.') }} {{ ticket.client.last_name }}</a></td>
|
||||
<td>
|
||||
@@ -161,6 +163,8 @@
|
||||
</tbody>
|
||||
</table>
|
||||
{% include "partial_pagination.phtml" with {'list': tickets, 'url':'support'} %}
|
||||
{% include "partial_batch_delete.phtml" with {'action':'admin/support/batch_delete'} %}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab_content nopadding" id="tab-new">
|
||||
|
||||
Reference in new issue
Block a user