diff --git a/app/Http/Controllers/ReportsController.php b/app/Http/Controllers/ReportsController.php index a04cd8356b..4b4db866ac 100644 --- a/app/Http/Controllers/ReportsController.php +++ b/app/Http/Controllers/ReportsController.php @@ -407,6 +407,7 @@ class ReportsController extends Controller */ public function postCustom(Request $request) { + dd('postCustom', $request->all()); ini_set('max_execution_time', env('REPORT_TIME_LIMIT', 12000)); //12000 seconds = 200 minutes $this->authorize('reports.view'); diff --git a/app/Http/Controllers/SavedReportsController.php b/app/Http/Controllers/SavedReportsController.php index 519e07b79b..31b91f0347 100644 --- a/app/Http/Controllers/SavedReportsController.php +++ b/app/Http/Controllers/SavedReportsController.php @@ -6,13 +6,8 @@ use Illuminate\Http\Request; class SavedReportsController extends Controller { - //a method to the madness public function store(Request $request) { - - - dd($request->all()); - + dd('saved reports', $request->all()); } - } diff --git a/resources/views/reports/custom.blade.php b/resources/views/reports/custom.blade.php index f8427f646b..94bdc37879 100644 --- a/resources/views/reports/custom.blade.php +++ b/resources/views/reports/custom.blade.php @@ -16,7 +16,12 @@
- {{ Form::open(['method' => 'post', 'class' => 'form-horizontal', 'id' => 'custom-report-form']) }} + {{ Form::open([ + 'method' => 'post', + 'class' => 'form-horizontal', + 'id' => 'custom-report-form', + 'url' => '/reports/custom', + ]) }} {{csrf_field()}} @@ -449,27 +454,28 @@ $("#savetemplateform").submit(function(e) { e.preventDefault(e); - let elements = Array.from(document.getElementById("custom-report-form").elements).map(item=>item.name); - console.log(elements); - - $("#savetemplateoptions").val(elements) - - let formElement = document.getElementById('custom-report-form') - - let inputsAsArray = Array.from(formElement.elements) - - inputsAsArray.map(function(item){ - // not a real method - if (item.isACheckbox()){ - return {name: item.name, type: checkbox, checked: item.checked}; - } - - if (item.isASelect){ - return {name:item.name, type: select, selected: [item.elements]} - } - }) - // set hidden input to variable - e.currentTarget.submit(); + $('#custom-report-form').attr('action', '/reports/savedtemplate').submit() + // let elements = Array.from(document.getElementById("custom-report-form").elements).map(item=>item.name); + // console.log(elements); + // + // $("#savetemplateoptions").val(elements) + // + // let formElement = document.getElementById('custom-report-form') + // + // let inputsAsArray = Array.from(formElement.elements) + // + // inputsAsArray.map(function(item){ + // // not a real method + // if (item.isACheckbox()){ + // return {name: item.name, type: checkbox, checked: item.checked}; + // } + // + // if (item.isASelect){ + // return {name:item.name, type: select, selected: [item.elements]} + // } + // }) + // // set hidden input to variable + // e.currentTarget.submit(); });