Add move/transfer assets

Add ability to move / transfer assets between clients. Moving an asset involves the asset being archived and then re-created under the new client with most of the same information.

Information about the old & new asset is stored in the audit logs and within the asset notes. Information from the audit logs is accessible via a new History tab on the asset, subject to audit log retention.
This commit is contained in:
wrongecho
2024-08-10 20:46:59 +01:00
parent b732e08aff
commit 3d3492ef27
4 changed files with 126 additions and 0 deletions

View File

@@ -29,6 +29,9 @@
<li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#pills-notes<?php echo $asset_id; ?>">Notes</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#pills-history<?php echo $asset_id; ?>">History</a>
</li>
</ul>
<hr>
@@ -386,6 +389,32 @@
</div>
<div class="tab-pane fade" id="pills-history<?php echo $asset_id; ?>">
<?php $sql_history = mysqli_query($mysqli, "SELECT * FROM logs WHERE log_type = 'asset' and log_entity_id = $asset_id and log_client_id = $client_id"); ?>
<div class="form-group">
<label>Asset History</label>
<ul>
<?php
while ($row = mysqli_fetch_array($sql_history)) {
$log_action = nullable_htmlentities(($row['log_action']));
$log_description = nullable_htmlentities(($row['log_description']));
$log_created_at = nullable_htmlentities(($row['log_created_at']));
echo "<li>$log_created_at - $log_action: $log_description</li>";
}
?>
</ul>
</div>
</div>
</div>
</div>
<div class="modal-footer bg-white">