diff --git a/CHANGELOG.md b/CHANGELOG.md
index b24509f75..5637046cf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,7 +6,7 @@ This file documents all notable changes made to ITFlow.
### Upgrading to 26.12
-Update from Maintenance > Update — Queue Update hands the job to cron, which updates the files and applies this release's forty-one database changes (3.6.6 to 4.0.8) in the same pass. They add four tables for RMM providers and their alerts, a setting for API keys in the address, a column marking the emails the mail queue clears once sent, a column and a table for agent banners, two columns for ticket statuses with a setting for the "ticket assigned" message, a column on tickets with a setting for the "no response" message, a table for who a ticket's email replies go to, the settings for Quick tickets, columns on recurring tickets and recurring invoices for booking and making them ahead, two columns on ticket replies for when their time was worked, the settings for cron alerts, a table and a setting for labor costs, a column on users for API / service accounts, columns on tickets and recurring tickets for how long booked work takes, a column each on recurring tickets and calendar events for repeating on a weekday, three columns on agents' settings for their calendar color, what their calendar shows and their own time zone, a table for the agents helping on a ticket, three columns on quote lines with three settings for what a quote line costs and how it is priced, a column each on quote lines and products with a setting for their pictures, two settings and a column on tickets for keeping project tickets apart, a table for your other offices with a column each on agents and invites for which one they work from, three settings for the emails and notices your agents get about their tickets, three settings for sending and reading Microsoft 365 mail through Microsoft Graph, five tables, four settings and a role permission for purchase orders, five settings for switching Dispatch, Bookkeeping, Purchasing, Trips and the calendar on and off, and eight tables, three columns and two settings for the Knowledge Base, who can read its articles, what its readers think of them and their files, a column on documents for how often each is reviewed, a column on agents' settings for compact rows, a table for reply drafts, a table for which tickets each agent has opened, two columns on contacts for an email that bounces, a table for credentials' earlier passwords, a column on recurring invoices for a pause with an end, a column on calendar events, two columns on agents' settings and a table for reminders, four settings for the weekly summary and a table for related tickets, and change nothing that is there. Nothing else is required, but it is a big release, so take a backup before you update. Purchasing starts off - switch it on in Admin > Settings > Modules - and so does the Knowledge Base's public help center, in Admin > Settings > Knowledge Base. This release has thirteen security fixes - see Security. On Apache, ITFlow's own .htaccess now sends security headers: if you show ITFlow inside a frame on another website, it will now refuse to load there. On nginx, add the same headers to your server block if you want them - see Developer Updates.
+Update from Maintenance > Update — Queue Update hands the job to cron, which updates the files and applies this release's forty-three database changes (3.6.6 to 4.1.0) in the same pass. They add four tables for RMM providers and their alerts, a setting for API keys in the address, a column marking the emails the mail queue clears once sent, a column and a table for agent banners, two columns for ticket statuses with a setting for the "ticket assigned" message, a column on tickets with a setting for the "no response" message, a table for who a ticket's email replies go to, the settings for Quick tickets, columns on recurring tickets and recurring invoices for booking and making them ahead, two columns on ticket replies for when their time was worked, the settings for cron alerts, a table and a setting for labor costs, a column on users for API / service accounts, columns on tickets and recurring tickets for how long booked work takes, a column each on recurring tickets and calendar events for repeating on a weekday, three columns on agents' settings for their calendar color, what their calendar shows and their own time zone, a table for the agents helping on a ticket, three columns on quote lines with three settings for what a quote line costs and how it is priced, a column each on quote lines and products with a setting for their pictures, two settings and a column on tickets for keeping project tickets apart, a table for your other offices with a column each on agents and invites for which one they work from, three settings for the emails and notices your agents get about their tickets, three settings for sending and reading Microsoft 365 mail through Microsoft Graph, five tables, four settings and a role permission for purchase orders, five settings for switching Dispatch, Bookkeeping, Purchasing, Trips and the calendar on and off, and eight tables, three columns and two settings for the Knowledge Base, who can read its articles, what its readers think of them and their files, a column on documents for how often each is reviewed, a column on agents' settings for compact rows, a table for reply drafts, a table for which tickets each agent has opened, two columns on contacts for an email that bounces, a table for credentials' earlier passwords, a column on recurring invoices for a pause with an end, a column on calendar events, two columns on agents' settings and a table for reminders, four settings for the weekly summary, a table for related tickets and a setting for the first technician to reply to a ticket nobody is assigned to being assigned it. They change nothing that is there, except that audit log entries filed as Software, Software Template, Revenue and Account Transfer are renamed License, License Template, Income and Transfer. Nothing else is required, but it is a big release, so take a backup before you update. Purchasing starts off - switch it on in Admin > Settings > Modules - and so does the Knowledge Base's public help center, in Admin > Settings > Knowledge Base. This release has thirteen security fixes - see Security. On Apache, ITFlow's own .htaccess now sends security headers: if you show ITFlow inside a frame on another website, it will now refuse to load there. On nginx, add the same headers to your server block if you want them - see Developer Updates.
### Security
@@ -286,6 +286,7 @@ Update from Maintenance > Update — Queue Update hands the job to cron, which u
- Tickets: cancelling Reset the timer still marked the timer as stopped in that browser, so it showed as stopped after a reload while it was still counting.
- Browser tabs: many pages were named after their file - Kb, Ai Providers, Rmm Providers, Sla, Settings Ticket, Profit Loss - and one with & in its name showed &. Each tab now has the name the menu gives the page, and a rack, an instance and a ticket, document or project template show their own name.
- Client menu: a client's Domains count never turned amber or red for domains about to expire or expired, and the Certificates and Licenses counts carried two text colours at once.
+- Audit Logs: income was filed as Income or Revenue, and transfers as Transfer or Account Transfer, depending on where they were made, so the Type filter listed each twice. Each now has one name, and licenses and license templates are License and License Template rather than Software. Entries already in the log are renamed when you update. Entries for RMM providers, collation repairs, the demo reset and Undo have their own icons.
### Developer Updates
@@ -458,6 +459,7 @@ Update from Maintenance > Update — Queue Update hands the job to cron, which u
- Menus: 30 menu items carried `text-dark`, which no other menu item has; it's gone.
- Sizes: `formatBytes()` (one decimal, whole bytes, a unit at 1024) is the one formatter - `backupFormatBytes()` calls it, and the portal and setup scripts write sizes the same way.
- New-tab links: every `target="_blank"` link has `rel="noopener"`, and `noopener noreferrer` when it leaves ITFlow.
+- Audit log types: database 4.1.0 renames `logs.log_type` Software, Software Template, Revenue and Account Transfer to License, License Template, Income and Transfer (`agent/post/transfer.php` and `functions/income_import.php` now match the API's Transfer). `auditLogKinds()` has those keys, drops Revenue and adds Database, Demo, Undo and RMM Provider; `auditLogActionStyle()` adds Bulk Link, Offboard, Repair, Reset and Sync. The `log` of the license kind in `archivedKinds()`, `importKinds()` and the tag kinds is License, and `linkLogSide()` (`functions/links.php`) names its type from the `LINK_ENTITIES` label and returns which side it is.
## [26.11.8]
diff --git a/admin/database_updates/4.1.0.php b/admin/database_updates/4.1.0.php
new file mode 100644
index 000000000..613f60f2a
--- /dev/null
+++ b/admin/database_updates/4.1.0.php
@@ -0,0 +1,20 @@
+ 'License', 'Software Template' => 'License Template', 'Revenue' => 'Income', 'Account Transfer' => 'Transfer'] as $old_type => $new_type) {
+ mysqli_query($mysqli, "UPDATE `logs` SET `log_type` = '$new_type' WHERE `log_type` = '$old_type'");
+ }
diff --git a/admin/post/software_template.php b/admin/post/software_template.php
index 904abbd41..a2a2da0da 100644
--- a/admin/post/software_template.php
+++ b/admin/post/software_template.php
@@ -38,7 +38,7 @@ if (isset($_POST['add_software_template']) || isset($_POST['edit_software_templa
}
$software_template_id = softwareTemplateSave($software_template_id, $fields);
- logAudit("Software Template", $editing ? "Edit" : "Create", "$session_name " . ($editing ? 'edited' : 'created') . " license template " . escapeSql($fields['name']), 0, $software_template_id);
+ logAudit("License Template", $editing ? "Edit" : "Create", "$session_name " . ($editing ? 'edited' : 'created') . " license template " . escapeSql($fields['name']), 0, $software_template_id);
flashAlert("License template " . escapeHtml($fields['name']) . " " . ($editing ? 'saved' : 'created'));
@@ -77,7 +77,7 @@ if (isset($_POST['make_licenses_from_template'])) {
$vendor_id = intval(getFieldById('software', $software_id, 'software_vendor_id'));
logAudit("Vendor", "Create", "$session_name created vendor " . escapeSql((string) getFieldById('vendors', $vendor_id, 'vendor_name')) . " from a template for license " . escapeSql($row['software_template_name']), $client_id, $vendor_id);
}
- logAudit("Software", "Create", "$session_name created license " . escapeSql($row['software_template_name']) . " from template " . escapeSql($row['software_template_name']), $client_id, $software_id);
+ logAudit("License", "Create", "$session_name created license " . escapeSql($row['software_template_name']) . " from template " . escapeSql($row['software_template_name']), $client_id, $software_id);
}
$made = count($result['made']);
@@ -110,7 +110,7 @@ if (isset($_POST['save_software_template_required'])) {
$scope = softwareTemplateScopeText($saved['software_template_required'], softwareTemplateRequiredTags([$software_template_id])[$software_template_id]);
$said = $scope !== '' ? "required of " . lcfirst($scope) : 'not required of anyone';
- logAudit("Software Template", "Edit", "$session_name set license template " . escapeSql($row['software_template_name']) . " " . escapeSql($said), 0, $software_template_id);
+ logAudit("License Template", "Edit", "$session_name set license template " . escapeSql($row['software_template_name']) . " " . escapeSql($said), 0, $software_template_id);
flashAlert("" . escapeHtml($row['software_template_name']) . " is " . escapeHtml($said));
@@ -136,7 +136,7 @@ if (isset($_POST['true_up_software_template'])) {
$changes = softwareTemplateTrueUp($software_template_id, $seats);
foreach ($changes as $software_id => $change) {
- logAudit("Software", "Edit", "$session_name trued up license " . escapeSql($change['name']) . " from " . softwareTemplateSeatsText($change['from']) . " to " . softwareTemplateSeatsText($change['to']), $change['client_id'], $software_id);
+ logAudit("License", "Edit", "$session_name trued up license " . escapeSql($change['name']) . " from " . softwareTemplateSeatsText($change['from']) . " to " . softwareTemplateSeatsText($change['to']), $change['client_id'], $software_id);
}
$count = count($changes);
@@ -207,7 +207,7 @@ if (isset($_GET['copy_software_template'])) {
$new_id = softwareTemplateCopy($row['software_template_id']);
$new_name = (string) softwareTemplateRow($new_id)['software_template_name'];
- logAudit("Software Template", "Create", "$session_name copied license template " . escapeSql($row['software_template_name']) . " as " . escapeSql($new_name), 0, $new_id);
+ logAudit("License Template", "Create", "$session_name copied license template " . escapeSql($row['software_template_name']) . " as " . escapeSql($new_name), 0, $new_id);
flashAlert("License template " . escapeHtml($row['software_template_name']) . " copied as " . escapeHtml($new_name) . "");
@@ -228,7 +228,7 @@ if (isset($_GET['archive_software_template']) || isset($_GET['restore_software_t
mysqli_query($mysqli, "UPDATE software_templates SET software_template_archived_at = " . ($archive ? 'NOW()' : 'NULL') . ", software_template_updated_at = software_template_updated_at
WHERE software_template_id = $software_template_id");
- logAudit("Software Template", $archive ? "Archive" : "Restore", "$session_name " . ($archive ? 'archived' : 'restored') . " license template " . escapeSql($row['software_template_name']), 0, $software_template_id);
+ logAudit("License Template", $archive ? "Archive" : "Restore", "$session_name " . ($archive ? 'archived' : 'restored') . " license template " . escapeSql($row['software_template_name']), 0, $software_template_id);
flashAlert("License template " . escapeHtml($row['software_template_name']) . " " . ($archive ? 'archived' : 'restored'), $archive ? 'error' : 'success');
if ($undo) {
@@ -248,7 +248,7 @@ if (isset($_GET['delete_software_template'])) {
// The licenses made from it stay, no longer linked to it
softwareTemplateDelete($row['software_template_id']);
- logAudit("Software Template", "Delete", "$session_name deleted license template " . escapeSql($row['software_template_name']));
+ logAudit("License Template", "Delete", "$session_name deleted license template " . escapeSql($row['software_template_name']));
flashAlert("License template " . escapeHtml($row['software_template_name']) . " deleted", 'error');
@@ -274,7 +274,7 @@ if (isset($_POST['export_software_templates']) || isset($_GET['export_software_t
}
$count = count($export['templates']);
- logAudit("Software Template", "Export", "$session_name exported $count license template" . ($count === 1 ? ' ' . escapeSql($export['templates'][0]['name']) : 's'));
+ logAudit("License Template", "Export", "$session_name exported $count license template" . ($count === 1 ? ' ' . escapeSql($export['templates'][0]['name']) : 's'));
header('Content-Type: application/json; charset=utf-8');
header('Content-Disposition: attachment; filename="' . softwareTemplatesExportFileName($export) . '"');
@@ -310,7 +310,7 @@ if (isset($_POST['import_software_templates'])) {
$existing = in_array($_POST['existing'] ?? '', ['skip', 'copy', 'replace'], true) ? $_POST['existing'] : 'skip';
$counts = softwareTemplatesImport($templates, $existing);
- logAudit("Software Template", "Import", "$session_name imported license templates from " . escapeSql(mb_substr((string) $file['name'], 0, 100)) . " - {$counts['added']} added, {$counts['replaced']} replaced, {$counts['skipped']} skipped"
+ logAudit("License Template", "Import", "$session_name imported license templates from " . escapeSql(mb_substr((string) $file['name'], 0, 100)) . " - {$counts['added']} added, {$counts['replaced']} replaced, {$counts['skipped']} skipped"
. ($counts['vendors'] ? ", {$counts['vendors']} vendor templates added" : ''));
flashAlert(softwareTemplatesImportSummary($counts), $counts['products'] ? 'warning' : ($counts['added'] || $counts['replaced'] ? 'success' : 'info'));
diff --git a/admin/software_template.php b/admin/software_template.php
index 5de5486bc..e29e7cdc1 100644
--- a/admin/software_template.php
+++ b/admin/software_template.php
@@ -363,7 +363,7 @@ $facts = array_filter([
- = auditLogHistoryCard(auditLogHistory('Software Template', $software_template_id, 10)) ?>
+ = auditLogHistoryCard(auditLogHistory('License Template', $software_template_id, 10)) ?>
diff --git a/agent/ajax.php b/agent/ajax.php
index d10199127..6dcfd1252 100644
--- a/agent/ajax.php
+++ b/agent/ajax.php
@@ -847,7 +847,7 @@ if (isset($_POST['software_set_notes'])) {
$notes = escapeSql($_POST['notes'] ?? '');
mysqli_query($mysqli, "UPDATE software SET software_notes = '$notes' WHERE software_id = $software_id");
- logAudit("Software", "Edit", "$session_name edited the notes on license " . escapeSql($row['software_name']), $client_id, $software_id);
+ logAudit("License", "Edit", "$session_name edited the notes on license " . escapeSql($row['software_name']), $client_id, $software_id);
}
diff --git a/agent/license.php b/agent/license.php
index c1e8fcf63..351441dae 100644
--- a/agent/license.php
+++ b/agent/license.php
@@ -75,7 +75,7 @@ if (!$license || ($client_url && intval($license['software_client_id']) !== intv
$credentials = $can_credentials ? credentialRows("credential_id IN (SELECT credential_id FROM software_credentials WHERE software_id = $software_id)") : [];
$documents = linkedRecords('software', $software_id, 'document');
$files = linkedRecords('software', $software_id, 'file');
- $history = auditLogHistory('Software', $software_id);
+ $history = auditLogHistory('License', $software_id);
$license_tabs = [
'seats' => ['label' => 'Seats', 'icon' => 'fa-users', 'count' => $seats['used']],
diff --git a/agent/post/client_onboarding.php b/agent/post/client_onboarding.php
index f8b56b977..e42b66479 100644
--- a/agent/post/client_onboarding.php
+++ b/agent/post/client_onboarding.php
@@ -411,7 +411,7 @@ if (isset($_POST['client_onboarding_it'])) {
logAudit("Vendor", "Create", "$session_name created vendor " . escapeSql((string) getFieldById('vendors', $vendor_id, 'vendor_name')) . " from a template for license " . escapeSql($license_name), $client_id, $vendor_id);
$made['vendors']++;
}
- logAudit("Software", "Create", "$session_name created license " . escapeSql($license_name) . " from its template, onboarding the client", $client_id, $software_id);
+ logAudit("License", "Create", "$session_name created license " . escapeSql($license_name) . " from its template, onboarding the client", $client_id, $software_id);
$made['licenses']++;
}
}
diff --git a/agent/post/income.php b/agent/post/income.php
index 983195c59..87164da96 100644
--- a/agent/post/income.php
+++ b/agent/post/income.php
@@ -80,7 +80,7 @@ if (isset($_POST['bulk_edit_income'])) {
transferDepositRelease('revenue', $revenue_id, $value);
}
mysqli_query($mysqli, "UPDATE revenues SET $revenue_set WHERE revenue_id = $revenue_id");
- logAudit("Revenue", "Edit", "$session_name set $label_sql on other income " . escapeSql(incomeRevenueLabel($row)), intval($row['revenue_client_id']), $revenue_id);
+ logAudit("Income", "Edit", "$session_name set $label_sql on other income " . escapeSql(incomeRevenueLabel($row)), intval($row['revenue_client_id']), $revenue_id);
$count++;
}
@@ -157,7 +157,7 @@ if (isset($_POST['bulk_delete_income'])) {
$cleared += reconcileLock('revenue', $revenue_id) ? 1 : 0;
continue;
}
- logAudit("Revenue", "Delete", "$session_name deleted other income " . escapeSql(incomeRevenueLabel($row)), intval($row['revenue_client_id']));
+ logAudit("Income", "Delete", "$session_name deleted other income " . escapeSql(incomeRevenueLabel($row)), intval($row['revenue_client_id']));
$count++;
}
logAudit("Income", "Bulk Delete", "$session_name deleted $count other income record" . ($count === 1 ? '' : 's'));
diff --git a/agent/post/revenue.php b/agent/post/revenue.php
index 0819a42e7..d55fe83d0 100644
--- a/agent/post/revenue.php
+++ b/agent/post/revenue.php
@@ -37,7 +37,7 @@ if (isset($_POST['add_revenue'])) {
$row = incomeRevenueRow($revenue_id);
$label = incomeRevenueLabel($row);
- logAudit("Revenue", "Create", "$session_name added other income " . escapeSql($label), intval($row['revenue_client_id']), $revenue_id);
+ logAudit("Income", "Create", "$session_name added other income " . escapeSql($label), intval($row['revenue_client_id']), $revenue_id);
flashAlert("Income " . escapeHtml($label) . " added");
@@ -60,9 +60,9 @@ if (isset($_POST['edit_revenue'])) {
$row = incomeRevenueRow($revenue_id);
$label = incomeRevenueLabel($row);
- logAudit("Revenue", "Edit", "$session_name edited other income " . escapeSql($label), intval($row['revenue_client_id']), $revenue_id);
+ logAudit("Income", "Edit", "$session_name edited other income " . escapeSql($label), intval($row['revenue_client_id']), $revenue_id);
if ($before && intval($before['revenue_client_id']) && intval($before['revenue_client_id']) !== intval($row['revenue_client_id'])) {
- logAudit("Revenue", "Edit", "$session_name moved other income " . escapeSql($label) . " to " . escapeSql($row['client_name'] ?: 'no client'), intval($before['revenue_client_id']), $revenue_id);
+ logAudit("Income", "Edit", "$session_name moved other income " . escapeSql($label) . " to " . escapeSql($row['client_name'] ?: 'no client'), intval($before['revenue_client_id']), $revenue_id);
}
flashAlert("Income " . escapeHtml($label) . " saved");
@@ -84,7 +84,7 @@ if (isset($_GET['delete_revenue'])) {
}
$label = incomeRevenueLabel($row);
- logAudit("Revenue", "Delete", "$session_name deleted other income " . escapeSql($label), intval($row['revenue_client_id']));
+ logAudit("Income", "Delete", "$session_name deleted other income " . escapeSql($label), intval($row['revenue_client_id']));
flashAlert("Income " . escapeHtml($label) . " deleted", 'error');
diff --git a/agent/post/software.php b/agent/post/software.php
index ae690d9d7..2b0751cf2 100644
--- a/agent/post/software.php
+++ b/agent/post/software.php
@@ -81,7 +81,7 @@ if (isset($_POST['add_software'])) {
if ($vendor_made) {
logAudit("Vendor", "Create", "$session_name created vendor " . escapeSql($vendor_name) . " from a template for license " . escapeSql($name), $client_id, intval($_POST['vendor']));
}
- logAudit("Software", "Create", "$session_name created license " . escapeSql($name . softwareSeatChangeText($changes)), $client_id, $software_id);
+ logAudit("License", "Create", "$session_name created license " . escapeSql($name . softwareSeatChangeText($changes)), $client_id, $software_id);
$warning = softwareSeatWarning($software_id);
flashAlert("License $name created" . ($keys_added ? " with $keys_added key" . ($keys_added === 1 ? '' : 's') : '') . ($vendor_made ? ", and vendor " . escapeHtml($vendor_name) . " added for the client" : '') . $warning, $warning ? 'warning' : 'success');
@@ -117,7 +117,7 @@ if (isset($_POST['add_software_from_template'])) {
if ($vendor_made) {
logAudit("Vendor", "Create", "$session_name created vendor " . escapeSql($vendor_name) . " from a template for license " . escapeSql($template['software_template_name']), $client_id, $vendor_id);
}
- logAudit("Software", "Create", "$session_name created license " . escapeSql($template['software_template_name']) . " from template " . escapeSql($template['software_template_name']), $client_id, $software_id);
+ logAudit("License", "Create", "$session_name created license " . escapeSql($template['software_template_name']) . " from template " . escapeSql($template['software_template_name']), $client_id, $software_id);
flashAlert("License " . escapeHtml($template['software_template_name']) . " created from template " . escapeHtml($template['software_template_name']) . "" . ($vendor_made ? ", with vendor " . escapeHtml($vendor_name) . " added for the client" : '') . " - put its devices and users on it");
@@ -153,7 +153,7 @@ if (isset($_POST['edit_software'])) {
}
$name = trim($_POST['name']);
- logAudit("Software", "Edit", "$session_name edited license " . escapeSql($name . softwareSeatChangeText($changes)), $client_id, $software_id);
+ logAudit("License", "Edit", "$session_name edited license " . escapeSql($name . softwareSeatChangeText($changes)), $client_id, $software_id);
$warning = softwareSeatWarning($software_id);
flashAlert("License $name updated$warning", $warning ? 'warning' : 'success');
@@ -174,7 +174,7 @@ if (isset($_POST['set_software_seats'])) {
$changes = softwareSyncSeats($software_id, $client_id, $_POST['assets'] ?? [], $_POST['contacts'] ?? []);
if ($changes['added'] || $changes['removed']) {
- logAudit("Software", "Seats", "$session_name changed seats on license " . escapeSql($row['software_name'] . softwareSeatChangeText($changes)), $client_id, $software_id);
+ logAudit("License", "Seats", "$session_name changed seats on license " . escapeSql($row['software_name'] . softwareSeatChangeText($changes)), $client_id, $software_id);
}
$warning = softwareSeatWarning($software_id);
@@ -217,7 +217,7 @@ if (isset($_POST['renew_software'])) {
mysqli_query($mysqli, "UPDATE software SET software_expire = '$until' $reference_sql WHERE software_id = $software_id");
$was = formatDate($row['software_expire']) ?: 'no date';
- logAudit("Software", "Renew", "$session_name renewed license " . escapeSql($row['software_name']) . " until " . formatDate($until) . " (was $was)" . ($reference !== '' ? ', reference ' . escapeSql($reference) : ''), $client_id, $software_id);
+ logAudit("License", "Renew", "$session_name renewed license " . escapeSql($row['software_name']) . " until " . formatDate($until) . " (was $was)" . ($reference !== '' ? ', reference ' . escapeSql($reference) : ''), $client_id, $software_id);
$renewed[] = [$row['software_name'], formatDate($until)];
}
@@ -243,7 +243,7 @@ if (isset($_POST['add_software_keys'])) {
$added = softwareAddKeys($software_id, $_POST['keys'] ?? '');
if ($added) {
- logAudit("Software", "Keys", "$session_name added $added key" . ($added === 1 ? '' : 's') . " to license " . escapeSql($row['software_name']), $client_id, $software_id);
+ logAudit("License", "Keys", "$session_name added $added key" . ($added === 1 ? '' : 's') . " to license " . escapeSql($row['software_name']), $client_id, $software_id);
flashAlert("Added $added key" . ($added === 1 ? '' : 's') . " to {$row['software_name']}");
} else {
flashAlert("No new keys to add - blank, or {$row['software_name']} already has them.", 'warning');
@@ -292,7 +292,7 @@ if (isset($_POST['edit_software_key'])) {
$holders[] = getFieldById('contacts', $contact_id, 'contact_name');
}
- logAudit("Software", "Keys", "$session_name updated a key on license " . escapeSql($row['software_name']) . ($holders ? ', handed to ' . escapeSql(implode(', ', $holders)) : ', not handed to anyone'), $client_id, $software_id);
+ logAudit("License", "Keys", "$session_name updated a key on license " . escapeSql($row['software_name']) . ($holders ? ', handed to ' . escapeSql(implode(', ', $holders)) : ', not handed to anyone'), $client_id, $software_id);
$warning = softwareSeatWarning($software_id);
flashAlert("Key on {$row['software_name']} saved" . ($holders ? ' - handed to ' . implode(', ', $holders) . '' : '') . $warning, $warning ? 'warning' : 'success');
@@ -317,7 +317,7 @@ if (isset($_GET['delete_software_key'])) {
mysqli_query($mysqli, "DELETE FROM software_keys WHERE software_key_id = $software_key_id");
- logAudit("Software", "Keys", "$session_name deleted a key from license " . escapeSql($row['software_name']), $client_id, intval($row['software_id']));
+ logAudit("License", "Keys", "$session_name deleted a key from license " . escapeSql($row['software_name']), $client_id, intval($row['software_id']));
flashAlert("Key deleted from {$row['software_name']}", 'error');
@@ -339,7 +339,7 @@ if (isset($_GET['archive_software'])) {
$undo = undoArchiveBefore('software', $software_id); // for Undo on the message
mysqli_query($mysqli, "UPDATE software SET software_archived_at = NOW() WHERE software_id = $software_id");
- logAudit("Software", "Archive", "$session_name archived license " . escapeSql($row['software_name']), $client_id, $software_id);
+ logAudit("License", "Archive", "$session_name archived license " . escapeSql($row['software_name']), $client_id, $software_id);
flashAlert("License {$row['software_name']} archived", 'error');
undoOfferArchive($undo);
@@ -359,7 +359,7 @@ if (isset($_GET['restore_software'])) {
mysqli_query($mysqli, "UPDATE software SET software_archived_at = NULL WHERE software_id = $software_id");
- logAudit("Software", "Restore", "$session_name restored license " . escapeSql($row['software_name']), $client_id, $software_id);
+ logAudit("License", "Restore", "$session_name restored license " . escapeSql($row['software_name']), $client_id, $software_id);
flashAlert("License {$row['software_name']} restored");
@@ -379,7 +379,7 @@ if (isset($_GET['delete_software'])) {
// Seats, keys and links go with it (foreign keys cascade)
mysqli_query($mysqli, "DELETE FROM software WHERE software_id = $software_id");
- logAudit("Software", "Delete", "$session_name deleted license " . escapeSql($row['software_name']) . " with its seats and keys", $client_id);
+ logAudit("License", "Delete", "$session_name deleted license " . escapeSql($row['software_name']) . " with its seats and keys", $client_id);
flashAlert("License {$row['software_name']} deleted", 'error');
@@ -402,7 +402,7 @@ if (isset($_POST['bulk_archive_software'])) {
foreach ($rows as $software_id => $row) {
$client_id = intval($row['software_client_id']);
mysqli_query($mysqli, "UPDATE software SET software_archived_at = NOW() WHERE software_id = $software_id AND software_archived_at IS NULL");
- logAudit("Software", "Archive", "$session_name archived license " . escapeSql($row['software_name']), $client_id, $software_id);
+ logAudit("License", "Archive", "$session_name archived license " . escapeSql($row['software_name']), $client_id, $software_id);
}
flashAlert("Archived " . count($rows) . " license" . (count($rows) === 1 ? '' : 's'), 'error');
@@ -422,7 +422,7 @@ if (isset($_POST['bulk_restore_software'])) {
foreach ($rows as $software_id => $row) {
$client_id = intval($row['software_client_id']);
mysqli_query($mysqli, "UPDATE software SET software_archived_at = NULL WHERE software_id = $software_id");
- logAudit("Software", "Restore", "$session_name restored license " . escapeSql($row['software_name']), $client_id, $software_id);
+ logAudit("License", "Restore", "$session_name restored license " . escapeSql($row['software_name']), $client_id, $software_id);
}
flashAlert("Restored " . count($rows) . " license" . (count($rows) === 1 ? '' : 's'));
@@ -441,7 +441,7 @@ if (isset($_POST['bulk_delete_software'])) {
foreach ($rows as $software_id => $row) {
$client_id = intval($row['software_client_id']);
mysqli_query($mysqli, "DELETE FROM software WHERE software_id = $software_id");
- logAudit("Software", "Delete", "$session_name deleted license " . escapeSql($row['software_name']) . " with its seats and keys", $client_id);
+ logAudit("License", "Delete", "$session_name deleted license " . escapeSql($row['software_name']) . " with its seats and keys", $client_id);
}
flashAlert("Deleted " . count($rows) . " license" . (count($rows) === 1 ? '' : 's'), 'error');
@@ -593,7 +593,7 @@ if (isExportRequest('export_software')) {
finishExport($export);
}
- logAudit("Software", "Export", "$session_name exported $num_rows license(s) to a " . strtoupper($format) . " file", $client_id);
+ logAudit("License", "Export", "$session_name exported $num_rows license(s) to a " . strtoupper($format) . " file", $client_id);
exit;
diff --git a/agent/post/transfer.php b/agent/post/transfer.php
index 4af7c3dae..f00e089e0 100644
--- a/agent/post/transfer.php
+++ b/agent/post/transfer.php
@@ -43,7 +43,7 @@ if (isset($_POST['add_transfer'])) {
}
$row = transferRow($transfer_id);
- logAudit("Account Transfer", "Create", "$session_name transferred " . escapeSql(transferLabel($row)), 0, $transfer_id);
+ logAudit("Transfer", "Create", "$session_name transferred " . escapeSql(transferLabel($row)), 0, $transfer_id);
flashAlert("Moved " . escapeHtml(transferLabel($row)) . "");
@@ -64,7 +64,7 @@ if (isset($_POST['edit_transfer'])) {
}
$row = transferRow($transfer_id);
- logAudit("Account Transfer", "Edit", "$session_name edited the transfer " . escapeSql(transferLabel($row)), 0, $transfer_id);
+ logAudit("Transfer", "Edit", "$session_name edited the transfer " . escapeSql(transferLabel($row)), 0, $transfer_id);
flashAlert("Transfer " . escapeHtml(transferLabel($row)) . " saved");
@@ -84,7 +84,7 @@ if (isset($_GET['delete_transfer'])) {
redirect();
}
- logAudit("Account Transfer", "Delete", "$session_name deleted the transfer " . escapeSql(transferLabel($row)));
+ logAudit("Transfer", "Delete", "$session_name deleted the transfer " . escapeSql(transferLabel($row)));
flashAlert("Transfer " . escapeHtml(transferLabel($row)) . " deleted", 'error');
diff --git a/api/v1/revenues/create.php b/api/v1/revenues/create.php
index 44482620b..64f94b334 100644
--- a/api/v1/revenues/create.php
+++ b/api/v1/revenues/create.php
@@ -38,7 +38,7 @@ if (!$revenue_id) {
$insert_id = $revenue_id;
$row = incomeRevenueRow($revenue_id, false);
$label = escapeSql(incomeRevenueLabel($row));
-logAudit("Revenue", "Create", "Added other income $label via API ($api_key_name)", intval($row['revenue_client_id']), $revenue_id);
+logAudit("Income", "Create", "Added other income $label via API ($api_key_name)", intval($row['revenue_client_id']), $revenue_id);
logAudit("API", "Success", "Added other income $label via API ($api_key_name)", intval($row['revenue_client_id']));
// Output
diff --git a/api/v1/revenues/delete.php b/api/v1/revenues/delete.php
index 9882a8ecc..92bef1c82 100644
--- a/api/v1/revenues/delete.php
+++ b/api/v1/revenues/delete.php
@@ -29,7 +29,7 @@ if ($before) {
}
$delete_count = 1;
$label = escapeSql(incomeRevenueLabel($row));
- logAudit("Revenue", "Delete", "Deleted other income $label via API ($api_key_name)", intval($row['revenue_client_id']));
+ logAudit("Income", "Delete", "Deleted other income $label via API ($api_key_name)", intval($row['revenue_client_id']));
logAudit("API", "Success", "Deleted other income $label via API ($api_key_name)", intval($row['revenue_client_id']));
}
diff --git a/api/v1/revenues/update.php b/api/v1/revenues/update.php
index d57595704..850bfea1b 100644
--- a/api/v1/revenues/update.php
+++ b/api/v1/revenues/update.php
@@ -34,7 +34,7 @@ if ($before) {
$update_count = 1;
$row = incomeRevenueRow($revenue_id, false);
$label = escapeSql(incomeRevenueLabel($row));
- logAudit("Revenue", "Edit", "Edited other income $label via API ($api_key_name)", intval($row['revenue_client_id']), $revenue_id);
+ logAudit("Income", "Edit", "Edited other income $label via API ($api_key_name)", intval($row['revenue_client_id']), $revenue_id);
logAudit("API", "Success", "Edited other income $label via API ($api_key_name)", intval($row['revenue_client_id']));
}
diff --git a/api/v1/software/archive.php b/api/v1/software/archive.php
index b0319f81e..27d99e99e 100644
--- a/api/v1/software/archive.php
+++ b/api/v1/software/archive.php
@@ -33,7 +33,7 @@ if (!empty($software_id)) {
$update_count = mysqli_affected_rows($mysqli);
// Logging
- logAudit("Software", "Archive", "$software_name archived via API ($api_key_name)", $client_id, $software_id);
+ logAudit("License", "Archive", "$software_name archived via API ($api_key_name)", $client_id, $software_id);
}
}
}
diff --git a/api/v1/software/create.php b/api/v1/software/create.php
index 16d3cdbf1..8bd69d0aa 100644
--- a/api/v1/software/create.php
+++ b/api/v1/software/create.php
@@ -34,7 +34,7 @@ if (!empty($client_id) && mysqli_num_rows(mysqli_query($mysqli, "SELECT 1 FROM c
$keys_added = softwareAddKeys($insert_id, is_scalar($_POST['software_keys'] ?? '') ? (string) ($_POST['software_keys'] ?? '') : '');
$name = escapeSql(trim($software_post['name']));
- logAudit("Software", "Create", "$name" . ($keys_added ? " with $keys_added key" . ($keys_added === 1 ? '' : 's') : '') . " via API ($api_key_name)", $client_id, $insert_id);
+ logAudit("License", "Create", "$name" . ($keys_added ? " with $keys_added key" . ($keys_added === 1 ? '' : 's') : '') . " via API ($api_key_name)", $client_id, $insert_id);
logAudit("API", "Success", "Created license $name via API ($api_key_name)", $client_id);
}
}
diff --git a/api/v1/software/delete.php b/api/v1/software/delete.php
index 0876f3e56..0538e9156 100644
--- a/api/v1/software/delete.php
+++ b/api/v1/software/delete.php
@@ -23,7 +23,7 @@ if (!empty($software_id)) {
$delete_count = mysqli_affected_rows($mysqli);
$software_name = escapeSql($row['software_name']);
- logAudit("Software", "Delete", "$software_name with its seats and keys via API ($api_key_name)", $client_id);
+ logAudit("License", "Delete", "$software_name with its seats and keys via API ($api_key_name)", $client_id);
logAudit("API", "Success", "Deleted license $software_name via API ($api_key_name)", $client_id);
}
}
diff --git a/api/v1/software/renew.php b/api/v1/software/renew.php
index 3ab88f47c..29e5e5de5 100644
--- a/api/v1/software/renew.php
+++ b/api/v1/software/renew.php
@@ -49,7 +49,7 @@ if ($software) {
$was = $software['software_expire'] ?: 'no date';
$label = escapeSql($software['software_name']) . " until " . formatDate($until) . " (was " . escapeSql(formatDate($was) ?: $was) . ")" . ($reference !== '' ? ', reference ' . escapeSql($reference) : '');
- logAudit("Software", "Renew", "Renewed license $label via API ($api_key_name)", $client_id, $software_id);
+ logAudit("License", "Renew", "Renewed license $label via API ($api_key_name)", $client_id, $software_id);
logAudit("API", "Success", "Renewed license " . escapeSql($software['software_name']) . " via API ($api_key_name)", $client_id);
}
}
diff --git a/api/v1/software/seats.php b/api/v1/software/seats.php
index e06df0505..a03d93f7e 100644
--- a/api/v1/software/seats.php
+++ b/api/v1/software/seats.php
@@ -61,7 +61,7 @@ if ($software && (array_key_exists('asset_ids', $_POST) || array_key_exists('con
if ($changes['added'] || $changes['removed']) {
$label = escapeSql($software['software_name'] . softwareSeatChangeText($changes));
- logAudit("Software", "Seats", "Changed seats on license $label via API ($api_key_name)", $client_id, $software_id);
+ logAudit("License", "Seats", "Changed seats on license $label via API ($api_key_name)", $client_id, $software_id);
logAudit("API", "Success", "Changed seats on license " . escapeSql($software['software_name']) . " via API ($api_key_name)", $client_id);
}
}
diff --git a/api/v1/software/unarchive.php b/api/v1/software/unarchive.php
index b1a154cad..30457e3ec 100644
--- a/api/v1/software/unarchive.php
+++ b/api/v1/software/unarchive.php
@@ -33,7 +33,7 @@ if (!empty($software_id)) {
$update_count = mysqli_affected_rows($mysqli);
// Logging
- logAudit("Software", "Restore", "$software_name unarchived via API ($api_key_name)", $client_id, $software_id);
+ logAudit("License", "Restore", "$software_name unarchived via API ($api_key_name)", $client_id, $software_id);
}
}
}
diff --git a/api/v1/software/update.php b/api/v1/software/update.php
index 40c8ec877..67c01c077 100644
--- a/api/v1/software/update.php
+++ b/api/v1/software/update.php
@@ -35,7 +35,7 @@ if (!empty($software_id)) {
$update_count = 1;
$name = escapeSql(trim($software_post['name']));
- logAudit("Software", "Edit", "$name via API ($api_key_name)", $client_id, $software_id);
+ logAudit("License", "Edit", "$name via API ($api_key_name)", $client_id, $software_id);
logAudit("API", "Success", "Edited license $name via API ($api_key_name)", $client_id);
}
}
diff --git a/api/v1/software_keys/create.php b/api/v1/software_keys/create.php
index 320a9ed50..55d231f0a 100644
--- a/api/v1/software_keys/create.php
+++ b/api/v1/software_keys/create.php
@@ -41,7 +41,7 @@ if ($software) {
$return_arr['added'] = $added;
$label = "$added key" . ($added === 1 ? '' : 's') . ' to license ' . escapeSql($software['software_name']);
- logAudit("Software", "Keys", "Added $label via API ($api_key_name)", $client_id, $software_id);
+ logAudit("License", "Keys", "Added $label via API ($api_key_name)", $client_id, $software_id);
logAudit("API", "Success", "Added $label via API ($api_key_name)", $client_id);
}
diff --git a/api/v1/software_keys/delete.php b/api/v1/software_keys/delete.php
index 73eedbc39..9556f452d 100644
--- a/api/v1/software_keys/delete.php
+++ b/api/v1/software_keys/delete.php
@@ -24,7 +24,7 @@ if ($key_row) {
if ($delete_count > 0) {
$label = escapeSql($software['software_name']);
- logAudit("Software", "Keys", "Deleted a key from license $label via API ($api_key_name)", $client_id, intval($software['software_id']));
+ logAudit("License", "Keys", "Deleted a key from license $label via API ($api_key_name)", $client_id, intval($software['software_id']));
logAudit("API", "Success", "Deleted a key from license $label via API ($api_key_name)", $client_id);
}
}
diff --git a/api/v1/software_keys/update.php b/api/v1/software_keys/update.php
index cc7fd1ccc..5bb350fbc 100644
--- a/api/v1/software_keys/update.php
+++ b/api/v1/software_keys/update.php
@@ -80,7 +80,7 @@ if ($key_row) {
$return_arr['warning'] = $software_seat_warning($software_id);
$label = escapeSql($software['software_name']);
- logAudit("Software", "Keys", "Updated a key on license $label via API ($api_key_name)", $client_id, $software_id);
+ logAudit("License", "Keys", "Updated a key on license $label via API ($api_key_name)", $client_id, $software_id);
logAudit("API", "Success", "Updated a key on license $label via API ($api_key_name)", $client_id);
}
diff --git a/functions/archived.php b/functions/archived.php
index 31d70e2aa..ef4d29da6 100644
--- a/functions/archived.php
+++ b/functions/archived.php
@@ -34,7 +34,7 @@ function archivedKinds() {
'network' => ['label' => 'Network', 'icon' => 'fa-network-wired', 'table' => 'networks', 'id' => 'network_id', 'name' => 'network_name', 'client' => 'network_client_id', 'archived' => 'network_archived_at', 'module' => 'module_support', 'log' => 'Network'],
'rack' => ['label' => 'Rack', 'icon' => 'fa-server', 'table' => 'racks', 'id' => 'rack_id', 'name' => 'rack_name', 'client' => 'rack_client_id', 'archived' => 'rack_archived_at', 'module' => 'module_support', 'log' => 'Rack'],
'service' => ['label' => 'Service', 'icon' => 'fa-stream', 'table' => 'services', 'id' => 'service_id', 'name' => 'service_name', 'client' => 'service_client_id', 'archived' => 'service_archived_at', 'module' => 'module_support', 'log' => 'Service'],
- 'software' => ['label' => 'License', 'icon' => 'fa-cube', 'table' => 'software', 'id' => 'software_id', 'name' => 'software_name', 'client' => 'software_client_id', 'archived' => 'software_archived_at', 'module' => 'module_support', 'log' => 'Software'],
+ 'software' => ['label' => 'License', 'icon' => 'fa-cube', 'table' => 'software', 'id' => 'software_id', 'name' => 'software_name', 'client' => 'software_client_id', 'archived' => 'software_archived_at', 'module' => 'module_support', 'log' => 'License'],
];
if (!empty($config_module_enable_ticketing)) {
$kinds['project'] = ['label' => 'Project', 'icon' => 'fa-project-diagram', 'table' => 'projects', 'id' => 'project_id', 'name' => 'project_name', 'client' => 'project_client_id', 'archived' => 'project_archived_at', 'module' => 'module_support', 'log' => 'Project'];
diff --git a/functions/audit_log.php b/functions/audit_log.php
index 23ce01225..2c0b9128e 100644
--- a/functions/audit_log.php
+++ b/functions/audit_log.php
@@ -39,7 +39,7 @@ function auditLogKinds() {
'Credential' => ['icon' => 'fa-key', 'module' => 'module_credential', 'table' => 'credentials', 'id' => 'credential_id', 'name' => 'credential_name', 'client' => 'credential_client_id', 'url' => '/agent/credentials.php?{client_q}open={id}'],
'Certificate' => ['icon' => 'fa-lock', 'module' => 'module_support', 'table' => 'certificates', 'id' => 'certificate_id', 'name' => 'certificate_name', 'client' => 'certificate_client_id', 'url' => '/agent/certificates.php?{client_q}open={id}'],
'Domain' => ['icon' => 'fa-globe', 'module' => 'module_support', 'table' => 'domains', 'id' => 'domain_id', 'name' => 'domain_name', 'client' => 'domain_client_id', 'url' => '/agent/domains.php?{client_q}open={id}'],
- 'Software' => ['icon' => 'fa-cube', 'module' => 'module_support', 'table' => 'software', 'id' => 'software_id', 'name' => 'software_name', 'client' => 'software_client_id', 'url' => '/agent/license.php?client_id={client}&software_id={id}'],
+ 'License' => ['icon' => 'fa-cube', 'module' => 'module_support', 'table' => 'software', 'id' => 'software_id', 'name' => 'software_name', 'client' => 'software_client_id', 'url' => '/agent/license.php?client_id={client}&software_id={id}'],
'Service' => ['icon' => 'fa-stream', 'module' => 'module_support', 'table' => 'services', 'id' => 'service_id', 'name' => 'service_name', 'client' => 'service_client_id', 'url' => '/agent/service.php?client_id={client}&service_id={id}'],
'Knowledge Base' => ['icon' => 'fa-book', 'module' => 'module_support', 'table' => 'kb_articles', 'id' => 'kb_article_id', 'name' => 'kb_article_title', 'url' => '/agent/kb_article.php?kb_article_id={id}'],
'Document' => ['icon' => 'fa-file-alt', 'module' => 'module_support', 'table' => 'documents', 'id' => 'document_id', 'name' => 'document_name', 'client' => 'document_client_id', 'url' => '/agent/document.php?client_id={client}&document_id={id}'],
@@ -59,7 +59,7 @@ function auditLogKinds() {
'Ticket Template' => ['icon' => 'fa-life-ring', 'table' => 'ticket_templates', 'id' => 'ticket_template_id', 'name' => 'ticket_template_name', 'url' => '/admin/ticket_template.php?ticket_template_id={id}'],
'Project Template' => ['icon' => 'fa-project-diagram', 'table' => 'project_templates', 'id' => 'project_template_id', 'name' => 'project_template_name', 'url' => '/admin/project_template.php?project_template_id={id}'],
'Document Template' => ['icon' => 'fa-file-alt', 'table' => 'document_templates', 'id' => 'document_template_id', 'name' => 'document_template_name', 'url' => '/admin/document_template.php?document_template_id={id}'],
- 'Software Template' => ['icon' => 'fa-cube', 'table' => 'software_templates', 'id' => 'software_template_id', 'name' => 'software_template_name', 'url' => '/admin/software_template.php?software_template_id={id}'],
+ 'License Template' => ['icon' => 'fa-cube', 'table' => 'software_templates', 'id' => 'software_template_id', 'name' => 'software_template_name', 'url' => '/admin/software_template.php?software_template_id={id}'],
'Vendor Template' => ['icon' => 'fa-building', 'table' => 'vendor_templates', 'id' => 'vendor_template_id', 'name' => 'vendor_template_name', 'url' => '/admin/vendor_template.php?vendor_template_id={id}'],
'Managed Instance' => ['icon' => 'fa-network-wired', 'table' => 'managed_instances', 'id' => 'managed_instance_id', 'name' => 'managed_instance_name', 'url' => '/admin/managed_instance.php?id={id}'],
@@ -78,6 +78,8 @@ function auditLogKinds() {
'Backup' => ['icon' => 'fa-cloud-upload-alt'],
'App' => ['icon' => 'fa-download'],
'Cron' => ['icon' => 'fa-clock'],
+ 'Database' => ['icon' => 'fa-database'],
+ 'Undo' => ['icon' => 'fa-undo'],
'Calendar' => ['icon' => 'fa-calendar-alt', 'module' => 'module_client'],
'Calendar Event' => ['icon' => 'fa-calendar-day', 'module' => 'module_client'],
'Recurring Ticket' => ['icon' => 'fa-redo-alt', 'module' => 'module_support'],
@@ -89,10 +91,9 @@ function auditLogKinds() {
'IP Address' => ['icon' => 'fa-sitemap', 'module' => 'module_support'],
'Payment' => ['icon' => 'fa-credit-card', 'module' => 'module_financial'],
'Income' => ['icon' => 'fa-hand-holding-usd', 'module' => 'module_financial'],
- 'Revenue' => ['icon' => 'fa-hand-holding-usd', 'module' => 'module_financial'],
'Credit' => ['icon' => 'fa-wallet', 'module' => 'module_sales'],
'Account' => ['icon' => 'fa-piggy-bank', 'module' => 'module_financial'],
- 'Account Transfer' => ['icon' => 'fa-exchange-alt', 'module' => 'module_financial'],
+ 'Transfer' => ['icon' => 'fa-exchange-alt', 'module' => 'module_financial'],
'Transaction' => ['icon' => 'fa-exchange-alt', 'module' => 'module_financial'],
'Reconciliation' => ['icon' => 'fa-balance-scale', 'module' => 'module_financial'],
'Budget' => ['icon' => 'fa-chart-pie', 'module' => 'module_financial'],
@@ -115,8 +116,10 @@ function auditLogKinds() {
'Custom Link' => ['icon' => 'fa-external-link-alt'],
'AI Provider' => ['icon' => 'fa-robot'],
'AI Model' => ['icon' => 'fa-brain'],
+ 'RMM Provider' => ['icon' => 'fa-laptop-medical'],
'Starter Content' => ['icon' => 'fa-seedling'],
'Demo Data' => ['icon' => 'fa-flask'],
+ 'Demo' => ['icon' => 'fa-flask'],
'Report' => ['icon' => 'fa-chart-bar', 'module' => 'module_reporting'],
'Sharing' => ['icon' => 'fa-share-alt'],
'Audit Log' => ['icon' => 'fa-history'],
@@ -140,7 +143,7 @@ function auditLogActionStyle($action) {
$styles = [
'Create' => ['success', 'fa-plus'], 'Bulk Create' => ['success', 'fa-plus'], 'Import' => ['success', 'fa-file-import'], 'Upload' => ['success', 'fa-upload'],
'Edit' => ['primary', 'fa-pen'], 'Bulk Edit' => ['primary', 'fa-pen'], 'Update' => ['primary', 'fa-sync-alt'], 'Modify' => ['primary', 'fa-pen'], 'Rename' => ['primary', 'fa-i-cursor'],
- 'Move' => ['primary', 'fa-arrows-alt'], 'Merge' => ['primary', 'fa-code-branch'], 'Link' => ['primary', 'fa-link'], 'Unlink' => ['secondary', 'fa-unlink'],
+ 'Move' => ['primary', 'fa-arrows-alt'], 'Merge' => ['primary', 'fa-code-branch'], 'Link' => ['primary', 'fa-link'], 'Bulk Link' => ['primary', 'fa-link'], 'Unlink' => ['secondary', 'fa-unlink'],
'Reply' => ['primary', 'fa-reply'], 'Resolve' => ['success', 'fa-check'], 'Close' => ['secondary', 'fa-check-double'], 'Reopen' => ['primary', 'fa-redo'],
'Delete' => ['danger', 'fa-trash'], 'Bulk Delete' => ['danger', 'fa-trash'], 'Revoke' => ['danger', 'fa-ban'],
'Archive' => ['secondary', 'fa-archive'], 'Bulk Archive' => ['secondary', 'fa-archive'], 'Restore' => ['info', 'fa-redo'], 'Bulk Restore' => ['info', 'fa-redo'],
@@ -150,12 +153,12 @@ function auditLogActionStyle($action) {
'Error' => ['danger', 'fa-exclamation-triangle'],
'Activate' => ['success', 'fa-toggle-on'], 'Disable' => ['secondary', 'fa-ban'], 'Cancel' => ['secondary', 'fa-ban'], 'Bulk Cancel' => ['secondary', 'fa-ban'], 'End' => ['secondary', 'fa-stop-circle'],
'Dismiss' => ['secondary', 'fa-times'], 'Discard' => ['danger', 'fa-trash'], 'Import Rule Delete' => ['danger', 'fa-trash'], 'Undo' => ['secondary', 'fa-undo'], 'Reimbursement Undo' => ['secondary', 'fa-undo'],
- 'Unshare' => ['secondary', 'fa-unlink'], 'Unbill' => ['secondary', 'fa-unlink'], 'Read' => ['warning', 'fa-eye'], 'Keys' => ['primary', 'fa-key'], 'Rotate' => ['primary', 'fa-sync-alt'], 'Refresh' => ['primary', 'fa-sync-alt'],
+ 'Unshare' => ['secondary', 'fa-unlink'], 'Unbill' => ['secondary', 'fa-unlink'], 'Read' => ['warning', 'fa-eye'], 'Keys' => ['primary', 'fa-key'], 'Rotate' => ['primary', 'fa-sync-alt'], 'Refresh' => ['primary', 'fa-sync-alt'], 'Sync' => ['primary', 'fa-sync-alt'], 'Repair' => ['primary', 'fa-wrench'], 'Reset' => ['primary', 'fa-undo'],
'Change' => ['primary', 'fa-pen'], 'Stock' => ['primary', 'fa-boxes'], 'Seats' => ['primary', 'fa-users'], 'Task' => ['primary', 'fa-tasks'], 'Transfer' => ['primary', 'fa-exchange-alt'], 'Bulk Transfer' => ['primary', 'fa-exchange-alt'],
'Statement' => ['primary', 'fa-file-invoice'], 'Receipt' => ['primary', 'fa-receipt'], 'Queue' => ['primary', 'fa-stream'], 'Run' => ['primary', 'fa-play'], 'Move On' => ['primary', 'fa-forward'],
'Check' => ['info', 'fa-check'], 'Review' => ['info', 'fa-clipboard-check'], 'Save' => ['success', 'fa-save'], 'Bill' => ['success', 'fa-file-invoice-dollar'], 'Renew' => ['success', 'fa-redo-alt'],
'Reimburse' => ['success', 'fa-hand-holding-usd'], 'Finish' => ['success', 'fa-flag-checkered'],
- 'Invite' => ['primary', 'fa-user-plus'], 'Onboard' => ['primary', 'fa-route'], 'Sign Up Requested' => ['secondary', 'fa-user-plus'], 'Sign Up Sent' => ['primary', 'fa-paper-plane'], 'Sign Up Refused' => ['warning', 'fa-user-times'],
+ 'Invite' => ['primary', 'fa-user-plus'], 'Onboard' => ['primary', 'fa-route'], 'Offboard' => ['secondary', 'fa-sign-out-alt'], 'Sign Up Requested' => ['secondary', 'fa-user-plus'], 'Sign Up Sent' => ['primary', 'fa-paper-plane'], 'Sign Up Refused' => ['warning', 'fa-user-times'],
'Connect' => ['success', 'fa-plug'], 'Disconnect' => ['secondary', 'fa-unlink'], 'Remove' => ['danger', 'fa-unlink'], 'Release' => ['secondary', 'fa-unlink'], 'Code' => ['primary', 'fa-key'],
'Mode' => ['warning', 'fa-lock'], 'Support' => ['warning', 'fa-headset'],
];
diff --git a/functions/import_kinds.php b/functions/import_kinds.php
index 569eab175..4e05c9c88 100644
--- a/functions/import_kinds.php
+++ b/functions/import_kinds.php
@@ -396,7 +396,7 @@ function importKinds() {
],
'licenses' => [
- 'title' => 'Licenses', 'one' => 'license', 'log' => 'Software', 'icon' => 'fa-cube', 'module' => 'module_support', 'client' => true,
+ 'title' => 'Licenses', 'one' => 'license', 'log' => 'License', 'icon' => 'fa-cube', 'module' => 'module_support', 'client' => true,
'about' => 'Each row is one of the client\'s licenses, found by its name. Assets and Contacts give it their seats, by name.',
'fields' => [
'name' => $f('Name', ['License', 'Software', 'License Name'], ['required' => true, 'example' => 'Microsoft 365 Business Premium']),
diff --git a/functions/income_import.php b/functions/income_import.php
index 889233120..d588c69bf 100644
--- a/functions/income_import.php
+++ b/functions/income_import.php
@@ -781,12 +781,12 @@ function incomeImportSave(array $import, array $picks, array $opts, &$error = ''
revenue_payment_method = " . ($method === '' ? 'NULL' : "'" . escapeSql($method) . "'") . ", revenue_reference = '" . escapeSql(mb_substr($line['reference'], 0, 200)) . "',
revenue_description = '" . escapeSql($line['description']) . "', revenue_created_by = " . intval($session_user_id) . ", revenue_import_key = '$key'");
$revenue_id = mysqli_insert_id($mysqli);
- logAudit("Revenue", "Create", "$who added other income " . escapeSql(mb_substr($line['description'], 0, 80) . ' - ' . billingMoney($line['amount'], $currency)) . " from a bank statement", $item['client'], $revenue_id);
+ logAudit("Income", "Create", "$who added other income " . escapeSql(mb_substr($line['description'], 0, 80) . ' - ' . billingMoney($line['amount'], $currency)) . " from a bank statement", $item['client'], $revenue_id);
$result['income']++;
$result['income_total'] += $line['amount'];
} else {
incomeImportTransfer($item['account'], $account_id, $date, $line['amount'], $currency, $method !== '' ? $method : 'Bank Transfer', $line['description'], $line['key_hash']);
- logAudit("Account Transfer", "Create", "$who brought in a transfer of " . escapeSql(billingMoney($line['amount'], $currency)) . " from " . escapeSql($accounts[$item['account']]['account_name'])
+ logAudit("Transfer", "Create", "$who brought in a transfer of " . escapeSql(billingMoney($line['amount'], $currency)) . " from " . escapeSql($accounts[$item['account']]['account_name'])
. " to " . escapeSql($accounts[$account_id]['account_name']) . " from a bank statement");
$result['transfers']++;
$result['transfer_total'] += $line['amount'];
diff --git a/functions/links.php b/functions/links.php
index e77fda517..043ed2673 100644
--- a/functions/links.php
+++ b/functions/links.php
@@ -192,17 +192,17 @@ function linkCandidates($from, $id, $to, $client_id) {
return $rows;
}
-/** The audit log entry a link change is filed under - the service, document, file or license side of it. */
+/** The audit log entry a link change is filed under - the service, document, file or license side of it: [its type, its id, whether it is the $from side]. */
function linkLogSide($from, $id, $to, $other_id) {
foreach (['service', 'document', 'file', 'software'] as $side) {
if ($from === $side) {
- return [ucfirst($side), $id];
+ return [ucfirst(LINK_ENTITIES[$side]['label']), $id, true];
}
if ($to === $side) {
- return [ucfirst($side), $other_id];
+ return [ucfirst(LINK_ENTITIES[$side]['label']), $other_id, false];
}
}
- return [ucfirst($from), $id];
+ return [ucfirst(LINK_ENTITIES[$from]['label']), $id, true];
}
/**
@@ -233,10 +233,10 @@ function linkAdd($from, $id, $to, $ids) {
continue;
}
$added[] = $other['name'];
- [$log_type, $log_id] = linkLogSide($from, intval($source['id']), $to, $other_id);
- $log_from = $log_type === ucfirst($from) ? $source['name'] : $other['name'];
- $log_other = $log_type === ucfirst($from) ? $other['name'] : $source['name'];
- $log_other_label = $log_type === ucfirst($from) ? $to_entity['label'] : $from_entity['label'];
+ [$log_type, $log_id, $log_is_from] = linkLogSide($from, intval($source['id']), $to, $other_id);
+ $log_from = $log_is_from ? $source['name'] : $other['name'];
+ $log_other = $log_is_from ? $other['name'] : $source['name'];
+ $log_other_label = $log_is_from ? $to_entity['label'] : $from_entity['label'];
logAudit($log_type, "Link", "$session_name linked $log_other_label " . escapeSql($log_other) . " to " . strtolower($log_type) . " " . escapeSql($log_from), $client_id, $log_id);
}
return $added;
@@ -265,10 +265,10 @@ function linkRemove($from, $id, $to, $other_id) {
softwareFreeKeys($other['id'], $holder, $source['id']);
}
}
- [$log_type, $log_id] = linkLogSide($from, intval($source['id']), $to, intval($other['id']));
- $log_from = $log_type === ucfirst($from) ? $source['name'] : $other['name'];
- $log_other = $log_type === ucfirst($from) ? $other['name'] : $source['name'];
- $log_other_label = $log_type === ucfirst($from) ? $to_entity['label'] : $from_entity['label'];
+ [$log_type, $log_id, $log_is_from] = linkLogSide($from, intval($source['id']), $to, intval($other['id']));
+ $log_from = $log_is_from ? $source['name'] : $other['name'];
+ $log_other = $log_is_from ? $other['name'] : $source['name'];
+ $log_other_label = $log_is_from ? $to_entity['label'] : $from_entity['label'];
logAudit($log_type, "Unlink", "$session_name unlinked $log_other_label " . escapeSql($log_other) . " from " . strtolower($log_type) . " " . escapeSql($log_from), intval($source['client_id']), $log_id);
return $other['name'];
}
diff --git a/functions/tags.php b/functions/tags.php
index 347bfffa4..ed1568126 100644
--- a/functions/tags.php
+++ b/functions/tags.php
@@ -78,7 +78,7 @@ function tagEntity($entity) {
'type' => 8, 'label' => 'license', 'module' => 'module_support',
'link_table' => 'software_tags', 'link_record' => 'software_id', 'link_tag' => 'tag_id',
'table' => 'software', 'id' => 'software_id', 'client' => 'software_client_id', 'name' => 'software_name',
- 'log' => 'Software', 'list' => 'software.php'
+ 'log' => 'License', 'list' => 'software.php'
],
'service' => [
'title' => 'Service', 'plural' => 'services', 'icon' => 'fa-stream',