mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
WIP: Simply post the form to a different controller
This commit is contained in:
parent
7a5faa9619
commit
06186c9b12
|
@ -407,6 +407,7 @@ class ReportsController extends Controller
|
||||||
*/
|
*/
|
||||||
public function postCustom(Request $request)
|
public function postCustom(Request $request)
|
||||||
{
|
{
|
||||||
|
dd('postCustom', $request->all());
|
||||||
ini_set('max_execution_time', env('REPORT_TIME_LIMIT', 12000)); //12000 seconds = 200 minutes
|
ini_set('max_execution_time', env('REPORT_TIME_LIMIT', 12000)); //12000 seconds = 200 minutes
|
||||||
$this->authorize('reports.view');
|
$this->authorize('reports.view');
|
||||||
|
|
||||||
|
|
|
@ -6,13 +6,8 @@ use Illuminate\Http\Request;
|
||||||
|
|
||||||
class SavedReportsController extends Controller
|
class SavedReportsController extends Controller
|
||||||
{
|
{
|
||||||
//a method to the madness
|
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
{
|
{
|
||||||
|
dd('saved reports', $request->all());
|
||||||
|
|
||||||
dd($request->all());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,12 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-8 col-md-offset-1">
|
<div class="col-md-8 col-md-offset-1">
|
||||||
|
|
||||||
{{ 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()}}
|
{{csrf_field()}}
|
||||||
|
|
||||||
<!-- Horizontal Form -->
|
<!-- Horizontal Form -->
|
||||||
|
@ -449,27 +454,28 @@
|
||||||
|
|
||||||
$("#savetemplateform").submit(function(e) {
|
$("#savetemplateform").submit(function(e) {
|
||||||
e.preventDefault(e);
|
e.preventDefault(e);
|
||||||
let elements = Array.from(document.getElementById("custom-report-form").elements).map(item=>item.name);
|
$('#custom-report-form').attr('action', '/reports/savedtemplate').submit()
|
||||||
console.log(elements);
|
// let elements = Array.from(document.getElementById("custom-report-form").elements).map(item=>item.name);
|
||||||
|
// console.log(elements);
|
||||||
$("#savetemplateoptions").val(elements)
|
//
|
||||||
|
// $("#savetemplateoptions").val(elements)
|
||||||
let formElement = document.getElementById('custom-report-form')
|
//
|
||||||
|
// let formElement = document.getElementById('custom-report-form')
|
||||||
let inputsAsArray = Array.from(formElement.elements)
|
//
|
||||||
|
// let inputsAsArray = Array.from(formElement.elements)
|
||||||
inputsAsArray.map(function(item){
|
//
|
||||||
// not a real method
|
// inputsAsArray.map(function(item){
|
||||||
if (item.isACheckbox()){
|
// // not a real method
|
||||||
return {name: item.name, type: checkbox, checked: item.checked};
|
// if (item.isACheckbox()){
|
||||||
}
|
// return {name: item.name, type: checkbox, checked: item.checked};
|
||||||
|
// }
|
||||||
if (item.isASelect){
|
//
|
||||||
return {name:item.name, type: select, selected: [item.elements]}
|
// if (item.isASelect){
|
||||||
}
|
// return {name:item.name, type: select, selected: [item.elements]}
|
||||||
})
|
// }
|
||||||
// set hidden input to variable
|
// })
|
||||||
e.currentTarget.submit();
|
// // set hidden input to variable
|
||||||
|
// e.currentTarget.submit();
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue