multiple saved reports, beginning of dynamic dropdown listing/queried url

This commit is contained in:
akemidx 2023-12-11 15:28:34 -05:00
parent bd86c5430c
commit e636d7b9d5
2 changed files with 11 additions and 10 deletions

View file

@ -388,7 +388,7 @@ class ReportsController extends Controller
* @since [v1.0] * @since [v1.0]
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function getCustomReport() public function getCustomReport(Request $request)
{ {
$this->authorize('reports.view'); $this->authorize('reports.view');
$customfields = CustomField::get(); $customfields = CustomField::get();
@ -398,7 +398,7 @@ class ReportsController extends Controller
'customfields' => $customfields, 'customfields' => $customfields,
'saved_reports' => $saved_reports, 'saved_reports' => $saved_reports,
// @todo: temporary // @todo: temporary
'savedReport' => $saved_reports->first(), 'savedReport' => $saved_reports->find($request->input('report')),
// 'savedReport' => new SavedReport, // 'savedReport' => new SavedReport,
]); ]);
} }

View file

@ -386,17 +386,18 @@
</form> </form>
</div> </div>
<div style=padding-bottom:5px> <div style=padding-bottom:5px>
<a href="#" class="js-data-ajax" data-toggle="dropdown" tabindex="-1" data-placeholder="{{ trans('admin/reports/general.saved_reports')}}" style="width:100%"> {{-- <a href="#" class="js-data-ajax" data-toggle="dropdown" tabindex="-1" data-placeholder="{{ trans('admin/reports/general.saved_reports')}}" style="width:100%">--}}
{{ trans('admin/reports/general.select_template') }} {{-- {{ trans('admin/reports/general.select_template') }}--}}
<strong class="caret"></strong> {{-- <strong class="caret"></strong>--}}
</a> {{-- </a>--}}
<ul class="dropdown-menu"> {{-- {!! Form::select('brand', array('1'=>'Text','2'=>'Logo','3'=>'Logo + Text'), old('brand', $setting->brand), array('class' => 'form-control select2', 'style'=>'width: 150px ;')) !!}--}}
<select class="form-control select2">
@foreach($saved_reports as $report) @foreach($saved_reports as $report)
<li> <option>
{{ $report->name }} {{ $report->name }}
</li> </option>
@endforeach @endforeach
</ul> </select>
</div> </div>
</div> </div>
</div> </div>