mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
Hide action for main user in datatable
This commit is contained in:
parent
6280598910
commit
7b735b9798
@ -41,6 +41,7 @@ class DatatableService
|
||||
private function createDropdown($entityType, $table, $actions)
|
||||
{
|
||||
$table->addColumn('dropdown', function ($model) use ($entityType, $actions) {
|
||||
$hasAction = false;
|
||||
$str = '<center style="min-width:100px">';
|
||||
|
||||
if (property_exists($model, 'is_deleted') && $model->is_deleted) {
|
||||
@ -70,6 +71,7 @@ class DatatableService
|
||||
if ($visible($model)) {
|
||||
$str .= "<li><a href=\"{$url($model)}\">{$value}</a></li>";
|
||||
$lastIsDivider = false;
|
||||
$hasAction = true;
|
||||
}
|
||||
} elseif ( ! $lastIsDivider) {
|
||||
$str .= "<li class=\"divider\"></li>";
|
||||
@ -77,6 +79,10 @@ class DatatableService
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $hasAction) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if ( ! $lastIsDivider) {
|
||||
$str .= "<li class=\"divider\"></li>";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user