Changes
This commit is contained in:
parent
c9e961f7a7
commit
ea7412e93b
|
|
@ -275,6 +275,7 @@ class Controller extends BaseController
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delete($id) {
|
public function delete($id) {
|
||||||
|
//echo '<pre>'; print_r($id); exit;
|
||||||
$response = LambdaRequest::signedrequest('get', $this->_service, $this->_module.'/delete', ['id' => $id]);
|
$response = LambdaRequest::signedrequest('get', $this->_service, $this->_module.'/delete', ['id' => $id]);
|
||||||
//echo '<pre>'; print_r($response); exit;
|
//echo '<pre>'; print_r($response); exit;
|
||||||
if($response->statusCode == 200 && $response->status == "success") {
|
if($response->statusCode == 200 && $response->status == "success") {
|
||||||
|
|
|
||||||
|
|
@ -160,9 +160,9 @@ class FormactionController extends Controller
|
||||||
|
|
||||||
public function history(Request $request) {
|
public function history(Request $request) {
|
||||||
$form_id = $request->input('id', 0);
|
$form_id = $request->input('id', 0);
|
||||||
$user_id = $request->input('user_id', 0);
|
echo $user_id = Auth::user()->user_id;
|
||||||
$history = LambdaRequest::postrequest('form', 'formentity/getformhistory', ['form_id' => $form_id, 'user_id' => $user_id, 'partition' => 'rapport-'.Auth::user()->domain ]);
|
$history = LambdaRequest::postrequest('form', 'formentity/getformhistory', ['form_id' => $form_id, 'user_id' => $user_id, 'partition' => 'rapport-'.Auth::user()->domain ]);
|
||||||
|
echo '<pre>'; print_r($history); exit;
|
||||||
//echo '<pre>'; print_r(['form_id' => $form_id, 'user_id' => $user_id, 'partition' => 'rapport-'.Auth::user()->domain ]); exit;
|
//echo '<pre>'; print_r(['form_id' => $form_id, 'user_id' => $user_id, 'partition' => 'rapport-'.Auth::user()->domain ]); exit;
|
||||||
// $hierarchy = LambdaRequest::signedrequest('get', 'ums', 'hierarchy/hierarchy_below_me');
|
// $hierarchy = LambdaRequest::signedrequest('get', 'ums', 'hierarchy/hierarchy_below_me');
|
||||||
// $submissions = [];
|
// $submissions = [];
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,80 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use App\Http\Requests\LambdaRequest;
|
||||||
|
use DB;
|
||||||
|
|
||||||
|
class FormexportController extends Controller
|
||||||
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->middleware('auth');
|
||||||
|
$this->_service = 'form';
|
||||||
|
$this->_module = 'formexports';
|
||||||
|
$this->_viewname = 'formexports';
|
||||||
|
$this->_title = 'Form Exports';
|
||||||
|
$this->_base_url = '/formexport';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function list(Request $request) {
|
||||||
|
$entity_id = $request->session()->get('entity_id');
|
||||||
|
if($entity_id === 0) {
|
||||||
|
return redirect('/formentitys')->withError('Question not found!');
|
||||||
|
}
|
||||||
|
$response = LambdaRequest::signedrequest('get', $this->_service, $this->_module.'/get_all', ['entity_id' => $entity_id]);
|
||||||
|
//echo '<pre>'; print_r($response); exit;
|
||||||
|
$fields = $this->get_list_fields();
|
||||||
|
return $this->view('list')->with([
|
||||||
|
'title' => $this->_title,
|
||||||
|
'fields' => $fields,
|
||||||
|
'base_url' => $this->_base_url,
|
||||||
|
'items' => $response->data->items,
|
||||||
|
'buttons' => $this->get_list_buttons()
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function get_list_buttons() {
|
||||||
|
return [ ['title' => 'Add New', 'link' => $this->_base_url.'/addnew' ] ];
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function get_list_fields(){
|
||||||
|
return [
|
||||||
|
'actions' => ['title' => 'Actions', 'buttons' => [ 'delete', 'download' => ['icon' => 'cloud-download', 'href' => 'download_url'] ] ],
|
||||||
|
'form_name' => ['title' => 'Form Name', 'type' => 'text'],
|
||||||
|
'start_date' => ['title' => 'Start Date', 'type' => 'text'],
|
||||||
|
'end_date' => ['title' => 'End Date', 'type' => 'text'],
|
||||||
|
//'download_url' => ['title' => 'download', 'type' => 'text'],
|
||||||
|
'state' => ['title' => 'Status', 'type' => 'text'],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function get_form_fields($type, $values){
|
||||||
|
$forms = $this->getlambda('get', 'form', 'formentity', 'dropdown');
|
||||||
|
$forms_dd = [];
|
||||||
|
foreach($forms->data->items as $form){
|
||||||
|
$forms_dd[$form->id] = $form->title;
|
||||||
|
}
|
||||||
|
$this->_request->session()->put('form_list_dropdown', $forms_dd);
|
||||||
|
|
||||||
|
//echo '<pre>'; print_r($forms_dd); exit;
|
||||||
|
return [
|
||||||
|
'form_id' => ['title' => 'Select Form', 'type' => 'select', 'required' => true, 'values' => $forms_dd],
|
||||||
|
'start_date' => ['title' => 'Start Date', 'type' => 'date', 'required' => true],
|
||||||
|
'end_date' => ['title' => 'End Date', 'type' => 'date', 'required' => true],
|
||||||
|
'status' => ['title' => 'Status', 'type' => 'select', 'required' => true, 'values' => ['active' => 'Active', 'disabled' => 'Disabled'] ],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function _beforesave($type, $request) {
|
||||||
|
$data = $request->except('_token');
|
||||||
|
$forms = $this->_request->session()->get('form_list_dropdown');
|
||||||
|
$data['form_name'] = $forms[$data['form_id']];
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function _beforeform($type, $values) {
|
||||||
|
return $values;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -47,6 +47,7 @@ class RolesController extends Controller
|
||||||
foreach($permissions as $permission) {
|
foreach($permissions as $permission) {
|
||||||
$permissions_dd[$permission] = $permission;
|
$permissions_dd[$permission] = $permission;
|
||||||
}
|
}
|
||||||
|
//echo '<pre>'; print_r($permissions_dd); exit;
|
||||||
return [
|
return [
|
||||||
'name' => ['title' => 'Role Name', 'type' => 'text', 'required' => true],
|
'name' => ['title' => 'Role Name', 'type' => 'text', 'required' => true],
|
||||||
'code' => ['title' => 'Role Code', 'type' => 'text', 'required' => true],
|
'code' => ['title' => 'Role Code', 'type' => 'text', 'required' => true],
|
||||||
|
|
|
||||||
|
|
@ -79,13 +79,19 @@
|
||||||
@break
|
@break
|
||||||
@default
|
@default
|
||||||
@php
|
@php
|
||||||
$querystring = $button['querystring'];
|
if($button['href']) {
|
||||||
foreach((array)$item as $k => $v) {
|
$href = $item->{$button['href']};
|
||||||
if(strpos($querystring,'{'.strtoupper($k).'}') !== false)
|
} else {
|
||||||
$querystring = str_replace('{'.strtoupper($k).'}', $v, $querystring);
|
$querystring = $button['querystring'];
|
||||||
|
foreach((array)$item as $k => $v) {
|
||||||
|
if(strpos($querystring,'{'.strtoupper($k).'}') !== false)
|
||||||
|
$querystring = str_replace('{'.strtoupper($k).'}', $v, $querystring);
|
||||||
|
}
|
||||||
|
$href = $base_url.'/'.$key.'?'.$querystring;
|
||||||
}
|
}
|
||||||
|
|
||||||
@endphp
|
@endphp
|
||||||
<a href="{{$base_url}}/{{$key}}?{{$querystring}}" class="action-icon"> <i class="mdi mdi-{{$button['icon']}}"></i></a>
|
<a href="{{$href}}" class="action-icon"> <i class="mdi mdi-{{$button['icon']}}"></i></a>
|
||||||
@endswitch
|
@endswitch
|
||||||
@endforeach
|
@endforeach
|
||||||
</td>
|
</td>
|
||||||
|
|
|
||||||
|
|
@ -228,6 +228,7 @@
|
||||||
$('#add-clild-modal').modal("show")
|
$('#add-clild-modal').modal("show")
|
||||||
});
|
});
|
||||||
$(document).on('click', '.delete-btn', function(){
|
$(document).on('click', '.delete-btn', function(){
|
||||||
|
console.log("/hierarchy/delete?id=" + $(this).attr('myid'))
|
||||||
window.location.href = "/hierarchy/delete?id=" + $(this).attr('myid');
|
window.location.href = "/hierarchy/delete?id=" + $(this).attr('myid');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -246,7 +246,8 @@
|
||||||
@if(in_array('formentity_get_all', $permissions) ||
|
@if(in_array('formentity_get_all', $permissions) ||
|
||||||
in_array('formaction_get_all', $permissions) ||
|
in_array('formaction_get_all', $permissions) ||
|
||||||
in_array('all_data_access', $permissions) ||
|
in_array('all_data_access', $permissions) ||
|
||||||
in_array('formproduct_get_all', $permissions) )
|
in_array('formproduct_get_all', $permissions) ||
|
||||||
|
in_array('formexports_get_all', $permissions) )
|
||||||
<li>
|
<li>
|
||||||
<a href="#sidebarFormmodule" data-bs-toggle="collapse">
|
<a href="#sidebarFormmodule" data-bs-toggle="collapse">
|
||||||
<i data-feather="file-text"></i>
|
<i data-feather="file-text"></i>
|
||||||
|
|
@ -270,6 +271,11 @@
|
||||||
<a href="/formdatas">Form Data</a>
|
<a href="/formdatas">Form Data</a>
|
||||||
</li>
|
</li>
|
||||||
@endif
|
@endif
|
||||||
|
@if(in_array('formexports_get_all', $permissions))
|
||||||
|
<li>
|
||||||
|
<a href="/formexports">Form Data Export</a>
|
||||||
|
</li>
|
||||||
|
@endif
|
||||||
@if(in_array('reminder_get_all', $permissions))
|
@if(in_array('reminder_get_all', $permissions))
|
||||||
<li>
|
<li>
|
||||||
<a href="/reminders">Reminders</a>
|
<a href="/reminders">Reminders</a>
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ use App\Http\Controllers\ReminderController;
|
||||||
use App\Http\Controllers\WidgetController;
|
use App\Http\Controllers\WidgetController;
|
||||||
use App\Http\Controllers\FormdataController;
|
use App\Http\Controllers\FormdataController;
|
||||||
use App\Http\Controllers\FormsubmissionController;
|
use App\Http\Controllers\FormsubmissionController;
|
||||||
|
use App\Http\Controllers\FormexportController;
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Web Routes
|
| Web Routes
|
||||||
|
|
@ -94,6 +95,7 @@ $modules = ['user' => UserController::class,
|
||||||
'widget' => WidgetController::class,
|
'widget' => WidgetController::class,
|
||||||
'formdata' => FormdataController::class,
|
'formdata' => FormdataController::class,
|
||||||
'formsubmission' => FormsubmissionController::class,
|
'formsubmission' => FormsubmissionController::class,
|
||||||
|
'formexport' => FormexportController::class,
|
||||||
];
|
];
|
||||||
foreach ($modules as $mod => $class) {
|
foreach ($modules as $mod => $class) {
|
||||||
Route::get('/'.$mod.'s', [$class, 'list'])->name($mod.'-list');
|
Route::get('/'.$mod.'s', [$class, 'list'])->name($mod.'-list');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue