mirror of
https://github.com/itflow-org/itflow
synced 2026-08-17 04:55:13 +00:00
Replace Function logAction() with logAudit()
This commit is contained in:
@@ -98,6 +98,6 @@ mysqli_query($mysqli, "UPDATE settings SET
|
|||||||
WHERE company_id = 1
|
WHERE company_id = 1
|
||||||
");
|
");
|
||||||
|
|
||||||
logAction("Settings", "Edit", "$session_name completed Microsoft OAuth connect flow for mail settings");
|
logAudit("Settings", "Edit", "$session_name completed Microsoft OAuth connect flow for mail settings");
|
||||||
flash_alert("Microsoft OAuth connected successfully. Token expires at $expires_at.");
|
flash_alert("Microsoft OAuth connected successfully. Token expires at $expires_at.");
|
||||||
redirect($settings_mail_path);
|
redirect($settings_mail_path);
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ if (isset($_POST['add_ai_model'])) {
|
|||||||
|
|
||||||
$ai_model_id = mysqli_insert_id($mysqli);
|
$ai_model_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("AI Model", "Create", "$session_name created AI Model $model");
|
logAudit("AI Model", "Create", "$session_name created AI Model $model");
|
||||||
|
|
||||||
flash_alert("AI Model <strong>$model</strong> created");
|
flash_alert("AI Model <strong>$model</strong> created");
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ if (isset($_POST['edit_ai_model'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE ai_models SET ai_model_name = '$model', ai_model_prompt = '$prompt', ai_model_use_case = '$use_case' WHERE ai_model_id = $model_id");
|
mysqli_query($mysqli,"UPDATE ai_models SET ai_model_name = '$model', ai_model_prompt = '$prompt', ai_model_use_case = '$use_case' WHERE ai_model_id = $model_id");
|
||||||
|
|
||||||
logAction("AI Model", "Edit", "$session_name edited AI Model $model");
|
logAudit("AI Model", "Edit", "$session_name edited AI Model $model");
|
||||||
|
|
||||||
flash_alert("AI Model <strong>$model</strong> edited");
|
flash_alert("AI Model <strong>$model</strong> edited");
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ if (isset($_GET['delete_ai_model'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM ai_models WHERE ai_model_id = $model_id");
|
mysqli_query($mysqli,"DELETE FROM ai_models WHERE ai_model_id = $model_id");
|
||||||
|
|
||||||
logAction("AI Model", "Delete", "$session_name deleted AI Model $model_name");
|
logAudit("AI Model", "Delete", "$session_name deleted AI Model $model_name");
|
||||||
|
|
||||||
flash_alert("AI Model <strong>$model_name</strong> deleted", 'error');
|
flash_alert("AI Model <strong>$model_name</strong> deleted", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ if (isset($_POST['add_ai_provider'])) {
|
|||||||
|
|
||||||
$ai_provider_id = mysqli_insert_id($mysqli);
|
$ai_provider_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("AI Provider", "Create", "$session_name created AI Provider $provider");
|
logAudit("AI Provider", "Create", "$session_name created AI Provider $provider");
|
||||||
|
|
||||||
flash_alert("AI Model <strong>$provider</strong> created");
|
flash_alert("AI Model <strong>$provider</strong> created");
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ if (isset($_POST['edit_ai_provider'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE ai_providers SET ai_provider_name = '$provider', ai_provider_api_url = '$url', ai_provider_api_key = '$api_key' WHERE ai_provider_id = $provider_id");
|
mysqli_query($mysqli,"UPDATE ai_providers SET ai_provider_name = '$provider', ai_provider_api_url = '$url', ai_provider_api_key = '$api_key' WHERE ai_provider_id = $provider_id");
|
||||||
|
|
||||||
logAction("AI Provider", "Edit", "$session_name edited AI Provider $provider");
|
logAudit("AI Provider", "Edit", "$session_name edited AI Provider $provider");
|
||||||
|
|
||||||
flash_alert("AI Model <strong>$provider</strong> edited");
|
flash_alert("AI Model <strong>$provider</strong> edited");
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ if (isset($_GET['delete_ai_provider'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM ai_providers WHERE ai_provider_id = $provider_id");
|
mysqli_query($mysqli,"DELETE FROM ai_providers WHERE ai_provider_id = $provider_id");
|
||||||
|
|
||||||
logAction("AI Provider", "Delete", "$session_name deleted AI Provider $provider_name", 'error');
|
logAudit("AI Provider", "Delete", "$session_name deleted AI Provider $provider_name", 'error');
|
||||||
|
|
||||||
flash_alert("AI Provider <strong>$provider_name</strong> deleted", 'error');
|
flash_alert("AI Provider <strong>$provider_name</strong> deleted", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ if (isset($_POST['add_api_key'])) {
|
|||||||
|
|
||||||
$api_key_id = mysqli_insert_id($mysqli);
|
$api_key_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("API Key", "Create", "$session_name created API key $name set to expire on $expire", $client_id, $api_key_id);
|
logAudit("API Key", "Create", "$session_name created API key $name set to expire on $expire", $client_id, $api_key_id);
|
||||||
|
|
||||||
flash_alert("API Key <strong>$name</strong> created");
|
flash_alert("API Key <strong>$name</strong> created");
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ if (isset($_GET['revoke_api_key'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE api_keys SET api_key_expire = NOW() WHERE api_key_id = $api_key_id");
|
mysqli_query($mysqli,"UPDATE api_keys SET api_key_expire = NOW() WHERE api_key_id = $api_key_id");
|
||||||
|
|
||||||
logAction("API Key", "Revoke", "$session_name revoked API key $name", $client_id);
|
logAudit("API Key", "Revoke", "$session_name revoked API key $name", $client_id);
|
||||||
|
|
||||||
flash_alert("API Key <strong>$name</strong> revoked", 'error');
|
flash_alert("API Key <strong>$name</strong> revoked", 'error');
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ if (isset($_GET['delete_api_key'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM api_keys WHERE api_key_id = $api_key_id");
|
mysqli_query($mysqli,"DELETE FROM api_keys WHERE api_key_id = $api_key_id");
|
||||||
|
|
||||||
logAction("API Key", "Delete", "$session_name deleted API key $name", $client_id);
|
logAudit("API Key", "Delete", "$session_name deleted API key $name", $client_id);
|
||||||
|
|
||||||
flash_alert("API Key <strong>$name</strong> deleted", 'error');
|
flash_alert("API Key <strong>$name</strong> deleted", 'error');
|
||||||
|
|
||||||
@@ -93,11 +93,11 @@ if (isset($_POST['bulk_delete_api_keys'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "DELETE FROM api_keys WHERE api_key_id = $api_key_id");
|
mysqli_query($mysqli, "DELETE FROM api_keys WHERE api_key_id = $api_key_id");
|
||||||
|
|
||||||
logAction("API Key", "Delete", "$session_name deleted API key $name", $client_id);
|
logAudit("API Key", "Delete", "$session_name deleted API key $name", $client_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("API Key", "Bulk Delete", "$session_name deleted $count API key(s)");
|
logAudit("API Key", "Bulk Delete", "$session_name deleted $count API key(s)");
|
||||||
|
|
||||||
flash_alert("Deleted <strong>$count</strong> API keys(s)", 'error');
|
flash_alert("Deleted <strong>$count</strong> API keys(s)", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -295,7 +295,7 @@ if (isset($_GET['download_backup'])) {
|
|||||||
fclose($fp);
|
fclose($fp);
|
||||||
|
|
||||||
// Log + UX
|
// Log + UX
|
||||||
logAction("System", "Backup Download", ($session_name ?? 'Unknown User') . " downloaded full backup.");
|
logAudit("System", "Backup Download", ($session_name ?? 'Unknown User') . " downloaded full backup.");
|
||||||
flash_alert("Full backup downloaded.");
|
flash_alert("Full backup downloaded.");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@@ -312,7 +312,7 @@ if (isset($_POST['backup_master_key'])) {
|
|||||||
if (password_verify($password, $row['user_password'])) {
|
if (password_verify($password, $row['user_password'])) {
|
||||||
$site_encryption_master_key = decryptUserSpecificKey($row['user_specific_encryption_ciphertext'], $password);
|
$site_encryption_master_key = decryptUserSpecificKey($row['user_specific_encryption_ciphertext'], $password);
|
||||||
|
|
||||||
logAction("Master Key", "Download", "$session_name retrieved the master encryption key");
|
logAudit("Master Key", "Download", "$session_name retrieved the master encryption key");
|
||||||
|
|
||||||
appNotify("Master Key", "$session_name retrieved the master encryption key");
|
appNotify("Master Key", "$session_name retrieved the master encryption key");
|
||||||
|
|
||||||
@@ -322,7 +322,7 @@ if (isset($_POST['backup_master_key'])) {
|
|||||||
echo "<br>==============================";
|
echo "<br>==============================";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
logAction("Master Key", "Download", "$session_name attempted to retrieve the master encryption key but failed");
|
logAudit("Master Key", "Download", "$session_name attempted to retrieve the master encryption key but failed");
|
||||||
|
|
||||||
flash_alert("Incorrect password.", 'error');
|
flash_alert("Incorrect password.", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ if (isset($_POST['add_category'])) {
|
|||||||
|
|
||||||
$category_id = mysqli_insert_id($mysqli);
|
$category_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Category", "Create", "$session_name created category $type $name", 0, $category_id);
|
logAudit("Category", "Create", "$session_name created category $type $name", 0, $category_id);
|
||||||
|
|
||||||
flash_alert("Category $type <strong>$name</strong> created");
|
flash_alert("Category $type <strong>$name</strong> created");
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ if (isset($_POST['edit_category'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE categories SET category_name = '$name', category_description = '$description', category_type = '$type', category_color = '$color' WHERE category_id = $category_id");
|
mysqli_query($mysqli,"UPDATE categories SET category_name = '$name', category_description = '$description', category_type = '$type', category_color = '$color' WHERE category_id = $category_id");
|
||||||
|
|
||||||
logAction("Category", "Edit", "$session_name edited category $type $name", 0, $category_id);
|
logAudit("Category", "Edit", "$session_name edited category $type $name", 0, $category_id);
|
||||||
|
|
||||||
flash_alert("Category $type <strong>$name</strong> edited");
|
flash_alert("Category $type <strong>$name</strong> edited");
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ if (isset($_GET['archive_category'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE categories SET category_archived_at = NOW() WHERE category_id = $category_id");
|
mysqli_query($mysqli,"UPDATE categories SET category_archived_at = NOW() WHERE category_id = $category_id");
|
||||||
|
|
||||||
logAction("Category", "Archive", "$session_name archived category $category_type $category_name", 0, $category_id);
|
logAudit("Category", "Archive", "$session_name archived category $category_type $category_name", 0, $category_id);
|
||||||
|
|
||||||
flash_alert("Category $category_type <strong>$category_name</strong> archived", 'error');
|
flash_alert("Category $category_type <strong>$category_name</strong> archived", 'error');
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ if (isset($_GET['restore_category'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE categories SET category_archived_at = NULL WHERE category_id = $category_id");
|
mysqli_query($mysqli,"UPDATE categories SET category_archived_at = NULL WHERE category_id = $category_id");
|
||||||
|
|
||||||
logAction("Category", "Restore", "$session_name retored category $category_type $category_name", 0, $category_id);
|
logAudit("Category", "Restore", "$session_name retored category $category_type $category_name", 0, $category_id);
|
||||||
|
|
||||||
flash_alert("Category $category_type <strong>$category_name</strong> restored");
|
flash_alert("Category $category_type <strong>$category_name</strong> restored");
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ if (isset($_GET['delete_category'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM categories WHERE category_id = $category_id");
|
mysqli_query($mysqli,"DELETE FROM categories WHERE category_id = $category_id");
|
||||||
|
|
||||||
logAction("Category", "Delete", "$session_name deleted category $category_type $category_name");
|
logAudit("Category", "Delete", "$session_name deleted category $category_type $category_name");
|
||||||
|
|
||||||
flash_alert("Category $category_type <strong>$category_name</strong> deleted", 'error');
|
flash_alert("Category $category_type <strong>$category_name</strong> deleted", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ if (isset($_POST['add_contract_template'])) {
|
|||||||
$contract_template_id = mysqli_insert_id($mysqli);
|
$contract_template_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
// Log action
|
// Log action
|
||||||
logAction("Contract Template", "Create", "$session_name created contract template $name", 0, $contract_template_id);
|
logAudit("Contract Template", "Create", "$session_name created contract template $name", 0, $contract_template_id);
|
||||||
|
|
||||||
// Flash message
|
// Flash message
|
||||||
flash_alert("Contract Template <strong>$name</strong> created");
|
flash_alert("Contract Template <strong>$name</strong> created");
|
||||||
@@ -99,7 +99,7 @@ if (isset($_POST['edit_contract_template'])) {
|
|||||||
");
|
");
|
||||||
|
|
||||||
// Log action
|
// Log action
|
||||||
logAction("Contract Template", "Update", "$session_name updated contract template $name", 0, $contract_template_id);
|
logAudit("Contract Template", "Update", "$session_name updated contract template $name", 0, $contract_template_id);
|
||||||
|
|
||||||
// Flash + redirect
|
// Flash + redirect
|
||||||
flash_alert("Contract Template <strong>$name</strong> updated");
|
flash_alert("Contract Template <strong>$name</strong> updated");
|
||||||
@@ -117,7 +117,7 @@ if (isset($_GET['archive_contract_template'])) {
|
|||||||
LIMIT 1
|
LIMIT 1
|
||||||
");
|
");
|
||||||
|
|
||||||
logAction("Contract Template", "Archive", "$session_name archived contract template $name", 0, $contract_template_id);
|
logAudit("Contract Template", "Archive", "$session_name archived contract template $name", 0, $contract_template_id);
|
||||||
flash_alert("Contract Template <strong>$name</strong> archived", "danger");
|
flash_alert("Contract Template <strong>$name</strong> archived", "danger");
|
||||||
redirect();
|
redirect();
|
||||||
}
|
}
|
||||||
@@ -133,7 +133,7 @@ if (isset($_GET['restore_contract_template'])) {
|
|||||||
LIMIT 1
|
LIMIT 1
|
||||||
");
|
");
|
||||||
|
|
||||||
logAction("Contract Template", "Restore", "$session_name restored contract template $name", 0, $contract_template_id);
|
logAudit("Contract Template", "Restore", "$session_name restored contract template $name", 0, $contract_template_id);
|
||||||
flash_alert("Contract Template <strong>$name</strong> restored");
|
flash_alert("Contract Template <strong>$name</strong> restored");
|
||||||
redirect();
|
redirect();
|
||||||
}
|
}
|
||||||
@@ -149,7 +149,7 @@ if (isset($_GET['delete_contract_template'])) {
|
|||||||
LIMIT 1
|
LIMIT 1
|
||||||
");
|
");
|
||||||
|
|
||||||
logAction("Contract Template", "Delete", "$session_name deleted contract template $name", 0, $contract_template_id);
|
logAudit("Contract Template", "Delete", "$session_name deleted contract template $name", 0, $contract_template_id);
|
||||||
flash_alert("Contract Template <strong>$name</strong> deleted", "danger");
|
flash_alert("Contract Template <strong>$name</strong> deleted", "danger");
|
||||||
redirect();
|
redirect();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ if(isset($_POST['create_custom_field'])){
|
|||||||
|
|
||||||
$custom_field_id = mysqli_insert_id($mysqli);
|
$custom_field_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Custom Field", "Create", "$session_name created custom field $label", 0, $custom_field_id);
|
logAudit("Custom Field", "Create", "$session_name created custom field $label", 0, $custom_field_id);
|
||||||
|
|
||||||
flash_alert("Custom field <strong>$label</strong> created");
|
flash_alert("Custom field <strong>$label</strong> created");
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ if(isset($_POST['edit_custom_field'])){
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE custom_fields SET custom_field_label = '$label', custom_field_type = '$type' WHERE custom_field_id = $custom_field_id");
|
mysqli_query($mysqli,"UPDATE custom_fields SET custom_field_label = '$label', custom_field_type = '$type' WHERE custom_field_id = $custom_field_id");
|
||||||
|
|
||||||
logAction("Custom Field", "Edit", "$session_name edited custom field $label", 0, $custom_field_id);
|
logAudit("Custom Field", "Edit", "$session_name edited custom field $label", 0, $custom_field_id);
|
||||||
|
|
||||||
flash_alert("Custom field <strong>$label</strong> edited");
|
flash_alert("Custom field <strong>$label</strong> edited");
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ if(isset($_GET['delete_custom_field'])){
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM custom_fields WHERE custom_field_id = $custom_field_id");
|
mysqli_query($mysqli,"DELETE FROM custom_fields WHERE custom_field_id = $custom_field_id");
|
||||||
|
|
||||||
logAction("Custom Field", "Delete", "$session_name deleted custom field $label");
|
logAudit("Custom Field", "Delete", "$session_name deleted custom field $label");
|
||||||
|
|
||||||
flash_alert("Custom field <strong>$label</strong> deleted", 'error');
|
flash_alert("Custom field <strong>$label</strong> deleted", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ if (isset($_POST['add_custom_link'])) {
|
|||||||
|
|
||||||
$custom_link_id = mysqli_insert_id($mysqli);
|
$custom_link_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Custom Link", "Create", "$session_name created custom link $name -> $uri", 0, $custom_link_id);
|
logAudit("Custom Link", "Create", "$session_name created custom link $name -> $uri", 0, $custom_link_id);
|
||||||
|
|
||||||
flash_alert("Custom link <strong>$name</strong> created");
|
flash_alert("Custom link <strong>$name</strong> created");
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ if (isset($_POST['edit_custom_link'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE custom_links SET custom_link_name = '$name', custom_link_uri = '$uri', custom_link_new_tab = $new_tab, custom_link_icon = '$icon', custom_link_order = $order, custom_link_location = $location WHERE custom_link_id = $custom_link_id");
|
mysqli_query($mysqli,"UPDATE custom_links SET custom_link_name = '$name', custom_link_uri = '$uri', custom_link_new_tab = $new_tab, custom_link_icon = '$icon', custom_link_order = $order, custom_link_location = $location WHERE custom_link_id = $custom_link_id");
|
||||||
|
|
||||||
logAction("Custom Link", "Edit", "$session_name edited custom link $name -> $uri", 0, $custom_link_id);
|
logAudit("Custom Link", "Edit", "$session_name edited custom link $name -> $uri", 0, $custom_link_id);
|
||||||
|
|
||||||
flash_alert("Custom Link <strong>$name</strong> edited");
|
flash_alert("Custom Link <strong>$name</strong> edited");
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ if (isset($_GET['delete_custom_link'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM custom_links WHERE custom_link_id = $custom_link_id");
|
mysqli_query($mysqli,"DELETE FROM custom_links WHERE custom_link_id = $custom_link_id");
|
||||||
|
|
||||||
logAction("Custom Link", "Delete", "$session_name deleted custom link $custom_link_name -> $custom_link_uri");
|
logAudit("Custom Link", "Delete", "$session_name deleted custom link $custom_link_name -> $custom_link_uri");
|
||||||
|
|
||||||
flash_alert("Custom Link <strong>$name</strong> deleted", 'error');
|
flash_alert("Custom Link <strong>$name</strong> deleted", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ if (isset($_POST['add_document_template'])) {
|
|||||||
// Document template update content
|
// Document template update content
|
||||||
mysqli_query($mysqli,"UPDATE document_templates SET document_template_content = '$processed_content' WHERE document_template_id = $document_template_id");
|
mysqli_query($mysqli,"UPDATE document_templates SET document_template_content = '$processed_content' WHERE document_template_id = $document_template_id");
|
||||||
|
|
||||||
logAction("Document Template", "Create", "$session_name created document template $name", 0, $document_template_id);
|
logAudit("Document Template", "Create", "$session_name created document template $name", 0, $document_template_id);
|
||||||
|
|
||||||
flash_alert("Document template <strong>$name</strong> created");
|
flash_alert("Document template <strong>$name</strong> created");
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ if (isset($_POST['edit_document_template'])) {
|
|||||||
// Document edit query
|
// Document edit query
|
||||||
mysqli_query($mysqli,"UPDATE document_templates SET document_template_name = '$name', document_template_description = '$description', document_template_content = '$processed_content_escaped', document_template_updated_by = $session_user_id WHERE document_template_id = $document_template_id");
|
mysqli_query($mysqli,"UPDATE document_templates SET document_template_name = '$name', document_template_description = '$description', document_template_content = '$processed_content_escaped', document_template_updated_by = $session_user_id WHERE document_template_id = $document_template_id");
|
||||||
|
|
||||||
logAction("Document Template", "Edit", "$session_name edited document template $name", 0, $document_template_id);
|
logAudit("Document Template", "Edit", "$session_name edited document template $name", 0, $document_template_id);
|
||||||
|
|
||||||
flash_alert("Document Template <strong>$name</strong> edited");
|
flash_alert("Document Template <strong>$name</strong> edited");
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ if (isset($_GET['delete_document_template'])) {
|
|||||||
// Delete uploads/document_templates/$document_template_id if exists
|
// Delete uploads/document_templates/$document_template_id if exists
|
||||||
removeDirectory($_SERVER['DOCUMENT_ROOT'] . "/uploads/document_templates/" . $document_template_id);
|
removeDirectory($_SERVER['DOCUMENT_ROOT'] . "/uploads/document_templates/" . $document_template_id);
|
||||||
|
|
||||||
logAction("Document Template", "Delete", "$session_name deleted document template $document_template_name");
|
logAudit("Document Template", "Delete", "$session_name deleted document template $document_template_name");
|
||||||
|
|
||||||
flash_alert("Document Template <strong>$document_template_name</strong> deleted", 'error');
|
flash_alert("Document Template <strong>$document_template_name</strong> deleted", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ if (isset($_POST['edit_identity_provider'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE settings SET config_azure_client_id = '$azure_client_id', config_azure_client_secret = '$azure_client_secret' WHERE company_id = 1");
|
mysqli_query($mysqli,"UPDATE settings SET config_azure_client_id = '$azure_client_id', config_azure_client_secret = '$azure_client_secret' WHERE company_id = 1");
|
||||||
|
|
||||||
logAction("Settings", "Edit", "$session_name edited identity provider settings");
|
logAudit("Settings", "Edit", "$session_name edited identity provider settings");
|
||||||
|
|
||||||
flash_alert("Identity Provider Settings updated");
|
flash_alert("Identity Provider Settings updated");
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ if (isset($_GET['send_failed_mail'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE email_queue SET email_status = 0, email_attempts = 3 WHERE email_id = $email_id");
|
mysqli_query($mysqli,"UPDATE email_queue SET email_status = 0, email_attempts = 3 WHERE email_id = $email_id");
|
||||||
|
|
||||||
logAction("Email", "Send", "$session_name attempted to force send email id: $email_id in the mail queue", 0, $email_id);
|
logAudit("Email", "Send", "$session_name attempted to force send email id: $email_id in the mail queue", 0, $email_id);
|
||||||
|
|
||||||
flash_alert("Email Force Sent, give it a minute to resend");
|
flash_alert("Email Force Sent, give it a minute to resend");
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ if (isset($_GET['cancel_mail'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE email_queue SET email_status = 2, email_attempts = 99, email_failed_at = NOW() WHERE email_id = $email_id");
|
mysqli_query($mysqli,"UPDATE email_queue SET email_status = 2, email_attempts = 99, email_failed_at = NOW() WHERE email_id = $email_id");
|
||||||
|
|
||||||
logAction("Email", "Send", "$session_name canceled send email id: $email_id in the mail queue", 0, $email_id);
|
logAudit("Email", "Send", "$session_name canceled send email id: $email_id in the mail queue", 0, $email_id);
|
||||||
|
|
||||||
flash_alert("Email cancelled and marked as failed.", 'error');
|
flash_alert("Email cancelled and marked as failed.", 'error');
|
||||||
|
|
||||||
@@ -48,11 +48,11 @@ if (isset($_POST['bulk_cancel_emails'])) {
|
|||||||
$email_id = intval($email_id);
|
$email_id = intval($email_id);
|
||||||
mysqli_query($mysqli,"UPDATE email_queue SET email_status = 2, email_attempts = 99, email_failed_at = NOW() WHERE email_id = $email_id");
|
mysqli_query($mysqli,"UPDATE email_queue SET email_status = 2, email_attempts = 99, email_failed_at = NOW() WHERE email_id = $email_id");
|
||||||
|
|
||||||
logAction("Email", "Cancel", "$session_name cancelled email id: $email_id in the mail queue", 0, $email_id);
|
logAudit("Email", "Cancel", "$session_name cancelled email id: $email_id in the mail queue", 0, $email_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Email", "Bulk Cancel", "$session_name cancelled $count email(s) in the mail queue");
|
logAudit("Email", "Bulk Cancel", "$session_name cancelled $count email(s) in the mail queue");
|
||||||
|
|
||||||
flash_alert("Cancelled <strong>$count</strong> email(s)", 'error');
|
flash_alert("Cancelled <strong>$count</strong> email(s)", 'error');
|
||||||
|
|
||||||
@@ -76,11 +76,11 @@ if (isset($_POST['bulk_delete_emails'])) {
|
|||||||
$email_id = intval($email_id);
|
$email_id = intval($email_id);
|
||||||
mysqli_query($mysqli,"DELETE FROM email_queue WHERE email_id = $email_id");
|
mysqli_query($mysqli,"DELETE FROM email_queue WHERE email_id = $email_id");
|
||||||
|
|
||||||
logAction("Email", "Delete", "$session_name deleted email id: $email_id from the mail queue");
|
logAudit("Email", "Delete", "$session_name deleted email id: $email_id from the mail queue");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Email", "Bulk Delete", "$session_name deleted $count email(s) from the mail queue");
|
logAudit("Email", "Bulk Delete", "$session_name deleted $count email(s) from the mail queue");
|
||||||
|
|
||||||
flash_alert("Deleted <strong>$count</strong> email(s)", 'error');
|
flash_alert("Deleted <strong>$count</strong> email(s)", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ if (isset($_POST['add_payment_method'])) {
|
|||||||
|
|
||||||
mysqli_stmt_execute($query);
|
mysqli_stmt_execute($query);
|
||||||
|
|
||||||
logAction("Payment Method", "Create", "$session_name created Payment Method $name");
|
logAudit("Payment Method", "Create", "$session_name created Payment Method $name");
|
||||||
|
|
||||||
flash_alert("Payment Method <strong>$name</strong> created");
|
flash_alert("Payment Method <strong>$name</strong> created");
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ if (isset($_POST['edit_payment_method'])) {
|
|||||||
|
|
||||||
mysqli_stmt_execute($query);
|
mysqli_stmt_execute($query);
|
||||||
|
|
||||||
logAction("Payment Method", "Edit", "$session_name edited Payment Method $name");
|
logAudit("Payment Method", "Edit", "$session_name edited Payment Method $name");
|
||||||
|
|
||||||
flash_alert("Payment Method <strong>$name</strong> edited");
|
flash_alert("Payment Method <strong>$name</strong> edited");
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ if (isset($_GET['delete_payment_method'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM payment_methods WHERE payment_method_id = $payment_method_id");
|
mysqli_query($mysqli,"DELETE FROM payment_methods WHERE payment_method_id = $payment_method_id");
|
||||||
|
|
||||||
logAction("Payment Method", "Delete", "$session_name deleted Payment Method $payment_method_name");
|
logAudit("Payment Method", "Delete", "$session_name deleted Payment Method $payment_method_name");
|
||||||
|
|
||||||
flash_alert("Payment Method <strong>$payment_method_name</strong> deleted", 'error');
|
flash_alert("Payment Method <strong>$payment_method_name</strong> deleted", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ if (isset($_POST['add_payment_provider'])) {
|
|||||||
|
|
||||||
$provider_id = mysqli_insert_id($mysqli);
|
$provider_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Payment Provider", "Create", "$session_name created AI Provider $provider");
|
logAudit("Payment Provider", "Create", "$session_name created AI Provider $provider");
|
||||||
|
|
||||||
flash_alert("Payment provider <strong>$provider</strong> created");
|
flash_alert("Payment provider <strong>$provider</strong> created");
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ if (isset($_POST['edit_payment_provider'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE payment_providers SET payment_provider_public_key = '$public_key', payment_provider_private_key = '$private_key', payment_provider_threshold = $threshold, payment_provider_account = $account, payment_provider_expense_vendor = $expense_vendor, payment_provider_expense_category = $expense_category, payment_provider_expense_percentage_fee = $percentage_fee, payment_provider_expense_flat_fee = $flat_fee WHERE payment_provider_id = $provider_id");
|
mysqli_query($mysqli,"UPDATE payment_providers SET payment_provider_public_key = '$public_key', payment_provider_private_key = '$private_key', payment_provider_threshold = $threshold, payment_provider_account = $account, payment_provider_expense_vendor = $expense_vendor, payment_provider_expense_category = $expense_category, payment_provider_expense_percentage_fee = $percentage_fee, payment_provider_expense_flat_fee = $flat_fee WHERE payment_provider_id = $provider_id");
|
||||||
|
|
||||||
logAction("Payment Provider", "Edit", "$session_name edited Payment Provider $provider");
|
logAudit("Payment Provider", "Edit", "$session_name edited Payment Provider $provider");
|
||||||
|
|
||||||
flash_alert("Payment Provider <strong>$provider</strong> edited");
|
flash_alert("Payment Provider <strong>$provider</strong> edited");
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ if (isset($_GET['delete_payment_provider'])) {
|
|||||||
// Delete provider
|
// Delete provider
|
||||||
mysqli_query($mysqli,"DELETE FROM payment_providers WHERE payment_provider_id = $provider_id");
|
mysqli_query($mysqli,"DELETE FROM payment_providers WHERE payment_provider_id = $provider_id");
|
||||||
|
|
||||||
logAction("Payment Provider", "Delete", "$session_name deleted Payment Provider $provider_name");
|
logAudit("Payment Provider", "Delete", "$session_name deleted Payment Provider $provider_name");
|
||||||
|
|
||||||
flash_alert("Payment Provider <strong>$provider_name</strong> deleted", 'error');
|
flash_alert("Payment Provider <strong>$provider_name</strong> deleted", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ if (isset($_POST['add_project_template'])) {
|
|||||||
|
|
||||||
$project_template_id = mysqli_insert_id($mysqli);
|
$project_template_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Project Template", "Create", "$session_name created project template $name", 0, $project_template_id);
|
logAudit("Project Template", "Create", "$session_name created project template $name", 0, $project_template_id);
|
||||||
|
|
||||||
flash_alert("Project Template <strong>$name</strong> created");
|
flash_alert("Project Template <strong>$name</strong> created");
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ if (isset($_POST['edit_project_template'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "UPDATE project_templates SET project_template_name = '$name', project_template_description = '$description' WHERE project_template_id = $project_template_id");
|
mysqli_query($mysqli, "UPDATE project_templates SET project_template_name = '$name', project_template_description = '$description' WHERE project_template_id = $project_template_id");
|
||||||
|
|
||||||
logAction("Project Template", "Edit", "$session_name edited project template $name", 0, $project_template_id);
|
logAudit("Project Template", "Edit", "$session_name edited project template $name", 0, $project_template_id);
|
||||||
|
|
||||||
flash_alert("Project Template <strong>$name</strong> edited");
|
flash_alert("Project Template <strong>$name</strong> edited");
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ if (isset($_POST['add_ticket_template_to_project_template'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "INSERT INTO project_template_ticket_templates SET project_template_id = $project_template_id, ticket_template_id = $ticket_template_id, ticket_template_order = $order");
|
mysqli_query($mysqli, "INSERT INTO project_template_ticket_templates SET project_template_id = $project_template_id, ticket_template_id = $ticket_template_id, ticket_template_order = $order");
|
||||||
|
|
||||||
logAction("Project Template", "Edit", "$session_name added ticket template to project_template", 0, $project_template_id);
|
logAudit("Project Template", "Edit", "$session_name added ticket template to project_template", 0, $project_template_id);
|
||||||
|
|
||||||
flash_alert("Ticket template added");
|
flash_alert("Ticket template added");
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ if (isset($_POST['remove_ticket_template_from_project_template'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "DELETE FROM project_template_ticket_templates WHERE project_template_id = $project_template_id AND ticket_template_id = $ticket_template_id");
|
mysqli_query($mysqli, "DELETE FROM project_template_ticket_templates WHERE project_template_id = $project_template_id AND ticket_template_id = $ticket_template_id");
|
||||||
|
|
||||||
logAction("Project Template", "Edit", "$session_name removed ticket template from project template", 0, $project_template_id);
|
logAudit("Project Template", "Edit", "$session_name removed ticket template from project template", 0, $project_template_id);
|
||||||
|
|
||||||
flash_alert("Ticket template removed", 'error');
|
flash_alert("Ticket template removed", 'error');
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ if (isset($_GET['delete_project_template'])) {
|
|||||||
// Remove Associated Ticket Templates
|
// Remove Associated Ticket Templates
|
||||||
mysqli_query($mysqli, "DELETE FROM project_template_ticket_templates WHERE project_template_id = $project_template_id");
|
mysqli_query($mysqli, "DELETE FROM project_template_ticket_templates WHERE project_template_id = $project_template_id");
|
||||||
|
|
||||||
logAction("Project Template", "Delete", "$session_name deleted project template $project_template_name and its associated ticket templates and tasks");
|
logAudit("Project Template", "Delete", "$session_name deleted project template $project_template_name and its associated ticket templates and tasks");
|
||||||
|
|
||||||
flash_alert("Project Template <strong>$project_template_name</strong> and its associated ticket templates and tasks deleted", 'error');
|
flash_alert("Project Template <strong>$project_template_name</strong> and its associated ticket templates and tasks deleted", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ if (isset($_POST['add_role'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("User Role", "Create", "$session_name created user role $name", 0, $role_id);
|
logAudit("User Role", "Create", "$session_name created user role $name", 0, $role_id);
|
||||||
|
|
||||||
flash_alert("User Role <strong>$name</strong> created");
|
flash_alert("User Role <strong>$name</strong> created");
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ if (isset($_POST['edit_role'])) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("User Role", "Edit", "$session_name edited user role $name", 0, $role_id);
|
logAudit("User Role", "Edit", "$session_name edited user role $name", 0, $role_id);
|
||||||
|
|
||||||
flash_alert("User Role <strong>$name</strong> edited");
|
flash_alert("User Role <strong>$name</strong> edited");
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ if (isset($_GET['archive_role'])) {
|
|||||||
|
|
||||||
$role_name = escapeSql(getFieldById('user_roles', $role_id, 'role_name'));
|
$role_name = escapeSql(getFieldById('user_roles', $role_id, 'role_name'));
|
||||||
|
|
||||||
logAction("User Role", "Archive", "$session_name archived user role $role_name", 0, $role_id);
|
logAudit("User Role", "Archive", "$session_name archived user role $role_name", 0, $role_id);
|
||||||
|
|
||||||
flash_alert("User Role <strong>$role_name</strong> archived", 'error');
|
flash_alert("User Role <strong>$role_name</strong> archived", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ if (isset($_GET['delete_saved_payment'])) {
|
|||||||
|
|
||||||
// SQL Cascade delete will Remove All Associated Auto Payment Methods on recurring invoices in the recurring payments table.
|
// SQL Cascade delete will Remove All Associated Auto Payment Methods on recurring invoices in the recurring payments table.
|
||||||
|
|
||||||
logAction("Payment Provider", "Update", "$session_name deleted saved payment method $saved_payment_description (PM: $payment_method)", $client_id);
|
logAudit("Payment Provider", "Update", "$session_name deleted saved payment method $saved_payment_description (PM: $payment_method)", $client_id);
|
||||||
|
|
||||||
flash_alert("Payment method <strong>$saved_payment_description</strong> removed", 'error');
|
flash_alert("Payment method <strong>$saved_payment_description</strong> removed", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ if (isset($_POST['edit_ai_settings'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE settings SET config_ai_enable = $ai_enable, config_ai_provider = '$provider', config_ai_model = '$model', config_ai_url = '$url', config_ai_api_key = '$api_key' WHERE company_id = 1");
|
mysqli_query($mysqli,"UPDATE settings SET config_ai_enable = $ai_enable, config_ai_provider = '$provider', config_ai_model = '$model', config_ai_url = '$url', config_ai_api_key = '$api_key' WHERE company_id = 1");
|
||||||
|
|
||||||
logAction("Settings", "Edit", "$session_name edited AI settings");
|
logAudit("Settings", "Edit", "$session_name edited AI settings");
|
||||||
|
|
||||||
flash_alert("AI Settings updated");
|
flash_alert("AI Settings updated");
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ if (isset($_POST['edit_company'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE companies SET company_name = '$name', company_address = '$address', company_city = '$city', company_state = '$state', company_zip = '$zip', company_country = '$country', company_phone_country_code = '$phone_country_code', company_phone = '$phone', company_email = '$email', company_website = '$website', company_tax_id = '$tax_id' WHERE company_id = 1");
|
mysqli_query($mysqli,"UPDATE companies SET company_name = '$name', company_address = '$address', company_city = '$city', company_state = '$state', company_zip = '$zip', company_country = '$country', company_phone_country_code = '$phone_country_code', company_phone = '$phone', company_email = '$email', company_website = '$website', company_tax_id = '$tax_id' WHERE company_id = 1");
|
||||||
|
|
||||||
logAction("Settings", "Edit", "$session_name edited company details");
|
logAudit("Settings", "Edit", "$session_name edited company details");
|
||||||
|
|
||||||
flash_alert("Company <strong>$name</strong> edited");
|
flash_alert("Company <strong>$name</strong> edited");
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ if (isset($_GET['remove_company_logo'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE companies SET company_logo = NULL WHERE company_id = 1");
|
mysqli_query($mysqli,"UPDATE companies SET company_logo = NULL WHERE company_id = 1");
|
||||||
|
|
||||||
logAction("Settings", "Edit", "$session_name deleted company logo");
|
logAudit("Settings", "Edit", "$session_name deleted company logo");
|
||||||
|
|
||||||
flash_alert("Removed company logo", 'error');
|
flash_alert("Removed company logo", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ if (isset($_POST['edit_default_settings'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE settings SET config_start_page = '$start_page', config_default_expense_account = $expense_account, config_default_payment_account = $payment_account, config_default_payment_method = '$payment_method', config_default_expense_payment_method = '$expense_payment_method', config_default_transfer_from_account = $transfer_from_account, config_default_transfer_to_account = $transfer_to_account, config_default_calendar = $calendar, config_default_net_terms = $net_terms, config_default_hourly_rate = $hourly_rate WHERE company_id = 1");
|
mysqli_query($mysqli,"UPDATE settings SET config_start_page = '$start_page', config_default_expense_account = $expense_account, config_default_payment_account = $payment_account, config_default_payment_method = '$payment_method', config_default_expense_payment_method = '$expense_payment_method', config_default_transfer_from_account = $transfer_from_account, config_default_transfer_to_account = $transfer_to_account, config_default_calendar = $calendar, config_default_net_terms = $net_terms, config_default_hourly_rate = $hourly_rate WHERE company_id = 1");
|
||||||
|
|
||||||
logAction("Settings", "Edit", "$session_name edited default settings");
|
logAudit("Settings", "Edit", "$session_name edited default settings");
|
||||||
|
|
||||||
flash_alert("Default settings edited");
|
flash_alert("Default settings edited");
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ if (isset($_POST['edit_invoice_settings'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE settings SET config_invoice_prefix = '$config_invoice_prefix', config_invoice_next_number = $config_invoice_next_number, config_invoice_footer = '$config_invoice_footer', config_invoice_show_tax_id = $config_invoice_show_tax_id, config_invoice_late_fee_enable = $config_invoice_late_fee_enable, config_invoice_late_fee_percent = $config_invoice_late_fee_percent, config_invoice_paid_notification_email = '$config_invoice_paid_notification_email', config_recurring_invoice_prefix = '$config_recurring_invoice_prefix', config_recurring_invoice_next_number = $config_recurring_invoice_next_number WHERE company_id = 1");
|
mysqli_query($mysqli,"UPDATE settings SET config_invoice_prefix = '$config_invoice_prefix', config_invoice_next_number = $config_invoice_next_number, config_invoice_footer = '$config_invoice_footer', config_invoice_show_tax_id = $config_invoice_show_tax_id, config_invoice_late_fee_enable = $config_invoice_late_fee_enable, config_invoice_late_fee_percent = $config_invoice_late_fee_percent, config_invoice_paid_notification_email = '$config_invoice_paid_notification_email', config_recurring_invoice_prefix = '$config_recurring_invoice_prefix', config_recurring_invoice_next_number = $config_recurring_invoice_next_number WHERE company_id = 1");
|
||||||
|
|
||||||
logAction("Settings", "Edit", "$session_name edited invoice settings");
|
logAudit("Settings", "Edit", "$session_name edited invoice settings");
|
||||||
|
|
||||||
flash_alert("Invoice Settings edited");
|
flash_alert("Invoice Settings edited");
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ if (isset($_POST['edit_localization'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE settings SET config_timezone = '$timezone' WHERE company_id = 1");
|
mysqli_query($mysqli,"UPDATE settings SET config_timezone = '$timezone' WHERE company_id = 1");
|
||||||
|
|
||||||
logAction("Settings", "Edit", "$session_name edited localization settings");
|
logAudit("Settings", "Edit", "$session_name edited localization settings");
|
||||||
|
|
||||||
flash_alert("Company localization updated");
|
flash_alert("Company localization updated");
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ if (isset($_POST['oauth_connect_microsoft_mail'])) {
|
|||||||
'prompt' => 'consent',
|
'prompt' => 'consent',
|
||||||
], '', '&', PHP_QUERY_RFC3986);
|
], '', '&', PHP_QUERY_RFC3986);
|
||||||
|
|
||||||
logAction("Settings", "Edit", "$session_name started Microsoft OAuth connect flow for mail settings");
|
logAudit("Settings", "Edit", "$session_name started Microsoft OAuth connect flow for mail settings");
|
||||||
|
|
||||||
redirect($authorize_url);
|
redirect($authorize_url);
|
||||||
}
|
}
|
||||||
@@ -95,7 +95,7 @@ if (isset($_POST['edit_mail_smtp_settings'])) {
|
|||||||
WHERE company_id = 1
|
WHERE company_id = 1
|
||||||
");
|
");
|
||||||
|
|
||||||
logAction("Settings", "Edit", "$session_name edited SMTP settings");
|
logAudit("Settings", "Edit", "$session_name edited SMTP settings");
|
||||||
|
|
||||||
flash_alert("SMTP Mail Settings updated");
|
flash_alert("SMTP Mail Settings updated");
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ if (isset($_POST['edit_mail_imap_settings'])) {
|
|||||||
WHERE company_id = 1
|
WHERE company_id = 1
|
||||||
");
|
");
|
||||||
|
|
||||||
logAction("Settings", "Edit", "$session_name edited IMAP settings");
|
logAudit("Settings", "Edit", "$session_name edited IMAP settings");
|
||||||
|
|
||||||
flash_alert("IMAP Mail Settings updated");
|
flash_alert("IMAP Mail Settings updated");
|
||||||
|
|
||||||
@@ -152,7 +152,7 @@ if (isset($_POST['edit_mail_oauth_settings'])) {
|
|||||||
WHERE company_id = 1
|
WHERE company_id = 1
|
||||||
");
|
");
|
||||||
|
|
||||||
logAction("Settings", "Edit", "$session_name edited mail OAuth settings");
|
logAudit("Settings", "Edit", "$session_name edited mail OAuth settings");
|
||||||
flash_alert("Mail OAuth Settings updated");
|
flash_alert("Mail OAuth Settings updated");
|
||||||
redirect();
|
redirect();
|
||||||
}
|
}
|
||||||
@@ -175,7 +175,7 @@ if (isset($_POST['edit_mail_from_settings'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE settings SET config_mail_from_email = '$config_mail_from_email', config_mail_from_name = '$config_mail_from_name', config_invoice_from_email = '$config_invoice_from_email', config_invoice_from_name = '$config_invoice_from_name', config_quote_from_email = '$config_quote_from_email', config_quote_from_name = '$config_quote_from_name', config_ticket_from_email = '$config_ticket_from_email', config_ticket_from_name = '$config_ticket_from_name' WHERE company_id = 1");
|
mysqli_query($mysqli,"UPDATE settings SET config_mail_from_email = '$config_mail_from_email', config_mail_from_name = '$config_mail_from_name', config_invoice_from_email = '$config_invoice_from_email', config_invoice_from_name = '$config_invoice_from_name', config_quote_from_email = '$config_quote_from_email', config_quote_from_name = '$config_quote_from_name', config_ticket_from_email = '$config_ticket_from_email', config_ticket_from_name = '$config_ticket_from_name' WHERE company_id = 1");
|
||||||
|
|
||||||
logAction("Settings", "Edit", "$session_name edited mail from settings");
|
logAudit("Settings", "Edit", "$session_name edited mail from settings");
|
||||||
|
|
||||||
flash_alert("Mail From Settings updated");
|
flash_alert("Mail From Settings updated");
|
||||||
|
|
||||||
@@ -573,7 +573,7 @@ if (isset($_POST['test_oauth_token_refresh'])) {
|
|||||||
mysqli_query($mysqli, "UPDATE settings SET config_mail_oauth_access_token = '$new_access_token_esc', config_mail_oauth_access_token_expires_at = '$new_expires_at_esc'$refresh_sql WHERE company_id = 1");
|
mysqli_query($mysqli, "UPDATE settings SET config_mail_oauth_access_token = '$new_access_token_esc', config_mail_oauth_access_token_expires_at = '$new_expires_at_esc'$refresh_sql WHERE company_id = 1");
|
||||||
|
|
||||||
$provider_label = $provider === 'microsoft_oauth' ? 'Microsoft 365' : 'Google Workspace';
|
$provider_label = $provider === 'microsoft_oauth' ? 'Microsoft 365' : 'Google Workspace';
|
||||||
logAction("Settings", "Edit", "$session_name tested OAuth token refresh for $provider_label mail settings");
|
logAudit("Settings", "Edit", "$session_name tested OAuth token refresh for $provider_label mail settings");
|
||||||
|
|
||||||
flash_alert("OAuth token refresh successful for $provider_label. Access token expires at $new_expires_at.");
|
flash_alert("OAuth token refresh successful for $provider_label. Access token expires at $new_expires_at.");
|
||||||
redirect();
|
redirect();
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ if (isset($_POST['edit_module_settings'])) {
|
|||||||
mysqli_query($mysqli, "UPDATE settings SET config_whitelabel_enabled = 0, config_whitelabel_key = '' WHERE company_id = 1");
|
mysqli_query($mysqli, "UPDATE settings SET config_whitelabel_enabled = 0, config_whitelabel_key = '' WHERE company_id = 1");
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Settings", "Edit", "$session_name edited module settings");
|
logAudit("Settings", "Edit", "$session_name edited module settings");
|
||||||
|
|
||||||
flash_alert("Module Settings updated");
|
flash_alert("Module Settings updated");
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ if (isset($_POST['edit_notification_settings'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE settings SET config_send_invoice_reminders = $config_send_invoice_reminders, config_recurring_auto_send_invoice = $config_recurring_auto_send_invoice, config_enable_cron = $config_enable_cron, config_enable_alert_domain_expire = $config_enable_alert_domain_expire, config_ticket_client_general_notifications = $config_ticket_client_general_notifications WHERE company_id = 1");
|
mysqli_query($mysqli,"UPDATE settings SET config_send_invoice_reminders = $config_send_invoice_reminders, config_recurring_auto_send_invoice = $config_recurring_auto_send_invoice, config_enable_cron = $config_enable_cron, config_enable_alert_domain_expire = $config_enable_alert_domain_expire, config_ticket_client_general_notifications = $config_ticket_client_general_notifications WHERE company_id = 1");
|
||||||
|
|
||||||
logAction("Settings", "Edit", "$session_name edited notification settings");
|
logAudit("Settings", "Edit", "$session_name edited notification settings");
|
||||||
|
|
||||||
flash_alert("Notification Settings updated");
|
flash_alert("Notification Settings updated");
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ if (isset($_POST['edit_online_payment_settings'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE settings SET config_stripe_enable = $config_stripe_enable, config_stripe_publishable = '$config_stripe_publishable', config_stripe_secret = '$config_stripe_secret', config_stripe_account = $config_stripe_account, config_stripe_expense_vendor = $config_stripe_expense_vendor, config_stripe_expense_category = $config_stripe_expense_category, config_stripe_percentage_fee = $config_stripe_percentage_fee, config_stripe_flat_fee = $config_stripe_flat_fee WHERE company_id = 1");
|
mysqli_query($mysqli,"UPDATE settings SET config_stripe_enable = $config_stripe_enable, config_stripe_publishable = '$config_stripe_publishable', config_stripe_secret = '$config_stripe_secret', config_stripe_account = $config_stripe_account, config_stripe_expense_vendor = $config_stripe_expense_vendor, config_stripe_expense_category = $config_stripe_expense_category, config_stripe_percentage_fee = $config_stripe_percentage_fee, config_stripe_flat_fee = $config_stripe_flat_fee WHERE company_id = 1");
|
||||||
|
|
||||||
logAction("Settings", "Edit", "$session_name edited online payment settings");
|
logAudit("Settings", "Edit", "$session_name edited online payment settings");
|
||||||
|
|
||||||
if ($config_stripe_enable && $config_stripe_account == 0) {
|
if ($config_stripe_enable && $config_stripe_account == 0) {
|
||||||
flash_alert("Stripe payment account must be specified!", 'error');
|
flash_alert("Stripe payment account must be specified!", 'error');
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ if (isset($_GET['stripe_remove_pm'])) {
|
|||||||
mysqli_query($mysqli, "DELETE FROM recurring_payments WHERE recurring_payment_method = 'Stripe' AND recurring_payment_recurring_invoice_id = $recurring_invoice_id");
|
mysqli_query($mysqli, "DELETE FROM recurring_payments WHERE recurring_payment_method = 'Stripe' AND recurring_payment_recurring_invoice_id = $recurring_invoice_id");
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Stripe", "Update", "$session_name deleted saved Stripe payment method (PM: $payment_method)", $client_id);
|
logAudit("Stripe", "Update", "$session_name deleted saved Stripe payment method (PM: $payment_method)", $client_id);
|
||||||
|
|
||||||
flash_alert("Payment method removed", 'error');
|
flash_alert("Payment method removed", 'error');
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ if (isset($_GET['stripe_reset_customer'])) {
|
|||||||
mysqli_query($mysqli, "DELETE FROM recurring_payments WHERE recurring_payment_method = 'Stripe' AND recurring_payment_recurring_invoice_id = $recurring_invoice_id");
|
mysqli_query($mysqli, "DELETE FROM recurring_payments WHERE recurring_payment_method = 'Stripe' AND recurring_payment_recurring_invoice_id = $recurring_invoice_id");
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Stripe", "Delete", "$session_name reset Stripe settings for client", $client_id);
|
logAudit("Stripe", "Delete", "$session_name reset Stripe settings for client", $client_id);
|
||||||
|
|
||||||
flash_alert("Reset client Stripe settings", 'error');
|
flash_alert("Reset client Stripe settings", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ if (isset($_POST['edit_project_settings'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE settings SET config_project_prefix = '$config_project_prefix', config_project_next_number = $config_project_next_number WHERE company_id = 1");
|
mysqli_query($mysqli,"UPDATE settings SET config_project_prefix = '$config_project_prefix', config_project_next_number = $config_project_next_number WHERE company_id = 1");
|
||||||
|
|
||||||
logAction("Settings", "Edit", "$session_name edited project settings");
|
logAudit("Settings", "Edit", "$session_name edited project settings");
|
||||||
|
|
||||||
flash_alert("Project Settings updated");
|
flash_alert("Project Settings updated");
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ if (isset($_POST['edit_quote_settings'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE settings SET config_quote_prefix = '$config_quote_prefix', config_quote_next_number = $config_quote_next_number, config_quote_footer = '$config_quote_footer', config_quote_notification_email = '$config_quote_notification_email' WHERE company_id = 1");
|
mysqli_query($mysqli,"UPDATE settings SET config_quote_prefix = '$config_quote_prefix', config_quote_next_number = $config_quote_next_number, config_quote_footer = '$config_quote_footer', config_quote_notification_email = '$config_quote_notification_email' WHERE company_id = 1");
|
||||||
|
|
||||||
logAction("Settings", "Edit", "$session_name edited Quote settings");
|
logAudit("Settings", "Edit", "$session_name edited Quote settings");
|
||||||
|
|
||||||
flash_alert("Quote Settings updated");
|
flash_alert("Quote Settings updated");
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ if (isset($_POST['edit_security_settings'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE settings SET config_login_message = '$config_login_message', config_login_key_required = '$config_login_key_required', config_login_key_secret = '$config_login_key_secret', config_login_remember_me_expire = $config_login_remember_me_expire, config_log_retention = $config_log_retention WHERE company_id = 1");
|
mysqli_query($mysqli,"UPDATE settings SET config_login_message = '$config_login_message', config_login_key_required = '$config_login_key_required', config_login_key_secret = '$config_login_key_secret', config_login_remember_me_expire = $config_login_remember_me_expire, config_log_retention = $config_log_retention WHERE company_id = 1");
|
||||||
|
|
||||||
logAction("Settings", "Edit", "$session_name edited security settings");
|
logAudit("Settings", "Edit", "$session_name edited security settings");
|
||||||
|
|
||||||
flash_alert("Security settings updated");
|
flash_alert("Security settings updated");
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ if (isset($_POST['edit_telemetry_settings'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE settings SET config_telemetry = $config_telemetry WHERE company_id = 1");
|
mysqli_query($mysqli,"UPDATE settings SET config_telemetry = $config_telemetry WHERE company_id = 1");
|
||||||
|
|
||||||
logAction("Settings", "Edit", "$session_name edited telemetry settings");
|
logAudit("Settings", "Edit", "$session_name edited telemetry settings");
|
||||||
|
|
||||||
flash_alert("Telemetry Settings updated");
|
flash_alert("Telemetry Settings updated");
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ if (isset($_POST['edit_theme_settings'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE settings SET config_theme = '$theme' WHERE company_id = 1");
|
mysqli_query($mysqli,"UPDATE settings SET config_theme = '$theme' WHERE company_id = 1");
|
||||||
|
|
||||||
logAction("Settings", "Edit", "$session_name edited theme settings $dark_mode");
|
logAudit("Settings", "Edit", "$session_name edited theme settings $dark_mode");
|
||||||
|
|
||||||
flash_alert("Changed theme to <strong>$theme</strong>");
|
flash_alert("Changed theme to <strong>$theme</strong>");
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ if (isset($_POST['edit_favicon_settings'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Settings", "Edit", "$session_name changed the favicon");
|
logAudit("Settings", "Edit", "$session_name changed the favicon");
|
||||||
|
|
||||||
flash_alert("Favicon Updated");
|
flash_alert("Favicon Updated");
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ if (isset($_GET['reset_favicon'])) {
|
|||||||
unlink("../uploads/favicon.ico");
|
unlink("../uploads/favicon.ico");
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Settings", "Edit", "$session_name reset Favicon");
|
logAudit("Settings", "Edit", "$session_name reset Favicon");
|
||||||
|
|
||||||
flash_alert("Favicon reset", 'error');
|
flash_alert("Favicon reset", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ if (isset($_POST['edit_ticket_settings'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE settings SET config_ticket_prefix = '$config_ticket_prefix', config_ticket_next_number = $config_ticket_next_number, config_ticket_email_parse = $config_ticket_email_parse, config_ticket_email_parse_unknown_senders = $config_ticket_email_parse_unknown_senders, config_ticket_autoclose_hours = $config_ticket_autoclose_hours, config_ticket_new_ticket_notification_email = '$config_ticket_new_ticket_notification_email', config_ticket_default_billable = $config_ticket_default_billable, config_ticket_default_view = $config_ticket_default_view, config_ticket_moving_columns = $config_ticket_moving_columns, config_ticket_ordering = $config_ticket_ordering, config_ticket_timer_autostart = $config_ticket_timer_autostart WHERE company_id = 1");
|
mysqli_query($mysqli,"UPDATE settings SET config_ticket_prefix = '$config_ticket_prefix', config_ticket_next_number = $config_ticket_next_number, config_ticket_email_parse = $config_ticket_email_parse, config_ticket_email_parse_unknown_senders = $config_ticket_email_parse_unknown_senders, config_ticket_autoclose_hours = $config_ticket_autoclose_hours, config_ticket_new_ticket_notification_email = '$config_ticket_new_ticket_notification_email', config_ticket_default_billable = $config_ticket_default_billable, config_ticket_default_view = $config_ticket_default_view, config_ticket_moving_columns = $config_ticket_moving_columns, config_ticket_ordering = $config_ticket_ordering, config_ticket_timer_autostart = $config_ticket_timer_autostart WHERE company_id = 1");
|
||||||
|
|
||||||
logAction("Settings", "Edit", "$session_name edited ticket settings");
|
logAudit("Settings", "Edit", "$session_name edited ticket settings");
|
||||||
|
|
||||||
flash_alert("Ticket Settings updated");
|
flash_alert("Ticket Settings updated");
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ if (isset($_POST['add_software_template'])) {
|
|||||||
|
|
||||||
$software_template_id = mysqli_insert_id($mysqli);
|
$software_template_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Software Template", "Create", "$session_name created software template $name", 0, $software_template_id);
|
logAudit("Software Template", "Create", "$session_name created software template $name", 0, $software_template_id);
|
||||||
|
|
||||||
flash_alert("Software template <strong>$name</strong> created");
|
flash_alert("Software template <strong>$name</strong> created");
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ if (isset($_POST['edit_software_template'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE software_templates SET software_template_name = '$name', software_template_version = '$version', software_template_description = '$description', software_template_type = '$type', software_template_license_type = '$license_type', software_template_notes = '$notes' WHERE software_template_id = $software_template_id");
|
mysqli_query($mysqli,"UPDATE software_templates SET software_template_name = '$name', software_template_version = '$version', software_template_description = '$description', software_template_type = '$type', software_template_license_type = '$license_type', software_template_notes = '$notes' WHERE software_template_id = $software_template_id");
|
||||||
|
|
||||||
logAction("Software Template", "Edit", "$session_name edited software template $name", 0, $software_template_id);
|
logAudit("Software Template", "Edit", "$session_name edited software template $name", 0, $software_template_id);
|
||||||
|
|
||||||
flash_alert("Software template <strong>$name</strong> edited");
|
flash_alert("Software template <strong>$name</strong> edited");
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ if (isset($_GET['delete_software_template'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM software_templates WHERE software_template_id = $software_template_id");
|
mysqli_query($mysqli,"DELETE FROM software_templates WHERE software_template_id = $software_template_id");
|
||||||
|
|
||||||
logAction("Software Template", "Delete", "$session_name deleted software template $software_template_name");
|
logAudit("Software Template", "Delete", "$session_name deleted software template $software_template_name");
|
||||||
|
|
||||||
flash_alert("Software Template <strong>$software_template_name</strong> deleted", 'error');
|
flash_alert("Software Template <strong>$software_template_name</strong> deleted", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ if (isset($_POST['add_tag'])) {
|
|||||||
|
|
||||||
$tag_id = mysqli_insert_id($mysqli);
|
$tag_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Tag", "Create", "$session_name created tag $name", 0, $tag_id);
|
logAudit("Tag", "Create", "$session_name created tag $name", 0, $tag_id);
|
||||||
|
|
||||||
flash_alert("Tag <strong>$name</strong> created");
|
flash_alert("Tag <strong>$name</strong> created");
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ if (isset($_POST['edit_tag'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE tags SET tag_name = '$name', tag_color = '$color', tag_icon = '$icon' WHERE tag_id = $tag_id");
|
mysqli_query($mysqli,"UPDATE tags SET tag_name = '$name', tag_color = '$color', tag_icon = '$icon' WHERE tag_id = $tag_id");
|
||||||
|
|
||||||
logAction("Tag", "Edit", "$session_name edited tag $name", 0, $tag_id);
|
logAudit("Tag", "Edit", "$session_name edited tag $name", 0, $tag_id);
|
||||||
|
|
||||||
flash_alert("Tag <strong>$name</strong> edited");
|
flash_alert("Tag <strong>$name</strong> edited");
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ if (isset($_GET['delete_tag'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM tags WHERE tag_id = $tag_id");
|
mysqli_query($mysqli,"DELETE FROM tags WHERE tag_id = $tag_id");
|
||||||
|
|
||||||
logAction("Tag", "Delete", "$session_name deleted tag $tag_name");
|
logAudit("Tag", "Delete", "$session_name deleted tag $tag_name");
|
||||||
|
|
||||||
flash_alert("Tag <strong>$tag_name</strong> deleted", 'error');
|
flash_alert("Tag <strong>$tag_name</strong> deleted", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ if (isset($_POST['add_tax'])) {
|
|||||||
|
|
||||||
$tax_id = mysqli_insert_id($mysqli);
|
$tax_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Tax", "Create", "$session_name created tax $name - $percent%", 0, $tax_id);
|
logAudit("Tax", "Create", "$session_name created tax $name - $percent%", 0, $tax_id);
|
||||||
|
|
||||||
flash_alert("Tax <strong>$name</strong> ($percent%) created");
|
flash_alert("Tax <strong>$name</strong> ($percent%) created");
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ if (isset($_POST['edit_tax'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE taxes SET tax_name = '$name', tax_percent = $percent WHERE tax_id = $tax_id");
|
mysqli_query($mysqli,"UPDATE taxes SET tax_name = '$name', tax_percent = $percent WHERE tax_id = $tax_id");
|
||||||
|
|
||||||
logAction("Tax", "Edit", "$session_name edited tax $name - $percent%", 0, $tax_id);
|
logAudit("Tax", "Edit", "$session_name edited tax $name - $percent%", 0, $tax_id);
|
||||||
|
|
||||||
flash_alert("Tax <strong>$name</strong> ($percent%) edited");
|
flash_alert("Tax <strong>$name</strong> ($percent%) edited");
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ if (isset($_GET['archive_tax'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE taxes SET tax_archived_at = NOW() WHERE tax_id = $tax_id");
|
mysqli_query($mysqli,"UPDATE taxes SET tax_archived_at = NOW() WHERE tax_id = $tax_id");
|
||||||
|
|
||||||
logAction("Tax", "Archive", "$session_name archived tax $tax_name", 0, $tax_id);
|
logAudit("Tax", "Archive", "$session_name archived tax $tax_name", 0, $tax_id);
|
||||||
|
|
||||||
flash_alert("Tax <strong>$tax_name</strong> Archived", 'error');
|
flash_alert("Tax <strong>$tax_name</strong> Archived", 'error');
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ if (isset($_GET['delete_tax'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM taxes WHERE tax_id = $tax_id");
|
mysqli_query($mysqli,"DELETE FROM taxes WHERE tax_id = $tax_id");
|
||||||
|
|
||||||
logAction("Tax", "Delete", "$session_name deleted tax $tax_name");
|
logAudit("Tax", "Delete", "$session_name deleted tax $tax_name");
|
||||||
|
|
||||||
flash_alert("Tax <strong>$tax_name</strong> deleted", 'error');
|
flash_alert("Tax <strong>$tax_name</strong> deleted", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ if (isset($_POST['add_ticket_status'])) {
|
|||||||
|
|
||||||
$ticket_status_id = mysqli_insert_id($mysqli);
|
$ticket_status_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Ticket Status", "Create", "$session_name created custom ticket status $name", 0, $ticket_status_id);
|
logAudit("Ticket Status", "Create", "$session_name created custom ticket status $name", 0, $ticket_status_id);
|
||||||
|
|
||||||
flash_alert("Custom Ticket Status <strong>$name</strong> created");
|
flash_alert("Custom Ticket Status <strong>$name</strong> created");
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ if (isset($_POST['edit_ticket_status'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "UPDATE ticket_statuses SET ticket_status_name = '$name', ticket_status_color = '$color', ticket_status_order = $order, ticket_status_active = $status WHERE ticket_status_id = $ticket_status_id");
|
mysqli_query($mysqli, "UPDATE ticket_statuses SET ticket_status_name = '$name', ticket_status_color = '$color', ticket_status_order = $order, ticket_status_active = $status WHERE ticket_status_id = $ticket_status_id");
|
||||||
|
|
||||||
logAction("Ticket Status", "Edit", "$session_name edited custom ticket status $name", 0, $ticket_status_id);
|
logAudit("Ticket Status", "Edit", "$session_name edited custom ticket status $name", 0, $ticket_status_id);
|
||||||
|
|
||||||
flash_alert("Custom Ticket Status <strong>$name</strong> edited");
|
flash_alert("Custom Ticket Status <strong>$name</strong> edited");
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ if (isset($_GET['delete_ticket_status'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "DELETE FROM ticket_statuses WHERE ticket_status_id = $ticket_status_id");
|
mysqli_query($mysqli, "DELETE FROM ticket_statuses WHERE ticket_status_id = $ticket_status_id");
|
||||||
|
|
||||||
logAction("Ticket Status", "Delete", "$session_name deleted custom ticket status $ticket_status_name");
|
logAudit("Ticket Status", "Delete", "$session_name deleted custom ticket status $ticket_status_name");
|
||||||
|
|
||||||
flash_alert("Custom Ticket Status <strong>$ticket_status_name</strong> Deleted", 'error');
|
flash_alert("Custom Ticket Status <strong>$ticket_status_name</strong> Deleted", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ if (isset($_POST['add_ticket_template'])) {
|
|||||||
mysqli_query($mysqli, "INSERT INTO project_template_ticket_templates SET project_template_id = $project_template_id, ticket_template_id = $ticket_template_id");
|
mysqli_query($mysqli, "INSERT INTO project_template_ticket_templates SET project_template_id = $project_template_id, ticket_template_id = $ticket_template_id");
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Ticket Template", "Create", "$session_name created ticket template $name", 0, $ticket_template_id);
|
logAudit("Ticket Template", "Create", "$session_name created ticket template $name", 0, $ticket_template_id);
|
||||||
|
|
||||||
flash_alert("Ticket Template <strong>$name</strong> created");
|
flash_alert("Ticket Template <strong>$name</strong> created");
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ if (isset($_POST['edit_ticket_template'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "UPDATE ticket_templates SET ticket_template_name = '$name', ticket_template_description = '$description', ticket_template_subject = '$subject', ticket_template_details = '$details' WHERE ticket_template_id = $ticket_template_id");
|
mysqli_query($mysqli, "UPDATE ticket_templates SET ticket_template_name = '$name', ticket_template_description = '$description', ticket_template_subject = '$subject', ticket_template_details = '$details' WHERE ticket_template_id = $ticket_template_id");
|
||||||
|
|
||||||
logAction("Ticket Template", "Edit", "$session_name edited ticket template $name", 0, $ticket_template_id);
|
logAudit("Ticket Template", "Edit", "$session_name edited ticket template $name", 0, $ticket_template_id);
|
||||||
|
|
||||||
flash_alert("Ticket Template <strong>$name</strong> edited");
|
flash_alert("Ticket Template <strong>$name</strong> edited");
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ if (isset($_GET['delete_ticket_template'])) {
|
|||||||
mysqli_query($mysqli, "DELETE FROM task_templates WHERE task_template_ticket_template_id = $ticket_template_id");
|
mysqli_query($mysqli, "DELETE FROM task_templates WHERE task_template_ticket_template_id = $ticket_template_id");
|
||||||
mysqli_query($mysqli, "DELETE FROM project_template_ticket_templates WHERE ticket_template_id = $ticket_template_id");
|
mysqli_query($mysqli, "DELETE FROM project_template_ticket_templates WHERE ticket_template_id = $ticket_template_id");
|
||||||
|
|
||||||
logAction("Ticket Template", "Delete", "$session_name deleted ticket template $ticket_template_name");
|
logAudit("Ticket Template", "Delete", "$session_name deleted ticket template $ticket_template_name");
|
||||||
|
|
||||||
flash_alert("Ticket Template <strong>$ticket_template_name</strong> and its associated tasks deleted", 'error');
|
flash_alert("Ticket Template <strong>$ticket_template_name</strong> and its associated tasks deleted", 'error');
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ if (isset($_POST['add_ticket_template_task'])) {
|
|||||||
|
|
||||||
$task_template_id = mysqli_insert_id($mysqli);
|
$task_template_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Ticket Template", "Create", "$session_name created task $task_name for ticket template", 0, $ticket_template_id);
|
logAudit("Ticket Template", "Create", "$session_name created task $task_name for ticket template", 0, $ticket_template_id);
|
||||||
|
|
||||||
flash_alert("Added Task <strong>$task_name</strong>");
|
flash_alert("Added Task <strong>$task_name</strong>");
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ if (isset($_GET['delete_task_template'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "DELETE FROM task_templates WHERE task_template_id = $task_template_id");
|
mysqli_query($mysqli, "DELETE FROM task_templates WHERE task_template_id = $task_template_id");
|
||||||
|
|
||||||
logAction("Ticket Template", "Edit", "$session_name deleted task $task_template_name from ticket template");
|
logAudit("Ticket Template", "Edit", "$session_name deleted task $task_template_name from ticket template");
|
||||||
|
|
||||||
flash_alert("Task <strong>$task_template_name</strong> deleted", 'error');
|
flash_alert("Task <strong>$task_template_name</strong> deleted", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -272,7 +272,7 @@ if (isset($_GET['update'])) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("App", "Update", "$session_name ran updates");
|
logAudit("App", "Update", "$session_name ran updates");
|
||||||
|
|
||||||
flash_alert("Update successful");
|
flash_alert("Update successful");
|
||||||
|
|
||||||
@@ -290,7 +290,7 @@ if (isset($_GET['update_db'])) {
|
|||||||
// Perform upgrades, if required
|
// Perform upgrades, if required
|
||||||
require_once ('database_updates.php');
|
require_once ('database_updates.php');
|
||||||
|
|
||||||
logAction("Database", "Update", "$session_name updated the database structure");
|
logAudit("Database", "Update", "$session_name updated the database structure");
|
||||||
|
|
||||||
flash_alert("Database structure update successful");
|
flash_alert("Database structure update successful");
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ if (isset($_POST['add_user'])) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("User", "Create", "$session_name created user $name", 0, $user_id);
|
logAudit("User", "Create", "$session_name created user $name", 0, $user_id);
|
||||||
|
|
||||||
flash_alert("User <strong>$name</strong> created" . $extended_alert_description);
|
flash_alert("User <strong>$name</strong> created" . $extended_alert_description);
|
||||||
|
|
||||||
@@ -170,7 +170,7 @@ if (isset($_POST['edit_user'])) {
|
|||||||
//Update User Settings
|
//Update User Settings
|
||||||
mysqli_query($mysqli, "UPDATE user_settings SET user_config_force_mfa = $force_mfa WHERE user_id = $user_id");
|
mysqli_query($mysqli, "UPDATE user_settings SET user_config_force_mfa = $force_mfa WHERE user_id = $user_id");
|
||||||
|
|
||||||
logAction("User", "Edit", "$session_name edited user $name", 0, $user_id);
|
logAudit("User", "Edit", "$session_name edited user $name", 0, $user_id);
|
||||||
|
|
||||||
flash_alert("User <strong>$name</strong> updated" . $extended_alert_description);
|
flash_alert("User <strong>$name</strong> updated" . $extended_alert_description);
|
||||||
|
|
||||||
@@ -188,7 +188,7 @@ if (isset($_GET['activate_user'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "UPDATE users SET user_status = 1 WHERE user_id = $user_id");
|
mysqli_query($mysqli, "UPDATE users SET user_status = 1 WHERE user_id = $user_id");
|
||||||
|
|
||||||
logAction("User", "Activate", "$session_name activated user $user_name", 0, $user_id);
|
logAudit("User", "Activate", "$session_name activated user $user_name", 0, $user_id);
|
||||||
|
|
||||||
flash_alert("User <strong>$user_name</strong> activated");
|
flash_alert("User <strong>$user_name</strong> activated");
|
||||||
|
|
||||||
@@ -210,7 +210,7 @@ if (isset($_GET['disable_user'])) {
|
|||||||
mysqli_query($mysqli, "UPDATE tickets SET ticket_assigned_to = 0 WHERE ticket_assigned_to = $user_id AND ticket_closed_at IS NULL");
|
mysqli_query($mysqli, "UPDATE tickets SET ticket_assigned_to = 0 WHERE ticket_assigned_to = $user_id AND ticket_closed_at IS NULL");
|
||||||
mysqli_query($mysqli, "UPDATE recurring_tickets SET recurring_ticket_assigned_to = 0 WHERE recurring_ticket_assigned_to = $user_id");
|
mysqli_query($mysqli, "UPDATE recurring_tickets SET recurring_ticket_assigned_to = 0 WHERE recurring_ticket_assigned_to = $user_id");
|
||||||
|
|
||||||
logAction("User", "Disable", "$session_name disabled user $name", 0, $user_id);
|
logAudit("User", "Disable", "$session_name disabled user $name", 0, $user_id);
|
||||||
|
|
||||||
flash_alert("User <strong>$user_name</strong> disabled", 'error');
|
flash_alert("User <strong>$user_name</strong> disabled", 'error');
|
||||||
|
|
||||||
@@ -228,7 +228,7 @@ if (isset($_GET['revoke_remember_me'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "DELETE FROM remember_tokens WHERE remember_token_user_id = $user_id");
|
mysqli_query($mysqli, "DELETE FROM remember_tokens WHERE remember_token_user_id = $user_id");
|
||||||
|
|
||||||
logAction("User", "Edit", "$session_name revoked all remember me tokens for user $user_name", 0, $user_id);
|
logAudit("User", "Edit", "$session_name revoked all remember me tokens for user $user_name", 0, $user_id);
|
||||||
|
|
||||||
flash_alert("User <strong>$user_name</strong> remember me tokens revoked", 'error');
|
flash_alert("User <strong>$user_name</strong> remember me tokens revoked", 'error');
|
||||||
|
|
||||||
@@ -253,7 +253,7 @@ if (isset($_POST['archive_user'])) {
|
|||||||
// Archive user query
|
// Archive user query
|
||||||
mysqli_query($mysqli, "UPDATE users SET user_name = '$user_name (archived)', user_password = '$password', user_status = 0, user_specific_encryption_ciphertext = '', user_archived_at = NOW() WHERE user_id = $user_id");
|
mysqli_query($mysqli, "UPDATE users SET user_name = '$user_name (archived)', user_password = '$password', user_status = 0, user_specific_encryption_ciphertext = '', user_archived_at = NOW() WHERE user_id = $user_id");
|
||||||
|
|
||||||
logAction("User", "Archive", "$session_name archived user $user_name", 0, $user_id);
|
logAudit("User", "Archive", "$session_name archived user $user_name", 0, $user_id);
|
||||||
|
|
||||||
flash_alert("User <strong>$user_name</strong> archived", 'error');
|
flash_alert("User <strong>$user_name</strong> archived", 'error');
|
||||||
|
|
||||||
@@ -283,7 +283,7 @@ if (isset($_POST['restore_user'])) {
|
|||||||
$extended_log_description .= ", password changed";
|
$extended_log_description .= ", password changed";
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("User", "Restored", "$session_name restored user $user_name", 0, $user_id);
|
logAudit("User", "Restored", "$session_name restored user $user_name", 0, $user_id);
|
||||||
|
|
||||||
flash_alert("User <strong>$user_name</strong> restored");
|
flash_alert("User <strong>$user_name</strong> restored");
|
||||||
|
|
||||||
@@ -338,7 +338,7 @@ if (isset($_POST['export_users_csv'])) {
|
|||||||
fpassthru($f);
|
fpassthru($f);
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("User", "Export", "$session_name exported $count user(s) to a CSV file");
|
logAudit("User", "Export", "$session_name exported $count user(s) to a CSV file");
|
||||||
}
|
}
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
@@ -378,7 +378,7 @@ if (isset($_POST['ir_reset_user_password'])) {
|
|||||||
echo "<br><br>";
|
echo "<br><br>";
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("User", "Edit", "$session_name reset ALL user passwords");
|
logAudit("User", "Edit", "$session_name reset ALL user passwords");
|
||||||
|
|
||||||
exit; // Stay on the plain text password page
|
exit; // Stay on the plain text password page
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ if (isset($_POST['client_set_notes'])) {
|
|||||||
mysqli_query($mysqli, "UPDATE clients SET client_notes = '$notes' WHERE client_id = $client_id");
|
mysqli_query($mysqli, "UPDATE clients SET client_notes = '$notes' WHERE client_id = $client_id");
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Client", "Edit", "$session_name edited client notes", $client_id);
|
logAudit("Client", "Edit", "$session_name edited client notes", $client_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ if (isset($_POST['contact_set_notes'])) {
|
|||||||
mysqli_query($mysqli, "UPDATE contacts SET contact_notes = '$notes' WHERE contact_id = $contact_id");
|
mysqli_query($mysqli, "UPDATE contacts SET contact_notes = '$notes' WHERE contact_id = $contact_id");
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Contact", "Edit", "$session_name edited contact notes for $contact_name", $client_id, $contact_id);
|
logAudit("Contact", "Edit", "$session_name edited contact notes for $contact_name", $client_id, $contact_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ if (isset($_POST['asset_set_notes'])) {
|
|||||||
mysqli_query($mysqli, "UPDATE assets SET asset_notes = '$notes' WHERE asset_id = $asset_id");
|
mysqli_query($mysqli, "UPDATE assets SET asset_notes = '$notes' WHERE asset_id = $asset_id");
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Asset", "Edit", "$session_name edited asset notes for $asset_name", $client_id, $asset_id);
|
logAudit("Asset", "Edit", "$session_name edited asset notes for $asset_name", $client_id, $asset_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -269,7 +269,7 @@ if (isset($_GET['share_generate_link'])) {
|
|||||||
echo json_encode($url);
|
echo json_encode($url);
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Share", "Create", "$session_name created shared link for $item_type - $item_name", $client_id, $item_id);
|
logAudit("Share", "Create", "$session_name created shared link for $item_type - $item_name", $client_id, $item_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -417,7 +417,7 @@ if (isset($_GET['get_totp_token_via_id'])) {
|
|||||||
|
|
||||||
if ($recent_totp_view_logged_count == 0) {
|
if ($recent_totp_view_logged_count == 0) {
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Credential", "View TOTP", "$session_name viewed credential TOTP code for $name", $client_id, $credential_id);
|
logAudit("Credential", "View TOTP", "$session_name viewed credential TOTP code for $name", $client_id, $credential_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ if (isset($_GET['client_id'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Log when users load the Credentials page
|
// Log when users load the Credentials page
|
||||||
logAction("Credential", "View", "$session_name viewed the Credentials page for client", $client_id);
|
logAudit("Credential", "View", "$session_name viewed the Credentials page for client", $client_id);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
require_once "includes/inc_client_overview_all.php";
|
require_once "includes/inc_client_overview_all.php";
|
||||||
@@ -34,7 +34,7 @@ if (isset($_GET['client_id'])) {
|
|||||||
$archive_query = "(client_archived_at IS NULL AND credential_archived_at IS NULL)";
|
$archive_query = "(client_archived_at IS NULL AND credential_archived_at IS NULL)";
|
||||||
}
|
}
|
||||||
// Log when users load the Credentials page
|
// Log when users load the Credentials page
|
||||||
logAction("Credential", "View", "$session_name viewed the All Credentials page");
|
logAudit("Credential", "View", "$session_name viewed the All Credentials page");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Perms
|
// Perms
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ if (isset($_POST['add_account'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO accounts SET account_name = '$name', opening_balance = $opening_balance, account_currency_code = '$currency_code', account_notes = '$notes'");
|
mysqli_query($mysqli,"INSERT INTO accounts SET account_name = '$name', opening_balance = $opening_balance, account_currency_code = '$currency_code', account_notes = '$notes'");
|
||||||
|
|
||||||
logAction("Account", "Create", "$session_name created account $name");
|
logAudit("Account", "Create", "$session_name created account $name");
|
||||||
|
|
||||||
flash_alert("Account <strong>$name</strong> created");
|
flash_alert("Account <strong>$name</strong> created");
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ if (isset($_POST['edit_account'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE accounts SET account_name = '$name', account_notes = '$notes' WHERE account_id = $account_id");
|
mysqli_query($mysqli,"UPDATE accounts SET account_name = '$name', account_notes = '$notes' WHERE account_id = $account_id");
|
||||||
|
|
||||||
logAction("Account", "Edit", "$session_name edited account $name");
|
logAudit("Account", "Edit", "$session_name edited account $name");
|
||||||
|
|
||||||
flash_alert("Account <strong>$name</strong> edited");
|
flash_alert("Account <strong>$name</strong> edited");
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ if (isset($_GET['archive_account'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE accounts SET account_archived_at = NOW() WHERE account_id = $account_id");
|
mysqli_query($mysqli,"UPDATE accounts SET account_archived_at = NOW() WHERE account_id = $account_id");
|
||||||
|
|
||||||
logAction("Account", "Archive", "$session_name archived account $account_name");
|
logAudit("Account", "Archive", "$session_name archived account $account_name");
|
||||||
|
|
||||||
flash_alert("Account <strong>$account_name</strong> archived", 'error');
|
flash_alert("Account <strong>$account_name</strong> archived", 'error');
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ if (isset($_GET['delete_account'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM accounts WHERE account_id = $account_id");
|
mysqli_query($mysqli,"DELETE FROM accounts WHERE account_id = $account_id");
|
||||||
|
|
||||||
logAction("Account", "Delete", "$session_name deleted account $account_name");
|
logAudit("Account", "Delete", "$session_name deleted account $account_name");
|
||||||
|
|
||||||
flash_alert("Account <strong>$account_name</strong> deleted", 'error');
|
flash_alert("Account <strong>$account_name</strong> deleted", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ if (isset($_POST['add_asset'])) {
|
|||||||
|
|
||||||
$credential_id = mysqli_insert_id($mysqli);
|
$credential_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Credential", "Create", "$session_name created login credential for asset $asset_name", $client_id, $credential_id);
|
logAudit("Credential", "Create", "$session_name created login credential for asset $asset_name", $client_id, $credential_id);
|
||||||
|
|
||||||
$alert_extended = " along with login credentials";
|
$alert_extended = " along with login credentials";
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ if (isset($_POST['add_asset'])) {
|
|||||||
// Add to History
|
// Add to History
|
||||||
mysqli_query($mysqli,"INSERT INTO asset_history SET asset_history_status = '$status', asset_history_description = '$session_name created $name', asset_history_asset_id = $asset_id");
|
mysqli_query($mysqli,"INSERT INTO asset_history SET asset_history_status = '$status', asset_history_description = '$session_name created $name', asset_history_asset_id = $asset_id");
|
||||||
|
|
||||||
logAction("Asset", "Create", "$session_name created asset $name", $client_id, $asset_id);
|
logAudit("Asset", "Create", "$session_name created asset $name", $client_id, $asset_id);
|
||||||
|
|
||||||
flash_alert("Asset <strong>$name</strong> created $alert_extended");
|
flash_alert("Asset <strong>$name</strong> created $alert_extended");
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ if (isset($_POST['edit_asset'])) {
|
|||||||
// Add to History
|
// 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");
|
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);
|
logAudit("Asset", "Edit", "$session_name edited asset $name", $client_id, $asset_id);
|
||||||
|
|
||||||
flash_alert("Asset <strong>$name</strong> edited");
|
flash_alert("Asset <strong>$name</strong> edited");
|
||||||
|
|
||||||
@@ -168,7 +168,7 @@ if (isset($_GET['archive_asset'])) {
|
|||||||
// Add to History
|
// 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");
|
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);
|
logAudit("Asset", "Archive", "$session_name archived asset $asset_name", $client_id, $asset_id);
|
||||||
|
|
||||||
flash_alert("Asset <strong>$asset_name</strong> archived", 'error');
|
flash_alert("Asset <strong>$asset_name</strong> archived", 'error');
|
||||||
|
|
||||||
@@ -197,7 +197,7 @@ if (isset($_GET['restore_asset'])) {
|
|||||||
// Add to History
|
// Add to History
|
||||||
mysqli_query($mysqli,"INSERT INTO asset_history SET asset_history_status = 'Restored', asset_history_description = '$session_name restored $asset_name', asset_history_asset_id = $asset_id");
|
mysqli_query($mysqli,"INSERT INTO asset_history SET asset_history_status = 'Restored', asset_history_description = '$session_name restored $asset_name', asset_history_asset_id = $asset_id");
|
||||||
|
|
||||||
logAction("Asset", "Restore", "$session_name restored asset $asset_name", $client_id, $asset_id);
|
logAudit("Asset", "Restore", "$session_name restored asset $asset_name", $client_id, $asset_id);
|
||||||
|
|
||||||
flash_alert("Asset <strong>$asset_name</strong> Restored");
|
flash_alert("Asset <strong>$asset_name</strong> Restored");
|
||||||
|
|
||||||
@@ -223,7 +223,7 @@ if (isset($_GET['delete_asset'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM assets WHERE asset_id = $asset_id");
|
mysqli_query($mysqli,"DELETE FROM assets WHERE asset_id = $asset_id");
|
||||||
|
|
||||||
logAction("Asset", "Delete", "$session_name deleted asset $asset_name", $client_id);
|
logAudit("Asset", "Delete", "$session_name deleted asset $asset_name", $client_id);
|
||||||
|
|
||||||
flash_alert("Asset <strong>$asset_name</strong> deleted");
|
flash_alert("Asset <strong>$asset_name</strong> deleted");
|
||||||
|
|
||||||
@@ -266,11 +266,11 @@ if (isset($_POST['bulk_assign_asset_tags'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Asset", "Edit", "$session_name added tags to asset $asset_name", $client_id, $asset_id);
|
logAudit("Asset", "Edit", "$session_name added tags to asset $asset_name", $client_id, $asset_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Asset", "Bulk Edit", "$session_name added tags for $asset_count assets", $client_id);
|
logAudit("Asset", "Bulk Edit", "$session_name added tags for $asset_count assets", $client_id);
|
||||||
|
|
||||||
flash_alert("Assigned tags for <strong>$count</strong> assets");
|
flash_alert("Assigned tags for <strong>$count</strong> assets");
|
||||||
}
|
}
|
||||||
@@ -314,11 +314,11 @@ if (isset($_POST['bulk_assign_asset_location'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE assets SET asset_location_id = $location_id WHERE asset_id = $asset_id");
|
mysqli_query($mysqli,"UPDATE assets SET asset_location_id = $location_id WHERE asset_id = $asset_id");
|
||||||
|
|
||||||
logAction("Asset", "Edit", "$session_name assigned asset $asset_name to location $location_name", $client_id, $asset_id);
|
logAudit("Asset", "Edit", "$session_name assigned asset $asset_name to location $location_name", $client_id, $asset_id);
|
||||||
|
|
||||||
} // End Assign Location Loop
|
} // End Assign Location Loop
|
||||||
|
|
||||||
logAction("Asset", "Bulk Edit", "$session_name assigned $asset_count assets to location $location_name", $client_id);
|
logAudit("Asset", "Bulk Edit", "$session_name assigned $asset_count assets to location $location_name", $client_id);
|
||||||
|
|
||||||
flash_alert("You assigned <strong>$asset_count</strong> assets to location <strong>$location_name</strong>");
|
flash_alert("You assigned <strong>$asset_count</strong> assets to location <strong>$location_name</strong>");
|
||||||
}
|
}
|
||||||
@@ -354,11 +354,11 @@ if (isset($_POST['bulk_assign_asset_physical_location'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE assets SET asset_physical_location = '$physical_location' WHERE asset_id = $asset_id");
|
mysqli_query($mysqli,"UPDATE assets SET asset_physical_location = '$physical_location' WHERE asset_id = $asset_id");
|
||||||
|
|
||||||
logAction("Asset", "Edit", "$session_name set asset $asset_name to physical location $physical_location", $client_id, $asset_id);
|
logAudit("Asset", "Edit", "$session_name set asset $asset_name to physical location $physical_location", $client_id, $asset_id);
|
||||||
|
|
||||||
} // End Assign Location Loop
|
} // End Assign Location Loop
|
||||||
|
|
||||||
logAction("Asset", "Bulk Edit", "$session_name set $asset_count assets to physical location $physical_location", $client_id);
|
logAudit("Asset", "Bulk Edit", "$session_name set $asset_count assets to physical location $physical_location", $client_id);
|
||||||
|
|
||||||
flash_alert("You moved <strong>$asset_count</strong> assets to location <strong>$physical_location</strong>");
|
flash_alert("You moved <strong>$asset_count</strong> assets to location <strong>$physical_location</strong>");
|
||||||
}
|
}
|
||||||
@@ -431,24 +431,24 @@ if (isset($_POST['bulk_transfer_client_asset'])) {
|
|||||||
mysqli_query($mysqli,"INSERT INTO asset_history SET asset_history_status = 'Transferred', asset_history_description = '$session_name transferred $asset_name to $new_client_name', asset_history_asset_id = $current_asset_id");
|
mysqli_query($mysqli,"INSERT INTO asset_history SET asset_history_status = 'Transferred', asset_history_description = '$session_name transferred $asset_name to $new_client_name', asset_history_asset_id = $current_asset_id");
|
||||||
|
|
||||||
// Log Archive
|
// Log Archive
|
||||||
logAction("Asset", "Archive", "$session_name archived asset $asset_name (via transfer)", $current_client_id, $current_asset_id);
|
logAudit("Asset", "Archive", "$session_name archived asset $asset_name (via transfer)", $current_client_id, $current_asset_id);
|
||||||
|
|
||||||
// Log Transfer
|
// Log Transfer
|
||||||
logAction("Asset", "Transfer", "$session_name Transferred asset $asset_name (old asset ID: $current_asset_id) from $current_client_name to $new_client_name (new asset ID: $new_asset_id)", $current_client_id, $current_asset_id);
|
logAudit("Asset", "Transfer", "$session_name Transferred asset $asset_name (old asset ID: $current_asset_id) from $current_client_name to $new_client_name (new asset ID: $new_asset_id)", $current_client_id, $current_asset_id);
|
||||||
mysqli_query($mysqli, "UPDATE assets SET asset_notes = '$notes' WHERE asset_id = $current_asset_id");
|
mysqli_query($mysqli, "UPDATE assets SET asset_notes = '$notes' WHERE asset_id = $current_asset_id");
|
||||||
|
|
||||||
// Log the new asset
|
// Log the new asset
|
||||||
$notes = $asset_notes . "\r\n\r\n---\r\n* " . date('Y-m-d H:i:s') . ": Transferred asset $asset_name (old asset ID: $current_asset_id) from $current_client_name to $new_client_name (new asset ID: $new_asset_id)";
|
$notes = $asset_notes . "\r\n\r\n---\r\n* " . date('Y-m-d H:i:s') . ": Transferred asset $asset_name (old asset ID: $current_asset_id) from $current_client_name to $new_client_name (new asset ID: $new_asset_id)";
|
||||||
logAction("Asset", "Create", "$session_name created asset $name (via transfer)", $new_client_id, $new_asset_id);
|
logAudit("Asset", "Create", "$session_name created asset $name (via transfer)", $new_client_id, $new_asset_id);
|
||||||
mysqli_query($mysqli,"INSERT INTO asset_history SET asset_history_status = 'Transferred', asset_history_description = '$session_name created asset via transfer from $current_client_name', asset_history_asset_id = $new_asset_id");
|
mysqli_query($mysqli,"INSERT INTO asset_history SET asset_history_status = 'Transferred', asset_history_description = '$session_name created asset via transfer from $current_client_name', asset_history_asset_id = $new_asset_id");
|
||||||
|
|
||||||
logAction("Asset", "Transfer", "$session_name Transferred asset $asset_name (old asset ID: $current_asset_id) from $current_client_name to $new_client_name (new asset ID: $new_asset_id)", $new_client_id, $new_asset_id);
|
logAudit("Asset", "Transfer", "$session_name Transferred asset $asset_name (old asset ID: $current_asset_id) from $current_client_name to $new_client_name (new asset ID: $new_asset_id)", $new_client_id, $new_asset_id);
|
||||||
|
|
||||||
mysqli_query($mysqli, "UPDATE assets SET asset_notes = '$notes' WHERE asset_id = $new_asset_id");
|
mysqli_query($mysqli, "UPDATE assets SET asset_notes = '$notes' WHERE asset_id = $new_asset_id");
|
||||||
|
|
||||||
} // End Transfer to Client Loop
|
} // End Transfer to Client Loop
|
||||||
|
|
||||||
logAction("Asset", "Bulk Transfer", "$session_name transferred $asset_count assets to $new_client_name", $new_client_id);
|
logAudit("Asset", "Bulk Transfer", "$session_name transferred $asset_count assets to $new_client_name", $new_client_id);
|
||||||
|
|
||||||
flash_alert("Transferred <strong>$asset_count</strong> assets to <strong>$new_client_name</strong>.");
|
flash_alert("Transferred <strong>$asset_count</strong> assets to <strong>$new_client_name</strong>.");
|
||||||
}
|
}
|
||||||
@@ -489,11 +489,11 @@ if (isset($_POST['bulk_assign_asset_contact'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE assets SET asset_contact_id = $contact_id WHERE asset_id = $asset_id");
|
mysqli_query($mysqli,"UPDATE assets SET asset_contact_id = $contact_id WHERE asset_id = $asset_id");
|
||||||
|
|
||||||
logAction("Asset", "Edit", "$session_name assigned asset $asset_name to contact $contact_name", $client_id, $asset_id);
|
logAudit("Asset", "Edit", "$session_name assigned asset $asset_name to contact $contact_name", $client_id, $asset_id);
|
||||||
|
|
||||||
} // End Assign Contact Loop
|
} // End Assign Contact Loop
|
||||||
|
|
||||||
logAction("Asset", "Bulk Edit", "$session_name assigned $asset_count assets to contact $contact_name", $client_id);
|
logAudit("Asset", "Bulk Edit", "$session_name assigned $asset_count assets to contact $contact_name", $client_id);
|
||||||
|
|
||||||
flash_alert("You assigned <strong>$asset_count</strong> assets to contact <strong>$contact_name</strong>");
|
flash_alert("You assigned <strong>$asset_count</strong> assets to contact <strong>$contact_name</strong>");
|
||||||
}
|
}
|
||||||
@@ -527,14 +527,14 @@ if (isset($_POST['bulk_edit_asset_status'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE assets SET asset_status = '$status' WHERE asset_id = $asset_id");
|
mysqli_query($mysqli,"UPDATE assets SET asset_status = '$status' WHERE asset_id = $asset_id");
|
||||||
|
|
||||||
logAction("Asset", "Edit", "$session_name set status to $status on $asset_name", $client_id, $asset_id);
|
logAudit("Asset", "Edit", "$session_name set status to $status on $asset_name", $client_id, $asset_id);
|
||||||
|
|
||||||
// Add to History
|
// 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");
|
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);
|
logAudit("Asset", "Bulk Edit", "$session_name set status to $status on $asset_count assets", $client_id);
|
||||||
|
|
||||||
flash_alert("You set the status <strong>$status</strong> on <strong>$asset_count</strong> assets.");
|
flash_alert("You set the status <strong>$status</strong> on <strong>$asset_count</strong> assets.");
|
||||||
}
|
}
|
||||||
@@ -567,11 +567,11 @@ if (isset($_POST['bulk_favorite_assets'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE assets SET asset_favorite = 1 WHERE asset_id = $asset_id");
|
mysqli_query($mysqli,"UPDATE assets SET asset_favorite = 1 WHERE asset_id = $asset_id");
|
||||||
|
|
||||||
logAction("Asset", "Edit", "$session_name marked asset $asset_name a favorite", $client_id, $asset_id);
|
logAudit("Asset", "Edit", "$session_name marked asset $asset_name a favorite", $client_id, $asset_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Asset", "Bulk Edit", "$session_name favorited $count assets", $client_id);
|
logAudit("Asset", "Bulk Edit", "$session_name favorited $count assets", $client_id);
|
||||||
|
|
||||||
flash_alert("Favorited <strong>$count</strong> asset(s)");
|
flash_alert("Favorited <strong>$count</strong> asset(s)");
|
||||||
|
|
||||||
@@ -605,11 +605,11 @@ if (isset($_POST['bulk_unfavorite_assets'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE assets SET asset_favorite = 0 WHERE asset_id = $asset_id");
|
mysqli_query($mysqli,"UPDATE assets SET asset_favorite = 0 WHERE asset_id = $asset_id");
|
||||||
|
|
||||||
logAction("Asset", "Edit", "$session_name unfavorited asset $asset_name", $client_id, $asset_id);
|
logAudit("Asset", "Edit", "$session_name unfavorited asset $asset_name", $client_id, $asset_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Asset", "Bulk Edit", "$session_name unfavorited $count assets", $client_id);
|
logAudit("Asset", "Bulk Edit", "$session_name unfavorited $count assets", $client_id);
|
||||||
|
|
||||||
flash_alert("Unfavorited <strong>$count</strong> asset(s)");
|
flash_alert("Unfavorited <strong>$count</strong> asset(s)");
|
||||||
|
|
||||||
@@ -643,14 +643,14 @@ if (isset($_POST['bulk_archive_assets'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE assets SET asset_archived_at = NOW() WHERE asset_id = $asset_id");
|
mysqli_query($mysqli,"UPDATE assets SET asset_archived_at = NOW() WHERE asset_id = $asset_id");
|
||||||
|
|
||||||
logAction("Asset", "Archive", "$session_name archived asset $asset_name", $client_id, $asset_id);
|
logAudit("Asset", "Archive", "$session_name archived asset $asset_name", $client_id, $asset_id);
|
||||||
|
|
||||||
// Add to History
|
// 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");
|
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);
|
logAudit("Asset", "Bulk Archive", "$session_name archived $count assets", $client_id);
|
||||||
|
|
||||||
flash_alert("Archived <strong>$count</strong> asset(s)", 'error');
|
flash_alert("Archived <strong>$count</strong> asset(s)", 'error');
|
||||||
|
|
||||||
@@ -685,14 +685,14 @@ if (isset($_POST['bulk_restore_assets'])) {
|
|||||||
mysqli_query($mysqli,"UPDATE assets SET asset_archived_at = NULL WHERE asset_id = $asset_id");
|
mysqli_query($mysqli,"UPDATE assets SET asset_archived_at = NULL WHERE asset_id = $asset_id");
|
||||||
|
|
||||||
// Individual Asset logging
|
// Individual Asset logging
|
||||||
logAction("Asset", "Restore", "$session_name restored asset $asset_name", $client_id, $asset_id);
|
logAudit("Asset", "Restore", "$session_name restored asset $asset_name", $client_id, $asset_id);
|
||||||
|
|
||||||
// Add to History
|
// Add to History
|
||||||
mysqli_query($mysqli,"INSERT INTO asset_history SET asset_history_status = 'Restored', asset_history_description = '$session_name restored $asset_name', asset_history_asset_id = $asset_id");
|
mysqli_query($mysqli,"INSERT INTO asset_history SET asset_history_status = 'Restored', asset_history_description = '$session_name restored $asset_name', asset_history_asset_id = $asset_id");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Asset", "Bulk Restore", "$session_name restored $count assets");
|
logAudit("Asset", "Bulk Restore", "$session_name restored $count assets");
|
||||||
|
|
||||||
flash_alert("Restored $count asset(s)");
|
flash_alert("Restored $count asset(s)");
|
||||||
|
|
||||||
@@ -726,10 +726,10 @@ if (isset($_POST['bulk_delete_assets'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM assets WHERE asset_id = $asset_id");
|
mysqli_query($mysqli,"DELETE FROM assets WHERE asset_id = $asset_id");
|
||||||
|
|
||||||
logAction("Asset", "Delete", "$session_name deleted asset $asset_name", $client_id, $asset_id);
|
logAudit("Asset", "Delete", "$session_name deleted asset $asset_name", $client_id, $asset_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Asset", "Bulk Delete", "$session_name deleted $count assets");
|
logAudit("Asset", "Bulk Delete", "$session_name deleted $count assets");
|
||||||
|
|
||||||
flash_alert("Deleted <strong>$count</strong> asset(s)", 'error');
|
flash_alert("Deleted <strong>$count</strong> asset(s)", 'error');
|
||||||
}
|
}
|
||||||
@@ -762,7 +762,7 @@ if (isset($_POST['link_software_to_asset'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO software_assets SET asset_id = $asset_id, software_id = $software_id");
|
mysqli_query($mysqli,"INSERT INTO software_assets SET asset_id = $asset_id, software_id = $software_id");
|
||||||
|
|
||||||
logAction("Software", "Link", "$session_name added software license $software_name to asset $asset_name", $client_id, $software_id);
|
logAudit("Software", "Link", "$session_name added software license $software_name to asset $asset_name", $client_id, $software_id);
|
||||||
|
|
||||||
flash_alert("Software <strong>$software_name</strong> licensed for asset <strong>$asset_name</strong>");
|
flash_alert("Software <strong>$software_name</strong> licensed for asset <strong>$asset_name</strong>");
|
||||||
|
|
||||||
@@ -792,7 +792,7 @@ if (isset($_GET['unlink_software_from_asset'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM software_assets WHERE asset_id = $asset_id AND software_id = $software_id");
|
mysqli_query($mysqli,"DELETE FROM software_assets WHERE asset_id = $asset_id AND software_id = $software_id");
|
||||||
|
|
||||||
logAction("software", "Unlink", "$session_name removed software license $software_name from asset $asset_name", $client_id, $software_id);
|
logAudit("software", "Unlink", "$session_name removed software license $software_name from asset $asset_name", $client_id, $software_id);
|
||||||
|
|
||||||
flash_alert("Removed Software License <strong>$software_name</strong> for Asset <strong>$asset_name</strong>", 'error');
|
flash_alert("Removed Software License <strong>$software_name</strong> for Asset <strong>$asset_name</strong>", 'error');
|
||||||
|
|
||||||
@@ -823,7 +823,7 @@ if (isset($_POST['link_asset_to_credential'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE credentials SET credential_asset_id = $asset_id WHERE credential_id = $credential_id");
|
mysqli_query($mysqli,"UPDATE credentials SET credential_asset_id = $asset_id WHERE credential_id = $credential_id");
|
||||||
|
|
||||||
logAction("Credential", "Link", "$session_name linked credential $credential_name to asset $asset_name", $client_id, $credential_id);
|
logAudit("Credential", "Link", "$session_name linked credential $credential_name to asset $asset_name", $client_id, $credential_id);
|
||||||
|
|
||||||
flash_alert("Asset <strong>$asset_name</strong> linked with credential <strong>$crdential_name</strong>");
|
flash_alert("Asset <strong>$asset_name</strong> linked with credential <strong>$crdential_name</strong>");
|
||||||
|
|
||||||
@@ -853,7 +853,7 @@ if (isset($_GET['unlink_credential_from_asset'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE credentials SET credential_asset_id = 0 WHERE credential_id = $credential_id");
|
mysqli_query($mysqli,"UPDATE credentials SET credential_asset_id = 0 WHERE credential_id = $credential_id");
|
||||||
|
|
||||||
logAction("Credential", "Unlink", "$session_name unlinked asset $asset_name from credential $credential_name", $client_id, $credential_id);
|
logAudit("Credential", "Unlink", "$session_name unlinked asset $asset_name from credential $credential_name", $client_id, $credential_id);
|
||||||
|
|
||||||
flash_alert("Credential <strong>$credential_name</strong> unlinked from Asset <strong>$asset_name</strong>", 'errpr');
|
flash_alert("Credential <strong>$credential_name</strong> unlinked from Asset <strong>$asset_name</strong>", 'errpr');
|
||||||
|
|
||||||
@@ -883,7 +883,7 @@ if (isset($_POST['link_service_to_asset'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO service_assets SET asset_id = $asset_id, service_id = $service_id");
|
mysqli_query($mysqli,"INSERT INTO service_assets SET asset_id = $asset_id, service_id = $service_id");
|
||||||
|
|
||||||
logAction("Service", "Link", "$session_name linked asset $asset_name to service $service_name", $client_id, $service_id);
|
logAudit("Service", "Link", "$session_name linked asset $asset_name to service $service_name", $client_id, $service_id);
|
||||||
|
|
||||||
flash_alert("Service <strong>$service_name</strong> linked with asset <strong>$asset_name</strong>");
|
flash_alert("Service <strong>$service_name</strong> linked with asset <strong>$asset_name</strong>");
|
||||||
|
|
||||||
@@ -913,7 +913,7 @@ if (isset($_GET['unlink_service_from_asset'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM service_assets WHERE asset_id = $asset_id AND service_id = $service_id");
|
mysqli_query($mysqli,"DELETE FROM service_assets WHERE asset_id = $asset_id AND service_id = $service_id");
|
||||||
|
|
||||||
logAction("Service", "Unlink", "$session_name unlinked asset $asset_name from service $service_name", $client_id, $service_id);
|
logAudit("Service", "Unlink", "$session_name unlinked asset $asset_name from service $service_name", $client_id, $service_id);
|
||||||
|
|
||||||
flash_alert("Asset <strong>$asset_name</strong> unlinked from service <strong>$service_name</strong>", 'error');
|
flash_alert("Asset <strong>$asset_name</strong> unlinked from service <strong>$service_name</strong>", 'error');
|
||||||
|
|
||||||
@@ -944,7 +944,7 @@ if (isset($_POST['link_asset_to_file'])) {
|
|||||||
// asset add query
|
// asset add query
|
||||||
mysqli_query($mysqli,"INSERT INTO asset_files SET asset_id = $asset_id, file_id = $file_id");
|
mysqli_query($mysqli,"INSERT INTO asset_files SET asset_id = $asset_id, file_id = $file_id");
|
||||||
|
|
||||||
logAction("File", "Link", "$session_name linked asset $asset_name to file $file_name", $client_id, $file_id);
|
logAudit("File", "Link", "$session_name linked asset $asset_name to file $file_name", $client_id, $file_id);
|
||||||
|
|
||||||
flash_alert("Asset <strong>$asset_name</strong> linked with File <strong>$file_name</strong>");
|
flash_alert("Asset <strong>$asset_name</strong> linked with File <strong>$file_name</strong>");
|
||||||
|
|
||||||
@@ -974,7 +974,7 @@ if (isset($_GET['unlink_asset_from_file'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM asset_files WHERE asset_id = $asset_id AND file_id = $file_id");
|
mysqli_query($mysqli,"DELETE FROM asset_files WHERE asset_id = $asset_id AND file_id = $file_id");
|
||||||
|
|
||||||
logAction("File", "Unlink", "$session_name unlinked asset $asset_name from file $file_name", $client_id, $file_id);
|
logAudit("File", "Unlink", "$session_name unlinked asset $asset_name from file $file_name", $client_id, $file_id);
|
||||||
|
|
||||||
flash_alert("Asset <strong>$asset_name</strong> unlinked from file <strong>$file_name</strong>", 'error');
|
flash_alert("Asset <strong>$asset_name</strong> unlinked from file <strong>$file_name</strong>", 'error');
|
||||||
|
|
||||||
@@ -1139,7 +1139,7 @@ if (isset($_POST["import_assets_csv"])) {
|
|||||||
}
|
}
|
||||||
fclose($file);
|
fclose($file);
|
||||||
|
|
||||||
logAction("Asset", "Import", "$session_name imported $row_count asset(s) via CSV file", $client_id);
|
logAudit("Asset", "Import", "$session_name imported $row_count asset(s) via CSV file", $client_id);
|
||||||
|
|
||||||
flash_alert("$row_count Asset(s) added, $duplicate_count duplicate(s) detected");
|
flash_alert("$row_count Asset(s) added, $duplicate_count duplicate(s) detected");
|
||||||
|
|
||||||
@@ -1243,7 +1243,7 @@ if (isset($_POST['export_assets_csv'])) {
|
|||||||
fpassthru($f);
|
fpassthru($f);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Asset", "Export", "$session_name exported $num_rows asset(s) to a CSV file", $client_id);
|
logAudit("Asset", "Export", "$session_name exported $num_rows asset(s) to a CSV file", $client_id);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
@@ -1311,7 +1311,7 @@ if (isset($_POST['add_asset_interface'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 6) Logging
|
// 6) Logging
|
||||||
logAction(
|
logAudit(
|
||||||
"Asset Interface",
|
"Asset Interface",
|
||||||
"Create",
|
"Create",
|
||||||
"$session_name created interface $name for asset $asset_name",
|
"$session_name created interface $name for asset $asset_name",
|
||||||
@@ -1362,10 +1362,10 @@ if (isset($_POST['add_asset_multiple_interfaces'])) {
|
|||||||
";
|
";
|
||||||
mysqli_query($mysqli, $sql_insert);
|
mysqli_query($mysqli, $sql_insert);
|
||||||
|
|
||||||
logAction("Asset Interface", "Create", "$session_name created interface $name for asset $asset_name", $client_id, $asset_id);
|
logAudit("Asset Interface", "Create", "$session_name created interface $name for asset $asset_name", $client_id, $asset_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Asset Interface", "Bulk Create", "$session_name created $interfaces for asset $asset_name", $client_id, $asset_id);
|
logAudit("Asset Interface", "Bulk Create", "$session_name created $interfaces for asset $asset_name", $client_id, $asset_id);
|
||||||
|
|
||||||
flash_alert("Created <strong>$interfaces</strong> Interface(s) for asset <strong>$asset_name</strong>");
|
flash_alert("Created <strong>$interfaces</strong> Interface(s) for asset <strong>$asset_name</strong>");
|
||||||
|
|
||||||
@@ -1439,7 +1439,7 @@ if (isset($_POST['edit_asset_interface'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 5) Logging
|
// 5) Logging
|
||||||
logAction(
|
logAudit(
|
||||||
"Asset Interface",
|
"Asset Interface",
|
||||||
"Edit",
|
"Edit",
|
||||||
"$session_name edited interface $name for asset $asset_name",
|
"$session_name edited interface $name for asset $asset_name",
|
||||||
@@ -1484,7 +1484,7 @@ if (isset($_GET['delete_asset_interface'])) {
|
|||||||
");
|
");
|
||||||
|
|
||||||
// 3) Logging
|
// 3) Logging
|
||||||
logAction(
|
logAudit(
|
||||||
"Asset Interface",
|
"Asset Interface",
|
||||||
"Delete",
|
"Delete",
|
||||||
"$session_name deleted interface $interface_name from asset $asset_name",
|
"$session_name deleted interface $interface_name from asset $asset_name",
|
||||||
@@ -1532,10 +1532,10 @@ if (isset($_POST['bulk_edit_asset_interface_type'])) {
|
|||||||
// Update inteface type
|
// Update inteface type
|
||||||
mysqli_query($mysqli,"UPDATE asset_interfaces SET interface_type = '$type' WHERE interface_id = $interface_id");
|
mysqli_query($mysqli,"UPDATE asset_interfaces SET interface_type = '$type' WHERE interface_id = $interface_id");
|
||||||
|
|
||||||
logAction("Asset Interface", "Edit", "$session_name set interface type to $type for asset $asset_name", $client_id, $asset_id);
|
logAudit("Asset Interface", "Edit", "$session_name set interface type to $type for asset $asset_name", $client_id, $asset_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Asset Interface", "Bulk Edit", "$session_name set interface type to $type on $interface_count interfaces for asset $asset_name", $client_id);
|
logAudit("Asset Interface", "Bulk Edit", "$session_name set interface type to $type on $interface_count interfaces for asset $asset_name", $client_id);
|
||||||
|
|
||||||
flash_alert("Type set to <strong>$type</strong> on <strong>$interface_count</strong> interfaces.");
|
flash_alert("Type set to <strong>$type</strong> on <strong>$interface_count</strong> interfaces.");
|
||||||
|
|
||||||
@@ -1581,10 +1581,10 @@ if (isset($_POST['bulk_edit_asset_interface_network'])) {
|
|||||||
// Update inteface type
|
// Update inteface type
|
||||||
mysqli_query($mysqli,"UPDATE asset_interfaces SET interface_network_id = $network_id WHERE interface_id = $interface_id");
|
mysqli_query($mysqli,"UPDATE asset_interfaces SET interface_network_id = $network_id WHERE interface_id = $interface_id");
|
||||||
|
|
||||||
logAction("Asset Interface", "Edit", "$session_name set network to $network_name for asset $asset_name", $client_id, $asset_id);
|
logAudit("Asset Interface", "Edit", "$session_name set network to $network_name for asset $asset_name", $client_id, $asset_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Asset Interface", "Bulk Edit", "$session_name set network to $network_name on $interface_count interfaces for asset $asset_name", $client_id);
|
logAudit("Asset Interface", "Bulk Edit", "$session_name set network to $network_name on $interface_count interfaces for asset $asset_name", $client_id);
|
||||||
|
|
||||||
flash_alert("Network set to <strong>$network_name</strong> on <strong>$interface_count</strong> interfaces.");
|
flash_alert("Network set to <strong>$network_name</strong> on <strong>$interface_count</strong> interfaces.");
|
||||||
}
|
}
|
||||||
@@ -1624,10 +1624,10 @@ if (isset($_POST['bulk_edit_asset_interface_ip_dhcp'])) {
|
|||||||
// Update inteface type
|
// Update inteface type
|
||||||
mysqli_query($mysqli,"UPDATE asset_interfaces SET interface_ip = 'DHCP' WHERE interface_id = $interface_id");
|
mysqli_query($mysqli,"UPDATE asset_interfaces SET interface_ip = 'DHCP' WHERE interface_id = $interface_id");
|
||||||
|
|
||||||
logAction("Asset Interface", "Edit", "$session_name set interface IP to DHCP for asset $asset_name", $client_id, $asset_id);
|
logAudit("Asset Interface", "Edit", "$session_name set interface IP to DHCP for asset $asset_name", $client_id, $asset_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Asset Interface", "Bulk Edit", "$session_name set interface IP to DHCP on $interface_count interfaces for asset $asset_name", $client_id);
|
logAudit("Asset Interface", "Bulk Edit", "$session_name set interface IP to DHCP on $interface_count interfaces for asset $asset_name", $client_id);
|
||||||
|
|
||||||
flash_alert("Interface IP set to <strong>DHCP</strong> on <strong>$interface_count</strong> interfaces.");
|
flash_alert("Interface IP set to <strong>DHCP</strong> on <strong>$interface_count</strong> interfaces.");
|
||||||
|
|
||||||
@@ -1668,10 +1668,10 @@ if (isset($_POST['bulk_delete_asset_interfaces'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "DELETE FROM asset_interfaces WHERE interface_id = $interface_id");
|
mysqli_query($mysqli, "DELETE FROM asset_interfaces WHERE interface_id = $interface_id");
|
||||||
|
|
||||||
logAction("Asset Interface", "Delete", "$session_name deleted interface $interface_name from asset $asset_name", $client_id, $asset_id);
|
logAudit("Asset Interface", "Delete", "$session_name deleted interface $interface_name from asset $asset_name", $client_id, $asset_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Asset Interface", "Bulk Delete", "$session_name deleted $interface_count interfaces for asset $asset_name", $client_id);
|
logAudit("Asset Interface", "Bulk Delete", "$session_name deleted $interface_count interfaces for asset $asset_name", $client_id);
|
||||||
|
|
||||||
flash_alert("<strong>$interface_count</strong> interfaces deleted.", 'error');
|
flash_alert("<strong>$interface_count</strong> interfaces deleted.", 'error');
|
||||||
}
|
}
|
||||||
@@ -1786,7 +1786,7 @@ if (isset($_POST["import_client_asset_interfaces_csv"])) {
|
|||||||
}
|
}
|
||||||
fclose($file);
|
fclose($file);
|
||||||
|
|
||||||
logAction("Asset", "Import", "$session_name imported $row_count interfaces(s) to asset $asset_name via CSV file", $client_id);
|
logAudit("Asset", "Import", "$session_name imported $row_count interfaces(s) to asset $asset_name via CSV file", $client_id);
|
||||||
|
|
||||||
flash_alert("<strong>$row_count</strong> Interfaces(s) added to asset <strong>$asset_name</stong>, <strong>$duplicate_count</strong> duplicate(s) detected");
|
flash_alert("<strong>$row_count</strong> Interfaces(s) added to asset <strong>$asset_name</stong>, <strong>$duplicate_count</strong> duplicate(s) detected");
|
||||||
|
|
||||||
@@ -1885,7 +1885,7 @@ if (isset($_POST['export_client_asset_interfaces_csv'])) {
|
|||||||
fpassthru($f);
|
fpassthru($f);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Asset Interface", "Export", "$session_name exported $num_rows interfaces(s) to a CSV file", $client_id);
|
logAudit("Asset Interface", "Export", "$session_name exported $num_rows interfaces(s) to a CSV file", $client_id);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ if (isset($_POST['add_category'])) {
|
|||||||
|
|
||||||
$category_id = mysqli_insert_id($mysqli);
|
$category_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Category", "Create", "$session_name created category $type $name", 0, $category_id);
|
logAudit("Category", "Create", "$session_name created category $type $name", 0, $category_id);
|
||||||
|
|
||||||
flash_alert("Category $type <strong>$name</strong> created");
|
flash_alert("Category $type <strong>$name</strong> created");
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ if (isset($_POST['add_certificate'])) {
|
|||||||
|
|
||||||
$certificate_id = mysqli_insert_id($mysqli);
|
$certificate_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Certificate", "Create", "$session_name created certificate $name", $client_id, $certificate_id);
|
logAudit("Certificate", "Create", "$session_name created certificate $name", $client_id, $certificate_id);
|
||||||
|
|
||||||
flash_alert("Certificate <strong>$name</strong> created");
|
flash_alert("Certificate <strong>$name</strong> created");
|
||||||
|
|
||||||
@@ -111,7 +111,7 @@ if (isset($_POST['edit_certificate'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Certificate", "Edit", "$session_name edited certificate $name", $client_id, $certificate_id);
|
logAudit("Certificate", "Edit", "$session_name edited certificate $name", $client_id, $certificate_id);
|
||||||
|
|
||||||
flash_alert("Certificate <strong>$name</strong> updated");
|
flash_alert("Certificate <strong>$name</strong> updated");
|
||||||
|
|
||||||
@@ -137,7 +137,7 @@ if (isset($_GET['archive_certificate'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE certificates SET certificate_archived_at = NOW() WHERE certificate_id = $certificate_id");
|
mysqli_query($mysqli,"UPDATE certificates SET certificate_archived_at = NOW() WHERE certificate_id = $certificate_id");
|
||||||
|
|
||||||
logAction("Certificate", "Archive", "$session_name archived certificate $certificate_name", $client_id, $certificate_id);
|
logAudit("Certificate", "Archive", "$session_name archived certificate $certificate_name", $client_id, $certificate_id);
|
||||||
|
|
||||||
flash_alert("Certificate <strong>$certificate_name</strong> archived", 'alert');
|
flash_alert("Certificate <strong>$certificate_name</strong> archived", 'alert');
|
||||||
|
|
||||||
@@ -163,7 +163,7 @@ if (isset($_GET['restore_certificate'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE certificates SET certificate_archived_at = NULL WHERE certificate_id = $certificate_id");
|
mysqli_query($mysqli,"UPDATE certificates SET certificate_archived_at = NULL WHERE certificate_id = $certificate_id");
|
||||||
|
|
||||||
logAction("Certificate", "Restore", "$session_name restored certificate $certificate_name", $client_id, $certificate_id);
|
logAudit("Certificate", "Restore", "$session_name restored certificate $certificate_name", $client_id, $certificate_id);
|
||||||
|
|
||||||
flash_alert("Certificate <strong>$certificate_name</strong> restored");
|
flash_alert("Certificate <strong>$certificate_name</strong> restored");
|
||||||
|
|
||||||
@@ -189,7 +189,7 @@ if (isset($_GET['delete_certificate'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM certificates WHERE certificate_id = $certificate_id");
|
mysqli_query($mysqli,"DELETE FROM certificates WHERE certificate_id = $certificate_id");
|
||||||
|
|
||||||
logAction("Certificate", "Delete", "$session_name deleted certificate $name", $client_id);
|
logAudit("Certificate", "Delete", "$session_name deleted certificate $name", $client_id);
|
||||||
|
|
||||||
flash_alert("Certificate <strong>$certificate_name</strong> deleted");
|
flash_alert("Certificate <strong>$certificate_name</strong> deleted");
|
||||||
|
|
||||||
@@ -223,11 +223,11 @@ if (isset($_POST['bulk_delete_certificates'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "DELETE FROM certificates WHERE certificate_id = $certificate_id AND certificate_client_id = $client_id");
|
mysqli_query($mysqli, "DELETE FROM certificates WHERE certificate_id = $certificate_id AND certificate_client_id = $client_id");
|
||||||
|
|
||||||
logAction("Certificate", "Delete", "$session_name deleted certificate $certificate_name", $client_id);
|
logAudit("Certificate", "Delete", "$session_name deleted certificate $certificate_name", $client_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Certificate", "Bulk Delete", "$session_name deleted $count certificates", $client_id);
|
logAudit("Certificate", "Bulk Delete", "$session_name deleted $count certificates", $client_id);
|
||||||
|
|
||||||
flash_alert("Deleted <strong>$count</strong> certificate(s)", 'error');
|
flash_alert("Deleted <strong>$count</strong> certificate(s)", 'error');
|
||||||
|
|
||||||
@@ -289,7 +289,7 @@ if (isset($_POST['export_certificates_csv'])) {
|
|||||||
fpassthru($f);
|
fpassthru($f);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Certificate", "Export", "$session_name exported $num_rows certificate(s) to a CSV file", $client_id);
|
logAudit("Certificate", "Export", "$session_name exported $num_rows certificate(s) to a CSV file", $client_id);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ if (isset($_POST['add_client'])) {
|
|||||||
mysqli_stmt_bind_param($query, "s", $referral);
|
mysqli_stmt_bind_param($query, "s", $referral);
|
||||||
mysqli_stmt_execute($query);
|
mysqli_stmt_execute($query);
|
||||||
|
|
||||||
logAction("Category", "Create", "$session_name created referral category $referral");
|
logAudit("Category", "Create", "$session_name created referral category $referral");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert primary location using SET
|
// Insert primary location using SET
|
||||||
@@ -244,7 +244,7 @@ if (isset($_POST['add_client'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Client", "Create", "$session_name created client $name$extended_log_description", $client_id, $client_id);
|
logAudit("Client", "Create", "$session_name created client $name$extended_log_description", $client_id, $client_id);
|
||||||
|
|
||||||
flash_alert("Client <strong>$name</strong> created");
|
flash_alert("Client <strong>$name</strong> created");
|
||||||
|
|
||||||
@@ -305,7 +305,7 @@ if (isset($_POST['edit_client'])) {
|
|||||||
mysqli_stmt_bind_param($query, "s", $referral);
|
mysqli_stmt_bind_param($query, "s", $referral);
|
||||||
mysqli_stmt_execute($query);
|
mysqli_stmt_execute($query);
|
||||||
|
|
||||||
logAction("Category", "Create", "$session_name created referral category $referral");
|
logAudit("Category", "Create", "$session_name created referral category $referral");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tags - delete existing and re-insert
|
// Tags - delete existing and re-insert
|
||||||
@@ -322,7 +322,7 @@ if (isset($_POST['edit_client'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Client", "Edit", "$session_name edited client $name", $client_id, $client_id);
|
logAudit("Client", "Edit", "$session_name edited client $name", $client_id, $client_id);
|
||||||
|
|
||||||
flash_alert("Client <strong>$name</strong> updated");
|
flash_alert("Client <strong>$name</strong> updated");
|
||||||
|
|
||||||
@@ -352,7 +352,7 @@ if (isset($_GET['archive_client'])) {
|
|||||||
// Get Client Name
|
// Get Client Name
|
||||||
$client_name = escapeSql(getFieldById('clients', $client_id, 'client_name'));
|
$client_name = escapeSql(getFieldById('clients', $client_id, 'client_name'));
|
||||||
|
|
||||||
logAction("Client", "Archive", "$session_name archived client $client_name", $client_id, $client_id);
|
logAudit("Client", "Archive", "$session_name archived client $client_name", $client_id, $client_id);
|
||||||
|
|
||||||
flash_alert("Client <strong>$client_name</strong> archived", 'error');
|
flash_alert("Client <strong>$client_name</strong> archived", 'error');
|
||||||
|
|
||||||
@@ -373,7 +373,7 @@ if (isset($_GET['restore_client'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "UPDATE clients SET client_archived_at = NULL WHERE client_id = $client_id");
|
mysqli_query($mysqli, "UPDATE clients SET client_archived_at = NULL WHERE client_id = $client_id");
|
||||||
|
|
||||||
logAction("Client", "Restored", "$session_name restored client $client_name", $client_id);
|
logAudit("Client", "Restored", "$session_name restored client $client_name", $client_id);
|
||||||
|
|
||||||
flash_alert("Client <strong>$client_name</strong> restored");
|
flash_alert("Client <strong>$client_name</strong> restored");
|
||||||
|
|
||||||
@@ -475,7 +475,7 @@ if (isset($_GET['delete_client'])) {
|
|||||||
//Finally Remove the Client
|
//Finally Remove the Client
|
||||||
mysqli_query($mysqli, "DELETE FROM clients WHERE client_id = $client_id");
|
mysqli_query($mysqli, "DELETE FROM clients WHERE client_id = $client_id");
|
||||||
|
|
||||||
logAction("Client", "Deleted", "$session_name deleted Client $client_name and all associated data");
|
logAudit("Client", "Deleted", "$session_name deleted Client $client_name and all associated data");
|
||||||
|
|
||||||
flash_alert("Client <strong>$client_name</strong> deleted along with all associated data", 'error');
|
flash_alert("Client <strong>$client_name</strong> deleted along with all associated data", 'error');
|
||||||
|
|
||||||
@@ -527,7 +527,7 @@ if (isset($_POST['export_clients_csv'])) {
|
|||||||
//output all remaining data on a file pointer
|
//output all remaining data on a file pointer
|
||||||
fpassthru($f);
|
fpassthru($f);
|
||||||
|
|
||||||
logAction("Client", "Export", "$session_name exported $num_rows client(s) to a CSV file");
|
logAudit("Client", "Export", "$session_name exported $num_rows client(s) to a CSV file");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -709,7 +709,7 @@ if (isset($_POST["import_clients_csv"])) {
|
|||||||
if(mysqli_num_rows($sql) == 0) {
|
if(mysqli_num_rows($sql) == 0) {
|
||||||
mysqli_query($mysqli, "INSERT INTO categories SET category_name = '$referral', category_type = 'Referral'");
|
mysqli_query($mysqli, "INSERT INTO categories SET category_name = '$referral', category_type = 'Referral'");
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Category", "Create", "$session_name created new refferal category $referral");
|
logAudit("Category", "Create", "$session_name created new refferal category $referral");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create Location
|
// Create Location
|
||||||
@@ -729,7 +729,7 @@ if (isset($_POST["import_clients_csv"])) {
|
|||||||
}
|
}
|
||||||
fclose($file);
|
fclose($file);
|
||||||
|
|
||||||
logAction("Client", "Import", "$session_name imported $row_count client(s) via CSV file, $duplicate_count duplicate(s) found");
|
logAudit("Client", "Import", "$session_name imported $row_count client(s) via CSV file, $duplicate_count duplicate(s) found");
|
||||||
|
|
||||||
flash_alert("<strong>$row_count</strong> Client(s) added, <strong>$duplicate_count</strong> duplicate(s) found");
|
flash_alert("<strong>$row_count</strong> Client(s) added, <strong>$duplicate_count</strong> duplicate(s) found");
|
||||||
|
|
||||||
@@ -873,7 +873,7 @@ if (isset($_POST['bulk_add_client_ticket'])) {
|
|||||||
customAction('ticket_create', $ticket_id);
|
customAction('ticket_create', $ticket_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Ticket", "Bulk Create", "$session_name created $client_count tickets for $client_name");
|
logAudit("Ticket", "Bulk Create", "$session_name created $client_count tickets for $client_name");
|
||||||
|
|
||||||
flash_alert("<strong>$client_count</strong> tickets created for selected clients");
|
flash_alert("<strong>$client_count</strong> tickets created for selected clients");
|
||||||
|
|
||||||
@@ -904,11 +904,11 @@ if (isset($_POST['bulk_edit_client_industry'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE clients SET client_type = '$industry' WHERE client_id = $client_id");
|
mysqli_query($mysqli,"UPDATE clients SET client_type = '$industry' WHERE client_id = $client_id");
|
||||||
|
|
||||||
logAction("Client", "Edit", "$session_name set Industry to $industry for $client_name", $client_id);
|
logAudit("Client", "Edit", "$session_name set Industry to $industry for $client_name", $client_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Client", "Bulk Edit", "$session_name set the department $industry for $count client(s)", $client_id);
|
logAudit("Client", "Bulk Edit", "$session_name set the department $industry for $count client(s)", $client_id);
|
||||||
|
|
||||||
flash_alert("Set the Industry to <strong>$industry</strong> for <strong>$count</strong> clients");
|
flash_alert("Set the Industry to <strong>$industry</strong> for <strong>$count</strong> clients");
|
||||||
}
|
}
|
||||||
@@ -938,11 +938,11 @@ if (isset($_POST['bulk_edit_client_referral'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE clients SET client_referral = '$referral' WHERE client_id = $client_id");
|
mysqli_query($mysqli,"UPDATE clients SET client_referral = '$referral' WHERE client_id = $client_id");
|
||||||
|
|
||||||
logAction("Client", "Edit", "$session_name set Referral to $referral for $client_name", $client_id);
|
logAudit("Client", "Edit", "$session_name set Referral to $referral for $client_name", $client_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Client", "Bulk Edit", "$session_name set the referral $referral for $count client(s)", $client_id);
|
logAudit("Client", "Bulk Edit", "$session_name set the referral $referral for $count client(s)", $client_id);
|
||||||
|
|
||||||
flash_alert("Set the Referral to <strong>$referral</strong> for <strong>$count</strong> clients");
|
flash_alert("Set the Referral to <strong>$referral</strong> for <strong>$count</strong> clients");
|
||||||
}
|
}
|
||||||
@@ -972,11 +972,11 @@ if (isset($_POST['bulk_edit_client_hourly_rate'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE clients SET client_rate = '$rate' WHERE client_id = $client_id");
|
mysqli_query($mysqli,"UPDATE clients SET client_rate = '$rate' WHERE client_id = $client_id");
|
||||||
|
|
||||||
logAction("Client", "Edit", "$session_name set Hourly Rate to" . numfmt_format_currency($currency_format, $rate, $session_company_currency) . "for $client_name", $client_id);
|
logAudit("Client", "Edit", "$session_name set Hourly Rate to" . numfmt_format_currency($currency_format, $rate, $session_company_currency) . "for $client_name", $client_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Client", "Bulk Edit", "$session_name set the hourly rate" . numfmt_format_currency($currency_format, $rate, $session_company_currency) . "for $count client(s)", $client_id);
|
logAudit("Client", "Bulk Edit", "$session_name set the hourly rate" . numfmt_format_currency($currency_format, $rate, $session_company_currency) . "for $count client(s)", $client_id);
|
||||||
|
|
||||||
flash_alert("Set the Hourly Rate to <strong>" . numfmt_format_currency($currency_format, $rate, $session_company_currency) . "</strong> for <strong>$count</strong> client(s)");
|
flash_alert("Set the Hourly Rate to <strong>" . numfmt_format_currency($currency_format, $rate, $session_company_currency) . "</strong> for <strong>$count</strong> client(s)");
|
||||||
}
|
}
|
||||||
@@ -1006,11 +1006,11 @@ if (isset($_POST['bulk_edit_client_net_terms'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE clients SET client_net_terms = $net_terms WHERE client_id = $client_id");
|
mysqli_query($mysqli,"UPDATE clients SET client_net_terms = $net_terms WHERE client_id = $client_id");
|
||||||
|
|
||||||
logAction("Client", "Edit", "$session_name set net terms to $net_terms days for $client_name", $client_id);
|
logAudit("Client", "Edit", "$session_name set net terms to $net_terms days for $client_name", $client_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Client", "Bulk Edit", "$session_name set the net terms to $net_terms days for $count client(s)", $client_id);
|
logAudit("Client", "Bulk Edit", "$session_name set the net terms to $net_terms days for $count client(s)", $client_id);
|
||||||
|
|
||||||
flash_alert("Set Net Term to <strong>$net_terms days</strong> for <strong>$count</strong> client(s)");
|
flash_alert("Set Net Term to <strong>$net_terms days</strong> for <strong>$count</strong> client(s)");
|
||||||
}
|
}
|
||||||
@@ -1051,11 +1051,11 @@ if (isset($_POST['bulk_assign_client_tags'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Client", "Edit", "$session_name added tags to $client_name", $client_id, $client_id);
|
logAudit("Client", "Edit", "$session_name added tags to $client_name", $client_id, $client_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Client", "Bulk Edit", "$session_name added tags for $count clients", $client_id);
|
logAudit("Client", "Bulk Edit", "$session_name added tags for $count clients", $client_id);
|
||||||
|
|
||||||
flash_alert("Assigned tags for <strong>$count</strong> clients");
|
flash_alert("Assigned tags for <strong>$count</strong> clients");
|
||||||
}
|
}
|
||||||
@@ -1143,7 +1143,7 @@ if (isset($_POST['bulk_send_client_email']) && isset($_POST['client_ids'])) {
|
|||||||
|
|
||||||
if (!empty($data)) {
|
if (!empty($data)) {
|
||||||
addToMailQueue($data);
|
addToMailQueue($data);
|
||||||
logAction("Bulk Mail", "Send", "$session_name sent " . count($data) . " messages via bulk mail");
|
logAudit("Bulk Mail", "Send", "$session_name sent " . count($data) . " messages via bulk mail");
|
||||||
flash_alert("<strong>" . count($data) . "</strong> messages queued");
|
flash_alert("<strong>" . count($data) . "</strong> messages queued");
|
||||||
} else {
|
} else {
|
||||||
flash_alert("No valid contacts found to queue emails.", 'error');
|
flash_alert("No valid contacts found to queue emails.", 'error');
|
||||||
@@ -1173,13 +1173,13 @@ if (isset($_POST['bulk_archive_clients'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE clients SET client_archived_at = NOW() WHERE client_id = $client_id");
|
mysqli_query($mysqli,"UPDATE clients SET client_archived_at = NOW() WHERE client_id = $client_id");
|
||||||
|
|
||||||
logAction("Client", "Archive", "$session_name archived $client_name", $client_id);
|
logAudit("Client", "Archive", "$session_name archived $client_name", $client_id);
|
||||||
|
|
||||||
$count++;
|
$count++;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Client", "Bulk Archive", "$session_name archived $count clients", $client_id);
|
logAudit("Client", "Bulk Archive", "$session_name archived $count clients", $client_id);
|
||||||
|
|
||||||
flash_alert("Archived $count client(s)", 'error');
|
flash_alert("Archived $count client(s)", 'error');
|
||||||
|
|
||||||
@@ -1209,11 +1209,11 @@ if (isset($_POST['bulk_unarchive_clients'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE clients SET client_archived_at = NULL WHERE client_id = $client_id");
|
mysqli_query($mysqli,"UPDATE clients SET client_archived_at = NULL WHERE client_id = $client_id");
|
||||||
|
|
||||||
logAction("client", "Restore", "$session_name restored $client_name", $client_id);
|
logAudit("client", "Restore", "$session_name restored $client_name", $client_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Client", "Bulk Restore", "$session_name restored $count client(s)", $client_id);
|
logAudit("Client", "Bulk Restore", "$session_name restored $count client(s)", $client_id);
|
||||||
|
|
||||||
flash_alert("You restored <strong>$count</strong> client(s)");
|
flash_alert("You restored <strong>$count</strong> client(s)");
|
||||||
|
|
||||||
@@ -1264,7 +1264,7 @@ if (isset($_POST["export_client_pdf"])) {
|
|||||||
$export_trips = intval($_POST["export_trips"]);
|
$export_trips = intval($_POST["export_trips"]);
|
||||||
$export_logs = intval($_POST["export_logs"]);
|
$export_logs = intval($_POST["export_logs"]);
|
||||||
|
|
||||||
logAction("Client", "Export", "$session_name exported client data to a PDF file", $client_id, $client_id);
|
logAudit("Client", "Export", "$session_name exported client data to a PDF file", $client_id, $client_id);
|
||||||
|
|
||||||
// Get client record (joining primary contact and primary location)
|
// Get client record (joining primary contact and primary location)
|
||||||
$sql = mysqli_query($mysqli, "SELECT * FROM clients
|
$sql = mysqli_query($mysqli, "SELECT * FROM clients
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ if (isset($_POST['add_contact'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Contact", "Create", "$session_name created contact $name", $client_id, $contact_id);
|
logAudit("Contact", "Create", "$session_name created contact $name", $client_id, $contact_id);
|
||||||
|
|
||||||
customAction('contact_create', $contact_id);
|
customAction('contact_create', $contact_id);
|
||||||
|
|
||||||
@@ -217,7 +217,7 @@ if (isset($_POST['edit_contact'])) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Contact", "Edit", "$session_name edited contact $name", $client_id, $contact_id);
|
logAudit("Contact", "Edit", "$session_name edited contact $name", $client_id, $contact_id);
|
||||||
|
|
||||||
customAction('contact_update', $contact_id);
|
customAction('contact_update', $contact_id);
|
||||||
|
|
||||||
@@ -250,7 +250,7 @@ if (isset($_POST['add_contact_note'])) {
|
|||||||
$contact_note_id = mysqli_insert_id($mysqli);
|
$contact_note_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
//Logging
|
//Logging
|
||||||
logAction("Contact", "Edit", "$session_name created a $type note for contact $contact_name", $client_id, $contact_id);
|
logAudit("Contact", "Edit", "$session_name created a $type note for contact $contact_name", $client_id, $contact_id);
|
||||||
|
|
||||||
$_SESSION['alert_message'] = "Note <strong>$type</strong> created for <strong>$contact_name</strong>";
|
$_SESSION['alert_message'] = "Note <strong>$type</strong> created for <strong>$contact_name</strong>";
|
||||||
|
|
||||||
@@ -278,7 +278,7 @@ if (isset($_GET['archive_contact_note'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE contact_notes SET contact_note_archived_at = NOW() WHERE contact_note_id = $contact_note_id");
|
mysqli_query($mysqli,"UPDATE contact_notes SET contact_note_archived_at = NOW() WHERE contact_note_id = $contact_note_id");
|
||||||
|
|
||||||
logAction("Contact", "Edit", "$session_name archived note $contact_note_type for $contact_name", $client_id, $contact_id);
|
logAudit("Contact", "Edit", "$session_name archived note $contact_note_type for $contact_name", $client_id, $contact_id);
|
||||||
|
|
||||||
flash_alert("Note <strong>$contact_note_type</strong> archived", 'error');
|
flash_alert("Note <strong>$contact_note_type</strong> archived", 'error');
|
||||||
|
|
||||||
@@ -306,7 +306,7 @@ if (isset($_GET['restore_contact_note'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE contact_notes SET contact_note_archived_at = NULL WHERE contact_note_id = $contact_note_id");
|
mysqli_query($mysqli,"UPDATE contact_notes SET contact_note_archived_at = NULL WHERE contact_note_id = $contact_note_id");
|
||||||
|
|
||||||
logAction("Contact", "Edit", "$session_name restored note $contact_note_type for $contact_name", $client_id, $contact_id);
|
logAudit("Contact", "Edit", "$session_name restored note $contact_note_type for $contact_name", $client_id, $contact_id);
|
||||||
|
|
||||||
flash_alert("Note <strong>$contact_note_type</strong> restored");
|
flash_alert("Note <strong>$contact_note_type</strong> restored");
|
||||||
|
|
||||||
@@ -334,7 +334,7 @@ if (isset($_GET['delete_contact_note'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM contact_notes WHERE contact_note_id = $contact_note_id");
|
mysqli_query($mysqli,"DELETE FROM contact_notes WHERE contact_note_id = $contact_note_id");
|
||||||
|
|
||||||
logAction("Contact", "Edit", "$session_name deleted $contact_note_type note for $contact_name", $client_id, $contact_id);
|
logAudit("Contact", "Edit", "$session_name deleted $contact_note_type note for $contact_name", $client_id, $contact_id);
|
||||||
|
|
||||||
flash_alert("Note <strong>$contact_note_type</strong> deleted.", 'error');
|
flash_alert("Note <strong>$contact_note_type</strong> deleted.", 'error');
|
||||||
|
|
||||||
@@ -374,11 +374,11 @@ if (isset($_POST['bulk_assign_contact_location'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE contacts SET contact_location_id = $location_id WHERE contact_id = $contact_id");
|
mysqli_query($mysqli,"UPDATE contacts SET contact_location_id = $location_id WHERE contact_id = $contact_id");
|
||||||
|
|
||||||
logAction("Contact", "Edit", "$session_name assigned $contaxt_name to location $location_name", $client_id, $contact_id);
|
logAudit("Contact", "Edit", "$session_name assigned $contaxt_name to location $location_name", $client_id, $contact_id);
|
||||||
|
|
||||||
} // End Assign Location Loop
|
} // End Assign Location Loop
|
||||||
|
|
||||||
logAction("Contact", "Bulk Edit", "$session_name assigned $contact_count contacts to location $location_name", $client_id);
|
logAudit("Contact", "Bulk Edit", "$session_name assigned $contact_count contacts to location $location_name", $client_id);
|
||||||
|
|
||||||
flash_alert("<b>$contact_count</b> contacts assigned to location <b>$location_name</b>");
|
flash_alert("<b>$contact_count</b> contacts assigned to location <b>$location_name</b>");
|
||||||
}
|
}
|
||||||
@@ -414,11 +414,11 @@ if (isset($_POST['bulk_edit_contact_phone'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE contacts SET contact_phone = '$phone' WHERE contact_id = $contact_id");
|
mysqli_query($mysqli,"UPDATE contacts SET contact_phone = '$phone' WHERE contact_id = $contact_id");
|
||||||
|
|
||||||
logAction("Contact", "Edit", "$session_name set Phone Number to $phone for $contact_name", $client_id, $contact_id);
|
logAudit("Contact", "Edit", "$session_name set Phone Number to $phone for $contact_name", $client_id, $contact_id);
|
||||||
|
|
||||||
} // End Assign Location Loop
|
} // End Assign Location Loop
|
||||||
|
|
||||||
logAction("Contact", "Bulk Edit", "$session_name set the Phone Number $phone for $contact_count contacts", $client_id);
|
logAudit("Contact", "Bulk Edit", "$session_name set the Phone Number $phone for $contact_count contacts", $client_id);
|
||||||
|
|
||||||
flash_alert("Phone Number set to <b>" . formatPhoneNumber($phone) . "</b> on $contact_count</b> contacts");
|
flash_alert("Phone Number set to <b>" . formatPhoneNumber($phone) . "</b> on $contact_count</b> contacts");
|
||||||
}
|
}
|
||||||
@@ -454,11 +454,11 @@ if (isset($_POST['bulk_edit_contact_department'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE contacts SET contact_department = '$department' WHERE contact_id = $contact_id");
|
mysqli_query($mysqli,"UPDATE contacts SET contact_department = '$department' WHERE contact_id = $contact_id");
|
||||||
|
|
||||||
logAction("Contact", "Edit", "$session_name set Department to $department for $contact_name", $client_id, $contact_id);
|
logAudit("Contact", "Edit", "$session_name set Department to $department for $contact_name", $client_id, $contact_id);
|
||||||
|
|
||||||
} // End Assign Location Loop
|
} // End Assign Location Loop
|
||||||
|
|
||||||
logAction("Contact", "Bulk Edit", "$session_name set the department $department for $contact_count contacts", $client_id);
|
logAudit("Contact", "Bulk Edit", "$session_name set the department $department for $contact_count contacts", $client_id);
|
||||||
|
|
||||||
flash_alert("You set the Department to <strong>$department</strong> for <strong>$contact_count</strong> contacts");
|
flash_alert("You set the Department to <strong>$department</strong> for <strong>$contact_count</strong> contacts");
|
||||||
}
|
}
|
||||||
@@ -496,13 +496,13 @@ if (isset($_POST['bulk_edit_contact_role'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE contacts SET contact_important = $contact_important, contact_billing = $contact_billing, contact_technical = $contact_technical WHERE contact_id = $contact_id");
|
mysqli_query($mysqli,"UPDATE contacts SET contact_important = $contact_important, contact_billing = $contact_billing, contact_technical = $contact_technical WHERE contact_id = $contact_id");
|
||||||
|
|
||||||
logAction("Contact", "Edit", "$session_name updated the contact role for $contact_name", $client_id, $contact_id);
|
logAudit("Contact", "Edit", "$session_name updated the contact role for $contact_name", $client_id, $contact_id);
|
||||||
|
|
||||||
customAction('contact_update', $contact_id);
|
customAction('contact_update', $contact_id);
|
||||||
|
|
||||||
} // End Assign Location Loop
|
} // End Assign Location Loop
|
||||||
|
|
||||||
logAction("Contact", "Bulk Edit", "$session_name edited the contact role for $contact_count contacts", $client_id);
|
logAudit("Contact", "Bulk Edit", "$session_name edited the contact role for $contact_count contacts", $client_id);
|
||||||
|
|
||||||
flash_alert("You updated contact roles for <b>$contact_count</b> contacts");
|
flash_alert("You updated contact roles for <b>$contact_count</b> contacts");
|
||||||
}
|
}
|
||||||
@@ -551,11 +551,11 @@ if (isset($_POST['bulk_assign_contact_tags'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Contact", "Edit", "$session_name added tags to $contact_name", $client_id, $contact_id);
|
logAudit("Contact", "Edit", "$session_name added tags to $contact_name", $client_id, $contact_id);
|
||||||
|
|
||||||
} // End Assign Location Loop
|
} // End Assign Location Loop
|
||||||
|
|
||||||
logAction("Contact", "Bulk Edit", "$session_name added tags for $contact_count contacts", $client_id);
|
logAudit("Contact", "Bulk Edit", "$session_name added tags for $contact_count contacts", $client_id);
|
||||||
|
|
||||||
flash_alert("You assigned tags for <strong>$count</strong> contacts");
|
flash_alert("You assigned tags for <strong>$count</strong> contacts");
|
||||||
}
|
}
|
||||||
@@ -605,7 +605,7 @@ if (isset($_POST['send_bulk_mail_now'])) {
|
|||||||
}
|
}
|
||||||
addToMailQueue($data);
|
addToMailQueue($data);
|
||||||
|
|
||||||
logAction("Bulk Mail", "Send", "$session_name sent $count messages via bulk mail");
|
logAudit("Bulk Mail", "Send", "$session_name sent $count messages via bulk mail");
|
||||||
|
|
||||||
flash_alert("<strong>$count</strong> messages queued");
|
flash_alert("<strong>$count</strong> messages queued");
|
||||||
|
|
||||||
@@ -650,14 +650,14 @@ if (isset($_POST['bulk_archive_contacts'])) {
|
|||||||
mysqli_query($mysqli,"UPDATE contacts SET contact_important = 0, contact_billing = 0, contact_technical = 0, contact_archived_at = NOW() WHERE contact_id = $contact_id");
|
mysqli_query($mysqli,"UPDATE contacts SET contact_important = 0, contact_billing = 0, contact_technical = 0, contact_archived_at = NOW() WHERE contact_id = $contact_id");
|
||||||
|
|
||||||
// Individual Contact logging
|
// Individual Contact logging
|
||||||
logAction("Contact", "Archive", "$session_name archived $contact_name", $client_id, $contact_id);
|
logAudit("Contact", "Archive", "$session_name archived $contact_name", $client_id, $contact_id);
|
||||||
|
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Contact", "Bulk Archive", "$session_name archived $count contacts", $client_id);
|
logAudit("Contact", "Bulk Archive", "$session_name archived $count contacts", $client_id);
|
||||||
|
|
||||||
flash_alert("Archived $count contact(s)", 'error');
|
flash_alert("Archived $count contact(s)", 'error');
|
||||||
|
|
||||||
@@ -698,11 +698,11 @@ if (isset($_POST['bulk_restore_contacts'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE contacts SET contact_archived_at = NULL WHERE contact_id = $contact_id");
|
mysqli_query($mysqli,"UPDATE contacts SET contact_archived_at = NULL WHERE contact_id = $contact_id");
|
||||||
|
|
||||||
logAction("Contact", "Restore", "$session_name restored $contact_name", $client_id, $contact_id);
|
logAudit("Contact", "Restore", "$session_name restored $contact_name", $client_id, $contact_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Contact", "Bulk Restore", "$session_name restored $count contacts", $client_id);
|
logAudit("Contact", "Bulk Restore", "$session_name restored $count contacts", $client_id);
|
||||||
|
|
||||||
flash_alert("Restored <strong>$count</strong> contact(s)");
|
flash_alert("Restored <strong>$count</strong> contact(s)");
|
||||||
|
|
||||||
@@ -743,11 +743,11 @@ if (isset($_POST['bulk_delete_contacts'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "DELETE FROM contacts WHERE contact_id = $contact_id AND contact_client_id = $client_id");
|
mysqli_query($mysqli, "DELETE FROM contacts WHERE contact_id = $contact_id AND contact_client_id = $client_id");
|
||||||
|
|
||||||
logAction("Contact", "Delete", "$session_name deleted $contact_name", $client_id);
|
logAudit("Contact", "Delete", "$session_name deleted $contact_name", $client_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Contact", "Bulk Delete", "$session_name deleted $count contacts", $client_id);
|
logAudit("Contact", "Bulk Delete", "$session_name deleted $count contacts", $client_id);
|
||||||
|
|
||||||
flash_alert("You deleted <strong>$count</strong> contact(s)");
|
flash_alert("You deleted <strong>$count</strong> contact(s)");
|
||||||
|
|
||||||
@@ -857,7 +857,7 @@ if (isset($_GET['anonymize_contact'])) {
|
|||||||
// Archive contact
|
// Archive contact
|
||||||
mysqli_query($mysqli,"UPDATE contacts SET contact_archived_at = NOW() WHERE contact_id = $contact_id");
|
mysqli_query($mysqli,"UPDATE contacts SET contact_archived_at = NOW() WHERE contact_id = $contact_id");
|
||||||
|
|
||||||
logAction("Contact", "Archive", "$session_name archived and anonymized contact", $client_id, $contact_id);
|
logAudit("Contact", "Archive", "$session_name archived and anonymized contact", $client_id, $contact_id);
|
||||||
|
|
||||||
flash_alert("Contact $contact_name anonymized & archived", 'error');
|
flash_alert("Contact $contact_name anonymized & archived", 'error');
|
||||||
|
|
||||||
@@ -889,7 +889,7 @@ if (isset($_GET['archive_contact'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE contacts SET contact_important = 0, contact_billing = 0, contact_technical = 0, contact_archived_at = NOW() WHERE contact_id = $contact_id");
|
mysqli_query($mysqli,"UPDATE contacts SET contact_important = 0, contact_billing = 0, contact_technical = 0, contact_archived_at = NOW() WHERE contact_id = $contact_id");
|
||||||
|
|
||||||
logAction("Contact", "Archive", "$session_name archived contact $contact_name", $client_id, $contact_id);
|
logAudit("Contact", "Archive", "$session_name archived contact $contact_name", $client_id, $contact_id);
|
||||||
|
|
||||||
flash_alert("Contact <strong>$contact_name</strong> has been archived", 'error');
|
flash_alert("Contact <strong>$contact_name</strong> has been archived", 'error');
|
||||||
|
|
||||||
@@ -921,7 +921,7 @@ if (isset($_GET['restore_contact'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE contacts SET contact_archived_at = NULL WHERE contact_id = $contact_id");
|
mysqli_query($mysqli,"UPDATE contacts SET contact_archived_at = NULL WHERE contact_id = $contact_id");
|
||||||
|
|
||||||
logAction("Contact", "Restore", "$session_name restored contact $contact_name", $client_id, $contact_id);
|
logAudit("Contact", "Restore", "$session_name restored contact $contact_name", $client_id, $contact_id);
|
||||||
|
|
||||||
flash_alert("Contact <strong>$contact_name</strong> Restored");
|
flash_alert("Contact <strong>$contact_name</strong> Restored");
|
||||||
|
|
||||||
@@ -953,7 +953,7 @@ if (isset($_GET['delete_contact'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM contacts WHERE contact_id = $contact_id");
|
mysqli_query($mysqli,"DELETE FROM contacts WHERE contact_id = $contact_id");
|
||||||
|
|
||||||
logAction("Contact", "Delete", "$session_name deleted contact $contact_name", $client_id);
|
logAudit("Contact", "Delete", "$session_name deleted contact $contact_name", $client_id);
|
||||||
|
|
||||||
flash_alert("Contact <strong>$contact_name</strong> has been deleted.", 'error');
|
flash_alert("Contact <strong>$contact_name</strong> has been deleted.", 'error');
|
||||||
|
|
||||||
@@ -983,7 +983,7 @@ if (isset($_POST['link_contact_to_asset'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE assets SET asset_contact_id = $contact_id WHERE asset_id = $asset_id");
|
mysqli_query($mysqli,"UPDATE assets SET asset_contact_id = $contact_id WHERE asset_id = $asset_id");
|
||||||
|
|
||||||
logAction("Asset", "Link", "$session_name linked asset $asset_name to contact $contact_name", $client_id, $asset_id);
|
logAudit("Asset", "Link", "$session_name linked asset $asset_name to contact $contact_name", $client_id, $asset_id);
|
||||||
|
|
||||||
flash_alert("Contact <strong>$contact_name</strong> linked with asset <strong>$asset_name</strong>");
|
flash_alert("Contact <strong>$contact_name</strong> linked with asset <strong>$asset_name</strong>");
|
||||||
|
|
||||||
@@ -1013,7 +1013,7 @@ if (isset($_GET['unlink_asset_from_contact'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE assets SET asset_contact_id = 0 WHERE asset_id = $asset_id");
|
mysqli_query($mysqli,"UPDATE assets SET asset_contact_id = 0 WHERE asset_id = $asset_id");
|
||||||
|
|
||||||
logAction("Asset", "Unlink", "$session_name unlinked contact $contact_name from asset $asset_name", $client_id, $asset_id);
|
logAudit("Asset", "Unlink", "$session_name unlinked contact $contact_name from asset $asset_name", $client_id, $asset_id);
|
||||||
|
|
||||||
flash_alert("Asset <strong>$asset_name</strong> unlinked from Contact <strong>$contact_name</strong>", 'error');
|
flash_alert("Asset <strong>$asset_name</strong> unlinked from Contact <strong>$contact_name</strong>", 'error');
|
||||||
|
|
||||||
@@ -1043,7 +1043,7 @@ if (isset($_POST['link_software_to_contact'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO software_contacts SET contact_id = $contact_id, software_id = $software_id");
|
mysqli_query($mysqli,"INSERT INTO software_contacts SET contact_id = $contact_id, software_id = $software_id");
|
||||||
|
|
||||||
logAction("Software", "Link", "$session_name added software license $software_name to contact $contact_name", $client_id, $software_id);
|
logAudit("Software", "Link", "$session_name added software license $software_name to contact $contact_name", $client_id, $software_id);
|
||||||
|
|
||||||
flash_alert("Software <strong>$software_name</strong> licensed for contact <strong>$contact_name</strong>");
|
flash_alert("Software <strong>$software_name</strong> licensed for contact <strong>$contact_name</strong>");
|
||||||
|
|
||||||
@@ -1073,7 +1073,7 @@ if (isset($_GET['unlink_software_from_contact'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM software_contacts WHERE contact_id = $contact_id AND software_id = $software_id");
|
mysqli_query($mysqli,"DELETE FROM software_contacts WHERE contact_id = $contact_id AND software_id = $software_id");
|
||||||
|
|
||||||
logAction("software", "Unlink", "$session_name removed software license $software_name from contact $contact_name", $client_id, $software_id);
|
logAudit("software", "Unlink", "$session_name removed software license $software_name from contact $contact_name", $client_id, $software_id);
|
||||||
|
|
||||||
flash_alert("Removed Software License <strong>$software_name</strong> for Contact <strong>$contact_name</strong>", 'error');
|
flash_alert("Removed Software License <strong>$software_name</strong> for Contact <strong>$contact_name</strong>", 'error');
|
||||||
|
|
||||||
@@ -1103,7 +1103,7 @@ if (isset($_POST['link_contact_to_credential'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE credentials SET credential_contact_id = $contact_id WHERE credential_id = $credential_id");
|
mysqli_query($mysqli,"UPDATE credentials SET credential_contact_id = $contact_id WHERE credential_id = $credential_id");
|
||||||
|
|
||||||
logAction("Asset", "Link", "$session_name linked credential $credential_name to contact $contact_name", $client_id, $credential_id);
|
logAudit("Asset", "Link", "$session_name linked credential $credential_name to contact $contact_name", $client_id, $credential_id);
|
||||||
|
|
||||||
flash_alert("Contact <strong>$contact_name</strong> linked with credential <strong>$credential_name</strong>");
|
flash_alert("Contact <strong>$contact_name</strong> linked with credential <strong>$credential_name</strong>");
|
||||||
|
|
||||||
@@ -1133,7 +1133,7 @@ if (isset($_GET['unlink_credential_from_contact'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE credentials SET credential_contact_id = 0 WHERE credential_id = $credential_id");
|
mysqli_query($mysqli,"UPDATE credentials SET credential_contact_id = 0 WHERE credential_id = $credential_id");
|
||||||
|
|
||||||
logAction("Credential", "Unlink", "$session_name unlinked contact $contact_name from credential $credential_name", $client_id, $credential_id);
|
logAudit("Credential", "Unlink", "$session_name unlinked contact $contact_name from credential $credential_name", $client_id, $credential_id);
|
||||||
|
|
||||||
flash_alert("Credential <strong>$credential_name</strong> unlinked from Contact <strong>$contact_name</strong>", 'error');
|
flash_alert("Credential <strong>$credential_name</strong> unlinked from Contact <strong>$contact_name</strong>", 'error');
|
||||||
|
|
||||||
@@ -1163,7 +1163,7 @@ if (isset($_POST['link_service_to_contact'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO service_contacts SET contact_id = $contact_id, service_id = $service_id");
|
mysqli_query($mysqli,"INSERT INTO service_contacts SET contact_id = $contact_id, service_id = $service_id");
|
||||||
|
|
||||||
logAction("Service", "Link", "$session_name linked contact $contact_name to service $service_name", $client_id, $service_id);
|
logAudit("Service", "Link", "$session_name linked contact $contact_name to service $service_name", $client_id, $service_id);
|
||||||
|
|
||||||
flash_alert("service <strong>$service_name</strong> linked with contact <strong>$contact_name</strong>");
|
flash_alert("service <strong>$service_name</strong> linked with contact <strong>$contact_name</strong>");
|
||||||
|
|
||||||
@@ -1193,7 +1193,7 @@ if (isset($_GET['unlink_service_from_contact'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM service_contacts WHERE contact_id = $contact_id AND service_id = $service_id");
|
mysqli_query($mysqli,"DELETE FROM service_contacts WHERE contact_id = $contact_id AND service_id = $service_id");
|
||||||
|
|
||||||
logAction("service", "Unlink", "$session_name unlinked contact $contact_name from service $service_name", $client_id, $service_id);
|
logAudit("service", "Unlink", "$session_name unlinked contact $contact_name from service $service_name", $client_id, $service_id);
|
||||||
|
|
||||||
flash_alert("Contact <strong>$contact_name</strong> unlinked from service <strong>$service_name</strong>", 'error');
|
flash_alert("Contact <strong>$contact_name</strong> unlinked from service <strong>$service_name</strong>", 'error');
|
||||||
|
|
||||||
@@ -1224,7 +1224,7 @@ if (isset($_POST['link_contact_to_file'])) {
|
|||||||
// Contact add query
|
// Contact add query
|
||||||
mysqli_query($mysqli,"INSERT INTO contact_files SET contact_id = $contact_id, file_id = $file_id");
|
mysqli_query($mysqli,"INSERT INTO contact_files SET contact_id = $contact_id, file_id = $file_id");
|
||||||
|
|
||||||
logAction("File", "Link", "$session_name linked contact $contact_name to file $file_name", $client_id, $file_id);
|
logAudit("File", "Link", "$session_name linked contact $contact_name to file $file_name", $client_id, $file_id);
|
||||||
|
|
||||||
flash_alert("Contact <strong>$contact_name</strong> linked with File <strong>$file_name</strong>");
|
flash_alert("Contact <strong>$contact_name</strong> linked with File <strong>$file_name</strong>");
|
||||||
|
|
||||||
@@ -1254,7 +1254,7 @@ if (isset($_GET['unlink_contact_from_file'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM contact_files WHERE contact_id = $contact_id AND file_id = $file_id");
|
mysqli_query($mysqli,"DELETE FROM contact_files WHERE contact_id = $contact_id AND file_id = $file_id");
|
||||||
|
|
||||||
logAction("File", "Unlink", "$session_name unlinked contact $contact_name from file $file_name", $client_id, $file_id);
|
logAudit("File", "Unlink", "$session_name unlinked contact $contact_name from file $file_name", $client_id, $file_id);
|
||||||
|
|
||||||
flash_alert("Contact <strong>$contact_name</strong> unlinked from file <strong>$file_name</strong>", 'error');
|
flash_alert("Contact <strong>$contact_name</strong> unlinked from file <strong>$file_name</strong>", 'error');
|
||||||
|
|
||||||
@@ -1314,7 +1314,7 @@ if (isset($_POST['export_contacts_csv'])) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Contact", "Export", "$session_name exported $num_rows contact(s) to a CSV file", $client_id);
|
logAudit("Contact", "Export", "$session_name exported $num_rows contact(s) to a CSV file", $client_id);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
@@ -1413,7 +1413,7 @@ if (isset($_POST["import_contacts_csv"])) {
|
|||||||
}
|
}
|
||||||
fclose($file);
|
fclose($file);
|
||||||
|
|
||||||
logAction("Contact", "Import", "$session_name imported $row_count contact(s) via CSV file", $client_id);
|
logAudit("Contact", "Import", "$session_name imported $row_count contact(s) via CSV file", $client_id);
|
||||||
|
|
||||||
flash_alert("$row_count Contact(s) added, $duplicate_count duplicate(s) detected", 'warning');
|
flash_alert("$row_count Contact(s) added, $duplicate_count duplicate(s) detected", 'warning');
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ if (isset($_POST['add_credential'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Credential", "Create", "$session_name created credential $name", $client_id, $credential_id);
|
logAudit("Credential", "Create", "$session_name created credential $name", $client_id, $credential_id);
|
||||||
|
|
||||||
flash_alert("Credential <strong>$name</strong> created");
|
flash_alert("Credential <strong>$name</strong> created");
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ if (isset($_POST['edit_credential'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Credential", "Edit", "$session_name edited credential $name", $client_id, $credential_id);
|
logAudit("Credential", "Edit", "$session_name edited credential $name", $client_id, $credential_id);
|
||||||
|
|
||||||
flash_alert("Credential <strong>$name</strong> edited");
|
flash_alert("Credential <strong>$name</strong> edited");
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ if(isset($_GET['archive_credential'])){
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE credentials SET credential_archived_at = NOW() WHERE credential_id = $credential_id");
|
mysqli_query($mysqli,"UPDATE credentials SET credential_archived_at = NOW() WHERE credential_id = $credential_id");
|
||||||
|
|
||||||
logAction("Credential", "Archive", "$session_name archived credential $credential_name", $client_id, $credential_id);
|
logAudit("Credential", "Archive", "$session_name archived credential $credential_name", $client_id, $credential_id);
|
||||||
|
|
||||||
flash_alert("Credential <strong>$credential_name</strong> archived", 'error');
|
flash_alert("Credential <strong>$credential_name</strong> archived", 'error');
|
||||||
|
|
||||||
@@ -127,7 +127,7 @@ if(isset($_GET['restore_credential'])){
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE credentials SET credential_archived_at = NULL WHERE credential_id = $credential_id");
|
mysqli_query($mysqli,"UPDATE credentials SET credential_archived_at = NULL WHERE credential_id = $credential_id");
|
||||||
|
|
||||||
logAction("Credential", "Restore", "$session_name restored credential $credential_name", $client_id, $credential_id);
|
logAudit("Credential", "Restore", "$session_name restored credential $credential_name", $client_id, $credential_id);
|
||||||
|
|
||||||
flash_alert("Credential <strong>$credential_name</strong> restored");
|
flash_alert("Credential <strong>$credential_name</strong> restored");
|
||||||
|
|
||||||
@@ -153,7 +153,7 @@ if (isset($_GET['delete_credential'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM credentials WHERE credential_id = $credential_id");
|
mysqli_query($mysqli,"DELETE FROM credentials WHERE credential_id = $credential_id");
|
||||||
|
|
||||||
logAction("Credential", "Delete", "$session_name deleted credential $credential_name", $client_id);
|
logAudit("Credential", "Delete", "$session_name deleted credential $credential_name", $client_id);
|
||||||
|
|
||||||
flash_alert("Credential <strong>$credential_name</strong> deleted", 'error');
|
flash_alert("Credential <strong>$credential_name</strong> deleted", 'error');
|
||||||
|
|
||||||
@@ -201,13 +201,13 @@ if (isset($_POST['bulk_assign_credential_tags'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Credential", "Edit", "$session_name added tags to $credential_name", $client_id, $credential_id);
|
logAudit("Credential", "Edit", "$session_name added tags to $credential_name", $client_id, $credential_id);
|
||||||
|
|
||||||
flash_alert("Assigned tags for <strong>$count</strong> credentials");
|
flash_alert("Assigned tags for <strong>$count</strong> credentials");
|
||||||
|
|
||||||
} // End Assign Loop
|
} // End Assign Loop
|
||||||
|
|
||||||
logAction("Credential", "Bulk Edit", "$session_name added tags to $count credentials", $client_id);
|
logAudit("Credential", "Bulk Edit", "$session_name added tags to $count credentials", $client_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -239,11 +239,11 @@ if (isset($_POST['bulk_favorite_credentials'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE credentials SET credential_favorite = 1 WHERE credential_id = $credential_id");
|
mysqli_query($mysqli,"UPDATE credentials SET credential_favorite = 1 WHERE credential_id = $credential_id");
|
||||||
|
|
||||||
logAction("Credential", "Edit", "$session_name marked credential $credential_name a favorite", $client_id, $credential_id);
|
logAudit("Credential", "Edit", "$session_name marked credential $credential_name a favorite", $client_id, $credential_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Credential", "Bulk Edit", "$session_name favorited $count credentials", $client_id);
|
logAudit("Credential", "Bulk Edit", "$session_name favorited $count credentials", $client_id);
|
||||||
|
|
||||||
flash_alert("Favorited <strong>$count</strong> credential(s)");
|
flash_alert("Favorited <strong>$count</strong> credential(s)");
|
||||||
|
|
||||||
@@ -277,11 +277,11 @@ if (isset($_POST['bulk_unfavorite_credentials'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE credentials SET credential_favorite = 0 WHERE credential_id = $credential_id");
|
mysqli_query($mysqli,"UPDATE credentials SET credential_favorite = 0 WHERE credential_id = $credential_id");
|
||||||
|
|
||||||
logAction("Credential", "Edit", "$session_name unfavorited credential $credential_name", $client_id, $credential_id);
|
logAudit("Credential", "Edit", "$session_name unfavorited credential $credential_name", $client_id, $credential_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Crednetial", "Bulk Edit", "$session_name unfavorited $count credentials", $client_id);
|
logAudit("Crednetial", "Bulk Edit", "$session_name unfavorited $count credentials", $client_id);
|
||||||
|
|
||||||
flash_alert("Unfavorited <strong>$count</strong> credential(s)");
|
flash_alert("Unfavorited <strong>$count</strong> credential(s)");
|
||||||
|
|
||||||
@@ -317,10 +317,10 @@ if (isset($_POST['bulk_archive_credentials'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE credentials SET credential_archived_at = NOW() WHERE credential_id = $credential_id");
|
mysqli_query($mysqli,"UPDATE credentials SET credential_archived_at = NOW() WHERE credential_id = $credential_id");
|
||||||
|
|
||||||
logAction("Credential", "Archive", "$session_name archived credential $credential_name", $client_id, $credential_id);
|
logAudit("Credential", "Archive", "$session_name archived credential $credential_name", $client_id, $credential_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Credential", "Bulk Archive", "$session_name archived $count credentials", $client_id);
|
logAudit("Credential", "Bulk Archive", "$session_name archived $count credentials", $client_id);
|
||||||
|
|
||||||
flash_alert("Archived <strong>$count</strong> credential(s)", 'error');
|
flash_alert("Archived <strong>$count</strong> credential(s)", 'error');
|
||||||
|
|
||||||
@@ -356,11 +356,11 @@ if (isset($_POST['bulk_restore_credentials'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE credentials SET credential_archived_at = NULL WHERE credential_id = $credential_id");
|
mysqli_query($mysqli,"UPDATE credentials SET credential_archived_at = NULL WHERE credential_id = $credential_id");
|
||||||
|
|
||||||
logAction("Credential", "Restore", "$session_name restored credential $credential_name", $client_id, $credential_id);
|
logAudit("Credential", "Restore", "$session_name restored credential $credential_name", $client_id, $credential_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Credential", "Bulk Restore", "$session_name restored $count credential(s)", $client_id);
|
logAudit("Credential", "Bulk Restore", "$session_name restored $count credential(s)", $client_id);
|
||||||
|
|
||||||
flash_alert("Restored <strong>$count</strong> credential(s)");
|
flash_alert("Restored <strong>$count</strong> credential(s)");
|
||||||
|
|
||||||
@@ -396,11 +396,11 @@ if (isset($_POST['bulk_delete_credentials'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "DELETE FROM credentials WHERE credential_id = $credential_id AND credential_client_id = $client_id");
|
mysqli_query($mysqli, "DELETE FROM credentials WHERE credential_id = $credential_id AND credential_client_id = $client_id");
|
||||||
|
|
||||||
logAction("Credential", "Delete", "$session_name deleted credential $credential_name", $client_id);
|
logAudit("Credential", "Delete", "$session_name deleted credential $credential_name", $client_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Credential", "Bulk Delete", "$session_name deleted $count credential(s)", $client_id);
|
logAudit("Credential", "Bulk Delete", "$session_name deleted $count credential(s)", $client_id);
|
||||||
|
|
||||||
flash_alert("Deleted <strong>$count</strong> credential(s)", 'error');
|
flash_alert("Deleted <strong>$count</strong> credential(s)", 'error');
|
||||||
|
|
||||||
@@ -464,7 +464,7 @@ if (isset($_POST['export_credentials_csv'])) {
|
|||||||
fpassthru($f);
|
fpassthru($f);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Credential", "Export", "$session_name exported $num_rows credential(s) to a CSV file", $client_id);
|
logAudit("Credential", "Export", "$session_name exported $num_rows credential(s) to a CSV file", $client_id);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
@@ -558,7 +558,7 @@ if (isset($_POST["import_credentials_csv"])) {
|
|||||||
}
|
}
|
||||||
fclose($file);
|
fclose($file);
|
||||||
|
|
||||||
logAction("Credential", "Import", "$session_name imported $row_count credential(s) via CSV file. $duplicate_count duplicate(s) found and not imported", $client_id);
|
logAudit("Credential", "Import", "$session_name imported $row_count credential(s) via CSV file. $duplicate_count duplicate(s) found and not imported", $client_id);
|
||||||
|
|
||||||
flash_alert("<strong>$row_count</strong> credential(s) imported, <strong>$duplicate_count</strong> duplicate(s) detected and not imported", 'warning');
|
flash_alert("<strong>$row_count</strong> credential(s) imported, <strong>$duplicate_count</strong> duplicate(s) detected and not imported", 'warning');
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ if (isset($_POST['add_credit'])) {
|
|||||||
|
|
||||||
$credit_id = mysqli_insert_id($mysqli);
|
$credit_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Credit", "Create", "$session_name added " . numfmt_format_currency($currency_format, $amount, $session_company_currency) . "", $client_id, $credit_id);
|
logAudit("Credit", "Create", "$session_name added " . numfmt_format_currency($currency_format, $amount, $session_company_currency) . "", $client_id, $credit_id);
|
||||||
|
|
||||||
flash_alert(numfmt_format_currency($currency_format, $amount, $session_company_currency) . " Credit Added");
|
flash_alert(numfmt_format_currency($currency_format, $amount, $session_company_currency) . " Credit Added");
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ if (isset($_POST['add_document'])) {
|
|||||||
mysqli_query($mysqli,"INSERT INTO asset_documents SET asset_id = $asset_id, document_id = $document_id");
|
mysqli_query($mysqli,"INSERT INTO asset_documents SET asset_id = $asset_id, document_id = $document_id");
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Document", "Create", "$session_name created document $name", $client_id, $document_id);
|
logAudit("Document", "Create", "$session_name created document $name", $client_id, $document_id);
|
||||||
|
|
||||||
flash_alert("Document <strong>$name</strong> created");
|
flash_alert("Document <strong>$name</strong> created");
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ if (isset($_POST['add_document_from_template'])) {
|
|||||||
WHERE document_id = $document_id"
|
WHERE document_id = $document_id"
|
||||||
);
|
);
|
||||||
|
|
||||||
logAction(
|
logAudit(
|
||||||
"Document",
|
"Document",
|
||||||
"Create",
|
"Create",
|
||||||
"$session_name created document $document_name from template $document_template_name",
|
"$session_name created document $document_name from template $document_template_name",
|
||||||
@@ -228,7 +228,7 @@ if (isset($_POST['edit_document'])) {
|
|||||||
WHERE document_id = $document_id"
|
WHERE document_id = $document_id"
|
||||||
);
|
);
|
||||||
|
|
||||||
logAction(
|
logAudit(
|
||||||
"Document",
|
"Document",
|
||||||
"Edit",
|
"Edit",
|
||||||
"$session_name edited document $name, previous version kept",
|
"$session_name edited document $name, previous version kept",
|
||||||
@@ -267,7 +267,7 @@ if (isset($_POST['move_document'])) {
|
|||||||
// Document edit query
|
// Document edit query
|
||||||
mysqli_query($mysqli,"UPDATE documents SET document_folder_id = $folder_id, document_updated_at = document_updated_at WHERE document_id = $document_id");
|
mysqli_query($mysqli,"UPDATE documents SET document_folder_id = $folder_id, document_updated_at = document_updated_at WHERE document_id = $document_id");
|
||||||
|
|
||||||
logAction("Document", "Move", "$session_name moved document $document_name to folder $folder_name", $client_id, $document_id);
|
logAudit("Document", "Move", "$session_name moved document $document_name to folder $folder_name", $client_id, $document_id);
|
||||||
|
|
||||||
flash_alert("Document <strong>$document_name</strong> moved to folder <strong>$folder_name</strong>");
|
flash_alert("Document <strong>$document_name</strong> moved to folder <strong>$folder_name</strong>");
|
||||||
|
|
||||||
@@ -296,7 +296,7 @@ if (isset($_POST['rename_document'])) {
|
|||||||
// Document edit query
|
// Document edit query
|
||||||
mysqli_query($mysqli,"UPDATE documents SET document_name = '$name', document_updated_at = document_updated_at WHERE document_id = $document_id");
|
mysqli_query($mysqli,"UPDATE documents SET document_name = '$name', document_updated_at = document_updated_at WHERE document_id = $document_id");
|
||||||
|
|
||||||
logAction("Document", "Edit", "$session_name renamed document $old_document_name to $name", $client_id, $document_id);
|
logAudit("Document", "Edit", "$session_name renamed document $old_document_name to $name", $client_id, $document_id);
|
||||||
|
|
||||||
|
|
||||||
flash_alert("You renamed Document from <strong>$old_document_name</strong> to <strong>$name</strong>");
|
flash_alert("You renamed Document from <strong>$old_document_name</strong> to <strong>$name</strong>");
|
||||||
@@ -335,10 +335,10 @@ if (isset($_POST['bulk_move_document'])) {
|
|||||||
// Document move query
|
// Document move query
|
||||||
mysqli_query($mysqli,"UPDATE documents SET document_folder_id = $folder_id, document_updated_at = document_updated_at WHERE document_id = $document_id");
|
mysqli_query($mysqli,"UPDATE documents SET document_folder_id = $folder_id, document_updated_at = document_updated_at WHERE document_id = $document_id");
|
||||||
|
|
||||||
logAction("Document", "Move", "$session_name moved document $document_name to folder $folder_name", $client_id, $document_id);
|
logAudit("Document", "Move", "$session_name moved document $document_name to folder $folder_name", $client_id, $document_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Document", "Bulk Move", "$session_name moved $count document(s) to folder $folder_name", $client_id);
|
logAudit("Document", "Bulk Move", "$session_name moved $count document(s) to folder $folder_name", $client_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
flash_alert("You moved <strong>$count</strong> document(s) to the folder <strong>$folder_name</strong>");
|
flash_alert("You moved <strong>$count</strong> document(s) to the folder <strong>$folder_name</strong>");
|
||||||
@@ -370,7 +370,7 @@ if (isset($_POST['link_file_to_document'])) {
|
|||||||
// Document add query
|
// Document add query
|
||||||
mysqli_query($mysqli,"INSERT INTO document_files SET file_id = $file_id, document_id = $document_id");
|
mysqli_query($mysqli,"INSERT INTO document_files SET file_id = $file_id, document_id = $document_id");
|
||||||
|
|
||||||
logAction("Document", "Link", "$session_name linked file $file_name to document $document_name", $client_id, $document_id);
|
logAudit("Document", "Link", "$session_name linked file $file_name to document $document_name", $client_id, $document_id);
|
||||||
|
|
||||||
flash_alert("File <strong>$file_name</strong> linked with Document <strong>$document_name</strong>");
|
flash_alert("File <strong>$file_name</strong> linked with Document <strong>$document_name</strong>");
|
||||||
|
|
||||||
@@ -400,7 +400,7 @@ if (isset($_GET['unlink_file_from_document'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM document_files WHERE file_id = $file_id AND document_id = $document_id");
|
mysqli_query($mysqli,"DELETE FROM document_files WHERE file_id = $file_id AND document_id = $document_id");
|
||||||
|
|
||||||
logAction("Document", "Unlink", "$session_name unlinked file $file_name from document $document_name", $client_id, $document_id);
|
logAudit("Document", "Unlink", "$session_name unlinked file $file_name from document $document_name", $client_id, $document_id);
|
||||||
|
|
||||||
flash_alert("File <strong>$file_name</strong> unlinked from Document <strong>$document_name</strong>", 'error');
|
flash_alert("File <strong>$file_name</strong> unlinked from Document <strong>$document_name</strong>", 'error');
|
||||||
|
|
||||||
@@ -431,7 +431,7 @@ if (isset($_POST['link_vendor_to_document'])) {
|
|||||||
// Document add query
|
// Document add query
|
||||||
mysqli_query($mysqli,"INSERT INTO vendor_documents SET vendor_id = $vendor_id, document_id = $document_id");
|
mysqli_query($mysqli,"INSERT INTO vendor_documents SET vendor_id = $vendor_id, document_id = $document_id");
|
||||||
|
|
||||||
logAction("Document", "Link", "$session_name linked vendor $vendor_name to document $document_name", $client_id, $document_id);
|
logAudit("Document", "Link", "$session_name linked vendor $vendor_name to document $document_name", $client_id, $document_id);
|
||||||
|
|
||||||
flash_alert("Vendor <strong>$vendor_name</strong> linked with Document <strong>$document_name</strong>");
|
flash_alert("Vendor <strong>$vendor_name</strong> linked with Document <strong>$document_name</strong>");
|
||||||
|
|
||||||
@@ -461,7 +461,7 @@ if (isset($_GET['unlink_vendor_from_document'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM vendor_documents WHERE vendor_id = $vendor_id AND document_id = $document_id");
|
mysqli_query($mysqli,"DELETE FROM vendor_documents WHERE vendor_id = $vendor_id AND document_id = $document_id");
|
||||||
|
|
||||||
logAction("Document", "Unlink", "$session_name unlinked vendor $vendor_name from document $document_name", $client_id, $document_id);
|
logAudit("Document", "Unlink", "$session_name unlinked vendor $vendor_name from document $document_name", $client_id, $document_id);
|
||||||
|
|
||||||
flash_alert("Vendor <strong>$vendor_name</strong> unlinked from Document <strong>$document_name</strong>", 'error');
|
flash_alert("Vendor <strong>$vendor_name</strong> unlinked from Document <strong>$document_name</strong>", 'error');
|
||||||
|
|
||||||
@@ -493,7 +493,7 @@ if (isset($_POST['link_contact_to_document'])) {
|
|||||||
// Contact add query
|
// Contact add query
|
||||||
mysqli_query($mysqli,"INSERT INTO contact_documents SET contact_id = $contact_id, document_id = $document_id");
|
mysqli_query($mysqli,"INSERT INTO contact_documents SET contact_id = $contact_id, document_id = $document_id");
|
||||||
|
|
||||||
logAction("Document", "Link", "$session_name linked contact $contact_name to document $document_name", $client_id, $document_id);
|
logAudit("Document", "Link", "$session_name linked contact $contact_name to document $document_name", $client_id, $document_id);
|
||||||
|
|
||||||
flash_alert("Contact <strong>$contact_name</strong> linked with Document <strong>$document_name</strong>");
|
flash_alert("Contact <strong>$contact_name</strong> linked with Document <strong>$document_name</strong>");
|
||||||
|
|
||||||
@@ -523,7 +523,7 @@ if (isset($_GET['unlink_contact_from_document'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM contact_documents WHERE contact_id = $contact_id AND document_id = $document_id");
|
mysqli_query($mysqli,"DELETE FROM contact_documents WHERE contact_id = $contact_id AND document_id = $document_id");
|
||||||
|
|
||||||
logAction("Document", "Unlink", "$session_name unlinked contact $contact_name from document $document_name", $client_id, $document_id);
|
logAudit("Document", "Unlink", "$session_name unlinked contact $contact_name from document $document_name", $client_id, $document_id);
|
||||||
|
|
||||||
flash_alert("Contact <strong>$contact_name</strong> unlinked from Document <strong>$document_name</strong>", 'error');
|
flash_alert("Contact <strong>$contact_name</strong> unlinked from Document <strong>$document_name</strong>", 'error');
|
||||||
|
|
||||||
@@ -553,7 +553,7 @@ if (isset($_POST['link_asset_to_document'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO asset_documents SET asset_id = $asset_id, document_id = $document_id");
|
mysqli_query($mysqli,"INSERT INTO asset_documents SET asset_id = $asset_id, document_id = $document_id");
|
||||||
|
|
||||||
logAction("Document", "Link", "$session_name linked asset $asset_name to document $document_name", $client_id, $document_id);
|
logAudit("Document", "Link", "$session_name linked asset $asset_name to document $document_name", $client_id, $document_id);
|
||||||
|
|
||||||
flash_alert("Asset <strong>$asset_name</strong> linked with Document <strong>$document_name</strong>");
|
flash_alert("Asset <strong>$asset_name</strong> linked with Document <strong>$document_name</strong>");
|
||||||
|
|
||||||
@@ -583,7 +583,7 @@ if (isset($_GET['unlink_asset_from_document'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM asset_documents WHERE asset_id = $asset_id AND document_id = $document_id");
|
mysqli_query($mysqli,"DELETE FROM asset_documents WHERE asset_id = $asset_id AND document_id = $document_id");
|
||||||
|
|
||||||
logAction("Document", "Unlink", "$session_name unlinked asset $asset_name from document $document_name", $client_id, $document_id);
|
logAudit("Document", "Unlink", "$session_name unlinked asset $asset_name from document $document_name", $client_id, $document_id);
|
||||||
|
|
||||||
flash_alert("Asset <strong>$asset_name</strong> unlinked from Document <strong>$document_name</strong>", 'error');
|
flash_alert("Asset <strong>$asset_name</strong> unlinked from Document <strong>$document_name</strong>", 'error');
|
||||||
|
|
||||||
@@ -614,7 +614,7 @@ if (isset($_POST['link_software_to_document'])) {
|
|||||||
// Contact add query
|
// Contact add query
|
||||||
mysqli_query($mysqli,"INSERT INTO software_documents SET software_id = $software_id, document_id = $document_id");
|
mysqli_query($mysqli,"INSERT INTO software_documents SET software_id = $software_id, document_id = $document_id");
|
||||||
|
|
||||||
logAction("Document", "Link", "$session_name linked software $software_name to document $document_name", $client_id, $document_id);
|
logAudit("Document", "Link", "$session_name linked software $software_name to document $document_name", $client_id, $document_id);
|
||||||
|
|
||||||
flash_alert("Software <strong>$software_name</strong> linked with Document <strong>$document_name</strong>");
|
flash_alert("Software <strong>$software_name</strong> linked with Document <strong>$document_name</strong>");
|
||||||
|
|
||||||
@@ -644,7 +644,7 @@ if (isset($_GET['unlink_software_from_document'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM software_documents WHERE software_id = $software_id AND document_id = $document_id");
|
mysqli_query($mysqli,"DELETE FROM software_documents WHERE software_id = $software_id AND document_id = $document_id");
|
||||||
|
|
||||||
logAction("Document", "Unlink", "$session_name unlinked software $software_name from document $document_name", $client_id, $document_id);
|
logAudit("Document", "Unlink", "$session_name unlinked software $software_name from document $document_name", $client_id, $document_id);
|
||||||
|
|
||||||
flash_alert("Software <strong>$software_name</strong> unlinked from Document <strong>$document_name</strong>", 'error');
|
flash_alert("Software <strong>$software_name</strong> unlinked from Document <strong>$document_name</strong>", 'error');
|
||||||
|
|
||||||
@@ -677,7 +677,7 @@ if (isset($_POST['toggle_document_visibility'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE documents SET document_client_visible = $document_visible, document_updated_at = document_updated_at WHERE document_id = $document_id");
|
mysqli_query($mysqli,"UPDATE documents SET document_client_visible = $document_visible, document_updated_at = document_updated_at WHERE document_id = $document_id");
|
||||||
|
|
||||||
logAction("Document", "Edit", "$session_name changed document $document_name visibilty to $visable_wording in the client portal", $client_id, $document_id);
|
logAudit("Document", "Edit", "$session_name changed document $document_name visibilty to $visable_wording in the client portal", $client_id, $document_id);
|
||||||
|
|
||||||
flash_alert("Document <strong>$document_name</strong> changed to <strong>$visable_wording</strong> in the client portal");
|
flash_alert("Document <strong>$document_name</strong> changed to <strong>$visable_wording</strong> in the client portal");
|
||||||
|
|
||||||
@@ -725,7 +725,7 @@ if (isset($_GET['export_document'])) {
|
|||||||
$pdf->Output("$document_name.pdf", 'I'); // 'I' for inline display, 'D' for download
|
$pdf->Output("$document_name.pdf", 'I'); // 'I' for inline display, 'D' for download
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Document", "Export", "$session_name exported document $document_name", $client_id, $document_id);
|
logAudit("Document", "Export", "$session_name exported document $document_name", $client_id, $document_id);
|
||||||
|
|
||||||
flash_alert("Document <strong>$document_name</strong> exported");
|
flash_alert("Document <strong>$document_name</strong> exported");
|
||||||
|
|
||||||
@@ -770,7 +770,7 @@ if (isset($_GET['archive_document'])) {
|
|||||||
// Service Associations
|
// Service Associations
|
||||||
mysqli_query($mysqli,"DELETE FROM service_documents WHERE document_id = $document_id");
|
mysqli_query($mysqli,"DELETE FROM service_documents WHERE document_id = $document_id");
|
||||||
|
|
||||||
logAction("Document", "Archive", "$session_name archived document $document_name", $client_id, $document_id);
|
logAudit("Document", "Archive", "$session_name archived document $document_name", $client_id, $document_id);
|
||||||
|
|
||||||
flash_alert("Document <strong>$document_name</strong> archived", 'error');
|
flash_alert("Document <strong>$document_name</strong> archived", 'error');
|
||||||
|
|
||||||
@@ -796,7 +796,7 @@ if (isset($_GET['restore_document'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE documents SET document_archived_at = NULL, document_updated_at = document_updated_at WHERE document_id = $document_id");
|
mysqli_query($mysqli,"UPDATE documents SET document_archived_at = NULL, document_updated_at = document_updated_at WHERE document_id = $document_id");
|
||||||
|
|
||||||
logAction("Document", "Restore", "$session_name restored document $document_name", $client_id, $document_id);
|
logAudit("Document", "Restore", "$session_name restored document $document_name", $client_id, $document_id);
|
||||||
|
|
||||||
flash_alert("Document <strong>$document_name</strong> Restored");
|
flash_alert("Document <strong>$document_name</strong> Restored");
|
||||||
|
|
||||||
@@ -822,7 +822,7 @@ if (isset($_GET['delete_document_version'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM document_versions WHERE document_version_id = $document_version_id");
|
mysqli_query($mysqli,"DELETE FROM document_versions WHERE document_version_id = $document_version_id");
|
||||||
|
|
||||||
logAction("Document Version", "Delete", "$session_name deleted document version $document_version_name", $client_id);
|
logAudit("Document Version", "Delete", "$session_name deleted document version $document_version_name", $client_id);
|
||||||
|
|
||||||
flash_alert("Document $document_version_name version deleted", 'error');
|
flash_alert("Document $document_version_name version deleted", 'error');
|
||||||
|
|
||||||
@@ -854,7 +854,7 @@ if (isset($_GET['delete_document'])) {
|
|||||||
// Delete uploads/document/$document_id if exists
|
// Delete uploads/document/$document_id if exists
|
||||||
removeDirectory($_SERVER['DOCUMENT_ROOT'] . "/uploads/documents/" . $document_id);
|
removeDirectory($_SERVER['DOCUMENT_ROOT'] . "/uploads/documents/" . $document_id);
|
||||||
|
|
||||||
logAction("Document", "Delete", "$session_name deleted document $document_name and all versions", $client_id);
|
logAudit("Document", "Delete", "$session_name deleted document $document_name and all versions", $client_id);
|
||||||
|
|
||||||
flash_alert("Document <strong>$document_name</strong> deleted and all versions", 'error');
|
flash_alert("Document <strong>$document_name</strong> deleted and all versions", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ if (isset($_POST['add_domain'])) {
|
|||||||
$extended_log_description = ', with associated SSL cert';
|
$extended_log_description = ', with associated SSL cert';
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Domain", "Create", "$session_name created domain $name$extended_log_description", $client_id, $domain_id);
|
logAudit("Domain", "Create", "$session_name created domain $name$extended_log_description", $client_id, $domain_id);
|
||||||
|
|
||||||
flash_alert("Domain <strong>$name</strong> created");
|
flash_alert("Domain <strong>$name</strong> created");
|
||||||
|
|
||||||
@@ -148,7 +148,7 @@ if (isset($_POST['edit_domain'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Domain", "Edit", "$session_name edited domain $name", $client_id, $domain_id);
|
logAudit("Domain", "Edit", "$session_name edited domain $name", $client_id, $domain_id);
|
||||||
|
|
||||||
flash_alert("Domain <strong>$name</strong> edited");
|
flash_alert("Domain <strong>$name</strong> edited");
|
||||||
|
|
||||||
@@ -174,7 +174,7 @@ if (isset($_GET['archive_domain'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE domains SET domain_archived_at = NOW() WHERE domain_id = $domain_id");
|
mysqli_query($mysqli,"UPDATE domains SET domain_archived_at = NOW() WHERE domain_id = $domain_id");
|
||||||
|
|
||||||
logAction("Domain", "Archive", "$session_name archived domain $domain_name", $client_id, $domain_id);
|
logAudit("Domain", "Archive", "$session_name archived domain $domain_name", $client_id, $domain_id);
|
||||||
|
|
||||||
flash_alert("Domain <strong>$domain_name archived", 'error');
|
flash_alert("Domain <strong>$domain_name archived", 'error');
|
||||||
|
|
||||||
@@ -200,7 +200,7 @@ if(isset($_GET['restore_domain'])){
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE domains SET domain_archived_at = NULL WHERE domain_id = $domain_id");
|
mysqli_query($mysqli,"UPDATE domains SET domain_archived_at = NULL WHERE domain_id = $domain_id");
|
||||||
|
|
||||||
logAction("Domain", "Restore", "$session_name restored domain $domain_name", $client_id, $domain_id);
|
logAudit("Domain", "Restore", "$session_name restored domain $domain_name", $client_id, $domain_id);
|
||||||
|
|
||||||
flash_alert("Domain <strong>$domain_name</strong> restored");
|
flash_alert("Domain <strong>$domain_name</strong> restored");
|
||||||
|
|
||||||
@@ -226,7 +226,7 @@ if (isset($_GET['delete_domain'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM domains WHERE domain_id = $domain_id");
|
mysqli_query($mysqli,"DELETE FROM domains WHERE domain_id = $domain_id");
|
||||||
|
|
||||||
logAction("Domain", "Delete", "$session_name deleted domain $domain_name", $client_id);
|
logAudit("Domain", "Delete", "$session_name deleted domain $domain_name", $client_id);
|
||||||
|
|
||||||
flash_alert("Domain <strong>$domain_name</strong> deleted", 'error');
|
flash_alert("Domain <strong>$domain_name</strong> deleted", 'error');
|
||||||
|
|
||||||
@@ -260,10 +260,10 @@ if (isset($_POST['bulk_archive_domains'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE domains SET domain_archived_at = NOW() WHERE domain_id = $domain_id");
|
mysqli_query($mysqli,"UPDATE domains SET domain_archived_at = NOW() WHERE domain_id = $domain_id");
|
||||||
|
|
||||||
logAction("Domain", "Archive", "$session_name archived domain $domain_name", $client_id, $domain_id);
|
logAudit("Domain", "Archive", "$session_name archived domain $domain_name", $client_id, $domain_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Domain", "Bulk Archive", "$session_name archived $count domain(s)", $client_id);
|
logAudit("Domain", "Bulk Archive", "$session_name archived $count domain(s)", $client_id);
|
||||||
|
|
||||||
flash_alert("Archived <strong>$count</strong> domain(s)", 'error');
|
flash_alert("Archived <strong>$count</strong> domain(s)", 'error');
|
||||||
|
|
||||||
@@ -299,11 +299,11 @@ if (isset($_POST['bulk_restore_domains'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE domains SET domain_archived_at = NULL WHERE domain_id = $domain_id");
|
mysqli_query($mysqli,"UPDATE domains SET domain_archived_at = NULL WHERE domain_id = $domain_id");
|
||||||
|
|
||||||
logAction("Domain", "Restore", "$session_name restored domain $domain_name", $client_id, $domain_id);
|
logAudit("Domain", "Restore", "$session_name restored domain $domain_name", $client_id, $domain_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Domain", "Bulk Restore", "$session_name restored $count domain(s)", $client_id);
|
logAudit("Domain", "Bulk Restore", "$session_name restored $count domain(s)", $client_id);
|
||||||
|
|
||||||
flash_alert("Restored <strong>$count</strong> domain(s)");
|
flash_alert("Restored <strong>$count</strong> domain(s)");
|
||||||
|
|
||||||
@@ -339,10 +339,10 @@ if (isset($_POST['bulk_delete_domains'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "DELETE FROM domains WHERE domain_id = $domain_id AND domain_client_id = $client_id");
|
mysqli_query($mysqli, "DELETE FROM domains WHERE domain_id = $domain_id AND domain_client_id = $client_id");
|
||||||
|
|
||||||
logAction("Domain", "Delete", "$session_name deleted domain $domain_name", $client_id);
|
logAudit("Domain", "Delete", "$session_name deleted domain $domain_name", $client_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Domain", "Bulk Delete", "$session_name deleted $count domain(s)", $client_id);
|
logAudit("Domain", "Bulk Delete", "$session_name deleted $count domain(s)", $client_id);
|
||||||
|
|
||||||
flash_alert("Deleted <strong>$count</strong> domain(s)", 'error');
|
flash_alert("Deleted <strong>$count</strong> domain(s)", 'error');
|
||||||
|
|
||||||
@@ -404,7 +404,7 @@ if (isset($_POST['export_domains_csv'])) {
|
|||||||
fpassthru($f);
|
fpassthru($f);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Domain", "Export", "$session_name exported $num_rows domain(s)", $client_id);
|
logAudit("Domain", "Export", "$session_name exported $num_rows domain(s)", $client_id);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ if (isset($_POST['add_calendar'])) {
|
|||||||
|
|
||||||
$calendar_id = mysqli_insert_id($mysqli);
|
$calendar_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Calendar", "Create", "$session_name created calendar $name", 0, $calendar_id);
|
logAudit("Calendar", "Create", "$session_name created calendar $name", 0, $calendar_id);
|
||||||
|
|
||||||
flash_alert("Calendar <strong>$name</strong> created");
|
flash_alert("Calendar <strong>$name</strong> created");
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ if (isset($_POST['edit_calendar'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE calendars SET calendar_name = '$name', calendar_color = '$color' WHERE calendar_id = $calendar_id");
|
mysqli_query($mysqli,"UPDATE calendars SET calendar_name = '$name', calendar_color = '$color' WHERE calendar_id = $calendar_id");
|
||||||
|
|
||||||
logAction("Calendar", "Edit", "$session_name edited calendar $name", 0, $calendar_id);
|
logAudit("Calendar", "Edit", "$session_name edited calendar $name", 0, $calendar_id);
|
||||||
|
|
||||||
flash_alert("Calendar <strong>$name</strong> edited");
|
flash_alert("Calendar <strong>$name</strong> edited");
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ if (isset($_GET['delete_calendar'])) {
|
|||||||
// Delete Events
|
// Delete Events
|
||||||
mysqli_query($mysqli,"DELETE FROM calendar_events WHERE event_calendar_id = $calendar_id");
|
mysqli_query($mysqli,"DELETE FROM calendar_events WHERE event_calendar_id = $calendar_id");
|
||||||
|
|
||||||
logAction("Calendar", "Delete", "$session_name deleted calendar $calendar_name and associated events");
|
logAudit("Calendar", "Delete", "$session_name deleted calendar $calendar_name and associated events");
|
||||||
|
|
||||||
flash_alert("Calendar <strong>$calendar_name</strong> deleted", 'error');
|
flash_alert("Calendar <strong>$calendar_name</strong> deleted", 'error');
|
||||||
|
|
||||||
@@ -129,15 +129,15 @@ if (isset($_POST['add_event'])) {
|
|||||||
|
|
||||||
// Logging for email (success/fail)
|
// Logging for email (success/fail)
|
||||||
if ($mail === true) {
|
if ($mail === true) {
|
||||||
logAction("Calendar Event", "Email", "$session_name emailed event $title to $contact_name from client $client_name", $client_id, $event_id);
|
logAudit("Calendar Event", "Email", "$session_name emailed event $title to $contact_name from client $client_name", $client_id, $event_id);
|
||||||
} else {
|
} else {
|
||||||
appNotify("Mail", "Failed to send email to $contact_email");
|
appNotify("Mail", "Failed to send email to $contact_email");
|
||||||
logAction("Mail", "Error", "Failed to send email to $contact_email regarding $subject. $mail");
|
logAudit("Mail", "Error", "Failed to send email to $contact_email regarding $subject. $mail");
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End mail IF
|
} // End mail IF
|
||||||
|
|
||||||
logAction("Calendar Event", "Create", "$session_name created a calendar event titled $title in calendar $calendar_name", $client_id, $event_id);
|
logAudit("Calendar Event", "Create", "$session_name created a calendar event titled $title in calendar $calendar_name", $client_id, $event_id);
|
||||||
|
|
||||||
flash_alert("Event <strong>$title</strong> created in calendar <strong>$calendar_name</strong>");
|
flash_alert("Event <strong>$title</strong> created in calendar <strong>$calendar_name</strong>");
|
||||||
|
|
||||||
@@ -203,15 +203,15 @@ if (isset($_POST['edit_event'])) {
|
|||||||
$mail = addToMailQueue($data);
|
$mail = addToMailQueue($data);
|
||||||
// Logging for email (success/fail)
|
// Logging for email (success/fail)
|
||||||
if ($mail === true) {
|
if ($mail === true) {
|
||||||
logAction("Calendar Event", "Email", "$session_name Emailed modified event $title to $contact_name email $contact_email", $client_id, $event_id);
|
logAudit("Calendar Event", "Email", "$session_name Emailed modified event $title to $contact_name email $contact_email", $client_id, $event_id);
|
||||||
} else {
|
} else {
|
||||||
appNotify("Mail", "Failed to send email to $contact_email");
|
appNotify("Mail", "Failed to send email to $contact_email");
|
||||||
logAction("Mail", "Error", "Failed to send email to $contact_email regarding $subject. $mail");
|
logAudit("Mail", "Error", "Failed to send email to $contact_email regarding $subject. $mail");
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End mail IF
|
} // End mail IF
|
||||||
|
|
||||||
logAction("Calendar Event", "Edit", "$session_name edited calendar event $title", $client_id, $event_id);
|
logAudit("Calendar Event", "Edit", "$session_name edited calendar event $title", $client_id, $event_id);
|
||||||
|
|
||||||
flash_alert("Calendar event titled <strong>$title</strong> edited");
|
flash_alert("Calendar event titled <strong>$title</strong> edited");
|
||||||
|
|
||||||
@@ -238,7 +238,7 @@ if (isset($_GET['delete_event'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM calendar_events WHERE event_id = $event_id");
|
mysqli_query($mysqli,"DELETE FROM calendar_events WHERE event_id = $event_id");
|
||||||
|
|
||||||
logAction("Calendar Event", "Delete", "$session_name deleted calendar event $event_title", $client_id);
|
logAudit("Calendar Event", "Delete", "$session_name deleted calendar event $event_title", $client_id);
|
||||||
|
|
||||||
flash_alert("Calendar event titled <strong>$event_title</strong> deleted", 'error');
|
flash_alert("Calendar event titled <strong>$event_title</strong> deleted", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ if (isset($_POST['add_expense'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Expense", "Create", "$session_name created expense $description", $client_id, $expense_id);
|
logAudit("Expense", "Create", "$session_name created expense $description", $client_id, $expense_id);
|
||||||
|
|
||||||
flash_alert("Expense added" . $extended_alert_description);
|
flash_alert("Expense added" . $extended_alert_description);
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ if (isset($_POST['edit_expense'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE expenses SET expense_date = '$date', expense_amount = $amount, expense_account_id = $account, expense_vendor_id = $vendor, expense_client_id = $client_id, expense_category_id = $category, expense_description = '$description', expense_reference = '$reference' WHERE expense_id = $expense_id");
|
mysqli_query($mysqli,"UPDATE expenses SET expense_date = '$date', expense_amount = $amount, expense_account_id = $account, expense_vendor_id = $vendor, expense_client_id = $client_id, expense_category_id = $category, expense_description = '$description', expense_reference = '$reference' WHERE expense_id = $expense_id");
|
||||||
|
|
||||||
logAction("Expense", "Edit", "$session_name edited expense $description", $client_id, $expense_id);
|
logAudit("Expense", "Edit", "$session_name edited expense $description", $client_id, $expense_id);
|
||||||
|
|
||||||
flash_alert("Expense modified" . $extended_alert_description);
|
flash_alert("Expense modified" . $extended_alert_description);
|
||||||
|
|
||||||
@@ -118,7 +118,7 @@ if (isset($_GET['delete_expense'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM expenses WHERE expense_id = $expense_id");
|
mysqli_query($mysqli,"DELETE FROM expenses WHERE expense_id = $expense_id");
|
||||||
|
|
||||||
logAction("Expense", "Delete", "$session_name deleted expense $expense_description", $client_id);
|
logAudit("Expense", "Delete", "$session_name deleted expense $expense_description", $client_id);
|
||||||
|
|
||||||
flash_alert("Expense deleted", 'error');
|
flash_alert("Expense deleted", 'error');
|
||||||
|
|
||||||
@@ -158,11 +158,11 @@ if (isset($_POST['bulk_edit_expense_category'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE expenses SET expense_category_id = $category_id WHERE expense_id = $expense_id");
|
mysqli_query($mysqli,"UPDATE expenses SET expense_category_id = $category_id WHERE expense_id = $expense_id");
|
||||||
|
|
||||||
logAction("Expense", "Edit", "$session_name assigned expense $expense_descrition to category $category_name", $client_id, $expense_id);
|
logAudit("Expense", "Edit", "$session_name assigned expense $expense_descrition to category $category_name", $client_id, $expense_id);
|
||||||
|
|
||||||
} // End Assign Loop
|
} // End Assign Loop
|
||||||
|
|
||||||
logAction("Expense", "Bulk Edit", "$session_name assigned $count expenses to category $category_name");
|
logAudit("Expense", "Bulk Edit", "$session_name assigned $count expenses to category $category_name");
|
||||||
|
|
||||||
flash_alert("You assigned expense category <strong>$category_name</strong> to <strong>$count</strong> expense(s)");
|
flash_alert("You assigned expense category <strong>$category_name</strong> to <strong>$count</strong> expense(s)");
|
||||||
}
|
}
|
||||||
@@ -203,11 +203,11 @@ if (isset($_POST['bulk_edit_expense_account'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE expenses SET expense_account_id = $account_id WHERE expense_id = $expense_id");
|
mysqli_query($mysqli,"UPDATE expenses SET expense_account_id = $account_id WHERE expense_id = $expense_id");
|
||||||
|
|
||||||
logAction("Expense", "Edit", "$session_name assigned expense $expense_descrition to account $account_name", $client_id, $expense_id);
|
logAudit("Expense", "Edit", "$session_name assigned expense $expense_descrition to account $account_name", $client_id, $expense_id);
|
||||||
|
|
||||||
} // End Assign Loop
|
} // End Assign Loop
|
||||||
|
|
||||||
logAction("Expense", "Bulk Edit", "$session_name assigned $count expense(s) to account $account_name");
|
logAudit("Expense", "Bulk Edit", "$session_name assigned $count expense(s) to account $account_name");
|
||||||
|
|
||||||
flash_alert("You assigned account <strong>$account_name</strong> to <strong>$count</strong> expense(s)");
|
flash_alert("You assigned account <strong>$account_name</strong> to <strong>$count</strong> expense(s)");
|
||||||
}
|
}
|
||||||
@@ -243,7 +243,7 @@ if (isset($_POST['bulk_edit_expense_client'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE expenses SET expense_client_id = $client_id WHERE expense_id = $expense_id");
|
mysqli_query($mysqli,"UPDATE expenses SET expense_client_id = $client_id WHERE expense_id = $expense_id");
|
||||||
|
|
||||||
logAction("Expense", "Edit", "$session_name assigned expense $expense_descrition to client $client_name", $client_id, $expense_id);
|
logAudit("Expense", "Edit", "$session_name assigned expense $expense_descrition to client $client_name", $client_id, $expense_id);
|
||||||
|
|
||||||
} // End Assign Loop
|
} // End Assign Loop
|
||||||
|
|
||||||
@@ -284,11 +284,11 @@ if (isset($_POST['bulk_delete_expenses'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "DELETE FROM expenses WHERE expense_id = $expense_id");
|
mysqli_query($mysqli, "DELETE FROM expenses WHERE expense_id = $expense_id");
|
||||||
|
|
||||||
logAction("Expense", "Delete", "$session_name deleted expense $expense_descrition", $client_id);
|
logAudit("Expense", "Delete", "$session_name deleted expense $expense_descrition", $client_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Expense", "Bulk Delete", "$session_name deleted $count expense(s)");
|
logAudit("Expense", "Bulk Delete", "$session_name deleted $count expense(s)");
|
||||||
|
|
||||||
flash_alert("Deleted <strong>$count</strong> expense(s)", 'error');
|
flash_alert("Deleted <strong>$count</strong> expense(s)", 'error');
|
||||||
|
|
||||||
@@ -387,7 +387,7 @@ if (isset($_POST['export_expenses_csv'])) {
|
|||||||
fpassthru($f);
|
fpassthru($f);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Expense", "Export", "$session_name exported $num_rows expense(s) to CSV file");
|
logAudit("Expense", "Export", "$session_name exported $num_rows expense(s) to CSV file");
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ if (isset($_POST['upload_files'])) {
|
|||||||
mysqli_query($mysqli,"INSERT INTO asset_files SET asset_id = $asset_id, file_id = $file_id");
|
mysqli_query($mysqli,"INSERT INTO asset_files SET asset_id = $asset_id, file_id = $file_id");
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("File", "Upload", "$session_name uploaded file $file_name", $client_id, $file_id);
|
logAudit("File", "Upload", "$session_name uploaded file $file_name", $client_id, $file_id);
|
||||||
|
|
||||||
flash_alert("Uploaded file <strong>$file_name</strong>");
|
flash_alert("Uploaded file <strong>$file_name</strong>");
|
||||||
}
|
}
|
||||||
@@ -124,7 +124,7 @@ if (isset($_POST['rename_file'])) {
|
|||||||
// file edit query
|
// file edit query
|
||||||
mysqli_query($mysqli,"UPDATE files SET file_name = '$file_name' ,file_description = '$file_description' WHERE file_id = $file_id");
|
mysqli_query($mysqli,"UPDATE files SET file_name = '$file_name' ,file_description = '$file_description' WHERE file_id = $file_id");
|
||||||
|
|
||||||
logAction("File", "Rename", "$session_name renamed file $old_file_name to $file_name", $client_id, $file_id);
|
logAudit("File", "Rename", "$session_name renamed file $old_file_name to $file_name", $client_id, $file_id);
|
||||||
|
|
||||||
flash_alert("Renamed file <strong>$old_file_name</strong> to <strong>$file_name</strong>");
|
flash_alert("Renamed file <strong>$old_file_name</strong> to <strong>$file_name</strong>");
|
||||||
|
|
||||||
@@ -154,7 +154,7 @@ if (isset($_POST['move_file'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE files SET file_folder_id = $folder_id WHERE file_id = $file_id");
|
mysqli_query($mysqli,"UPDATE files SET file_folder_id = $folder_id WHERE file_id = $file_id");
|
||||||
|
|
||||||
logAction("File", "Move", "$session_name moved file $file_name to $folder_name", $client_id, $file_id);
|
logAudit("File", "Move", "$session_name moved file $file_name to $folder_name", $client_id, $file_id);
|
||||||
|
|
||||||
flash_alert("File <strong>$file_name</strong> moved to <strong>$folder_name</strong>");
|
flash_alert("File <strong>$file_name</strong> moved to <strong>$folder_name</strong>");
|
||||||
|
|
||||||
@@ -180,7 +180,7 @@ if (isset($_GET['archive_file'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE files SET file_archived_at = NOW() WHERE file_id = $file_id");
|
mysqli_query($mysqli,"UPDATE files SET file_archived_at = NOW() WHERE file_id = $file_id");
|
||||||
|
|
||||||
logAction("File", "Archive", "$session_name archived file $file_name", $client_id, $file_id);
|
logAudit("File", "Archive", "$session_name archived file $file_name", $client_id, $file_id);
|
||||||
|
|
||||||
flash_alert("File <strong>$file_name</strong> archived", 'error');
|
flash_alert("File <strong>$file_name</strong> archived", 'error');
|
||||||
|
|
||||||
@@ -206,7 +206,7 @@ if (isset($_GET['restore_file'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE files SET file_archived_at = NULL WHERE file_id = $file_id");
|
mysqli_query($mysqli,"UPDATE files SET file_archived_at = NULL WHERE file_id = $file_id");
|
||||||
|
|
||||||
logAction("File", "Restore", "$session_name restored file $file_name", $client_id, $file_id);
|
logAudit("File", "Restore", "$session_name restored file $file_name", $client_id, $file_id);
|
||||||
|
|
||||||
flash_alert("File <strong>$file_name</strong> Restored");
|
flash_alert("File <strong>$file_name</strong> Restored");
|
||||||
|
|
||||||
@@ -243,7 +243,7 @@ if (isset($_POST['delete_file'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM files WHERE file_id = $file_id");
|
mysqli_query($mysqli,"DELETE FROM files WHERE file_id = $file_id");
|
||||||
|
|
||||||
logAction("File", "Delete", "$session_name deleted file $file_name", $client_id);
|
logAudit("File", "Delete", "$session_name deleted file $file_name", $client_id);
|
||||||
|
|
||||||
flash_alert("File <strong>$file_name</strong> deleted", 'alert');
|
flash_alert("File <strong>$file_name</strong> deleted", 'alert');
|
||||||
|
|
||||||
@@ -276,7 +276,7 @@ if (isset($_POST['bulk_archive_files'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE files SET file_archived_at = NOW() WHERE file_id = $file_id");
|
mysqli_query($mysqli,"UPDATE files SET file_archived_at = NOW() WHERE file_id = $file_id");
|
||||||
|
|
||||||
logAction("File", "Archive", "$session_name archived file $file_name", $client_id, $file_id);
|
logAudit("File", "Archive", "$session_name archived file $file_name", $client_id, $file_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -300,13 +300,13 @@ if (isset($_POST['bulk_archive_files'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE documents SET document_archived_at = NOW(), document_updated_at = document_updated_at WHERE document_id = $document_id");
|
mysqli_query($mysqli,"UPDATE documents SET document_archived_at = NOW(), document_updated_at = document_updated_at WHERE document_id = $document_id");
|
||||||
|
|
||||||
logAction("Document", "Archive", "$session_name archived document $document_name", $client_id, $document_id);
|
logAudit("Document", "Archive", "$session_name archived document $document_name", $client_id, $document_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("File", "Bulk Archive", "$session_name archived $document_count document(s) and $file_count file(s)", $client_id);
|
logAudit("File", "Bulk Archive", "$session_name archived $document_count document(s) and $file_count file(s)", $client_id);
|
||||||
|
|
||||||
flash_alert("Archived <strong>$document_count</strong> Documents and <strong>$file_count</strong> files", 'error');
|
flash_alert("Archived <strong>$document_count</strong> Documents and <strong>$file_count</strong> files", 'error');
|
||||||
|
|
||||||
@@ -351,7 +351,7 @@ if (isset($_POST['bulk_delete_files'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM files WHERE file_id = $file_id");
|
mysqli_query($mysqli,"DELETE FROM files WHERE file_id = $file_id");
|
||||||
|
|
||||||
logAction("File", "Delete", "$session_name deleted file $file_name", $client_id);
|
logAudit("File", "Delete", "$session_name deleted file $file_name", $client_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -381,13 +381,13 @@ if (isset($_POST['bulk_delete_files'])) {
|
|||||||
// Delete uploads/document/$document_id if exists
|
// Delete uploads/document/$document_id if exists
|
||||||
removeDirectory($_SERVER['DOCUMENT_ROOT'] . "/uploads/documents/" . $document_id);
|
removeDirectory($_SERVER['DOCUMENT_ROOT'] . "/uploads/documents/" . $document_id);
|
||||||
|
|
||||||
logAction("Document", "Delete", "$session_name deleted document $document_name and all versions", $client_id);
|
logAudit("Document", "Delete", "$session_name deleted document $document_name and all versions", $client_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("File", "Bulk Delete", "$session_name deleted $document_count document(s) and $file_count file(s)", $client_id);
|
logAudit("File", "Bulk Delete", "$session_name deleted $document_count document(s) and $file_count file(s)", $client_id);
|
||||||
|
|
||||||
flash_alert("Deleted <strong>$document_count</strong> Documents and <strong>$file_count</strong> files", 'error');
|
flash_alert("Deleted <strong>$document_count</strong> Documents and <strong>$file_count</strong> files", 'error');
|
||||||
|
|
||||||
@@ -420,7 +420,7 @@ if (isset($_POST['bulk_restore_files'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE files SET file_archived_at = NULL WHERE file_id = $file_id");
|
mysqli_query($mysqli,"UPDATE files SET file_archived_at = NULL WHERE file_id = $file_id");
|
||||||
|
|
||||||
logAction("File", "Restore", "$session_name restored file $file_name", $client_id, $file_id);
|
logAudit("File", "Restore", "$session_name restored file $file_name", $client_id, $file_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -444,13 +444,13 @@ if (isset($_POST['bulk_restore_files'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE documents SET document_archived_at = NULL, document_updated_at = document_updated_at WHERE document_id = $document_id");
|
mysqli_query($mysqli,"UPDATE documents SET document_archived_at = NULL, document_updated_at = document_updated_at WHERE document_id = $document_id");
|
||||||
|
|
||||||
logAction("Document", "Restore", "$session_name restored document $document_name", $client_id, $document_id);
|
logAudit("Document", "Restore", "$session_name restored document $document_name", $client_id, $document_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("File", "Bulk Restore", "$session_name restored $document_count document(s) and $file_count file(s)", $client_id);
|
logAudit("File", "Bulk Restore", "$session_name restored $document_count document(s) and $file_count file(s)", $client_id);
|
||||||
|
|
||||||
flash_alert("Restored <strong>$document_count</strong> Documents and <strong>$file_count</strong> files");
|
flash_alert("Restored <strong>$document_count</strong> Documents and <strong>$file_count</strong> files");
|
||||||
|
|
||||||
@@ -503,7 +503,7 @@ if (isset($_POST['bulk_move_files'])) {
|
|||||||
mysqli_query($mysqli,"UPDATE files SET file_folder_id = $folder_id WHERE file_id = $file_id");
|
mysqli_query($mysqli,"UPDATE files SET file_folder_id = $folder_id WHERE file_id = $file_id");
|
||||||
|
|
||||||
// Per-file log
|
// Per-file log
|
||||||
logAction(
|
logAudit(
|
||||||
"File",
|
"File",
|
||||||
"Move",
|
"Move",
|
||||||
"$session_name moved file $file_name to folder $folder_name",
|
"$session_name moved file $file_name to folder $folder_name",
|
||||||
@@ -513,7 +513,7 @@ if (isset($_POST['bulk_move_files'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Bulk summary log for files
|
// Bulk summary log for files
|
||||||
logAction(
|
logAudit(
|
||||||
"File",
|
"File",
|
||||||
"Bulk Move",
|
"Bulk Move",
|
||||||
"$session_name moved $file_count file(s) to folder $folder_name",
|
"$session_name moved $file_count file(s) to folder $folder_name",
|
||||||
@@ -541,7 +541,7 @@ if (isset($_POST['bulk_move_files'])) {
|
|||||||
mysqli_query($mysqli,"UPDATE documents SET document_folder_id = $folder_id, document_updated_at = document_updated_at WHERE document_id = $document_id");
|
mysqli_query($mysqli,"UPDATE documents SET document_folder_id = $folder_id, document_updated_at = document_updated_at WHERE document_id = $document_id");
|
||||||
|
|
||||||
// Per-document log
|
// Per-document log
|
||||||
logAction(
|
logAudit(
|
||||||
"Document",
|
"Document",
|
||||||
"Move",
|
"Move",
|
||||||
"$session_name moved document $document_name to folder $folder_name",
|
"$session_name moved document $document_name to folder $folder_name",
|
||||||
@@ -551,7 +551,7 @@ if (isset($_POST['bulk_move_files'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Bulk summary log for documents
|
// Bulk summary log for documents
|
||||||
logAction(
|
logAudit(
|
||||||
"Document",
|
"Document",
|
||||||
"Bulk Move",
|
"Bulk Move",
|
||||||
"$session_name moved $document_count document(s) to folder $folder_name",
|
"$session_name moved $document_count document(s) to folder $folder_name",
|
||||||
@@ -599,7 +599,7 @@ if (isset($_POST['link_asset_to_file'])) {
|
|||||||
// Contact add query
|
// Contact add query
|
||||||
mysqli_query($mysqli,"INSERT INTO asset_files SET asset_id = $asset_id, file_id = $file_id");
|
mysqli_query($mysqli,"INSERT INTO asset_files SET asset_id = $asset_id, file_id = $file_id");
|
||||||
|
|
||||||
logAction("File", "Link", "$session_name linked asset $asset_name to file $file_name", $client_id, $file_id);
|
logAudit("File", "Link", "$session_name linked asset $asset_name to file $file_name", $client_id, $file_id);
|
||||||
|
|
||||||
flash_alert("Asset <strong>$asset_name</strong> linked to File <strong>$file_name</strong>");
|
flash_alert("Asset <strong>$asset_name</strong> linked to File <strong>$file_name</strong>");
|
||||||
|
|
||||||
@@ -629,7 +629,7 @@ if (isset($_GET['unlink_asset_from_file'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM asset_files WHERE asset_id = $asset_id AND file_id = $file_id");
|
mysqli_query($mysqli,"DELETE FROM asset_files WHERE asset_id = $asset_id AND file_id = $file_id");
|
||||||
|
|
||||||
logAction("File", "Link", "$session_name unlinked asset $asset_name from file $file_name", $client_id, $file_id);
|
logAudit("File", "Link", "$session_name unlinked asset $asset_name from file $file_name", $client_id, $file_id);
|
||||||
|
|
||||||
flash_alert("Asset <strong>$asset_name</strong> unlinked from File <strong>$file_name</strong>");
|
flash_alert("Asset <strong>$asset_name</strong> unlinked from File <strong>$file_name</strong>");
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ if (isset($_POST['create_folder'])) {
|
|||||||
$add_folder = mysqli_query($mysqli,"INSERT INTO folders SET folder_name = '$folder_name', parent_folder = $parent_folder, folder_location = $folder_location, folder_client_id = $client_id");
|
$add_folder = mysqli_query($mysqli,"INSERT INTO folders SET folder_name = '$folder_name', parent_folder = $parent_folder, folder_location = $folder_location, folder_client_id = $client_id");
|
||||||
$folder_id = mysqli_insert_id($mysqli);
|
$folder_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Folder", "Create", "$session_name created folder $folder_name", $client_id, $folder_id);
|
logAudit("Folder", "Create", "$session_name created folder $folder_name", $client_id, $folder_id);
|
||||||
|
|
||||||
flash_alert("Folder <strong>$folder_name</strong> created");
|
flash_alert("Folder <strong>$folder_name</strong> created");
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ if (isset($_POST['rename_folder'])) {
|
|||||||
// Folder edit query
|
// Folder edit query
|
||||||
mysqli_query($mysqli,"UPDATE folders SET folder_name = '$folder_name' WHERE folder_id = $folder_id");
|
mysqli_query($mysqli,"UPDATE folders SET folder_name = '$folder_name' WHERE folder_id = $folder_id");
|
||||||
|
|
||||||
logAction("Folder", "Rename", "$session_name renamed folder $old_folder_name to $folder_name", $client_id, $folder_id);
|
logAudit("Folder", "Rename", "$session_name renamed folder $old_folder_name to $folder_name", $client_id, $folder_id);
|
||||||
|
|
||||||
flash_alert("Folder <strong>$old_folder_name</strong> renamed to <strong>$folder_name</strong>");
|
flash_alert("Folder <strong>$old_folder_name</strong> renamed to <strong>$folder_name</strong>");
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ if (isset($_GET['delete_folder'])) {
|
|||||||
mysqli_query($mysqli,"UPDATE documents SET document_folder_id = 0 WHERE document_id = $document_id");
|
mysqli_query($mysqli,"UPDATE documents SET document_folder_id = 0 WHERE document_id = $document_id");
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Folder", "Delete", "$session_name deleted folder $folder_name", $client_id);
|
logAudit("Folder", "Delete", "$session_name deleted folder $folder_name", $client_id);
|
||||||
|
|
||||||
flash_alert("Folder <strong>$folder_name</strong> deleted", 'error');
|
flash_alert("Folder <strong>$folder_name</strong> deleted", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ if (isset($_POST['add_invoice'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Draft', history_description = 'Invoice created by $session_name', history_invoice_id = $invoice_id");
|
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Draft', history_description = 'Invoice created by $session_name', history_invoice_id = $invoice_id");
|
||||||
|
|
||||||
logAction("Invoice", "Create", "$session_name created Invoice $config_invoice_prefix$invoice_number - $scope", $client_id, $invoice_id);
|
logAudit("Invoice", "Create", "$session_name created Invoice $config_invoice_prefix$invoice_number - $scope", $client_id, $invoice_id);
|
||||||
|
|
||||||
customAction('invoice_create', $invoice_id);
|
customAction('invoice_create', $invoice_id);
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ if (isset($_POST['edit_invoice'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE invoices SET invoice_scope = '$scope', invoice_date = '$date', invoice_due = '$due', invoice_category_id = $category, invoice_discount_amount = '$invoice_discount', invoice_amount = '$invoice_amount' WHERE invoice_id = $invoice_id");
|
mysqli_query($mysqli,"UPDATE invoices SET invoice_scope = '$scope', invoice_date = '$date', invoice_due = '$due', invoice_category_id = $category, invoice_discount_amount = '$invoice_discount', invoice_amount = '$invoice_amount' WHERE invoice_id = $invoice_id");
|
||||||
|
|
||||||
logAction("Invoice", "Edit", "$session_name edited Invoice $invoice_prefix$invoice_number - $scope", $client_id, $invoice_id);
|
logAudit("Invoice", "Edit", "$session_name edited Invoice $invoice_prefix$invoice_number - $scope", $client_id, $invoice_id);
|
||||||
|
|
||||||
flash_alert("Invoice <strong>$invoice_prefix$invoice_number</strong> edited");
|
flash_alert("Invoice <strong>$invoice_prefix$invoice_number</strong> edited");
|
||||||
|
|
||||||
@@ -154,7 +154,7 @@ if (isset($_POST['add_invoice_copy'])) {
|
|||||||
mysqli_query($mysqli,"INSERT INTO invoice_items SET item_name = '$item_name', item_description = '$item_description', item_quantity = $item_quantity, item_price = $item_price, item_subtotal = $item_subtotal, item_tax = $item_tax, item_total = $item_total, item_order = $item_order, item_tax_id = $tax_id, item_invoice_id = $new_invoice_id");
|
mysqli_query($mysqli,"INSERT INTO invoice_items SET item_name = '$item_name', item_description = '$item_description', item_quantity = $item_quantity, item_price = $item_price, item_subtotal = $item_subtotal, item_tax = $item_tax, item_total = $item_total, item_order = $item_order, item_tax_id = $tax_id, item_invoice_id = $new_invoice_id");
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Invoice", "Create", "$session_name created new Invoice $config_invoice_prefix$new_invoice_number from $old_invoice_prefix$old_invoice_prefix", $client_id, $new_invoice_id);
|
logAudit("Invoice", "Create", "$session_name created new Invoice $config_invoice_prefix$new_invoice_number from $old_invoice_prefix$old_invoice_prefix", $client_id, $new_invoice_id);
|
||||||
|
|
||||||
customAction('invoice_create', $new_invoice_id);
|
customAction('invoice_create', $new_invoice_id);
|
||||||
|
|
||||||
@@ -185,7 +185,7 @@ if (isset($_GET['mark_invoice_sent'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Sent', history_description = 'Invoice marked sent by $session_name', history_invoice_id = $invoice_id");
|
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Sent', history_description = 'Invoice marked sent by $session_name', history_invoice_id = $invoice_id");
|
||||||
|
|
||||||
logAction("Invoice", "Edit", "$session_name marked invoice $invoice_prefix$invoice_number sent", $client_id, $invoice_id);
|
logAudit("Invoice", "Edit", "$session_name marked invoice $invoice_prefix$invoice_number sent", $client_id, $invoice_id);
|
||||||
|
|
||||||
flash_alert("Invoice marked sent");
|
flash_alert("Invoice marked sent");
|
||||||
|
|
||||||
@@ -214,7 +214,7 @@ if (isset($_GET['mark_invoice_non-billable'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Non-Billable', history_description = 'INVOICE marked Non-Billable', history_invoice_id = $invoice_id");
|
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Non-Billable', history_description = 'INVOICE marked Non-Billable', history_invoice_id = $invoice_id");
|
||||||
|
|
||||||
logAction("Invoice", "Edit", "$session_name marked invoice $invoice_prefix$invoice_number Non-Billable", $client_id, $invoice_id);
|
logAudit("Invoice", "Edit", "$session_name marked invoice $invoice_prefix$invoice_number Non-Billable", $client_id, $invoice_id);
|
||||||
|
|
||||||
flash_alert("Invoice marked Non-Billable");
|
flash_alert("Invoice marked Non-Billable");
|
||||||
|
|
||||||
@@ -243,7 +243,7 @@ if (isset($_GET['cancel_invoice'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Cancelled', history_description = 'Invoice cancelled by $session_name', history_invoice_id = $invoice_id");
|
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Cancelled', history_description = 'Invoice cancelled by $session_name', history_invoice_id = $invoice_id");
|
||||||
|
|
||||||
logAction("Invoice", "Edit", "$session_name cancelled invoice $invoice_prefix$invoice_number", $client_id, $invoice_id);
|
logAudit("Invoice", "Edit", "$session_name cancelled invoice $invoice_prefix$invoice_number", $client_id, $invoice_id);
|
||||||
|
|
||||||
flash_alert("Invoice <strong>$invoice_prefix$invoice_number</strong> cancelled", 'error');
|
flash_alert("Invoice <strong>$invoice_prefix$invoice_number</strong> cancelled", 'error');
|
||||||
|
|
||||||
@@ -294,7 +294,7 @@ if (isset($_GET['delete_invoice'])) {
|
|||||||
//unlink tickets from invoice
|
//unlink tickets from invoice
|
||||||
mysqli_query($mysqli,"UPDATE tickets SET ticket_invoice_id = 0 WHERE ticket_invoice_id = $invoice_id");
|
mysqli_query($mysqli,"UPDATE tickets SET ticket_invoice_id = 0 WHERE ticket_invoice_id = $invoice_id");
|
||||||
|
|
||||||
logAction("Invoice", "Delete", "$session_name deleted invoice $invoice_prefix$invoice_number", $client_id);
|
logAudit("Invoice", "Delete", "$session_name deleted invoice $invoice_prefix$invoice_number", $client_id);
|
||||||
|
|
||||||
flash_alert("Invoice <strong>$invoice_prefix$invoice_number</strong> deleted", 'error');
|
flash_alert("Invoice <strong>$invoice_prefix$invoice_number</strong> deleted", 'error');
|
||||||
|
|
||||||
@@ -382,7 +382,7 @@ if (isset($_POST['add_invoice_item'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE invoices SET invoice_amount = $new_invoice_amount WHERE invoice_id = $invoice_id");
|
mysqli_query($mysqli,"UPDATE invoices SET invoice_amount = $new_invoice_amount WHERE invoice_id = $invoice_id");
|
||||||
|
|
||||||
logAction("Invoice", "Edit", "$session_name added item $name to invoice $invoice_prefix$invoice_number", $client_id, $invoice_id);
|
logAudit("Invoice", "Edit", "$session_name added item $name to invoice $invoice_prefix$invoice_number", $client_id, $invoice_id);
|
||||||
|
|
||||||
flash_alert("Item <strong>$name</strong> added to invoice");
|
flash_alert("Item <strong>$name</strong> added to invoice");
|
||||||
|
|
||||||
@@ -410,7 +410,7 @@ if (isset($_POST['invoice_note'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE invoices SET invoice_note = '$note' WHERE invoice_id = $invoice_id");
|
mysqli_query($mysqli,"UPDATE invoices SET invoice_note = '$note' WHERE invoice_id = $invoice_id");
|
||||||
|
|
||||||
logAction("Invoice", "Edit", "$session_name added note to invoice $invoice_prefix$invoice_number", $client_id, $invoice_id);
|
logAudit("Invoice", "Edit", "$session_name added note to invoice $invoice_prefix$invoice_number", $client_id, $invoice_id);
|
||||||
|
|
||||||
flash_alert("Notes added");
|
flash_alert("Notes added");
|
||||||
|
|
||||||
@@ -469,7 +469,7 @@ if (isset($_POST['edit_invoice_item'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE invoices SET invoice_amount = $new_invoice_amount WHERE invoice_id = $invoice_id");
|
mysqli_query($mysqli,"UPDATE invoices SET invoice_amount = $new_invoice_amount WHERE invoice_id = $invoice_id");
|
||||||
|
|
||||||
logAction("Invoice", "Edit", "$session_name edited item $name on invoice $invoice_prefix$invoice_number", $client_id, $invoice_id);
|
logAudit("Invoice", "Edit", "$session_name edited item $name on invoice $invoice_prefix$invoice_number", $client_id, $invoice_id);
|
||||||
|
|
||||||
flash_alert("Item <strong>$name</strong> updated");
|
flash_alert("Item <strong>$name</strong> updated");
|
||||||
|
|
||||||
@@ -514,7 +514,7 @@ if (isset($_GET['delete_invoice_item'])) {
|
|||||||
mysqli_query($mysqli,"INSERT INTO product_stock SET stock_qty = $item_quantity, stock_note = 'Returned QTY $item_quantity back to stock from Invoice $invoice_id', stock_product_id = $item_product_id");
|
mysqli_query($mysqli,"INSERT INTO product_stock SET stock_qty = $item_quantity, stock_note = 'Returned QTY $item_quantity back to stock from Invoice $invoice_id', stock_product_id = $item_product_id");
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Invoice", "Delete", "$session_name removed item $item_name from invoice $invoice_prefix$invoice_number", $client_id, $invoice_id);
|
logAudit("Invoice", "Delete", "$session_name removed item $item_name from invoice $invoice_prefix$invoice_number", $client_id, $invoice_id);
|
||||||
|
|
||||||
flash_alert("Item <strong>$item_name</strong> removed from invoice", 'error');
|
flash_alert("Item <strong>$item_name</strong> removed from invoice", 'error');
|
||||||
|
|
||||||
@@ -613,7 +613,7 @@ if (isset($_GET['email_invoice'])) {
|
|||||||
mysqli_query($mysqli,"UPDATE invoices SET invoice_status = 'Sent' WHERE invoice_id = $invoice_id");
|
mysqli_query($mysqli,"UPDATE invoices SET invoice_status = 'Sent' WHERE invoice_id = $invoice_id");
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Invoice", "Email", "$session_name Emailed $contact_email Invoice $invoice_prefix$invoice_number Email queued to Email ID: $email_id", $client_id, $invoice_id);
|
logAudit("Invoice", "Email", "$session_name Emailed $contact_email Invoice $invoice_prefix$invoice_number Email queued to Email ID: $email_id", $client_id, $invoice_id);
|
||||||
|
|
||||||
// Send copies of the invoice to any additional billing contacts
|
// Send copies of the invoice to any additional billing contacts
|
||||||
$sql_billing_contacts = mysqli_query(
|
$sql_billing_contacts = mysqli_query(
|
||||||
@@ -640,7 +640,7 @@ if (isset($_GET['email_invoice'])) {
|
|||||||
'body' => $body
|
'body' => $body
|
||||||
];
|
];
|
||||||
|
|
||||||
logAction("Invoice", "Email", "$session_name Emailed $billing_contact_email Invoice $invoice_prefix$invoice_number Email queued Email ID: $email_id", $client_id, $invoice_id);
|
logAudit("Invoice", "Email", "$session_name Emailed $billing_contact_email Invoice $invoice_prefix$invoice_number Email queued Email ID: $email_id", $client_id, $invoice_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -712,7 +712,7 @@ if (isset($_POST['export_invoices_csv'])) {
|
|||||||
fpassthru($f);
|
fpassthru($f);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Invoice", "Export", "$session_name exported $num_rows invoices to CSV file");
|
logAudit("Invoice", "Export", "$session_name exported $num_rows invoices to CSV file");
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
@@ -1168,11 +1168,11 @@ if (isset($_POST['bulk_edit_invoice_category'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE invoices SET invoice_category_id = $category_id WHERE invoice_id = $invoice_id");
|
mysqli_query($mysqli,"UPDATE invoices SET invoice_category_id = $category_id WHERE invoice_id = $invoice_id");
|
||||||
|
|
||||||
logAction("Invoice", "Edit", "$session_name assigned Invoice $invoice_prefix$invoice_number to category $category_name", $client_id, $invoice_id);
|
logAudit("Invoice", "Edit", "$session_name assigned Invoice $invoice_prefix$invoice_number to category $category_name", $client_id, $invoice_id);
|
||||||
|
|
||||||
} // End Assign Loop
|
} // End Assign Loop
|
||||||
|
|
||||||
logAction("Invoice", "Bulk Edit", "$session_name assigned $count invoices to category $category_name");
|
logAudit("Invoice", "Bulk Edit", "$session_name assigned $count invoices to category $category_name");
|
||||||
|
|
||||||
flash_alert("Assigned income category <strong>$category_name</strong> to <strong>$count</strong> invoice(s)");
|
flash_alert("Assigned income category <strong>$category_name</strong> to <strong>$count</strong> invoice(s)");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ if(isset($_POST['add_location'])){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Location", "Create", "$session_name created location $name", $client_id, $location_id);
|
logAudit("Location", "Create", "$session_name created location $name", $client_id, $location_id);
|
||||||
|
|
||||||
flash_alert("Location <strong>$name</strong> created.");
|
flash_alert("Location <strong>$name</strong> created.");
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ if(isset($_POST['edit_location'])){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Location", "Edit", "$session_name edited location $name", $client_id, $location_id);
|
logAudit("Location", "Edit", "$session_name edited location $name", $client_id, $location_id);
|
||||||
|
|
||||||
flash_alert("Location <strong>$name</strong> updated");
|
flash_alert("Location <strong>$name</strong> updated");
|
||||||
|
|
||||||
@@ -149,7 +149,7 @@ if(isset($_GET['archive_location'])){
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE locations SET location_archived_at = NOW() WHERE location_id = $location_id");
|
mysqli_query($mysqli,"UPDATE locations SET location_archived_at = NOW() WHERE location_id = $location_id");
|
||||||
|
|
||||||
logAction("Location", "Archive", "$session_name archived location $location_name", $client_id, $location_id);
|
logAudit("Location", "Archive", "$session_name archived location $location_name", $client_id, $location_id);
|
||||||
|
|
||||||
flash_alert("Location <strong>$location_name</strong> archived", 'error');
|
flash_alert("Location <strong>$location_name</strong> archived", 'error');
|
||||||
|
|
||||||
@@ -175,7 +175,7 @@ if(isset($_GET['restore_location'])){
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE locations SET location_archived_at = NULL WHERE location_id = $location_id");
|
mysqli_query($mysqli,"UPDATE locations SET location_archived_at = NULL WHERE location_id = $location_id");
|
||||||
|
|
||||||
logAction("Location", "Restore", "$session_name restored location $location_name", $client_id, $location_id);
|
logAudit("Location", "Restore", "$session_name restored location $location_name", $client_id, $location_id);
|
||||||
|
|
||||||
flash_alert("Location <strong>$location_name</strong> restored");
|
flash_alert("Location <strong>$location_name</strong> restored");
|
||||||
|
|
||||||
@@ -201,7 +201,7 @@ if(isset($_GET['delete_location'])){
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM locations WHERE location_id = $location_id");
|
mysqli_query($mysqli,"DELETE FROM locations WHERE location_id = $location_id");
|
||||||
|
|
||||||
logAction("Location", "Delete", "$session_name deleted location $location_name", $client_id);
|
logAudit("Location", "Delete", "$session_name deleted location $location_name", $client_id);
|
||||||
|
|
||||||
flash_alert("Location <strong>$location_name</strong> deleted", 'error');
|
flash_alert("Location <strong>$location_name</strong> deleted", 'error');
|
||||||
|
|
||||||
@@ -249,11 +249,11 @@ if (isset($_POST['bulk_assign_location_tags'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Location", "Edit", "$session_name assigned tags to location $location_name", $client_id, $location_id);
|
logAudit("Location", "Edit", "$session_name assigned tags to location $location_name", $client_id, $location_id);
|
||||||
|
|
||||||
} // End Assign Location Loop
|
} // End Assign Location Loop
|
||||||
|
|
||||||
logAction("Location", "Bulk Edit", "$session_name assigned tags to $count location(s)", $client_id);
|
logAudit("Location", "Bulk Edit", "$session_name assigned tags to $count location(s)", $client_id);
|
||||||
|
|
||||||
flash_alert("Assigned tags for <strong>$count</strong> locations");
|
flash_alert("Assigned tags for <strong>$count</strong> locations");
|
||||||
|
|
||||||
@@ -291,14 +291,14 @@ if (isset($_POST['bulk_archive_locations'])) {
|
|||||||
mysqli_query($mysqli,"UPDATE locations SET location_archived_at = NOW() WHERE location_id = $location_id");
|
mysqli_query($mysqli,"UPDATE locations SET location_archived_at = NOW() WHERE location_id = $location_id");
|
||||||
|
|
||||||
// Individual Contact logging
|
// Individual Contact logging
|
||||||
logAction("Location", "Archive", "$session_name archived location $location_name", $client_id, $location_id);
|
logAudit("Location", "Archive", "$session_name archived location $location_name", $client_id, $location_id);
|
||||||
|
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Location", "Bulk Archive", "$session_name archived $count location(s)");
|
logAudit("Location", "Bulk Archive", "$session_name archived $count location(s)");
|
||||||
|
|
||||||
flash_alert("Archived <strong>$count</strong> location(s)", 'error');
|
flash_alert("Archived <strong>$count</strong> location(s)", 'error');
|
||||||
|
|
||||||
@@ -334,11 +334,11 @@ if (isset($_POST['bulk_restore_locations'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE locations SET location_archived_at = NULL WHERE location_id = $location_id");
|
mysqli_query($mysqli,"UPDATE locations SET location_archived_at = NULL WHERE location_id = $location_id");
|
||||||
|
|
||||||
logAction("Location", "Restore", "$session_name restored location $location_name", $client_id, $location_id);
|
logAudit("Location", "Restore", "$session_name restored location $location_name", $client_id, $location_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Location", "Bulk Restore", "$session_name restored $count location(s)", $client_id);
|
logAudit("Location", "Bulk Restore", "$session_name restored $count location(s)", $client_id);
|
||||||
|
|
||||||
flash_alert("Restored <strong>$count</strong> location(s)");
|
flash_alert("Restored <strong>$count</strong> location(s)");
|
||||||
|
|
||||||
@@ -374,11 +374,11 @@ if (isset($_POST['bulk_delete_locations'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "DELETE FROM locations WHERE location_id = $location_id AND location_client_id = $client_id");
|
mysqli_query($mysqli, "DELETE FROM locations WHERE location_id = $location_id AND location_client_id = $client_id");
|
||||||
|
|
||||||
logAction("Location", "Delete", "$session_name deleted location $location_name", $client_id);
|
logAudit("Location", "Delete", "$session_name deleted location $location_name", $client_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Location", "Bulk Delete", "$session_name deleted $count location(s)", $client_id);
|
logAudit("Location", "Bulk Delete", "$session_name deleted $count location(s)", $client_id);
|
||||||
|
|
||||||
flash_alert("Deleted <strong>$count</strong> location(s)", 'error');
|
flash_alert("Deleted <strong>$count</strong> location(s)", 'error');
|
||||||
|
|
||||||
@@ -440,7 +440,7 @@ if(isset($_POST['export_locations_csv'])){
|
|||||||
fpassthru($f);
|
fpassthru($f);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Location", "Export", "$session_name exported $num_rows location(s) to a CSV file", $client_id);
|
logAudit("Location", "Export", "$session_name exported $num_rows location(s) to a CSV file", $client_id);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
@@ -534,7 +534,7 @@ if (isset($_POST["import_locations_csv"])) {
|
|||||||
}
|
}
|
||||||
fclose($file);
|
fclose($file);
|
||||||
|
|
||||||
logAction("Location", "Import", "$session_name imported $row_count location(s). $duplicate_count duplicate(s) found and not imported", $client_id);
|
logAudit("Location", "Import", "$session_name imported $row_count location(s). $duplicate_count duplicate(s) found and not imported", $client_id);
|
||||||
|
|
||||||
flash_alert("$row_count Location(s) imported, $duplicate_count duplicate(s) detected and not imported");
|
flash_alert("$row_count Location(s) imported, $duplicate_count duplicate(s) detected and not imported");
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ if (isset($_POST['add_network'])) {
|
|||||||
|
|
||||||
$network_id = mysqli_insert_id($mysqli);
|
$network_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Network", "Create", "$session_name created network $name", $client_id, $network_id);
|
logAudit("Network", "Create", "$session_name created network $name", $client_id, $network_id);
|
||||||
|
|
||||||
flash_alert("Network <strong>$name</strong> created");
|
flash_alert("Network <strong>$name</strong> created");
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ if (isset($_POST['edit_network'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE networks SET network_name = '$name', network_description = '$description', network_vlan = $vlan, network = '$network', network_gateway = '$gateway', network_primary_dns = '$primary_dns', network_secondary_dns = '$secondary_dns', network_dhcp_range = '$dhcp_range', network_notes = '$notes', network_location_id = $location_id WHERE network_id = $network_id");
|
mysqli_query($mysqli,"UPDATE networks SET network_name = '$name', network_description = '$description', network_vlan = $vlan, network = '$network', network_gateway = '$gateway', network_primary_dns = '$primary_dns', network_secondary_dns = '$secondary_dns', network_dhcp_range = '$dhcp_range', network_notes = '$notes', network_location_id = $location_id WHERE network_id = $network_id");
|
||||||
|
|
||||||
logAction("Network", "Edit", "$session_name edited network $name", $client_id, $network_id);
|
logAudit("Network", "Edit", "$session_name edited network $name", $client_id, $network_id);
|
||||||
|
|
||||||
flash_alert("Network <strong>$name</strong> updated");
|
flash_alert("Network <strong>$name</strong> updated");
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ if (isset($_GET['archive_network'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE networks SET network_archived_at = NOW() WHERE network_id = $network_id");
|
mysqli_query($mysqli,"UPDATE networks SET network_archived_at = NOW() WHERE network_id = $network_id");
|
||||||
|
|
||||||
logAction("Network", "Archive", "$session_name archived network $network_name", $client_id, $network_id);
|
logAudit("Network", "Archive", "$session_name archived network $network_name", $client_id, $network_id);
|
||||||
|
|
||||||
flash_alert("Network <strong>$network_name</strong> archived", 'error');
|
flash_alert("Network <strong>$network_name</strong> archived", 'error');
|
||||||
|
|
||||||
@@ -98,7 +98,7 @@ if (isset($_GET['restore_network'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE networks SET network_archived_at = NULL WHERE network_id = $network_id");
|
mysqli_query($mysqli,"UPDATE networks SET network_archived_at = NULL WHERE network_id = $network_id");
|
||||||
|
|
||||||
logAction("Network", "Restore", "$session_name restored contact $contact_name", $client_id, $network_id);
|
logAudit("Network", "Restore", "$session_name restored contact $contact_name", $client_id, $network_id);
|
||||||
|
|
||||||
flash_alert("Network <strong>$network_name</strong> restored");
|
flash_alert("Network <strong>$network_name</strong> restored");
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ if (isset($_GET['delete_network'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM networks WHERE network_id = $network_id");
|
mysqli_query($mysqli,"DELETE FROM networks WHERE network_id = $network_id");
|
||||||
|
|
||||||
logAction("Network", "Delete", "$session_name deleted network $network_name", $client_id);
|
logAudit("Network", "Delete", "$session_name deleted network $network_name", $client_id);
|
||||||
|
|
||||||
flash_alert("Network <strong>$network_name</strong> deleted", 'error');
|
flash_alert("Network <strong>$network_name</strong> deleted", 'error');
|
||||||
|
|
||||||
@@ -158,11 +158,11 @@ if (isset($_POST['bulk_delete_networks'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "DELETE FROM networks WHERE network_id = $network_id AND network_client_id = $client_id");
|
mysqli_query($mysqli, "DELETE FROM networks WHERE network_id = $network_id AND network_client_id = $client_id");
|
||||||
|
|
||||||
logAction("Network", "Delete", "$session_name deleted network $network_name", $client_id);
|
logAudit("Network", "Delete", "$session_name deleted network $network_name", $client_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Network", "Bulk Delete", "$session_name deleted $count network(s)", $client_id);
|
logAudit("Network", "Bulk Delete", "$session_name deleted $count network(s)", $client_id);
|
||||||
|
|
||||||
flash_alert("Deleted <strong>$count</strong> network(s)", 'error');
|
flash_alert("Deleted <strong>$count</strong> network(s)", 'error');
|
||||||
|
|
||||||
@@ -222,7 +222,7 @@ if (isset($_POST['export_networks_csv'])) {
|
|||||||
fpassthru($f);
|
fpassthru($f);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Network", "Export", "$session_name deleted $num_rows network(s) to a CSV file", $client_id);
|
logAudit("Network", "Export", "$session_name deleted $num_rows network(s) to a CSV file", $client_id);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
@@ -373,7 +373,7 @@ if (isset($_POST['import_networks_csv'])) {
|
|||||||
|
|
||||||
fclose($file);
|
fclose($file);
|
||||||
|
|
||||||
logAction("Network", "Import", "$session_name imported $row_count network(s). $duplicate_count duplicate(s) found and not imported", $client_id);
|
logAudit("Network", "Import", "$session_name imported $row_count network(s). $duplicate_count duplicate(s) found and not imported", $client_id);
|
||||||
|
|
||||||
flash_alert("$row_count Network(s) imported, $duplicate_count duplicate(s) detected and not imported");
|
flash_alert("$row_count Network(s) imported, $duplicate_count duplicate(s) detected and not imported");
|
||||||
|
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ if (isset($_POST['add_payment'])) {
|
|||||||
|
|
||||||
// Email Logging
|
// Email Logging
|
||||||
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Sent', history_description = 'Payment Receipt sent to mail queue ID: $email_id!', history_invoice_id = $invoice_id");
|
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Sent', history_description = 'Payment Receipt sent to mail queue ID: $email_id!', history_invoice_id = $invoice_id");
|
||||||
logAction("Invoice", "Payment", "Payment receipt for invoice $invoice_prefix$invoice_number queued to $contact_email Email ID: $email_id", $client_id, $invoice_id);
|
logAudit("Invoice", "Payment", "Payment receipt for invoice $invoice_prefix$invoice_number queued to $contact_email Email ID: $email_id", $client_id, $invoice_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,7 +152,7 @@ if (isset($_POST['add_payment'])) {
|
|||||||
|
|
||||||
// Email Logging
|
// Email Logging
|
||||||
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Sent', history_description = 'Payment Receipt sent to mail queue ID: $email_id!', history_invoice_id = $invoice_id");
|
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Sent', history_description = 'Payment Receipt sent to mail queue ID: $email_id!', history_invoice_id = $invoice_id");
|
||||||
logAction("Invoice", "Payment", "Payment receipt for invoice $invoice_prefix$invoice_number queued to $contact_email Email ID: $email_id", $client_id, $invoice_id);
|
logAudit("Invoice", "Payment", "Payment receipt for invoice $invoice_prefix$invoice_number queued to $contact_email Email ID: $email_id", $client_id, $invoice_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,7 +164,7 @@ if (isset($_POST['add_payment'])) {
|
|||||||
//Add Payment to History
|
//Add Payment to History
|
||||||
mysqli_query($mysqli,"INSERT INTO history SET history_status = '$invoice_status', history_description = 'Payment added', history_invoice_id = $invoice_id");
|
mysqli_query($mysqli,"INSERT INTO history SET history_status = '$invoice_status', history_description = 'Payment added', history_invoice_id = $invoice_id");
|
||||||
|
|
||||||
logAction("Invoice", "Payment", "Payment amount of " . numfmt_format_currency($currency_format, $amount, $invoice_currency_code) . " added to invoice $invoice_prefix$invoice_number", $client_id, $invoice_id);
|
logAudit("Invoice", "Payment", "Payment amount of " . numfmt_format_currency($currency_format, $amount, $invoice_currency_code) . " added to invoice $invoice_prefix$invoice_number", $client_id, $invoice_id);
|
||||||
|
|
||||||
customAction('invoice_pay', $invoice_id);
|
customAction('invoice_pay', $invoice_id);
|
||||||
|
|
||||||
@@ -196,7 +196,7 @@ if (isset($_POST['edit_payment'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE payments SET payment_date = '$date', payment_amount = $amount, payment_account_id = $account, payment_method = '$payment_method', payment_reference = '$reference' WHERE payment_id = $payment_id");
|
mysqli_query($mysqli,"UPDATE payments SET payment_date = '$date', payment_amount = $amount, payment_account_id = $account, payment_method = '$payment_method', payment_reference = '$reference' WHERE payment_id = $payment_id");
|
||||||
|
|
||||||
logAction("Payment", "Edit", "Payment edited amount of " . numfmt_format_currency($currency_format, $amount, $session_company_currency));
|
logAudit("Payment", "Edit", "Payment edited amount of " . numfmt_format_currency($currency_format, $amount, $session_company_currency));
|
||||||
|
|
||||||
flash_alert("Payment edited to amount <strong>" . numfmt_format_currency($currency_format, $amount, $session_company_currency) . "</strong> added");
|
flash_alert("Payment edited to amount <strong>" . numfmt_format_currency($currency_format, $amount, $session_company_currency) . "</strong> added");
|
||||||
|
|
||||||
@@ -305,7 +305,7 @@ if (isset($_POST['apply_credit'])) {
|
|||||||
history_invoice_id = $invoice_id
|
history_invoice_id = $invoice_id
|
||||||
");
|
");
|
||||||
|
|
||||||
logAction("Invoice", "Payment", "Credit " . numfmt_format_currency($currency_format, $amount, $session_company_currency) . " applied to invoice $invoice_prefix$invoice_number", $client_id, $invoice_id);
|
logAudit("Invoice", "Payment", "Credit " . numfmt_format_currency($currency_format, $amount, $session_company_currency) . " applied to invoice $invoice_prefix$invoice_number", $client_id, $invoice_id);
|
||||||
|
|
||||||
customAction('invoice_pay', $invoice_id);
|
customAction('invoice_pay', $invoice_id);
|
||||||
|
|
||||||
@@ -479,7 +479,7 @@ if (isset($_POST['add_payment_stripe'])) {
|
|||||||
// Email Logging
|
// Email Logging
|
||||||
$email_id = mysqli_insert_id($mysqli);
|
$email_id = mysqli_insert_id($mysqli);
|
||||||
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Sent', history_description = 'Payment Receipt sent to mail queue ID: $email_id!', history_invoice_id = $invoice_id");
|
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Sent', history_description = 'Payment Receipt sent to mail queue ID: $email_id!', history_invoice_id = $invoice_id");
|
||||||
logAction("Invoice", "Payment", "Payment receipt for invoice $invoice_prefix$invoice_number queued to $contact_email Email ID: $email_id", $client_id, $invoice_id);
|
logAudit("Invoice", "Payment", "Payment receipt for invoice $invoice_prefix$invoice_number queued to $contact_email Email ID: $email_id", $client_id, $invoice_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Log info
|
// Log info
|
||||||
@@ -496,7 +496,7 @@ if (isset($_POST['add_payment_stripe'])) {
|
|||||||
|
|
||||||
// Notify/log
|
// Notify/log
|
||||||
appNotify("Invoice Paid", "Invoice $invoice_prefix$invoice_number automatically paid", "/agent/invoice.php?invoice_id=$invoice_id", $client_id);
|
appNotify("Invoice Paid", "Invoice $invoice_prefix$invoice_number automatically paid", "/agent/invoice.php?invoice_id=$invoice_id", $client_id);
|
||||||
logAction("Invoice", "Payment", "$session_name initiated Stripe payment amount of " . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . " added to invoice $invoice_prefix$invoice_number - $pi_id $extended_log_desc", $client_id, $invoice_id);
|
logAudit("Invoice", "Payment", "$session_name initiated Stripe payment amount of " . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . " added to invoice $invoice_prefix$invoice_number - $pi_id $extended_log_desc", $client_id, $invoice_id);
|
||||||
customAction('invoice_pay', $invoice_id);
|
customAction('invoice_pay', $invoice_id);
|
||||||
|
|
||||||
flash_alert("Payment amount <strong>" . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . "</strong> added");
|
flash_alert("Payment amount <strong>" . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . "</strong> added");
|
||||||
@@ -506,7 +506,7 @@ if (isset($_POST['add_payment_stripe'])) {
|
|||||||
} else {
|
} else {
|
||||||
mysqli_query($mysqli, "INSERT INTO history SET history_status = 'Payment failed', history_description = 'Stripe pay failed due to payment error', history_invoice_id = $invoice_id");
|
mysqli_query($mysqli, "INSERT INTO history SET history_status = 'Payment failed', history_description = 'Stripe pay failed due to payment error', history_invoice_id = $invoice_id");
|
||||||
|
|
||||||
logAction("Invoice", "Payment", "Failed online payment amount of invoice $invoice_prefix$invoice_number due to Stripe payment error", $client_id, $invoice_id);
|
logAudit("Invoice", "Payment", "Failed online payment amount of invoice $invoice_prefix$invoice_number due to Stripe payment error", $client_id, $invoice_id);
|
||||||
flash_alert("Payment failed", 'error');
|
flash_alert("Payment failed", 'error');
|
||||||
|
|
||||||
redirect();
|
redirect();
|
||||||
@@ -664,7 +664,7 @@ if (isset($_GET['add_payment_stripe'])) {
|
|||||||
// Email Logging
|
// Email Logging
|
||||||
$email_id = mysqli_insert_id($mysqli);
|
$email_id = mysqli_insert_id($mysqli);
|
||||||
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Sent', history_description = 'Payment Receipt sent to mail queue ID: $email_id!', history_invoice_id = $invoice_id");
|
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Sent', history_description = 'Payment Receipt sent to mail queue ID: $email_id!', history_invoice_id = $invoice_id");
|
||||||
logAction("Invoice", "Payment", "Payment receipt for invoice $invoice_prefix$invoice_number queued to $contact_email Email ID: $email_id", $client_id, $invoice_id);
|
logAudit("Invoice", "Payment", "Payment receipt for invoice $invoice_prefix$invoice_number queued to $contact_email Email ID: $email_id", $client_id, $invoice_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Log info
|
// Log info
|
||||||
@@ -681,7 +681,7 @@ if (isset($_GET['add_payment_stripe'])) {
|
|||||||
|
|
||||||
// Notify/log
|
// Notify/log
|
||||||
appNotify("Invoice Paid", "Invoice $invoice_prefix$invoice_number automatically paid", "invoice.php?invoice_id=$invoice_id", $client_id);
|
appNotify("Invoice Paid", "Invoice $invoice_prefix$invoice_number automatically paid", "invoice.php?invoice_id=$invoice_id", $client_id);
|
||||||
logAction("Invoice", "Payment", "$session_name initiated Stripe payment amount of " . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . " added to invoice $invoice_prefix$invoice_number - $pi_id $extended_log_desc", $client_id, $invoice_id);
|
logAudit("Invoice", "Payment", "$session_name initiated Stripe payment amount of " . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . " added to invoice $invoice_prefix$invoice_number - $pi_id $extended_log_desc", $client_id, $invoice_id);
|
||||||
customAction('invoice_pay', $invoice_id);
|
customAction('invoice_pay', $invoice_id);
|
||||||
|
|
||||||
flash_alert("Payment amount <strong>" . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . "</strong> added");
|
flash_alert("Payment amount <strong>" . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . "</strong> added");
|
||||||
@@ -691,7 +691,7 @@ if (isset($_GET['add_payment_stripe'])) {
|
|||||||
} else {
|
} else {
|
||||||
mysqli_query($mysqli, "INSERT INTO history SET history_status = 'Payment failed', history_description = 'Stripe pay failed due to payment error', history_invoice_id = $invoice_id");
|
mysqli_query($mysqli, "INSERT INTO history SET history_status = 'Payment failed', history_description = 'Stripe pay failed due to payment error', history_invoice_id = $invoice_id");
|
||||||
|
|
||||||
logAction("Invoice", "Payment", "Failed online payment amount of invoice $invoice_prefix$invoice_number due to Stripe payment error", $client_id, $invoice_id);
|
logAudit("Invoice", "Payment", "Failed online payment amount of invoice $invoice_prefix$invoice_number due to Stripe payment error", $client_id, $invoice_id);
|
||||||
flash_alert("Payment failed", 'error');
|
flash_alert("Payment failed", 'error');
|
||||||
|
|
||||||
redirect();
|
redirect();
|
||||||
@@ -822,13 +822,13 @@ if (isset($_POST['add_bulk_payment'])) {
|
|||||||
$email_id = mysqli_insert_id($mysqli);
|
$email_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
// Email Logging
|
// Email Logging
|
||||||
logAction("Payment", "Email", "Bulk Payment receipt for multiple Invoices queued to $contact_email Email ID: $email_id", $client_id);
|
logAudit("Payment", "Email", "Bulk Payment receipt for multiple Invoices queued to $contact_email Email ID: $email_id", $client_id);
|
||||||
|
|
||||||
$alert_message .= "Email receipt queued and ";
|
$alert_message .= "Email receipt queued and ";
|
||||||
|
|
||||||
} // End Email
|
} // End Email
|
||||||
|
|
||||||
logAction("Invoice", "Payment", "Bulk Payment amount of " . numfmt_format_currency($currency_format, $bulk_payment_amount_static, $currency_code) . " applied to multiple invoices", $client_id);
|
logAudit("Invoice", "Payment", "Bulk Payment amount of " . numfmt_format_currency($currency_format, $bulk_payment_amount_static, $currency_code) . " applied to multiple invoices", $client_id);
|
||||||
|
|
||||||
flash_alert("$alert_message Bulk Payment added");
|
flash_alert("$alert_message Bulk Payment added");
|
||||||
|
|
||||||
@@ -883,7 +883,7 @@ if (isset($_GET['delete_payment'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM payments WHERE payment_id = $payment_id");
|
mysqli_query($mysqli,"DELETE FROM payments WHERE payment_id = $payment_id");
|
||||||
|
|
||||||
logAction("Invoice", "Edit", "$session_name deleted Payment on Invoice $invoice_prefix$invoice_number", $client_id, $invoice_id);
|
logAudit("Invoice", "Edit", "$session_name deleted Payment on Invoice $invoice_prefix$invoice_number", $client_id, $invoice_id);
|
||||||
|
|
||||||
flash_alert("Payment deleted", 'error');
|
flash_alert("Payment deleted", 'error');
|
||||||
if ($config_stripe_enable) {
|
if ($config_stripe_enable) {
|
||||||
@@ -946,7 +946,7 @@ if (isset($_POST['export_payments_csv'])) {
|
|||||||
fpassthru($f);
|
fpassthru($f);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Payments", "Export", "$session_name exported $num_rows payments to CSV file");
|
logAudit("Payments", "Export", "$session_name exported $num_rows payments to CSV file");
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ if (isset($_POST['add_product'])) {
|
|||||||
|
|
||||||
$product_id = mysqli_insert_id($mysqli);
|
$product_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Product", "Create", "$session_name created product $name", 0, $product_id);
|
logAudit("Product", "Create", "$session_name created product $name", 0, $product_id);
|
||||||
|
|
||||||
flash_alert("Product <strong>$name</strong> created");
|
flash_alert("Product <strong>$name</strong> created");
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ if (isset($_POST['edit_product'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE products SET product_name = '$name', product_description = '$description', product_code = '$code', product_location = '$location', product_price = '$price', product_tax_id = $tax, product_category_id = $category WHERE product_id = $product_id");
|
mysqli_query($mysqli,"UPDATE products SET product_name = '$name', product_description = '$description', product_code = '$code', product_location = '$location', product_price = '$price', product_tax_id = $tax, product_category_id = $category WHERE product_id = $product_id");
|
||||||
|
|
||||||
logAction("Product", "Edit", "$session_name edited product $name", 0, $product_id);
|
logAudit("Product", "Edit", "$session_name edited product $name", 0, $product_id);
|
||||||
|
|
||||||
flash_alert("Product <strong>$name</strong> edited");
|
flash_alert("Product <strong>$name</strong> edited");
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ if (isset($_GET['archive_product'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE products SET product_archived_at = NOW() WHERE product_id = $product_id");
|
mysqli_query($mysqli,"UPDATE products SET product_archived_at = NOW() WHERE product_id = $product_id");
|
||||||
|
|
||||||
logAction("Product", "Archive", "$session_name archived product $product_name", 0, $product_id);
|
logAudit("Product", "Archive", "$session_name archived product $product_name", 0, $product_id);
|
||||||
|
|
||||||
flash_alert("Product <strong>$product_name</strong> archived", 'error');
|
flash_alert("Product <strong>$product_name</strong> archived", 'error');
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ if (isset($_GET['restore_product'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE products SET product_archived_at = NULL WHERE product_id = $product_id");
|
mysqli_query($mysqli,"UPDATE products SET product_archived_at = NULL WHERE product_id = $product_id");
|
||||||
|
|
||||||
logAction("Product", "Restore", "$session_name restored product $product_name", 0, $product_id);
|
logAudit("Product", "Restore", "$session_name restored product $product_name", 0, $product_id);
|
||||||
|
|
||||||
flash_alert("Product <strong>$product_name</strong> restored");
|
flash_alert("Product <strong>$product_name</strong> restored");
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ if (isset($_GET['delete_product'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM products WHERE product_id = $product_id");
|
mysqli_query($mysqli,"DELETE FROM products WHERE product_id = $product_id");
|
||||||
|
|
||||||
logAction("Product", "Delete", "$session_name deleted product $product_name");
|
logAudit("Product", "Delete", "$session_name deleted product $product_name");
|
||||||
|
|
||||||
flash_alert("Product <strong>$product_name</strong> deleted", 'error');
|
flash_alert("Product <strong>$product_name</strong> deleted", 'error');
|
||||||
|
|
||||||
@@ -133,11 +133,11 @@ if (isset($_POST['bulk_edit_product_category'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE products SET product_category_id = $category_id WHERE product_id = $product_id");
|
mysqli_query($mysqli,"UPDATE products SET product_category_id = $category_id WHERE product_id = $product_id");
|
||||||
|
|
||||||
logAction("Product", "Edit", "$session_name assigned product $product_name to category $category_name", 0, $product_id);
|
logAudit("Product", "Edit", "$session_name assigned product $product_name to category $category_name", 0, $product_id);
|
||||||
|
|
||||||
} // End Assign Product Loop
|
} // End Assign Product Loop
|
||||||
|
|
||||||
logAction("Product", "Edit", "$session_name assigned category $category_name to $count product(s)");
|
logAudit("Product", "Edit", "$session_name assigned category $category_name to $count product(s)");
|
||||||
|
|
||||||
flash_alert("Assigned category <strong>$category_name</strong> to <strong>$count</strong> product(s)");
|
flash_alert("Assigned category <strong>$category_name</strong> to <strong>$count</strong> product(s)");
|
||||||
}
|
}
|
||||||
@@ -165,10 +165,10 @@ if (isset($_POST['bulk_archive_products'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE products SET product_archived_at = NOW() WHERE product_id = $product_id");
|
mysqli_query($mysqli,"UPDATE products SET product_archived_at = NOW() WHERE product_id = $product_id");
|
||||||
|
|
||||||
logAction("Product", "Archive", "$session_name archived product $product_name", 0, $product_id);
|
logAudit("Product", "Archive", "$session_name archived product $product_name", 0, $product_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Product", "Bulk Archive", "$session_name archived $count product(s)");
|
logAudit("Product", "Bulk Archive", "$session_name archived $count product(s)");
|
||||||
|
|
||||||
flash_alert("Archived <strong>$count</strong> product(s)", 'error');
|
flash_alert("Archived <strong>$count</strong> product(s)", 'error');
|
||||||
|
|
||||||
@@ -197,11 +197,11 @@ if (isset($_POST['bulk_restore_products'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE products SET product_archived_at = NULL WHERE product_id = $product_id");
|
mysqli_query($mysqli,"UPDATE products SET product_archived_at = NULL WHERE product_id = $product_id");
|
||||||
|
|
||||||
logAction("Product", "Restore", "$session_name restored product $product_name", 0, $product_id);
|
logAudit("Product", "Restore", "$session_name restored product $product_name", 0, $product_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Product", "Bulk Restore", "$session_name restored $count product(s)");
|
logAudit("Product", "Bulk Restore", "$session_name restored $count product(s)");
|
||||||
|
|
||||||
flash_alert("Restored <strong>$count</strong> product(s)");
|
flash_alert("Restored <strong>$count</strong> product(s)");
|
||||||
|
|
||||||
@@ -230,11 +230,11 @@ if (isset($_POST['bulk_delete_products'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "DELETE FROM products WHERE product_id = $product_id");
|
mysqli_query($mysqli, "DELETE FROM products WHERE product_id = $product_id");
|
||||||
|
|
||||||
logAction("Product", "Delete", "$session_name deleted product $product_name");
|
logAudit("Product", "Delete", "$session_name deleted product $product_name");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Product", "Bulk Delete", "$session_name deleted $count product(s)");
|
logAudit("Product", "Bulk Delete", "$session_name deleted $count product(s)");
|
||||||
|
|
||||||
flash_alert("Deleted <strong>$count</strong> product(s)", 'error');
|
flash_alert("Deleted <strong>$count</strong> product(s)", 'error');
|
||||||
|
|
||||||
@@ -286,7 +286,7 @@ if (isset($_POST['export_products_csv'])) {
|
|||||||
fpassthru($f);
|
fpassthru($f);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Product", "Export", "$session_name exported $num_rows product(s) to a CSV file");
|
logAudit("Product", "Export", "$session_name exported $num_rows product(s) to a CSV file");
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@@ -305,7 +305,7 @@ if (isset($_POST['add_product_stock'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO product_stock SET stock_qty = $qty, stock_expense_id = $expense, stock_note = '$note', stock_product_id = $product_id");
|
mysqli_query($mysqli,"INSERT INTO product_stock SET stock_qty = $qty, stock_expense_id = $expense, stock_note = '$note', stock_product_id = $product_id");
|
||||||
|
|
||||||
logAction("Product", "Stock", "$session_name added $qty units to stock for product $product_name", 0, $product_id);
|
logAudit("Product", "Stock", "$session_name added $qty units to stock for product $product_name", 0, $product_id);
|
||||||
|
|
||||||
flash_alert("Added $qty units to <strong>$product_name</strong> stock");
|
flash_alert("Added $qty units to <strong>$product_name</strong> stock");
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ if (isset($_POST['add_project'])) {
|
|||||||
} // End Ticket Loop
|
} // End Ticket Loop
|
||||||
} // End If Project Template
|
} // End If Project Template
|
||||||
|
|
||||||
logAction("Project", "Create", "$session_name created project $project_name", $client_id, $project_id);
|
logAudit("Project", "Create", "$session_name created project $project_name", $client_id, $project_id);
|
||||||
|
|
||||||
flash_alert("You created Project <strong>$project_name</strong>");
|
flash_alert("You created Project <strong>$project_name</strong>");
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ if (isset($_POST['edit_project'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "UPDATE projects SET project_name = '$project_name', project_description = '$project_description', project_due = '$due_date', project_manager = $project_manager, project_client_id = $client_id WHERE project_id = $project_id");
|
mysqli_query($mysqli, "UPDATE projects SET project_name = '$project_name', project_description = '$project_description', project_due = '$due_date', project_manager = $project_manager, project_client_id = $client_id WHERE project_id = $project_id");
|
||||||
|
|
||||||
logAction("Project", "Edit", "$session_name edited project $project_name", $client_id, $project_id);
|
logAudit("Project", "Edit", "$session_name edited project $project_name", $client_id, $project_id);
|
||||||
|
|
||||||
flash_alert("Project <strong>$project_name</strong> edited");
|
flash_alert("Project <strong>$project_name</strong> edited");
|
||||||
|
|
||||||
@@ -143,7 +143,7 @@ if (isset($_GET['close_project'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "UPDATE projects SET project_completed_at = NOW() WHERE project_id = $project_id");
|
mysqli_query($mysqli, "UPDATE projects SET project_completed_at = NOW() WHERE project_id = $project_id");
|
||||||
|
|
||||||
logAction("Project", "Close", "$session_name closed project $project_name", $client_id, $project_id);
|
logAudit("Project", "Close", "$session_name closed project $project_name", $client_id, $project_id);
|
||||||
|
|
||||||
flash_alert("Project <strong>$project_name</strong> closed");
|
flash_alert("Project <strong>$project_name</strong> closed");
|
||||||
|
|
||||||
@@ -172,7 +172,7 @@ if (isset($_GET['archive_project'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "UPDATE projects SET project_archived_at = NOW() WHERE project_id = $project_id");
|
mysqli_query($mysqli, "UPDATE projects SET project_archived_at = NOW() WHERE project_id = $project_id");
|
||||||
|
|
||||||
logAction("Project", "Archive", "$session_name archived project $project_name", $client_id, $project_id);
|
logAudit("Project", "Archive", "$session_name archived project $project_name", $client_id, $project_id);
|
||||||
|
|
||||||
flash_alert("Project <strong>$project_name</strong> archived", 'error');
|
flash_alert("Project <strong>$project_name</strong> archived", 'error');
|
||||||
|
|
||||||
@@ -201,7 +201,7 @@ if (isset($_GET['restore_project'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "UPDATE projects SET project_archived_at = NULL WHERE project_id = $project_id");
|
mysqli_query($mysqli, "UPDATE projects SET project_archived_at = NULL WHERE project_id = $project_id");
|
||||||
|
|
||||||
logAction("Project", "Restore", "$session_name restored project $project_name", $client_id, $project_id);
|
logAudit("Project", "Restore", "$session_name restored project $project_name", $client_id, $project_id);
|
||||||
|
|
||||||
flash_alert("Project <strong>$project_name</strong> restored");
|
flash_alert("Project <strong>$project_name</strong> restored");
|
||||||
|
|
||||||
@@ -230,7 +230,7 @@ if (isset($_GET['delete_project'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "DELETE FROM projects WHERE project_id = $project_id");
|
mysqli_query($mysqli, "DELETE FROM projects WHERE project_id = $project_id");
|
||||||
|
|
||||||
logAction("Project", "Delete", "$session_name deleted project $project_name", $client_id, $project_id);
|
logAudit("Project", "Delete", "$session_name deleted project $project_name", $client_id, $project_id);
|
||||||
|
|
||||||
flash_alert("Project <strong>$project_name</strong> Deleted", 'error');
|
flash_alert("Project <strong>$project_name</strong> Deleted", 'error');
|
||||||
|
|
||||||
@@ -275,11 +275,11 @@ if (isset($_POST['link_ticket_to_project'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "UPDATE tickets SET ticket_project_id = $project_id WHERE ticket_id = $ticket_id");
|
mysqli_query($mysqli, "UPDATE tickets SET ticket_project_id = $project_id WHERE ticket_id = $ticket_id");
|
||||||
|
|
||||||
logAction("Project", "Edit", "$session_name added ticket $ticket_prefix$ticket_number - $ticket_subject to project $project_name", $client_id, $project_id);
|
logAudit("Project", "Edit", "$session_name added ticket $ticket_prefix$ticket_number - $ticket_subject to project $project_name", $client_id, $project_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Project", "Bulk Edit", "$session_name added $count ticket(s) to project $project_name", $client_id, $project_id);
|
logAudit("Project", "Bulk Edit", "$session_name added $count ticket(s) to project $project_name", $client_id, $project_id);
|
||||||
|
|
||||||
flash_alert("<strong>$count</strong> Ticket(s) added to <strong>$project_name</strong>");
|
flash_alert("<strong>$count</strong> Ticket(s) added to <strong>$project_name</strong>");
|
||||||
}
|
}
|
||||||
@@ -323,7 +323,7 @@ if (isset($_POST['link_closed_ticket_to_project'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "UPDATE tickets SET ticket_project_id = $project_id, ticket_updated_at = '$ticket_updated' WHERE ticket_id = $ticket_id");
|
mysqli_query($mysqli, "UPDATE tickets SET ticket_project_id = $project_id, ticket_updated_at = '$ticket_updated' WHERE ticket_id = $ticket_id");
|
||||||
|
|
||||||
logAction("Project", "Edit", "$session_name added ticket $ticket_prefix$ticket_number - $ticket_subject to project $project_name", $client_id, $project_id);
|
logAudit("Project", "Edit", "$session_name added ticket $ticket_prefix$ticket_number - $ticket_subject to project $project_name", $client_id, $project_id);
|
||||||
|
|
||||||
flash_alert("Ticket added to <strong>$project_name</strong>");
|
flash_alert("Ticket added to <strong>$project_name</strong>");
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ if (isset($_POST['add_quote'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Draft', history_description = 'Quote created!', history_quote_id = $quote_id");
|
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Draft', history_description = 'Quote created!', history_quote_id = $quote_id");
|
||||||
|
|
||||||
logAction("Quote", "Create", "$session_name created quote $config_quote_prefix$quote_number", $client_id, $quote_id);
|
logAudit("Quote", "Create", "$session_name created quote $config_quote_prefix$quote_number", $client_id, $quote_id);
|
||||||
|
|
||||||
customAction('quote_create', $quote_id);
|
customAction('quote_create', $quote_id);
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@ if (isset($_POST['add_quote_copy'])) {
|
|||||||
mysqli_query($mysqli,"INSERT INTO quote_items SET item_name = '$item_name', item_description = '$item_description', item_quantity = $item_quantity, item_price = $item_price, item_subtotal = $item_subtotal, item_tax = $item_tax, item_total = $item_total, item_order = $item_order, item_tax_id = $tax_id, item_quote_id = $new_quote_id");
|
mysqli_query($mysqli,"INSERT INTO quote_items SET item_name = '$item_name', item_description = '$item_description', item_quantity = $item_quantity, item_price = $item_price, item_subtotal = $item_subtotal, item_tax = $item_tax, item_total = $item_total, item_order = $item_order, item_tax_id = $tax_id, item_quote_id = $new_quote_id");
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Quote", "Create", "$session_name created quote $config_quote_prefix$quote_number from quote $original_quote_prefix$original_quote_number", $client_id, $new_quote_id);
|
logAudit("Quote", "Create", "$session_name created quote $config_quote_prefix$quote_number from quote $original_quote_prefix$original_quote_number", $client_id, $new_quote_id);
|
||||||
|
|
||||||
customAction('quote_create', $new_quote_id);
|
customAction('quote_create', $new_quote_id);
|
||||||
|
|
||||||
@@ -187,7 +187,7 @@ if (isset($_POST['add_quote_to_invoice'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Invoiced', history_description = 'Quote invoiced as $config_invoice_prefix$invoice_number', history_quote_id = $quote_id");
|
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Invoiced', history_description = 'Quote invoiced as $config_invoice_prefix$invoice_number', history_quote_id = $quote_id");
|
||||||
|
|
||||||
logAction("Invoice", "Create", "$session_name created invoice $config_invoice_prefix$invoice_number from quote $config_quote_prefix$quote_number", $client_id, $new_invoice_id);
|
logAudit("Invoice", "Create", "$session_name created invoice $config_invoice_prefix$invoice_number from quote $config_quote_prefix$quote_number", $client_id, $new_invoice_id);
|
||||||
|
|
||||||
// Check & update any quote-ticket association
|
// Check & update any quote-ticket association
|
||||||
$ticket_id = 0;
|
$ticket_id = 0;
|
||||||
@@ -265,7 +265,7 @@ if (isset($_POST['add_quote_item'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE quotes SET quote_amount = $new_quote_amount WHERE quote_id = $quote_id");
|
mysqli_query($mysqli,"UPDATE quotes SET quote_amount = $new_quote_amount WHERE quote_id = $quote_id");
|
||||||
|
|
||||||
logAction("Quote", "Edit", "$session_name added item $name to quote $quote_prefix$quote_number", $client_id, $quote_id);
|
logAudit("Quote", "Edit", "$session_name added item $name to quote $quote_prefix$quote_number", $client_id, $quote_id);
|
||||||
|
|
||||||
flash_alert("Item <strong>$name</strong> added");
|
flash_alert("Item <strong>$name</strong> added");
|
||||||
|
|
||||||
@@ -324,7 +324,7 @@ if (isset($_POST['edit_quote_item'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE quotes SET quote_amount = $new_quote_amount WHERE quote_id = $quote_id");
|
mysqli_query($mysqli,"UPDATE quotes SET quote_amount = $new_quote_amount WHERE quote_id = $quote_id");
|
||||||
|
|
||||||
logAction("Quote", "Edit", "$session_name edited item $name on quote $quote_prefix$quote_number", $client_id, $quote_id);
|
logAudit("Quote", "Edit", "$session_name edited item $name on quote $quote_prefix$quote_number", $client_id, $quote_id);
|
||||||
|
|
||||||
flash_alert("Item <strong>$name</strong> updated");
|
flash_alert("Item <strong>$name</strong> updated");
|
||||||
|
|
||||||
@@ -352,7 +352,7 @@ if (isset($_POST['quote_note'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE quotes SET quote_note = '$note' WHERE quote_id = $quote_id");
|
mysqli_query($mysqli,"UPDATE quotes SET quote_note = '$note' WHERE quote_id = $quote_id");
|
||||||
|
|
||||||
logAction("Quote", "Edit", "$session_name added notes to quote $quote_prefix$quote_number", $client_id, $quote_id);
|
logAudit("Quote", "Edit", "$session_name added notes to quote $quote_prefix$quote_number", $client_id, $quote_id);
|
||||||
|
|
||||||
flash_alert("Notes added");
|
flash_alert("Notes added");
|
||||||
|
|
||||||
@@ -390,7 +390,7 @@ if (isset($_POST['edit_quote'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE quotes SET quote_scope = '$scope', quote_date = '$date', quote_expire = '$expire', quote_discount_amount = '$quote_discount', quote_amount = '$quote_amount', quote_category_id = $category WHERE quote_id = $quote_id");
|
mysqli_query($mysqli,"UPDATE quotes SET quote_scope = '$scope', quote_date = '$date', quote_expire = '$expire', quote_discount_amount = '$quote_discount', quote_amount = '$quote_amount', quote_category_id = $category WHERE quote_id = $quote_id");
|
||||||
|
|
||||||
logAction("Quote", "Edit", "$session_name edited quote $quote_prefix$quote_number", $client_id, $quote_id);
|
logAudit("Quote", "Edit", "$session_name edited quote $quote_prefix$quote_number", $client_id, $quote_id);
|
||||||
|
|
||||||
flash_alert("Quote edited");
|
flash_alert("Quote edited");
|
||||||
|
|
||||||
@@ -431,7 +431,7 @@ if (isset($_GET['delete_quote'])) {
|
|||||||
mysqli_query($mysqli,"DELETE FROM history WHERE history_id = $history_id");
|
mysqli_query($mysqli,"DELETE FROM history WHERE history_id = $history_id");
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Quote", "Delete", "$session_name deleted quote $quote_prefix$quote_number", $client_id);
|
logAudit("Quote", "Delete", "$session_name deleted quote $quote_prefix$quote_number", $client_id);
|
||||||
|
|
||||||
flash_alert("Quote <strong>$quote_prefix$quote_number</strong> deleted", 'error');
|
flash_alert("Quote <strong>$quote_prefix$quote_number</strong> deleted", 'error');
|
||||||
|
|
||||||
@@ -474,7 +474,7 @@ if (isset($_GET['delete_quote_item'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM quote_items WHERE item_id = $item_id");
|
mysqli_query($mysqli,"DELETE FROM quote_items WHERE item_id = $item_id");
|
||||||
|
|
||||||
logAction("Quote", "Edit", "$session_name removed item $item_name from $quote_prefix$quote_number", $client_id, $quote_id);
|
logAudit("Quote", "Edit", "$session_name removed item $item_name from $quote_prefix$quote_number", $client_id, $quote_id);
|
||||||
|
|
||||||
flash_alert("Item <strong>$item_name</strong> removed", 'error');
|
flash_alert("Item <strong>$item_name</strong> removed", 'error');
|
||||||
|
|
||||||
@@ -502,7 +502,7 @@ if (isset($_GET['mark_quote_sent'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Sent', history_description = 'Quote marked sent', history_quote_id = $quote_id");
|
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Sent', history_description = 'Quote marked sent', history_quote_id = $quote_id");
|
||||||
|
|
||||||
logAction("Quote", "Sent", "$session_name marked quote $quote_prefix$quote_number as sent", $client_id, $quote_id);
|
logAudit("Quote", "Sent", "$session_name marked quote $quote_prefix$quote_number as sent", $client_id, $quote_id);
|
||||||
|
|
||||||
flash_alert("Quote marked sent");
|
flash_alert("Quote marked sent");
|
||||||
|
|
||||||
@@ -530,7 +530,7 @@ if (isset($_GET['accept_quote'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Accepted', history_description = 'Quote accepted by $session_name', history_quote_id = $quote_id");
|
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Accepted', history_description = 'Quote accepted by $session_name', history_quote_id = $quote_id");
|
||||||
|
|
||||||
logAction("Quote", "Edit", "$session_name marked quote $quote_prefix$quote_number as accepted", $client_id, $quote_id);
|
logAudit("Quote", "Edit", "$session_name marked quote $quote_prefix$quote_number as accepted", $client_id, $quote_id);
|
||||||
|
|
||||||
customAction('quote_accept', $quote_id);
|
customAction('quote_accept', $quote_id);
|
||||||
|
|
||||||
@@ -562,7 +562,7 @@ if (isset($_GET['decline_quote'])) {
|
|||||||
|
|
||||||
customAction('quote_decline', $quote_id);
|
customAction('quote_decline', $quote_id);
|
||||||
|
|
||||||
logAction("Quote", "Edit", "$session_name marked quote $quote_prefix$quote_number as declined", $client_id, $quote_id);
|
logAudit("Quote", "Edit", "$session_name marked quote $quote_prefix$quote_number as declined", $client_id, $quote_id);
|
||||||
|
|
||||||
flash_alert("Quote declined", 'error');
|
flash_alert("Quote declined", 'error');
|
||||||
|
|
||||||
@@ -639,7 +639,7 @@ if (isset($_GET['email_quote'])) {
|
|||||||
// Update History
|
// Update History
|
||||||
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Sent', history_description = 'Emailed Quote', history_quote_id = $quote_id");
|
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Sent', history_description = 'Emailed Quote', history_quote_id = $quote_id");
|
||||||
|
|
||||||
logAction("Quote", "Email", "$session_name emailed quote $quote_prefix$quote_number to $contact_email", $client_id, $quote_id);
|
logAudit("Quote", "Email", "$session_name emailed quote $quote_prefix$quote_number to $contact_email", $client_id, $quote_id);
|
||||||
|
|
||||||
flash_alert("Quote sent!");
|
flash_alert("Quote sent!");
|
||||||
|
|
||||||
@@ -672,7 +672,7 @@ if (isset($_GET['mark_quote_invoiced'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Invoiced', history_description = 'Quote marked as invoiced', history_quote_id = $quote_id");
|
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Invoiced', history_description = 'Quote marked as invoiced', history_quote_id = $quote_id");
|
||||||
|
|
||||||
logAction("Quote", "Sent", "$session_name marked quote $quote_prefix$quote_number as invoiced", $client_id, $quote_id);
|
logAudit("Quote", "Sent", "$session_name marked quote $quote_prefix$quote_number as invoiced", $client_id, $quote_id);
|
||||||
|
|
||||||
flash_alert("Quote marked invoiced");
|
flash_alert("Quote marked invoiced");
|
||||||
|
|
||||||
@@ -733,7 +733,7 @@ if(isset($_POST['export_quotes_csv'])){
|
|||||||
fpassthru($f);
|
fpassthru($f);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Quote", "Export", "$session_name exported $num_rows quote(s) to a CSV file");
|
logAudit("Quote", "Export", "$session_name exported $num_rows quote(s) to a CSV file");
|
||||||
|
|
||||||
flash_alert("Exported <strong>$num_rows</strong> quote(s)");
|
flash_alert("Exported <strong>$num_rows</strong> quote(s)");
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ if (isset($_POST['add_rack'])) {
|
|||||||
mysqli_query($mysqli,"UPDATE racks SET rack_photo = '$new_file_name' WHERE rack_id = $rack_id");
|
mysqli_query($mysqli,"UPDATE racks SET rack_photo = '$new_file_name' WHERE rack_id = $rack_id");
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Rack", "Create", "$session_name created rack $name", $client_id, $rack_id);
|
logAudit("Rack", "Create", "$session_name created rack $name", $client_id, $rack_id);
|
||||||
|
|
||||||
flash_alert("Rack <strong>$name</strong> created");
|
flash_alert("Rack <strong>$name</strong> created");
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ if (isset($_POST['edit_rack'])) {
|
|||||||
mysqli_query($mysqli,"UPDATE racks SET rack_photo = '$new_file_name' WHERE rack_id = $rack_id");
|
mysqli_query($mysqli,"UPDATE racks SET rack_photo = '$new_file_name' WHERE rack_id = $rack_id");
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Rack", "Edit", "$session_name edited rack $name", $client_id, $rack_id);
|
logAudit("Rack", "Edit", "$session_name edited rack $name", $client_id, $rack_id);
|
||||||
|
|
||||||
flash_alert("Rack <strong>$name</strong> edited");
|
flash_alert("Rack <strong>$name</strong> edited");
|
||||||
|
|
||||||
@@ -118,7 +118,7 @@ if (isset($_GET['archive_rack'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE racks SET rack_archived_at = NOW() WHERE rack_id = $rack_id");
|
mysqli_query($mysqli,"UPDATE racks SET rack_archived_at = NOW() WHERE rack_id = $rack_id");
|
||||||
|
|
||||||
logAction("Rack", "Archive", "$session_name archived rack $rack_name", $client_id, $rack_id);
|
logAudit("Rack", "Archive", "$session_name archived rack $rack_name", $client_id, $rack_id);
|
||||||
|
|
||||||
flash_alert("Rack <strong>$rack_name</strong> archived", 'error');
|
flash_alert("Rack <strong>$rack_name</strong> archived", 'error');
|
||||||
|
|
||||||
@@ -144,7 +144,7 @@ if (isset($_GET['restore_rack'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE racks SET rack_archived_at = NULL WHERE rack_id = $rack_id");
|
mysqli_query($mysqli,"UPDATE racks SET rack_archived_at = NULL WHERE rack_id = $rack_id");
|
||||||
|
|
||||||
logAction("Rack", "Restore", "$session_name restored rack $rack_name", $client_id, $rack_id);
|
logAudit("Rack", "Restore", "$session_name restored rack $rack_name", $client_id, $rack_id);
|
||||||
|
|
||||||
flash_alert("Rack <strong>$rack_name</strong> Restored");
|
flash_alert("Rack <strong>$rack_name</strong> Restored");
|
||||||
|
|
||||||
@@ -176,7 +176,7 @@ if (isset($_GET['delete_rack'])) {
|
|||||||
unlink("../uploads/clients/$client_id/$rack_photo");
|
unlink("../uploads/clients/$client_id/$rack_photo");
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Rack", "Delete", "$session_name deleted rack $rack_name", $client_id);
|
logAudit("Rack", "Delete", "$session_name deleted rack $rack_name", $client_id);
|
||||||
|
|
||||||
flash_alert("Rack <strong>$rack_name</strong> deleted", 'error');
|
flash_alert("Rack <strong>$rack_name</strong> deleted", 'error');
|
||||||
|
|
||||||
@@ -224,7 +224,7 @@ if (isset($_POST['add_rack_unit'])) {
|
|||||||
|
|
||||||
$unit_id = mysqli_insert_id($mysqli);
|
$unit_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Rack", "Edit", "$session_name added device $name to units $unit_start - $unit_end in rack $rack_name", $client_id, $rack_id);
|
logAudit("Rack", "Edit", "$session_name added device $name to units $unit_start - $unit_end in rack $rack_name", $client_id, $rack_id);
|
||||||
|
|
||||||
flash_alert("Device <strong>$name</strong> added to units $unit_start - $unit_end in rack.");
|
flash_alert("Device <strong>$name</strong> added to units $unit_start - $unit_end in rack.");
|
||||||
|
|
||||||
@@ -255,7 +255,7 @@ if (isset($_POST['edit_rack_unit'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE rack_units SET unit_device = '$name', unit_asset_id = $asset, unit_start_number = $unit_start, unit_end_number = $unit_end WHERE unit_id = $unit_id");
|
mysqli_query($mysqli,"UPDATE rack_units SET unit_device = '$name', unit_asset_id = $asset, unit_start_number = $unit_start, unit_end_number = $unit_end WHERE unit_id = $unit_id");
|
||||||
|
|
||||||
logAction("Rack", "Edit", "$session_name edited device $name in rack $rack_name", $client_id, $rack_id);
|
logAudit("Rack", "Edit", "$session_name edited device $name in rack $rack_name", $client_id, $rack_id);
|
||||||
|
|
||||||
flash_alert("Device $name edited on the rack");
|
flash_alert("Device $name edited on the rack");
|
||||||
|
|
||||||
@@ -283,7 +283,7 @@ if (isset($_GET['remove_rack_unit'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM rack_units WHERE unit_id = $unit_id");
|
mysqli_query($mysqli,"DELETE FROM rack_units WHERE unit_id = $unit_id");
|
||||||
|
|
||||||
logAction("Rack", "Edit", "$session_name removed device $device_name from rack $rack_name", $client_id, $rack_id);
|
logAudit("Rack", "Edit", "$session_name removed device $device_name from rack $rack_name", $client_id, $rack_id);
|
||||||
|
|
||||||
flash_alert("Device <strong>$device_name</strong> removed from rack", 'error');
|
flash_alert("Device <strong>$device_name</strong> removed from rack", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ if (isset($_POST['create_recurring_expense'])) {
|
|||||||
|
|
||||||
$recurring_expense_id = mysqli_insert_id($mysqli);
|
$recurring_expense_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Recurring Expense", "Create", "$session_name created recurring expense $description", $client_id, $recurring_expense_id);
|
logAudit("Recurring Expense", "Create", "$session_name created recurring expense $description", $client_id, $recurring_expense_id);
|
||||||
|
|
||||||
flash_alert("Recurring Expense created");
|
flash_alert("Recurring Expense created");
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ if (isset($_POST['edit_recurring_expense'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE recurring_expenses SET recurring_expense_frequency = $frequency, recurring_expense_day = $day, recurring_expense_month = $month, recurring_expense_next_date = '$start_date', recurring_expense_description = '$description', recurring_expense_reference = '$reference', recurring_expense_amount = $amount, recurring_expense_currency_code = '$session_company_currency', recurring_expense_vendor_id = $vendor, recurring_expense_client_id = $client_id, recurring_expense_category_id = $category, recurring_expense_account_id = $account WHERE recurring_expense_id = $recurring_expense_id");
|
mysqli_query($mysqli,"UPDATE recurring_expenses SET recurring_expense_frequency = $frequency, recurring_expense_day = $day, recurring_expense_month = $month, recurring_expense_next_date = '$start_date', recurring_expense_description = '$description', recurring_expense_reference = '$reference', recurring_expense_amount = $amount, recurring_expense_currency_code = '$session_company_currency', recurring_expense_vendor_id = $vendor, recurring_expense_client_id = $client_id, recurring_expense_category_id = $category, recurring_expense_account_id = $account WHERE recurring_expense_id = $recurring_expense_id");
|
||||||
|
|
||||||
logAction("Recurring Expense", "Edit", "$session_name edited recurring expense $description", $client_id, $recurring_expense_id);
|
logAudit("Recurring Expense", "Edit", "$session_name edited recurring expense $description", $client_id, $recurring_expense_id);
|
||||||
|
|
||||||
flash_alert("Recurring Expense edited");
|
flash_alert("Recurring Expense edited");
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ if (isset($_GET['delete_recurring_expense'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM recurring_expenses WHERE recurring_expense_id = $recurring_expense_id");
|
mysqli_query($mysqli,"DELETE FROM recurring_expenses WHERE recurring_expense_id = $recurring_expense_id");
|
||||||
|
|
||||||
logAction("Recurring Expense", "Delete", "$session_name deleted recurring expense $recurring_expense_description", $client_id);
|
logAudit("Recurring Expense", "Delete", "$session_name deleted recurring expense $recurring_expense_description", $client_id);
|
||||||
|
|
||||||
flash_alert("Recurring Expense deleted", 'error');
|
flash_alert("Recurring Expense deleted", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ if (isset($_POST['add_invoice_recurring'])) {
|
|||||||
mysqli_query($mysqli,"INSERT INTO recurring_invoice_items SET item_name = '$item_name', item_description = '$item_description', item_quantity = $item_quantity, item_price = $item_price, item_subtotal = $item_subtotal, item_tax = $item_tax, item_total = $item_total, item_order = $item_order, item_tax_id = $tax_id, item_recurring_invoice_id = $recurring_invoice_id");
|
mysqli_query($mysqli,"INSERT INTO recurring_invoice_items SET item_name = '$item_name', item_description = '$item_description', item_quantity = $item_quantity, item_price = $item_price, item_subtotal = $item_subtotal, item_tax = $item_tax, item_total = $item_total, item_order = $item_order, item_tax_id = $tax_id, item_recurring_invoice_id = $recurring_invoice_id");
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Recurring Invoice", "Create", "$session_name created recurring Invoice from Invoice $invoice_prefix$invoice_number", $client_id, $recurring_invoice_id);
|
logAudit("Recurring Invoice", "Create", "$session_name created recurring Invoice from Invoice $invoice_prefix$invoice_number", $client_id, $recurring_invoice_id);
|
||||||
|
|
||||||
flash_alert("Created recurring Invoice from Invoice <strong>$invoice_prefix$invoice_number</strong>");
|
flash_alert("Created recurring Invoice from Invoice <strong>$invoice_prefix$invoice_number</strong>");
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ if (isset($_POST['add_recurring_invoice'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Active', history_description = 'Recurring Invoice created', history_recurring_invoice_id = $recurring_invoice_id");
|
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Active', history_description = 'Recurring Invoice created', history_recurring_invoice_id = $recurring_invoice_id");
|
||||||
|
|
||||||
logAction("Recurring Invoice", "Create", "$session_name created recurring invoice $config_recurring_invoice_prefix$recurring_invoice_number - $scope", $client_id, $recurring_invoice_id);
|
logAudit("Recurring Invoice", "Create", "$session_name created recurring invoice $config_recurring_invoice_prefix$recurring_invoice_number - $scope", $client_id, $recurring_invoice_id);
|
||||||
|
|
||||||
flash_alert("Recurring Invoice <strong>$config_recurring_invoice_prefix$recurring_invoice_number</strong> created");
|
flash_alert("Recurring Invoice <strong>$config_recurring_invoice_prefix$recurring_invoice_number</strong> created");
|
||||||
|
|
||||||
@@ -145,7 +145,7 @@ if (isset($_POST['edit_recurring_invoice'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO history SET history_status = '$status', history_description = 'Recurring Invoice edited', history_recurring_invoice_id = $recurring_invoice_id");
|
mysqli_query($mysqli,"INSERT INTO history SET history_status = '$status', history_description = 'Recurring Invoice edited', history_recurring_invoice_id = $recurring_invoice_id");
|
||||||
|
|
||||||
logAction("Recurring Invoice", "Edit", "$session_name edited recurring invoice $recurring_invoice_prefix$recurring_invoice_number - $scope", $client_id, $recurring_invoice_id);
|
logAudit("Recurring Invoice", "Edit", "$session_name edited recurring invoice $recurring_invoice_prefix$recurring_invoice_number - $scope", $client_id, $recurring_invoice_id);
|
||||||
|
|
||||||
flash_alert("Recurring Invoice <strong>$recurring_invoice_prefix$recurring_invoice_number</strong> edited");
|
flash_alert("Recurring Invoice <strong>$recurring_invoice_prefix$recurring_invoice_number</strong> edited");
|
||||||
|
|
||||||
@@ -187,7 +187,7 @@ if (isset($_GET['delete_recurring_invoice'])) {
|
|||||||
mysqli_query($mysqli,"DELETE FROM history WHERE history_id = $history_id");
|
mysqli_query($mysqli,"DELETE FROM history WHERE history_id = $history_id");
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Recurring Invoice", "Delete", "$session_name deleted recurring invoice $recurring_invoice_prefix$recurring_invoice_number - $recurring_invoice_scope", $client_id);
|
logAudit("Recurring Invoice", "Delete", "$session_name deleted recurring invoice $recurring_invoice_prefix$recurring_invoice_number - $recurring_invoice_scope", $client_id);
|
||||||
|
|
||||||
flash_alert("Recurring Invoice <strong>$recurring_invoice_prefix$recurring_invoice_number</strong> deleted", 'error');
|
flash_alert("Recurring Invoice <strong>$recurring_invoice_prefix$recurring_invoice_number</strong> deleted", 'error');
|
||||||
|
|
||||||
@@ -247,7 +247,7 @@ if (isset($_POST['add_recurring_invoice_item'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE recurring_invoices SET recurring_invoice_amount = $recurring_invoice_amount WHERE recurring_invoice_id = $recurring_invoice_id");
|
mysqli_query($mysqli,"UPDATE recurring_invoices SET recurring_invoice_amount = $recurring_invoice_amount WHERE recurring_invoice_id = $recurring_invoice_id");
|
||||||
|
|
||||||
logAction("Recurring Invoice", "Edit", "$session_name added item $name to recurring invoice $recurring_invoice_prefix$recurring_invoice_number", $client_id, $recurring_invoice_id);
|
logAudit("Recurring Invoice", "Edit", "$session_name added item $name to recurring invoice $recurring_invoice_prefix$recurring_invoice_number", $client_id, $recurring_invoice_id);
|
||||||
|
|
||||||
flash_alert("Item <srrong>$name</strong> added to Recurring Invoice");
|
flash_alert("Item <srrong>$name</strong> added to Recurring Invoice");
|
||||||
|
|
||||||
@@ -307,7 +307,7 @@ if (isset($_POST['edit_recurring_invoice_item'])) {
|
|||||||
mysqli_query($mysqli,"UPDATE recurring_invoices SET recurring_invoice_amount = $new_recurring_invoice_amount WHERE recurring_invoice_id = $recurring_invoice_id");
|
mysqli_query($mysqli,"UPDATE recurring_invoices SET recurring_invoice_amount = $new_recurring_invoice_amount WHERE recurring_invoice_id = $recurring_invoice_id");
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Recurring Invoice", "Edit", "$session_name edited item $name on recurring invoice $recurring_invoice_prefix$recurring_invoice_number", $client_id, $recurring_invoice_id);
|
logAudit("Recurring Invoice", "Edit", "$session_name edited item $name on recurring invoice $recurring_invoice_prefix$recurring_invoice_number", $client_id, $recurring_invoice_id);
|
||||||
|
|
||||||
flash_alert("Item <strong>$name</strong> updated");
|
flash_alert("Item <strong>$name</strong> updated");
|
||||||
|
|
||||||
@@ -335,7 +335,7 @@ if (isset($_POST['recurring_invoice_note'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE recurring_invoices SET recurring_invoice_note = '$note' WHERE recurring_invoice_id = $recurring_invoice_id");
|
mysqli_query($mysqli,"UPDATE recurring_invoices SET recurring_invoice_note = '$note' WHERE recurring_invoice_id = $recurring_invoice_id");
|
||||||
|
|
||||||
logAction("Recurring Invoice", "Edit", "$session_name added note to recurring invoice $recurring_invoice_prefix$recurring_invoice_number", $client_id, $recurring_invoice_id);
|
logAudit("Recurring Invoice", "Edit", "$session_name added note to recurring invoice $recurring_invoice_prefix$recurring_invoice_number", $client_id, $recurring_invoice_id);
|
||||||
|
|
||||||
flash_alert("Notes added");
|
flash_alert("Notes added");
|
||||||
|
|
||||||
@@ -373,7 +373,7 @@ if (isset($_GET['delete_recurring_invoice_item'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM recurring_invoice_items WHERE item_id = $item_id");
|
mysqli_query($mysqli,"DELETE FROM recurring_invoice_items WHERE item_id = $item_id");
|
||||||
|
|
||||||
logAction("Recurring Invoice", "Edit", "$session_name removed item $item_name from recurring invoice $recurring_invoice_prefix$recurring_invoice_number", $client_id);
|
logAudit("Recurring Invoice", "Edit", "$session_name removed item $item_name from recurring invoice $recurring_invoice_prefix$recurring_invoice_number", $client_id);
|
||||||
|
|
||||||
flash_alert("Item <strong>$item_name</strong> removed", 'error');
|
flash_alert("Item <strong>$item_name</strong> removed", 'error');
|
||||||
|
|
||||||
@@ -532,13 +532,13 @@ if (isset($_GET['force_recurring'])) {
|
|||||||
// Error reporting
|
// Error reporting
|
||||||
appNotify("Mail", "Failed to send email to $contact_email");
|
appNotify("Mail", "Failed to send email to $contact_email");
|
||||||
|
|
||||||
logAction("Mail", "Error", "Failed to send email to $contact_email regarding $subject. $mail");
|
logAudit("Mail", "Error", "Failed to send email to $contact_email regarding $subject. $mail");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} //End Recurring Invoices Loop
|
} //End Recurring Invoices Loop
|
||||||
|
|
||||||
logAction("Invoice", "Create", "$session_name forced recurring invoice into an invoice", $client_id, $new_invoice_id);
|
logAudit("Invoice", "Create", "$session_name forced recurring invoice into an invoice", $client_id, $new_invoice_id);
|
||||||
|
|
||||||
customAction('invoice_create', $new_invoice_id);
|
customAction('invoice_create', $new_invoice_id);
|
||||||
|
|
||||||
@@ -589,14 +589,14 @@ if (isset($_POST['set_recurring_payment'])) {
|
|||||||
// Get Payment ID for reference
|
// Get Payment ID for reference
|
||||||
$recurring_payment_id = mysqli_insert_id($mysqli);
|
$recurring_payment_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Recurring Invoice", "Auto Payment", "$session_name created Auto Pay for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number in the amount of " . numfmt_format_currency($currency_format, $recurring_invoice_amount, $recurring_invoice_currency_code), $client_id, $recurring_invoice_id);
|
logAudit("Recurring Invoice", "Auto Payment", "$session_name created Auto Pay for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number in the amount of " . numfmt_format_currency($currency_format, $recurring_invoice_amount, $recurring_invoice_currency_code), $client_id, $recurring_invoice_id);
|
||||||
|
|
||||||
flash_alert("Automatic Payment <strong>$saved_payment_description</strong> enabled for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number");
|
flash_alert("Automatic Payment <strong>$saved_payment_description</strong> enabled for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number");
|
||||||
} else {
|
} else {
|
||||||
// Delete
|
// Delete
|
||||||
mysqli_query($mysqli, "DELETE FROM recurring_payments WHERE recurring_payment_recurring_invoice_id = $recurring_invoice_id");
|
mysqli_query($mysqli, "DELETE FROM recurring_payments WHERE recurring_payment_recurring_invoice_id = $recurring_invoice_id");
|
||||||
|
|
||||||
logAction("Recurring Invoice", "Auto Payment", "$session_name removed Auto Pay for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number in the amount of " . numfmt_format_currency($currency_format, $recurring_invoice_amount, $recurring_invoice_currency_code), $client_id, $recurring_invoice_id);
|
logAudit("Recurring Invoice", "Auto Payment", "$session_name removed Auto Pay for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number in the amount of " . numfmt_format_currency($currency_format, $recurring_invoice_amount, $recurring_invoice_currency_code), $client_id, $recurring_invoice_id);
|
||||||
|
|
||||||
flash_alert("Automatic Payment <strong>Disabled</strong> for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number", 'error');
|
flash_alert("Automatic Payment <strong>Disabled</strong> for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number", 'error');
|
||||||
}
|
}
|
||||||
@@ -653,7 +653,7 @@ if (isset($_POST['export_client_recurring_invoice_csv'])) {
|
|||||||
fpassthru($f);
|
fpassthru($f);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Recurring Invoice", "Export", "$session_name exported $num_rows recurring invoices to CSV file");
|
logAudit("Recurring Invoice", "Export", "$session_name exported $num_rows recurring invoices to CSV file");
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
@@ -685,7 +685,7 @@ if (isset($_GET['recurring_invoice_email_notify'])) {
|
|||||||
$notify_wording = "Off";
|
$notify_wording = "Off";
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Recurring Invoice", "Edit", "$session_name turned $notify_wording Email Notifications for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number", $client_id, $recurring_invoice_id);
|
logAudit("Recurring Invoice", "Edit", "$session_name turned $notify_wording Email Notifications for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number", $client_id, $recurring_invoice_id);
|
||||||
|
|
||||||
flash_alert("Email Notifications <strong>$notify_wording</strong>", 'error');
|
flash_alert("Email Notifications <strong>$notify_wording</strong>", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ if (isset($_POST['add_recurring_ticket'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Recurring Ticket", "Create", "$session_name created recurring ticket for $subject - $frequency", $client_id, $recurring_ticket_id);
|
logAudit("Recurring Ticket", "Create", "$session_name created recurring ticket for $subject - $frequency", $client_id, $recurring_ticket_id);
|
||||||
|
|
||||||
flash_alert("Recurring ticket <strong>$subject - $frequency</strong> created");
|
flash_alert("Recurring ticket <strong>$subject - $frequency</strong> created");
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ if (isset($_POST['edit_recurring_ticket'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Recurring Ticket", "Edit", "$session_name edited recurring ticket $subject", $client_id, $recurring_ticket_id);
|
logAudit("Recurring Ticket", "Edit", "$session_name edited recurring ticket $subject", $client_id, $recurring_ticket_id);
|
||||||
|
|
||||||
flash_alert("Recurring ticket <strong>$subject - $frequency</strong> updated");
|
flash_alert("Recurring ticket <strong>$subject - $frequency</strong> updated");
|
||||||
|
|
||||||
@@ -205,7 +205,7 @@ if (isset($_POST['bulk_force_recurring_tickets'])) {
|
|||||||
$next_run = $next_run->format('Y-m-d');
|
$next_run = $next_run->format('Y-m-d');
|
||||||
mysqli_query($mysqli, "UPDATE recurring_tickets SET recurring_ticket_next_run = '$next_run' WHERE recurring_ticket_id = $recurring_ticket_id");
|
mysqli_query($mysqli, "UPDATE recurring_tickets SET recurring_ticket_next_run = '$next_run' WHERE recurring_ticket_id = $recurring_ticket_id");
|
||||||
|
|
||||||
logAction("Ticket", "Create", "$session_name force created recurring scheduled $frequency ticket - $config_ticket_prefix$ticket_number - $subject", $client_id, $id);
|
logAudit("Ticket", "Create", "$session_name force created recurring scheduled $frequency ticket - $config_ticket_prefix$ticket_number - $subject", $client_id, $id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -345,7 +345,7 @@ if (isset($_GET['force_recurring_ticket'])) {
|
|||||||
$next_run = $next_run->format('Y-m-d');
|
$next_run = $next_run->format('Y-m-d');
|
||||||
mysqli_query($mysqli, "UPDATE recurring_tickets SET recurring_ticket_next_run = '$next_run' WHERE recurring_ticket_id = $recurring_ticket_id");
|
mysqli_query($mysqli, "UPDATE recurring_tickets SET recurring_ticket_next_run = '$next_run' WHERE recurring_ticket_id = $recurring_ticket_id");
|
||||||
|
|
||||||
logAction("Ticket", "Create", "$session_name force created recurring scheduled $frequency ticket - $config_ticket_prefix$ticket_number - $subject", $client_id, $id);
|
logAudit("Ticket", "Create", "$session_name force created recurring scheduled $frequency ticket - $config_ticket_prefix$ticket_number - $subject", $client_id, $id);
|
||||||
|
|
||||||
flash_alert("Recurring Ticket Forced");
|
flash_alert("Recurring Ticket Forced");
|
||||||
|
|
||||||
@@ -378,7 +378,7 @@ if (isset($_GET['delete_recurring_ticket'])) {
|
|||||||
// Delete
|
// Delete
|
||||||
mysqli_query($mysqli, "DELETE FROM recurring_tickets WHERE recurring_ticket_id = $recurring_ticket_id");
|
mysqli_query($mysqli, "DELETE FROM recurring_tickets WHERE recurring_ticket_id = $recurring_ticket_id");
|
||||||
|
|
||||||
logAction("Recurring Ticket", "Delete", "$session_name deleted recurring ticket $subject", $client_id, $recurring_ticket_id);
|
logAudit("Recurring Ticket", "Delete", "$session_name deleted recurring ticket $subject", $client_id, $recurring_ticket_id);
|
||||||
|
|
||||||
flash_alert("Recurring ticket <strong>$subject - $frequency</strong> deleted", 'error');
|
flash_alert("Recurring ticket <strong>$subject - $frequency</strong> deleted", 'error');
|
||||||
|
|
||||||
@@ -412,11 +412,11 @@ if (isset($_POST['bulk_delete_recurring_tickets'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "DELETE FROM recurring_tickets WHERE recurring_ticket_id = $recurring_ticket_id");
|
mysqli_query($mysqli, "DELETE FROM recurring_tickets WHERE recurring_ticket_id = $recurring_ticket_id");
|
||||||
|
|
||||||
logAction("Recurring Ticket", "Delete", "$session_name deleted recurring ticket $subject", $client_id, $recurring_ticket_id);
|
logAudit("Recurring Ticket", "Delete", "$session_name deleted recurring ticket $subject", $client_id, $recurring_ticket_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Recurring Ticket", "Bulk Delete", "$session_name deleted $count recurring ticket(s)");
|
logAudit("Recurring Ticket", "Bulk Delete", "$session_name deleted $count recurring ticket(s)");
|
||||||
|
|
||||||
flash_alert("Deleted <strong>$count</strong> recurring ticket(s)", 'error');
|
flash_alert("Deleted <strong>$count</strong> recurring ticket(s)", 'error');
|
||||||
}
|
}
|
||||||
@@ -472,7 +472,7 @@ if (isset($_POST['bulk_assign_recurring_ticket'])) {
|
|||||||
// Update recurring ticket
|
// Update recurring ticket
|
||||||
mysqli_query($mysqli, "UPDATE recurring_tickets SET recurring_ticket_assigned_to = $assign_to WHERE recurring_ticket_id = $recurring_ticket_id");
|
mysqli_query($mysqli, "UPDATE recurring_tickets SET recurring_ticket_assigned_to = $assign_to WHERE recurring_ticket_id = $recurring_ticket_id");
|
||||||
|
|
||||||
logAction("Recurring_Ticket", "Edit", "$session_name reassigned recurring ticket $recurring_ticket_subject to $agent_name", $client_id, $recurring_ticket_id);
|
logAudit("Recurring_Ticket", "Edit", "$session_name reassigned recurring ticket $recurring_ticket_subject to $agent_name", $client_id, $recurring_ticket_id);
|
||||||
|
|
||||||
$tickets_assigned_body .= "$recurring_ticket_subject<br>";
|
$tickets_assigned_body .= "$recurring_ticket_subject<br>";
|
||||||
} // End For Each Ticket ID Loop
|
} // End For Each Ticket ID Loop
|
||||||
@@ -546,12 +546,12 @@ if (isset($_POST['bulk_edit_recurring_ticket_priority'])) {
|
|||||||
// Update recurring ticket
|
// Update recurring ticket
|
||||||
mysqli_query($mysqli, "UPDATE recurring_tickets SET recurring_ticket_priority = '$priority' WHERE recurring_ticket_id = $recurring_ticket_id");
|
mysqli_query($mysqli, "UPDATE recurring_tickets SET recurring_ticket_priority = '$priority' WHERE recurring_ticket_id = $recurring_ticket_id");
|
||||||
|
|
||||||
logAction("Ticket", "Edit", "$session_name updated the priority on recurring ticket $ticket_subject from $original_recurring_ticket_priority to $priority", $client_id, $recurring_ticket_id);
|
logAudit("Ticket", "Edit", "$session_name updated the priority on recurring ticket $ticket_subject from $original_recurring_ticket_priority to $priority", $client_id, $recurring_ticket_id);
|
||||||
|
|
||||||
customAction('recurring_ticket_update', $recurring_ticket_id);
|
customAction('recurring_ticket_update', $recurring_ticket_id);
|
||||||
} // End For Each Recurring Ticket ID Loop
|
} // End For Each Recurring Ticket ID Loop
|
||||||
|
|
||||||
logAction("Recurring Ticket", " Bulk Edit", "$session_name updated the priority to $priority on $recurring_ticket_count Recurring Tickets");
|
logAudit("Recurring Ticket", " Bulk Edit", "$session_name updated the priority to $priority on $recurring_ticket_count Recurring Tickets");
|
||||||
|
|
||||||
flash_alert("Priority updated to <strong>$priority</strong> for <strong>$recurring_ticket_count</strong> Recurring Tickets");
|
flash_alert("Priority updated to <strong>$priority</strong> for <strong>$recurring_ticket_count</strong> Recurring Tickets");
|
||||||
}
|
}
|
||||||
@@ -588,12 +588,12 @@ if (isset($_POST['bulk_edit_recurring_ticket_category'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "UPDATE recurring_tickets SET recurring_ticket_category = '$category_id' WHERE recurring_ticket_id = $recurring_ticket_id");
|
mysqli_query($mysqli, "UPDATE recurring_tickets SET recurring_ticket_category = '$category_id' WHERE recurring_ticket_id = $recurring_ticket_id");
|
||||||
|
|
||||||
logAction("Recurring Ticket", "Edit", "$session_name updated the category on recurring ticket $recurring_ticket_subject from $previous_recurring_ticket_category_name to $category_name", $client_id, $recurring_ticket_id);
|
logAudit("Recurring Ticket", "Edit", "$session_name updated the category on recurring ticket $recurring_ticket_subject from $previous_recurring_ticket_category_name to $category_name", $client_id, $recurring_ticket_id);
|
||||||
|
|
||||||
customAction('recurring_ticket_update', $recurring_ticket_id);
|
customAction('recurring_ticket_update', $recurring_ticket_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Recurring Ticket", " Bulk Edit", "$session_name updated the category to $category_name for $recurring_ticket_count Recurring Tickets");
|
logAudit("Recurring Ticket", " Bulk Edit", "$session_name updated the category to $category_name for $recurring_ticket_count Recurring Tickets");
|
||||||
|
|
||||||
flash_alert("Category set to $category_name for <strong>$recurring_ticket_count</strong> Recurring Tickets");
|
flash_alert("Category set to $category_name for <strong>$recurring_ticket_count</strong> Recurring Tickets");
|
||||||
}
|
}
|
||||||
@@ -639,12 +639,12 @@ if (isset($_POST['bulk_edit_recurring_ticket_billable'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "UPDATE recurring_tickets SET recurring_ticket_billable = $billable WHERE recurring_ticket_id = $recurring_ticket_id");
|
mysqli_query($mysqli, "UPDATE recurring_tickets SET recurring_ticket_billable = $billable WHERE recurring_ticket_id = $recurring_ticket_id");
|
||||||
|
|
||||||
logAction("Recurring Ticket", "Edit", "$session_name updated the billable status on recurring ticket $recurring_ticket_subject from $previous_billable_status to $billable_status", $client_id, $recurring_ticket_id);
|
logAudit("Recurring Ticket", "Edit", "$session_name updated the billable status on recurring ticket $recurring_ticket_subject from $previous_billable_status to $billable_status", $client_id, $recurring_ticket_id);
|
||||||
|
|
||||||
customAction('recurring_ticket_update', $recurring_ticket_id);
|
customAction('recurring_ticket_update', $recurring_ticket_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Recurring Ticket", " Bulk Edit", "$session_name updated the billable status to $billable_status for $recurring_ticket_count Recurring Tickets");
|
logAudit("Recurring Ticket", " Bulk Edit", "$session_name updated the billable status to $billable_status for $recurring_ticket_count Recurring Tickets");
|
||||||
|
|
||||||
flash_alert("Billable status set to $billable_status for <strong>$recurring_ticket_count</strong> Recurring Tickets");
|
flash_alert("Billable status set to $billable_status for <strong>$recurring_ticket_count</strong> Recurring Tickets");
|
||||||
}
|
}
|
||||||
@@ -679,12 +679,12 @@ if (isset($_POST['bulk_edit_recurring_ticket_next_run_date'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "UPDATE recurring_tickets SET recurring_ticket_next_run = '$next_run_date' WHERE recurring_ticket_id = $recurring_ticket_id");
|
mysqli_query($mysqli, "UPDATE recurring_tickets SET recurring_ticket_next_run = '$next_run_date' WHERE recurring_ticket_id = $recurring_ticket_id");
|
||||||
|
|
||||||
logAction("Recurring Ticket", "Edit", "$session_name updated the Next run date on recurring ticket $recurring_ticket_subject from $previous_recurring_ticket_next_run_date to $next_run_date", $client_id, $recurring_ticket_id);
|
logAudit("Recurring Ticket", "Edit", "$session_name updated the Next run date on recurring ticket $recurring_ticket_subject from $previous_recurring_ticket_next_run_date to $next_run_date", $client_id, $recurring_ticket_id);
|
||||||
|
|
||||||
customAction('recurring_ticket_update', $recurring_ticket_id);
|
customAction('recurring_ticket_update', $recurring_ticket_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Recurring Ticket", " Bulk Edit", "$session_name updated the Next run date to $next_run_date for $recurring_ticket_count Recurring Tickets");
|
logAudit("Recurring Ticket", " Bulk Edit", "$session_name updated the Next run date to $next_run_date for $recurring_ticket_count Recurring Tickets");
|
||||||
|
|
||||||
flash_alert("Next run date set to <strong>$next_run_date</strong> for <strong>$recurring_ticket_count</strong> Recurring Tickets");
|
flash_alert("Next run date set to <strong>$next_run_date</strong> for <strong>$recurring_ticket_count</strong> Recurring Tickets");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ if (isset($_POST['add_revenue'])) {
|
|||||||
|
|
||||||
$revenue_id = mysqli_insert_id($mysqli);
|
$revenue_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Revenue", "Create", "$session_name added revenue $description", 0, $revenue_id);
|
logAudit("Revenue", "Create", "$session_name added revenue $description", 0, $revenue_id);
|
||||||
|
|
||||||
flash_alert("Revenue added");
|
flash_alert("Revenue added");
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ if (isset($_POST['edit_revenue'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE revenues SET revenue_date = '$date', revenue_amount = $amount, revenue_payment_method = '$payment_method', revenue_reference = '$reference', revenue_description = '$description', revenue_category_id = $category, revenue_account_id = $account WHERE revenue_id = $revenue_id");
|
mysqli_query($mysqli,"UPDATE revenues SET revenue_date = '$date', revenue_amount = $amount, revenue_payment_method = '$payment_method', revenue_reference = '$reference', revenue_description = '$description', revenue_category_id = $category, revenue_account_id = $account WHERE revenue_id = $revenue_id");
|
||||||
|
|
||||||
logAction("Revenue", "Edit", "$session_name edited revenue $description", 0, $revenue_id);
|
logAudit("Revenue", "Edit", "$session_name edited revenue $description", 0, $revenue_id);
|
||||||
|
|
||||||
flash_alert("Revenue edited");
|
flash_alert("Revenue edited");
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ if (isset($_GET['delete_revenue'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM revenues WHERE revenue_id = $revenue_id");
|
mysqli_query($mysqli,"DELETE FROM revenues WHERE revenue_id = $revenue_id");
|
||||||
|
|
||||||
logAction("Revenue", "Delete", "$session_name deleted revenue $revenue_description");
|
logAudit("Revenue", "Delete", "$session_name deleted revenue $revenue_description");
|
||||||
|
|
||||||
flash_alert("Revenue removed", 'error');
|
flash_alert("Revenue removed", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ if (isset($_POST['add_service'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Service", "Create", "$session_name created service $service_name", $client_id, $service_id);
|
logAudit("Service", "Create", "$session_name created service $service_name", $client_id, $service_id);
|
||||||
|
|
||||||
flash_alert("Service <strong>$service_name</strong> created");
|
flash_alert("Service <strong>$service_name</strong> created");
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@ if (isset($_POST['edit_service'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Service", "Edit", "$session_name edited service $service_name", $client_id, $service_id);
|
logAudit("Service", "Edit", "$session_name edited service $service_name", $client_id, $service_id);
|
||||||
|
|
||||||
flash_alert("Service <strong>$service_name</strong> edited");
|
flash_alert("Service <strong>$service_name</strong> edited");
|
||||||
|
|
||||||
@@ -193,7 +193,7 @@ if (isset($_GET['delete_service'])) {
|
|||||||
// Delete service
|
// Delete service
|
||||||
mysqli_query($mysqli, "DELETE FROM services WHERE service_id = $service_id");
|
mysqli_query($mysqli, "DELETE FROM services WHERE service_id = $service_id");
|
||||||
|
|
||||||
logAction("Service", "Delete", "$session_name deleted service $service_name", $client_id);
|
logAudit("Service", "Delete", "$session_name deleted service $service_name", $client_id);
|
||||||
|
|
||||||
flash_alert("Service <strong>$service_name</strong> deleted", 'error');
|
flash_alert("Service <strong>$service_name</strong> deleted", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ if (isset($_POST['add_software_from_template'])) {
|
|||||||
|
|
||||||
$software_id = mysqli_insert_id($mysqli);
|
$software_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Software", "Create", "$session_name created software $name using template", $client_id, $software_id);
|
logAudit("Software", "Create", "$session_name created software $name using template", $client_id, $software_id);
|
||||||
|
|
||||||
flash_alert("Software <strong>$name</strong> created from template");
|
flash_alert("Software <strong>$name</strong> created from template");
|
||||||
|
|
||||||
@@ -97,7 +97,7 @@ if (isset($_POST['add_software'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Software", "Create", "$session_name created software $name", $client_id, $software_id);
|
logAudit("Software", "Create", "$session_name created software $name", $client_id, $software_id);
|
||||||
|
|
||||||
flash_alert("Software <strong>$name</strong> created $alert_extended");
|
flash_alert("Software <strong>$name</strong> created $alert_extended");
|
||||||
|
|
||||||
@@ -161,7 +161,7 @@ if (isset($_POST['edit_software'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Software", "Edit", "$session_name edited software $name", $client_id, $software_id);
|
logAudit("Software", "Edit", "$session_name edited software $name", $client_id, $software_id);
|
||||||
|
|
||||||
flash_alert("Software <strong>$name</strong> updated");
|
flash_alert("Software <strong>$name</strong> updated");
|
||||||
|
|
||||||
@@ -191,7 +191,7 @@ if (isset($_GET['archive_software'])) {
|
|||||||
mysqli_query($mysqli,"DELETE FROM software_contacts WHERE software_id = $software_id");
|
mysqli_query($mysqli,"DELETE FROM software_contacts WHERE software_id = $software_id");
|
||||||
mysqli_query($mysqli,"DELETE FROM software_assets WHERE software_id = $software_id");
|
mysqli_query($mysqli,"DELETE FROM software_assets WHERE software_id = $software_id");
|
||||||
|
|
||||||
logAction("Software", "Archive", "$session_name archived software $software_name and removed all device/user license associations", $client_id, $software_id);
|
logAudit("Software", "Archive", "$session_name archived software $software_name and removed all device/user license associations", $client_id, $software_id);
|
||||||
|
|
||||||
flash_alert("Software <strong>$software_name</strong> archived and removed all device/user license associations", 'error');
|
flash_alert("Software <strong>$software_name</strong> archived and removed all device/user license associations", 'error');
|
||||||
|
|
||||||
@@ -217,7 +217,7 @@ if (isset($_GET['delete_software'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM software WHERE software_id = $software_id");
|
mysqli_query($mysqli,"DELETE FROM software WHERE software_id = $software_id");
|
||||||
|
|
||||||
logAction("Software", "Delete", "$session_name deleted software $software_name and removed all device/user license associations", $client_id);
|
logAudit("Software", "Delete", "$session_name deleted software $software_name and removed all device/user license associations", $client_id);
|
||||||
|
|
||||||
flash_alert("Software <strong>$software_name</strong> deleted and removed all device/user license associations", 'error');
|
flash_alert("Software <strong>$software_name</strong> deleted and removed all device/user license associations", 'error');
|
||||||
|
|
||||||
@@ -304,7 +304,7 @@ if (isset($_POST['export_software_csv'])) {
|
|||||||
fpassthru($f);
|
fpassthru($f);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Software", "Export", "$session_name exported $num_rows software(s) $software_name to a CSV file", $client_id);
|
logAudit("Software", "Export", "$session_name exported $num_rows software(s) $software_name to a CSV file", $client_id);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ if (isset($_POST['add_tag'])) {
|
|||||||
|
|
||||||
$tag_id = mysqli_insert_id($mysqli);
|
$tag_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Tag", "Create", "$session_name created tag $name", 0, $tag_id);
|
logAudit("Tag", "Create", "$session_name created tag $name", 0, $tag_id);
|
||||||
|
|
||||||
flash_alert("Tag <strong>$name</strong> created");
|
flash_alert("Tag <strong>$name</strong> created");
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ if (isset($_POST['add_task'])) {
|
|||||||
|
|
||||||
$task_id = mysqli_insert_id($mysqli);
|
$task_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Task", "Create", "$session_name created task $task_name", $client_id, $task_id);
|
logAudit("Task", "Create", "$session_name created task $task_name", $client_id, $task_id);
|
||||||
|
|
||||||
flash_alert("You created Task <strong>$task_name</strong>");
|
flash_alert("You created Task <strong>$task_name</strong>");
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ if (isset($_POST['edit_ticket_task'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "UPDATE tasks SET task_name = '$task_name', task_order = $task_order, task_completion_estimate = $task_completion_estimate WHERE task_id = $task_id");
|
mysqli_query($mysqli, "UPDATE tasks SET task_name = '$task_name', task_order = $task_order, task_completion_estimate = $task_completion_estimate WHERE task_id = $task_id");
|
||||||
|
|
||||||
logAction("Task", "Edit", "$session_name edited task $task_name", $client_id, $task_id);
|
logAudit("Task", "Edit", "$session_name edited task $task_name", $client_id, $task_id);
|
||||||
|
|
||||||
flash_alert("Task <strong>$task_name</strong> edited");
|
flash_alert("Task <strong>$task_name</strong> edited");
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ if (isset($_POST['edit_ticket_template_task'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "UPDATE task_templates SET task_template_name = '$task_name', task_template_order = $task_order, task_template_completion_estimate = $task_completion_estimate WHERE task_template_id = $task_template_id");
|
mysqli_query($mysqli, "UPDATE task_templates SET task_template_name = '$task_name', task_template_order = $task_order, task_template_completion_estimate = $task_completion_estimate WHERE task_template_id = $task_template_id");
|
||||||
|
|
||||||
logAction("Task", "Edit", "$session_name edited task $task_name", 0, $task_template_id);
|
logAudit("Task", "Edit", "$session_name edited task $task_name", 0, $task_template_id);
|
||||||
|
|
||||||
flash_alert("Task <strong>$task_name</strong> edited");
|
flash_alert("Task <strong>$task_name</strong> edited");
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ if (isset($_GET['delete_task'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "DELETE FROM tasks WHERE task_id = $task_id");
|
mysqli_query($mysqli, "DELETE FROM tasks WHERE task_id = $task_id");
|
||||||
|
|
||||||
logAction("Task", "Delete", "$session_name deleted task $task_name", $client_id, $task_id);
|
logAudit("Task", "Delete", "$session_name deleted task $task_name", $client_id, $task_id);
|
||||||
|
|
||||||
flash_alert("Task <strong>$task_name</strong> deleted", 'error');
|
flash_alert("Task <strong>$task_name</strong> deleted", 'error');
|
||||||
|
|
||||||
@@ -127,7 +127,7 @@ if (isset($_GET['complete_task'])) {
|
|||||||
|
|
||||||
$ticket_reply_id = mysqli_insert_id($mysqli);
|
$ticket_reply_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Task", "Edit", "$session_name completed task $task_name", $client_id, $task_id);
|
logAudit("Task", "Edit", "$session_name completed task $task_name", $client_id, $task_id);
|
||||||
|
|
||||||
flash_alert("Task <strong>$task_name</strong> Completed");
|
flash_alert("Task <strong>$task_name</strong> Completed");
|
||||||
|
|
||||||
@@ -157,7 +157,7 @@ if (isset($_GET['undo_complete_task'])) {
|
|||||||
|
|
||||||
$ticket_reply_id = mysqli_insert_id($mysqli);
|
$ticket_reply_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Task", "Edit", "$session_name marked task $task_name as incomplete", $client_id, $task_id);
|
logAudit("Task", "Edit", "$session_name marked task $task_name as incomplete", $client_id, $task_id);
|
||||||
|
|
||||||
flash_alert("Task <strong>$task_name</strong> marked as incomplete", 'error');
|
flash_alert("Task <strong>$task_name</strong> marked as incomplete", 'error');
|
||||||
|
|
||||||
@@ -333,7 +333,7 @@ if (isset($_POST['add_ticket_task_approver'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Task", "Edit", "$session_name added task approver for $task_name", $client_id, $task_id);
|
logAudit("Task", "Edit", "$session_name added task approver for $task_name", $client_id, $task_id);
|
||||||
|
|
||||||
flash_alert("Added approver");
|
flash_alert("Added approver");
|
||||||
redirect();
|
redirect();
|
||||||
@@ -383,7 +383,7 @@ if (isset($_GET['approve_ticket_task'])) {
|
|||||||
// TODO: Email agent
|
// TODO: Email agent
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Task", "Edit", "$session_name approved task $task_name (approval $approval_id)", 0, $task_id);
|
logAudit("Task", "Edit", "$session_name approved task $task_name (approval $approval_id)", 0, $task_id);
|
||||||
|
|
||||||
flash_alert("Approved");
|
flash_alert("Approved");
|
||||||
redirect();
|
redirect();
|
||||||
@@ -400,7 +400,7 @@ if (isset($_GET['delete_ticket_task_approver'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "DELETE FROM task_approvals WHERE approval_id = $approval_id");
|
mysqli_query($mysqli, "DELETE FROM task_approvals WHERE approval_id = $approval_id");
|
||||||
|
|
||||||
logAction("Task", "Delete", "$session_name deleted task approval request ($approval_id)", 0, 0);
|
logAudit("Task", "Delete", "$session_name deleted task approval request ($approval_id)", 0, 0);
|
||||||
|
|
||||||
flash_alert("Approval request deleted", 'error');
|
flash_alert("Approval request deleted", 'error');
|
||||||
|
|
||||||
@@ -426,7 +426,7 @@ if (isset($_GET['complete_all_tasks'])) {
|
|||||||
|
|
||||||
$ticket_reply_id = mysqli_insert_id($mysqli);
|
$ticket_reply_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Ticket", "Edit", "$session_name marked all tasks complete for ticket", $client_id, $ticket_id);
|
logAudit("Ticket", "Edit", "$session_name marked all tasks complete for ticket", $client_id, $ticket_id);
|
||||||
|
|
||||||
flash_alert("Marked all tasks Complete");
|
flash_alert("Marked all tasks Complete");
|
||||||
|
|
||||||
@@ -452,7 +452,7 @@ if (isset($_GET['undo_complete_all_tasks'])) {
|
|||||||
|
|
||||||
$ticket_reply_id = mysqli_insert_id($mysqli);
|
$ticket_reply_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Ticket", "Edit", "$session_name marked all tasks as incomplete for ticket", $client_id, $ticket_id);
|
logAudit("Ticket", "Edit", "$session_name marked all tasks as incomplete for ticket", $client_id, $ticket_id);
|
||||||
|
|
||||||
flash_alert("Marked all tasks Incomplete", 'error');
|
flash_alert("Marked all tasks Incomplete", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ if (isset($_POST['add_ticket'])) {
|
|||||||
// Custom action/notif handler
|
// Custom action/notif handler
|
||||||
customAction('ticket_create', $ticket_id);
|
customAction('ticket_create', $ticket_id);
|
||||||
|
|
||||||
logAction("Ticket", "Create", "$session_name created ticket $config_ticket_prefix$ticket_number - $ticket_subject", $client_id, $ticket_id);
|
logAudit("Ticket", "Create", "$session_name created ticket $config_ticket_prefix$ticket_number - $ticket_subject", $client_id, $ticket_id);
|
||||||
|
|
||||||
flash_alert("Ticket <strong>$config_ticket_prefix$ticket_number</strong> created");
|
flash_alert("Ticket <strong>$config_ticket_prefix$ticket_number</strong> created");
|
||||||
|
|
||||||
@@ -306,7 +306,7 @@ if (isset($_POST['edit_ticket'])) {
|
|||||||
// Custom action/notif handler
|
// Custom action/notif handler
|
||||||
customAction('ticket_update', $ticket_id);
|
customAction('ticket_update', $ticket_id);
|
||||||
|
|
||||||
logAction("Ticket", "Edit", "$session_name edited ticket $ticket_prefix$ticket_number", $client_id, $ticket_id);
|
logAudit("Ticket", "Edit", "$session_name edited ticket $ticket_prefix$ticket_number", $client_id, $ticket_id);
|
||||||
|
|
||||||
flash_alert("Ticket <strong>$ticket_prefix$ticket_number</strong> updated");
|
flash_alert("Ticket <strong>$ticket_prefix$ticket_number</strong> updated");
|
||||||
|
|
||||||
@@ -348,7 +348,7 @@ if (isset($_POST['edit_ticket_priority'])) {
|
|||||||
// Update Ticket History
|
// Update Ticket History
|
||||||
mysqli_query($mysqli, "INSERT INTO ticket_history SET ticket_history_status = '$ticket_status', ticket_history_description = '$session_name changed priority from $original_priority to $priority', ticket_history_ticket_id = $ticket_id");
|
mysqli_query($mysqli, "INSERT INTO ticket_history SET ticket_history_status = '$ticket_status', ticket_history_description = '$session_name changed priority from $original_priority to $priority', ticket_history_ticket_id = $ticket_id");
|
||||||
|
|
||||||
logAction("Ticket", "Edit", "$session_name changed priority from $original_priority to $priority for ticket $ticket_prefix$ticket_number", $client_id, $ticket_id);
|
logAudit("Ticket", "Edit", "$session_name changed priority from $original_priority to $priority for ticket $ticket_prefix$ticket_number", $client_id, $ticket_id);
|
||||||
|
|
||||||
customAction('ticket_update', $ticket_id);
|
customAction('ticket_update', $ticket_id);
|
||||||
|
|
||||||
@@ -441,7 +441,7 @@ if (isset($_POST['edit_ticket_contact'])) {
|
|||||||
// Update Ticket History
|
// Update Ticket History
|
||||||
mysqli_query($mysqli, "INSERT INTO ticket_history SET ticket_history_status = '$ticket_status', ticket_history_description = '$session_name changed the contact from $original_contact_name to $contact_name', ticket_history_ticket_id = $ticket_id");
|
mysqli_query($mysqli, "INSERT INTO ticket_history SET ticket_history_status = '$ticket_status', ticket_history_description = '$session_name changed the contact from $original_contact_name to $contact_name', ticket_history_ticket_id = $ticket_id");
|
||||||
|
|
||||||
logAction("Ticket", "Edit", "$session_name changed the contact from $original_contact_name to $contact_name for ticket $ticket_prefix$ticket_number", $client_id, $ticket_id);
|
logAudit("Ticket", "Edit", "$session_name changed the contact from $original_contact_name to $contact_name for ticket $ticket_prefix$ticket_number", $client_id, $ticket_id);
|
||||||
|
|
||||||
flash_alert("Contact changed from <strong>$original_contact_name</strong> to <strong>$contact_name</strong>");
|
flash_alert("Contact changed from <strong>$original_contact_name</strong> to <strong>$contact_name</strong>");
|
||||||
|
|
||||||
@@ -470,7 +470,7 @@ if (isset($_POST['edit_ticket_project'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "UPDATE tickets SET ticket_project_id = $project_id WHERE ticket_id = $ticket_id");
|
mysqli_query($mysqli, "UPDATE tickets SET ticket_project_id = $project_id WHERE ticket_id = $ticket_id");
|
||||||
|
|
||||||
logAction("Ticket", "Edit", "$session_name set ticket $ticket_prefix$ticket_number project to $project_name", $client_id, $ticket_id);
|
logAudit("Ticket", "Edit", "$session_name set ticket $ticket_prefix$ticket_number project to $project_name", $client_id, $ticket_id);
|
||||||
|
|
||||||
flash_alert("Project changed to <strong>$project_name</strong> for Ticket <strong>$ticket_prefix$ticket_number</strong>");
|
flash_alert("Project changed to <strong>$project_name</strong> for Ticket <strong>$ticket_prefix$ticket_number</strong>");
|
||||||
|
|
||||||
@@ -552,7 +552,7 @@ if (isset($_POST['add_ticket_watcher'])) {
|
|||||||
addToMailQueue($data);
|
addToMailQueue($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Ticket", "Edit", "$session_name added $watcher_email as a watcher for ticket $ticket_prefix$ticket_number", $client_id, $ticket_id);
|
logAudit("Ticket", "Edit", "$session_name added $watcher_email as a watcher for ticket $ticket_prefix$ticket_number", $client_id, $ticket_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -596,7 +596,7 @@ if (isset($_GET['delete_ticket_watcher'])) {
|
|||||||
// History
|
// History
|
||||||
mysqli_query($mysqli, "INSERT INTO ticket_history SET ticket_history_status = '$ticket_status_name', ticket_history_description = '$session_name removed ticket $watcher_email as a watcher', ticket_history_ticket_id = $ticket_id");
|
mysqli_query($mysqli, "INSERT INTO ticket_history SET ticket_history_status = '$ticket_status_name', ticket_history_description = '$session_name removed ticket $watcher_email as a watcher', ticket_history_ticket_id = $ticket_id");
|
||||||
|
|
||||||
logAction("Ticket", "Edit", "$session_name removed $watcher_email as a watcher for ticket $ticket_prefix$ticket_number", $client_id, $ticket_id);
|
logAudit("Ticket", "Edit", "$session_name removed $watcher_email as a watcher for ticket $ticket_prefix$ticket_number", $client_id, $ticket_id);
|
||||||
|
|
||||||
flash_alert("Removed ticket watcher <strong>$watcher_email</strong>", 'error');
|
flash_alert("Removed ticket watcher <strong>$watcher_email</strong>", 'error');
|
||||||
|
|
||||||
@@ -637,7 +637,7 @@ if (isset($_GET['delete_ticket_additional_asset'])) {
|
|||||||
// History
|
// History
|
||||||
mysqli_query($mysqli, "INSERT INTO ticket_history SET ticket_history_status = '$ticket_status_name', ticket_history_description = '$session_name removed additional asset $asset_name', ticket_history_ticket_id = $ticket_id");
|
mysqli_query($mysqli, "INSERT INTO ticket_history SET ticket_history_status = '$ticket_status_name', ticket_history_description = '$session_name removed additional asset $asset_name', ticket_history_ticket_id = $ticket_id");
|
||||||
|
|
||||||
logAction("Ticket", "Edit", "$session_name removed asset $asset_name from ticket $ticket_prefix$ticket_number", $client_id, $ticket_id);
|
logAudit("Ticket", "Edit", "$session_name removed asset $asset_name from ticket $ticket_prefix$ticket_number", $client_id, $ticket_id);
|
||||||
|
|
||||||
flash_alert("Removed asset <strong>$asset_name</strong> from ticket.", 'error');
|
flash_alert("Removed asset <strong>$asset_name</strong> from ticket.", 'error');
|
||||||
|
|
||||||
@@ -690,7 +690,7 @@ if (isset($_POST['edit_ticket_asset'])) {
|
|||||||
$asset_name = escapeSql($row['asset_name']);
|
$asset_name = escapeSql($row['asset_name']);
|
||||||
$client_id = intval($row['ticket_client_id']);
|
$client_id = intval($row['ticket_client_id']);
|
||||||
|
|
||||||
logAction("Ticket", "Edit", "$session_name changed asset to $asset_name for ticket $ticket_prefix$ticket_number", $client_id, $ticket_id);
|
logAudit("Ticket", "Edit", "$session_name changed asset to $asset_name for ticket $ticket_prefix$ticket_number", $client_id, $ticket_id);
|
||||||
|
|
||||||
flash_alert("Ticket <strong>$ticket_prefix$ticket_number</strong> asset updated to <strong>$asset_name</strong>");
|
flash_alert("Ticket <strong>$ticket_prefix$ticket_number</strong> asset updated to <strong>$asset_name</strong>");
|
||||||
|
|
||||||
@@ -730,7 +730,7 @@ if (isset($_POST['edit_ticket_vendor'])) {
|
|||||||
$vendor_name = escapeSql($row['vendor_name']);
|
$vendor_name = escapeSql($row['vendor_name']);
|
||||||
$client_id = intval($row['ticket_client_id']);
|
$client_id = intval($row['ticket_client_id']);
|
||||||
|
|
||||||
logAction("Ticket", "Edit", "$session_name set vendor to $vendor_name for ticket $ticket_prefix$ticket_number", $client_id, $ticket_id);
|
logAudit("Ticket", "Edit", "$session_name set vendor to $vendor_name for ticket $ticket_prefix$ticket_number", $client_id, $ticket_id);
|
||||||
|
|
||||||
flash_alert("Set vendor to <strong>$vendor_name</strong> for ticket <strong>$ticket_prefix$ticket_number</strong>");
|
flash_alert("Set vendor to <strong>$vendor_name</strong> for ticket <strong>$ticket_prefix$ticket_number</strong>");
|
||||||
|
|
||||||
@@ -804,7 +804,7 @@ if (isset($_POST['assign_ticket'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = '$ticket_reply', ticket_reply_type = 'Internal', ticket_reply_time_worked = '00:01:00', ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $ticket_id");
|
mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = '$ticket_reply', ticket_reply_type = 'Internal', ticket_reply_time_worked = '00:01:00', ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $ticket_id");
|
||||||
|
|
||||||
logAction("Ticket", "Edit", "$session_name reassigned $ticket_prefix$ticket_number to $agent_name", $client_id, $ticket_id);
|
logAudit("Ticket", "Edit", "$session_name reassigned $ticket_prefix$ticket_number to $agent_name", $client_id, $ticket_id);
|
||||||
|
|
||||||
// Notification
|
// Notification
|
||||||
if ($session_user_id != $assigned_to && $assigned_to != 0) {
|
if ($session_user_id != $assigned_to && $assigned_to != 0) {
|
||||||
@@ -888,7 +888,7 @@ if (isset($_GET['delete_ticket'])) {
|
|||||||
|
|
||||||
// No Need to delete ticket assets as this is cascadely deleted via the database.
|
// No Need to delete ticket assets as this is cascadely deleted via the database.
|
||||||
|
|
||||||
logAction("Ticket", "Delete", "$session_name deleted $ticket_prefix$ticket_number along with all replies", $client_id);
|
logAudit("Ticket", "Delete", "$session_name deleted $ticket_prefix$ticket_number along with all replies", $client_id);
|
||||||
|
|
||||||
flash_alert("Ticket <strong>$ticket_prefix$ticket_number</strong> along with all replies deleted", 'error');
|
flash_alert("Ticket <strong>$ticket_prefix$ticket_number</strong> along with all replies deleted", 'error');
|
||||||
|
|
||||||
@@ -938,11 +938,11 @@ if (isset($_POST['bulk_delete_tickets'])) {
|
|||||||
|
|
||||||
// No Need to delete ticket assets as this is cascadely deleted via the database.
|
// No Need to delete ticket assets as this is cascadely deleted via the database.
|
||||||
|
|
||||||
logAction("Ticket", "Delete", "$session_name deleted ticket", 0, $ticket_id);
|
logAudit("Ticket", "Delete", "$session_name deleted ticket", 0, $ticket_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Ticket", "Bulk Delete", "$session_name deleted $count ticket(s)");
|
logAudit("Ticket", "Bulk Delete", "$session_name deleted $count ticket(s)");
|
||||||
|
|
||||||
flash_alert("Deleted <strong>$count</strong> ticket(s)", 'error');
|
flash_alert("Deleted <strong>$count</strong> ticket(s)", 'error');
|
||||||
}
|
}
|
||||||
@@ -1011,7 +1011,7 @@ if (isset($_POST['bulk_assign_ticket'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = '$ticket_reply', ticket_reply_type = 'Internal', ticket_reply_time_worked = '00:01:00', ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $ticket_id");
|
mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = '$ticket_reply', ticket_reply_type = 'Internal', ticket_reply_time_worked = '00:01:00', ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $ticket_id");
|
||||||
|
|
||||||
logAction("Ticket", "Edit", "$session_name reassigned ticket $ticket_prefix$ticket_number to $agent_name", $client_id, $ticket_id);
|
logAudit("Ticket", "Edit", "$session_name reassigned ticket $ticket_prefix$ticket_number to $agent_name", $client_id, $ticket_id);
|
||||||
|
|
||||||
customAction('ticket_assign', $ticket_id);
|
customAction('ticket_assign', $ticket_id);
|
||||||
|
|
||||||
@@ -1095,12 +1095,12 @@ if (isset($_POST['bulk_edit_ticket_priority'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = '$session_name updated the priority from $current_ticket_priority to $priority', ticket_reply_type = 'Internal', ticket_reply_time_worked = '00:01:00', ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $ticket_id");
|
mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = '$session_name updated the priority from $current_ticket_priority to $priority', ticket_reply_type = 'Internal', ticket_reply_time_worked = '00:01:00', ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $ticket_id");
|
||||||
|
|
||||||
logAction("Ticket", "Edit", "$session_name updated the priority on ticket $ticket_prefix$ticket_number - $ticket_subject from $original_ticket_priority to $priority", $client_id, $ticket_id);
|
logAudit("Ticket", "Edit", "$session_name updated the priority on ticket $ticket_prefix$ticket_number - $ticket_subject from $original_ticket_priority to $priority", $client_id, $ticket_id);
|
||||||
|
|
||||||
customAction('ticket_update', $ticket_id);
|
customAction('ticket_update', $ticket_id);
|
||||||
} // End For Each Ticket ID Loop
|
} // End For Each Ticket ID Loop
|
||||||
|
|
||||||
logAction("Ticket", " Bulk Edit", "$session_name updated the priority on $ticket_count");
|
logAudit("Ticket", " Bulk Edit", "$session_name updated the priority on $ticket_count");
|
||||||
|
|
||||||
flash_alert("You updated the priority for <strong>$ticket_count</strong> Tickets to <strong>$priority</strong>");
|
flash_alert("You updated the priority for <strong>$ticket_count</strong> Tickets to <strong>$priority</strong>");
|
||||||
}
|
}
|
||||||
@@ -1147,12 +1147,12 @@ if (isset($_POST['bulk_edit_ticket_category'])) {
|
|||||||
// Update ticket
|
// Update ticket
|
||||||
mysqli_query($mysqli, "UPDATE tickets SET ticket_category = '$category_id' WHERE ticket_id = $ticket_id");
|
mysqli_query($mysqli, "UPDATE tickets SET ticket_category = '$category_id' WHERE ticket_id = $ticket_id");
|
||||||
|
|
||||||
logAction("Ticket", "Edit", "$session_name updated the category on ticket $ticket_prefix$ticket_number - $ticket_subject from $previous_category_name to $category_name", $client_id, $ticket_id);
|
logAudit("Ticket", "Edit", "$session_name updated the category on ticket $ticket_prefix$ticket_number - $ticket_subject from $previous_category_name to $category_name", $client_id, $ticket_id);
|
||||||
|
|
||||||
customAction('ticket_update', $ticket_id);
|
customAction('ticket_update', $ticket_id);
|
||||||
} // End For Each Ticket ID Loop
|
} // End For Each Ticket ID Loop
|
||||||
|
|
||||||
logAction("Ticket", " Bulk Edit", "$session_name updated the category to $category_name on $ticket_count");
|
logAudit("Ticket", " Bulk Edit", "$session_name updated the category to $category_name on $ticket_count");
|
||||||
|
|
||||||
flash_alert("Category set to $category_name for <strong>$ticket_count</strong> Tickets");
|
flash_alert("Category set to $category_name for <strong>$ticket_count</strong> Tickets");
|
||||||
}
|
}
|
||||||
@@ -1217,7 +1217,7 @@ if (isset($_POST['bulk_merge_tickets'])) {
|
|||||||
// Update new parent ticket
|
// Update new parent ticket
|
||||||
mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = 'Ticket $ticket_prefix$ticket_number was bulk merged into this ticket with comment: $merge_comment.<br><br><b>$ticket_subject</b><br>$ticket_details', ticket_reply_time_worked = '00:01:00', ticket_reply_type = 'Internal', ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $merge_into_ticket_id");
|
mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = 'Ticket $ticket_prefix$ticket_number was bulk merged into this ticket with comment: $merge_comment.<br><br><b>$ticket_subject</b><br>$ticket_details', ticket_reply_time_worked = '00:01:00', ticket_reply_type = 'Internal', ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $merge_into_ticket_id");
|
||||||
|
|
||||||
logAction("Ticket", "Merged", "$session_name Merged ticket $ticket_prefix$ticket_number into $ticket_prefix$merge_into_ticket_number", $client_id, $ticket_id);
|
logAudit("Ticket", "Merged", "$session_name Merged ticket $ticket_prefix$ticket_number into $ticket_prefix$merge_into_ticket_number", $client_id, $ticket_id);
|
||||||
|
|
||||||
// Custom action/notif handler
|
// Custom action/notif handler
|
||||||
customAction('ticket_merge', $ticket_id);
|
customAction('ticket_merge', $ticket_id);
|
||||||
@@ -1295,7 +1295,7 @@ if (isset($_POST['bulk_resolve_tickets'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = '$details', ticket_reply_type = '$ticket_reply_type', ticket_reply_time_worked = '$ticket_reply_time_worked', ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $ticket_id");
|
mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = '$details', ticket_reply_type = '$ticket_reply_type', ticket_reply_time_worked = '$ticket_reply_time_worked', ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $ticket_id");
|
||||||
|
|
||||||
logAction("Ticket", "Resolve", "$session_name resolved $ticket_prefix$ticket_number - $ticket_subject", $client_id, $ticket_id);
|
logAudit("Ticket", "Resolve", "$session_name resolved $ticket_prefix$ticket_number - $ticket_subject", $client_id, $ticket_id);
|
||||||
|
|
||||||
customAction('ticket_resolve', $ticket_id);
|
customAction('ticket_resolve', $ticket_id);
|
||||||
|
|
||||||
@@ -1440,7 +1440,7 @@ if (isset($_POST['bulk_ticket_reply'])) {
|
|||||||
// Update Ticket Status
|
// Update Ticket Status
|
||||||
mysqli_query($mysqli, "UPDATE tickets SET ticket_status = '$ticket_status' WHERE ticket_id = $ticket_id");
|
mysqli_query($mysqli, "UPDATE tickets SET ticket_status = '$ticket_status' WHERE ticket_id = $ticket_id");
|
||||||
|
|
||||||
logAction("Ticket", "Reply", "$session_name replied to ticket $ticket_prefix$ticket_number - $ticket_subject and was a $ticket_reply_type reply", $client_id, $ticket_id);
|
logAudit("Ticket", "Reply", "$session_name replied to ticket $ticket_prefix$ticket_number - $ticket_subject and was a $ticket_reply_type reply", $client_id, $ticket_id);
|
||||||
|
|
||||||
// Custom action/notif handler
|
// Custom action/notif handler
|
||||||
if ($ticket_reply_type == 'Internal') {
|
if ($ticket_reply_type == 'Internal') {
|
||||||
@@ -1454,7 +1454,7 @@ if (isset($_POST['bulk_ticket_reply'])) {
|
|||||||
mysqli_query($mysqli, "UPDATE tickets SET ticket_resolved_at = NOW() WHERE ticket_id = $ticket_id");
|
mysqli_query($mysqli, "UPDATE tickets SET ticket_resolved_at = NOW() WHERE ticket_id = $ticket_id");
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Ticket", "Resolved", "$session_name resolved Ticket $ticket_prefix$ticket_number", $client_id, $ticket_id);
|
logAudit("Ticket", "Resolved", "$session_name resolved Ticket $ticket_prefix$ticket_number", $client_id, $ticket_id);
|
||||||
|
|
||||||
customAction('ticket_resolve', $ticket_id);
|
customAction('ticket_resolve', $ticket_id);
|
||||||
}
|
}
|
||||||
@@ -1590,7 +1590,7 @@ if (isset($_POST['bulk_add_ticket_project'])) {
|
|||||||
// Update ticket & insert reply
|
// Update ticket & insert reply
|
||||||
mysqli_query($mysqli, "UPDATE tickets SET ticket_project_id = $project_id WHERE ticket_id = $ticket_id");
|
mysqli_query($mysqli, "UPDATE tickets SET ticket_project_id = $project_id WHERE ticket_id = $ticket_id");
|
||||||
|
|
||||||
logAction("Ticket", "Reply", "$session_name added ticket $ticket_prefix$ticket_number - $ticket_subject to project $project_name", $client_id, $ticket_id);
|
logAudit("Ticket", "Reply", "$session_name added ticket $ticket_prefix$ticket_number - $ticket_subject to project $project_name", $client_id, $ticket_id);
|
||||||
|
|
||||||
|
|
||||||
} // End For Each Ticket ID Loop
|
} // End For Each Ticket ID Loop
|
||||||
@@ -1713,7 +1713,7 @@ if (isset($_POST['bulk_add_asset_ticket'])) {
|
|||||||
customAction('ticket_create', $ticket_id);
|
customAction('ticket_create', $ticket_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Ticket", "Bulk Create", "$session_name created $asset_count tickets for $asset_count");
|
logAudit("Ticket", "Bulk Create", "$session_name created $asset_count tickets for $asset_count");
|
||||||
|
|
||||||
flash_alert("You created <b>$asset_count</b> tickets for the selected assets");
|
flash_alert("You created <b>$asset_count</b> tickets for the selected assets");
|
||||||
|
|
||||||
@@ -1770,7 +1770,7 @@ if (isset($_POST['add_ticket_reply'])) {
|
|||||||
if ($ticket_status == 4) {
|
if ($ticket_status == 4) {
|
||||||
mysqli_query($mysqli, "UPDATE tickets SET ticket_resolved_at = NOW() WHERE ticket_id = $ticket_id");
|
mysqli_query($mysqli, "UPDATE tickets SET ticket_resolved_at = NOW() WHERE ticket_id = $ticket_id");
|
||||||
|
|
||||||
logAction("Ticket", "Resolved", "$session_name resolved Ticket ticket ID $ticket_id", $client_id, $ticket_id);
|
logAudit("Ticket", "Resolved", "$session_name resolved Ticket ticket ID $ticket_id", $client_id, $ticket_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process reply actions, if we have a reply to work with (e.g. we're not just editing the status)
|
// Process reply actions, if we have a reply to work with (e.g. we're not just editing the status)
|
||||||
@@ -1901,7 +1901,7 @@ if (isset($_POST['add_ticket_reply'])) {
|
|||||||
flash_alert("Ticket updated");
|
flash_alert("Ticket updated");
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Ticket", "Reply", "$session_name replied to ticket $ticket_prefix$ticket_number - $ticket_subject and was a $ticket_reply_type reply", $client_id, $ticket_id);
|
logAudit("Ticket", "Reply", "$session_name replied to ticket $ticket_prefix$ticket_number - $ticket_subject and was a $ticket_reply_type reply", $client_id, $ticket_id);
|
||||||
|
|
||||||
redirect();
|
redirect();
|
||||||
|
|
||||||
@@ -1927,7 +1927,7 @@ if (isset($_POST['edit_ticket_reply'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "UPDATE ticket_replies SET ticket_reply = '$ticket_reply', ticket_reply_type = '$ticket_reply_type', ticket_reply_time_worked = '$ticket_reply_time_worked' WHERE ticket_reply_id = $ticket_reply_id AND ticket_reply_type != 'Client'") or die(mysqli_error($mysqli));
|
mysqli_query($mysqli, "UPDATE ticket_replies SET ticket_reply = '$ticket_reply', ticket_reply_type = '$ticket_reply_type', ticket_reply_time_worked = '$ticket_reply_time_worked' WHERE ticket_reply_id = $ticket_reply_id AND ticket_reply_type != 'Client'") or die(mysqli_error($mysqli));
|
||||||
|
|
||||||
logAction("Ticket", "Reply", "$session_name edited ticket_reply", $client_id, $ticket_reply_id);
|
logAudit("Ticket", "Reply", "$session_name edited ticket_reply", $client_id, $ticket_reply_id);
|
||||||
|
|
||||||
flash_alert("Ticket reply updated");
|
flash_alert("Ticket reply updated");
|
||||||
|
|
||||||
@@ -1953,7 +1953,7 @@ if (isset($_POST['redact_ticket_reply'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "UPDATE ticket_replies SET ticket_reply = '$ticket_reply' WHERE ticket_reply_id = $ticket_reply_id");
|
mysqli_query($mysqli, "UPDATE ticket_replies SET ticket_reply = '$ticket_reply' WHERE ticket_reply_id = $ticket_reply_id");
|
||||||
|
|
||||||
logAction("Ticket", "Reply", "$session_name redacted ticket_reply", $client_id, $ticket_reply_id);
|
logAudit("Ticket", "Reply", "$session_name redacted ticket_reply", $client_id, $ticket_reply_id);
|
||||||
|
|
||||||
flash_alert("Ticket reply redacted");
|
flash_alert("Ticket reply redacted");
|
||||||
|
|
||||||
@@ -1979,7 +1979,7 @@ if (isset($_GET['archive_ticket_reply'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "UPDATE ticket_replies SET ticket_reply_archived_at = NOW() WHERE ticket_reply_id = $ticket_reply_id");
|
mysqli_query($mysqli, "UPDATE ticket_replies SET ticket_reply_archived_at = NOW() WHERE ticket_reply_id = $ticket_reply_id");
|
||||||
|
|
||||||
logAction("Ticket Reply", "Archive", "$session_name archived ticket_reply", $client_id, $ticket_reply_id);
|
logAudit("Ticket Reply", "Archive", "$session_name archived ticket_reply", $client_id, $ticket_reply_id);
|
||||||
|
|
||||||
flash_alert("Ticket reply archived", 'error');
|
flash_alert("Ticket reply archived", 'error');
|
||||||
|
|
||||||
@@ -2057,7 +2057,7 @@ if (isset($_POST['merge_ticket'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "UPDATE tickets SET ticket_updated_at = NOW() WHERE ticket_id = $merge_into_ticket_id");
|
mysqli_query($mysqli, "UPDATE tickets SET ticket_updated_at = NOW() WHERE ticket_id = $merge_into_ticket_id");
|
||||||
|
|
||||||
logAction("Ticket", "Merged", "$session_name Merged ticket $ticket_prefix$ticket_number into $ticket_prefix$merge_into_ticket_number");
|
logAudit("Ticket", "Merged", "$session_name Merged ticket $ticket_prefix$ticket_number into $ticket_prefix$merge_into_ticket_number");
|
||||||
|
|
||||||
customAction('ticket_merge', $ticket_id);
|
customAction('ticket_merge', $ticket_id);
|
||||||
|
|
||||||
@@ -2088,7 +2088,7 @@ if (isset($_POST['change_client_ticket'])) {
|
|||||||
// Update ticket client & contact
|
// Update ticket client & contact
|
||||||
mysqli_query($mysqli, "UPDATE tickets SET ticket_client_id = $client_id, ticket_contact_id = $contact_id WHERE ticket_id = $ticket_id LIMIT 1");
|
mysqli_query($mysqli, "UPDATE tickets SET ticket_client_id = $client_id, ticket_contact_id = $contact_id WHERE ticket_id = $ticket_id LIMIT 1");
|
||||||
|
|
||||||
logAction("Ticket", "Change", "$session_name changed ticket client", $client_id, $ticket_id);
|
logAudit("Ticket", "Change", "$session_name changed ticket client", $client_id, $ticket_id);
|
||||||
|
|
||||||
customAction('ticket_update', $ticket_id);
|
customAction('ticket_update', $ticket_id);
|
||||||
|
|
||||||
@@ -2126,7 +2126,7 @@ if (isset($_GET['resolve_ticket'])) {
|
|||||||
// Resolve
|
// Resolve
|
||||||
mysqli_query($mysqli, "UPDATE tickets SET ticket_status = 4, ticket_resolved_at = NOW() WHERE ticket_id = $ticket_id");
|
mysqli_query($mysqli, "UPDATE tickets SET ticket_status = 4, ticket_resolved_at = NOW() WHERE ticket_id = $ticket_id");
|
||||||
|
|
||||||
logAction("Ticket", "Resolved", "$session_name resolved ticket $ticket_prefix$ticket_number (ID: $ticket_id)", $client_id, $ticket_id);
|
logAudit("Ticket", "Resolved", "$session_name resolved ticket $ticket_prefix$ticket_number (ID: $ticket_id)", $client_id, $ticket_id);
|
||||||
|
|
||||||
customAction('ticket_resolve', $ticket_id);
|
customAction('ticket_resolve', $ticket_id);
|
||||||
|
|
||||||
@@ -2228,7 +2228,7 @@ if (isset($_GET['close_ticket'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = 'Ticket closed.', ticket_reply_type = 'Internal', ticket_reply_time_worked = '00:01:00', ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $ticket_id");
|
mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = 'Ticket closed.', ticket_reply_type = 'Internal', ticket_reply_time_worked = '00:01:00', ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $ticket_id");
|
||||||
|
|
||||||
logAction("Ticket", "Closed", "$session_name closed ticket ID $ticket_id", $client_id, $ticket_id);
|
logAudit("Ticket", "Closed", "$session_name closed ticket ID $ticket_id", $client_id, $ticket_id);
|
||||||
|
|
||||||
customAction('ticket_close', $ticket_id);
|
customAction('ticket_close', $ticket_id);
|
||||||
|
|
||||||
@@ -2326,7 +2326,7 @@ if (isset($_GET['reopen_ticket'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "UPDATE tickets SET ticket_status = 2, ticket_resolved_at = NULL WHERE ticket_id = $ticket_id");
|
mysqli_query($mysqli, "UPDATE tickets SET ticket_status = 2, ticket_resolved_at = NULL WHERE ticket_id = $ticket_id");
|
||||||
|
|
||||||
logAction("Ticket", "Reopened", "$session_name reopened ticket ID $ticket_id", $client_id, $ticket_id);
|
logAudit("Ticket", "Reopened", "$session_name reopened ticket ID $ticket_id", $client_id, $ticket_id);
|
||||||
|
|
||||||
customAction('ticket_update', $ticket_id);
|
customAction('ticket_update', $ticket_id);
|
||||||
|
|
||||||
@@ -2449,7 +2449,7 @@ if (isset($_POST['add_invoice_from_ticket'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "UPDATE tickets SET ticket_invoice_id = $invoice_id WHERE ticket_id = $ticket_id");
|
mysqli_query($mysqli, "UPDATE tickets SET ticket_invoice_id = $invoice_id WHERE ticket_id = $ticket_id");
|
||||||
|
|
||||||
logAction("Invoice", "Create", "$session_name created invoice $invoice_prefix$invoice_number from Ticket $ticket_prefix$ticket_number", $client_id, $invoice_id);
|
logAudit("Invoice", "Create", "$session_name created invoice $invoice_prefix$invoice_number from Ticket $ticket_prefix$ticket_number", $client_id, $invoice_id);
|
||||||
|
|
||||||
flash_alert("Invoice $invoice_prefix$invoice_number created from ticket");
|
flash_alert("Invoice $invoice_prefix$invoice_number created from ticket");
|
||||||
|
|
||||||
@@ -2523,7 +2523,7 @@ if (isset($_POST['add_quote_from_ticket'])) {
|
|||||||
|
|
||||||
// Logging + redirects
|
// Logging + redirects
|
||||||
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Draft', history_description = 'Quote created from Ticket $ticket_prefix$ticket_number!', history_quote_id = $quote_id");
|
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Draft', history_description = 'Quote created from Ticket $ticket_prefix$ticket_number!', history_quote_id = $quote_id");
|
||||||
logAction("Quote", "Create", "$session_name created quote $config_quote_prefix$quote_number from ticket $ticket_prefix$ticket_number", $client_id, $quote_id);
|
logAudit("Quote", "Create", "$session_name created quote $config_quote_prefix$quote_number from ticket $ticket_prefix$ticket_number", $client_id, $quote_id);
|
||||||
|
|
||||||
customAction('quote_create', $quote_id);
|
customAction('quote_create', $quote_id);
|
||||||
|
|
||||||
@@ -2616,7 +2616,7 @@ if (isset($_POST['edit_ticket_billable_status'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE tickets SET ticket_billable = $billable_status WHERE ticket_id = $ticket_id");
|
mysqli_query($mysqli,"UPDATE tickets SET ticket_billable = $billable_status WHERE ticket_id = $ticket_id");
|
||||||
|
|
||||||
logAction("Ticket", "Edit", "$session_name marked ticket $ticket_prefix$ticket_number as $billable_wording Billable", $client_id, $ticket_id);
|
logAudit("Ticket", "Edit", "$session_name marked ticket $ticket_prefix$ticket_number as $billable_wording Billable", $client_id, $ticket_id);
|
||||||
|
|
||||||
flash_alert("Ticket marked <strong>$billable_wording Billable</strong>");
|
flash_alert("Ticket marked <strong>$billable_wording Billable</strong>");
|
||||||
|
|
||||||
@@ -2787,7 +2787,7 @@ if (isset($_POST['edit_ticket_schedule'])) {
|
|||||||
$ticket_reply_note = "Ticket scheduled for $email_datetime " . (boolval($onsite) ? '(onsite).' : '(remote).');
|
$ticket_reply_note = "Ticket scheduled for $email_datetime " . (boolval($onsite) ? '(onsite).' : '(remote).');
|
||||||
mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = '$ticket_reply_note', ticket_reply_type = 'Internal', ticket_reply_time_worked = '00:01:00', ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $ticket_id");
|
mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = '$ticket_reply_note', ticket_reply_type = 'Internal', ticket_reply_time_worked = '00:01:00', ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $ticket_id");
|
||||||
|
|
||||||
logAction("Ticket", "Edit", "$session_name edited ticket schedule", $client_id, $ticket_id);
|
logAudit("Ticket", "Edit", "$session_name edited ticket schedule", $client_id, $ticket_id);
|
||||||
|
|
||||||
customAction('ticket_schedule', $ticket_id);
|
customAction('ticket_schedule', $ticket_id);
|
||||||
|
|
||||||
@@ -2951,7 +2951,7 @@ if (isset($_GET['cancel_ticket_schedule'])) {
|
|||||||
$ticket_reply_note = "Ticket schedule cancelled.";
|
$ticket_reply_note = "Ticket schedule cancelled.";
|
||||||
mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = '$ticket_reply_note', ticket_reply_type = 'Internal', ticket_reply_time_worked = '00:01:00', ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $ticket_id");
|
mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = '$ticket_reply_note', ticket_reply_type = 'Internal', ticket_reply_time_worked = '00:01:00', ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $ticket_id");
|
||||||
|
|
||||||
logAction("Ticket", "Edit", "$session_name cancelled ticket schedule", $client_id, $ticket_id);
|
logAudit("Ticket", "Edit", "$session_name cancelled ticket schedule", $client_id, $ticket_id);
|
||||||
|
|
||||||
customAction('ticket_unschedule', $ticket_id);
|
customAction('ticket_unschedule', $ticket_id);
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ if (isset($_POST['add_transfer'])) {
|
|||||||
|
|
||||||
$transfer_id = mysqli_insert_id($mysqli);
|
$transfer_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Account Transfer", "Create", "$session_name transferred " . numfmt_format_currency($currency_format, $amount, $account_currency_code) . " from account $source_account_name to $destination_account_name", 0, $transfer_id);
|
logAudit("Account Transfer", "Create", "$session_name transferred " . numfmt_format_currency($currency_format, $amount, $account_currency_code) . " from account $source_account_name to $destination_account_name", 0, $transfer_id);
|
||||||
|
|
||||||
flash_alert("Transferred <strong>" . numfmt_format_currency($currency_format, $amount, $account_currency_code) . "</strong> from <strong>$source_account_name</strong> to <strong>$destination_account_name</strong>");
|
flash_alert("Transferred <strong>" . numfmt_format_currency($currency_format, $amount, $account_currency_code) . "</strong> from <strong>$source_account_name</strong> to <strong>$destination_account_name</strong>");
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ if (isset($_POST['edit_transfer'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE transfers SET transfer_method = '$transfer_method', transfer_notes = '$notes' WHERE transfer_id = $transfer_id");
|
mysqli_query($mysqli,"UPDATE transfers SET transfer_method = '$transfer_method', transfer_notes = '$notes' WHERE transfer_id = $transfer_id");
|
||||||
|
|
||||||
logAction("Account Transfer", "Edit", "$session_name edited transfer", 0, $transfer_id);
|
logAudit("Account Transfer", "Edit", "$session_name edited transfer", 0, $transfer_id);
|
||||||
|
|
||||||
flash_alert("Transfer edited");
|
flash_alert("Transfer edited");
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ if (isset($_GET['delete_transfer'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM transfers WHERE transfer_id = $transfer_id");
|
mysqli_query($mysqli,"DELETE FROM transfers WHERE transfer_id = $transfer_id");
|
||||||
|
|
||||||
logAction("Account Transfer", "Delete", "$session_name deleted transfer");
|
logAudit("Account Transfer", "Delete", "$session_name deleted transfer");
|
||||||
|
|
||||||
flash_alert("Transfer deleted", 'error');
|
flash_alert("Transfer deleted", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ if (isset($_POST['add_trip'])) {
|
|||||||
|
|
||||||
$trip_id = mysqli_insert_id($mysqli);
|
$trip_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Trip", "Create", "$session_name logged trip from $source to $destination", $client_id , $trip_id);
|
logAudit("Trip", "Create", "$session_name logged trip from $source to $destination", $client_id , $trip_id);
|
||||||
|
|
||||||
flash_alert("Trip from <strong>$source</strong> to <strong>$destination</strong> logged");
|
flash_alert("Trip from <strong>$source</strong> to <strong>$destination</strong> logged");
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ if (isset($_POST['edit_trip'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE trips SET trip_date = '$date', trip_source = '$source', trip_destination = '$destination', trip_miles = $miles, trip_purpose = '$purpose', round_trip = $roundtrip, trip_user_id = $user_id, trip_client_id = $client_id WHERE trip_id = $trip_id");
|
mysqli_query($mysqli,"UPDATE trips SET trip_date = '$date', trip_source = '$source', trip_destination = '$destination', trip_miles = $miles, trip_purpose = '$purpose', round_trip = $roundtrip, trip_user_id = $user_id, trip_client_id = $client_id WHERE trip_id = $trip_id");
|
||||||
|
|
||||||
logAction("Trip", "Edit", "$session_name edited trip", $client_id , $trip_id);
|
logAudit("Trip", "Edit", "$session_name edited trip", $client_id , $trip_id);
|
||||||
|
|
||||||
flash_alert("Trip edited");
|
flash_alert("Trip edited");
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ if (isset($_GET['delete_trip'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"DELETE FROM trips WHERE trip_id = $trip_id");
|
mysqli_query($mysqli,"DELETE FROM trips WHERE trip_id = $trip_id");
|
||||||
|
|
||||||
logAction("Trip", "Delete", "$session_name deleted trip ($trip_source - $trip_destination)", $client_id);
|
logAudit("Trip", "Delete", "$session_name deleted trip ($trip_source - $trip_destination)", $client_id);
|
||||||
|
|
||||||
flash_alert("Trip ($trip_source - $trip_destination) deleted", 'error');
|
flash_alert("Trip ($trip_source - $trip_destination) deleted", 'error');
|
||||||
|
|
||||||
@@ -152,7 +152,7 @@ if (isset($_POST['export_trips_csv'])) {
|
|||||||
//output all remaining data on a file pointer
|
//output all remaining data on a file pointer
|
||||||
fpassthru($f);
|
fpassthru($f);
|
||||||
|
|
||||||
logAction("Trip", "Export", "$session_name exported $count trip(s) to a CSV file");
|
logAudit("Trip", "Export", "$session_name exported $count trip(s) to a CSV file");
|
||||||
}
|
}
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ if (isset($_POST['edit_your_user_details'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE user_settings SET user_config_signature = '$signature' WHERE user_id = $session_user_id");
|
mysqli_query($mysqli,"UPDATE user_settings SET user_config_signature = '$signature' WHERE user_id = $session_user_id");
|
||||||
|
|
||||||
logAction("User Account", "Edit", "$session_name edited their account $extended_log_description");
|
logAudit("User Account", "Edit", "$session_name edited their account $extended_log_description");
|
||||||
|
|
||||||
flash_alert("User details updated");
|
flash_alert("User details updated");
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ if (isset($_GET['clear_your_user_avatar'])) {
|
|||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE users SET user_avatar = NULL WHERE user_id = $session_user_id");
|
mysqli_query($mysqli,"UPDATE users SET user_avatar = NULL WHERE user_id = $session_user_id");
|
||||||
|
|
||||||
logAction("User Account", "Edit", "$session_name cleared their avatar");
|
logAudit("User Account", "Edit", "$session_name cleared their avatar");
|
||||||
|
|
||||||
flash_alert("Avatar cleared", 'error');
|
flash_alert("Avatar cleared", 'error');
|
||||||
|
|
||||||
@@ -154,7 +154,7 @@ if (isset($_POST['edit_your_user_password'])) {
|
|||||||
$user_specific_encryption_ciphertext = encryptUserSpecificKey($_POST['new_password']);
|
$user_specific_encryption_ciphertext = encryptUserSpecificKey($_POST['new_password']);
|
||||||
mysqli_query($mysqli,"UPDATE users SET user_password = '$new_password', user_specific_encryption_ciphertext = '$user_specific_encryption_ciphertext' WHERE user_id = $session_user_id");
|
mysqli_query($mysqli,"UPDATE users SET user_password = '$new_password', user_specific_encryption_ciphertext = '$user_specific_encryption_ciphertext' WHERE user_id = $session_user_id");
|
||||||
|
|
||||||
logAction("User Account", "Edit", "$session_name changed their password");
|
logAudit("User Account", "Edit", "$session_name changed their password");
|
||||||
|
|
||||||
flash_alert("Your password was updated");
|
flash_alert("Your password was updated");
|
||||||
|
|
||||||
@@ -190,7 +190,7 @@ if (isset($_POST['edit_your_user_preferences'])) {
|
|||||||
$extended_log_description .= "disabled browser extension access";
|
$extended_log_description .= "disabled browser extension access";
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("User Account", "Edit", "$session_name $extended_log_description");
|
logAudit("User Account", "Edit", "$session_name $extended_log_description");
|
||||||
|
|
||||||
flash_alert("User preferences updated");
|
flash_alert("User preferences updated");
|
||||||
|
|
||||||
@@ -223,7 +223,7 @@ if (isset($_POST['enable_mfa'])) {
|
|||||||
// Delete any existing MFA tokens - these browsers should be re-validated
|
// Delete any existing MFA tokens - these browsers should be re-validated
|
||||||
mysqli_query($mysqli, "DELETE FROM remember_tokens WHERE remember_token_user_id = $session_user_id");
|
mysqli_query($mysqli, "DELETE FROM remember_tokens WHERE remember_token_user_id = $session_user_id");
|
||||||
|
|
||||||
logAction("User Account", "Edit", "$session_name enabled MFA on their account");
|
logAudit("User Account", "Edit", "$session_name enabled MFA on their account");
|
||||||
|
|
||||||
flash_alert("Multi-Factor authentication enabled");
|
flash_alert("Multi-Factor authentication enabled");
|
||||||
|
|
||||||
@@ -298,7 +298,7 @@ if (isset($_GET['disable_mfa'])){
|
|||||||
$mail = addToMailQueue($data);
|
$mail = addToMailQueue($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("User Account", "Edit", "$session_name disabled MFA on their account");
|
logAudit("User Account", "Edit", "$session_name disabled MFA on their account");
|
||||||
|
|
||||||
flash_alert("Multi-Factor authentication disabled", 'error');
|
flash_alert("Multi-Factor authentication disabled", 'error');
|
||||||
|
|
||||||
@@ -313,7 +313,7 @@ if (isset($_POST['revoke_your_2fa_remember_tokens'])) {
|
|||||||
// Delete tokens
|
// Delete tokens
|
||||||
mysqli_query($mysqli, "DELETE FROM remember_tokens WHERE remember_token_user_id = $session_user_id");
|
mysqli_query($mysqli, "DELETE FROM remember_tokens WHERE remember_token_user_id = $session_user_id");
|
||||||
|
|
||||||
logAction("User Account", "Edit", "$session_name revoked all their remember-me tokens");
|
logAudit("User Account", "Edit", "$session_name revoked all their remember-me tokens");
|
||||||
|
|
||||||
flash_alert("Remember me tokens revoked", 'error');
|
flash_alert("Remember me tokens revoked", 'error');
|
||||||
|
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ if (!empty($name) && !empty($client_id)) {
|
|||||||
mysqli_query($mysqli,"INSERT INTO asset_interfaces SET interface_name = '1', interface_mac = '$mac', interface_ip = '$ip', interface_primary = 1, interface_network_id = $network, interface_asset_id = $insert_id");
|
mysqli_query($mysqli,"INSERT INTO asset_interfaces SET interface_name = '1', interface_mac = '$mac', interface_ip = '$ip', interface_primary = 1, interface_network_id = $network, interface_asset_id = $insert_id");
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Asset", "Create", "$name via API ($api_key_name)", $client_id, $insert_id);
|
logAudit("Asset", "Create", "$name via API ($api_key_name)", $client_id, $insert_id);
|
||||||
logAction("API", "Success", "Created asset $name via API ($api_key_name)", $client_id);
|
logAudit("API", "Success", "Created asset $name via API ($api_key_name)", $client_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ if (!empty($asset_id)) {
|
|||||||
$delete_count = mysqli_affected_rows($mysqli);
|
$delete_count = mysqli_affected_rows($mysqli);
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Asset", "Delete", "$asset_name via API ($api_key_name)", $client_id);
|
logAudit("Asset", "Delete", "$asset_name via API ($api_key_name)", $client_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ if (!empty($asset_id)) {
|
|||||||
mysqli_query($mysqli,"INSERT INTO asset_history SET asset_history_status = '$status', asset_history_description = 'API updated $name ($api_key_name)', asset_history_asset_id = $asset_id");
|
mysqli_query($mysqli,"INSERT INTO asset_history SET asset_history_status = '$status', asset_history_description = 'API updated $name ($api_key_name)', asset_history_asset_id = $asset_id");
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Asset", "Edit", "$name via API ($api_key_name)", $client_id);
|
logAudit("Asset", "Edit", "$name via API ($api_key_name)", $client_id);
|
||||||
logAction("API", "Success", "Edited asset $name via API ($api_key_name)", $client_id);
|
logAudit("API", "Success", "Edited asset $name via API ($api_key_name)", $client_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,8 +49,8 @@ if (!empty($name) && !empty($domain) && !empty($client_id)) {
|
|||||||
$insert_id = mysqli_insert_id($mysqli);
|
$insert_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Certificate", "Create", "$name via API ($api_key_name)", $client_id, $insert_id);
|
logAudit("Certificate", "Create", "$name via API ($api_key_name)", $client_id, $insert_id);
|
||||||
logAction("API", "Success", "Created certificate $name via API ($api_key_name)", $client_id, $insert_id);
|
logAudit("API", "Success", "Created certificate $name via API ($api_key_name)", $client_id, $insert_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ if (!empty($client_id)) {
|
|||||||
$update_count = mysqli_affected_rows($mysqli);
|
$update_count = mysqli_affected_rows($mysqli);
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Contact", "Archive", "$client_name archived via API ($api_key_name)", $client_id);
|
logAudit("Contact", "Archive", "$client_name archived via API ($api_key_name)", $client_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ if (!empty($name) && $client_id == 0) {
|
|||||||
$insert_id = mysqli_insert_id($mysqli);
|
$insert_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Client", "Create", "$name via API ($api_key_name)", $insert_id);
|
logAudit("Client", "Create", "$name via API ($api_key_name)", $insert_id);
|
||||||
logAction("API", "Success", "Created client $name via API ($api_key_name)", $insert_id);
|
logAudit("API", "Success", "Created client $name via API ($api_key_name)", $insert_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ if (!empty($client_id)) {
|
|||||||
$update_count = mysqli_affected_rows($mysqli);
|
$update_count = mysqli_affected_rows($mysqli);
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Contact", "Unarchive", "$client_name unarchived via API ($api_key_name)", $client_id);
|
logAudit("Contact", "Unarchive", "$client_name unarchived via API ($api_key_name)", $client_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ if (!empty($client_id)) {
|
|||||||
$update_count = mysqli_affected_rows($mysqli);
|
$update_count = mysqli_affected_rows($mysqli);
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Client", "Edit", "$name via API ($api_key_name)", $client_id);
|
logAudit("Client", "Edit", "$name via API ($api_key_name)", $client_id);
|
||||||
logAction("API", "Success", "Edited client $name via API ($api_key_name)", $client_id);
|
logAudit("API", "Success", "Edited client $name via API ($api_key_name)", $client_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ if (!empty($contact_id)) {
|
|||||||
$update_count = mysqli_affected_rows($mysqli);
|
$update_count = mysqli_affected_rows($mysqli);
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Contact", "Archive", "$contact_name archived via API ($api_key_name)", $client_id, $contact_id);
|
logAudit("Contact", "Archive", "$contact_name archived via API ($api_key_name)", $client_id, $contact_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ if (!empty($name) && !empty($email) && !empty($client_id)) {
|
|||||||
$insert_id = mysqli_insert_id($mysqli);
|
$insert_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Contact", "Create", "$name via API ($api_key_name)", $client_id, $insert_id);
|
logAudit("Contact", "Create", "$name via API ($api_key_name)", $client_id, $insert_id);
|
||||||
logAction("API", "Success", "Created contact $name via API ($api_key_name)", $client_id);
|
logAudit("API", "Success", "Created contact $name via API ($api_key_name)", $client_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ if (!empty($contact_id)) {
|
|||||||
$delete_count = mysqli_affected_rows($mysqli);
|
$delete_count = mysqli_affected_rows($mysqli);
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Contact", "Delete", "$contact_name via API ($api_key_name)", $client_id);
|
logAudit("Contact", "Delete", "$contact_name via API ($api_key_name)", $client_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ if (!empty($contact_id)) {
|
|||||||
$update_count = mysqli_affected_rows($mysqli);
|
$update_count = mysqli_affected_rows($mysqli);
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Contact", "Unarchive", "$contact_name unarchived via API ($api_key_name)", $client_id, $contact_id);
|
logAudit("Contact", "Unarchive", "$contact_name unarchived via API ($api_key_name)", $client_id, $contact_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ if (!empty($contact_id)) {
|
|||||||
$update_count = mysqli_affected_rows($mysqli);
|
$update_count = mysqli_affected_rows($mysqli);
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Contact", "Edit", "$name via API ($api_key_name)", $client_id, $contact_id);
|
logAudit("Contact", "Edit", "$name via API ($api_key_name)", $client_id, $contact_id);
|
||||||
logAction("API", "Success", "Edited contact $name via API ($api_key_name)", $client_id);
|
logAudit("API", "Success", "Edited contact $name via API ($api_key_name)", $client_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ if (!empty($api_key_decrypt_password) && !empty($name) && !(empty($password))) {
|
|||||||
$insert_id = mysqli_insert_id($mysqli);
|
$insert_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Credential", "Create", "$name via API ($api_key_name)", $client_id, $insert_id);
|
logAudit("Credential", "Create", "$name via API ($api_key_name)", $client_id, $insert_id);
|
||||||
logAction("API", "Success", "Created credential $name via API ($api_key_name)", $client_id);
|
logAudit("API", "Success", "Created credential $name via API ($api_key_name)", $client_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ if (!empty($_POST['api_key_decrypt_password']) && !empty($credential_id)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Credential", "Edit", "$name via API ($api_key_name)", $client_id, $credential_id);
|
logAudit("Credential", "Edit", "$name via API ($api_key_name)", $client_id, $credential_id);
|
||||||
logAction("API", "Success", "Updated credential $name via API ($api_key_name)", $client_id);
|
logAudit("API", "Success", "Updated credential $name via API ($api_key_name)", $client_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ if (!empty($name) && !(empty($content))) {
|
|||||||
mysqli_query($mysqli,"UPDATE documents SET document_content = '$processed_content' WHERE document_id = $insert_id");
|
mysqli_query($mysqli,"UPDATE documents SET document_content = '$processed_content' WHERE document_id = $insert_id");
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Document", "Create", "$name via API ($api_key_name)", $client_id, $insert_id);
|
logAudit("Document", "Create", "$name via API ($api_key_name)", $client_id, $insert_id);
|
||||||
logAction("API", "Success", "Created document $name via API ($api_key_name)", $client_id);
|
logAudit("API", "Success", "Created document $name via API ($api_key_name)", $client_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,13 +118,13 @@ if (!empty($document_id)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Document", "Edit", "$name_db via API ($api_key_name), previous version kept", $client_id, $document_version_id);
|
logAudit("Document", "Edit", "$name_db via API ($api_key_name), previous version kept", $client_id, $document_version_id);
|
||||||
logAction("API", "Success", "Edited document $name_db via API ($api_key_name)", $client_id);
|
logAudit("API", "Success", "Edited document $name_db via API ($api_key_name)", $client_id);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Not found (or not this client's doc)
|
// Not found (or not this client's doc)
|
||||||
$update_count = false;
|
$update_count = false;
|
||||||
logAction("API", "Error", "Document update failed (not found or unauthorized) via API ($api_key_name)", $client_id);
|
logAudit("API", "Error", "Document update failed (not found or unauthorized) via API ($api_key_name)", $client_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ if (!empty($name) && !empty($client_id)) {
|
|||||||
$insert_id = mysqli_insert_id($mysqli);
|
$insert_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Location", "Create", "$name via API ($api_key_name)", $client_id, $insert_id);
|
logAudit("Location", "Create", "$name via API ($api_key_name)", $client_id, $insert_id);
|
||||||
logAction("API", "Success", "Created location $name via API ($api_key_name)", $client_id);
|
logAudit("API", "Success", "Created location $name via API ($api_key_name)", $client_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,8 +52,8 @@ if (!empty($subject)) {
|
|||||||
$insert_id = mysqli_insert_id($mysqli);
|
$insert_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Ticket", "Create", "Created ticket $config_ticket_prefix$ticket_number $subject via API ($api_key_name)", $client_id, $insert_id);
|
logAudit("Ticket", "Create", "Created ticket $config_ticket_prefix$ticket_number $subject via API ($api_key_name)", $client_id, $insert_id);
|
||||||
logAction("API", "Success", "Created ticket $config_ticket_prefix$ticket_number $subject via API ($api_key_name)", $client_id);
|
logAudit("API", "Success", "Created ticket $config_ticket_prefix$ticket_number $subject via API ($api_key_name)", $client_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ if (!empty($ticket_id)) {
|
|||||||
$update_count = mysqli_affected_rows($mysqli);
|
$update_count = mysqli_affected_rows($mysqli);
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Ticket", "Resolved", "$ticket_prefix$ticket_number ticket via API ($api_key_name)", $client_id, $ticket_id);
|
logAudit("Ticket", "Resolved", "$ticket_prefix$ticket_number ticket via API ($api_key_name)", $client_id, $ticket_id);
|
||||||
logAction("API", "Success", "Resolved ticket $ticket_prefix$ticket_number via API ($api_key_name)", $client_id);
|
logAudit("API", "Success", "Resolved ticket $ticket_prefix$ticket_number via API ($api_key_name)", $client_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
customAction('ticket_resolve', $ticket_id);
|
customAction('ticket_resolve', $ticket_id);
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ if (isset($_POST['code']) && $_POST['state'] == session_id()) {
|
|||||||
$_SESSION['login_method'] = "azure";
|
$_SESSION['login_method'] = "azure";
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Client Login", "Success", "Client contact $upn successfully logged in via Entra", $client_id, $user_id);
|
logAudit("Client Login", "Success", "Client contact $upn successfully logged in via Entra", $client_id, $user_id);
|
||||||
|
|
||||||
header("Location: index.php");
|
header("Location: index.php");
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ if (isset($_POST['add_ticket'])) {
|
|||||||
// Custom action/notif handler
|
// Custom action/notif handler
|
||||||
customAction('ticket_create', $ticket_id);
|
customAction('ticket_create', $ticket_id);
|
||||||
|
|
||||||
logAction("Ticket", "Create", "$session_contact_name created ticket $config_ticket_prefix$ticket_number - $subject from the client portal", $session_client_id, $ticket_id);
|
logAudit("Ticket", "Create", "$session_contact_name created ticket $config_ticket_prefix$ticket_number - $subject from the client portal", $session_client_id, $ticket_id);
|
||||||
|
|
||||||
redirect("ticket.php?id=" . $ticket_id);
|
redirect("ticket.php?id=" . $ticket_id);
|
||||||
|
|
||||||
@@ -221,7 +221,7 @@ if (isset($_GET['approve_ticket_task'])) {
|
|||||||
// TODO: Email agent
|
// TODO: Email agent
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Task", "Edit", "Contact $session_contact_email approved task $task_name (approval $approval_id)", $session_client_id, $task_id);
|
logAudit("Task", "Edit", "Contact $session_contact_email approved task $task_name (approval $approval_id)", $session_client_id, $task_id);
|
||||||
|
|
||||||
flash_alert("Task Approved");
|
flash_alert("Task Approved");
|
||||||
redirect();
|
redirect();
|
||||||
@@ -281,7 +281,7 @@ if (isset($_GET['resolve_ticket'])) {
|
|||||||
// Add reply
|
// Add reply
|
||||||
mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = 'Ticket resolved by $session_contact_name.', ticket_reply_type = 'Client', ticket_reply_by = $session_contact_id, ticket_reply_ticket_id = $ticket_id");
|
mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = 'Ticket resolved by $session_contact_name.', ticket_reply_type = 'Client', ticket_reply_by = $session_contact_id, ticket_reply_ticket_id = $ticket_id");
|
||||||
|
|
||||||
logAction("Ticket", "Edit", "$session_contact_name marked ticket $ticket_prefix$ticket_number as resolved in the client portal", $session_client_id, $ticket_id);
|
logAudit("Ticket", "Edit", "$session_contact_name marked ticket $ticket_prefix$ticket_number as resolved in the client portal", $session_client_id, $ticket_id);
|
||||||
|
|
||||||
// Custom action/notif handler
|
// Custom action/notif handler
|
||||||
customAction('ticket_resolve', $ticket_id);
|
customAction('ticket_resolve', $ticket_id);
|
||||||
@@ -316,7 +316,7 @@ if (isset($_GET['reopen_ticket'])) {
|
|||||||
// Add reply
|
// Add reply
|
||||||
mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = 'Ticket reopened by $session_contact_name.', ticket_reply_type = 'Client', ticket_reply_by = $session_contact_id, ticket_reply_ticket_id = $ticket_id");
|
mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = 'Ticket reopened by $session_contact_name.', ticket_reply_type = 'Client', ticket_reply_by = $session_contact_id, ticket_reply_ticket_id = $ticket_id");
|
||||||
|
|
||||||
logAction("Ticket", "Edit", "$session_contact_name reopend ticket $ticket_prefix$ticket_number in the client portal", $session_client_id, $ticket_id);
|
logAudit("Ticket", "Edit", "$session_contact_name reopend ticket $ticket_prefix$ticket_number in the client portal", $session_client_id, $ticket_id);
|
||||||
|
|
||||||
// Custom action/notif handler
|
// Custom action/notif handler
|
||||||
customAction('ticket_update', $ticket_id);
|
customAction('ticket_update', $ticket_id);
|
||||||
@@ -351,7 +351,7 @@ if (isset($_GET['close_ticket'])) {
|
|||||||
// Add reply
|
// Add reply
|
||||||
mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = 'Ticket closed by $session_contact_name.', ticket_reply_type = 'Client', ticket_reply_by = $session_contact_id, ticket_reply_ticket_id = $ticket_id");
|
mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = 'Ticket closed by $session_contact_name.', ticket_reply_type = 'Client', ticket_reply_by = $session_contact_id, ticket_reply_ticket_id = $ticket_id");
|
||||||
|
|
||||||
logAction("Ticket", "Edit", "$session_contact_name closed ticket $ticket_prefix$ticket_number in the client portal", $session_client_id, $ticket_id);
|
logAudit("Ticket", "Edit", "$session_contact_name closed ticket $ticket_prefix$ticket_number in the client portal", $session_client_id, $ticket_id);
|
||||||
|
|
||||||
// Custom action/notif handler
|
// Custom action/notif handler
|
||||||
customAction('ticket_close', $ticket_id);
|
customAction('ticket_close', $ticket_id);
|
||||||
@@ -387,7 +387,7 @@ if (isset($_POST['edit_profile'])) {
|
|||||||
mysqli_query($mysqli, "UPDATE users SET user_password = '$password_hash' WHERE user_id = $session_user_id");
|
mysqli_query($mysqli, "UPDATE users SET user_password = '$password_hash' WHERE user_id = $session_user_id");
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Contact", "Edit", "Client contact $session_contact_name edited their profile/password in the client portal", $session_client_id, $session_contact_id);
|
logAudit("Contact", "Edit", "Client contact $session_contact_name edited their profile/password in the client portal", $session_client_id, $session_contact_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
redirect('index.php');
|
redirect('index.php');
|
||||||
@@ -433,7 +433,7 @@ if (isset($_POST['add_contact'])) {
|
|||||||
$contact_id = mysqli_insert_id($mysqli);
|
$contact_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Contact", "Create", "Client contact $session_contact_name created contact $contact_name in the client portal", $session_client_id, $contact_id);
|
logAudit("Contact", "Create", "Client contact $session_contact_name created contact $contact_name in the client portal", $session_client_id, $contact_id);
|
||||||
|
|
||||||
customAction('contact_create', $contact_id);
|
customAction('contact_create', $contact_id);
|
||||||
|
|
||||||
@@ -485,7 +485,7 @@ if (isset($_POST['edit_contact'])) {
|
|||||||
// Update contact
|
// Update contact
|
||||||
mysqli_query($mysqli, "UPDATE contacts SET contact_name = '$contact_name', contact_email = '$contact_email', contact_billing = $contact_billing, contact_technical = $contact_technical, contact_user_id = $contact_user_id WHERE contact_id = $contact_id AND contact_client_id = $session_client_id AND contact_archived_at IS NULL AND contact_primary = 0");
|
mysqli_query($mysqli, "UPDATE contacts SET contact_name = '$contact_name', contact_email = '$contact_email', contact_billing = $contact_billing, contact_technical = $contact_technical, contact_user_id = $contact_user_id WHERE contact_id = $contact_id AND contact_client_id = $session_client_id AND contact_archived_at IS NULL AND contact_primary = 0");
|
||||||
|
|
||||||
logAction("Contact", "Edit", "Client contact $session_contact_name edited contact $contact_name in the client portal", $session_client_id, $contact_id);
|
logAudit("Contact", "Edit", "Client contact $session_contact_name edited contact $contact_name in the client portal", $session_client_id, $contact_id);
|
||||||
|
|
||||||
flash_alert("Contact $contact_name updated");
|
flash_alert("Contact $contact_name updated");
|
||||||
|
|
||||||
@@ -660,7 +660,7 @@ if (isset($_GET['add_payment_by_provider'])) {
|
|||||||
// Email Logging
|
// Email Logging
|
||||||
$email_id = mysqli_insert_id($mysqli);
|
$email_id = mysqli_insert_id($mysqli);
|
||||||
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Sent', history_description = 'Payment Receipt sent to mail queue ID: $email_id!', history_invoice_id = $invoice_id");
|
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Sent', history_description = 'Payment Receipt sent to mail queue ID: $email_id!', history_invoice_id = $invoice_id");
|
||||||
logAction("Invoice", "Payment", "Payment receipt for invoice $invoice_prefix$invoice_number queued to $contact_email Email ID: $email_id", $client_id, $invoice_id);
|
logAudit("Invoice", "Payment", "Payment receipt for invoice $invoice_prefix$invoice_number queued to $contact_email Email ID: $email_id", $client_id, $invoice_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Log info
|
// Log info
|
||||||
@@ -677,7 +677,7 @@ if (isset($_GET['add_payment_by_provider'])) {
|
|||||||
|
|
||||||
// Notify/log
|
// Notify/log
|
||||||
appNotify("Invoice Paid", "Invoice $invoice_prefix$invoice_number automatically paid", "/agent/invoice.php?invoice_id=$invoice_id", $client_id);
|
appNotify("Invoice Paid", "Invoice $invoice_prefix$invoice_number automatically paid", "/agent/invoice.php?invoice_id=$invoice_id", $client_id);
|
||||||
logAction("Invoice", "Payment", "$session_name initiated Stripe payment amount of " . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . " added to invoice $invoice_prefix$invoice_number - $pi_id $extended_log_desc", $client_id, $invoice_id);
|
logAudit("Invoice", "Payment", "$session_name initiated Stripe payment amount of " . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . " added to invoice $invoice_prefix$invoice_number - $pi_id $extended_log_desc", $client_id, $invoice_id);
|
||||||
customAction('invoice_pay', $invoice_id);
|
customAction('invoice_pay', $invoice_id);
|
||||||
|
|
||||||
flash_alert("The amount " . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . " paid Invoice $invoice_prefix$invoice_number");
|
flash_alert("The amount " . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . " paid Invoice $invoice_prefix$invoice_number");
|
||||||
@@ -687,7 +687,7 @@ if (isset($_GET['add_payment_by_provider'])) {
|
|||||||
} else {
|
} else {
|
||||||
mysqli_query($mysqli, "INSERT INTO history SET history_status = 'Payment failed', history_description = 'Stripe pay failed due to payment error', history_invoice_id = $invoice_id");
|
mysqli_query($mysqli, "INSERT INTO history SET history_status = 'Payment failed', history_description = 'Stripe pay failed due to payment error', history_invoice_id = $invoice_id");
|
||||||
|
|
||||||
logAction("Invoice", "Payment", "Failed online payment amount of invoice $invoice_prefix$invoice_number due to Stripe payment error", $client_id, $invoice_id);
|
logAudit("Invoice", "Payment", "Failed online payment amount of invoice $invoice_prefix$invoice_number due to Stripe payment error", $client_id, $invoice_id);
|
||||||
flash_alert("Payment failed", 'error');
|
flash_alert("Payment failed", 'error');
|
||||||
|
|
||||||
redirect();
|
redirect();
|
||||||
@@ -761,7 +761,7 @@ if (isset($_POST['create_stripe_customer'])) {
|
|||||||
client_payment_provider_created_at = NOW()
|
client_payment_provider_created_at = NOW()
|
||||||
");
|
");
|
||||||
|
|
||||||
logAction("Stripe", "Create", "$session_contact_name created Stripe customer for $session_client_name as $stripe_customer_id and authorized future automatic payments", $session_client_id, $session_client_id);
|
logAudit("Stripe", "Create", "$session_contact_name created Stripe customer for $session_client_name as $stripe_customer_id and authorized future automatic payments", $session_client_id, $session_client_id);
|
||||||
|
|
||||||
flash_alert("Stripe customer created. Thank you for your consent.");
|
flash_alert("Stripe customer created. Thank you for your consent.");
|
||||||
|
|
||||||
@@ -980,7 +980,7 @@ if (isset($_GET['stripe_save_card'])) {
|
|||||||
$mail = addToMailQueue($data);
|
$mail = addToMailQueue($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Stripe", "Update", "$session_contact_name saved payment method ($saved_payment_description) (PM: $payment_method_id)", $session_client_id);
|
logAudit("Stripe", "Update", "$session_contact_name saved payment method ($saved_payment_description) (PM: $payment_method_id)", $session_client_id);
|
||||||
|
|
||||||
flash_alert("Payment method saved – thank you.");
|
flash_alert("Payment method saved – thank you.");
|
||||||
redirect("saved_payment_methods.php");
|
redirect("saved_payment_methods.php");
|
||||||
@@ -1083,7 +1083,7 @@ if (isset($_GET['delete_saved_payment'])) {
|
|||||||
");
|
");
|
||||||
}
|
}
|
||||||
|
|
||||||
logAction("Stripe", "Update", "$session_contact_name deleted Stripe payment method $saved_payment_description (PM: $payment_method_id)", $session_client_id);
|
logAudit("Stripe", "Update", "$session_contact_name deleted Stripe payment method $saved_payment_description (PM: $payment_method_id)", $session_client_id);
|
||||||
|
|
||||||
flash_alert("Payment method $saved_payment_description removed.");
|
flash_alert("Payment method $saved_payment_description removed.");
|
||||||
|
|
||||||
@@ -1128,14 +1128,14 @@ if (isset($_POST['set_recurring_payment'])) {
|
|||||||
// Get Payment ID for reference
|
// Get Payment ID for reference
|
||||||
$recurring_payment_id = mysqli_insert_id($mysqli);
|
$recurring_payment_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Recurring Invoice", "Auto Payment", "$session_name created Auto Pay for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number in the amount of " . numfmt_format_currency($currency_format, $recurring_invoice_amount, $recurring_invoice_currency_code), $session_client_id, $recurring_invoice_id);
|
logAudit("Recurring Invoice", "Auto Payment", "$session_name created Auto Pay for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number in the amount of " . numfmt_format_currency($currency_format, $recurring_invoice_amount, $recurring_invoice_currency_code), $session_client_id, $recurring_invoice_id);
|
||||||
|
|
||||||
flash_alert("Automatic Payment $saved_payment_description enabled for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number");
|
flash_alert("Automatic Payment $saved_payment_description enabled for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number");
|
||||||
} else {
|
} else {
|
||||||
// Delete
|
// Delete
|
||||||
mysqli_query($mysqli, "DELETE FROM recurring_payments WHERE recurring_payment_recurring_invoice_id = $recurring_invoice_id");
|
mysqli_query($mysqli, "DELETE FROM recurring_payments WHERE recurring_payment_recurring_invoice_id = $recurring_invoice_id");
|
||||||
|
|
||||||
logAction("Recurring Invoice", "Auto Payment", "$session_name removed Auto Pay for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number in the amount of " . numfmt_format_currency($currency_format, $recurring_invoice_amount, $recurring_invoice_currency_code), $session_client_id, $recurring_invoice_id);
|
logAudit("Recurring Invoice", "Auto Payment", "$session_name removed Auto Pay for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number in the amount of " . numfmt_format_currency($currency_format, $recurring_invoice_amount, $recurring_invoice_currency_code), $session_client_id, $recurring_invoice_id);
|
||||||
|
|
||||||
flash_alert("Automatic Payment Disabled for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number");
|
flash_alert("Automatic Payment Disabled for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number");
|
||||||
}
|
}
|
||||||
@@ -1182,7 +1182,7 @@ if (isset($_POST['client_add_document'])) {
|
|||||||
// Document update content
|
// Document update content
|
||||||
mysqli_query($mysqli,"UPDATE documents SET document_content = '$processed_content' WHERE document_id = $document_id");
|
mysqli_query($mysqli,"UPDATE documents SET document_content = '$processed_content' WHERE document_id = $document_id");
|
||||||
|
|
||||||
logAction("Document", "Create", "Client contact $session_contact_name created document $document_name", $session_client_id, $document_id);
|
logAudit("Document", "Create", "Client contact $session_contact_name created document $document_name", $session_client_id, $document_id);
|
||||||
|
|
||||||
flash_alert("Document <strong>$document_name</strong> created successfully");
|
flash_alert("Document <strong>$document_name</strong> created successfully");
|
||||||
|
|
||||||
@@ -1260,7 +1260,7 @@ if (isset($_POST['client_upload_document'])) {
|
|||||||
// Link file to document
|
// Link file to document
|
||||||
mysqli_query($mysqli, "INSERT INTO document_files SET document_id = $document_id, file_id = $file_id");
|
mysqli_query($mysqli, "INSERT INTO document_files SET document_id = $document_id, file_id = $file_id");
|
||||||
|
|
||||||
logAction("Document", "Upload", "Client contact $session_contact_name uploaded document $document_name with file $file_name", $session_client_id, $document_id);
|
logAudit("Document", "Upload", "Client contact $session_contact_name uploaded document $document_name with file $file_name", $session_client_id, $document_id);
|
||||||
|
|
||||||
flash_alert("Document <strong>$document_name</strong> uploaded successfully");
|
flash_alert("Document <strong>$document_name</strong> uploaded successfully");
|
||||||
|
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ while ($row = mysqli_fetch_assoc($sql)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
// logAction("Cron", "Task", "Cron cleaned up old data");
|
// logAudit("Cron", "Task", "Cron cleaned up old data");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ###############################################################################################################
|
* ###############################################################################################################
|
||||||
@@ -197,7 +197,7 @@ if ($config_enable_alert_domain_expire == 1) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
// Logging
|
// Logging
|
||||||
// logAction("Cron", "Task", "Cron created notifications for domains expiring");
|
// logAudit("Cron", "Task", "Cron created notifications for domains expiring");
|
||||||
}
|
}
|
||||||
|
|
||||||
// CERTIFICATES EXPIRING
|
// CERTIFICATES EXPIRING
|
||||||
@@ -248,7 +248,7 @@ foreach ($certificateAlertArray as $day) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
// Logging
|
// Logging
|
||||||
// logAction("Cron", "Task", "Cron created notifications for certificates expiring");
|
// logAudit("Cron", "Task", "Cron created notifications for certificates expiring");
|
||||||
|
|
||||||
// Asset Warranties Expiring
|
// Asset Warranties Expiring
|
||||||
|
|
||||||
@@ -277,7 +277,7 @@ foreach ($warranty_alert_array as $day) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
// Logging
|
// Logging
|
||||||
// logAction("Cron", "Task", "Cron created notifications for asset warranties expiring");
|
// logAudit("Cron", "Task", "Cron created notifications for asset warranties expiring");
|
||||||
|
|
||||||
// Notify of New Tickets
|
// Notify of New Tickets
|
||||||
// Get Ticket Pending Assignment
|
// Get Ticket Pending Assignment
|
||||||
@@ -347,7 +347,7 @@ if (mysqli_num_rows($sql_recurring_tickets) > 0) {
|
|||||||
WHERE recurring_ticket_id = $recurring_ticket_id");
|
WHERE recurring_ticket_id = $recurring_ticket_id");
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Ticket", "Create", "Cron created recurring scheduled $frequency ticket - $subject", $client_id, $id);
|
logAudit("Ticket", "Create", "Cron created recurring scheduled $frequency ticket - $subject", $client_id, $id);
|
||||||
|
|
||||||
customAction('ticket_create', $id);
|
customAction('ticket_create', $id);
|
||||||
|
|
||||||
@@ -455,7 +455,7 @@ while ($row = mysqli_fetch_assoc($sql_invalid_recurring_tickets)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
// logAction("Cron", "Task", "Cron created sent out recurring tickets");
|
// logAudit("Cron", "Task", "Cron created sent out recurring tickets");
|
||||||
|
|
||||||
|
|
||||||
// TICKET RESOLUTION/CLOSURE PROCESS
|
// TICKET RESOLUTION/CLOSURE PROCESS
|
||||||
@@ -481,7 +481,7 @@ while ($row = mysqli_fetch_assoc($sql_resolved_tickets_to_close)) {
|
|||||||
mysqli_query($mysqli,"UPDATE tickets SET ticket_status = 5, ticket_closed_at = NOW(), ticket_closed_by = $ticket_assigned_to WHERE ticket_id = $ticket_id");
|
mysqli_query($mysqli,"UPDATE tickets SET ticket_status = 5, ticket_closed_at = NOW(), ticket_closed_by = $ticket_assigned_to WHERE ticket_id = $ticket_id");
|
||||||
|
|
||||||
//Logging
|
//Logging
|
||||||
logAction("Ticket", "Closed", "$ticket_prefix$ticket_number auto closed", $client_id, $ticket_id);
|
logAudit("Ticket", "Closed", "$ticket_prefix$ticket_number auto closed", $client_id, $ticket_id);
|
||||||
|
|
||||||
customAction('ticket_close', $ticket_id);
|
customAction('ticket_close', $ticket_id);
|
||||||
|
|
||||||
@@ -596,7 +596,7 @@ if ($config_send_invoice_reminders == 1) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Logging
|
// Logging
|
||||||
// logAction("Cron", "Task", "Cron created notifications for past due invoices and sent out notifications to the primary and billing contacts email");
|
// logAudit("Cron", "Task", "Cron created notifications for past due invoices and sent out notifications to the primary and billing contacts email");
|
||||||
|
|
||||||
// Send Recurring Invoices that match todays date and are active
|
// Send Recurring Invoices that match todays date and are active
|
||||||
|
|
||||||
@@ -810,7 +810,7 @@ while ($row = mysqli_fetch_assoc($sql_recurring_payments)) {
|
|||||||
"));
|
"));
|
||||||
|
|
||||||
if (!$saved_payment) {
|
if (!$saved_payment) {
|
||||||
logAction("Invoice", "Payment", "Failed auto Payment for invoice $invoice_prefix$invoice_number: Saved payment method not found or provider inactive", $client_id, $invoice_id);
|
logAudit("Invoice", "Payment", "Failed auto Payment for invoice $invoice_prefix$invoice_number: Saved payment method not found or provider inactive", $client_id, $invoice_id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -872,7 +872,7 @@ while ($row = mysqli_fetch_assoc($sql_recurring_payments)) {
|
|||||||
error_log("Stripe payment error - encountered exception during payment intent for invoice ID $invoice_id / $invoice_prefix$invoice_number: $error");
|
error_log("Stripe payment error - encountered exception during payment intent for invoice ID $invoice_id / $invoice_prefix$invoice_number: $error");
|
||||||
logApp("Stripe", "error", "Exception during PI for invoice ID $invoice_id: $error");
|
logApp("Stripe", "error", "Exception during PI for invoice ID $invoice_id: $error");
|
||||||
mysqli_query($mysqli, "INSERT INTO history SET history_status = 'Payment failed', history_description = 'Stripe autopay failed due to payment error', history_invoice_id = $invoice_id");
|
mysqli_query($mysqli, "INSERT INTO history SET history_status = 'Payment failed', history_description = 'Stripe autopay failed due to payment error', history_invoice_id = $invoice_id");
|
||||||
logAction("Invoice", "Payment", "Failed auto Payment amount of invoice $invoice_prefix$invoice_number due to Stripe payment error: $error", $client_id, $invoice_id);
|
logAudit("Invoice", "Payment", "Failed auto Payment amount of invoice $invoice_prefix$invoice_number due to Stripe payment error: $error", $client_id, $invoice_id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -921,18 +921,18 @@ while ($row = mysqli_fetch_assoc($sql_recurring_payments)) {
|
|||||||
$mail = addToMailQueue($data);
|
$mail = addToMailQueue($data);
|
||||||
$email_id = mysqli_insert_id($mysqli);
|
$email_id = mysqli_insert_id($mysqli);
|
||||||
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Sent', history_description = 'Payment Receipt sent to mail queue ID: $email_id!', history_invoice_id = $invoice_id");
|
mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Sent', history_description = 'Payment Receipt sent to mail queue ID: $email_id!', history_invoice_id = $invoice_id");
|
||||||
logAction("Invoice", "Payment", "Payment receipt for invoice $invoice_prefix$invoice_number queued to $contact_email Email ID: $email_id", $client_id, $invoice_id);
|
logAudit("Invoice", "Payment", "Payment receipt for invoice $invoice_prefix$invoice_number queued to $contact_email Email ID: $email_id", $client_id, $invoice_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
// LOGGING
|
// LOGGING
|
||||||
$extended_log_desc = !$pi_livemode ? '(DEV MODE)' : '';
|
$extended_log_desc = !$pi_livemode ? '(DEV MODE)' : '';
|
||||||
appNotify("Invoice Paid", "Invoice $invoice_prefix$invoice_number automatically paid", "/agent/invoice.php?invoice_id=$invoice_id", $client_id);
|
appNotify("Invoice Paid", "Invoice $invoice_prefix$invoice_number automatically paid", "/agent/invoice.php?invoice_id=$invoice_id", $client_id);
|
||||||
logAction("Invoice", "Payment", "Auto Stripe payment amount of " . numfmt_format_currency($currency_format, $invoice_amount, $recurring_payment_currency_code) . " added to invoice $invoice_prefix$invoice_number - $pi_id $extended_log_desc", $client_id, $invoice_id);
|
logAudit("Invoice", "Payment", "Auto Stripe payment amount of " . numfmt_format_currency($currency_format, $invoice_amount, $recurring_payment_currency_code) . " added to invoice $invoice_prefix$invoice_number - $pi_id $extended_log_desc", $client_id, $invoice_id);
|
||||||
customAction('invoice_pay', $invoice_id);
|
customAction('invoice_pay', $invoice_id);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
mysqli_query($mysqli, "INSERT INTO history SET history_status = 'Payment failed', history_description = 'Stripe autopay failed: Status {$payment_intent->status}', history_invoice_id = $invoice_id");
|
mysqli_query($mysqli, "INSERT INTO history SET history_status = 'Payment failed', history_description = 'Stripe autopay failed: Status {$payment_intent->status}', history_invoice_id = $invoice_id");
|
||||||
logAction("Invoice", "Payment", "Failed auto Payment for invoice $invoice_prefix$invoice_number. Stripe PI status: {$payment_intent->status}", $client_id, $invoice_id);
|
logAudit("Invoice", "Payment", "Failed auto Payment for invoice $invoice_prefix$invoice_number. Stripe PI status: {$payment_intent->status}", $client_id, $invoice_id);
|
||||||
}
|
}
|
||||||
} // End if Stripe creds and IDs
|
} // End if Stripe creds and IDs
|
||||||
} // End if Stripe provider
|
} // End if Stripe provider
|
||||||
@@ -944,7 +944,7 @@ while ($row = mysqli_fetch_assoc($sql_recurring_payments)) {
|
|||||||
|
|
||||||
mysqli_query($mysqli, "UPDATE invoices SET invoice_status = 'Paid' WHERE invoice_id = $invoice_id");
|
mysqli_query($mysqli, "UPDATE invoices SET invoice_status = 'Paid' WHERE invoice_id = $invoice_id");
|
||||||
mysqli_query($mysqli, "INSERT INTO history SET history_status = 'Paid', history_description = 'Payment added via Auto Pay', history_invoice_id = $invoice_id");
|
mysqli_query($mysqli, "INSERT INTO history SET history_status = 'Paid', history_description = 'Payment added via Auto Pay', history_invoice_id = $invoice_id");
|
||||||
logAction("Invoice", "Payment", "Auto Payment amount of $recurring_payment_currency_code $invoice_amount added to invoice $invoice_prefix$invoice_number", $client_id, $invoice_id);
|
logAudit("Invoice", "Payment", "Auto Payment amount of $recurring_payment_currency_code $invoice_amount added to invoice $invoice_prefix$invoice_number", $client_id, $invoice_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1245,7 +1245,7 @@ if ($config_telemetry > 0 || $config_telemetry == 2) {
|
|||||||
$result = file_get_contents('https://telemetry.itflow.org', false, $context);
|
$result = file_get_contents('https://telemetry.itflow.org', false, $context);
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
// logAction("Cron", "Task", "Cron sent telemetry results to ITFlow Developers");
|
// logAudit("Cron", "Task", "Cron sent telemetry results to ITFlow Developers");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ function addTicket($contact_id, $contact_name, $contact_email, $client_id, $date
|
|||||||
$id = mysqli_insert_id($mysqli);
|
$id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
logAction("Ticket", "Create", "Email parser: Client contact $contact_email_esc created ticket $ticket_prefix_esc$ticket_number ($subject) ($id)", $client_id, $id);
|
logAudit("Ticket", "Create", "Email parser: Client contact $contact_email_esc created ticket $ticket_prefix_esc$ticket_number ($subject) ($id)", $client_id, $id);
|
||||||
|
|
||||||
mkdirMissing('../uploads/tickets/');
|
mkdirMissing('../uploads/tickets/');
|
||||||
$att_dir = "../uploads/tickets/" . $id . "/";
|
$att_dir = "../uploads/tickets/" . $id . "/";
|
||||||
@@ -151,7 +151,7 @@ function addTicket($contact_id, $contact_name, $contact_email, $client_id, $date
|
|||||||
mysqli_query($mysqli, "INSERT INTO ticket_attachments SET ticket_attachment_name = '$ticket_attachment_name_esc', ticket_attachment_reference_name = '$ticket_attachment_reference_name_esc', ticket_attachment_ticket_id = $id");
|
mysqli_query($mysqli, "INSERT INTO ticket_attachments SET ticket_attachment_name = '$ticket_attachment_name_esc', ticket_attachment_reference_name = '$ticket_attachment_reference_name_esc', ticket_attachment_ticket_id = $id");
|
||||||
} else {
|
} else {
|
||||||
$ticket_attachment_name_esc = mysqli_real_escape_string($mysqli, $att_name);
|
$ticket_attachment_name_esc = mysqli_real_escape_string($mysqli, $att_name);
|
||||||
logAction("Ticket", "Edit", "Email parser: Blocked attachment $ticket_attachment_name_esc from Client contact $contact_email_esc for ticket $ticket_prefix_esc$ticket_number", $client_id, $id);
|
logAudit("Ticket", "Edit", "Email parser: Blocked attachment $ticket_attachment_name_esc from Client contact $contact_email_esc for ticket $ticket_prefix_esc$ticket_number", $client_id, $id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -332,7 +332,7 @@ function addReply($from_email, $date, $subject, $ticket_number, $message, $attac
|
|||||||
mysqli_query($mysqli, "INSERT INTO ticket_attachments SET ticket_attachment_name = '$ticket_attachment_name_esc', ticket_attachment_reference_name = '$ticket_attachment_reference_name_esc', ticket_attachment_reply_id = $reply_id, ticket_attachment_ticket_id = $ticket_id");
|
mysqli_query($mysqli, "INSERT INTO ticket_attachments SET ticket_attachment_name = '$ticket_attachment_name_esc', ticket_attachment_reference_name = '$ticket_attachment_reference_name_esc', ticket_attachment_reply_id = $reply_id, ticket_attachment_ticket_id = $ticket_id");
|
||||||
} else {
|
} else {
|
||||||
$ticket_attachment_name_esc = mysqli_real_escape_string($mysqli, $att_name);
|
$ticket_attachment_name_esc = mysqli_real_escape_string($mysqli, $att_name);
|
||||||
logAction("Ticket", "Edit", "Email parser: Blocked attachment $ticket_attachment_name_esc from Client contact $from_email_esc for ticket $config_ticket_prefix$ticket_number_esc", $client_id, $ticket_id);
|
logAudit("Ticket", "Edit", "Email parser: Blocked attachment $ticket_attachment_name_esc from Client contact $from_email_esc for ticket $config_ticket_prefix$ticket_number_esc", $client_id, $ticket_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -366,7 +366,7 @@ function addReply($from_email, $date, $subject, $ticket_number, $message, $attac
|
|||||||
|
|
||||||
mysqli_query($mysqli, "UPDATE tickets SET ticket_status = 2, ticket_resolved_at = NULL WHERE ticket_id = $ticket_id AND ticket_client_id = $client_id LIMIT 1");
|
mysqli_query($mysqli, "UPDATE tickets SET ticket_status = 2, ticket_resolved_at = NULL WHERE ticket_id = $ticket_id AND ticket_client_id = $client_id LIMIT 1");
|
||||||
|
|
||||||
logAction("Ticket", "Edit", "Email parser: Client contact $from_email_esc updated ticket $config_ticket_prefix$ticket_number_esc ($subject)", $client_id, $ticket_id);
|
logAudit("Ticket", "Edit", "Email parser: Client contact $from_email_esc updated ticket $config_ticket_prefix$ticket_number_esc ($subject)", $client_id, $ticket_id);
|
||||||
customAction('ticket_reply_client', $ticket_id);
|
customAction('ticket_reply_client', $ticket_id);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
@@ -855,7 +855,7 @@ foreach ($messages as $message) {
|
|||||||
mysqli_query($mysqli, "INSERT INTO contacts SET contact_name = '".mysqli_real_escape_string($mysqli, $contact_name)."', contact_email = '".mysqli_real_escape_string($mysqli, $contact_email)."', contact_notes = 'Added automatically via email parsing.', contact_client_id = $client_id");
|
mysqli_query($mysqli, "INSERT INTO contacts SET contact_name = '".mysqli_real_escape_string($mysqli, $contact_name)."', contact_email = '".mysqli_real_escape_string($mysqli, $contact_email)."', contact_notes = 'Added automatically via email parsing.', contact_client_id = $client_id");
|
||||||
$contact_id = mysqli_insert_id($mysqli);
|
$contact_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
logAction("Contact", "Create", "Email parser: created contact " . mysqli_real_escape_string($mysqli, $contact_name), $client_id, $contact_id);
|
logAudit("Contact", "Create", "Email parser: created contact " . mysqli_real_escape_string($mysqli, $contact_name), $client_id, $contact_id);
|
||||||
customAction('contact_create', $contact_id);
|
customAction('contact_create', $contact_id);
|
||||||
|
|
||||||
$email_processed = addTicket($contact_id, $contact_name, $contact_email, $client_id, $date, $subject, $message_body, $attachments, $original_message_file, $ccs);
|
$email_processed = addTicket($contact_id, $contact_name, $contact_email, $client_id, $date, $subject, $message_body, $attachments, $original_message_file, $ccs);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user