Work on language line generation for reports.

- They are broken because CI4 calls lang lines with lang([Filename].[stringname])
This commit is contained in:
objecttothis
2023-02-17 18:06:13 +04:00
committed by Steve Ireland
parent f3bd5346ea
commit 067fd99c8b
3 changed files with 10 additions and 10 deletions

View File

@@ -33,7 +33,7 @@ function show_report(string $report_prefix, string $report_name, string $lang_ke
if(!empty($report_label) && $report_label != $lang_key . ' (TBD)') //TODO: String Interpolation. Also !==
{//TODO: Is there a better way to do this? breaking the php like this makes it more difficult to read.
?>
<a class="list-group-item" href="<?php echo site_url('reports/' . $report_prefix . preg_replace('/reports_(.*)/', '$1', $report_name)) ?>"><?php echo $report_label; ?></a>
<a class="list-group-item" href="<?= site_url("reports/$report_prefix" . preg_replace('/reports_(.*)/', '$1', $report_name)) ?>"><?= $report_label; ?></a>
<?php
}
}

View File

@@ -17,8 +17,8 @@
{
?>
<div class="module_item" title="<?= lang("Module.$module->module_id" . '_desc') ?>">
<a href="<?= esc(base_url($module->module_id), 'url') ?>"><img src="<?= base_url("images/menubar/$module->module_id.png") ?>" style="border-width: 0;" alt="Menubar Image" /></a>
<a href="<?= esc(base_url($module->module_id), 'url') ?>"><?= lang("Module.$module->module_id") ?></a>
<a href="<?= base_url($module->module_id) ?>"><img src="<?= base_url("images/menubar/$module->module_id.png") ?>" style="border-width: 0;" alt="Menubar Image" /></a>
<a href="<?= base_url($module->module_id) ?>"><?= lang("Module.$module->module_id") ?></a>
</div>
<?php
}

View File

@@ -69,17 +69,17 @@ if(isset($error))
show_report_if_allowed('detailed', 'sales', $person_id);
show_report_if_allowed('detailed', 'receivings', $person_id);
show_report_if_allowed('specific', 'customer', $person_id, 'reports_customers');
show_report_if_allowed('specific', 'discount', $person_id, 'reports_discounts');
show_report_if_allowed('specific', 'employee', $person_id, 'reports_employees');
show_report_if_allowed('specific', 'supplier', $person_id, 'reports_suppliers');
show_report_if_allowed('specific', 'customer', $person_id, 'Reports.customers');
show_report_if_allowed('specific', 'discount', $person_id, 'Reports.discounts');
show_report_if_allowed('specific', 'employee', $person_id, 'Reports.employees');
show_report_if_allowed('specific', 'supplier', $person_id, 'Reports.suppliers');
?>
</div>
</div>
<?php
$employee = model(Employee::class);
if ($employee->has_grant('reports_inventory', session('person_id')))
if ($employee->has_grant('Reports.inventory', session('person_id')))
{
?>
<div class="panel panel-primary">
@@ -88,8 +88,8 @@ if(isset($error))
</div>
<div class="list-group">
<?php
show_report('', 'reports_inventory_low');
show_report('', 'reports_inventory_summary');
show_report('', 'reports_inventory_low', 'Reports.inventory_low');
show_report('', 'reports_inventory_summary', 'Reports.inventory_summary');
?>
</div>
</div>