mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-22 05:50:53 -04: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)
|
private function createDropdown($entityType, $table, $actions)
|
||||||
{
|
{
|
||||||
$table->addColumn('dropdown', function ($model) use ($entityType, $actions) {
|
$table->addColumn('dropdown', function ($model) use ($entityType, $actions) {
|
||||||
|
$hasAction = false;
|
||||||
$str = '<center style="min-width:100px">';
|
$str = '<center style="min-width:100px">';
|
||||||
|
|
||||||
if (property_exists($model, 'is_deleted') && $model->is_deleted) {
|
if (property_exists($model, 'is_deleted') && $model->is_deleted) {
|
||||||
@ -70,6 +71,7 @@ class DatatableService
|
|||||||
if ($visible($model)) {
|
if ($visible($model)) {
|
||||||
$str .= "<li><a href=\"{$url($model)}\">{$value}</a></li>";
|
$str .= "<li><a href=\"{$url($model)}\">{$value}</a></li>";
|
||||||
$lastIsDivider = false;
|
$lastIsDivider = false;
|
||||||
|
$hasAction = true;
|
||||||
}
|
}
|
||||||
} elseif ( ! $lastIsDivider) {
|
} elseif ( ! $lastIsDivider) {
|
||||||
$str .= "<li class=\"divider\"></li>";
|
$str .= "<li class=\"divider\"></li>";
|
||||||
@ -77,6 +79,10 @@ class DatatableService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( ! $hasAction) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
if ( ! $lastIsDivider) {
|
if ( ! $lastIsDivider) {
|
||||||
$str .= "<li class=\"divider\"></li>";
|
$str .= "<li class=\"divider\"></li>";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user