mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-21 20:34:57 +09:00
Finish mass-delete-checkboxes
This commit is contained in:
commit
5a3cdecb89
37 files changed
+771
-6
No files matched your search
@@ -117,4 +117,25 @@ class Admin extends \Api_Abstract
|
||||
$database->trash($model);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes logs 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->log_delete(array('id' => $id));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -722,4 +722,46 @@ class Admin extends \Api_Abstract
|
||||
return $this->di['db']->toArray($model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes clients 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->delete(array('id' => $id));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deletes client login logs with given IDs
|
||||
*
|
||||
* @param array $ids - IDs for deletion
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function batch_delete_log($data)
|
||||
{
|
||||
$required = array(
|
||||
'ids' => 'IDs not passed',
|
||||
);
|
||||
$this->di['validator']->checkRequiredParamsForArray($required, $data);
|
||||
|
||||
foreach ($data['ids'] as $id) {
|
||||
$this->login_history_delete(array('id' => $id));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -406,4 +406,25 @@ class Admin extends \Api_Abstract
|
||||
return $this->getService()->sendTemplate($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes email logs 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->email_delete(array('id' => $id));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,6 +11,7 @@
|
||||
<table class="tableStatic wide">
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="width: 2%"><input type="checkbox" class="batch-delete-master-checkbox"/></td>
|
||||
<td>{% trans 'To' %}</td>
|
||||
<td>{% trans 'From' %}</td>
|
||||
<td>{% trans 'Subject' %}</td>
|
||||
@@ -23,6 +24,7 @@
|
||||
{% set emails = admin.email_email_get_list({"per_page":30, "page":request.page}|merge(request)) %}
|
||||
{% for i, email in emails.list %}
|
||||
<tr>
|
||||
<td><input type="checkbox" class="batch-delete-checkbox" data-item-id="{{ email.id }}"/></td>
|
||||
<td>{{ email.recipients }}</td>
|
||||
<td>{{ email.sender }}</td>
|
||||
<td>{{ email.subject|truncate(40) }}</td>
|
||||
@@ -45,6 +47,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
{% include "partial_batch_delete.phtml" with {'action' : 'admin/email/batch_delete'} %}
|
||||
{% include "partial_pagination.phtml" with {'list': emails, 'url':'email/history'} %}
|
||||
|
||||
{% endblock %}
|
||||
@@ -884,4 +884,88 @@ class Admin extends \Api_Abstract
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes invoices 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->delete(array('id' => $id));
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes transactions with given IDs
|
||||
*
|
||||
* @param array $ids - IDs for deletion
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function batch_delete_transaction($data)
|
||||
{
|
||||
$required = array(
|
||||
'ids' => 'IDs not passed',
|
||||
);
|
||||
$this->di['validator']->checkRequiredParamsForArray($required, $data);
|
||||
|
||||
foreach ($data['ids'] as $id) {
|
||||
$this->transaction_delete(array('id' => $id));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes taxes with given IDs
|
||||
*
|
||||
* @param array $ids - IDs for deletion
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function batch_delete_tax($data)
|
||||
{
|
||||
$required = array(
|
||||
'ids' => 'IDs not passed',
|
||||
);
|
||||
$this->di['validator']->checkRequiredParamsForArray($required, $data);
|
||||
|
||||
foreach ($data['ids'] as $id) {
|
||||
$this->tax_delete(array('id' => $id));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -176,4 +176,25 @@ class Admin extends \Api_Abstract
|
||||
$this->di['logger']->info('Removed news item #%s', $id);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes news items 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->delete(array('id' => $id));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,8 @@
|
||||
<table class="tableStatic wide">
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="width: 2%"><input type="checkbox" class="batch-delete-master-checkbox"/></td>
|
||||
<td>#</td>
|
||||
<td colspan="2">{% trans 'Title' %}</td>
|
||||
<td>{% trans 'Active' %}</td>
|
||||
<td>{% trans 'Date' %}</td>
|
||||
@@ -31,6 +33,7 @@
|
||||
{% set posts = admin.news_get_list({"per_page":30, "page":request.page}|merge(request)) %}
|
||||
{% for i, post in posts.list %}
|
||||
<tr>
|
||||
<td><input type="checkbox" class="batch-delete-checkbox" data-item-id="{{ post.id }}"/></td>
|
||||
<td>{{ post.id }}</td>
|
||||
<td>{{ post.title }}</td>
|
||||
<td>{{ mf.status_name(post.status) }}</td>
|
||||
@@ -51,6 +54,8 @@
|
||||
</tbody>
|
||||
</table>
|
||||
{% include "partial_pagination.phtml" with {'list': posts, 'url':'news/index'} %}
|
||||
{% include "partial_batch_delete.phtml" with {'action' : 'admin/news/batch_delete'} %}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab_content nopadding" id="tab-new">
|
||||
|
||||
@@ -454,4 +454,29 @@ class Admin extends \Api_Abstract
|
||||
|
||||
return $this->di['db']->getExistingModelById('ClientOrder', $data['id'], 'Order not found');
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes orders with given IDs
|
||||
*
|
||||
* @param array $ids - Order ids for deletion
|
||||
*
|
||||
* @optional bool $delete_addons - Remove addons also. Default false.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function batch_delete($data)
|
||||
{
|
||||
$required = array(
|
||||
'ids' => 'Orders ids not passed',
|
||||
);
|
||||
$this->di['validator']->checkRequiredParamsForArray($required, $data);
|
||||
|
||||
$delete_addons = isset($data['delete_addons']) ? (bool)$data['delete_addons'] : false;
|
||||
|
||||
foreach ($data['ids'] as $id) {
|
||||
$this->delete(array('id' => $id, 'delete_addons' => $delete_addons));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -513,4 +513,25 @@ class Admin extends \Api_Abstract
|
||||
$this->di['logger']->info('Changed profile password');
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes admin login logs with given IDs
|
||||
*
|
||||
* @param array $ids - IDs for deletion
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function batch_delete_logs($data)
|
||||
{
|
||||
$required = array(
|
||||
'ids' => 'IDs not passed',
|
||||
);
|
||||
$this->di['validator']->checkRequiredParamsForArray($required, $data);
|
||||
|
||||
foreach ($data['ids'] as $id) {
|
||||
$this->login_history_delete(array('id' => $id));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -793,4 +793,46 @@ 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes tickets with given IDs
|
||||
*
|
||||
* @param array $ids - IDs for deletion
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function batch_delete_public($data)
|
||||
{
|
||||
$required = array(
|
||||
'ids' => 'IDs not passed',
|
||||
);
|
||||
$this->di['validator']->checkRequiredParamsForArray($required, $data);
|
||||
|
||||
foreach ($data['ids'] as $id) {
|
||||
$this->public_ticket_delete(array('id' => $id));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@
|
||||
<table class="tableStatic wide">
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="width: 2%"><input type="checkbox" class="batch-delete-master-checkbox"/></td>
|
||||
<td colspan="2">{% trans 'Message' %}</td>
|
||||
<td>{% trans 'Ip' %}</td>
|
||||
<td>{% trans 'Country' %}</td>
|
||||
@@ -23,6 +24,7 @@
|
||||
{% set events = admin.activity_log_get_list({"per_page":10, "page":request.page}|merge(request)) %}
|
||||
{% for i, event in events.list %}
|
||||
<tr>
|
||||
<td><input type="checkbox" class="batch-delete-checkbox" data-item-id="{{ event.id }}"/></td>
|
||||
<td>
|
||||
{% if event.client %}
|
||||
<a href="{{ 'client/manage'|alink }}/{{ event.client.id }}" title="{{ event.client.name }}"><img src="{{ event.client.email|gravatar }}?size=20" alt="{{ event.client.name }}" /> {{ event.client.name }} </a>
|
||||
@@ -51,7 +53,7 @@
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
{% include "partial_batch_delete.phtml" with {'action' : 'admin/activity/batch_delete'} %}
|
||||
{% include "partial_pagination.phtml" with {'list': events, 'url':'activity'} %}
|
||||
|
||||
{% endblock %}
|
||||
@@ -113,6 +113,7 @@
|
||||
<table class="tableStatic wide">
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="width: 2%"><input type="checkbox" class="batch-delete-master-checkbox"/></td>
|
||||
<td colspan="2">{% trans 'Name' %}</td>
|
||||
<td>{% trans 'Company' %}</td>
|
||||
<td width="30%">{% trans 'Email' %}</td>
|
||||
@@ -126,6 +127,7 @@
|
||||
{% set clients = admin.client_get_list({"per_page":30, "page":request.page}|merge(request)) %}
|
||||
{% for client in clients.list %}
|
||||
<tr>
|
||||
<td><input type="checkbox" class="batch-delete-checkbox" data-item-id="{{ client.id }}"/></td>
|
||||
<td>
|
||||
<a href="{{ 'client/manage'|alink }}/{{ client.id }}"><img src="{{ client.email|gravatar }}?size=20" alt="{{ client.id }}" /></a>
|
||||
</td>
|
||||
@@ -153,7 +155,8 @@
|
||||
</div>
|
||||
|
||||
<div class="fix"></div>
|
||||
|
||||
{% include "partial_batch_delete.phtml" with {'action' : 'admin/client/batch_delete'} %}
|
||||
|
||||
<div class="tab_content nopadding" id="tab-new">
|
||||
|
||||
<form method="post" action="{{ 'api/admin/client/create'|link }}" class="mainForm api-form save" data-api-redirect="{{ 'client'|alink }}">
|
||||
@@ -268,7 +271,7 @@
|
||||
</div>
|
||||
<div class="fix"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<input type="submit" value="{% trans 'Create' %}" class="greyishBtn submitForm" />
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
@@ -11,6 +11,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 'IP' %}</td>
|
||||
<td>{% trans 'Country' %}</td>
|
||||
@@ -23,6 +24,7 @@
|
||||
{% set history = admin.client_login_history_get_list({"per_page":30, "page":request.page}|merge(request)) %}
|
||||
{% for i, event in history.list %}
|
||||
<tr>
|
||||
<td><input type="checkbox" class="batch-delete-checkbox" data-item-id="{{ event.id }}"/></td>
|
||||
<td style="width:5%"><a href="{{ 'client/manage'|alink }}/{{ event.client.id }}"><img src="{{ event.client.email|gravatar }}?size=20" alt="{{ event.client.email }}" /></a></td>
|
||||
<td>{{ event.client.first_name }} {{ event.client.last_name }}</td>
|
||||
<td>{{ event.ip }}</td>
|
||||
@@ -42,7 +44,8 @@
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
{% include "partial_pagination.phtml" with {'list': history, 'url':'client/logins'} %}
|
||||
{% include "partial_batch_delete.phtml" with {'action' : 'admin/client/batch_delete_log'} %}
|
||||
{% include "partial_pagination.phtml" with {'list': history, 'url':'client/logins'} %}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -109,6 +109,7 @@
|
||||
<table class="tableStatic wide">
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="width: 2%"><input type="checkbox" class="batch-delete-master-checkbox"/></td>
|
||||
<td colspan="3">{% trans 'Invoice' %}</td>
|
||||
<td>{% trans 'Amount' %}</td>
|
||||
<td>{% trans 'Issued at' %}</td>
|
||||
@@ -121,6 +122,7 @@
|
||||
{% set invoices = admin.invoice_get_list({"per_page":30, "page":request.page}|merge(request)) %}
|
||||
{% for invoice in invoices.list %}
|
||||
<tr>
|
||||
<td><input type="checkbox" class="batch-delete-checkbox" data-item-id="{{ invoice.id }}"/></td>
|
||||
<td style="width:5%;"><img src="{{ invoice.buyer.email|gravatar }}?size=20" alt="{{ invoice.buyer.email }}" title="{{invoice.buyer.first_name}} {{invoice.buyer.last_name}}"/></td>
|
||||
<td><a href="{{ 'client'|alink }}/manage/{{ invoice.client.id }}">{{invoice.client.first_name|truncate(1, null, '.')}} {{invoice.client.last_name|truncate(20)}}</a></td>
|
||||
<td style="width:15%;" title="{{invoice.id}}">{{ invoice.serie_nr }}</td>
|
||||
@@ -142,6 +144,7 @@
|
||||
</table>
|
||||
|
||||
{% include "partial_pagination.phtml" with {'list': invoices, 'url':'invoice'} %}
|
||||
{% include "partial_batch_delete.phtml" with {'action' : 'admin/invoice/batch_delete'} %}
|
||||
</div>
|
||||
|
||||
<div class="tab_content nopadding" id="tab-new">
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
<table class="tableStatic wide">
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="width: 2%"><input type="checkbox" class="batch-delete-master-checkbox"/></td>
|
||||
<td>{% trans 'Name' %}</td>
|
||||
<td>{% trans 'Country' %}</td>
|
||||
<td>{% trans 'State/Region' %}</td>
|
||||
@@ -29,6 +30,7 @@
|
||||
<tbody>
|
||||
{% for tax in admin.invoice_tax_get_list({"per_page":100}).list %}
|
||||
<tr>
|
||||
<td><input type="checkbox" class="batch-delete-checkbox" data-item-id="{{ tax.id }}"/></td>
|
||||
<td>{{ tax.name }}</td>
|
||||
<td>
|
||||
{% if tax.country %}
|
||||
@@ -62,6 +64,8 @@
|
||||
</tbody>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% include "partial_batch_delete.phtml" with {'action' : 'admin/invoice/batch_delete_tax'} %}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab_content nopadding" id="tab-settings">
|
||||
|
||||
@@ -104,6 +104,7 @@
|
||||
<table class="tableStatic wide">
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="width: 2%"><input type="checkbox" class="batch-delete-master-checkbox"/></td>
|
||||
<td width="5%">{% trans 'Invoice' %}</td>
|
||||
<td>{% trans 'Type' %}</td>
|
||||
<td>{% trans 'Status' %}</td>
|
||||
@@ -118,6 +119,7 @@
|
||||
{% set transactions = admin.invoice_transaction_get_list({"per_page":30, "page":request.page}|merge(request)) %}
|
||||
{% for i, tx in transactions.list %}
|
||||
<tr>
|
||||
<td><input type="checkbox" class="batch-delete-checkbox" data-item-id="{{ tx.id }}"/></td>
|
||||
<td>{% if tx.invoice_id %}<a href="{{ 'invoice/manage'|alink }}/{{tx.invoice_id}}">#{{ tx.invoice_id }}</a>{%else%}n/a{% endif %}</td>
|
||||
<td>{{mf.status_name(tx.type|default('-')) }}</td>
|
||||
<td>{% if tx.error %}<a href="#" onclick="bb.msg('{{ tx.error }}','{{ tx.error_code }}'); return false;">{{ tx.error_code }}</a>{% else %}{{mf.status_name(tx.status) }}{% endif %}</td>
|
||||
@@ -139,6 +141,9 @@
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% include "partial_batch_delete.phtml" with {'action':'admin/invoice/batch_delete_transaction'} %}
|
||||
|
||||
</div>
|
||||
{% include "partial_pagination.phtml" with {'list': transactions, 'url':'invoice/transactions'} %}
|
||||
{% endblock %}
|
||||
@@ -119,6 +119,7 @@
|
||||
<table class="tableStatic wide">
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="width: 2%"><input type="checkbox" class="batch-delete-master-checkbox"/></td>
|
||||
<td>{% trans 'ID' %}</td>
|
||||
<td width="25%" colspan="2">{% trans 'Client' %}</td>
|
||||
<td width="40%">{% trans 'Title' %}</td>
|
||||
@@ -133,6 +134,7 @@
|
||||
{% set orders = admin.order_get_list({"per_page":30, "page":request.page}|merge(request)) %}
|
||||
{% for i, order in orders.list %}
|
||||
<tr>
|
||||
<td><input type="checkbox" class="batch-delete-checkbox" data-item-id="{{ order.id }}"/></td>
|
||||
<td>{{order.id}}</td>
|
||||
<td><a href="{{ 'client/manage'|alink }}/{{ order.client_id }}"><img src="{{ order.client.email|gravatar }}?size=20" alt="{{ order.client.email }}" /></a></td>
|
||||
<td><a href="{{ 'client/manage'|alink }}/{{ order.client_id }}">{{order.client.first_name}} {{order.client.last_name}}</a></td>
|
||||
@@ -153,6 +155,7 @@
|
||||
</tbody>
|
||||
</table>
|
||||
{% include "partial_pagination.phtml" with {'list': orders, 'url':'order'} %}
|
||||
{% include "partial_batch_delete.phtml" with {'action' : 'admin/order/batch_delete'} %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<table class="tableStatic wide">
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="width: 2%"><input type="checkbox" class="batch-delete-master-checkbox"/></td>
|
||||
<td colspan="2">{% trans 'Admin' %}</td>
|
||||
<td>{% trans 'IP' %}</td>
|
||||
<td>{% trans 'Country' %}</td>
|
||||
@@ -23,6 +24,7 @@
|
||||
{% set history = admin.staff_login_history_get_list({"per_page":30, "page":request.page}|merge(request)) %}
|
||||
{% for i, event in history.list %}
|
||||
<tr>
|
||||
<td><input type="checkbox" class="batch-delete-checkbox" data-item-id="{{ event.id }}"/></td>
|
||||
<td style="width:5%"><a href="{{ 'staff/manage'|alink }}/{{ event.staff.id }}"><img src="{{ event.staff.email|gravatar }}?size=20" alt="{{ event.staff.email }}" /></a></td>
|
||||
<td>{{ event.staff.name }}</td>
|
||||
<td>{{ event.ip }}</td>
|
||||
@@ -45,4 +47,6 @@
|
||||
</div>
|
||||
|
||||
{% include "partial_pagination.phtml" with {'list': history, 'url':'staff/logins'} %}
|
||||
{% include "partial_batch_delete.phtml" with {'action' : 'admin/staff/batch_delete_logs'} %}
|
||||
|
||||
{% endblock %}
|
||||
@@ -21,6 +21,7 @@
|
||||
<table class="tableStatic wide">
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="width: 2%"><input type="checkbox" class="batch-delete-master-checkbox"/></td>
|
||||
<td style="width: 50%">{% trans 'Subject' %}</td>
|
||||
<td>{% trans 'Email' %}</td>
|
||||
<td>{% trans 'Status' %}</td>
|
||||
@@ -33,6 +34,7 @@
|
||||
{% set tickets = admin.support_public_ticket_get_list({"per_page":30, "page":request.page}|merge(request)) %}
|
||||
{% for i, ticket in tickets.list %}
|
||||
<tr>
|
||||
<td><input type="checkbox" class="batch-delete-checkbox" data-item-id="{{ ticket.id }}"/></td>
|
||||
<td><a href="{{ '/support/public-ticket'|alink }}/{{ticket.id}}">#{{ ticket.id }} - {{ ticket.subject }} ({{ ticket.messages|length}})</a></td>
|
||||
<td>{{ ticket.author_email }}</td>
|
||||
<td>{{ mf.status_name(ticket.status) }}</td>
|
||||
@@ -52,4 +54,6 @@
|
||||
</table>
|
||||
</div>
|
||||
{% include "partial_pagination.phtml" with {'list': tickets, 'url':'support/public-tickets'} %}
|
||||
{% include "partial_batch_delete.phtml" with {'action':'admin/support/batch_delete_public'} %}
|
||||
|
||||
{% endblock %}
|
||||
@@ -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">
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
<a class="bb-button btn14" id="batch-delete-selected-btn" style="margin: 10px"><img src="images/icons/dark/trash.png" alt="" > {% trans 'Delete selected' %}</a>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#batch-delete-selected-btn').click(function () {
|
||||
if ($('input.batch-delete-checkbox:checked').length) {
|
||||
jConfirm('Are you sure?', 'Confirm Batch Delete', function (r) {
|
||||
if (r) {
|
||||
var ids = $('input.batch-delete-checkbox:checked').map(function () {
|
||||
return $(this).attr("data-item-id");
|
||||
}).get();
|
||||
bb.post(
|
||||
'{{ action }}',
|
||||
{ids: ids},
|
||||
function (result) {
|
||||
bb.reload();
|
||||
})
|
||||
}
|
||||
});
|
||||
} else {
|
||||
jAlert('You need to select at least one item to delete');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$('input.batch-delete-master-checkbox').click(function () {
|
||||
$('input.batch-delete-checkbox').prop('checked', this.checked);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -178,5 +178,23 @@ class AdminTest extends \PHPUnit_Framework_TestCase {
|
||||
|
||||
$result = $activity->log_delete(array('id' => 1));
|
||||
}
|
||||
|
||||
public function testBatch_delete()
|
||||
{
|
||||
$activityMock = $this->getMockBuilder('\Box\Mod\Activity\Api\Admin')->setMethods(array('log_delete'))->getMock();
|
||||
$activityMock->expects($this->atLeastOnce())->method('log_delete')->will($this->returnValue(true));
|
||||
|
||||
$validatorMock = $this->getMockBuilder('\Box_Validate')->disableOriginalConstructor()->getMock();
|
||||
$validatorMock->expects($this->atLeastOnce())
|
||||
->method('checkRequiredParamsForArray')
|
||||
->will($this->returnValue(null));
|
||||
|
||||
$di = new \Box_Di();
|
||||
$di['validator'] = $validatorMock;
|
||||
$activityMock->setDi($di);
|
||||
|
||||
$result = $activityMock->batch_delete(array('ids' => array(1, 2, 3)));
|
||||
$this->assertEquals(true, $result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1087,4 +1087,42 @@ class AdminTest extends \PHPUnit_Framework_TestCase {
|
||||
$data = array('id' => 1);
|
||||
$admin_Client->login_history_delete($data);
|
||||
}
|
||||
|
||||
public function testBatch_delete()
|
||||
{
|
||||
$activityMock = $this->getMockBuilder('\Box\Mod\Client\Api\Admin')->setMethods(array('delete'))->getMock();
|
||||
$activityMock->expects($this->atLeastOnce())->method('delete')->will($this->returnValue(true));
|
||||
|
||||
$validatorMock = $this->getMockBuilder('\Box_Validate')->disableOriginalConstructor()->getMock();
|
||||
$validatorMock->expects($this->atLeastOnce())
|
||||
->method('checkRequiredParamsForArray')
|
||||
->will($this->returnValue(null));
|
||||
|
||||
$di = new \Box_Di();
|
||||
$di['validator'] = $validatorMock;
|
||||
$activityMock->setDi($di);
|
||||
|
||||
$result = $activityMock->batch_delete(array('ids' => array(1, 2, 3)));
|
||||
$this->assertEquals(true, $result);
|
||||
}
|
||||
|
||||
public function testBatch_delete_log()
|
||||
{
|
||||
$activityMock = $this->getMockBuilder('\Box\Mod\Client\Api\Admin')->setMethods(array('login_history_delete'))->getMock();
|
||||
$activityMock->expects($this->atLeastOnce())->method('login_history_delete')->will($this->returnValue(true));
|
||||
|
||||
$validatorMock = $this->getMockBuilder('\Box_Validate')->disableOriginalConstructor()->getMock();
|
||||
$validatorMock->expects($this->atLeastOnce())
|
||||
->method('checkRequiredParamsForArray')
|
||||
->will($this->returnValue(null));
|
||||
|
||||
$di = new \Box_Di();
|
||||
$di['validator'] = $validatorMock;
|
||||
$activityMock->setDi($di);
|
||||
|
||||
$result = $activityMock->batch_delete_log(array('ids' => array(1, 2, 3)));
|
||||
$this->assertEquals(true, $result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -730,4 +730,22 @@ class AdminTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($result, 'rendered');
|
||||
}
|
||||
|
||||
public function testBatch_delete()
|
||||
{
|
||||
$activityMock = $this->getMockBuilder('\Box\Mod\Email\Api\Admin')->setMethods(array('email_delete'))->getMock();
|
||||
$activityMock->expects($this->atLeastOnce())->method('email_delete')->will($this->returnValue(true));
|
||||
|
||||
$validatorMock = $this->getMockBuilder('\Box_Validate')->disableOriginalConstructor()->getMock();
|
||||
$validatorMock->expects($this->atLeastOnce())
|
||||
->method('checkRequiredParamsForArray')
|
||||
->will($this->returnValue(null));
|
||||
|
||||
$di = new \Box_Di();
|
||||
$di['validator'] = $validatorMock;
|
||||
$activityMock->setDi($di);
|
||||
|
||||
$result = $activityMock->batch_delete(array('ids' => array(1, 2, 3)));
|
||||
$this->assertEquals(true, $result);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1338,6 +1338,80 @@ class AdminTest extends \PHPUnit_Framework_TestCase {
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
public function testBatch_delete()
|
||||
{
|
||||
$activityMock = $this->getMockBuilder('\Box\Mod\Invoice\Api\Admin')->setMethods(array('delete'))->getMock();
|
||||
$activityMock->expects($this->atLeastOnce())->
|
||||
method('delete')->
|
||||
will($this->returnValue(true));
|
||||
$validatorMock = $this->getMockBuilder('\Box_Validate')->disableOriginalConstructor()->getMock();
|
||||
$validatorMock->expects($this->atLeastOnce())
|
||||
->method('checkRequiredParamsForArray')
|
||||
->will($this->returnValue(null));
|
||||
|
||||
$di = new \Box_Di();
|
||||
$di['validator'] = $validatorMock;
|
||||
$activityMock->setDi($di);
|
||||
|
||||
$result = $activityMock->batch_delete(array('ids' => array(1, 2, 3)));
|
||||
$this->assertEquals(true, $result);
|
||||
}
|
||||
|
||||
public function testBatch_delete_subscription()
|
||||
{
|
||||
$activityMock = $this->getMockBuilder('\Box\Mod\Invoice\Api\Admin')->setMethods(array('subscription_delete'))->getMock();
|
||||
$activityMock->expects($this->atLeastOnce())->method('subscription_delete')->will($this->returnValue(true));
|
||||
|
||||
$validatorMock = $this->getMockBuilder('\Box_Validate')->disableOriginalConstructor()->getMock();
|
||||
$validatorMock->expects($this->atLeastOnce())
|
||||
->method('checkRequiredParamsForArray')
|
||||
->will($this->returnValue(null));
|
||||
|
||||
$di = new \Box_Di();
|
||||
$di['validator'] = $validatorMock;
|
||||
$activityMock->setDi($di);
|
||||
|
||||
$result = $activityMock->batch_delete_subscription(array('ids' => array(1, 2, 3)));
|
||||
$this->assertEquals(true, $result);
|
||||
}
|
||||
|
||||
public function testBatch_delete_transaction()
|
||||
{
|
||||
$activityMock = $this->getMockBuilder('\Box\Mod\Invoice\Api\Admin')->setMethods(array('transaction_delete'))->getMock();
|
||||
$activityMock->expects($this->atLeastOnce())->method('transaction_delete')->will($this->returnValue(true));
|
||||
|
||||
$validatorMock = $this->getMockBuilder('\Box_Validate')->disableOriginalConstructor()->getMock();
|
||||
$validatorMock->expects($this->atLeastOnce())
|
||||
->method('checkRequiredParamsForArray')
|
||||
->will($this->returnValue(null));
|
||||
|
||||
$di = new \Box_Di();
|
||||
$di['validator'] = $validatorMock;
|
||||
$activityMock->setDi($di);
|
||||
|
||||
$result = $activityMock->batch_delete_transaction(array('ids' => array(1, 2, 3)));
|
||||
$this->assertEquals(true, $result);
|
||||
}
|
||||
|
||||
|
||||
public function testBatch_delete_tax()
|
||||
{
|
||||
$activityMock = $this->getMockBuilder('\Box\Mod\Invoice\Api\Admin')->setMethods(array('tax_delete'))->getMock();
|
||||
$activityMock->expects($this->atLeastOnce())->method('tax_delete')->will($this->returnValue(true));
|
||||
|
||||
$validatorMock = $this->getMockBuilder('\Box_Validate')->disableOriginalConstructor()->getMock();
|
||||
$validatorMock->expects($this->atLeastOnce())
|
||||
->method('checkRequiredParamsForArray')
|
||||
->will($this->returnValue(null));
|
||||
|
||||
$di = new \Box_Di();
|
||||
$di['validator'] = $validatorMock;
|
||||
$activityMock->setDi($di);
|
||||
|
||||
$result = $activityMock->batch_delete_tax(array('ids' => array(1, 2, 3)));
|
||||
$this->assertEquals(true, $result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -697,6 +697,25 @@ class AdminTest extends \PHPUnit_Framework_TestCase
|
||||
$result = $this->api->get($data);
|
||||
}
|
||||
|
||||
public function testBatch_delete()
|
||||
{
|
||||
$activityMock = $this->getMockBuilder('\Box\Mod\Order\Api\Admin')->setMethods(array('delete'))->getMock();
|
||||
$activityMock->expects($this->atLeastOnce())->
|
||||
method('delete')->
|
||||
will($this->returnValue(true));
|
||||
$validatorMock = $this->getMockBuilder('\Box_Validate')->disableOriginalConstructor()->getMock();
|
||||
$validatorMock->expects($this->atLeastOnce())
|
||||
->method('checkRequiredParamsForArray')
|
||||
->will($this->returnValue(null));
|
||||
|
||||
$di = new \Box_Di();
|
||||
$di['validator'] = $validatorMock;
|
||||
$activityMock->setDi($di);
|
||||
|
||||
$result = $activityMock->batch_delete(array('ids' => array(1, 2, 3)));
|
||||
$this->assertEquals(true, $result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -549,5 +549,23 @@ class AdminTest extends \PHPUnit_Framework_TestCase {
|
||||
$this->assertInternalType('bool', $result);
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
public function testBatch_delete()
|
||||
{
|
||||
$activityMock = $this->getMockBuilder('\Box\Mod\Staff\Api\Admin')->setMethods(array('login_history_delete'))->getMock();
|
||||
$activityMock->expects($this->atLeastOnce())->method('login_history_delete')->will($this->returnValue(true));
|
||||
|
||||
$validatorMock = $this->getMockBuilder('\Box_Validate')->disableOriginalConstructor()->getMock();
|
||||
$validatorMock->expects($this->atLeastOnce())
|
||||
->method('checkRequiredParamsForArray')
|
||||
->will($this->returnValue(null));
|
||||
|
||||
$di = new \Box_Di();
|
||||
$di['validator'] = $validatorMock;
|
||||
$activityMock->setDi($di);
|
||||
|
||||
$result = $activityMock->batch_delete_logs(array('ids' => array(1, 2, 3)));
|
||||
$this->assertEquals(true, $result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1331,5 +1331,41 @@ class Api_AdminTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
public function testBatch_delete()
|
||||
{
|
||||
$activityMock = $this->getMockBuilder('\Box\Mod\Support\Api\Admin')->setMethods(array('ticket_delete'))->getMock();
|
||||
$activityMock->expects($this->atLeastOnce())->method('ticket_delete')->will($this->returnValue(true));
|
||||
|
||||
$validatorMock = $this->getMockBuilder('\Box_Validate')->disableOriginalConstructor()->getMock();
|
||||
$validatorMock->expects($this->atLeastOnce())
|
||||
->method('checkRequiredParamsForArray')
|
||||
->will($this->returnValue(null));
|
||||
|
||||
$di = new \Box_Di();
|
||||
$di['validator'] = $validatorMock;
|
||||
$activityMock->setDi($di);
|
||||
|
||||
$result = $activityMock->batch_delete(array('ids' => array(1, 2, 3)));
|
||||
$this->assertEquals(true, $result);
|
||||
}
|
||||
|
||||
public function testBatch_delete_public()
|
||||
{
|
||||
$activityMock = $this->getMockBuilder('\Box\Mod\Support\Api\Admin')->setMethods(array('public_ticket_delete'))->getMock();
|
||||
$activityMock->expects($this->atLeastOnce())->method('public_ticket_delete')->will($this->returnValue(true));
|
||||
|
||||
$validatorMock = $this->getMockBuilder('\Box_Validate')->disableOriginalConstructor()->getMock();
|
||||
$validatorMock->expects($this->atLeastOnce())
|
||||
->method('checkRequiredParamsForArray')
|
||||
->will($this->returnValue(null));
|
||||
|
||||
$di = new \Box_Di();
|
||||
$di['validator'] = $validatorMock;
|
||||
$activityMock->setDi($di);
|
||||
|
||||
$result = $activityMock->batch_delete_public(array('ids' => array(1, 2, 3)));
|
||||
$this->assertEquals(true, $result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,4 +57,18 @@ class Api_Admin_ActivityTest extends BBDbApiTestCase
|
||||
$this->assertArrayHasKey('updated_at', $item);
|
||||
}
|
||||
}
|
||||
|
||||
public function testBatchDelete()
|
||||
{
|
||||
$array = $this->api_admin->activity_log_get_list(array());
|
||||
|
||||
foreach ($array['list'] as $value) {
|
||||
$ids[] = $value['id'];
|
||||
}
|
||||
$result = $this->api_admin->activity_batch_delete(array('ids' => $ids));
|
||||
$array = $this->api_admin->activity_log_get_list(array());
|
||||
|
||||
$this->assertEquals(0, count($array['list']));
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
}
|
||||
@@ -203,7 +203,49 @@ class Api_Admin_ClientTest extends BBDbApiTestCase
|
||||
$this->assertArrayHasKey('amount', $item);
|
||||
$this->assertArrayHasKey('currency', $item);
|
||||
$this->assertArrayHasKey('created_at', $item);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function testClientBatchDelete()
|
||||
{
|
||||
$id = $this->api_admin->client_create(
|
||||
array(
|
||||
'email' => 'tester@gmail.com',
|
||||
'first_name' => 'Client',
|
||||
'password' => 'password',
|
||||
));
|
||||
|
||||
$id2 = $this->api_admin->client_create(
|
||||
array(
|
||||
'email' => 'tester2@gmail.com',
|
||||
'first_name' => 'Client',
|
||||
'password' => 'password',
|
||||
));
|
||||
$id3 = $this->api_admin->client_create(
|
||||
array(
|
||||
'email' => 'tester3@gmail.com',
|
||||
'first_name' => 'Client',
|
||||
'password' => 'password',
|
||||
));
|
||||
|
||||
$array = $this->api_admin->client_get_list(array());
|
||||
$count = count($array['list']);
|
||||
$result = $this->api_admin->client_batch_delete(array('ids' => array($id, $id2, $id3)));
|
||||
$array = $this->api_admin->client_get_list(array());
|
||||
|
||||
$this->assertEquals($count - 3, count($array['list']));
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
public function testClientBatchDeleteLog()
|
||||
{
|
||||
$this->api_admin->client_login(array('id' => 1));
|
||||
$array = $this->api_admin->client_login_history_get_list(array());
|
||||
|
||||
$result = $this->api_admin->client_batch_delete_log(array('ids' => array($array['list'][0])));
|
||||
$array = $this->api_admin->client_login_history_get_list(array());
|
||||
|
||||
$this->assertEquals(0, count($array['list']));
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
}
|
||||
@@ -220,6 +220,19 @@ class Api_Admin_EmailTest extends BBDbApiTestCase
|
||||
$this->assertArrayHasKey('subject', $item);
|
||||
$this->assertArrayHasKey('description', $item);
|
||||
}
|
||||
}
|
||||
|
||||
public function testBatchDelete()
|
||||
{
|
||||
$array = $this->api_admin->email_email_get_list(array());
|
||||
|
||||
foreach ($array['list'] as $value) {
|
||||
$ids[] = $value['id'];
|
||||
}
|
||||
$result = $this->api_admin->email_batch_delete(array('ids' => $ids));
|
||||
$array = $this->api_admin->email_email_get_list(array());
|
||||
|
||||
$this->assertEquals(0, count($array['list']));
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
}
|
||||
@@ -756,4 +756,60 @@ class Api_Admin_InvoiceTest extends BBDbApiTestCase
|
||||
$this->assertInternalType('array', $gateway['accepted_currencies']);
|
||||
}
|
||||
}
|
||||
|
||||
public function testInvoiceBatchDelete()
|
||||
{
|
||||
$array = $this->api_admin->invoice_get_list(array());
|
||||
|
||||
foreach ($array['list'] as $value) {
|
||||
$ids[] = $value['id'];
|
||||
}
|
||||
$result = $this->api_admin->invoice_batch_delete(array('ids' => $ids));
|
||||
$array = $this->api_admin->invoice_get_list(array());
|
||||
|
||||
$this->assertEquals(0, count($array['list']));
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
public function testInvoiceBatchDeleteSubscription()
|
||||
{
|
||||
$array = $this->api_admin->invoice_subscription_get_list(array());
|
||||
|
||||
foreach ($array['list'] as $value) {
|
||||
$ids[] = $value['id'];
|
||||
}
|
||||
$result = $this->api_admin->invoice_batch_delete_subscription(array('ids' => $ids));
|
||||
$array = $this->api_admin->invoice_subscription_get_list(array());
|
||||
|
||||
$this->assertEquals(0, count($array['list']));
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
public function testInvoiceBatchDeleteTransaction()
|
||||
{
|
||||
$array = $this->api_admin->invoice_transaction_get_list(array());
|
||||
|
||||
foreach ($array['list'] as $value) {
|
||||
$ids[] = $value['id'];
|
||||
}
|
||||
$result = $this->api_admin->invoice_batch_delete_transaction(array('ids' => $ids));
|
||||
$array = $this->api_admin->invoice_transaction_get_list(array());
|
||||
|
||||
$this->assertEquals(0, count($array['list']));
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
public function testInvoiceBatchDeleteTax()
|
||||
{
|
||||
$array = $this->api_admin->invoice_tax_get_list(array());
|
||||
|
||||
foreach ($array['list'] as $value) {
|
||||
$ids[] = $value['id'];
|
||||
}
|
||||
$result = $this->api_admin->invoice_batch_delete_tax(array('ids' => $ids));
|
||||
$array = $this->api_admin->invoice_tax_get_list(array());
|
||||
|
||||
$this->assertEquals(0, count($array['list']));
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
}
|
||||
@@ -68,4 +68,18 @@ class Api_Admin_NewsTest extends BBDbApiTestCase
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function testNewsBatchDelete()
|
||||
{
|
||||
$array = $this->api_admin->news_get_list(array());
|
||||
|
||||
foreach ($array['list'] as $value) {
|
||||
$ids[] = $value['id'];
|
||||
}
|
||||
$result = $this->api_admin->news_batch_delete(array('ids' => $ids));
|
||||
$array = $this->api_admin->news_get_list(array());
|
||||
|
||||
$this->assertEquals(0, count($array['list']));
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
}
|
||||
@@ -254,4 +254,17 @@ class Api_Admin_OrderTest extends BBDbApiTestCase
|
||||
$result = $this->api_admin->order_status_history_delete($data);
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
public function testOrderBatchDelete()
|
||||
{
|
||||
$array = $this->api_admin->order_get_list(array());
|
||||
|
||||
foreach ($array['list'] as $value){
|
||||
$ids[] = $value['id'];
|
||||
}
|
||||
$result = $this->api_admin->order_batch_delete(array('ids' => $ids, 'delete_addons' => true));
|
||||
$array = $this->api_admin->order_get_list(array());
|
||||
$this->assertEquals(0, count($array['list']));
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
}
|
||||
@@ -167,5 +167,17 @@ class Api_Admin_StaffTest extends BBDbApiTestCase
|
||||
$this->assertArrayHasKey('created_at', $item);
|
||||
$this->assertArrayHasKey('updated_at', $item);
|
||||
}
|
||||
public function testBatchDelete()
|
||||
{
|
||||
$array = $this->api_admin->staff_login_history_get_list(array());
|
||||
|
||||
foreach ($array['list'] as $value) {
|
||||
$ids[] = $value['id'];
|
||||
}
|
||||
$result = $this->api_admin->staff_batch_delete_logs(array('ids' => $ids));
|
||||
$array = $this->api_admin->staff_login_history_get_list(array());
|
||||
|
||||
$this->assertEquals(0, count($array['list']));
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
}
|
||||
@@ -290,4 +290,32 @@ class Api_Admin_SupportTest extends BBDbApiTestCase
|
||||
$this->assertInternalType('array', $item['client']);
|
||||
}
|
||||
}
|
||||
|
||||
public function testTicketBatchDelete()
|
||||
{
|
||||
$array = $this->api_admin->support_ticket_get_list(array());
|
||||
|
||||
foreach ($array['list'] as $value) {
|
||||
$ids[] = $value['id'];
|
||||
}
|
||||
$result = $this->api_admin->support_batch_delete(array('ids' => $ids));
|
||||
$array = $this->api_admin->support_ticket_get_list(array());
|
||||
|
||||
$this->assertEquals(0, count($array['list']));
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
public function testPublicTicketBatchDelete()
|
||||
{
|
||||
$array = $this->api_admin->support_public_ticket_get_list(array());
|
||||
|
||||
foreach ($array['list'] as $value) {
|
||||
$ids[] = $value['id'];
|
||||
}
|
||||
$result = $this->api_admin->support_batch_delete_public(array('ids' => $ids));
|
||||
$array = $this->api_admin->support_public_ticket_get_list(array());
|
||||
|
||||
$this->assertEquals(0, count($array['list']));
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user