1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-19 16:01:34 +02:00

fix for dashboard links for quotes / invoices (#2409)

This commit is contained in:
David Bomba 2018-10-05 00:45:21 +10:00 committed by GitHub
parent 3d8742de1b
commit b091c27d57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -817,7 +817,11 @@ class Invoice extends EntityModel implements BalanceAffecting
*/
public static function calcLink($invoice)
{
return link_to('invoices/' . $invoice->public_id, $invoice->invoice_number);
if(isset($invoice->invoice_type_id))
$linkPrefix = ($invoice->invoice_type_id == INVOICE_TYPE_QUOTE) ? 'quotes/' : 'invoices/';
else
$linkPrefix = 'invoices/';
return link_to($linkPrefix . $invoice->public_id, $invoice->invoice_number);
}
/**

View File

@ -11,7 +11,7 @@
<i class="fa fa-calendar" style="width:20px"></i>
</a>
@elseif ($option == 'dashboard')
@elseif (Auth::user()->can('create', $option) || Auth::user()->can('create', substr($option, 0, -1)))
<a type="button" class="btn btn-primary btn-sm pull-right"
href="{{ url("/{$option}/create") }}">