Skip to content

A free open source IT asset/license management system

migration, and front end

akemidxc797472bcc77
diff --git a/app/Http/Controllers/ReportsController.php b/app/Http/Controllers/ReportsController.php
index 5dd6386e40..a1f2440b78 100644
--- a/app/Http/Controllers/ReportsController.php
+++ b/app/Http/Controllers/ReportsController.php
@@ -452,6 +452,10 @@ class ReportsController extends Controller
$header = [];
+ if($request->filled('share_report_template')) {
+ $header[] = trans('admin/reports/general.share_template');
+ }
+
if ($request->filled('id')) {
$header[] = trans('general.id');
}
@@ -646,7 +650,13 @@ class ReportsController extends Controller
$executionTime = microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'];
Log::debug('Added headers: '.$executionTime);
- $assets = Asset::select('assets.*')->with(
+ if($request->filled('share_report_template')) {
+ //to fill with logic for the report template and NOT the assets retrieved by the query
+ }
+
+
+
+ $assets = Asset::select('assets.*')->with(
'location', 'assetstatus', 'company', 'defaultLoc', 'assignedTo',
'model.category', 'model.manufacturer', 'supplier');
diff --git a/database/migrations/2025_11_18_193933_add_share_report_template_option.php b/database/migrations/2025_11_18_193933_add_share_report_template_option.php
new file mode 100644
index 0000000000..16641ae5ff
--- /dev/null
+++ b/database/migrations/2025_11_18_193933_add_share_report_template_option.php
@@ -0,0 +1,30 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+ /**
+ * Run the migrations.
+ */
+ public function up(): void
+ {
+ Schema::table('report_templates', function (Blueprint $table) {
+ $table->boolean('share_report_template', )->nullable()->default(null);
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void
+ {
+ Schema::table('report_templates', function (Blueprint $table) {
+ if (Schema::hasColumn('report_templates', 'share_report_template')) {
+ $table->dropColumn('share_report_template');
+ }
+ });
+ }
+};
diff --git a/resources/lang/en-US/admin/reports/general.php b/resources/lang/en-US/admin/reports/general.php
index ed8bf1a156..98f3d39290 100644
--- a/resources/lang/en-US/admin/reports/general.php
+++ b/resources/lang/en-US/admin/reports/general.php
@@ -20,4 +20,5 @@ return [
'select_a_template' => 'Select a Template',
'template_name' => 'Template Name',
'update_template' => 'Update Template',
+ 'share_template' => 'Share Template',
];
diff --git a/resources/views/reports/custom.blade.php b/resources/views/reports/custom.blade.php
index 326f23e672..1289ac8686 100644
--- a/resources/views/reports/custom.blade.php
+++ b/resources/views/reports/custom.blade.php
@@ -79,6 +79,12 @@
</div>
</div>
</div>
+ <div class="col-md-7 col-md-offset-7">
+ <label class="form-control">
+ <input type="checkbox" name="shared_report_template" value="1" @checked($template->checkmarkValue('shared_report_template')) />
+ {{ trans('admin/reports/general.share_template') }}
+ </label>
+ </div>
@endif
</div><!-- /.box-header -->