mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 12:12:48 +01:00
Fixed to bulk download
This commit is contained in:
parent
047a0fb2be
commit
84b6b7b928
@ -480,6 +480,8 @@ class InvoiceController extends BaseController
|
||||
$key = 'emailed_' . $entityType;
|
||||
} elseif ($action == 'markPaid') {
|
||||
$key = 'created_payment';
|
||||
} elseif ($action == 'download') {
|
||||
$key = 'downloaded_invoice';
|
||||
} else {
|
||||
$key = "{$action}d_{$entityType}";
|
||||
}
|
||||
|
@ -133,7 +133,13 @@ class QuoteController extends BaseController
|
||||
$count = $this->invoiceService->bulk($ids, $action);
|
||||
|
||||
if ($count > 0) {
|
||||
$key = $action == 'markSent' ? 'updated_quote' : "{$action}d_quote";
|
||||
if ($action == 'markSent') {
|
||||
$key = 'updated_quote';
|
||||
} elseif ($action == 'download') {
|
||||
$key = 'downloaded_quote';
|
||||
} else {
|
||||
$key = "{$action}d_quote";
|
||||
}
|
||||
$message = Utils::pluralize($key, $count);
|
||||
Session::flash('message', $message);
|
||||
}
|
||||
|
@ -916,7 +916,7 @@ class Utils
|
||||
$str = '';
|
||||
|
||||
if (property_exists($model, 'is_deleted')) {
|
||||
$str = $model->is_deleted || ($model->deleted_at && $model->deleted_at != '0000-00-00') ? 'DISABLED ' : '';
|
||||
$str = $model->is_deleted ? 'DISABLED ' : '';
|
||||
|
||||
if ($model->is_deleted) {
|
||||
$str .= 'ENTITY_DELETED ';
|
||||
|
@ -181,10 +181,9 @@ class InvoiceDatatable extends EntityDatatable
|
||||
|
||||
public function bulkActions()
|
||||
{
|
||||
$actions = parent::bulkActions();
|
||||
$actions = [];
|
||||
|
||||
if ($this->entityType == ENTITY_INVOICE || $this->entityType == ENTITY_QUOTE) {
|
||||
$actions[] = \DropdownButton::DIVIDER;
|
||||
$actions[] = [
|
||||
'label' => mtrans($this->entityType, 'download_' . $this->entityType),
|
||||
'url' => 'javascript:submitForm_'.$this->entityType.'("download")',
|
||||
@ -207,6 +206,9 @@ class InvoiceDatatable extends EntityDatatable
|
||||
];
|
||||
}
|
||||
|
||||
$actions[] = \DropdownButton::DIVIDER;
|
||||
$actions = array_merge($actions, parent::bulkActions());
|
||||
|
||||
return $actions;
|
||||
}
|
||||
}
|
||||
|
@ -78,7 +78,8 @@ class DatatableService
|
||||
$dropdown_contents = '';
|
||||
|
||||
$lastIsDivider = false;
|
||||
if (! $model->deleted_at || $model->deleted_at == '0000-00-00') {
|
||||
//if (! $model->deleted_at || $model->deleted_at == '0000-00-00') {
|
||||
if (! $model->is_deleted) {
|
||||
foreach ($datatable->actions() as $action) {
|
||||
if (count($action)) {
|
||||
// if show function isn't set default to true
|
||||
|
@ -66,6 +66,7 @@ class InvoiceService extends BaseService
|
||||
if ($action == 'download') {
|
||||
$invoices = $this->getRepo()->findByPublicIdsWithTrashed($ids);
|
||||
dispatch(new DownloadInvoices(Auth::user(), $invoices));
|
||||
return count($invoices);
|
||||
} else {
|
||||
return parent::bulk($ids, $action);
|
||||
}
|
||||
|
@ -2311,6 +2311,10 @@ $LANG = array(
|
||||
'download_invoice' => 'Download Invoice',
|
||||
'download_quote' => 'Download Quote',
|
||||
'invoices_are_attached' => 'Your invoice PDFs are attached.',
|
||||
'downloaded_invoice' => 'An email will be sent with the invoice PDF',
|
||||
'downloaded_quote' => 'An email will be sent with the quote PDF',
|
||||
'downloaded_invoices' => 'An email will be sent with the invoice PDFs',
|
||||
'downloaded_quotes' => 'An email will be sent with the quote PDFs',
|
||||
|
||||
);
|
||||
|
||||
|
@ -189,7 +189,12 @@
|
||||
|
||||
<body class="body">
|
||||
|
||||
@if (Utils::isNinjaProd() && isset($_ENV['TAG_MANAGER_KEY']) && $_ENV['TAG_MANAGER_KEY'])
|
||||
@if (request()->phantomjs)
|
||||
<script>
|
||||
function trackEvent(category, action) {
|
||||
}
|
||||
</script>
|
||||
@elseif (Utils::isNinjaProd() && isset($_ENV['TAG_MANAGER_KEY']) && $_ENV['TAG_MANAGER_KEY'])
|
||||
<!-- Google Tag Manager -->
|
||||
<noscript>
|
||||
<iframe src="//www.googletagmanager.com/ns.html?id={{ $_ENV['TAG_MANAGER_KEY'] }}"
|
||||
|
Loading…
Reference in New Issue
Block a user