From c34f585e5e7059ee257f2ae9c0ff7bbba8d56467 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 20 Dec 2017 13:05:46 +0200 Subject: [PATCH] Adjust module settings --- app/Libraries/Utils.php | 2 +- app/Models/Account.php | 6 ++---- resources/views/partials/navigation_option.blade.php | 2 +- resources/views/reports/report_builder.blade.php | 6 ++++++ 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/Libraries/Utils.php b/app/Libraries/Utils.php index afab900eee0c..b11cb1c3b135 100644 --- a/app/Libraries/Utils.php +++ b/app/Libraries/Utils.php @@ -96,7 +96,7 @@ class Utils public static function requireHTTPS() { - if (Request::root() === 'http://ninja.dev' || Request::root() === 'http://ninja.dev:8000') { + if (in_array(Request::root(), ['http://ninja.dev', 'http://ninja.dev:8000', 'http://www.ninja.test'])) { return false; } diff --git a/app/Models/Account.php b/app/Models/Account.php index 00212bb7306d..22a605d75aeb 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -1045,9 +1045,8 @@ class Account extends Eloquent // Pro case FEATURE_TASKS: case FEATURE_EXPENSES: - if (Utils::isNinja() && $this->company_id < EXTRAS_GRANDFATHER_COMPANY_ID) { - return true; - } + case FEATURE_QUOTES: + return true; case FEATURE_CUSTOMIZE_INVOICE_DESIGN: case FEATURE_DIFFERENT_DESIGNS: @@ -1056,7 +1055,6 @@ class Account extends Eloquent case FEATURE_CUSTOM_EMAILS: case FEATURE_PDF_ATTACHMENT: case FEATURE_MORE_INVOICE_DESIGNS: - case FEATURE_QUOTES: case FEATURE_REPORTS: case FEATURE_BUY_NOW_BUTTONS: case FEATURE_API: diff --git a/resources/views/partials/navigation_option.blade.php b/resources/views/partials/navigation_option.blade.php index 24654f196760..88783898fbb0 100644 --- a/resources/views/partials/navigation_option.blade.php +++ b/resources/views/partials/navigation_option.blade.php @@ -22,7 +22,7 @@ class="nav-link {{ Request::is("{$option}*") ? 'active' : '' }}"> {{ ($option == 'recurring_invoices') ? trans('texts.recurring') : mtrans($option) }} - {!! Utils::isTrial() && in_array($option, ['quotes', 'tasks', 'expenses', 'vendors', 'reports']) ? ' ' . trans('texts.pro') . '' : '' !!} + {!! Utils::isTrial() && in_array($option, ['reports']) ? ' ' . trans('texts.pro') . '' : '' !!} diff --git a/resources/views/reports/report_builder.blade.php b/resources/views/reports/report_builder.blade.php index 8ad0fffdae17..63418ff3c86d 100644 --- a/resources/views/reports/report_builder.blade.php +++ b/resources/views/reports/report_builder.blade.php @@ -452,6 +452,9 @@ }); $('#format').change(function() { + @if (! auth()->user()->hasFeature(FEATURE_REPORTS)) + return; + @endif var val = $('#format').val(); $('#scheduleButton').prop('disabled', val == 'zip'); if (isStorageSupported() && val != 'zip') { @@ -460,6 +463,9 @@ }); $('#report_type').change(function() { + @if (! auth()->user()->hasFeature(FEATURE_REPORTS)) + return; + @endif var val = $('#report_type').val(); setFiltersShown(); setDocumentZipShown();