Merge branch 'main' of http://192.168.1.200:3000/Stratawiz/Rapport-Laravel
Specific Folder FTP Upload / ftp-deploy (push) Successful in 52s
Details
Specific Folder FTP Upload / ftp-deploy (push) Successful in 52s
Details
This commit is contained in:
commit
b442dcd9c8
|
|
@ -37,6 +37,23 @@ class FormController extends Controller
|
|||
$this->_base_url = '/formaction';
|
||||
}
|
||||
|
||||
protected function sessionAttr($data, $key, $default = null)
|
||||
{
|
||||
if (is_object($data) && isset($data->{$key})) {
|
||||
return $data->{$key};
|
||||
}
|
||||
if (is_array($data) && array_key_exists($key, $data)) {
|
||||
return $data[$key];
|
||||
}
|
||||
return $default;
|
||||
}
|
||||
|
||||
protected function sessionFlag($data, $key)
|
||||
{
|
||||
$value = $this->sessionAttr($data, $key, false);
|
||||
return $value === true || $value === 1 || $value === '1' || $value === 'true';
|
||||
}
|
||||
|
||||
protected function deliverform($formdata, $questions, $id = false) {
|
||||
$additional_info = $this->get_additional_info($formdata);
|
||||
// if($formdata->form_id == '1711609582-e93dba24-9c98-43e7-b97a-b22d64d9b9fc') {
|
||||
|
|
@ -151,6 +168,8 @@ class FormController extends Controller
|
|||
$form = $finfo->data->form ?? $formdata;
|
||||
$showPositions = $form->show_positions ?? $form->show_position ?? 'no';
|
||||
$positionColumns = $this->getAvailablePositionColumns($finfo->data->submissions ?? [], $showPositions);
|
||||
$userAttrs = $this->userAttributeCodes($form);
|
||||
$userAttrLabels = $this->resolveUserAttributeLabels($userAttrs);
|
||||
$listViewData = [
|
||||
'questions' => $finfo->data->questions,
|
||||
'submissions' => $finfo->data->submissions,
|
||||
|
|
@ -160,6 +179,8 @@ class FormController extends Controller
|
|||
'formdata' => $formdata,
|
||||
'form' => $form,
|
||||
'positionColumns' => $positionColumns,
|
||||
'userAttrs' => $userAttrs,
|
||||
'userAttrLabels' => $userAttrLabels,
|
||||
];
|
||||
if (\View::exists('form.'.$formdata->partition.'.list-'.$formdata->form_id)) {
|
||||
return view('form.'.$formdata->partition.'.list-'.$formdata->form_id)->with($listViewData);
|
||||
|
|
@ -286,7 +307,9 @@ class FormController extends Controller
|
|||
|
||||
//print_r($finfo->data->submissions);exit;
|
||||
$sessionForm = $request->session()->get('formdata');
|
||||
$canDeleteByPermission = is_object($sessionForm) && !empty($sessionForm->delete_submission);
|
||||
$canDeleteByPermission = $request->input('delete_submission') == 1
|
||||
|| $this->sessionFlag($sessionForm, 'delete_submission');
|
||||
$userAttrs = $this->userAttributeCodes($formdata);
|
||||
foreach($submissions as $submission) {
|
||||
if (!isset($submission->user_info->name)) continue;
|
||||
$row = [
|
||||
|
|
@ -297,6 +320,9 @@ class FormController extends Controller
|
|||
"submission_id" => $submission->id,
|
||||
"actions" => []
|
||||
];
|
||||
foreach ($userAttrs as $attr) {
|
||||
$row[$attr] = $this->userAttributeValue($submission->user_info ?? null, $attr);
|
||||
}
|
||||
|
||||
// workflow status
|
||||
if (isset($formdata->workflow) && $formdata->workflow == 'yes') {
|
||||
|
|
@ -551,14 +577,18 @@ class FormController extends Controller
|
|||
public function deletesubmission(Request $request) {
|
||||
$formdata = $request->session()->get('formdata');
|
||||
Log::debug(print_r($formdata, true));
|
||||
$canDeleteByPermission = is_object($formdata) && !empty($formdata->delete_submission);
|
||||
$canDeleteByUser = is_object($formdata) && isset($formdata->allow_delete_by_user) && $formdata->allow_delete_by_user == 'yes';
|
||||
$canDeleteByPermission = $this->sessionFlag($formdata, 'delete_submission');
|
||||
$canDeleteByUser = $this->sessionAttr($formdata, 'allow_delete_by_user') == 'yes';
|
||||
if(!$canDeleteByPermission && !$canDeleteByUser) {
|
||||
return response()->json(['success' => false, 'message' => 'Unauthorized'], 403);
|
||||
}
|
||||
$id = $request->input('id', false);
|
||||
$form_id = $request->input('form_id', false);
|
||||
list($application, $domain) = explode("-", $formdata->partition);
|
||||
$partition = $this->sessionAttr($formdata, 'partition');
|
||||
if (!$partition) {
|
||||
return response()->json(['success' => false, 'message' => 'Unauthorized'], 403);
|
||||
}
|
||||
list($application, $domain) = explode("-", $partition);
|
||||
$token = DB::table('users')->select("access_token")->where("domain", $domain)->where("permissions", 'like', '%contact_create%')->orderBy('updated_at', 'desc')->skip(0)->take(1)->get();
|
||||
//print_r(['form_id' => $form_id, 'id' => $id ]); exit;
|
||||
LambdaRequest::getrequest('form', 'formentity/deletesubmission', ['form_id' => $form_id, 'id' => $id ], $token[0]->access_token);
|
||||
|
|
@ -8131,7 +8161,7 @@ class FormController extends Controller
|
|||
$history = LambdaRequest::postrequest('form', 'formentity/getformhistory', ['form_id' => $form_id, 'user_id' => $formdata->user_id, 'partition' => $formdata->partition ]);
|
||||
//echo '<pre>'; print_r($history); print_r($formdata); exit;
|
||||
//Log::debug(print_r($history, true));
|
||||
$canDeleteSubmission = is_object($formdata) && !empty($formdata->delete_submission);
|
||||
$canDeleteSubmission = $this->sessionFlag($formdata, 'delete_submission');
|
||||
if($form_id == '1713426268-c89f38eb-ec32-43ba-a81b-b690a8f90d6a') {
|
||||
$plan_id = $request->input('plan_id', '');
|
||||
$submissions = [];
|
||||
|
|
@ -8145,11 +8175,20 @@ class FormController extends Controller
|
|||
$data = ['form' => $history->data->form, 'questions' => $history->data->questions, 'submissions' => $history->data->submissions, 'formname' => $history->data->formname, 'form_id' => $form_id, 'formdata' => $formdata, 'can_delete_submission' => $canDeleteSubmission ];
|
||||
}
|
||||
|
||||
$userAttrs = $this->userAttributeCodes($history->data->form ?? null);
|
||||
$userAttrLabels = $this->resolveUserAttributeLabels($userAttrs);
|
||||
$data['userAttrs'] = $userAttrs;
|
||||
$data['userAttrLabels'] = $userAttrLabels;
|
||||
|
||||
if($request->input('export', false)) {
|
||||
$exceldata = [];
|
||||
$exceldata[] = [$formdata->title];
|
||||
$exceldata[] = [''];
|
||||
$headers = ['Submission Date', 'Submitted By', 'Approval Status'];
|
||||
$headers = ['Submission Date', 'Submitted By'];
|
||||
foreach ($userAttrs as $attr) {
|
||||
$headers[] = $userAttrLabels[$attr] ?? ucwords(str_replace('_', ' ', (string) $attr));
|
||||
}
|
||||
$headers[] = 'Approval Status';
|
||||
foreach($history->data->questions as $question) {
|
||||
if (isset($question->type) && $question->type == 'hidden') {
|
||||
continue;
|
||||
|
|
@ -8168,6 +8207,9 @@ class FormController extends Controller
|
|||
$row = [];
|
||||
$row[] = $submission->createdAt;
|
||||
$row[] = isset($submission->user_info->name) ? $submission->user_info->name : '';
|
||||
foreach ($userAttrs as $attr) {
|
||||
$row[] = $this->userAttributeValue($submission->user_info ?? null, $attr);
|
||||
}
|
||||
$row[] = isset($submission->workflow_status) ? $submission->workflow_status : '';
|
||||
foreach($history->data->questions as $q => $v) {
|
||||
if (isset($v->type) && $v->type == 'hidden') {
|
||||
|
|
@ -10291,6 +10333,11 @@ class FormController extends Controller
|
|||
|
||||
$exceldata[] = [''];
|
||||
$headers = ['Submission Date', 'Submitted By', 'Employee Code', 'Approval Status'];
|
||||
$userAttrs = $this->userAttributeCodes($history->data->form ?? null);
|
||||
$userAttrLabels = $this->resolveUserAttributeLabels($userAttrs);
|
||||
foreach ($userAttrs as $attr) {
|
||||
$headers[] = $userAttrLabels[$attr] ?? ucwords(str_replace('_', ' ', (string) $attr));
|
||||
}
|
||||
$exportShowPositions = $history->data->form->show_positions ?? $history->data->form->show_position ?? 'no';
|
||||
$exportPositionColumns = $this->getAvailablePositionColumns($history->data->submissions ?? [], $exportShowPositions);
|
||||
$positionLabels = [
|
||||
|
|
@ -10325,6 +10372,9 @@ class FormController extends Controller
|
|||
$row[] = isset($submission->user_info->name) ? $submission->user_info->name : '';
|
||||
$row[] = isset($submission->user_info->employee_code) ? $submission->user_info->employee_code : '';
|
||||
$row[] = isset($submission->workflow_status) ? $submission->workflow_status : '';
|
||||
foreach ($userAttrs as $attr) {
|
||||
$row[] = $this->userAttributeValue($submission->user_info ?? null, $attr);
|
||||
}
|
||||
foreach ($exportPositionColumns as $positionField) {
|
||||
$row[] = isset($submission->{$positionField}) ? $submission->{$positionField} : '';
|
||||
}
|
||||
|
|
@ -12487,4 +12537,87 @@ class FormController extends Controller
|
|||
Log::debug($cmd);
|
||||
}
|
||||
|
||||
/**
|
||||
* Selected user attribute codes when the form is configured to show them.
|
||||
* Uses the saved attribute list as the source of truth so columns still render
|
||||
* if Show User Attributes was left off after attributes were selected.
|
||||
*/
|
||||
protected function userAttributeCodes($form): array
|
||||
{
|
||||
if (!$form) {
|
||||
return [];
|
||||
}
|
||||
$raw = $form->user_attributes ?? [];
|
||||
if (is_object($raw)) {
|
||||
$raw = (array) $raw;
|
||||
}
|
||||
if (is_string($raw) && $raw !== '') {
|
||||
$decoded = json_decode($raw, true);
|
||||
$raw = is_array($decoded) ? $decoded : explode('#', $raw);
|
||||
}
|
||||
if (!is_array($raw)) {
|
||||
return [];
|
||||
}
|
||||
$codes = [];
|
||||
foreach ($raw as $code) {
|
||||
if (is_object($code)) {
|
||||
$code = $code->code ?? '';
|
||||
} elseif (is_array($code)) {
|
||||
$code = $code['code'] ?? '';
|
||||
}
|
||||
$code = trim((string) $code);
|
||||
if ($code !== '') {
|
||||
$codes[] = $code;
|
||||
}
|
||||
}
|
||||
$codes = array_values(array_unique($codes));
|
||||
return $codes;
|
||||
}
|
||||
|
||||
protected function userAttributeValue($user, string $attr): string
|
||||
{
|
||||
if (!$user) {
|
||||
return '-';
|
||||
}
|
||||
$prefixed = 'attribute_' . $attr;
|
||||
if (isset($user->{$attr}) && $user->{$attr} !== '') {
|
||||
return (string) $user->{$attr};
|
||||
}
|
||||
if (isset($user->{$prefixed}) && $user->{$prefixed} !== '') {
|
||||
return (string) $user->{$prefixed};
|
||||
}
|
||||
return '-';
|
||||
}
|
||||
|
||||
/**
|
||||
* Map user attribute codes to display names.
|
||||
*/
|
||||
protected function resolveUserAttributeLabels(array $codes): array
|
||||
{
|
||||
$labels = [];
|
||||
if (empty($codes)) {
|
||||
return $labels;
|
||||
}
|
||||
|
||||
$map = [];
|
||||
try {
|
||||
$userAttrs = $this->getlambda('get', 'ums', 'userattribute', 'get_all');
|
||||
if (isset($userAttrs->data->items) && is_array($userAttrs->data->items)) {
|
||||
foreach ($userAttrs->data->items as $attr) {
|
||||
if (isset($attr->code)) {
|
||||
$map[$attr->code] = $attr->attribute ?? $attr->code;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
// Fall back to ucwords(code) below
|
||||
}
|
||||
|
||||
foreach ($codes as $code) {
|
||||
$labels[$code] = $map[$code] ?? ucwords(str_replace('_', ' ', (string) $code));
|
||||
}
|
||||
|
||||
return $labels;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -158,6 +158,9 @@ class FormentityController extends Controller
|
|||
$values->show_manager_details = $values->show_manager_details ?? 'no';
|
||||
$values->show_user_attributes = (($values->show_user_attributes ?? 'no') === 'yes') ? 'yes' : 'no';
|
||||
$values->user_attributes = $this->normalizeAttributeCodes($values->user_attributes ?? []);
|
||||
if (!empty($values->user_attributes)) {
|
||||
$values->show_user_attributes = 'yes';
|
||||
}
|
||||
}
|
||||
//echo '<pre>'; print_r($values); exit;
|
||||
return $values;
|
||||
|
|
@ -251,6 +254,9 @@ class FormentityController extends Controller
|
|||
$data['roles_info'] = ($data['roles_info'] ?? 'no') === 'yes' ? 'yes' : 'no';
|
||||
$data['show_user_attributes'] = ($data['show_user_attributes'] ?? 'no') === 'yes' ? 'yes' : 'no';
|
||||
$data['user_attributes'] = $this->normalizeAttributeCodes($data['user_attributes'] ?? []);
|
||||
if (!empty($data['user_attributes'])) {
|
||||
$data['show_user_attributes'] = 'yes';
|
||||
}
|
||||
if ($data['email_notification'] === 'no') {
|
||||
$data['email_notification_rules'] = [];
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -153,9 +153,14 @@ class MetricreportController extends Controller
|
|||
if (isset($response->data->graph->contact_attributes) && is_array($response->data->graph->contact_attributes)) {
|
||||
$contact_attribute_labels = $this->resolveContactAttributeLabels($response->data->graph->contact_attributes);
|
||||
}
|
||||
|
||||
$user_attribute_labels = [];
|
||||
if (isset($response->data->graph)) {
|
||||
$user_attribute_labels = $this->resolveUserAttributeLabels($this->userAttributeCodes($response->data->graph));
|
||||
}
|
||||
|
||||
//echo '<pre>'; print_r(['periods' => $response->data->periods, 'charts' => $response->data->available_charts, 'graph' => $response->data->graph, 'post' => $post, 'colors' => $colors, 'breadcrumbs' => $breadcrumbs]); exit;
|
||||
return $this->view('report')->with(['periods' => $response->data->periods, 'charts' => $response->data->available_charts, 'graph' => $response->data->graph, 'post' => $post , 'colors' => $colors, 'breadcrumbs' => $breadcrumbs, 'contact_attribute_labels' => $contact_attribute_labels]);
|
||||
return $this->view('report')->with(['periods' => $response->data->periods, 'charts' => $response->data->available_charts, 'graph' => $response->data->graph, 'post' => $post , 'colors' => $colors, 'breadcrumbs' => $breadcrumbs, 'contact_attribute_labels' => $contact_attribute_labels, 'user_attribute_labels' => $user_attribute_labels]);
|
||||
}
|
||||
|
||||
public function export(Request $request) {
|
||||
|
|
@ -177,6 +182,8 @@ class MetricreportController extends Controller
|
|||
}
|
||||
}
|
||||
$exceldata[] = [''];
|
||||
$userAttrCodes = $this->userAttributeCodes($response->data->graph);
|
||||
$userAttrLabels = $this->resolveUserAttributeLabels($userAttrCodes);
|
||||
switch($response->data->post->type) {
|
||||
case 'leaderboard':
|
||||
case 'scoreboard':
|
||||
|
|
@ -185,6 +192,9 @@ class MetricreportController extends Controller
|
|||
$headings = $hideRank
|
||||
? ["User Id", "User Name", "Employee Code", "Designation"]
|
||||
: ["Rank", "User Id", "User Name", "Employee Code", "Designation"];
|
||||
foreach ($userAttrCodes as $attr) {
|
||||
$headings[] = $userAttrLabels[$attr] ?? ucwords(str_replace('_', ' ', (string) $attr));
|
||||
}
|
||||
//'Manager 1 Name', 'Manager 1 Emp Code', 'Manager 1 Email', 'Manager 2 Name', 'Manager 2 Emp Code', 'Manager 2 Email'
|
||||
$parentSample = [];
|
||||
if (!empty($response->data->graph->values)) {
|
||||
|
|
@ -223,6 +233,9 @@ class MetricreportController extends Controller
|
|||
(string)($user->employee_code ?? ''),
|
||||
$user->designation ?? '',
|
||||
];
|
||||
foreach ($userAttrCodes as $attr) {
|
||||
$rowdata[] = $this->userAttributeValue($user, $attr);
|
||||
}
|
||||
$parents = (isset($user->parents) && !empty((array) $user->parents)) ? (array) $user->parents : [];
|
||||
foreach ($parents as $par) {
|
||||
$rowdata[] = isset($par->name) ? $par->name : '-';
|
||||
|
|
@ -294,7 +307,11 @@ class MetricreportController extends Controller
|
|||
break;
|
||||
case 'details':
|
||||
if($response->data->graph->chart == 'tabular') {
|
||||
$headers = ['User', 'Employee Code', 'Email', 'Designation', 'Manager 1 Name', 'Manager 1 Emp Code', 'Manager 1 Email', 'Manager 2 Name', 'Manager 2 Emp Code', 'Manager 2 Email', 'Zone', 'Region', "Area", "Territory", "Role"];
|
||||
$headers = ['User', 'Employee Code', 'Email', 'Designation'];
|
||||
foreach ($userAttrCodes as $attr) {
|
||||
$headers[] = $userAttrLabels[$attr] ?? ucwords(str_replace('_', ' ', (string) $attr));
|
||||
}
|
||||
$headers = array_merge($headers, ['Manager 1 Name', 'Manager 1 Emp Code', 'Manager 1 Email', 'Manager 2 Name', 'Manager 2 Emp Code', 'Manager 2 Email', 'Zone', 'Region', "Area", "Territory", "Role"]);
|
||||
foreach($response->data->graph->values->metrics as $metric) {
|
||||
$headers[] = $metric->metric;
|
||||
}
|
||||
|
|
@ -305,6 +322,9 @@ class MetricreportController extends Controller
|
|||
$row[] = $user->employee_code;
|
||||
$row[] = $user->email;
|
||||
$row[] = $user->designation;
|
||||
foreach ($userAttrCodes as $attr) {
|
||||
$row[] = $this->userAttributeValue($user, $attr);
|
||||
}
|
||||
|
||||
if(isset($user->parents->{'level_'.($user->level+1)})) {
|
||||
$manager = $user->parents->{'level_'.($user->level+1)};
|
||||
|
|
@ -589,6 +609,12 @@ class MetricreportController extends Controller
|
|||
$first->user->{$prop} = $canonical->user->{$prop};
|
||||
}
|
||||
}
|
||||
foreach ($this->userAttributeCodes($graph) as $attr) {
|
||||
if ((!isset($first->user->{$attr}) || $first->user->{$attr} === '' || $first->user->{$attr} === '-')
|
||||
&& isset($canonical->user->{$attr})) {
|
||||
$first->user->{$attr} = $canonical->user->{$attr};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$graph->values = array_values(array_filter($graph->values, function ($val, $i) use ($uid) {
|
||||
|
|
@ -629,4 +655,75 @@ class MetricreportController extends Controller
|
|||
|
||||
return $labels;
|
||||
}
|
||||
|
||||
/**
|
||||
* Selected user attribute codes when the view is configured to show them.
|
||||
*/
|
||||
protected function userAttributeCodes($graph): array
|
||||
{
|
||||
if (($graph->show_user_attributes ?? 'no') !== 'yes') {
|
||||
return [];
|
||||
}
|
||||
$raw = $graph->user_attributes ?? [];
|
||||
if (!is_array($raw)) {
|
||||
return [];
|
||||
}
|
||||
$codes = [];
|
||||
foreach ($raw as $code) {
|
||||
if (is_object($code)) {
|
||||
$code = $code->code ?? '';
|
||||
}
|
||||
$code = trim((string) $code);
|
||||
if ($code !== '') {
|
||||
$codes[] = $code;
|
||||
}
|
||||
}
|
||||
return array_values(array_unique($codes));
|
||||
}
|
||||
|
||||
protected function userAttributeValue($user, string $attr): string
|
||||
{
|
||||
if (!$user) {
|
||||
return '-';
|
||||
}
|
||||
$prefixed = 'attribute_' . $attr;
|
||||
if (isset($user->{$attr}) && $user->{$attr} !== '') {
|
||||
return (string) $user->{$attr};
|
||||
}
|
||||
if (isset($user->{$prefixed}) && $user->{$prefixed} !== '') {
|
||||
return (string) $user->{$prefixed};
|
||||
}
|
||||
return '-';
|
||||
}
|
||||
|
||||
/**
|
||||
* Map user attribute codes to display names.
|
||||
*/
|
||||
protected function resolveUserAttributeLabels(array $codes): array
|
||||
{
|
||||
$labels = [];
|
||||
if (empty($codes)) {
|
||||
return $labels;
|
||||
}
|
||||
|
||||
$map = [];
|
||||
try {
|
||||
$userAttrs = $this->getlambda('get', 'ums', 'userattribute', 'get_all');
|
||||
if (isset($userAttrs->data->items) && is_array($userAttrs->data->items)) {
|
||||
foreach ($userAttrs->data->items as $attr) {
|
||||
if (isset($attr->code)) {
|
||||
$map[$attr->code] = $attr->attribute ?? $attr->code;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
// Fall back to ucwords(code) below
|
||||
}
|
||||
|
||||
foreach ($codes as $code) {
|
||||
$labels[$code] = $map[$code] ?? ucwords(str_replace('_', ' ', (string) $code));
|
||||
}
|
||||
|
||||
return $labels;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,9 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th data-priority="1">Submission Date</th>
|
||||
@foreach(($userAttrs ?? []) as $attr)
|
||||
<th data-priority="1">{{ $userAttrLabels[$attr] ?? ucwords(str_replace('_', ' ', $attr)) }}</th>
|
||||
@endforeach
|
||||
@foreach($questions as $code => $question)
|
||||
@if($question->type == 'hidden')
|
||||
@continue;
|
||||
|
|
@ -59,6 +62,20 @@
|
|||
@foreach($submissions as $submission)
|
||||
<tr>
|
||||
<th>{{date("d M Y", strtotime($submission->updatedAt))}}</th>
|
||||
@foreach(($userAttrs ?? []) as $attr)
|
||||
@php
|
||||
$uaUser = $submission->user_info ?? null;
|
||||
$uaVal = '-';
|
||||
if ($uaUser) {
|
||||
if (isset($uaUser->{$attr}) && $uaUser->{$attr} !== '') {
|
||||
$uaVal = $uaUser->{$attr};
|
||||
} elseif (isset($uaUser->{'attribute_'.$attr}) && $uaUser->{'attribute_'.$attr} !== '') {
|
||||
$uaVal = $uaUser->{'attribute_'.$attr};
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
<td>{{ $uaVal }}</td>
|
||||
@endforeach
|
||||
@foreach($questions as $code => $question)
|
||||
@if($question->type == 'hidden')
|
||||
@continue;
|
||||
|
|
@ -97,16 +114,20 @@
|
|||
@endif
|
||||
@endforeach
|
||||
<th>
|
||||
@php
|
||||
$isApproved = ($submission->workflow ?? '') == 'yes' && ($submission->workflow_status ?? '') == 'approved';
|
||||
$showFieldDelete = isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes' && !$isApproved;
|
||||
@endphp
|
||||
@if($question->can_edit == 'yes' || sizeof($submission->workflow_approvals) == 0 )
|
||||
@if($submission->workflow == 'yes' && $submission->workflow_status == 'approved' )
|
||||
@if($isApproved)
|
||||
<p>Approved</p>
|
||||
@else
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@if($showFieldDelete || !empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -67,6 +67,9 @@
|
|||
<th data-priority="1">Submission Date</th>
|
||||
<th data-priority="1">Submitted By</th>
|
||||
<th data-priority="1">Employee Code</th>
|
||||
@foreach(($userAttrs ?? []) as $attr)
|
||||
<th data-priority="1">{{ $userAttrLabels[$attr] ?? ucwords(str_replace('_', ' ', $attr)) }}</th>
|
||||
@endforeach
|
||||
@if(isset($formdata) && isset($formdata->workflow) && $formdata->workflow == 'yes' )
|
||||
<th data-priority="1">Workflow Status</th>
|
||||
@endif
|
||||
|
|
@ -169,6 +172,7 @@
|
|||
const loggedInUser = @json($formdata->user_id ?? "");
|
||||
const allAccess = @json(isset($formdata->all_data_access) ? $formdata->all_data_access : 0);
|
||||
const formId = @json($form_id);
|
||||
const canDeleteSubmission = @json(!empty($formdata->delete_submission));
|
||||
|
||||
let table = $('#basic-datatable').DataTable({
|
||||
"responsive": false,
|
||||
|
|
@ -196,7 +200,7 @@
|
|||
if (row.actions.includes('edit')) {
|
||||
buttons += ` <button title="Edit" class="btn btn-warning btn-xs waves-effect waves-light btn-edit" submission="${row.submission_id}"><i class="mdi mdi-pencil-outline"></i></button>`;
|
||||
}
|
||||
if (row.actions.includes('delete')) {
|
||||
if (row.actions.includes('delete') || canDeleteSubmission) {
|
||||
buttons += ` <button title="Delete" class="btn btn-danger btn-xs waves-effect waves-light btn-delete" submission="${row.submission_id}"><i class="mdi mdi-delete-outline"></i></button>`;
|
||||
}
|
||||
|
||||
|
|
@ -226,6 +230,9 @@
|
|||
{ "data": "date" },
|
||||
{ "data": "name" },
|
||||
{ "data": "employee_code" },
|
||||
@foreach(($userAttrs ?? []) as $attr)
|
||||
{ "data": "{{ $attr }}" },
|
||||
@endforeach
|
||||
@if(isset($formdata) && isset($formdata->workflow) && $formdata->workflow == 'yes' )
|
||||
{ "data": "workflow_status" },
|
||||
@endif
|
||||
|
|
@ -460,6 +467,7 @@
|
|||
@else
|
||||
params['team_report'] = 1;
|
||||
@endif
|
||||
params['delete_submission'] = canDeleteSubmission ? 1 : 0;
|
||||
|
||||
params = Object.assign(params, extraParams);
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@
|
|||
|
||||
{{-- <a href="/form/show?form_id={{ $submission->formdata->form_id }}&id={{ $submission->id }}" class="btn btn-primary btn-xs">Edit</a>
|
||||
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{ $submission->formdata->form_id }}&id={{ $submission->id }}"
|
||||
onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');"
|
||||
class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
|
|
@ -111,11 +111,15 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -71,11 +71,15 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
{{-- <a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button> --}}
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -71,11 +71,15 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif --}}
|
||||
@endif
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -102,11 +102,15 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
{{-- <a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button> --}}
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
|
|
|
|||
|
|
@ -71,11 +71,15 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
{{-- <a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif --}}
|
||||
@endif
|
||||
@endif
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -69,11 +69,15 @@
|
|||
{{-- @if($question->can_edit == 'yes' || sizeof($submission->workflow_approvals) == 0 )
|
||||
@if($submission->workflow == 'yes' && $submission->workflow_status == 'rejected' )
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif --}}
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -69,11 +69,15 @@
|
|||
{{-- @if($question->can_edit == 'yes' || sizeof($submission->workflow_approvals) == 0 )
|
||||
@if($submission->workflow == 'yes' && $submission->workflow_status == 'rejected' )
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif --}}
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -69,11 +69,15 @@
|
|||
{{-- @if($question->can_edit == 'yes' || sizeof($submission->workflow_approvals) == 0 )
|
||||
@if($submission->workflow == 'yes' && $submission->workflow_status == 'rejected' )
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif --}}
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -69,11 +69,15 @@
|
|||
{{-- @if($question->can_edit == 'yes' || sizeof($submission->workflow_approvals) == 0 )
|
||||
@if($submission->workflow == 'yes' && $submission->workflow_status == 'rejected' )
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif --}}
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -87,11 +87,15 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@
|
|||
|
||||
{{-- <a href="/form/show?form_id={{ $submission->formdata->form_id }}&id={{ $submission->id }}" class="btn btn-primary btn-xs">Edit</a>
|
||||
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{ $submission->formdata->form_id }}&id={{ $submission->id }}"
|
||||
onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');"
|
||||
class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
|
|
@ -111,11 +111,15 @@
|
|||
<p>Approved</p>
|
||||
@elseif($submission->workflow == 'yes' && $submission->workflow_status == 'rejected' )
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@
|
|||
|
||||
{{-- <a href="/form/show?form_id={{ $submission->formdata->form_id }}&id={{ $submission->id }}" class="btn btn-primary btn-xs">Edit</a>
|
||||
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{ $submission->formdata->form_id }}&id={{ $submission->id }}"
|
||||
onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');"
|
||||
class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
|
|
@ -111,11 +111,15 @@
|
|||
<p>Approved</p>
|
||||
@elseif($submission->workflow == 'yes' && $submission->workflow_status == 'rejected' )
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@
|
|||
|
||||
{{-- <a href="/form/show?form_id={{ $submission->formdata->form_id }}&id={{ $submission->id }}" class="btn btn-primary btn-xs">Edit</a>
|
||||
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{ $submission->formdata->form_id }}&id={{ $submission->id }}"
|
||||
onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');"
|
||||
class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
|
|
@ -111,11 +111,15 @@
|
|||
<p>Approved</p>
|
||||
@elseif($submission->workflow == 'yes' && $submission->workflow_status == 'rejected' )
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@
|
|||
|
||||
{{-- <a href="/form/show?form_id={{ $submission->formdata->form_id }}&id={{ $submission->id }}" class="btn btn-primary btn-xs">Edit</a>
|
||||
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{ $submission->formdata->form_id }}&id={{ $submission->id }}"
|
||||
onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');"
|
||||
class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
|
|
@ -111,11 +111,15 @@
|
|||
<p>Approved</p>
|
||||
@elseif($submission->workflow == 'yes' && $submission->workflow_status == 'rejected' )
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -77,11 +77,15 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif --}}
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -77,11 +77,15 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif --}}
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@
|
|||
{{-- <p>UnApproved</p> --}}
|
||||
<a href="/form/show?form_id={{ $submission->formdata->form_id }}&id={{ $submission->id }}&edit=1" class="btn btn-primary btn-xs">Edit</a>
|
||||
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{ $submission->formdata->form_id }}&id={{ $submission->id }}"
|
||||
onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');"
|
||||
class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
|
|
@ -92,11 +92,15 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif --}}
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@
|
|||
{{-- <p>UnApproved</p> --}}
|
||||
<a href="/form/show?form_id={{ $submission->formdata->form_id }}&id={{ $submission->id }}&edit=1" class="btn btn-primary btn-xs">Edit</a>
|
||||
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{ $submission->formdata->form_id }}&id={{ $submission->id }}"
|
||||
onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');"
|
||||
class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
|
|
@ -92,11 +92,15 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif --}}
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@
|
|||
|
||||
{{-- <a href="/form/show?form_id={{ $submission->formdata->form_id }}&id={{ $submission->id }}" class="btn btn-primary btn-xs">Edit</a>
|
||||
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{ $submission->formdata->form_id }}&id={{ $submission->id }}"
|
||||
onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');"
|
||||
class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
|
|
@ -111,11 +111,15 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -77,11 +77,15 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
{{-- <a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button> --}}
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@
|
|||
|
||||
@if($submission->workflow == 'yes' && $submission->workflow_status == 'rejected' )
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@elseif($submission->workflow == 'yes' && $submission->workflow_status == 'approved' )
|
||||
|
|
@ -80,6 +80,10 @@
|
|||
|
||||
|
||||
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@
|
|||
{{-- <p>UnApproved</p> --}}
|
||||
<a href="/form/show?form_id={{ $submission->formdata->form_id }}&id={{ $submission->id }}" class="btn btn-primary btn-xs">Edit</a>
|
||||
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{ $submission->formdata->form_id }}&id={{ $submission->id }}"
|
||||
onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');"
|
||||
class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
|
|
@ -98,11 +98,15 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif --}}
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@
|
|||
|
||||
<a href="/form/show?form_id={{ $submission->formdata->form_id }}&id={{ $submission->id }}" class="btn btn-primary btn-xs">Edit</a>
|
||||
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{ $submission->formdata->form_id }}&id={{ $submission->id }}"
|
||||
onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');"
|
||||
class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
|
|
@ -95,11 +95,15 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif --}}
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
|
|
|
|||
|
|
@ -134,6 +134,7 @@
|
|||
const loggedInUser = @json($formdata->user_id ?? "");
|
||||
const allAccess = @json(isset($formdata->all_data_access) ? $formdata->all_data_access : 0);
|
||||
const formId = @json($form_id);
|
||||
const canDeleteSubmission = @json(!empty($formdata->delete_submission));
|
||||
const partition = @json($formdata->partition ?? '');
|
||||
|
||||
function buildGeneratedImageDownloadHtml(row, iconOnly) {
|
||||
|
|
@ -178,7 +179,7 @@
|
|||
if (row.actions.includes('edit')) {
|
||||
buttons += ` <button title="Edit" class="btn btn-warning btn-xs waves-effect waves-light btn-edit" submission="${row.submission_id}"><i class="mdi mdi-pencil-outline"></i></button>`;
|
||||
}
|
||||
if (row.actions.includes('delete')) {
|
||||
if (row.actions.includes('delete') || canDeleteSubmission) {
|
||||
buttons += ` <button title="Delete" class="btn btn-danger btn-xs waves-effect waves-light btn-delete" submission="${row.submission_id}"><i class="mdi mdi-delete-outline"></i></button>`;
|
||||
}
|
||||
|
||||
|
|
@ -382,6 +383,7 @@
|
|||
params['user_id'] = '{{ $formdata->user_id ?? '' }}';
|
||||
params['team_report'] = 1;
|
||||
@endif
|
||||
params['delete_submission'] = canDeleteSubmission ? 1 : 0;
|
||||
|
||||
params = Object.assign(params, extraParams);
|
||||
// Ensure form_id is never dropped by filters / load-more
|
||||
|
|
|
|||
|
|
@ -77,11 +77,15 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -62,11 +62,14 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Upload Invoice</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
</th>
|
||||
<th>{{date("d M Y", strtotime($submission->updatedAt))}}</th>
|
||||
@foreach($questions as $code => $question)
|
||||
|
|
|
|||
|
|
@ -71,11 +71,15 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -71,11 +71,15 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -69,11 +69,15 @@
|
|||
{{-- @if($question->can_edit == 'yes' || sizeof($submission->workflow_approvals) == 0 )
|
||||
@if($submission->workflow == 'yes' && $submission->workflow_status == 'rejected' )
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif --}}
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -640,6 +640,7 @@
|
|||
params['user_id'] = '{{ $formdata->user_id }}';
|
||||
params['team_report'] = 1;
|
||||
@endif
|
||||
params['delete_submission'] = @json(!empty($formdata->delete_submission)) ? 1 : 0;
|
||||
|
||||
// Merge extraParams (e.g., date range, form_id)
|
||||
params = Object.assign(params, extraParams);
|
||||
|
|
|
|||
|
|
@ -223,6 +223,7 @@ $is_authorised = in_array('1655449174-a39a5017-8232-4d58-a253-90d06bc733d0', $ro
|
|||
const nextApprover = row?.workflow_next_approver ?? "";
|
||||
const noofneb = row?.no_of_nebulizer ?? [];
|
||||
const allAccess = @json($formdata->all_data_access ?? 0);
|
||||
const canDeleteSubmission = @json(!empty($formdata->delete_submission));
|
||||
// console.log("row:", row);
|
||||
// console.log('workflowType'+workflowType);
|
||||
|
||||
|
|
@ -239,7 +240,7 @@ $is_authorised = in_array('1655449174-a39a5017-8232-4d58-a253-90d06bc733d0', $ro
|
|||
if (row.actions.includes('edit')) {
|
||||
buttons += ` <button title="Edit" class="btn btn-warning btn-xs waves-effect waves-light btn-edit" submission="${row.submission_id}"><i class="mdi mdi-pencil-outline"></i></button>`;
|
||||
}
|
||||
if (row.actions.includes('delete')) {
|
||||
if (row.actions.includes('delete') || canDeleteSubmission) {
|
||||
buttons += ` <button title="Delete" class="btn btn-danger btn-xs waves-effect waves-light btn-delete" submission="${row.submission_id}"><i class="mdi mdi-delete-outline"></i></button>`;
|
||||
}
|
||||
|
||||
|
|
@ -380,6 +381,7 @@ $is_authorised = in_array('1655449174-a39a5017-8232-4d58-a253-90d06bc733d0', $ro
|
|||
params['user_id'] = '{{$formdata->user_id}}';
|
||||
params['team_report'] = 1;
|
||||
@endif
|
||||
params['delete_submission'] = @json(!empty($formdata->delete_submission)) ? 1 : 0;
|
||||
|
||||
// Merge extraParams (e.g., date range, form_id)
|
||||
params = Object.assign(params, extraParams);
|
||||
|
|
|
|||
|
|
@ -147,6 +147,7 @@ $is_authorised = in_array('1655449174-a39a5017-8232-4d58-a253-90d06bc733d0', $ro
|
|||
|
||||
<script>
|
||||
const user_id = @json($logged_in_user);
|
||||
const canDeleteSubmission = @json(!empty($formdata->delete_submission));
|
||||
console.log('user'+ user_id);
|
||||
|
||||
const is_authorised = @json($is_authorised);
|
||||
|
|
@ -267,10 +268,9 @@ $is_authorised = in_array('1655449174-a39a5017-8232-4d58-a253-90d06bc733d0', $ro
|
|||
if (row.actions.includes('edit')) {
|
||||
buttons += ` <button title="Edit" class="btn btn-warning btn-xs waves-effect waves-light btn-edit" submission="${row.submission_id}"><i class="mdi mdi-pencil-outline"></i></button>`;
|
||||
}
|
||||
if (row.actions.includes('delete')) {
|
||||
}
|
||||
if ((user_id == '1655447765-e31f1d42-78f2-47b4-9f1d-2df00913d82f' && row.actions.includes('delete')) || canDeleteSubmission) {
|
||||
buttons += ` <button title="Delete" class="btn btn-danger btn-xs waves-effect waves-light btn-delete" submission="${row.submission_id}"><i class="mdi mdi-delete-outline"></i></button>`;
|
||||
}
|
||||
|
||||
}
|
||||
// if(is_authorised){
|
||||
if(row.no_of_nebulizer <= 5){
|
||||
|
|
@ -372,6 +372,7 @@ $is_authorised = in_array('1655449174-a39a5017-8232-4d58-a253-90d06bc733d0', $ro
|
|||
params['user_id'] = '{{$formdata->user_id}}';
|
||||
params['team_report'] = 1;
|
||||
@endif
|
||||
params['delete_submission'] = canDeleteSubmission ? 1 : 0;
|
||||
|
||||
// Merge extraParams (e.g., date range, form_id)
|
||||
params = Object.assign(params, extraParams);
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@
|
|||
|
||||
{{-- <a href="/form/show?form_id={{ $submission->formdata->form_id }}&id={{ $submission->id }}" class="btn btn-primary btn-xs">Edit</a>
|
||||
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{ $submission->formdata->form_id }}&id={{ $submission->id }}"
|
||||
onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');"
|
||||
class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
|
|
@ -111,11 +111,15 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -69,11 +69,15 @@
|
|||
@if($question->can_edit == 'yes' || sizeof($submission->workflow_approvals) == 0 )
|
||||
@if($submission->workflow == 'yes' && $submission->workflow_status == 'rejected' )
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -69,11 +69,15 @@
|
|||
@if($question->can_edit == 'yes' || sizeof($submission->workflow_approvals) == 0 )
|
||||
@if($submission->workflow == 'yes' && $submission->workflow_status == 'rejected' )
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -69,11 +69,15 @@
|
|||
{{-- @if($question->can_edit == 'yes' || sizeof($submission->workflow_approvals) == 0 )
|
||||
@if($submission->workflow == 'yes' && $submission->workflow_status == 'rejected' )
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif --}}
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -69,11 +69,15 @@
|
|||
{{-- @if($question->can_edit == 'yes' || sizeof($submission->workflow_approvals) == 0 )
|
||||
@if($submission->workflow == 'yes' && $submission->workflow_status == 'rejected' )
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif --}}
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -79,11 +79,15 @@
|
|||
<!-- <a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit
|
||||
|
||||
</button> -->
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -102,11 +102,15 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
{{-- <a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button> --}}
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -71,11 +71,15 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif --}}
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -71,11 +71,15 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif --}}
|
||||
@endif
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -71,11 +71,15 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif --}}
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -71,11 +71,15 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif --}}
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -71,11 +71,15 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif --}}
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -73,11 +73,15 @@
|
|||
|
||||
@if($submission->workflow == 'yes' && $submission->workflow_status =='rejected')
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -77,11 +77,15 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
{{-- <a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button> --}}
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -77,11 +77,15 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
{{-- <a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button> --}}
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -134,6 +134,7 @@
|
|||
const loggedInUser = @json($formdata->user_id ?? "");
|
||||
const allAccess = @json(isset($formdata->all_data_access) ? $formdata->all_data_access : 0);
|
||||
const formId = @json($form_id);
|
||||
const canDeleteSubmission = @json(!empty($formdata->delete_submission));
|
||||
const partition = @json($formdata->partition ?? '');
|
||||
|
||||
function buildGeneratedImageDownloadHtml(row, iconOnly) {
|
||||
|
|
@ -178,7 +179,7 @@
|
|||
if (row.actions.includes('edit')) {
|
||||
buttons += ` <button title="Edit" class="btn btn-warning btn-xs waves-effect waves-light btn-edit" submission="${row.submission_id}"><i class="mdi mdi-pencil-outline"></i></button>`;
|
||||
}
|
||||
if (row.actions.includes('delete')) {
|
||||
if (row.actions.includes('delete') || canDeleteSubmission) {
|
||||
buttons += ` <button title="Delete" class="btn btn-danger btn-xs waves-effect waves-light btn-delete" submission="${row.submission_id}"><i class="mdi mdi-delete-outline"></i></button>`;
|
||||
}
|
||||
|
||||
|
|
@ -382,6 +383,7 @@
|
|||
params['user_id'] = '{{ $formdata->user_id ?? '' }}';
|
||||
params['team_report'] = 1;
|
||||
@endif
|
||||
params['delete_submission'] = canDeleteSubmission ? 1 : 0;
|
||||
|
||||
params = Object.assign(params, extraParams);
|
||||
// Ensure form_id is never dropped by filters / load-more
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@
|
|||
{{-- <p>UnApproved</p> --}}
|
||||
<a href="/form/show?form_id={{ $submission->formdata->form_id }}&id={{ $submission->id }}" class="btn btn-primary btn-xs">Edit</a>
|
||||
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{ $submission->formdata->form_id }}&id={{ $submission->id }}"
|
||||
onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');"
|
||||
class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
|
|
@ -98,11 +98,15 @@
|
|||
<p>Approved</p>
|
||||
@else
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
||||
@if((isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes') || !empty($can_delete_submission))
|
||||
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
||||
@endif
|
||||
@endif
|
||||
@endif --}}
|
||||
@if(!empty($can_delete_submission))
|
||||
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
||||
@endif
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -278,6 +278,7 @@
|
|||
const workflowType = (document.getElementById('workflow_type')?.value ?? "").toLowerCase();
|
||||
const nextApprover = row?.workflow_next_approver ?? "";
|
||||
const allAccess = @json($formdata->all_data_access ?? 0);
|
||||
const canDeleteSubmission = @json(!empty($formdata->delete_submission));
|
||||
|
||||
// console.log("loggedInUser:", loggedInUser);
|
||||
// console.log("workflowType:", workflowType);
|
||||
|
|
@ -290,7 +291,7 @@
|
|||
if (row.actions.includes('edit')) {
|
||||
buttons += ` <button title="Edit" class="btn btn-warning btn-xs waves-effect waves-light btn-edit" submission="${row.submission_id}"><i class="mdi mdi-pencil-outline"></i></button>`;
|
||||
}
|
||||
if (row.actions.includes('delete')) {
|
||||
if (row.actions.includes('delete') || canDeleteSubmission) {
|
||||
buttons += ` <button title="Delete" class="btn btn-danger btn-xs waves-effect waves-light btn-delete" submission="${row.submission_id}"><i class="mdi mdi-delete-outline"></i></button>`;
|
||||
}
|
||||
|
||||
|
|
@ -377,6 +378,7 @@
|
|||
params['user_id'] = '{{$formdata->user_id}}';
|
||||
params['team_report'] = 1;
|
||||
@endif
|
||||
params['delete_submission'] = @json(!empty($formdata->delete_submission)) ? 1 : 0;
|
||||
|
||||
// Merge extraParams (e.g., date range, form_id)
|
||||
params = Object.assign(params, extraParams);
|
||||
|
|
|
|||
|
|
@ -67,6 +67,9 @@
|
|||
<th data-priority="1">Submission Date</th>
|
||||
<th data-priority="1">Submitted By</th>
|
||||
<th data-priority="1">Employee Code</th>
|
||||
@foreach(($userAttrs ?? []) as $attr)
|
||||
<th data-priority="1">{{ $userAttrLabels[$attr] ?? ucwords(str_replace('_', ' ', $attr)) }}</th>
|
||||
@endforeach
|
||||
@if(isset($formdata) && isset($formdata->workflow) && $formdata->workflow == 'yes' )
|
||||
<th data-priority="1">Workflow Status</th>
|
||||
@endif
|
||||
|
|
@ -169,6 +172,7 @@
|
|||
const loggedInUser = @json($formdata->user_id ?? "");
|
||||
const allAccess = @json(isset($formdata->all_data_access) ? $formdata->all_data_access : 0);
|
||||
const formId = @json($form_id);
|
||||
const canDeleteSubmission = @json(!empty($formdata->delete_submission));
|
||||
|
||||
let table = $('#basic-datatable').DataTable({
|
||||
"responsive": false,
|
||||
|
|
@ -196,7 +200,7 @@
|
|||
if (row.actions.includes('edit')) {
|
||||
buttons += ` <button title="Edit" class="btn btn-warning btn-xs waves-effect waves-light btn-edit" submission="${row.submission_id}"><i class="mdi mdi-pencil-outline"></i></button>`;
|
||||
}
|
||||
if (row.actions.includes('delete')) {
|
||||
if (row.actions.includes('delete') || canDeleteSubmission) {
|
||||
buttons += ` <button title="Delete" class="btn btn-danger btn-xs waves-effect waves-light btn-delete" submission="${row.submission_id}"><i class="mdi mdi-delete-outline"></i></button>`;
|
||||
}
|
||||
|
||||
|
|
@ -226,6 +230,9 @@
|
|||
{ "data": "date" },
|
||||
{ "data": "name" },
|
||||
{ "data": "employee_code" },
|
||||
@foreach(($userAttrs ?? []) as $attr)
|
||||
{ "data": "{{ $attr }}" },
|
||||
@endforeach
|
||||
@if(isset($formdata) && isset($formdata->workflow) && $formdata->workflow == 'yes' )
|
||||
{ "data": "workflow_status" },
|
||||
@endif
|
||||
|
|
@ -460,6 +467,7 @@
|
|||
@else
|
||||
params['team_report'] = 1;
|
||||
@endif
|
||||
params['delete_submission'] = canDeleteSubmission ? 1 : 0;
|
||||
|
||||
params = Object.assign(params, extraParams);
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,11 @@
|
|||
<div class="row">
|
||||
<div class="col-12 pt-1">
|
||||
<h4 class="header-title">{{$graph->name}}</h4>
|
||||
@php
|
||||
$showUserAttrs = ($graph->show_user_attributes ?? 'no') === 'yes';
|
||||
$userAttrs = ($showUserAttrs && isset($graph->user_attributes) && is_array($graph->user_attributes)) ? $graph->user_attributes : [];
|
||||
$userAttrLabels = $user_attribute_labels ?? [];
|
||||
@endphp
|
||||
</div>
|
||||
|
||||
<div class="col-6 pt-1">
|
||||
|
|
@ -137,6 +142,9 @@
|
|||
<tr>
|
||||
@if($graph->agg_type != 'team' || $post['type'] != 'leaderboard')<th>Rank</th>@endif
|
||||
<th>User</th>
|
||||
@foreach($userAttrs as $attr)
|
||||
<th>{{ $userAttrLabels[$attr] ?? ucwords(str_replace('_', ' ', $attr)) }}</th>
|
||||
@endforeach
|
||||
@foreach($graph->metrics as $val)
|
||||
@if(isset($val->is_visible) && $val->is_visible)
|
||||
<th>{{$val->display}}</th>
|
||||
|
|
@ -155,6 +163,9 @@
|
|||
<td><img src="https://ui-avatars.com/api/?background={{$i>3?$colors[4]:$colors[$i]}}&name={{$val->rank}}" class="avatar-md"></td>
|
||||
@endif
|
||||
<td style="text-align:left;">{{ isset($val->user->name) ? $val->user->name : '' }} <br />{{ isset($val->user->designation) ? $val->user->designation : '' }}</td>
|
||||
@foreach($userAttrs as $attr)
|
||||
<td>{{ $val->user->{$attr} ?? '-' }}</td>
|
||||
@endforeach
|
||||
@if($graph->type == 'verses')
|
||||
@foreach($graph->metrics as $m)
|
||||
@if(isset($m->is_visible) && $m->is_visible)
|
||||
|
|
@ -242,6 +253,9 @@
|
|||
<tr>
|
||||
<th colspan="2">User</th>
|
||||
<th>Employee Code</th>
|
||||
@foreach($userAttrs as $attr)
|
||||
<th>{{ $userAttrLabels[$attr] ?? ucwords(str_replace('_', ' ', $attr)) }}</th>
|
||||
@endforeach
|
||||
<th>Zone</th>
|
||||
<th>Region</th>
|
||||
<th>Area</th>
|
||||
|
|
@ -259,6 +273,9 @@
|
|||
<td><img src="{{isset($user->avatar) ? $user->avatar : ''}}" class="avatar-sm rounded-circle"></td>
|
||||
<td>{{ $user->name }} <br/>{{$user->designation}}</td>
|
||||
<td>{{ isset($user->employee_code) ? $user->employee_code:''}}</td>
|
||||
@foreach($userAttrs as $attr)
|
||||
<td>{{ $user->{$attr} ?? '-' }}</td>
|
||||
@endforeach
|
||||
<td>{{ isset($user->positions->Zone) ? $user->positions->Zone : '-' }}</td>
|
||||
<td>{{ isset($user->positions->Region) ? $user->positions->Region : '-' }}</td>
|
||||
<td>{{ isset($user->positions->Area) ? $user->positions->Area : '-' }}</td>
|
||||
|
|
|
|||
|
|
@ -29,6 +29,11 @@
|
|||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="header-title mb-2">{{$graph->name}}</h4>
|
||||
@php
|
||||
$showUserAttrs = ($graph->show_user_attributes ?? 'no') === 'yes';
|
||||
$userAttrs = ($showUserAttrs && isset($graph->user_attributes) && is_array($graph->user_attributes)) ? $graph->user_attributes : [];
|
||||
$userAttrLabels = $user_attribute_labels ?? [];
|
||||
@endphp
|
||||
<div class="row">
|
||||
<div class="col-6 pt-1">
|
||||
<p class="text-muted"> {!!$graph->agg_type == 'team' ? '<i class="mdi mdi-account-group" aria-hidden="true"></i>' : '<i class="mdi mdi-account" aria-hidden="true"></i>' !!} {{ucwords($graph->agg_type)}} Report</p>
|
||||
|
|
@ -161,6 +166,9 @@
|
|||
<th colspan="2">User</th>
|
||||
<th>Employee Code</th>
|
||||
<th>Designation</th>
|
||||
@foreach($userAttrs as $attr)
|
||||
<th>{{ $userAttrLabels[$attr] ?? ucwords(str_replace('_', ' ', $attr)) }}</th>
|
||||
@endforeach
|
||||
<th>Zone</th>
|
||||
<th>Region</th>
|
||||
<th>Area</th>
|
||||
|
|
@ -204,6 +212,9 @@
|
|||
<td>
|
||||
{{ isset($val->user->designation) ? $val->user->designation : '-' }}
|
||||
</td>
|
||||
@foreach($userAttrs as $attr)
|
||||
<td>{{ $val->user->{$attr} ?? '-' }}</td>
|
||||
@endforeach
|
||||
|
||||
<td>{{ isset($val->user->positions->Zone) ? $val->user->positions->Zone : (isset($val->user->positions->Country) ? $val->user->positions->Country : '-' ) }}</td>
|
||||
<td>{{ isset($val->user->positions->Region) ? $val->user->positions->Region : '-' }}</td>
|
||||
|
|
@ -303,6 +314,9 @@
|
|||
<tr>
|
||||
<th colspan="2">User</th>
|
||||
<th>Employee Code</th>
|
||||
@foreach($userAttrs as $attr)
|
||||
<th>{{ $userAttrLabels[$attr] ?? ucwords(str_replace('_', ' ', $attr)) }}</th>
|
||||
@endforeach
|
||||
@if(!isset($graph->show_positions) || (isset($graph->show_positions) && $graph->show_positions))
|
||||
<th>Zone</th>
|
||||
<th>Region</th>
|
||||
|
|
@ -321,6 +335,9 @@
|
|||
<td><img src="{{isset($user->avatar) ? $user->avatar : 'https://ui-avatars.com/api/?background=random&name='.$user->name}}" class="avatar-sm rounded-circle"></td>
|
||||
<td>{{ isset($user->name) ? $user->name : '-' }} <br/>{{isset($user->designation) ? $user->designation : '-'}}</td>
|
||||
<td>{{ isset($user->employee_code) ? $user->employee_code:''}}</td>
|
||||
@foreach($userAttrs as $attr)
|
||||
<td>{{ $user->{$attr} ?? '-' }}</td>
|
||||
@endforeach
|
||||
@if(!isset($graph->show_positions) || (isset($graph->show_positions) && $graph->show_positions))
|
||||
<td>{{ isset($user->positions->Zone) ? $user->positions->Zone : '-' }}</td>
|
||||
<td>{{ isset($user->positions->Region) ? $user->positions->Region : '-' }}</td>
|
||||
|
|
|
|||
Loading…
Reference in New Issue