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

Hide action for main user in datatable

This commit is contained in:
Hillel Coren 2016-02-17 21:33:15 +02:00
parent 6280598910
commit 7b735b9798

View File

@ -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>";
}