mirror of https://github.com/itflow-org/itflow
Basic asset history tracking - See https://tasks.dev.itflow.org/task_details.php?task_id=19
This commit is contained in:
parent
512d65c17a
commit
11d6654763
|
|
@ -508,9 +508,10 @@ ob_start();
|
|||
<ul>
|
||||
<?php
|
||||
while ($row = mysqli_fetch_assoc($sql_asset_history)) {
|
||||
$asset_history_description = nullable_htmlentities(($row['asset_history_description']));
|
||||
$asset_history_created_at = nullable_htmlentities(($row['asset_history_created_at']));
|
||||
echo "<li><small class='text-secondary'>$asset_history_created_at</small><br>$asset_history_description</li>";
|
||||
$asset_history_status = nullable_htmlentities($row['asset_history_status']);
|
||||
$asset_history_description = nullable_htmlentities($row['asset_history_description']);
|
||||
$asset_history_created_at = nullable_htmlentities($row['asset_history_created_at']);
|
||||
echo "<li>$asset_history_created_at - $asset_history_status <br/>$asset_history_description</li><br/>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -128,6 +128,9 @@ if (isset($_POST['edit_asset'])) {
|
|||
}
|
||||
}
|
||||
|
||||
// Add to History
|
||||
mysqli_query($mysqli,"INSERT INTO asset_history SET asset_history_status = '$status', asset_history_description = '$session_name updated $name', asset_history_asset_id = $asset_id");
|
||||
|
||||
logAction("Asset", "Edit", "$session_name edited asset $name", $client_id, $asset_id);
|
||||
|
||||
flash_alert("Asset <strong>$name</strong> edited");
|
||||
|
|
@ -152,6 +155,9 @@ if (isset($_GET['archive_asset'])) {
|
|||
|
||||
mysqli_query($mysqli,"UPDATE assets SET asset_archived_at = NOW() WHERE asset_id = $asset_id");
|
||||
|
||||
// Add to History
|
||||
mysqli_query($mysqli,"INSERT INTO asset_history SET asset_history_status = 'Archived', asset_history_description = '$session_name archived $asset_name', asset_history_asset_id = $asset_id");
|
||||
|
||||
logAction("Asset", "Archive", "$session_name archived asset $asset_name", $client_id, $asset_id);
|
||||
|
||||
flash_alert("Asset <strong>$asset_name</strong> archived", 'error');
|
||||
|
|
@ -176,6 +182,9 @@ if (isset($_GET['unarchive_asset'])) {
|
|||
|
||||
mysqli_query($mysqli,"UPDATE assets SET asset_archived_at = NULL WHERE asset_id = $asset_id");
|
||||
|
||||
// Add to History
|
||||
mysqli_query($mysqli,"INSERT INTO asset_history SET asset_history_status = 'UnArchived', asset_history_description = '$session_name unarchived $asset_name', asset_history_asset_id = $asset_id");
|
||||
|
||||
logAction("Asset", "Unarchive", "$session_name unarchived asset $asset_name", $client_id, $asset_id);
|
||||
|
||||
flash_alert("Asset <strong>$asset_name</strong> Unarchived");
|
||||
|
|
@ -486,6 +495,9 @@ if (isset($_POST['bulk_edit_asset_status'])) {
|
|||
|
||||
logAction("Asset", "Edit", "$session_name set status to $status on $asset_name", $client_id, $asset_id);
|
||||
|
||||
// Add to History
|
||||
mysqli_query($mysqli,"INSERT INTO asset_history SET asset_history_status = '$status', asset_history_description = '$session_name updated $asset_name', asset_history_asset_id = $asset_id");
|
||||
|
||||
}
|
||||
|
||||
logAction("Asset", "Bulk Edit", "$session_name set status to $status on $asset_count assets", $client_id);
|
||||
|
|
@ -521,6 +533,9 @@ if (isset($_POST['bulk_archive_assets'])) {
|
|||
|
||||
logAction("Asset", "Archive", "$session_name archived asset $asset_name", $client_id, $asset_id);
|
||||
|
||||
// Add to History
|
||||
mysqli_query($mysqli,"INSERT INTO asset_history SET asset_history_status = 'Archived', asset_history_description = '$session_name archived $asset_name', asset_history_asset_id = $asset_id");
|
||||
|
||||
}
|
||||
|
||||
logAction("Asset", "Bulk Archive", "$session_name archived $count assets", $client_id);
|
||||
|
|
@ -558,6 +573,9 @@ if (isset($_POST['bulk_unarchive_assets'])) {
|
|||
// Individual Asset logging
|
||||
logAction("Asset", "Unarchive", "$session_name unarchived asset $asset_name", $client_id, $asset_id);
|
||||
|
||||
// Add to History
|
||||
mysqli_query($mysqli,"INSERT INTO asset_history SET asset_history_status = 'UnArchived', asset_history_description = '$session_name unarchived $asset_name', asset_history_asset_id = $asset_id");
|
||||
|
||||
}
|
||||
|
||||
logAction("Asset", "Bulk Unarchive", "$session_name unarchived $count assets");
|
||||
|
|
|
|||
Loading…
Reference in New Issue