mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Inline downloads for file resources
This commit is contained in:
parent
ee947ad6c6
commit
f35ad6a5a3
@ -20,10 +20,10 @@ use Illuminate\Database\Eloquent\Builder;
|
||||
class DocumentFilters extends QueryFilters
|
||||
{
|
||||
|
||||
public function client_id(int $client_id) :Builder
|
||||
{
|
||||
return $this->builder->where('client_id', $client_id);
|
||||
}
|
||||
// public function client_id(int $client_id) :Builder
|
||||
// {
|
||||
// return $this->builder->where('client_id', $client_id);
|
||||
// }
|
||||
|
||||
/**
|
||||
* Filter based on search text.
|
||||
|
@ -57,7 +57,12 @@ class DocumentController extends Controller
|
||||
{
|
||||
$document = Document::where('hash', $document_hash)->firstOrFail();
|
||||
|
||||
return Storage::disk($document->disk)->download($document->url, $document->name);
|
||||
$headers = [];
|
||||
|
||||
if(request()->input('inline') == 'true')
|
||||
$headers = array_merge($headers, ['Content-Disposition' => 'inline']);
|
||||
|
||||
return Storage::disk($document->disk)->download($document->url, $document->name, $headers);
|
||||
}
|
||||
|
||||
public function downloadMultiple(DownloadMultipleDocumentsRequest $request)
|
||||
|
@ -43,37 +43,26 @@ class GatewayType extends StaticModel
|
||||
switch ($type) {
|
||||
case self::CREDIT_CARD:
|
||||
return ctrans('texts.credit_card');
|
||||
break;
|
||||
case self::BANK_TRANSFER:
|
||||
return ctrans('texts.bank_transfer');
|
||||
break;
|
||||
case self::PAYPAL:
|
||||
return ctrans('texts.paypal');
|
||||
break;
|
||||
case self::CRYPTO:
|
||||
return ctrans('texts.crypto');
|
||||
break;
|
||||
case self::CUSTOM:
|
||||
return ctrans('texts.custom');
|
||||
break;
|
||||
case self::ALIPAY:
|
||||
return ctrans('texts.alipay');
|
||||
break;
|
||||
case self::SOFORT:
|
||||
return ctrans('texts.sofort');
|
||||
break;
|
||||
case self::APPLE_PAY:
|
||||
return ctrans('texts.apple_pay');
|
||||
break;
|
||||
case self::SEPA:
|
||||
return ctrans('texts.sepa');
|
||||
break;
|
||||
case self::KBC:
|
||||
return ctrans('texts.kbc_cbc');
|
||||
break;
|
||||
case self::BANCONTACT:
|
||||
return ctrans('texts.bancontact');
|
||||
break;
|
||||
|
||||
default:
|
||||
return 'Undefined.';
|
||||
|
Loading…
x
Reference in New Issue
Block a user