[Legacy] Fix broken subpanel configuration on OAuthTokens

This commit is contained in:
Clemente Raposo 2022-02-17 11:50:41 +00:00
parent bd5cdbecb3
commit f0e4634f3b
3 changed files with 15 additions and 4 deletions

View file

@ -304,9 +304,22 @@ class OAuthToken extends SugarBean
function displayDateFromTs($focus, $field, $value, $view='ListView')
{
$field = strtoupper($field);
if (!isset($focus[$field])) {

$fieldValue = '';

if (is_array($focus) && isset($focus[$field])) {
$fieldValue = $focus[$field];
}

if (is_object($focus) && !empty($focus->$field)) {
$fieldValue = $focus->$field;
}

if (empty($fieldValue)) {
return '';
}

global $timedate;
return $timedate->asUser($timedate->fromTimestamp($focus[$field]));

return $timedate->asUser($timedate->fromTimestamp($fieldValue));
}

View file

@ -64,7 +64,6 @@ $subpanel_layout = array(
'name'=>'token_ts',
'width' => '10%',
'vname' => 'LBL_TS',
'function' => 'testfunc',
),
'assigned_user_name' => array(
'name' => 'assigned_user_name',

View file

@ -65,7 +65,6 @@ $subpanel_layout = array(
'name'=>'token_ts',
'width' => '10%',
'vname' => 'LBL_TS',
'function' => 'testfunc',
),
'consumer_name' => array(
'name' => 'consumer_name',