translations/messages on report template controller

This commit is contained in:
akemidx 2024-01-10 15:23:42 -05:00
parent 27103124bf
commit a5099b5163
2 changed files with 9 additions and 5 deletions

View file

@ -30,7 +30,7 @@ class ReportTemplatesController extends Controller
if (!$reportTemplate) {
return redirect()->route('reports/custom')
->with('error', 'Template does not exist or you do not have permission to view it.'); //needs translation
->with('error', trans('admin/reports/message.no_report_permission'));
}
$customfields = CustomField::get();
@ -59,7 +59,7 @@ class ReportTemplatesController extends Controller
if (!$reportTemplate) {
return redirect()->route('reports/custom')
->with('error', 'Template does not exist or you do not have permission to view it.');
->with('error', trans('admin/reports/message.no_report_permission'));
}
$reportTemplate->options = $request->except(['_token', 'name']);
@ -76,12 +76,12 @@ class ReportTemplatesController extends Controller
if (!$reportTemplate) {
return redirect()->route('reports/custom')
->with('error', 'Template does not exist or you do not have permission to delete it.');
->with('error', trans('admin/reports/message.delete.no_delete_permission'));
}
$reportTemplate->delete();
return redirect()->route('reports/custom')
->with('success', 'Template deleted.');
->with('success', trans('admin/reports/message.delete.delete_confirm'));
}
}

View file

@ -2,6 +2,7 @@
return array(
'error' => 'You must select at least ONE option.',
'no_report_permission' => 'Template does not exist or you do not have permission to view it.',
'create' => [
'success' => 'Report saved successfully',
@ -9,7 +10,10 @@ return array(
'duplicate' => 'Report title already exists. Please choose a different one.',
],
'delete' => [
'delete' => 'Are you sure you want to delete this report?',
'no_report_permission' => 'Template does not exist or you do not have permission to view it.',
'delete_confirm' => 'Template deleted',
'no_delete_permission' => 'Template does not exist or you do not have permission to delete it.',
],
);