migration, and front end
This commit is contained in:
@@ -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');
|
||||
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -20,4 +20,5 @@ return [
|
||||
'select_a_template' => 'Select a Template',
|
||||
'template_name' => 'Template Name',
|
||||
'update_template' => 'Update Template',
|
||||
'share_template' => 'Share Template',
|
||||
];
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
Reference in New Issue
Block a user