CMXX - Improved history visibility
This commit is contained in:
@@ -2886,10 +2886,10 @@ function getRelativeTime($timestamp) {
|
||||
return $time_just_now;
|
||||
} elseif ($diff < $hour) {
|
||||
$minutes = floor($diff / $minute);
|
||||
return $minutes.$time_minute . ($minutes != 1 ? $time_minutes : '') . " $suffix";
|
||||
return $minutes.(($minutes != 1) ? $time_minutes : $time_minute) . " $suffix";
|
||||
} elseif ($diff < $day) {
|
||||
$hours = floor($diff / $hour);
|
||||
return $hours.$time_hour . ($hours != 1 ? $time_hours : '') . " $suffix";
|
||||
return $hours.(($hours != 1) ? $time_hours : $time_hour) . " $suffix";
|
||||
} elseif ($diff < $week) {
|
||||
$days = floor($diff / $day);
|
||||
|
||||
|
||||
@@ -110,13 +110,18 @@ $view .= '
|
||||
|
||||
$description = json_decode($response->description) ?? $response->description;
|
||||
$description = json_encode($description, JSON_PRETTY_PRINT);
|
||||
//Replace JSON ITEMS
|
||||
$search = ['{', '}', '"',':','[',']',','];
|
||||
$replace = ['', '','','=','','',''];
|
||||
$description = str_replace($search, $replace, $description);
|
||||
|
||||
|
||||
$view .= '<tr>
|
||||
<td class="responsive-hidden">'.$response->historyID.'</td>
|
||||
<td>'.$response->type.'</td>
|
||||
<td class="responsive-hidden">'.$response->created.'</td>
|
||||
<td class="responsive-hidden">'.$response->createdby.'</td>
|
||||
<td><pre>' . $description . '</pre></td>
|
||||
<td><div style="overflow-y:scroll;height:200px !important;max-width:300px;"><pre>' . $description . '</pre><div></td>
|
||||
<td><a href="index.php?page=equipment&equipmentID='.$response->equipmentID.'" class="btn_link">'.$general_view .'</a></td>
|
||||
</tr>
|
||||
';
|
||||
|
||||
@@ -143,12 +143,17 @@ foreach ($responses as $response){
|
||||
$description = json_decode($response->description) ?? $response->description;
|
||||
$description = json_encode($description, JSON_PRETTY_PRINT);
|
||||
|
||||
//Replace JSON ITEMS
|
||||
$search = ['{', '}', '"',':','[',']',','];
|
||||
$replace = ['', '','','=','','',''];
|
||||
$description = str_replace($search, $replace, $description);
|
||||
|
||||
$view .= '<tr>
|
||||
<td class="responsive-hidden">'.$response->historyID.'</td>
|
||||
<td>'.$response->type.' </td>
|
||||
<td class="responsive-hidden">'.$response->created.'</td>
|
||||
<td class="responsive-hidden">'.$response->createdby.'</td>
|
||||
<td><pre>' . $description . '</pre></td>
|
||||
<td><div style="overflow-y:scroll;height:200px !important;max-width:300px;"><pre>' . $description . '</pre><div></td>
|
||||
';
|
||||
if ($update_allowed === 1){
|
||||
$view .= ' <td><a href="index.php?page=history_manage&equipmentID='.$_GET['equipmentID'].'&rowID='.$response->historyID.'" class="btn_link">'.$general_view .'</a></td>
|
||||
|
||||
Reference in New Issue
Block a user