#209 Add ability get status text based on xref or fallback
This commit is contained in:
parent
03718e2632
commit
2b6807137f
@ -117,7 +117,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
|
|||||||
?>
|
?>
|
||||||
<tr id="s<?php echo $row['ID']; ?>_row">
|
<tr id="s<?php echo $row['ID']; ?>_row">
|
||||||
<td style="color: <?php echo $row['TextColor']; ?>; font-weight: bold">
|
<td style="color: <?php echo $row['TextColor']; ?>; font-weight: bold">
|
||||||
<?php echo $hesklang[$row['Key']]; ?>
|
<?php echo mfh_getDisplayTextForStatusId($row['ID']); ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?php
|
<?php
|
||||||
|
@ -1948,3 +1948,21 @@ function hesk_getFeatureArray() {
|
|||||||
'can_change_notification_settings', /* User can change notification settings */
|
'can_change_notification_settings', /* User can change notification settings */
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function mfh_getDisplayTextForStatusId($statusId) {
|
||||||
|
global $hesklang, $hesk_settings;
|
||||||
|
|
||||||
|
$xrefRs = hesk_dbQuery("SELECT `text` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."text_to_status_xref`
|
||||||
|
WHERE `status_id` = ".intval($statusId)."
|
||||||
|
AND `language` = '".hesk_dbEscape($hesk_settings['language'])."'");
|
||||||
|
if (hesk_dbNumRows($xrefRs) == 1) {
|
||||||
|
// We found a record. Use the text field
|
||||||
|
$xrefRecord = hesk_dbFetchAssoc($xrefRs);
|
||||||
|
return $xrefRecord['text'];
|
||||||
|
} else {
|
||||||
|
// Fallback to the language key
|
||||||
|
$statusRs = hesk_dbQuery("SELECT `Key` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` WHERE `ID` = ".intval($statusId));
|
||||||
|
$statusRec = hesk_dbFetchAssoc($statusRs);
|
||||||
|
return $hesklang[$statusRec['Key']];
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user