diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index 33afd47f83..14d0904226 100755 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -349,6 +349,7 @@ class SettingsController extends Controller $setting->privacy_policy_link = $request->input('privacy_policy_link'); $setting->depreciation_method = $request->input('depreciation_method'); + $setting->dash_chart_type = $request->input('dash_chart_type'); if ($request->input('per_page') != '') { $setting->per_page = $request->input('per_page'); diff --git a/database/migrations/2022_09_29_040231_add_chart_type_to_settings.php b/database/migrations/2022_09_29_040231_add_chart_type_to_settings.php new file mode 100644 index 0000000000..1e69b66f2a --- /dev/null +++ b/database/migrations/2022_09_29_040231_add_chart_type_to_settings.php @@ -0,0 +1,34 @@ +string('dash_chart_type')->nullable()->default('name'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('settings', function (Blueprint $table) { + if (Schema::hasColumn('settings', 'dash_chart_type')) { + $table->dropColumn('dash_chart_type'); + } + }); + } +} diff --git a/resources/lang/en/general.php b/resources/lang/en/general.php index d4db6b2b82..ba2cb77a6d 100644 --- a/resources/lang/en/general.php +++ b/resources/lang/en/general.php @@ -375,6 +375,7 @@ return [ 'na_no_purchase_date' => 'N/A - No purchase date provided', 'assets_by_status' => 'Assets by Status', 'assets_by_status_type' => 'Assets by Status Type', + 'pie_chart_type' => 'Dashboard Pie Chart Type', ]; \ No newline at end of file diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php index ff95530002..fe6f2ac0dd 100755 --- a/resources/views/dashboard.blade.php +++ b/resources/views/dashboard.blade.php @@ -248,7 +248,9 @@
-

{{ trans('general.assets_by_status_type') }}

+

+ {{ (\App\Models\Setting::getSettings()->dash_chart_type == 'name') ? trans('general.assets_by_status') : trans('general.assets_by_status_type') }} +

+ + + +
+
+ {{ Form::label('show_in_model_list', + trans('general.pie_chart_type')) }} +
+
+ {{ Form::select('dash_chart_type', array( + 'name' => 'Status Label Name', + 'type' => 'Status Label Type'), Request::old('dash_chart_type', $setting->dash_chart_type), ['class' =>'select2', 'style' => 'width: 80%']) }} +
+
+