Skip to content

Commit

Permalink
Compromise - show both the last Cabinet and last Device audit stamps …
Browse files Browse the repository at this point in the history
…on the device screen. #1280
  • Loading branch information
samilliken committed Jul 3, 2021
1 parent b5198ae commit 33243e3
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions devices.php
Original file line number Diff line number Diff line change
Expand Up @@ -773,14 +773,19 @@ function updatedevice($devid){
// Finished updating devices or creating them. Refresh the object with data from the DB
$dev->GetDevice();

// Audits are either at the individual device or the full cabinet level, so grab the latest date
// Audits are either at the individual device or the full cabinet level, so grab the latest date for both
$cabAudit = new CabinetAudit();
$cabAudit->CabinetID = $dev->Cabinet;
$cabAudit->GetLastAudit();
if ( strtotime($dev->AuditStamp) > strtotime($cabAudit->AuditStamp) ) {
$lastAudit = $dev->AuditStamp;
if ( $cabAudit->GetLastAudit() ) {
$lastCAudit = date("r", strtotime($cabAudit->AuditStamp));
} else {
$lastAudit = $cabAudit->AuditStamp;
$lastCAudit = "Never";
}

if ( $dev->AuditStamp > 0 ) {
$lastAudit = date("r",strtotime($dev->AuditStamp));
} else {
$lastAudit = "Never";
}

// Get any tags associated with this device
Expand Down Expand Up @@ -1832,7 +1837,7 @@ function setPreferredLayout() {<?php if(isset($_COOKIE["layout"]) && strtolower(
</div>
<div>
<div>'.__("Last Audit Completed").'</div>
<div><span id="auditdate">'.((strtotime($lastAudit)>0)?date('r',strtotime($lastAudit)):__("Audit not yet completed")).'</span></div>
<div><span id="auditdate">Cabinet: '.$lastCAudit.'<br>Device: '.$lastAudit.'</span></div>
</div>
<div>
<div><label for="Owner">'.__("Departmental Owner").'</label></div>
Expand Down

0 comments on commit 33243e3

Please sign in to comment.