From 7f8f1b414b89c92c45892e0ccfd7d762ceb03d85 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 29 Jun 2017 17:39:10 +0300 Subject: [PATCH] Hide tasks invoice line item table if module is disabled --- app/Models/Account.php | 1 + resources/views/invoices/edit.blade.php | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Models/Account.php b/app/Models/Account.php index 1cbe5cb9f2e2..a3c2b2497503 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -1593,6 +1593,7 @@ class Account extends Eloquent return true; } + // note: single & checks bitmask match return $this->enabled_modules & static::$modules[$entityType]; } diff --git a/resources/views/invoices/edit.blade.php b/resources/views/invoices/edit.blade.php index f1f807037fe3..83a496bcea69 100644 --- a/resources/views/invoices/edit.blade.php +++ b/resources/views/invoices/edit.blade.php @@ -254,7 +254,10 @@ @include('invoices.edit_table', ['isTasks' => false]) - @include('invoices.edit_table', ['isTasks' => true]) + + @if ($account->isModuleEnabled(ENTITY_TASK)) + @include('invoices.edit_table', ['isTasks' => true]) + @endif