Report subpermission labels are shown properly in employee form now

Fix logic to show correct report subpermissions
This commit is contained in:
jekkos
2015-04-09 18:09:23 +02:00
parent b8fba91244
commit 3d62a73c8c
2 changed files with 13 additions and 3 deletions

View File

@@ -72,7 +72,7 @@ class MY_Lang extends CI_Lang
else
{
// just return label name (with TBD)
$line = $line . ' (TBD)';
$line = $this->line_tbd($line);
log_message('error', 'Could not find the language line "'.$line.'"');
}
}
@@ -85,6 +85,12 @@ class MY_Lang extends CI_Lang
return $line;
}
function line_tbd($line='')
{
return $line . ' (TBD)';
}
}
?>

View File

@@ -65,9 +65,13 @@ foreach($all_modules->result() as $module)
$exploded_permission = explode('_', $permission->permission_id);
if ($permission->module_id == $module->module_id)
{
$lang_key = 'reports_'.$exploded_permission[1];
$lang_key = $module->module_id.'_'.$exploded_permission[1];
$lang_line = $this->lang->line($lang_key);
$lang_line = ($lang_key = $lang_line) ? $exploded_permission[1] : $lang_line;
$lang_line = ($this->lang->line_tbd($lang_key) == $lang_line) ? $exploded_permission[1] : $lang_line;
if (empty($lang_line))
{
continue;
}
?>
<ul>
<li>