diff --git a/admin/oauth_microsoft_mail_callback.php b/admin/oauth_microsoft_mail_callback.php index 77e0f44d..691f8e7d 100644 --- a/admin/oauth_microsoft_mail_callback.php +++ b/admin/oauth_microsoft_mail_callback.php @@ -7,7 +7,7 @@ require_once "../includes/check_login.php"; $settings_mail_path = '/admin/settings_mail.php'; if (!isset($session_is_admin) || !$session_is_admin) { - flash_alert("Admin access required.", 'error'); + flashAlert("Admin access required.", 'error'); redirect($settings_mail_path); } @@ -27,17 +27,17 @@ if (!empty($error)) { $msg .= " ($error_description)"; } - flash_alert($msg, 'error'); + flashAlert($msg, 'error'); redirect($settings_mail_path); } if (empty($state) || empty($code) || empty($session_state) || !hash_equals($session_state, $state) || time() > $session_state_expires) { - flash_alert("Microsoft OAuth callback validation failed. Please try connecting again.", 'error'); + flashAlert("Microsoft OAuth callback validation failed. Please try connecting again.", 'error'); redirect($settings_mail_path); } if (empty($config_mail_oauth_client_id) || empty($config_mail_oauth_client_secret) || empty($config_mail_oauth_tenant_id)) { - flash_alert("Microsoft OAuth settings are incomplete. Please fill Client ID, Client Secret, and Tenant ID.", 'error'); + flashAlert("Microsoft OAuth settings are incomplete. Please fill Client ID, Client Secret, and Tenant ID.", 'error'); redirect($settings_mail_path); } @@ -71,13 +71,13 @@ curl_close($ch); if ($raw_body === false || $http_code < 200 || $http_code >= 300) { $reason = !empty($curl_err) ? $curl_err : "HTTP $http_code"; - flash_alert("Microsoft OAuth token exchange failed: $reason", 'error'); + flashAlert("Microsoft OAuth token exchange failed: $reason", 'error'); redirect($settings_mail_path); } $json = json_decode($raw_body, true); if (!is_array($json) || empty($json['refresh_token']) || empty($json['access_token'])) { - flash_alert("Microsoft OAuth token exchange failed: refresh token or access token missing.", 'error'); + flashAlert("Microsoft OAuth token exchange failed: refresh token or access token missing.", 'error'); redirect($settings_mail_path); } @@ -99,5 +99,5 @@ mysqli_query($mysqli, "UPDATE settings SET "); logAudit("Settings", "Edit", "$session_name completed Microsoft OAuth connect flow for mail settings"); -flash_alert("Microsoft OAuth connected successfully. Token expires at $expires_at."); +flashAlert("Microsoft OAuth connected successfully. Token expires at $expires_at."); redirect($settings_mail_path); diff --git a/admin/post/ai_model.php b/admin/post/ai_model.php index fd6102d8..d96f85cc 100644 --- a/admin/post/ai_model.php +++ b/admin/post/ai_model.php @@ -21,7 +21,7 @@ if (isset($_POST['add_ai_model'])) { logAudit("AI Model", "Create", "$session_name created AI Model $model"); - flash_alert("AI Model $model created"); + flashAlert("AI Model $model created"); redirect(); @@ -40,7 +40,7 @@ if (isset($_POST['edit_ai_model'])) { logAudit("AI Model", "Edit", "$session_name edited AI Model $model"); - flash_alert("AI Model $model edited"); + flashAlert("AI Model $model edited"); redirect(); @@ -58,7 +58,7 @@ if (isset($_GET['delete_ai_model'])) { logAudit("AI Model", "Delete", "$session_name deleted AI Model $model_name"); - flash_alert("AI Model $model_name deleted", 'error'); + flashAlert("AI Model $model_name deleted", 'error'); redirect(); diff --git a/admin/post/ai_provider.php b/admin/post/ai_provider.php index 24793914..d79fcfec 100644 --- a/admin/post/ai_provider.php +++ b/admin/post/ai_provider.php @@ -21,7 +21,7 @@ if (isset($_POST['add_ai_provider'])) { logAudit("AI Provider", "Create", "$session_name created AI Provider $provider"); - flash_alert("AI Model $provider created"); + flashAlert("AI Model $provider created"); redirect(); @@ -40,7 +40,7 @@ if (isset($_POST['edit_ai_provider'])) { logAudit("AI Provider", "Edit", "$session_name edited AI Provider $provider"); - flash_alert("AI Model $provider edited"); + flashAlert("AI Model $provider edited"); redirect(); @@ -58,7 +58,7 @@ if (isset($_GET['delete_ai_provider'])) { logAudit("AI Provider", "Delete", "$session_name deleted AI Provider $provider_name", 'error'); - flash_alert("AI Provider $provider_name deleted", 'error'); + flashAlert("AI Provider $provider_name deleted", 'error'); redirect(); diff --git a/admin/post/api_keys.php b/admin/post/api_keys.php index 6d1496ea..6447bc29 100644 --- a/admin/post/api_keys.php +++ b/admin/post/api_keys.php @@ -25,7 +25,7 @@ if (isset($_POST['add_api_key'])) { logAudit("API Key", "Create", "$session_name created API key $name set to expire on $expire", $client_id, $api_key_id); - flash_alert("API Key $name created"); + flashAlert("API Key $name created"); redirect(); @@ -46,7 +46,7 @@ if (isset($_GET['revoke_api_key'])) { logAudit("API Key", "Revoke", "$session_name revoked API key $name", $client_id); - flash_alert("API Key $name revoked", 'error'); + flashAlert("API Key $name revoked", 'error'); redirect(); @@ -67,7 +67,7 @@ if (isset($_GET['delete_api_key'])) { logAudit("API Key", "Delete", "$session_name deleted API key $name", $client_id); - flash_alert("API Key $name deleted", 'error'); + flashAlert("API Key $name deleted", 'error'); redirect(); @@ -99,7 +99,7 @@ if (isset($_POST['bulk_delete_api_keys'])) { logAudit("API Key", "Bulk Delete", "$session_name deleted $count API key(s)"); - flash_alert("Deleted $count API keys(s)", 'error'); + flashAlert("Deleted $count API keys(s)", 'error'); } diff --git a/admin/post/backup.php b/admin/post/backup.php index c1dd61fa..b70a6ade 100644 --- a/admin/post/backup.php +++ b/admin/post/backup.php @@ -296,7 +296,7 @@ if (isset($_GET['download_backup'])) { // Log + UX logAudit("System", "Backup Download", ($session_name ?? 'Unknown User') . " downloaded full backup."); - flash_alert("Full backup downloaded."); + flashAlert("Full backup downloaded."); exit; } @@ -324,7 +324,7 @@ if (isset($_POST['backup_master_key'])) { } else { logAudit("Master Key", "Download", "$session_name attempted to retrieve the master encryption key but failed"); - flash_alert("Incorrect password.", 'error'); + flashAlert("Incorrect password.", 'error'); redirect(); } diff --git a/admin/post/category.php b/admin/post/category.php index 981f6044..58dfe810 100644 --- a/admin/post/category.php +++ b/admin/post/category.php @@ -18,7 +18,7 @@ if (isset($_POST['add_category'])) { logAudit("Category", "Create", "$session_name created category $type $name", 0, $category_id); - flash_alert("Category $type $name created"); + flashAlert("Category $type $name created"); redirect(); @@ -36,7 +36,7 @@ if (isset($_POST['edit_category'])) { logAudit("Category", "Edit", "$session_name edited category $type $name", 0, $category_id); - flash_alert("Category $type $name edited"); + flashAlert("Category $type $name edited"); redirect(); @@ -58,7 +58,7 @@ if (isset($_GET['archive_category'])) { logAudit("Category", "Archive", "$session_name archived category $category_type $category_name", 0, $category_id); - flash_alert("Category $category_type $category_name archived", 'error'); + flashAlert("Category $category_type $category_name archived", 'error'); redirect(); @@ -80,7 +80,7 @@ if (isset($_GET['restore_category'])) { logAudit("Category", "Restore", "$session_name retored category $category_type $category_name", 0, $category_id); - flash_alert("Category $category_type $category_name restored"); + flashAlert("Category $category_type $category_name restored"); redirect(); @@ -102,7 +102,7 @@ if (isset($_GET['delete_category'])) { logAudit("Category", "Delete", "$session_name deleted category $category_type $category_name"); - flash_alert("Category $category_type $category_name deleted", 'error'); + flashAlert("Category $category_type $category_name deleted", 'error'); redirect(); diff --git a/admin/post/contract_template.php b/admin/post/contract_template.php index 84294cb8..2787a505 100644 --- a/admin/post/contract_template.php +++ b/admin/post/contract_template.php @@ -53,7 +53,7 @@ if (isset($_POST['add_contract_template'])) { logAudit("Contract Template", "Create", "$session_name created contract template $name", 0, $contract_template_id); // Flash message - flash_alert("Contract Template $name created"); + flashAlert("Contract Template $name created"); // Redirect back redirect(); @@ -102,7 +102,7 @@ if (isset($_POST['edit_contract_template'])) { logAudit("Contract Template", "Update", "$session_name updated contract template $name", 0, $contract_template_id); // Flash + redirect - flash_alert("Contract Template $name updated"); + flashAlert("Contract Template $name updated"); redirect(); } @@ -118,7 +118,7 @@ if (isset($_GET['archive_contract_template'])) { "); logAudit("Contract Template", "Archive", "$session_name archived contract template $name", 0, $contract_template_id); - flash_alert("Contract Template $name archived", "danger"); + flashAlert("Contract Template $name archived", "danger"); redirect(); } @@ -134,7 +134,7 @@ if (isset($_GET['restore_contract_template'])) { "); logAudit("Contract Template", "Restore", "$session_name restored contract template $name", 0, $contract_template_id); - flash_alert("Contract Template $name restored"); + flashAlert("Contract Template $name restored"); redirect(); } @@ -150,7 +150,7 @@ if (isset($_GET['delete_contract_template'])) { "); logAudit("Contract Template", "Delete", "$session_name deleted contract template $name", 0, $contract_template_id); - flash_alert("Contract Template $name deleted", "danger"); + flashAlert("Contract Template $name deleted", "danger"); redirect(); } diff --git a/admin/post/custom_field.php b/admin/post/custom_field.php index e3a535d7..26353e27 100644 --- a/admin/post/custom_field.php +++ b/admin/post/custom_field.php @@ -18,7 +18,7 @@ if(isset($_POST['create_custom_field'])){ logAudit("Custom Field", "Create", "$session_name created custom field $label", 0, $custom_field_id); - flash_alert("Custom field $label created"); + flashAlert("Custom field $label created"); redirect(); @@ -34,7 +34,7 @@ if(isset($_POST['edit_custom_field'])){ logAudit("Custom Field", "Edit", "$session_name edited custom field $label", 0, $custom_field_id); - flash_alert("Custom field $label edited"); + flashAlert("Custom field $label edited"); redirect(); @@ -50,7 +50,7 @@ if(isset($_GET['delete_custom_field'])){ logAudit("Custom Field", "Delete", "$session_name deleted custom field $label"); - flash_alert("Custom field $label deleted", 'error'); + flashAlert("Custom field $label deleted", 'error'); redirect(); diff --git a/admin/post/custom_link.php b/admin/post/custom_link.php index aa83d683..e2d1918a 100644 --- a/admin/post/custom_link.php +++ b/admin/post/custom_link.php @@ -23,7 +23,7 @@ if (isset($_POST['add_custom_link'])) { logAudit("Custom Link", "Create", "$session_name created custom link $name -> $uri", 0, $custom_link_id); - flash_alert("Custom link $name created"); + flashAlert("Custom link $name created"); redirect(); @@ -45,7 +45,7 @@ if (isset($_POST['edit_custom_link'])) { logAudit("Custom Link", "Edit", "$session_name edited custom link $name -> $uri", 0, $custom_link_id); - flash_alert("Custom Link $name edited"); + flashAlert("Custom Link $name edited"); redirect(); @@ -67,7 +67,7 @@ if (isset($_GET['delete_custom_link'])) { logAudit("Custom Link", "Delete", "$session_name deleted custom link $custom_link_name -> $custom_link_uri"); - flash_alert("Custom Link $name deleted", 'error'); + flashAlert("Custom Link $name deleted", 'error'); redirect(); diff --git a/admin/post/document_template.php b/admin/post/document_template.php index d39a48d9..1686acf7 100644 --- a/admin/post/document_template.php +++ b/admin/post/document_template.php @@ -30,7 +30,7 @@ if (isset($_POST['add_document_template'])) { logAudit("Document Template", "Create", "$session_name created document template $name", 0, $document_template_id); - flash_alert("Document template $name created"); + flashAlert("Document template $name created"); redirect(); @@ -65,7 +65,7 @@ if (isset($_POST['edit_document_template'])) { logAudit("Document Template", "Edit", "$session_name edited document template $name", 0, $document_template_id); - flash_alert("Document Template $name edited"); + flashAlert("Document Template $name edited"); redirect(); @@ -86,7 +86,7 @@ if (isset($_GET['delete_document_template'])) { logAudit("Document Template", "Delete", "$session_name deleted document template $document_template_name"); - flash_alert("Document Template $document_template_name deleted", 'error'); + flashAlert("Document Template $document_template_name deleted", 'error'); redirect(); diff --git a/admin/post/identity_provider.php b/admin/post/identity_provider.php index ab3838a4..f91123bd 100644 --- a/admin/post/identity_provider.php +++ b/admin/post/identity_provider.php @@ -13,7 +13,7 @@ if (isset($_POST['edit_identity_provider'])) { logAudit("Settings", "Edit", "$session_name edited identity provider settings"); - flash_alert("Identity Provider Settings updated"); + flashAlert("Identity Provider Settings updated"); redirect(); diff --git a/admin/post/mail_queue.php b/admin/post/mail_queue.php index 9791ac9d..bf6aa11c 100644 --- a/admin/post/mail_queue.php +++ b/admin/post/mail_queue.php @@ -12,7 +12,7 @@ if (isset($_GET['send_failed_mail'])) { 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"); + flashAlert("Email Force Sent, give it a minute to resend"); redirect(); @@ -28,7 +28,7 @@ if (isset($_GET['cancel_mail'])) { 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'); + flashAlert("Email cancelled and marked as failed.", 'error'); redirect(); @@ -54,7 +54,7 @@ if (isset($_POST['bulk_cancel_emails'])) { logAudit("Email", "Bulk Cancel", "$session_name cancelled $count email(s) in the mail queue"); - flash_alert("Cancelled $count email(s)", 'error'); + flashAlert("Cancelled $count email(s)", 'error'); } @@ -82,7 +82,7 @@ if (isset($_POST['bulk_delete_emails'])) { logAudit("Email", "Bulk Delete", "$session_name deleted $count email(s) from the mail queue"); - flash_alert("Deleted $count email(s)", 'error'); + flashAlert("Deleted $count email(s)", 'error'); } diff --git a/admin/post/payment_method.php b/admin/post/payment_method.php index 68cb2e25..5523525b 100644 --- a/admin/post/payment_method.php +++ b/admin/post/payment_method.php @@ -24,7 +24,7 @@ if (isset($_POST['add_payment_method'])) { logAudit("Payment Method", "Create", "$session_name created Payment Method $name"); - flash_alert("Payment Method $name created"); + flashAlert("Payment Method $name created"); redirect(); @@ -51,7 +51,7 @@ if (isset($_POST['edit_payment_method'])) { logAudit("Payment Method", "Edit", "$session_name edited Payment Method $name"); - flash_alert("Payment Method $name edited"); + flashAlert("Payment Method $name edited"); redirect(); @@ -69,7 +69,7 @@ if (isset($_GET['delete_payment_method'])) { logAudit("Payment Method", "Delete", "$session_name deleted Payment Method $payment_method_name"); - flash_alert("Payment Method $payment_method_name deleted", 'error'); + flashAlert("Payment Method $payment_method_name deleted", 'error'); redirect(); diff --git a/admin/post/payment_provider.php b/admin/post/payment_provider.php index 840507c9..d8a05761 100644 --- a/admin/post/payment_provider.php +++ b/admin/post/payment_provider.php @@ -23,7 +23,7 @@ if (isset($_POST['add_payment_provider'])) { // Check to ensure provider isn't added twice $sql = mysqli_query($mysqli, "SELECT 1 FROM payment_providers WHERE payment_provider_name = '$provider' LIMIT 1"); if (mysqli_num_rows($sql) > 0) { - flash_alert("Payment Provider $provider already exists", 'error'); + flashAlert("Payment Provider $provider already exists", 'error'); redirect(); } @@ -33,7 +33,7 @@ if (isset($_POST['add_payment_provider'])) { logAudit("Payment Provider", "Create", "$session_name created AI Provider $provider"); - flash_alert("Payment provider $provider created"); + flashAlert("Payment provider $provider created"); redirect(); @@ -58,7 +58,7 @@ if (isset($_POST['edit_payment_provider'])) { logAudit("Payment Provider", "Edit", "$session_name edited Payment Provider $provider"); - flash_alert("Payment Provider $provider edited"); + flashAlert("Payment Provider $provider edited"); redirect(); @@ -82,7 +82,7 @@ if (isset($_GET['delete_payment_provider'])) { logAudit("Payment Provider", "Delete", "$session_name deleted Payment Provider $provider_name"); - flash_alert("Payment Provider $provider_name deleted", 'error'); + flashAlert("Payment Provider $provider_name deleted", 'error'); redirect(); diff --git a/admin/post/project_template.php b/admin/post/project_template.php index 2a5b5e0a..df78fb86 100644 --- a/admin/post/project_template.php +++ b/admin/post/project_template.php @@ -15,7 +15,7 @@ if (isset($_POST['add_project_template'])) { logAudit("Project Template", "Create", "$session_name created project template $name", 0, $project_template_id); - flash_alert("Project Template $name created"); + flashAlert("Project Template $name created"); redirect(); @@ -33,7 +33,7 @@ if (isset($_POST['edit_project_template'])) { logAudit("Project Template", "Edit", "$session_name edited project template $name", 0, $project_template_id); - flash_alert("Project Template $name edited"); + flashAlert("Project Template $name edited"); redirect(); @@ -65,7 +65,7 @@ if (isset($_POST['add_ticket_template_to_project_template'])) { logAudit("Project Template", "Edit", "$session_name added ticket template to project_template", 0, $project_template_id); - flash_alert("Ticket template added"); + flashAlert("Ticket template added"); redirect(); @@ -82,7 +82,7 @@ if (isset($_POST['remove_ticket_template_from_project_template'])) { logAudit("Project Template", "Edit", "$session_name removed ticket template from project template", 0, $project_template_id); - flash_alert("Ticket template removed", 'error'); + flashAlert("Ticket template removed", 'error'); redirect(); @@ -103,7 +103,7 @@ if (isset($_GET['delete_project_template'])) { logAudit("Project Template", "Delete", "$session_name deleted project template $project_template_name and its associated ticket templates and tasks"); - flash_alert("Project Template $project_template_name and its associated ticket templates and tasks deleted", 'error'); + flashAlert("Project Template $project_template_name and its associated ticket templates and tasks deleted", 'error'); redirect(); diff --git a/admin/post/roles.php b/admin/post/roles.php index 97b62d9d..9ac36716 100644 --- a/admin/post/roles.php +++ b/admin/post/roles.php @@ -34,7 +34,7 @@ if (isset($_POST['add_role'])) { logAudit("User Role", "Create", "$session_name created user role $name", 0, $role_id); - flash_alert("User Role $name created"); + flashAlert("User Role $name created"); redirect(); @@ -67,7 +67,7 @@ if (isset($_POST['edit_role'])) { logAudit("User Role", "Edit", "$session_name edited user role $name", 0, $role_id); - flash_alert("User Role $name edited"); + flashAlert("User Role $name edited"); redirect(); @@ -83,7 +83,7 @@ if (isset($_GET['archive_role'])) { $sql_role_user_count = mysqli_query($mysqli, "SELECT COUNT(user_id) FROM users WHERE user_role_id = $role_id AND user_archived_at IS NULL"); $role_user_count = mysqli_fetch_row($sql_role_user_count)[0]; if ($role_user_count != 0) { - flash_alert("Role must not in use to archive it", 'error'); + flashAlert("Role must not in use to archive it", 'error'); redirect(); } @@ -94,7 +94,7 @@ if (isset($_GET['archive_role'])) { logAudit("User Role", "Archive", "$session_name archived user role $role_name", 0, $role_id); - flash_alert("User Role $role_name archived", 'error'); + flashAlert("User Role $role_name archived", 'error'); redirect(); diff --git a/admin/post/saved_payment_method.php b/admin/post/saved_payment_method.php index f92cc4aa..883ae630 100644 --- a/admin/post/saved_payment_method.php +++ b/admin/post/saved_payment_method.php @@ -63,7 +63,7 @@ if (isset($_GET['delete_saved_payment'])) { logAudit("Payment Provider", "Update", "$session_name deleted saved payment method $saved_payment_description (PM: $payment_method)", $client_id); - flash_alert("Payment method $saved_payment_description removed", 'error'); + flashAlert("Payment method $saved_payment_description removed", 'error'); redirect(); diff --git a/admin/post/settings_ai.php b/admin/post/settings_ai.php index fca53a07..a452e948 100644 --- a/admin/post/settings_ai.php +++ b/admin/post/settings_ai.php @@ -20,7 +20,7 @@ if (isset($_POST['edit_ai_settings'])) { logAudit("Settings", "Edit", "$session_name edited AI settings"); - flash_alert("AI Settings updated"); + flashAlert("AI Settings updated"); redirect(); diff --git a/admin/post/settings_company.php b/admin/post/settings_company.php index e00d7f24..d111345f 100644 --- a/admin/post/settings_company.php +++ b/admin/post/settings_company.php @@ -46,7 +46,7 @@ if (isset($_POST['edit_company'])) { logAudit("Settings", "Edit", "$session_name edited company details"); - flash_alert("Company $name edited"); + flashAlert("Company $name edited"); redirect(); @@ -66,7 +66,7 @@ if (isset($_GET['remove_company_logo'])) { logAudit("Settings", "Edit", "$session_name deleted company logo"); - flash_alert("Removed company logo", 'error'); + flashAlert("Removed company logo", 'error'); redirect(); diff --git a/admin/post/settings_default.php b/admin/post/settings_default.php index ca8942b3..1d0963df 100644 --- a/admin/post/settings_default.php +++ b/admin/post/settings_default.php @@ -21,7 +21,7 @@ if (isset($_POST['edit_default_settings'])) { logAudit("Settings", "Edit", "$session_name edited default settings"); - flash_alert("Default settings edited"); + flashAlert("Default settings edited"); redirect(); diff --git a/admin/post/settings_invoice.php b/admin/post/settings_invoice.php index f17701fd..bd6b46e0 100644 --- a/admin/post/settings_invoice.php +++ b/admin/post/settings_invoice.php @@ -23,7 +23,7 @@ if (isset($_POST['edit_invoice_settings'])) { logAudit("Settings", "Edit", "$session_name edited invoice settings"); - flash_alert("Invoice Settings edited"); + flashAlert("Invoice Settings edited"); redirect(); diff --git a/admin/post/settings_localization.php b/admin/post/settings_localization.php index e185b1f3..980d12d1 100644 --- a/admin/post/settings_localization.php +++ b/admin/post/settings_localization.php @@ -16,7 +16,7 @@ if (isset($_POST['edit_localization'])) { logAudit("Settings", "Edit", "$session_name edited localization settings"); - flash_alert("Company localization updated"); + flashAlert("Company localization updated"); redirect(); diff --git a/admin/post/settings_mail.php b/admin/post/settings_mail.php index dd82d595..ba2b9db2 100644 --- a/admin/post/settings_mail.php +++ b/admin/post/settings_mail.php @@ -29,12 +29,12 @@ if (isset($_POST['oauth_connect_microsoft_mail'])) { // Check the SAVED providers (loaded from config at bootstrap), not $_POST — // the provider dropdowns live in different forms and are never posted here if ($config_imap_provider !== 'microsoft_oauth' && $config_smtp_provider !== 'microsoft_oauth') { - flash_alert("Please set the SMTP or IMAP Provider to Microsoft 365 (OAuth) and save it before connecting.", 'error'); + flashAlert("Please set the SMTP or IMAP Provider to Microsoft 365 (OAuth) and save it before connecting.", 'error'); redirect(); } if (empty($config_mail_oauth_client_id) || empty($config_mail_oauth_client_secret) || empty($config_mail_oauth_tenant_id)) { - flash_alert("Missing Microsoft OAuth settings. Please provide Client ID, Client Secret, and Tenant ID first.", 'error'); + flashAlert("Missing Microsoft OAuth settings. Please provide Client ID, Client Secret, and Tenant ID first.", 'error'); redirect(); } @@ -97,7 +97,7 @@ if (isset($_POST['edit_mail_smtp_settings'])) { logAudit("Settings", "Edit", "$session_name edited SMTP settings"); - flash_alert("SMTP Mail Settings updated"); + flashAlert("SMTP Mail Settings updated"); redirect(); @@ -127,7 +127,7 @@ if (isset($_POST['edit_mail_imap_settings'])) { logAudit("Settings", "Edit", "$session_name edited IMAP settings"); - flash_alert("IMAP Mail Settings updated"); + flashAlert("IMAP Mail Settings updated"); redirect(); @@ -153,7 +153,7 @@ if (isset($_POST['edit_mail_oauth_settings'])) { "); logAudit("Settings", "Edit", "$session_name edited mail OAuth settings"); - flash_alert("Mail OAuth Settings updated"); + flashAlert("Mail OAuth Settings updated"); redirect(); } @@ -177,7 +177,7 @@ if (isset($_POST['edit_mail_from_settings'])) { logAudit("Settings", "Edit", "$session_name edited mail from settings"); - flash_alert("Mail From Settings updated"); + flashAlert("Mail From Settings updated"); redirect(); @@ -221,9 +221,9 @@ if (isset($_POST['test_email_smtp'])) { $mail = addToMailQueue($data); if ($mail === true) { - flash_alert("Test email queued! Check Admin > Mail queue"); + flashAlert("Test email queued! Check Admin > Mail queue"); } else { - flash_alert("Failed to add test mail to queue", 'error'); + flashAlert("Failed to add test mail to queue", 'error'); } redirect(); @@ -275,7 +275,7 @@ if (isset($_POST['test_email_imap'])) { } if (empty($host) || empty($port) || empty($username)) { - flash_alert("IMAP connection failed: Missing host, port, or username.", 'error'); + flashAlert("IMAP connection failed: Missing host, port, or username.", 'error'); redirect(); } @@ -319,7 +319,7 @@ if (isset($_POST['test_email_imap'])) { $password = $config_mail_oauth_access_token; } else { if (empty($config_mail_oauth_client_id) || empty($config_mail_oauth_client_secret) || empty($config_mail_oauth_refresh_token)) { - flash_alert("IMAP OAuth failed: Missing OAuth client credentials or refresh token.", 'error'); + flashAlert("IMAP OAuth failed: Missing OAuth client credentials or refresh token.", 'error'); redirect(); } @@ -332,7 +332,7 @@ if (isset($_POST['test_email_imap'])) { ]); } else { if (empty($config_mail_oauth_tenant_id)) { - flash_alert("IMAP OAuth failed: Microsoft tenant ID is required.", 'error'); + flashAlert("IMAP OAuth failed: Microsoft tenant ID is required.", 'error'); redirect(); } @@ -346,13 +346,13 @@ if (isset($_POST['test_email_imap'])) { } if (!$response['ok']) { - flash_alert("IMAP OAuth failed: Could not refresh access token.", 'error'); + flashAlert("IMAP OAuth failed: Could not refresh access token.", 'error'); redirect(); } $json = json_decode($response['body'], true); if (!is_array($json) || empty($json['access_token'])) { - flash_alert("IMAP OAuth failed: Token response did not include an access token.", 'error'); + flashAlert("IMAP OAuth failed: Token response did not include an access token.", 'error'); redirect(); } @@ -476,9 +476,9 @@ if (isset($_POST['test_email_imap'])) { if ($success) { if ($is_oauth) { - flash_alert("Connected successfully using OAuth"); + flashAlert("Connected successfully using OAuth"); } else { - flash_alert("Connected successfully"); + flashAlert("Connected successfully"); } } else { if (!$error_line) { @@ -488,7 +488,7 @@ if (isset($_POST['test_email_imap'])) { } } catch (Exception $e) { - flash_alert("IMAP connection failed: " . htmlspecialchars($e->getMessage()), 'error'); + flashAlert("IMAP connection failed: " . htmlspecialchars($e->getMessage()), 'error'); } redirect(); @@ -502,7 +502,7 @@ if (isset($_POST['test_oauth_token_refresh'])) { $provider = escapeSql($_POST['oauth_provider'] ?? ''); if ($provider !== 'google_oauth' && $provider !== 'microsoft_oauth') { - flash_alert("OAuth token test failed: unsupported provider.", 'error'); + flashAlert("OAuth token test failed: unsupported provider.", 'error'); redirect(); } @@ -512,12 +512,12 @@ if (isset($_POST['test_oauth_token_refresh'])) { $oauth_refresh_token = escapeSql($config_mail_oauth_refresh_token ?? ''); if (empty($oauth_client_id) || empty($oauth_client_secret) || empty($oauth_refresh_token)) { - flash_alert("OAuth token test failed: missing client ID, client secret, or refresh token.", 'error'); + flashAlert("OAuth token test failed: missing client ID, client secret, or refresh token.", 'error'); redirect(); } if ($provider === 'microsoft_oauth' && empty($oauth_tenant_id)) { - flash_alert("OAuth token test failed: Microsoft tenant ID is required.", 'error'); + flashAlert("OAuth token test failed: Microsoft tenant ID is required.", 'error'); redirect(); } @@ -546,14 +546,14 @@ if (isset($_POST['test_oauth_token_refresh'])) { if ($raw_body === false || $http_code < 200 || $http_code >= 300) { $err_msg = !empty($curl_err) ? $curl_err : "HTTP $http_code"; - flash_alert("OAuth token test failed: $err_msg", 'error'); + flashAlert("OAuth token test failed: $err_msg", 'error'); redirect(); } $json = json_decode($raw_body, true); if (!is_array($json) || empty($json['access_token'])) { - flash_alert("OAuth token test failed: access token missing in provider response.", 'error'); + flashAlert("OAuth token test failed: access token missing in provider response.", 'error'); redirect(); } @@ -575,6 +575,6 @@ if (isset($_POST['test_oauth_token_refresh'])) { $provider_label = $provider === 'microsoft_oauth' ? 'Microsoft 365' : 'Google Workspace'; 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."); + flashAlert("OAuth token refresh successful for $provider_label. Access token expires at $new_expires_at."); redirect(); } diff --git a/admin/post/settings_module.php b/admin/post/settings_module.php index 954981ff..aa04336a 100644 --- a/admin/post/settings_module.php +++ b/admin/post/settings_module.php @@ -23,7 +23,7 @@ if (isset($_POST['edit_module_settings'])) { logAudit("Settings", "Edit", "$session_name edited module settings"); - flash_alert("Module Settings updated"); + flashAlert("Module Settings updated"); redirect(); diff --git a/admin/post/settings_notification.php b/admin/post/settings_notification.php index fbb1f618..7d4dad87 100644 --- a/admin/post/settings_notification.php +++ b/admin/post/settings_notification.php @@ -16,7 +16,7 @@ if (isset($_POST['edit_notification_settings'])) { logAudit("Settings", "Edit", "$session_name edited notification settings"); - flash_alert("Notification Settings updated"); + flashAlert("Notification Settings updated"); redirect(); diff --git a/admin/post/settings_online_payment.php b/admin/post/settings_online_payment.php index e1126eb7..84edc6d7 100644 --- a/admin/post/settings_online_payment.php +++ b/admin/post/settings_online_payment.php @@ -20,9 +20,9 @@ if (isset($_POST['edit_online_payment_settings'])) { logAudit("Settings", "Edit", "$session_name edited online payment settings"); if ($config_stripe_enable && $config_stripe_account == 0) { - flash_alert("Stripe payment account must be specified!", 'error'); + flashAlert("Stripe payment account must be specified!", 'error'); } else { - flash_alert("Online Payment Settings updated"); + flashAlert("Online Payment Settings updated"); } redirect(); diff --git a/admin/post/settings_online_payment_clients.php b/admin/post/settings_online_payment_clients.php index 246241a0..bfa60908 100644 --- a/admin/post/settings_online_payment_clients.php +++ b/admin/post/settings_online_payment_clients.php @@ -7,7 +7,7 @@ if (isset($_GET['stripe_remove_pm'])) { validateCSRFToken($_GET['csrf_token']); if (!$config_stripe_enable) { - flash_alert("Stripe not enabled", 'error'); + flashAlert("Stripe not enabled", 'error'); redirect(); } @@ -41,7 +41,7 @@ if (isset($_GET['stripe_remove_pm'])) { logAudit("Stripe", "Update", "$session_name deleted saved Stripe payment method (PM: $payment_method)", $client_id); - flash_alert("Payment method removed", 'error'); + flashAlert("Payment method removed", 'error'); redirect(); @@ -66,7 +66,7 @@ if (isset($_GET['stripe_reset_customer'])) { logAudit("Stripe", "Delete", "$session_name reset Stripe settings for client", $client_id); - flash_alert("Reset client Stripe settings", 'error'); + flashAlert("Reset client Stripe settings", 'error'); redirect(); diff --git a/admin/post/settings_project.php b/admin/post/settings_project.php index 4c5cf425..b3cd8030 100644 --- a/admin/post/settings_project.php +++ b/admin/post/settings_project.php @@ -13,7 +13,7 @@ if (isset($_POST['edit_project_settings'])) { logAudit("Settings", "Edit", "$session_name edited project settings"); - flash_alert("Project Settings updated"); + flashAlert("Project Settings updated"); redirect(); diff --git a/admin/post/settings_quote.php b/admin/post/settings_quote.php index d9e892cd..4d8693a8 100644 --- a/admin/post/settings_quote.php +++ b/admin/post/settings_quote.php @@ -18,7 +18,7 @@ if (isset($_POST['edit_quote_settings'])) { logAudit("Settings", "Edit", "$session_name edited Quote settings"); - flash_alert("Quote Settings updated"); + flashAlert("Quote Settings updated"); redirect(); diff --git a/admin/post/settings_security.php b/admin/post/settings_security.php index ddfc10c7..ee7a7270 100644 --- a/admin/post/settings_security.php +++ b/admin/post/settings_security.php @@ -21,7 +21,7 @@ if (isset($_POST['edit_security_settings'])) { logAudit("Settings", "Edit", "$session_name edited security settings"); - flash_alert("Security settings updated"); + flashAlert("Security settings updated"); redirect(); diff --git a/admin/post/settings_telemetry.php b/admin/post/settings_telemetry.php index c8cc8135..7c601d25 100644 --- a/admin/post/settings_telemetry.php +++ b/admin/post/settings_telemetry.php @@ -12,7 +12,7 @@ if (isset($_POST['edit_telemetry_settings'])) { logAudit("Settings", "Edit", "$session_name edited telemetry settings"); - flash_alert("Telemetry Settings updated"); + flashAlert("Telemetry Settings updated"); redirect(); diff --git a/admin/post/settings_theme.php b/admin/post/settings_theme.php index 42ee2293..373bb166 100644 --- a/admin/post/settings_theme.php +++ b/admin/post/settings_theme.php @@ -12,7 +12,7 @@ if (isset($_POST['edit_theme_settings'])) { logAudit("Settings", "Edit", "$session_name edited theme settings $dark_mode"); - flash_alert("Changed theme to $theme"); + flashAlert("Changed theme to $theme"); redirect(); @@ -44,7 +44,7 @@ if (isset($_POST['edit_favicon_settings'])) { logAudit("Settings", "Edit", "$session_name changed the favicon"); - flash_alert("Favicon Updated"); + flashAlert("Favicon Updated"); redirect(); @@ -60,7 +60,7 @@ if (isset($_GET['reset_favicon'])) { logAudit("Settings", "Edit", "$session_name reset Favicon"); - flash_alert("Favicon reset", 'error'); + flashAlert("Favicon reset", 'error'); redirect(); diff --git a/admin/post/settings_ticket.php b/admin/post/settings_ticket.php index 18c30600..2f4e743e 100644 --- a/admin/post/settings_ticket.php +++ b/admin/post/settings_ticket.php @@ -25,7 +25,7 @@ if (isset($_POST['edit_ticket_settings'])) { logAudit("Settings", "Edit", "$session_name edited ticket settings"); - flash_alert("Ticket Settings updated"); + flashAlert("Ticket Settings updated"); redirect(); diff --git a/admin/post/software_template.php b/admin/post/software_template.php index 292cfe56..8adab155 100644 --- a/admin/post/software_template.php +++ b/admin/post/software_template.php @@ -21,7 +21,7 @@ if (isset($_POST['add_software_template'])) { logAudit("Software Template", "Create", "$session_name created software template $name", 0, $software_template_id); - flash_alert("Software template $name created"); + flashAlert("Software template $name created"); redirect(); @@ -43,7 +43,7 @@ if (isset($_POST['edit_software_template'])) { logAudit("Software Template", "Edit", "$session_name edited software template $name", 0, $software_template_id); - flash_alert("Software template $name edited"); + flashAlert("Software template $name edited"); redirect(); @@ -64,7 +64,7 @@ if (isset($_GET['delete_software_template'])) { logAudit("Software Template", "Delete", "$session_name deleted software template $software_template_name"); - flash_alert("Software Template $software_template_name deleted", 'error'); + flashAlert("Software Template $software_template_name deleted", 'error'); redirect(); diff --git a/admin/post/tag.php b/admin/post/tag.php index 524c6c2c..21d82959 100644 --- a/admin/post/tag.php +++ b/admin/post/tag.php @@ -18,7 +18,7 @@ if (isset($_POST['add_tag'])) { logAudit("Tag", "Create", "$session_name created tag $name", 0, $tag_id); - flash_alert("Tag $name created"); + flashAlert("Tag $name created"); redirect(); @@ -36,7 +36,7 @@ if (isset($_POST['edit_tag'])) { logAudit("Tag", "Edit", "$session_name edited tag $name", 0, $tag_id); - flash_alert("Tag $name edited"); + flashAlert("Tag $name edited"); redirect(); @@ -54,7 +54,7 @@ if (isset($_GET['delete_tag'])) { logAudit("Tag", "Delete", "$session_name deleted tag $tag_name"); - flash_alert("Tag $tag_name deleted", 'error'); + flashAlert("Tag $tag_name deleted", 'error'); redirect(); diff --git a/admin/post/tax.php b/admin/post/tax.php index 33a237de..0505431e 100644 --- a/admin/post/tax.php +++ b/admin/post/tax.php @@ -19,7 +19,7 @@ if (isset($_POST['add_tax'])) { logAudit("Tax", "Create", "$session_name created tax $name - $percent%", 0, $tax_id); - flash_alert("Tax $name ($percent%) created"); + flashAlert("Tax $name ($percent%) created"); redirect(); @@ -37,7 +37,7 @@ if (isset($_POST['edit_tax'])) { logAudit("Tax", "Edit", "$session_name edited tax $name - $percent%", 0, $tax_id); - flash_alert("Tax $name ($percent%) edited"); + flashAlert("Tax $name ($percent%) edited"); redirect(); @@ -55,7 +55,7 @@ if (isset($_GET['archive_tax'])) { logAudit("Tax", "Archive", "$session_name archived tax $tax_name", 0, $tax_id); - flash_alert("Tax $tax_name Archived", 'error'); + flashAlert("Tax $tax_name Archived", 'error'); redirect(); @@ -73,7 +73,7 @@ if (isset($_GET['delete_tax'])) { logAudit("Tax", "Delete", "$session_name deleted tax $tax_name"); - flash_alert("Tax $tax_name deleted", 'error'); + flashAlert("Tax $tax_name deleted", 'error'); redirect(); diff --git a/admin/post/ticket_status.php b/admin/post/ticket_status.php index caa4e8ec..e21a0080 100644 --- a/admin/post/ticket_status.php +++ b/admin/post/ticket_status.php @@ -15,7 +15,7 @@ if (isset($_POST['add_ticket_status'])) { logAudit("Ticket Status", "Create", "$session_name created custom ticket status $name", 0, $ticket_status_id); - flash_alert("Custom Ticket Status $name created"); + flashAlert("Custom Ticket Status $name created"); redirect(); @@ -35,7 +35,7 @@ if (isset($_POST['edit_ticket_status'])) { logAudit("Ticket Status", "Edit", "$session_name edited custom ticket status $name", 0, $ticket_status_id); - flash_alert("Custom Ticket Status $name edited"); + flashAlert("Custom Ticket Status $name edited"); redirect(); @@ -57,7 +57,7 @@ if (isset($_GET['delete_ticket_status'])) { logAudit("Ticket Status", "Delete", "$session_name deleted custom ticket status $ticket_status_name"); - flash_alert("Custom Ticket Status $ticket_status_name Deleted", 'error'); + flashAlert("Custom Ticket Status $ticket_status_name Deleted", 'error'); redirect(); diff --git a/admin/post/ticket_template.php b/admin/post/ticket_template.php index 6524c613..b287eb4b 100644 --- a/admin/post/ticket_template.php +++ b/admin/post/ticket_template.php @@ -28,7 +28,7 @@ if (isset($_POST['add_ticket_template'])) { logAudit("Ticket Template", "Create", "$session_name created ticket template $name", 0, $ticket_template_id); - flash_alert("Ticket Template $name created"); + flashAlert("Ticket Template $name created"); redirect(); @@ -48,7 +48,7 @@ if (isset($_POST['edit_ticket_template'])) { logAudit("Ticket Template", "Edit", "$session_name edited ticket template $name", 0, $ticket_template_id); - flash_alert("Ticket Template $name edited"); + flashAlert("Ticket Template $name edited"); redirect(); @@ -70,7 +70,7 @@ if (isset($_GET['delete_ticket_template'])) { logAudit("Ticket Template", "Delete", "$session_name deleted ticket template $ticket_template_name"); - flash_alert("Ticket Template $ticket_template_name and its associated tasks deleted", 'error'); + flashAlert("Ticket Template $ticket_template_name and its associated tasks deleted", 'error'); redirect(); @@ -89,7 +89,7 @@ if (isset($_POST['add_ticket_template_task'])) { logAudit("Ticket Template", "Create", "$session_name created task $task_name for ticket template", 0, $ticket_template_id); - flash_alert("Added Task $task_name"); + flashAlert("Added Task $task_name"); redirect(); @@ -107,7 +107,7 @@ if (isset($_GET['delete_task_template'])) { logAudit("Ticket Template", "Edit", "$session_name deleted task $task_template_name from ticket template"); - flash_alert("Task $task_template_name deleted", 'error'); + flashAlert("Task $task_template_name deleted", 'error'); redirect(); diff --git a/admin/post/update.php b/admin/post/update.php index 3d181316..db55121c 100644 --- a/admin/post/update.php +++ b/admin/post/update.php @@ -274,7 +274,7 @@ if (isset($_GET['update'])) { logAudit("App", "Update", "$session_name ran updates"); - flash_alert("Update successful"); + flashAlert("Update successful"); sleep(1); @@ -292,7 +292,7 @@ if (isset($_GET['update_db'])) { logAudit("Database", "Update", "$session_name updated the database structure"); - flash_alert("Database structure update successful"); + flashAlert("Database structure update successful"); sleep(1); diff --git a/admin/post/users.php b/admin/post/users.php index 5ddfb8a4..39724663 100644 --- a/admin/post/users.php +++ b/admin/post/users.php @@ -92,7 +92,7 @@ if (isset($_POST['add_user'])) { logAudit("User", "Create", "$session_name created user $name", 0, $user_id); - flash_alert("User $name created" . $extended_alert_description); + flashAlert("User $name created" . $extended_alert_description); redirect(); @@ -172,7 +172,7 @@ if (isset($_POST['edit_user'])) { logAudit("User", "Edit", "$session_name edited user $name", 0, $user_id); - flash_alert("User $name updated" . $extended_alert_description); + flashAlert("User $name updated" . $extended_alert_description); redirect(); @@ -190,7 +190,7 @@ if (isset($_GET['activate_user'])) { logAudit("User", "Activate", "$session_name activated user $user_name", 0, $user_id); - flash_alert("User $user_name activated"); + flashAlert("User $user_name activated"); redirect(); @@ -212,7 +212,7 @@ if (isset($_GET['disable_user'])) { logAudit("User", "Disable", "$session_name disabled user $name", 0, $user_id); - flash_alert("User $user_name disabled", 'error'); + flashAlert("User $user_name disabled", 'error'); redirect(); @@ -230,7 +230,7 @@ if (isset($_GET['revoke_remember_me'])) { logAudit("User", "Edit", "$session_name revoked all remember me tokens for user $user_name", 0, $user_id); - flash_alert("User $user_name remember me tokens revoked", 'error'); + flashAlert("User $user_name remember me tokens revoked", 'error'); redirect(); @@ -255,7 +255,7 @@ if (isset($_POST['archive_user'])) { logAudit("User", "Archive", "$session_name archived user $user_name", 0, $user_id); - flash_alert("User $user_name archived", 'error'); + flashAlert("User $user_name archived", 'error'); redirect(); @@ -285,7 +285,7 @@ if (isset($_POST['restore_user'])) { logAudit("User", "Restored", "$session_name restored user $user_name", 0, $user_id); - flash_alert("User $user_name restored"); + flashAlert("User $user_name restored"); redirect(); @@ -356,7 +356,7 @@ if (isset($_POST['ir_reset_user_password'])) { $userRow = mysqli_fetch_assoc($sql); if (!password_verify($admin_password, $userRow['user_password'])) { - flash_alert("Incorrect password.", 'error'); + flashAlert("Incorrect password.", 'error'); redirect(); } diff --git a/agent/modals/document/document_add.php b/agent/modals/document/document_add.php index 4573181e..b75b8df0 100644 --- a/agent/modals/document/document_add.php +++ b/agent/modals/document/document_add.php @@ -41,7 +41,7 @@ ob_start(); diff --git a/agent/modals/file/file_upload.php b/agent/modals/file/file_upload.php index ddec732a..3a02bb53 100644 --- a/agent/modals/file/file_upload.php +++ b/agent/modals/file/file_upload.php @@ -46,7 +46,7 @@ ob_start(); diff --git a/agent/post/account.php b/agent/post/account.php index 825649b4..d23f615a 100644 --- a/agent/post/account.php +++ b/agent/post/account.php @@ -21,7 +21,7 @@ if (isset($_POST['add_account'])) { logAudit("Account", "Create", "$session_name created account $name"); - flash_alert("Account $name created"); + flashAlert("Account $name created"); redirect(); @@ -41,7 +41,7 @@ if (isset($_POST['edit_account'])) { logAudit("Account", "Edit", "$session_name edited account $name"); - flash_alert("Account $name edited"); + flashAlert("Account $name edited"); redirect(); @@ -61,7 +61,7 @@ if (isset($_GET['archive_account'])) { logAudit("Account", "Archive", "$session_name archived account $account_name"); - flash_alert("Account $account_name archived", 'error'); + flashAlert("Account $account_name archived", 'error'); redirect(); @@ -82,7 +82,7 @@ if (isset($_GET['delete_account'])) { logAudit("Account", "Delete", "$session_name deleted account $account_name"); - flash_alert("Account $account_name deleted", 'error'); + flashAlert("Account $account_name deleted", 'error'); redirect(); diff --git a/agent/post/asset.php b/agent/post/asset.php index d84987fd..98335982 100644 --- a/agent/post/asset.php +++ b/agent/post/asset.php @@ -72,7 +72,7 @@ if (isset($_POST['add_asset'])) { logAudit("Asset", "Create", "$session_name created asset $name", $client_id, $asset_id); - flash_alert("Asset $name created $alert_extended"); + flashAlert("Asset $name created $alert_extended"); redirect(); @@ -141,7 +141,7 @@ if (isset($_POST['edit_asset'])) { logAudit("Asset", "Edit", "$session_name edited asset $name", $client_id, $asset_id); - flash_alert("Asset $name edited"); + flashAlert("Asset $name edited"); redirect(); @@ -170,7 +170,7 @@ if (isset($_GET['archive_asset'])) { logAudit("Asset", "Archive", "$session_name archived asset $asset_name", $client_id, $asset_id); - flash_alert("Asset $asset_name archived", 'error'); + flashAlert("Asset $asset_name archived", 'error'); redirect(); @@ -199,7 +199,7 @@ if (isset($_GET['restore_asset'])) { logAudit("Asset", "Restore", "$session_name restored asset $asset_name", $client_id, $asset_id); - flash_alert("Asset $asset_name Restored"); + flashAlert("Asset $asset_name Restored"); redirect(); @@ -225,7 +225,7 @@ if (isset($_GET['delete_asset'])) { logAudit("Asset", "Delete", "$session_name deleted asset $asset_name", $client_id); - flash_alert("Asset $asset_name deleted"); + flashAlert("Asset $asset_name deleted"); redirect(); @@ -272,7 +272,7 @@ if (isset($_POST['bulk_assign_asset_tags'])) { logAudit("Asset", "Bulk Edit", "$session_name added tags for $asset_count assets", $client_id); - flash_alert("Assigned tags for $count assets"); + flashAlert("Assigned tags for $count assets"); } redirect(); @@ -320,7 +320,7 @@ if (isset($_POST['bulk_assign_asset_location'])) { logAudit("Asset", "Bulk Edit", "$session_name assigned $asset_count assets to location $location_name", $client_id); - flash_alert("You assigned $asset_count assets to location $location_name"); + flashAlert("You assigned $asset_count assets to location $location_name"); } redirect(); @@ -360,7 +360,7 @@ if (isset($_POST['bulk_assign_asset_physical_location'])) { logAudit("Asset", "Bulk Edit", "$session_name set $asset_count assets to physical location $physical_location", $client_id); - flash_alert("You moved $asset_count assets to location $physical_location"); + flashAlert("You moved $asset_count assets to location $physical_location"); } redirect(); @@ -450,7 +450,7 @@ if (isset($_POST['bulk_transfer_client_asset'])) { logAudit("Asset", "Bulk Transfer", "$session_name transferred $asset_count assets to $new_client_name", $new_client_id); - flash_alert("Transferred $asset_count assets to $new_client_name."); + flashAlert("Transferred $asset_count assets to $new_client_name."); } redirect(); @@ -495,7 +495,7 @@ if (isset($_POST['bulk_assign_asset_contact'])) { logAudit("Asset", "Bulk Edit", "$session_name assigned $asset_count assets to contact $contact_name", $client_id); - flash_alert("You assigned $asset_count assets to contact $contact_name"); + flashAlert("You assigned $asset_count assets to contact $contact_name"); } redirect(); @@ -536,7 +536,7 @@ if (isset($_POST['bulk_edit_asset_status'])) { logAudit("Asset", "Bulk Edit", "$session_name set status to $status on $asset_count assets", $client_id); - flash_alert("You set the status $status on $asset_count assets."); + flashAlert("You set the status $status on $asset_count assets."); } redirect(); @@ -573,7 +573,7 @@ if (isset($_POST['bulk_favorite_assets'])) { logAudit("Asset", "Bulk Edit", "$session_name favorited $count assets", $client_id); - flash_alert("Favorited $count asset(s)"); + flashAlert("Favorited $count asset(s)"); } @@ -611,7 +611,7 @@ if (isset($_POST['bulk_unfavorite_assets'])) { logAudit("Asset", "Bulk Edit", "$session_name unfavorited $count assets", $client_id); - flash_alert("Unfavorited $count asset(s)"); + flashAlert("Unfavorited $count asset(s)"); } @@ -652,7 +652,7 @@ if (isset($_POST['bulk_archive_assets'])) { logAudit("Asset", "Bulk Archive", "$session_name archived $count assets", $client_id); - flash_alert("Archived $count asset(s)", 'error'); + flashAlert("Archived $count asset(s)", 'error'); } @@ -694,7 +694,7 @@ if (isset($_POST['bulk_restore_assets'])) { logAudit("Asset", "Bulk Restore", "$session_name restored $count assets"); - flash_alert("Restored $count asset(s)"); + flashAlert("Restored $count asset(s)"); } @@ -731,7 +731,7 @@ if (isset($_POST['bulk_delete_assets'])) { logAudit("Asset", "Bulk Delete", "$session_name deleted $count assets"); - flash_alert("Deleted $count asset(s)", 'error'); + flashAlert("Deleted $count asset(s)", 'error'); } redirect(); @@ -764,7 +764,7 @@ if (isset($_POST['link_software_to_asset'])) { logAudit("Software", "Link", "$session_name added software license $software_name to asset $asset_name", $client_id, $software_id); - flash_alert("Software $software_name licensed for asset $asset_name"); + flashAlert("Software $software_name licensed for asset $asset_name"); redirect(); @@ -794,7 +794,7 @@ if (isset($_GET['unlink_software_from_asset'])) { logAudit("software", "Unlink", "$session_name removed software license $software_name from asset $asset_name", $client_id, $software_id); - flash_alert("Removed Software License $software_name for Asset $asset_name", 'error'); + flashAlert("Removed Software License $software_name for Asset $asset_name", 'error'); redirect(); @@ -825,7 +825,7 @@ if (isset($_POST['link_asset_to_credential'])) { logAudit("Credential", "Link", "$session_name linked credential $credential_name to asset $asset_name", $client_id, $credential_id); - flash_alert("Asset $asset_name linked with credential $crdential_name"); + flashAlert("Asset $asset_name linked with credential $crdential_name"); redirect(); @@ -855,7 +855,7 @@ if (isset($_GET['unlink_credential_from_asset'])) { logAudit("Credential", "Unlink", "$session_name unlinked asset $asset_name from credential $credential_name", $client_id, $credential_id); - flash_alert("Credential $credential_name unlinked from Asset $asset_name", 'errpr'); + flashAlert("Credential $credential_name unlinked from Asset $asset_name", 'errpr'); redirect(); @@ -885,7 +885,7 @@ if (isset($_POST['link_service_to_asset'])) { logAudit("Service", "Link", "$session_name linked asset $asset_name to service $service_name", $client_id, $service_id); - flash_alert("Service $service_name linked with asset $asset_name"); + flashAlert("Service $service_name linked with asset $asset_name"); redirect(); @@ -915,7 +915,7 @@ if (isset($_GET['unlink_service_from_asset'])) { logAudit("Service", "Unlink", "$session_name unlinked asset $asset_name from service $service_name", $client_id, $service_id); - flash_alert("Asset $asset_name unlinked from service $service_name", 'error'); + flashAlert("Asset $asset_name unlinked from service $service_name", 'error'); redirect(); @@ -946,7 +946,7 @@ if (isset($_POST['link_asset_to_file'])) { logAudit("File", "Link", "$session_name linked asset $asset_name to file $file_name", $client_id, $file_id); - flash_alert("Asset $asset_name linked with File $file_name"); + flashAlert("Asset $asset_name linked with File $file_name"); redirect(); @@ -976,7 +976,7 @@ if (isset($_GET['unlink_asset_from_file'])) { logAudit("File", "Unlink", "$session_name unlinked asset $asset_name from file $file_name", $client_id, $file_id); - flash_alert("Asset $asset_name unlinked from file $file_name", 'error'); + flashAlert("Asset $asset_name unlinked from file $file_name", 'error'); redirect(); @@ -1002,7 +1002,7 @@ if (isset($_POST["import_assets_csv"])) { if (!empty($_FILES["file"]["tmp_name"])) { $file_name = $_FILES["file"]["tmp_name"]; } else { - flash_alert("Please select a file to upload.", 'error'); + flashAlert("Please select a file to upload.", 'error'); redirect(); } @@ -1011,13 +1011,13 @@ if (isset($_POST["import_assets_csv"])) { $allowed_file_extensions = array('csv'); if (in_array($file_extension,$allowed_file_extensions) === false) { $error = true; - flash_alert("Bad file extension", 'error'); + flashAlert("Bad file extension", 'error'); } //Check file isn't empty elseif ($_FILES["file"]["size"] < 1) { $error = true; - flash_alert("Bad file size (empty?)", 'error'); + flashAlert("Bad file size (empty?)", 'error'); } //(Else)Check column count (name, desc, type, make, model, serial, os, purchase date, assigned to, location, notes) @@ -1025,7 +1025,7 @@ if (isset($_POST["import_assets_csv"])) { $f_columns = fgetcsv($f, 1000, ","); if (!$error & count($f_columns) != 12) { $error = true; - flash_alert("Invalid column count.", 'error'); + flashAlert("Invalid column count.", 'error'); } //Else, parse the file @@ -1141,7 +1141,7 @@ if (isset($_POST["import_assets_csv"])) { 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"); + flashAlert("$row_count Asset(s) added, $duplicate_count duplicate(s) detected"); redirect(); @@ -1217,7 +1217,7 @@ if (isset($_POST['export_assets_csv'])) { $delimiter = ","; $enclosure = '"'; $escape = '\\'; // backslash - $filename = sanitize_filename($file_name_prepend . "Assets-" . date('Y-m-d_H-i-s') . ".csv"); + $filename = sanitizeFilename($file_name_prepend . "Assets-" . date('Y-m-d_H-i-s') . ".csv"); //create a file pointer $f = fopen('php://memory', 'w'); @@ -1320,7 +1320,7 @@ if (isset($_POST['add_asset_interface'])) { ); // 7) Alert message + redirect - flash_alert("Interface $name created"); + flashAlert("Interface $name created"); redirect(); @@ -1367,7 +1367,7 @@ if (isset($_POST['add_asset_multiple_interfaces'])) { logAudit("Asset Interface", "Bulk Create", "$session_name created $interfaces for asset $asset_name", $client_id, $asset_id); - flash_alert("Created $interfaces Interface(s) for asset $asset_name"); + flashAlert("Created $interfaces Interface(s) for asset $asset_name"); redirect(); @@ -1448,7 +1448,7 @@ if (isset($_POST['edit_asset_interface'])) { ); // 6) Alert and redirect - flash_alert("Interface $name edited"); + flashAlert("Interface $name edited"); redirect(); @@ -1493,7 +1493,7 @@ if (isset($_GET['delete_asset_interface'])) { ); // 4) Alert and redirect - flash_alert("Interface $interface_name deleted", 'error'); + flashAlert("Interface $interface_name deleted", 'error'); redirect(); @@ -1537,7 +1537,7 @@ if (isset($_POST['bulk_edit_asset_interface_type'])) { 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 $type on $interface_count interfaces."); + flashAlert("Type set to $type on $interface_count interfaces."); } @@ -1586,7 +1586,7 @@ if (isset($_POST['bulk_edit_asset_interface_network'])) { 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 $network_name on $interface_count interfaces."); + flashAlert("Network set to $network_name on $interface_count interfaces."); } redirect(); @@ -1629,7 +1629,7 @@ if (isset($_POST['bulk_edit_asset_interface_ip_dhcp'])) { 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 DHCP on $interface_count interfaces."); + flashAlert("Interface IP set to DHCP on $interface_count interfaces."); } @@ -1673,7 +1673,7 @@ if (isset($_POST['bulk_delete_asset_interfaces'])) { logAudit("Asset Interface", "Bulk Delete", "$session_name deleted $interface_count interfaces for asset $asset_name", $client_id); - flash_alert("$interface_count interfaces deleted.", 'error'); + flashAlert("$interface_count interfaces deleted.", 'error'); } redirect(); @@ -1702,7 +1702,7 @@ if (isset($_POST["import_client_asset_interfaces_csv"])) { if (!empty($_FILES["file"]["tmp_name"])) { $file_name = $_FILES["file"]["tmp_name"]; } else { - flash_alert("Please select a file to upload.", 'error'); + flashAlert("Please select a file to upload.", 'error'); redirect(); } @@ -1711,13 +1711,13 @@ if (isset($_POST["import_client_asset_interfaces_csv"])) { $allowed_file_extensions = array('csv'); if (in_array($file_extension,$allowed_file_extensions) === false) { $error = true; - flash_alert("Bad file extension", 'error'); + flashAlert("Bad file extension", 'error'); } //Check file isn't empty elseif ($_FILES["file"]["size"] < 1) { $error = true; - flash_alert("Bad file size (empty?)", 'error'); + flashAlert("Bad file size (empty?)", 'error'); } //(Else)Check column count (Name, Description, Type, MAC, IP, NAT IP, IPv6, Network) @@ -1725,7 +1725,7 @@ if (isset($_POST["import_client_asset_interfaces_csv"])) { $f_columns = fgetcsv($f, 1000, ","); if (!$error & count($f_columns) != 8) { $error = true; - flash_alert("Bad column count.", 'error'); + flashAlert("Bad column count.", 'error'); } //Else, parse the file @@ -1788,7 +1788,7 @@ if (isset($_POST["import_client_asset_interfaces_csv"])) { logAudit("Asset", "Import", "$session_name imported $row_count interfaces(s) to asset $asset_name via CSV file", $client_id); - flash_alert("$row_count Interfaces(s) added to asset $asset_name, $duplicate_count duplicate(s) detected"); + flashAlert("$row_count Interfaces(s) added to asset $asset_name, $duplicate_count duplicate(s) detected"); redirect(); diff --git a/agent/post/category.php b/agent/post/category.php index b240cd86..e8e934e9 100644 --- a/agent/post/category.php +++ b/agent/post/category.php @@ -18,7 +18,7 @@ if (isset($_POST['add_category'])) { logAudit("Category", "Create", "$session_name created category $type $name", 0, $category_id); - flash_alert("Category $type $name created"); + flashAlert("Category $type $name created"); redirect(); diff --git a/agent/post/certificate.php b/agent/post/certificate.php index 08c3c4e2..44e9d4cb 100644 --- a/agent/post/certificate.php +++ b/agent/post/certificate.php @@ -40,7 +40,7 @@ if (isset($_POST['add_certificate'])) { logAudit("Certificate", "Create", "$session_name created certificate $name", $client_id, $certificate_id); - flash_alert("Certificate $name created"); + flashAlert("Certificate $name created"); redirect(); @@ -113,7 +113,7 @@ if (isset($_POST['edit_certificate'])) { logAudit("Certificate", "Edit", "$session_name edited certificate $name", $client_id, $certificate_id); - flash_alert("Certificate $name updated"); + flashAlert("Certificate $name updated"); redirect(); @@ -139,7 +139,7 @@ if (isset($_GET['archive_certificate'])) { logAudit("Certificate", "Archive", "$session_name archived certificate $certificate_name", $client_id, $certificate_id); - flash_alert("Certificate $certificate_name archived", 'alert'); + flashAlert("Certificate $certificate_name archived", 'alert'); redirect(); @@ -165,7 +165,7 @@ if (isset($_GET['restore_certificate'])) { logAudit("Certificate", "Restore", "$session_name restored certificate $certificate_name", $client_id, $certificate_id); - flash_alert("Certificate $certificate_name restored"); + flashAlert("Certificate $certificate_name restored"); redirect(); @@ -191,7 +191,7 @@ if (isset($_GET['delete_certificate'])) { logAudit("Certificate", "Delete", "$session_name deleted certificate $name", $client_id); - flash_alert("Certificate $certificate_name deleted"); + flashAlert("Certificate $certificate_name deleted"); redirect(); @@ -229,7 +229,7 @@ if (isset($_POST['bulk_delete_certificates'])) { logAudit("Certificate", "Bulk Delete", "$session_name deleted $count certificates", $client_id); - flash_alert("Deleted $count certificate(s)", 'error'); + flashAlert("Deleted $count certificate(s)", 'error'); } @@ -263,7 +263,7 @@ if (isset($_POST['export_certificates_csv'])) { $delimiter = ","; $enclosure = '"'; $escape = '\\'; // backslash - $filename = sanitize_filename($file_name_prepend . "Certificates-" . date('Y-m-d_H-i-s') . ".csv"); + $filename = sanitizeFilename($file_name_prepend . "Certificates-" . date('Y-m-d_H-i-s') . ".csv"); //create a file pointer $f = fopen('php://memory', 'w'); diff --git a/agent/post/client.php b/agent/post/client.php index 9c9445db..02c06416 100644 --- a/agent/post/client.php +++ b/agent/post/client.php @@ -246,7 +246,7 @@ if (isset($_POST['add_client'])) { logAudit("Client", "Create", "$session_name created client $name$extended_log_description", $client_id, $client_id); - flash_alert("Client $name created"); + flashAlert("Client $name created"); redirect(); @@ -324,7 +324,7 @@ if (isset($_POST['edit_client'])) { logAudit("Client", "Edit", "$session_name edited client $name", $client_id, $client_id); - flash_alert("Client $name updated"); + flashAlert("Client $name updated"); redirect(); @@ -354,7 +354,7 @@ if (isset($_GET['archive_client'])) { logAudit("Client", "Archive", "$session_name archived client $client_name", $client_id, $client_id); - flash_alert("Client $client_name archived", 'error'); + flashAlert("Client $client_name archived", 'error'); redirect(); @@ -375,7 +375,7 @@ if (isset($_GET['restore_client'])) { logAudit("Client", "Restored", "$session_name restored client $client_name", $client_id); - flash_alert("Client $client_name restored"); + flashAlert("Client $client_name restored"); redirect(); @@ -477,7 +477,7 @@ if (isset($_GET['delete_client'])) { logAudit("Client", "Deleted", "$session_name deleted Client $client_name and all associated data"); - flash_alert("Client $client_name deleted along with all associated data", 'error'); + flashAlert("Client $client_name deleted along with all associated data", 'error'); redirect('clients.php'); @@ -502,7 +502,7 @@ if (isset($_POST['export_clients_csv'])) { $delimiter = ","; $enclosure = '"'; $escape = '\\'; // backslash - $filename = sanitize_filename($session_company_name . "-Clients-" . date('Y-m-d_H-i-s') . ".csv"); + $filename = sanitizeFilename($session_company_name . "-Clients-" . date('Y-m-d_H-i-s') . ".csv"); //create a file pointer $f = fopen('php://memory', 'w'); @@ -545,7 +545,7 @@ if (isset($_POST["import_clients_csv"])) { if (!empty($_FILES["file"]["tmp_name"])) { $file_name = $_FILES["file"]["tmp_name"]; } else { - flash_alert("Please select a file to upload.", 'error'); + flashAlert("Please select a file to upload.", 'error'); redirect(); } @@ -554,13 +554,13 @@ if (isset($_POST["import_clients_csv"])) { $allowed_file_extensions = array('csv'); if (in_array($file_extension,$allowed_file_extensions) === false) { $error = true; - flash_alert("Bad file extension", 'error'); + flashAlert("Bad file extension", 'error'); } //Check file isn't empty elseif ($_FILES["file"]["size"] < 1) { $error = true; - flash_alert("Bad file size (empty?)", 'error'); + flashAlert("Bad file size (empty?)", 'error'); } //(Else)Check column count @@ -568,7 +568,7 @@ if (isset($_POST["import_clients_csv"])) { $f_columns = fgetcsv($f, 1000, ","); if (!$error & count($f_columns) != 22) { $error = true; - flash_alert("Bad column count.", 'error'); + flashAlert("Bad column count.", 'error'); } //Else, parse the file @@ -731,7 +731,7 @@ if (isset($_POST["import_clients_csv"])) { logAudit("Client", "Import", "$session_name imported $row_count client(s) via CSV file, $duplicate_count duplicate(s) found"); - flash_alert("$row_count Client(s) added, $duplicate_count duplicate(s) found"); + flashAlert("$row_count Client(s) added, $duplicate_count duplicate(s) found"); redirect(); @@ -875,7 +875,7 @@ if (isset($_POST['bulk_add_client_ticket'])) { logAudit("Ticket", "Bulk Create", "$session_name created $client_count tickets for $client_name"); - flash_alert("$client_count tickets created for selected clients"); + flashAlert("$client_count tickets created for selected clients"); } @@ -910,7 +910,7 @@ if (isset($_POST['bulk_edit_client_industry'])) { logAudit("Client", "Bulk Edit", "$session_name set the department $industry for $count client(s)", $client_id); - flash_alert("Set the Industry to $industry for $count clients"); + flashAlert("Set the Industry to $industry for $count clients"); } redirect(); @@ -944,7 +944,7 @@ if (isset($_POST['bulk_edit_client_referral'])) { logAudit("Client", "Bulk Edit", "$session_name set the referral $referral for $count client(s)", $client_id); - flash_alert("Set the Referral to $referral for $count clients"); + flashAlert("Set the Referral to $referral for $count clients"); } redirect(); @@ -978,7 +978,7 @@ if (isset($_POST['bulk_edit_client_hourly_rate'])) { 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 " . numfmt_format_currency($currency_format, $rate, $session_company_currency) . " for $count client(s)"); + flashAlert("Set the Hourly Rate to " . numfmt_format_currency($currency_format, $rate, $session_company_currency) . " for $count client(s)"); } redirect(); @@ -1012,7 +1012,7 @@ if (isset($_POST['bulk_edit_client_net_terms'])) { 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 $net_terms days for $count client(s)"); + flashAlert("Set Net Term to $net_terms days for $count client(s)"); } redirect(); @@ -1057,7 +1057,7 @@ if (isset($_POST['bulk_assign_client_tags'])) { logAudit("Client", "Bulk Edit", "$session_name added tags for $count clients", $client_id); - flash_alert("Assigned tags for $count clients"); + flashAlert("Assigned tags for $count clients"); } redirect(); @@ -1144,9 +1144,9 @@ if (isset($_POST['bulk_send_client_email']) && isset($_POST['client_ids'])) { if (!empty($data)) { addToMailQueue($data); logAudit("Bulk Mail", "Send", "$session_name sent " . count($data) . " messages via bulk mail"); - flash_alert("" . count($data) . " messages queued"); + flashAlert("" . count($data) . " messages queued"); } else { - flash_alert("No valid contacts found to queue emails.", 'error'); + flashAlert("No valid contacts found to queue emails.", 'error'); } redirect(); @@ -1181,7 +1181,7 @@ if (isset($_POST['bulk_archive_clients'])) { logAudit("Client", "Bulk Archive", "$session_name archived $count clients", $client_id); - flash_alert("Archived $count client(s)", 'error'); + flashAlert("Archived $count client(s)", 'error'); } @@ -1215,7 +1215,7 @@ if (isset($_POST['bulk_unarchive_clients'])) { logAudit("Client", "Bulk Restore", "$session_name restored $count client(s)", $client_id); - flash_alert("You restored $count client(s)"); + flashAlert("You restored $count client(s)"); } diff --git a/agent/post/contact.php b/agent/post/contact.php index 3758d95f..028a7065 100644 --- a/agent/post/contact.php +++ b/agent/post/contact.php @@ -76,7 +76,7 @@ if (isset($_POST['add_contact'])) { customAction('contact_create', $contact_id); - flash_alert("Contact $name created"); + flashAlert("Contact $name created"); redirect(); @@ -221,7 +221,7 @@ if (isset($_POST['edit_contact'])) { customAction('contact_update', $contact_id); - flash_alert("Contact $name updated"); + flashAlert("Contact $name updated"); redirect(); @@ -280,7 +280,7 @@ if (isset($_GET['archive_contact_note'])) { logAudit("Contact", "Edit", "$session_name archived note $contact_note_type for $contact_name", $client_id, $contact_id); - flash_alert("Note $contact_note_type archived", 'error'); + flashAlert("Note $contact_note_type archived", 'error'); redirect(); @@ -308,7 +308,7 @@ if (isset($_GET['restore_contact_note'])) { logAudit("Contact", "Edit", "$session_name restored note $contact_note_type for $contact_name", $client_id, $contact_id); - flash_alert("Note $contact_note_type restored"); + flashAlert("Note $contact_note_type restored"); redirect(); @@ -336,7 +336,7 @@ if (isset($_GET['delete_contact_note'])) { logAudit("Contact", "Edit", "$session_name deleted $contact_note_type note for $contact_name", $client_id, $contact_id); - flash_alert("Note $contact_note_type deleted.", 'error'); + flashAlert("Note $contact_note_type deleted.", 'error'); redirect(); @@ -380,7 +380,7 @@ if (isset($_POST['bulk_assign_contact_location'])) { logAudit("Contact", "Bulk Edit", "$session_name assigned $contact_count contacts to location $location_name", $client_id); - flash_alert("$contact_count contacts assigned to location $location_name"); + flashAlert("$contact_count contacts assigned to location $location_name"); } redirect(); @@ -420,7 +420,7 @@ if (isset($_POST['bulk_edit_contact_phone'])) { logAudit("Contact", "Bulk Edit", "$session_name set the Phone Number $phone for $contact_count contacts", $client_id); - flash_alert("Phone Number set to " . formatPhoneNumber($phone) . " on $contact_count contacts"); + flashAlert("Phone Number set to " . formatPhoneNumber($phone) . " on $contact_count contacts"); } redirect(); @@ -460,7 +460,7 @@ if (isset($_POST['bulk_edit_contact_department'])) { logAudit("Contact", "Bulk Edit", "$session_name set the department $department for $contact_count contacts", $client_id); - flash_alert("You set the Department to $department for $contact_count contacts"); + flashAlert("You set the Department to $department for $contact_count contacts"); } redirect(); @@ -504,7 +504,7 @@ if (isset($_POST['bulk_edit_contact_role'])) { logAudit("Contact", "Bulk Edit", "$session_name edited the contact role for $contact_count contacts", $client_id); - flash_alert("You updated contact roles for $contact_count contacts"); + flashAlert("You updated contact roles for $contact_count contacts"); } redirect(); @@ -557,7 +557,7 @@ if (isset($_POST['bulk_assign_contact_tags'])) { logAudit("Contact", "Bulk Edit", "$session_name added tags for $contact_count contacts", $client_id); - flash_alert("You assigned tags for $count contacts"); + flashAlert("You assigned tags for $count contacts"); } redirect(); @@ -607,7 +607,7 @@ if (isset($_POST['send_bulk_mail_now'])) { logAudit("Bulk Mail", "Send", "$session_name sent $count messages via bulk mail"); - flash_alert("$count messages queued"); + flashAlert("$count messages queued"); } @@ -659,7 +659,7 @@ if (isset($_POST['bulk_archive_contacts'])) { logAudit("Contact", "Bulk Archive", "$session_name archived $count contacts", $client_id); - flash_alert("Archived $count contact(s)", 'error'); + flashAlert("Archived $count contact(s)", 'error'); } @@ -704,7 +704,7 @@ if (isset($_POST['bulk_restore_contacts'])) { logAudit("Contact", "Bulk Restore", "$session_name restored $count contacts", $client_id); - flash_alert("Restored $count contact(s)"); + flashAlert("Restored $count contact(s)"); } @@ -749,7 +749,7 @@ if (isset($_POST['bulk_delete_contacts'])) { logAudit("Contact", "Bulk Delete", "$session_name deleted $count contacts", $client_id); - flash_alert("You deleted $count contact(s)"); + flashAlert("You deleted $count contact(s)"); } @@ -859,7 +859,7 @@ if (isset($_GET['anonymize_contact'])) { logAudit("Contact", "Archive", "$session_name archived and anonymized contact", $client_id, $contact_id); - flash_alert("Contact $contact_name anonymized & archived", 'error'); + flashAlert("Contact $contact_name anonymized & archived", 'error'); redirect(); @@ -891,7 +891,7 @@ if (isset($_GET['archive_contact'])) { logAudit("Contact", "Archive", "$session_name archived contact $contact_name", $client_id, $contact_id); - flash_alert("Contact $contact_name has been archived", 'error'); + flashAlert("Contact $contact_name has been archived", 'error'); redirect(); @@ -923,7 +923,7 @@ if (isset($_GET['restore_contact'])) { logAudit("Contact", "Restore", "$session_name restored contact $contact_name", $client_id, $contact_id); - flash_alert("Contact $contact_name Restored"); + flashAlert("Contact $contact_name Restored"); redirect(); @@ -955,7 +955,7 @@ if (isset($_GET['delete_contact'])) { logAudit("Contact", "Delete", "$session_name deleted contact $contact_name", $client_id); - flash_alert("Contact $contact_name has been deleted.", 'error'); + flashAlert("Contact $contact_name has been deleted.", 'error'); redirect(); @@ -985,7 +985,7 @@ if (isset($_POST['link_contact_to_asset'])) { logAudit("Asset", "Link", "$session_name linked asset $asset_name to contact $contact_name", $client_id, $asset_id); - flash_alert("Contact $contact_name linked with asset $asset_name"); + flashAlert("Contact $contact_name linked with asset $asset_name"); redirect(); @@ -1015,7 +1015,7 @@ if (isset($_GET['unlink_asset_from_contact'])) { logAudit("Asset", "Unlink", "$session_name unlinked contact $contact_name from asset $asset_name", $client_id, $asset_id); - flash_alert("Asset $asset_name unlinked from Contact $contact_name", 'error'); + flashAlert("Asset $asset_name unlinked from Contact $contact_name", 'error'); redirect(); @@ -1045,7 +1045,7 @@ if (isset($_POST['link_software_to_contact'])) { logAudit("Software", "Link", "$session_name added software license $software_name to contact $contact_name", $client_id, $software_id); - flash_alert("Software $software_name licensed for contact $contact_name"); + flashAlert("Software $software_name licensed for contact $contact_name"); redirect(); @@ -1075,7 +1075,7 @@ if (isset($_GET['unlink_software_from_contact'])) { logAudit("software", "Unlink", "$session_name removed software license $software_name from contact $contact_name", $client_id, $software_id); - flash_alert("Removed Software License $software_name for Contact $contact_name", 'error'); + flashAlert("Removed Software License $software_name for Contact $contact_name", 'error'); redirect(); @@ -1105,7 +1105,7 @@ if (isset($_POST['link_contact_to_credential'])) { logAudit("Asset", "Link", "$session_name linked credential $credential_name to contact $contact_name", $client_id, $credential_id); - flash_alert("Contact $contact_name linked with credential $credential_name"); + flashAlert("Contact $contact_name linked with credential $credential_name"); redirect(); @@ -1135,7 +1135,7 @@ if (isset($_GET['unlink_credential_from_contact'])) { logAudit("Credential", "Unlink", "$session_name unlinked contact $contact_name from credential $credential_name", $client_id, $credential_id); - flash_alert("Credential $credential_name unlinked from Contact $contact_name", 'error'); + flashAlert("Credential $credential_name unlinked from Contact $contact_name", 'error'); redirect(); @@ -1165,7 +1165,7 @@ if (isset($_POST['link_service_to_contact'])) { logAudit("Service", "Link", "$session_name linked contact $contact_name to service $service_name", $client_id, $service_id); - flash_alert("service $service_name linked with contact $contact_name"); + flashAlert("service $service_name linked with contact $contact_name"); redirect(); @@ -1195,7 +1195,7 @@ if (isset($_GET['unlink_service_from_contact'])) { logAudit("service", "Unlink", "$session_name unlinked contact $contact_name from service $service_name", $client_id, $service_id); - flash_alert("Contact $contact_name unlinked from service $service_name", 'error'); + flashAlert("Contact $contact_name unlinked from service $service_name", 'error'); redirect(); @@ -1226,7 +1226,7 @@ if (isset($_POST['link_contact_to_file'])) { logAudit("File", "Link", "$session_name linked contact $contact_name to file $file_name", $client_id, $file_id); - flash_alert("Contact $contact_name linked with File $file_name"); + flashAlert("Contact $contact_name linked with File $file_name"); redirect(); @@ -1256,7 +1256,7 @@ if (isset($_GET['unlink_contact_from_file'])) { logAudit("File", "Unlink", "$session_name unlinked contact $contact_name from file $file_name", $client_id, $file_id); - flash_alert("Contact $contact_name unlinked from file $file_name", 'error'); + flashAlert("Contact $contact_name unlinked from file $file_name", 'error'); redirect(); @@ -1287,7 +1287,7 @@ if (isset($_POST['export_contacts_csv'])) { $delimiter = ","; $enclosure = '"'; $escape = '\\'; // backslash - $filename = sanitize_filename($file_name_prepend . "Contacts-" . date('Y-m-d_H-i-s') . ".csv"); + $filename = sanitizeFilename($file_name_prepend . "Contacts-" . date('Y-m-d_H-i-s') . ".csv"); //create a file pointer $f = fopen('php://memory', 'w'); @@ -1335,7 +1335,7 @@ if (isset($_POST["import_contacts_csv"])) { if (!empty($_FILES["file"]["tmp_name"])) { $file_name = $_FILES["file"]["tmp_name"]; } else { - flash_alert("Please select a file to upload.", 'error'); + flashAlert("Please select a file to upload.", 'error'); redirect(); } @@ -1344,13 +1344,13 @@ if (isset($_POST["import_contacts_csv"])) { $allowed_file_extensions = array('csv'); if (in_array($file_extension,$allowed_file_extensions) === false) { $error = true; - flash_alert("Bad file extension", 'error'); + flashAlert("Bad file extension", 'error'); } //Check file isn't empty elseif ($_FILES["file"]["size"] < 1) { $error = true; - flash_alert("Bad file size (empty?)", 'error'); + flashAlert("Bad file size (empty?)", 'error'); } //(Else)Check column count @@ -1358,7 +1358,7 @@ if (isset($_POST["import_contacts_csv"])) { $f_columns = fgetcsv($f, 1000, ","); if (!$error & count($f_columns) != 8) { $error = true; - flash_alert("Bad column count.", 'error'); + flashAlert("Bad column count.", 'error'); } //Else, parse the file @@ -1415,7 +1415,7 @@ if (isset($_POST["import_contacts_csv"])) { 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'); + flashAlert("$row_count Contact(s) added, $duplicate_count duplicate(s) detected", 'warning'); redirect(); diff --git a/agent/post/credential.php b/agent/post/credential.php index c3369a87..fdd84745 100644 --- a/agent/post/credential.php +++ b/agent/post/credential.php @@ -32,7 +32,7 @@ if (isset($_POST['add_credential'])) { logAudit("Credential", "Create", "$session_name created credential $name", $client_id, $credential_id); - flash_alert("Credential $name created"); + flashAlert("Credential $name created"); redirect(); @@ -77,7 +77,7 @@ if (isset($_POST['edit_credential'])) { logAudit("Credential", "Edit", "$session_name edited credential $name", $client_id, $credential_id); - flash_alert("Credential $name edited"); + flashAlert("Credential $name edited"); redirect(); @@ -103,7 +103,7 @@ if(isset($_GET['archive_credential'])){ logAudit("Credential", "Archive", "$session_name archived credential $credential_name", $client_id, $credential_id); - flash_alert("Credential $credential_name archived", 'error'); + flashAlert("Credential $credential_name archived", 'error'); redirect(); @@ -129,7 +129,7 @@ if(isset($_GET['restore_credential'])){ logAudit("Credential", "Restore", "$session_name restored credential $credential_name", $client_id, $credential_id); - flash_alert("Credential $credential_name restored"); + flashAlert("Credential $credential_name restored"); redirect(); @@ -155,7 +155,7 @@ if (isset($_GET['delete_credential'])) { logAudit("Credential", "Delete", "$session_name deleted credential $credential_name", $client_id); - flash_alert("Credential $credential_name deleted", 'error'); + flashAlert("Credential $credential_name deleted", 'error'); redirect(); @@ -203,7 +203,7 @@ if (isset($_POST['bulk_assign_credential_tags'])) { logAudit("Credential", "Edit", "$session_name added tags to $credential_name", $client_id, $credential_id); - flash_alert("Assigned tags for $count credentials"); + flashAlert("Assigned tags for $count credentials"); } // End Assign Loop @@ -245,7 +245,7 @@ if (isset($_POST['bulk_favorite_credentials'])) { logAudit("Credential", "Bulk Edit", "$session_name favorited $count credentials", $client_id); - flash_alert("Favorited $count credential(s)"); + flashAlert("Favorited $count credential(s)"); } @@ -283,7 +283,7 @@ if (isset($_POST['bulk_unfavorite_credentials'])) { logAudit("Crednetial", "Bulk Edit", "$session_name unfavorited $count credentials", $client_id); - flash_alert("Unfavorited $count credential(s)"); + flashAlert("Unfavorited $count credential(s)"); } @@ -322,7 +322,7 @@ if (isset($_POST['bulk_archive_credentials'])) { logAudit("Credential", "Bulk Archive", "$session_name archived $count credentials", $client_id); - flash_alert("Archived $count credential(s)", 'error'); + flashAlert("Archived $count credential(s)", 'error'); } @@ -362,7 +362,7 @@ if (isset($_POST['bulk_restore_credentials'])) { logAudit("Credential", "Bulk Restore", "$session_name restored $count credential(s)", $client_id); - flash_alert("Restored $count credential(s)"); + flashAlert("Restored $count credential(s)"); } @@ -402,7 +402,7 @@ if (isset($_POST['bulk_delete_credentials'])) { logAudit("Credential", "Bulk Delete", "$session_name deleted $count credential(s)", $client_id); - flash_alert("Deleted $count credential(s)", 'error'); + flashAlert("Deleted $count credential(s)", 'error'); } @@ -436,7 +436,7 @@ if (isset($_POST['export_credentials_csv'])) { $delimiter = ","; $enclosure = '"'; $escape = '\\'; // backslash - $filename = sanitize_filename($file_name_prepend . "Credentials-" . date('Y-m-d_H-i-s') . ".csv"); + $filename = sanitizeFilename($file_name_prepend . "Credentials-" . date('Y-m-d_H-i-s') . ".csv"); //create a file pointer $f = fopen('php://memory', 'w'); @@ -485,7 +485,7 @@ if (isset($_POST["import_credentials_csv"])) { if (!empty($_FILES["file"]["tmp_name"])) { $file_name = $_FILES["file"]["tmp_name"]; } else { - flash_alert("Please select a file to upload.", 'error'); + flashAlert("Please select a file to upload.", 'error'); redirect(); } @@ -494,13 +494,13 @@ if (isset($_POST["import_credentials_csv"])) { $allowed_file_extensions = array('csv'); if (in_array($file_extension,$allowed_file_extensions) === false){ $error = true; - flash_alert("Bad file extension", 'error'); + flashAlert("Bad file extension", 'error'); } //Check file isn't empty elseif ($_FILES["file"]["size"] < 1){ $error = true; - flash_alert("Bad file size (empty?)", 'error'); + flashAlert("Bad file size (empty?)", 'error'); } //(Else)Check column count @@ -508,7 +508,7 @@ if (isset($_POST["import_credentials_csv"])) { $f_columns = fgetcsv($f, 1000, ","); if (!$error & count($f_columns) != 6) { $error = true; - flash_alert("Bad column count.", 'error'); + flashAlert("Bad column count.", 'error'); } //Else, parse the file @@ -560,7 +560,7 @@ if (isset($_POST["import_credentials_csv"])) { 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("$row_count credential(s) imported, $duplicate_count duplicate(s) detected and not imported", 'warning'); + flashAlert("$row_count credential(s) imported, $duplicate_count duplicate(s) detected and not imported", 'warning'); redirect(); } diff --git a/agent/post/credit.php b/agent/post/credit.php index b1beb453..c4d46112 100644 --- a/agent/post/credit.php +++ b/agent/post/credit.php @@ -24,7 +24,7 @@ if (isset($_POST['add_credit'])) { 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"); + flashAlert(numfmt_format_currency($currency_format, $amount, $session_company_currency) . " Credit Added"); redirect(); diff --git a/agent/post/document.php b/agent/post/document.php index fbbe5ec8..7e70437e 100644 --- a/agent/post/document.php +++ b/agent/post/document.php @@ -47,7 +47,7 @@ if (isset($_POST['add_document'])) { logAudit("Document", "Create", "$session_name created document $name", $client_id, $document_id); - flash_alert("Document $name created"); + flashAlert("Document $name created"); redirect(); @@ -132,7 +132,7 @@ if (isset($_POST['add_document_from_template'])) { $document_id ); - flash_alert("Document $document_name created from template"); + flashAlert("Document $document_name created from template"); redirect("document_details.php?client_id=$client_id&document_id=$document_id"); } @@ -236,7 +236,7 @@ if (isset($_POST['edit_document'])) { $document_version_id ); - flash_alert("Document $name edited, previous version kept"); + flashAlert("Document $name edited, previous version kept"); redirect("document_details.php?client_id=$client_id&document_id=$document_id"); @@ -269,7 +269,7 @@ if (isset($_POST['move_document'])) { logAudit("Document", "Move", "$session_name moved document $document_name to folder $folder_name", $client_id, $document_id); - flash_alert("Document $document_name moved to folder $folder_name"); + flashAlert("Document $document_name moved to folder $folder_name"); redirect(); @@ -299,7 +299,7 @@ if (isset($_POST['rename_document'])) { logAudit("Document", "Edit", "$session_name renamed document $old_document_name to $name", $client_id, $document_id); - flash_alert("You renamed Document from $old_document_name to $name"); + flashAlert("You renamed Document from $old_document_name to $name"); redirect(); @@ -341,7 +341,7 @@ if (isset($_POST['bulk_move_document'])) { logAudit("Document", "Bulk Move", "$session_name moved $count document(s) to folder $folder_name", $client_id); } - flash_alert("You moved $count document(s) to the folder $folder_name"); + flashAlert("You moved $count document(s) to the folder $folder_name"); redirect(); @@ -372,7 +372,7 @@ if (isset($_POST['link_file_to_document'])) { logAudit("Document", "Link", "$session_name linked file $file_name to document $document_name", $client_id, $document_id); - flash_alert("File $file_name linked with Document $document_name"); + flashAlert("File $file_name linked with Document $document_name"); redirect(); @@ -402,7 +402,7 @@ if (isset($_GET['unlink_file_from_document'])) { logAudit("Document", "Unlink", "$session_name unlinked file $file_name from document $document_name", $client_id, $document_id); - flash_alert("File $file_name unlinked from Document $document_name", 'error'); + flashAlert("File $file_name unlinked from Document $document_name", 'error'); redirect(); @@ -433,7 +433,7 @@ if (isset($_POST['link_vendor_to_document'])) { logAudit("Document", "Link", "$session_name linked vendor $vendor_name to document $document_name", $client_id, $document_id); - flash_alert("Vendor $vendor_name linked with Document $document_name"); + flashAlert("Vendor $vendor_name linked with Document $document_name"); redirect(); @@ -463,7 +463,7 @@ if (isset($_GET['unlink_vendor_from_document'])) { logAudit("Document", "Unlink", "$session_name unlinked vendor $vendor_name from document $document_name", $client_id, $document_id); - flash_alert("Vendor $vendor_name unlinked from Document $document_name", 'error'); + flashAlert("Vendor $vendor_name unlinked from Document $document_name", 'error'); redirect(); @@ -495,7 +495,7 @@ if (isset($_POST['link_contact_to_document'])) { logAudit("Document", "Link", "$session_name linked contact $contact_name to document $document_name", $client_id, $document_id); - flash_alert("Contact $contact_name linked with Document $document_name"); + flashAlert("Contact $contact_name linked with Document $document_name"); redirect(); @@ -525,7 +525,7 @@ if (isset($_GET['unlink_contact_from_document'])) { logAudit("Document", "Unlink", "$session_name unlinked contact $contact_name from document $document_name", $client_id, $document_id); - flash_alert("Contact $contact_name unlinked from Document $document_name", 'error'); + flashAlert("Contact $contact_name unlinked from Document $document_name", 'error'); redirect(); @@ -555,7 +555,7 @@ if (isset($_POST['link_asset_to_document'])) { logAudit("Document", "Link", "$session_name linked asset $asset_name to document $document_name", $client_id, $document_id); - flash_alert("Asset $asset_name linked with Document $document_name"); + flashAlert("Asset $asset_name linked with Document $document_name"); redirect(); @@ -585,7 +585,7 @@ if (isset($_GET['unlink_asset_from_document'])) { logAudit("Document", "Unlink", "$session_name unlinked asset $asset_name from document $document_name", $client_id, $document_id); - flash_alert("Asset $asset_name unlinked from Document $document_name", 'error'); + flashAlert("Asset $asset_name unlinked from Document $document_name", 'error'); redirect(); @@ -616,7 +616,7 @@ if (isset($_POST['link_software_to_document'])) { logAudit("Document", "Link", "$session_name linked software $software_name to document $document_name", $client_id, $document_id); - flash_alert("Software $software_name linked with Document $document_name"); + flashAlert("Software $software_name linked with Document $document_name"); redirect(); @@ -646,7 +646,7 @@ if (isset($_GET['unlink_software_from_document'])) { logAudit("Document", "Unlink", "$session_name unlinked software $software_name from document $document_name", $client_id, $document_id); - flash_alert("Software $software_name unlinked from Document $document_name", 'error'); + flashAlert("Software $software_name unlinked from Document $document_name", 'error'); redirect(); @@ -679,7 +679,7 @@ if (isset($_POST['toggle_document_visibility'])) { logAudit("Document", "Edit", "$session_name changed document $document_name visibilty to $visable_wording in the client portal", $client_id, $document_id); - flash_alert("Document $document_name changed to $visable_wording in the client portal"); + flashAlert("Document $document_name changed to $visable_wording in the client portal"); redirect(); @@ -727,7 +727,7 @@ if (isset($_GET['export_document'])) { // Logging logAudit("Document", "Export", "$session_name exported document $document_name", $client_id, $document_id); - flash_alert("Document $document_name exported"); + flashAlert("Document $document_name exported"); redirect(); @@ -772,7 +772,7 @@ if (isset($_GET['archive_document'])) { logAudit("Document", "Archive", "$session_name archived document $document_name", $client_id, $document_id); - flash_alert("Document $document_name archived", 'error'); + flashAlert("Document $document_name archived", 'error'); redirect(); @@ -798,7 +798,7 @@ if (isset($_GET['restore_document'])) { logAudit("Document", "Restore", "$session_name restored document $document_name", $client_id, $document_id); - flash_alert("Document $document_name Restored"); + flashAlert("Document $document_name Restored"); redirect(); @@ -824,7 +824,7 @@ if (isset($_GET['delete_document_version'])) { logAudit("Document Version", "Delete", "$session_name deleted document version $document_version_name", $client_id); - flash_alert("Document $document_version_name version deleted", 'error'); + flashAlert("Document $document_version_name version deleted", 'error'); redirect(); @@ -856,7 +856,7 @@ if (isset($_GET['delete_document'])) { logAudit("Document", "Delete", "$session_name deleted document $document_name and all versions", $client_id); - flash_alert("Document $document_name deleted and all versions", 'error'); + flashAlert("Document $document_name deleted and all versions", 'error'); // Determine redirect behavior // If there's a "from" parameter, we can use it to decide where to go diff --git a/agent/post/domain.php b/agent/post/domain.php index 590a96da..ee5f2b54 100644 --- a/agent/post/domain.php +++ b/agent/post/domain.php @@ -58,7 +58,7 @@ if (isset($_POST['add_domain'])) { logAudit("Domain", "Create", "$session_name created domain $name$extended_log_description", $client_id, $domain_id); - flash_alert("Domain $name created"); + flashAlert("Domain $name created"); redirect(); @@ -150,7 +150,7 @@ if (isset($_POST['edit_domain'])) { logAudit("Domain", "Edit", "$session_name edited domain $name", $client_id, $domain_id); - flash_alert("Domain $name edited"); + flashAlert("Domain $name edited"); redirect(); @@ -176,7 +176,7 @@ if (isset($_GET['archive_domain'])) { logAudit("Domain", "Archive", "$session_name archived domain $domain_name", $client_id, $domain_id); - flash_alert("Domain $domain_name archived", 'error'); + flashAlert("Domain $domain_name archived", 'error'); redirect(); @@ -202,7 +202,7 @@ if(isset($_GET['restore_domain'])){ logAudit("Domain", "Restore", "$session_name restored domain $domain_name", $client_id, $domain_id); - flash_alert("Domain $domain_name restored"); + flashAlert("Domain $domain_name restored"); redirect(); @@ -228,7 +228,7 @@ if (isset($_GET['delete_domain'])) { logAudit("Domain", "Delete", "$session_name deleted domain $domain_name", $client_id); - flash_alert("Domain $domain_name deleted", 'error'); + flashAlert("Domain $domain_name deleted", 'error'); redirect(); @@ -265,7 +265,7 @@ if (isset($_POST['bulk_archive_domains'])) { logAudit("Domain", "Bulk Archive", "$session_name archived $count domain(s)", $client_id); - flash_alert("Archived $count domain(s)", 'error'); + flashAlert("Archived $count domain(s)", 'error'); } @@ -305,7 +305,7 @@ if (isset($_POST['bulk_restore_domains'])) { logAudit("Domain", "Bulk Restore", "$session_name restored $count domain(s)", $client_id); - flash_alert("Restored $count domain(s)"); + flashAlert("Restored $count domain(s)"); } @@ -344,7 +344,7 @@ if (isset($_POST['bulk_delete_domains'])) { logAudit("Domain", "Bulk Delete", "$session_name deleted $count domain(s)", $client_id); - flash_alert("Deleted $count domain(s)", 'error'); + flashAlert("Deleted $count domain(s)", 'error'); } @@ -378,7 +378,7 @@ if (isset($_POST['export_domains_csv'])) { $delimiter = ","; $enclosure = '"'; $escape = '\\'; // backslash - $filename = sanitize_filename($file_name_prepend . "Domains-" . date('Y-m-d_H-i-s') . ".csv"); + $filename = sanitizeFilename($file_name_prepend . "Domains-" . date('Y-m-d_H-i-s') . ".csv"); //create a file pointer $f = fopen('php://memory', 'w'); diff --git a/agent/post/event.php b/agent/post/event.php index bfc9d19e..5163a784 100644 --- a/agent/post/event.php +++ b/agent/post/event.php @@ -19,7 +19,7 @@ if (isset($_POST['add_calendar'])) { logAudit("Calendar", "Create", "$session_name created calendar $name", 0, $calendar_id); - flash_alert("Calendar $name created"); + flashAlert("Calendar $name created"); redirect(); @@ -37,7 +37,7 @@ if (isset($_POST['edit_calendar'])) { logAudit("Calendar", "Edit", "$session_name edited calendar $name", 0, $calendar_id); - flash_alert("Calendar $name edited"); + flashAlert("Calendar $name edited"); redirect(); @@ -62,7 +62,7 @@ if (isset($_GET['delete_calendar'])) { logAudit("Calendar", "Delete", "$session_name deleted calendar $calendar_name and associated events"); - flash_alert("Calendar $calendar_name deleted", 'error'); + flashAlert("Calendar $calendar_name deleted", 'error'); redirect(); @@ -139,7 +139,7 @@ if (isset($_POST['add_event'])) { logAudit("Calendar Event", "Create", "$session_name created a calendar event titled $title in calendar $calendar_name", $client_id, $event_id); - flash_alert("Event $title created in calendar $calendar_name"); + flashAlert("Event $title created in calendar $calendar_name"); redirect(); @@ -213,7 +213,7 @@ if (isset($_POST['edit_event'])) { logAudit("Calendar Event", "Edit", "$session_name edited calendar event $title", $client_id, $event_id); - flash_alert("Calendar event titled $title edited"); + flashAlert("Calendar event titled $title edited"); redirect(); @@ -240,7 +240,7 @@ if (isset($_GET['delete_event'])) { logAudit("Calendar Event", "Delete", "$session_name deleted calendar event $event_title", $client_id); - flash_alert("Calendar event titled $event_title deleted", 'error'); + flashAlert("Calendar event titled $event_title deleted", 'error'); redirect(); diff --git a/agent/post/expense.php b/agent/post/expense.php index 5e50a35f..93fd1881 100644 --- a/agent/post/expense.php +++ b/agent/post/expense.php @@ -43,7 +43,7 @@ if (isset($_POST['add_expense'])) { logAudit("Expense", "Create", "$session_name created expense $description", $client_id, $expense_id); - flash_alert("Expense added" . $extended_alert_description); + flashAlert("Expense added" . $extended_alert_description); redirect(); @@ -90,7 +90,7 @@ if (isset($_POST['edit_expense'])) { logAudit("Expense", "Edit", "$session_name edited expense $description", $client_id, $expense_id); - flash_alert("Expense modified" . $extended_alert_description); + flashAlert("Expense modified" . $extended_alert_description); redirect(); @@ -120,7 +120,7 @@ if (isset($_GET['delete_expense'])) { logAudit("Expense", "Delete", "$session_name deleted expense $expense_description", $client_id); - flash_alert("Expense deleted", 'error'); + flashAlert("Expense deleted", 'error'); redirect(); @@ -164,7 +164,7 @@ if (isset($_POST['bulk_edit_expense_category'])) { logAudit("Expense", "Bulk Edit", "$session_name assigned $count expenses to category $category_name"); - flash_alert("You assigned expense category $category_name to $count expense(s)"); + flashAlert("You assigned expense category $category_name to $count expense(s)"); } redirect(); @@ -209,7 +209,7 @@ if (isset($_POST['bulk_edit_expense_account'])) { logAudit("Expense", "Bulk Edit", "$session_name assigned $count expense(s) to account $account_name"); - flash_alert("You assigned account $account_name to $count expense(s)"); + flashAlert("You assigned account $account_name to $count expense(s)"); } redirect(); @@ -247,7 +247,7 @@ if (isset($_POST['bulk_edit_expense_client'])) { } // End Assign Loop - flash_alert("You assigned Client $client_name to $expense_count expenses"); + flashAlert("You assigned Client $client_name to $expense_count expenses"); } redirect(); @@ -290,7 +290,7 @@ if (isset($_POST['bulk_delete_expenses'])) { logAudit("Expense", "Bulk Delete", "$session_name deleted $count expense(s)"); - flash_alert("Deleted $count expense(s)", 'error'); + flashAlert("Deleted $count expense(s)", 'error'); } @@ -361,7 +361,7 @@ if (isset($_POST['export_expenses_csv'])) { $delimiter = ","; $enclosure = '"'; $escape = '\\'; // backslash - $filename = sanitize_filename("$session_company_name-Expenses-" . date('Y-m-d_H-i-s') . ".csv"); + $filename = sanitizeFilename("$session_company_name-Expenses-" . date('Y-m-d_H-i-s') . ".csv"); //create a file pointer $f = fopen('php://memory', 'w'); diff --git a/agent/post/file.php b/agent/post/file.php index d787d408..b9438c98 100644 --- a/agent/post/file.php +++ b/agent/post/file.php @@ -63,7 +63,7 @@ if (isset($_POST['upload_files'])) { $dest_path = $upload_file_dir . $file_reference_name; if (!move_uploaded_file($file_tmp_path, $dest_path)) { - flash_alert('Error moving file to upload directory. Please ensure the directory is writable.', 'error'); + flashAlert('Error moving file to upload directory. Please ensure the directory is writable.', 'error'); continue; // Skip processing this file } @@ -94,7 +94,7 @@ if (isset($_POST['upload_files'])) { logAudit("File", "Upload", "$session_name uploaded file $file_name", $client_id, $file_id); - flash_alert("Uploaded file $file_name"); + flashAlert("Uploaded file $file_name"); } } @@ -126,7 +126,7 @@ if (isset($_POST['rename_file'])) { logAudit("File", "Rename", "$session_name renamed file $old_file_name to $file_name", $client_id, $file_id); - flash_alert("Renamed file $old_file_name to $file_name"); + flashAlert("Renamed file $old_file_name to $file_name"); redirect(); @@ -156,7 +156,7 @@ if (isset($_POST['move_file'])) { logAudit("File", "Move", "$session_name moved file $file_name to $folder_name", $client_id, $file_id); - flash_alert("File $file_name moved to $folder_name"); + flashAlert("File $file_name moved to $folder_name"); redirect(); @@ -182,7 +182,7 @@ if (isset($_GET['archive_file'])) { logAudit("File", "Archive", "$session_name archived file $file_name", $client_id, $file_id); - flash_alert("File $file_name archived", 'error'); + flashAlert("File $file_name archived", 'error'); redirect(); @@ -208,7 +208,7 @@ if (isset($_GET['restore_file'])) { logAudit("File", "Restore", "$session_name restored file $file_name", $client_id, $file_id); - flash_alert("File $file_name Restored"); + flashAlert("File $file_name Restored"); redirect(); @@ -245,7 +245,7 @@ if (isset($_POST['delete_file'])) { logAudit("File", "Delete", "$session_name deleted file $file_name", $client_id); - flash_alert("File $file_name deleted", 'alert'); + flashAlert("File $file_name deleted", 'alert'); redirect(); @@ -308,7 +308,7 @@ if (isset($_POST['bulk_archive_files'])) { logAudit("File", "Bulk Archive", "$session_name archived $document_count document(s) and $file_count file(s)", $client_id); - flash_alert("Archived $document_count Documents and $file_count files", 'error'); + flashAlert("Archived $document_count Documents and $file_count files", 'error'); redirect(); @@ -389,7 +389,7 @@ if (isset($_POST['bulk_delete_files'])) { logAudit("File", "Bulk Delete", "$session_name deleted $document_count document(s) and $file_count file(s)", $client_id); - flash_alert("Deleted $document_count Documents and $file_count files", 'error'); + flashAlert("Deleted $document_count Documents and $file_count files", 'error'); redirect(); @@ -452,7 +452,7 @@ if (isset($_POST['bulk_restore_files'])) { logAudit("File", "Bulk Restore", "$session_name restored $document_count document(s) and $file_count file(s)", $client_id); - flash_alert("Restored $document_count Documents and $file_count files"); + flashAlert("Restored $document_count Documents and $file_count files"); redirect(); @@ -563,13 +563,13 @@ if (isset($_POST['bulk_move_files'])) { // Flash message // ------------------------- if ($file_count && $document_count) { - flash_alert("Moved $file_count file(s) and $document_count document(s) to the folder $folder_name"); + flashAlert("Moved $file_count file(s) and $document_count document(s) to the folder $folder_name"); } elseif ($file_count) { - flash_alert("Moved $file_count file(s) to the folder $folder_name"); + flashAlert("Moved $file_count file(s) to the folder $folder_name"); } elseif ($document_count) { - flash_alert("Moved $document_count document(s) to the folder $folder_name"); + flashAlert("Moved $document_count document(s) to the folder $folder_name"); } else { - flash_alert("No items were moved."); + flashAlert("No items were moved."); } redirect(); @@ -601,7 +601,7 @@ if (isset($_POST['link_asset_to_file'])) { logAudit("File", "Link", "$session_name linked asset $asset_name to file $file_name", $client_id, $file_id); - flash_alert("Asset $asset_name linked to File $file_name"); + flashAlert("Asset $asset_name linked to File $file_name"); redirect(); @@ -631,7 +631,7 @@ if (isset($_GET['unlink_asset_from_file'])) { logAudit("File", "Link", "$session_name unlinked asset $asset_name from file $file_name", $client_id, $file_id); - flash_alert("Asset $asset_name unlinked from File $file_name"); + flashAlert("Asset $asset_name unlinked from File $file_name"); redirect(); diff --git a/agent/post/folder.php b/agent/post/folder.php index d09995cf..9697effa 100644 --- a/agent/post/folder.php +++ b/agent/post/folder.php @@ -25,7 +25,7 @@ if (isset($_POST['create_folder'])) { logAudit("Folder", "Create", "$session_name created folder $folder_name", $client_id, $folder_id); - flash_alert("Folder $folder_name created"); + flashAlert("Folder $folder_name created"); redirect(); @@ -53,7 +53,7 @@ if (isset($_POST['rename_folder'])) { logAudit("Folder", "Rename", "$session_name renamed folder $old_folder_name to $folder_name", $client_id, $folder_id); - flash_alert("Folder $old_folder_name renamed to $folder_name"); + flashAlert("Folder $old_folder_name renamed to $folder_name"); redirect(); @@ -87,7 +87,7 @@ if (isset($_GET['delete_folder'])) { logAudit("Folder", "Delete", "$session_name deleted folder $folder_name", $client_id); - flash_alert("Folder $folder_name deleted", 'error'); + flashAlert("Folder $folder_name deleted", 'error'); redirect(); diff --git a/agent/post/invoice.php b/agent/post/invoice.php index e9126fec..6a5c2d27 100644 --- a/agent/post/invoice.php +++ b/agent/post/invoice.php @@ -47,7 +47,7 @@ if (isset($_POST['add_invoice'])) { customAction('invoice_create', $invoice_id); - flash_alert("Invoice $config_invoice_prefix$invoice_number created"); + flashAlert("Invoice $config_invoice_prefix$invoice_number created"); redirect("invoice.php?invoice_id=$invoice_id"); @@ -87,7 +87,7 @@ if (isset($_POST['edit_invoice'])) { logAudit("Invoice", "Edit", "$session_name edited Invoice $invoice_prefix$invoice_number - $scope", $client_id, $invoice_id); - flash_alert("Invoice $invoice_prefix$invoice_number edited"); + flashAlert("Invoice $invoice_prefix$invoice_number edited"); redirect(); @@ -158,7 +158,7 @@ if (isset($_POST['add_invoice_copy'])) { customAction('invoice_create', $new_invoice_id); - flash_alert("Created new Invoice $config_invoice_prefix$new_invoice_number from $old_invoice_prefix$old_invoice_prefix"); + flashAlert("Created new Invoice $config_invoice_prefix$new_invoice_number from $old_invoice_prefix$old_invoice_prefix"); redirect("invoice.php?invoice_id=$new_invoice_id"); @@ -187,7 +187,7 @@ if (isset($_GET['mark_invoice_sent'])) { logAudit("Invoice", "Edit", "$session_name marked invoice $invoice_prefix$invoice_number sent", $client_id, $invoice_id); - flash_alert("Invoice marked sent"); + flashAlert("Invoice marked sent"); redirect(); @@ -216,7 +216,7 @@ if (isset($_GET['mark_invoice_non-billable'])) { logAudit("Invoice", "Edit", "$session_name marked invoice $invoice_prefix$invoice_number Non-Billable", $client_id, $invoice_id); - flash_alert("Invoice marked Non-Billable"); + flashAlert("Invoice marked Non-Billable"); redirect(); @@ -245,7 +245,7 @@ if (isset($_GET['cancel_invoice'])) { logAudit("Invoice", "Edit", "$session_name cancelled invoice $invoice_prefix$invoice_number", $client_id, $invoice_id); - flash_alert("Invoice $invoice_prefix$invoice_number cancelled", 'error'); + flashAlert("Invoice $invoice_prefix$invoice_number cancelled", 'error'); redirect(); @@ -296,7 +296,7 @@ if (isset($_GET['delete_invoice'])) { logAudit("Invoice", "Delete", "$session_name deleted invoice $invoice_prefix$invoice_number", $client_id); - flash_alert("Invoice $invoice_prefix$invoice_number deleted", 'error'); + flashAlert("Invoice $invoice_prefix$invoice_number deleted", 'error'); redirect(); @@ -344,7 +344,7 @@ if (isset($_POST['add_invoice_item'])) { mysqli_query($mysqli,"INSERT INTO product_stock SET stock_qty = -$qty, stock_note = 'QTY $qty - Invoice $invoice_id', stock_product_id = $product_id"); } else { // Not enough in stock: stop and notify - flash_alert("Not Enough $name in stock", 'error'); + flashAlert("Not Enough $name in stock", 'error'); redirect(); } } @@ -384,7 +384,7 @@ if (isset($_POST['add_invoice_item'])) { logAudit("Invoice", "Edit", "$session_name added item $name to invoice $invoice_prefix$invoice_number", $client_id, $invoice_id); - flash_alert("Item $name added to invoice"); + flashAlert("Item $name added to invoice"); redirect(); @@ -412,7 +412,7 @@ if (isset($_POST['invoice_note'])) { logAudit("Invoice", "Edit", "$session_name added note to invoice $invoice_prefix$invoice_number", $client_id, $invoice_id); - flash_alert("Notes added"); + flashAlert("Notes added"); redirect(); @@ -471,7 +471,7 @@ if (isset($_POST['edit_invoice_item'])) { logAudit("Invoice", "Edit", "$session_name edited item $name on invoice $invoice_prefix$invoice_number", $client_id, $invoice_id); - flash_alert("Item $name updated"); + flashAlert("Item $name updated"); redirect(); @@ -516,7 +516,7 @@ if (isset($_GET['delete_invoice_item'])) { logAudit("Invoice", "Delete", "$session_name removed item $item_name from invoice $invoice_prefix$invoice_number", $client_id, $invoice_id); - flash_alert("Item $item_name removed from invoice", 'error'); + flashAlert("Item $item_name removed from invoice", 'error'); redirect(); @@ -604,7 +604,7 @@ if (isset($_GET['email_invoice'])) { // Get Email ID for reference $email_id = mysqli_insert_id($mysqli); - flash_alert("Invoice sent!"); + flashAlert("Invoice sent!"); mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Sent', history_description = 'Invoice sent by $session_name (mail queue ID: $email_id)', history_invoice_id = $invoice_id"); @@ -686,7 +686,7 @@ if (isset($_POST['export_invoices_csv'])) { $delimiter = ","; $enclosure = '"'; $escape = '\\'; // backslash - $filename = sanitize_filename($file_name_prepend . "Invoices-$file_name_date.csv"); + $filename = sanitizeFilename($file_name_prepend . "Invoices-$file_name_date.csv"); //create a file pointer $f = fopen('php://memory', 'w'); @@ -733,7 +733,7 @@ if (isset($_POST['link_invoice_to_ticket'])) { mysqli_query($mysqli,"UPDATE invoices SET invoice_ticket_id = $ticket_id WHERE invoice_id = $invoice_id"); - flash_alert("Invoice linked to ticket"); + flashAlert("Invoice linked to ticket"); redirect(); @@ -754,7 +754,7 @@ if (isset($_POST['add_ticket_to_invoice'])) { mysqli_query($mysqli,"UPDATE tickets SET ticket_invoice_id = $invoice_id WHERE ticket_id = $ticket_id"); - flash_alert("Ticket linked to invoice"); + flashAlert("Ticket linked to invoice"); redirect("post.php?add_ticket_to_invoice=$invoice_id"); @@ -1174,7 +1174,7 @@ if (isset($_POST['bulk_edit_invoice_category'])) { logAudit("Invoice", "Bulk Edit", "$session_name assigned $count invoices to category $category_name"); - flash_alert("Assigned income category $category_name to $count invoice(s)"); + flashAlert("Assigned income category $category_name to $count invoice(s)"); } redirect(); diff --git a/agent/post/location.php b/agent/post/location.php index d30561de..23442669 100644 --- a/agent/post/location.php +++ b/agent/post/location.php @@ -58,7 +58,7 @@ if(isset($_POST['add_location'])){ logAudit("Location", "Create", "$session_name created location $name", $client_id, $location_id); - flash_alert("Location $name created."); + flashAlert("Location $name created."); redirect(); @@ -125,7 +125,7 @@ if(isset($_POST['edit_location'])){ logAudit("Location", "Edit", "$session_name edited location $name", $client_id, $location_id); - flash_alert("Location $name updated"); + flashAlert("Location $name updated"); redirect(); @@ -151,7 +151,7 @@ if(isset($_GET['archive_location'])){ logAudit("Location", "Archive", "$session_name archived location $location_name", $client_id, $location_id); - flash_alert("Location $location_name archived", 'error'); + flashAlert("Location $location_name archived", 'error'); redirect(); @@ -177,7 +177,7 @@ if(isset($_GET['restore_location'])){ logAudit("Location", "Restore", "$session_name restored location $location_name", $client_id, $location_id); - flash_alert("Location $location_name restored"); + flashAlert("Location $location_name restored"); redirect(); @@ -203,7 +203,7 @@ if(isset($_GET['delete_location'])){ logAudit("Location", "Delete", "$session_name deleted location $location_name", $client_id); - flash_alert("Location $location_name deleted", 'error'); + flashAlert("Location $location_name deleted", 'error'); redirect(); @@ -255,7 +255,7 @@ if (isset($_POST['bulk_assign_location_tags'])) { logAudit("Location", "Bulk Edit", "$session_name assigned tags to $count location(s)", $client_id); - flash_alert("Assigned tags for $count locations"); + flashAlert("Assigned tags for $count locations"); } @@ -300,7 +300,7 @@ if (isset($_POST['bulk_archive_locations'])) { logAudit("Location", "Bulk Archive", "$session_name archived $count location(s)"); - flash_alert("Archived $count location(s)", 'error'); + flashAlert("Archived $count location(s)", 'error'); } @@ -340,7 +340,7 @@ if (isset($_POST['bulk_restore_locations'])) { logAudit("Location", "Bulk Restore", "$session_name restored $count location(s)", $client_id); - flash_alert("Restored $count location(s)"); + flashAlert("Restored $count location(s)"); } @@ -380,7 +380,7 @@ if (isset($_POST['bulk_delete_locations'])) { logAudit("Location", "Bulk Delete", "$session_name deleted $count location(s)", $client_id); - flash_alert("Deleted $count location(s)", 'error'); + flashAlert("Deleted $count location(s)", 'error'); } @@ -414,7 +414,7 @@ if(isset($_POST['export_locations_csv'])){ $delimiter = ","; $enclosure = '"'; $escape = '\\'; // backslash - $filename = sanitize_filename($file_name_prepend . "Locations-" . date('Y-m-d_H-i-s') . ".csv"); + $filename = sanitizeFilename($file_name_prepend . "Locations-" . date('Y-m-d_H-i-s') . ".csv"); //create a file pointer $f = fopen('php://memory', 'w'); @@ -461,7 +461,7 @@ if (isset($_POST["import_locations_csv"])) { if (!empty($_FILES["file"]["tmp_name"])) { $file_name = $_FILES["file"]["tmp_name"]; } else { - flash_alert("Please select a file to upload.", 'error'); + flashAlert("Please select a file to upload.", 'error'); redirect(); } @@ -470,13 +470,13 @@ if (isset($_POST["import_locations_csv"])) { $allowed_file_extensions = array('csv'); if(in_array($file_extension,$allowed_file_extensions) === false){ $error = true; - flash_alert("Bad file extension", 'error'); + flashAlert("Bad file extension", 'error'); } //Check file isn't empty elseif($_FILES["file"]["size"] < 1){ $error = true; - flash_alert("Bad file size (empty?)", 'error'); + flashAlert("Bad file size (empty?)", 'error'); } //(Else)Check column count @@ -484,7 +484,7 @@ if (isset($_POST["import_locations_csv"])) { $f_columns = fgetcsv($f, 1000, ","); if(!$error & count($f_columns) != 8) { $error = true; - flash_alert("Bad column count.", 'error'); + flashAlert("Bad column count.", 'error'); } //Else, parse the file @@ -536,7 +536,7 @@ if (isset($_POST["import_locations_csv"])) { 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"); + flashAlert("$row_count Location(s) imported, $duplicate_count duplicate(s) detected and not imported"); redirect(); } diff --git a/agent/post/network.php b/agent/post/network.php index e7fcce8b..26f95150 100644 --- a/agent/post/network.php +++ b/agent/post/network.php @@ -24,7 +24,7 @@ if (isset($_POST['add_network'])) { logAudit("Network", "Create", "$session_name created network $name", $client_id, $network_id); - flash_alert("Network $name created"); + flashAlert("Network $name created"); redirect(); @@ -48,7 +48,7 @@ if (isset($_POST['edit_network'])) { logAudit("Network", "Edit", "$session_name edited network $name", $client_id, $network_id); - flash_alert("Network $name updated"); + flashAlert("Network $name updated"); redirect(); @@ -74,7 +74,7 @@ if (isset($_GET['archive_network'])) { logAudit("Network", "Archive", "$session_name archived network $network_name", $client_id, $network_id); - flash_alert("Network $network_name archived", 'error'); + flashAlert("Network $network_name archived", 'error'); redirect(); @@ -100,7 +100,7 @@ if (isset($_GET['restore_network'])) { logAudit("Network", "Restore", "$session_name restored contact $contact_name", $client_id, $network_id); - flash_alert("Network $network_name restored"); + flashAlert("Network $network_name restored"); redirect(); @@ -126,7 +126,7 @@ if (isset($_GET['delete_network'])) { logAudit("Network", "Delete", "$session_name deleted network $network_name", $client_id); - flash_alert("Network $network_name deleted", 'error'); + flashAlert("Network $network_name deleted", 'error'); redirect(); @@ -164,7 +164,7 @@ if (isset($_POST['bulk_delete_networks'])) { logAudit("Network", "Bulk Delete", "$session_name deleted $count network(s)", $client_id); - flash_alert("Deleted $count network(s)", 'error'); + flashAlert("Deleted $count network(s)", 'error'); } @@ -196,7 +196,7 @@ if (isset($_POST['export_networks_csv'])) { $delimiter = ","; $enclosure = '"'; $escape = '\\'; // backslash - $filename = sanitize_filename($file_name_prepend . "Networks-" . date('Y-m-d_H-i-s') . ".csv"); + $filename = sanitizeFilename($file_name_prepend . "Networks-" . date('Y-m-d_H-i-s') . ".csv"); //create a file pointer $f = fopen('php://memory', 'w'); @@ -283,7 +283,7 @@ if (isset($_POST['import_networks_csv'])) { if (!empty($_FILES['file']['tmp_name'])) { $file_name = $_FILES['file']['tmp_name']; } else { - flash_alert("Please select a file to upload.", 'error'); + flashAlert("Please select a file to upload.", 'error'); redirect(); } @@ -291,13 +291,13 @@ if (isset($_POST['import_networks_csv'])) { $file_extension = strtolower(end(explode('.', $_FILES['file']['name']))); if ($file_extension !== 'csv') { $error = true; - flash_alert("Bad file extension — only .csv files are accepted.", 'error'); + flashAlert("Bad file extension — only .csv files are accepted.", 'error'); } // Check not empty elseif ($_FILES['file']['size'] < 1) { $error = true; - flash_alert("Bad file size (empty file?).", 'error'); + flashAlert("Bad file size (empty file?).", 'error'); } // Check column count matches the 8-column export/template format @@ -308,7 +308,7 @@ if (isset($_POST['import_networks_csv'])) { if (count($f_columns) !== 8) { $error = true; - flash_alert("Bad column count — expected 8 columns: Name, Description, VLAN, Network (CIDR), Gateway, IP Range, Primary DNS, Secondary DNS.", 'error'); + flashAlert("Bad column count — expected 8 columns: Name, Description, VLAN, Network (CIDR), Gateway, IP Range, Primary DNS, Secondary DNS.", 'error'); } } @@ -375,7 +375,7 @@ if (isset($_POST['import_networks_csv'])) { 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"); + flashAlert("$row_count Network(s) imported, $duplicate_count duplicate(s) detected and not imported"); redirect(); } diff --git a/agent/post/payment.php b/agent/post/payment.php index 6a2605ea..fdab76d8 100644 --- a/agent/post/payment.php +++ b/agent/post/payment.php @@ -29,7 +29,7 @@ if (isset($_POST['add_payment'])) { //Check to see if amount entered is greater than the balance of the invoice if ($amount > $balance) { - flash_alert("Payment can not be more than the balance", 'error'); + flashAlert("Payment can not be more than the balance", 'error'); redirect(); } else { mysqli_query($mysqli,"INSERT INTO payments SET payment_date = '$date', payment_amount = $amount, payment_currency_code = '$currency_code', payment_account_id = $account, payment_method = '$payment_method', payment_reference = '$reference', payment_invoice_id = $invoice_id"); @@ -168,7 +168,7 @@ if (isset($_POST['add_payment'])) { customAction('invoice_pay', $invoice_id); - flash_alert("Payment amount " . numfmt_format_currency($currency_format, $amount, $invoice_currency_code) . " added"); + flashAlert("Payment amount " . numfmt_format_currency($currency_format, $amount, $invoice_currency_code) . " added"); redirect(); @@ -198,7 +198,7 @@ if (isset($_POST['edit_payment'])) { logAudit("Payment", "Edit", "Payment edited amount of " . numfmt_format_currency($currency_format, $amount, $session_company_currency)); - flash_alert("Payment edited to amount " . numfmt_format_currency($currency_format, $amount, $session_company_currency) . " added"); + flashAlert("Payment edited to amount " . numfmt_format_currency($currency_format, $amount, $session_company_currency) . " added"); redirect(); @@ -250,13 +250,13 @@ if (isset($_POST['apply_credit'])) { // Check to see if amount entered is greater than the balance of the invoice if ($credit_amount_applied > $invoice_balance) { - flash_alert("Credit can not be more than the balance", 'alert'); + flashAlert("Credit can not be more than the balance", 'alert'); redirect(); } // Check to see if amount entered is greater than the credit balance if ($credit_amount_applied > $credit_balance) { - flash_alert("Credit can not be more than the available credit", 'alert'); + flashAlert("Credit can not be more than the available credit", 'alert'); redirect(); } @@ -309,7 +309,7 @@ if (isset($_POST['apply_credit'])) { customAction('invoice_pay', $invoice_id); - flash_alert("Credit amount " . numfmt_format_currency($currency_format, $amount, $session_company_currency) . " applied"); + flashAlert("Credit amount " . numfmt_format_currency($currency_format, $amount, $session_company_currency) . " applied"); redirect(); @@ -385,13 +385,13 @@ if (isset($_POST['add_payment_stripe'])) { // Sanity checks if (!$payment_provider_client || !$saved_payment_method) { - flash_alert("Stripe not enabled or no client card saved", 'error'); + flashAlert("Stripe not enabled or no client card saved", 'error'); redirect(); } elseif ($invoice_status !== 'Sent' && $invoice_status !== 'Viewed') { - flash_alert("Invalid invoice state (draft/partial/paid/not billable)", 'error'); + flashAlert("Invalid invoice state (draft/partial/paid/not billable)", 'error'); redirect(); } elseif ($invoice_amount == 0) { - flash_alert("Invalid invoice amount", 'error'); + flashAlert("Invalid invoice amount", 'error'); redirect(); } @@ -499,7 +499,7 @@ if (isset($_POST['add_payment_stripe'])) { 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); - flash_alert("Payment amount " . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . " added"); + flashAlert("Payment amount " . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . " added"); redirect(); @@ -507,7 +507,7 @@ if (isset($_POST['add_payment_stripe'])) { 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"); 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'); + flashAlert("Payment failed", 'error'); redirect(); } @@ -570,13 +570,13 @@ if (isset($_GET['add_payment_stripe'])) { // Sanity checks if (!$config_stripe_enable || !$stripe_id || !$stripe_pm) { - flash_alert("Stripe not enabled or no client card saved", 'error'); + flashAlert("Stripe not enabled or no client card saved", 'error'); redirect(); } elseif ($invoice_status !== 'Sent' && $invoice_status !== 'Viewed') { - flash_alert("Invalid invoice state (draft/partial/paid/not billable)", 'error'); + flashAlert("Invalid invoice state (draft/partial/paid/not billable)", 'error'); redirect(); } elseif ($invoice_amount == 0) { - flash_alert("Invalid invoice amount", 'error'); + flashAlert("Invalid invoice amount", 'error'); redirect(); } @@ -684,7 +684,7 @@ if (isset($_GET['add_payment_stripe'])) { 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); - flash_alert("Payment amount " . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . " added"); + flashAlert("Payment amount " . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . " added"); redirect(); @@ -692,7 +692,7 @@ if (isset($_GET['add_payment_stripe'])) { 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"); 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'); + flashAlert("Payment failed", 'error'); redirect(); } @@ -722,7 +722,7 @@ if (isset($_POST['add_bulk_payment'])) { // Check if bulk_payment_amount exceeds total_account_balance if ($bulk_payment_amount > $total_account_balance) { - flash_alert("Payment exceeds Client Balance.", 'error'); + flashAlert("Payment exceeds Client Balance.", 'error'); redirect(); } @@ -830,7 +830,7 @@ if (isset($_POST['add_bulk_payment'])) { 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"); + flashAlert("$alert_message Bulk Payment added"); redirect(); @@ -885,9 +885,9 @@ if (isset($_GET['delete_payment'])) { logAudit("Invoice", "Edit", "$session_name deleted Payment on Invoice $invoice_prefix$invoice_number", $client_id, $invoice_id); - flash_alert("Payment deleted", 'error'); + flashAlert("Payment deleted", 'error'); if ($config_stripe_enable) { - flash_alert("Payment deleted - Stripe payments must be manually refunded in Stripe", 'error'); + flashAlert("Payment deleted - Stripe payments must be manually refunded in Stripe", 'error'); } redirect(); @@ -920,7 +920,7 @@ if (isset($_POST['export_payments_csv'])) { $delimiter = ","; $enclosure = '"'; $escape = '\\'; // backslash - $filename = sanitize_filename($file_name_prepend . "Payments-" . date('Y-m-d_H-i-s') . ".csv"); + $filename = sanitizeFilename($file_name_prepend . "Payments-" . date('Y-m-d_H-i-s') . ".csv"); //create a file pointer $f = fopen('php://memory', 'w'); diff --git a/agent/post/product.php b/agent/post/product.php index e69f8ec9..d77d6104 100644 --- a/agent/post/product.php +++ b/agent/post/product.php @@ -21,7 +21,7 @@ if (isset($_POST['add_product'])) { logAudit("Product", "Create", "$session_name created product $name", 0, $product_id); - flash_alert("Product $name created"); + flashAlert("Product $name created"); redirect(); @@ -41,7 +41,7 @@ if (isset($_POST['edit_product'])) { logAudit("Product", "Edit", "$session_name edited product $name", 0, $product_id); - flash_alert("Product $name edited"); + flashAlert("Product $name edited"); redirect(); @@ -61,7 +61,7 @@ if (isset($_GET['archive_product'])) { logAudit("Product", "Archive", "$session_name archived product $product_name", 0, $product_id); - flash_alert("Product $product_name archived", 'error'); + flashAlert("Product $product_name archived", 'error'); redirect(); @@ -81,7 +81,7 @@ if (isset($_GET['restore_product'])) { logAudit("Product", "Restore", "$session_name restored product $product_name", 0, $product_id); - flash_alert("Product $product_name restored"); + flashAlert("Product $product_name restored"); redirect(); @@ -102,7 +102,7 @@ if (isset($_GET['delete_product'])) { logAudit("Product", "Delete", "$session_name deleted product $product_name"); - flash_alert("Product $product_name deleted", 'error'); + flashAlert("Product $product_name deleted", 'error'); redirect(); @@ -139,7 +139,7 @@ if (isset($_POST['bulk_edit_product_category'])) { logAudit("Product", "Edit", "$session_name assigned category $category_name to $count product(s)"); - flash_alert("Assigned category $category_name to $count product(s)"); + flashAlert("Assigned category $category_name to $count product(s)"); } redirect(); @@ -170,7 +170,7 @@ if (isset($_POST['bulk_archive_products'])) { logAudit("Product", "Bulk Archive", "$session_name archived $count product(s)"); - flash_alert("Archived $count product(s)", 'error'); + flashAlert("Archived $count product(s)", 'error'); } @@ -203,7 +203,7 @@ if (isset($_POST['bulk_restore_products'])) { logAudit("Product", "Bulk Restore", "$session_name restored $count product(s)"); - flash_alert("Restored $count product(s)"); + flashAlert("Restored $count product(s)"); } @@ -236,7 +236,7 @@ if (isset($_POST['bulk_delete_products'])) { logAudit("Product", "Bulk Delete", "$session_name deleted $count product(s)"); - flash_alert("Deleted $count product(s)", 'error'); + flashAlert("Deleted $count product(s)", 'error'); } @@ -260,7 +260,7 @@ if (isset($_POST['export_products_csv'])) { $delimiter = ","; $enclosure = '"'; $escape = '\\'; // backslash - $filename = sanitize_filename("$session_company_name-Products-" . date('Y-m-d_H-i-s') . ".csv"); + $filename = sanitizeFilename("$session_company_name-Products-" . date('Y-m-d_H-i-s') . ".csv"); //create a file pointer $f = fopen('php://memory', 'w'); @@ -307,7 +307,7 @@ if (isset($_POST['add_product_stock'])) { logAudit("Product", "Stock", "$session_name added $qty units to stock for product $product_name", 0, $product_id); - flash_alert("Added $qty units to $product_name stock"); + flashAlert("Added $qty units to $product_name stock"); redirect(); diff --git a/agent/post/project.php b/agent/post/project.php index 68b3eefb..b0b9cff8 100644 --- a/agent/post/project.php +++ b/agent/post/project.php @@ -88,7 +88,7 @@ if (isset($_POST['add_project'])) { logAudit("Project", "Create", "$session_name created project $project_name", $client_id, $project_id); - flash_alert("You created Project $project_name"); + flashAlert("You created Project $project_name"); redirect(); @@ -116,7 +116,7 @@ if (isset($_POST['edit_project'])) { logAudit("Project", "Edit", "$session_name edited project $project_name", $client_id, $project_id); - flash_alert("Project $project_name edited"); + flashAlert("Project $project_name edited"); redirect(); @@ -145,7 +145,7 @@ if (isset($_GET['close_project'])) { logAudit("Project", "Close", "$session_name closed project $project_name", $client_id, $project_id); - flash_alert("Project $project_name closed"); + flashAlert("Project $project_name closed"); redirect(); @@ -174,7 +174,7 @@ if (isset($_GET['archive_project'])) { logAudit("Project", "Archive", "$session_name archived project $project_name", $client_id, $project_id); - flash_alert("Project $project_name archived", 'error'); + flashAlert("Project $project_name archived", 'error'); redirect(); @@ -203,7 +203,7 @@ if (isset($_GET['restore_project'])) { logAudit("Project", "Restore", "$session_name restored project $project_name", $client_id, $project_id); - flash_alert("Project $project_name restored"); + flashAlert("Project $project_name restored"); redirect(); @@ -232,7 +232,7 @@ if (isset($_GET['delete_project'])) { logAudit("Project", "Delete", "$session_name deleted project $project_name", $client_id, $project_id); - flash_alert("Project $project_name Deleted", 'error'); + flashAlert("Project $project_name Deleted", 'error'); redirect(); @@ -281,7 +281,7 @@ if (isset($_POST['link_ticket_to_project'])) { logAudit("Project", "Bulk Edit", "$session_name added $count ticket(s) to project $project_name", $client_id, $project_id); - flash_alert("$count Ticket(s) added to $project_name"); + flashAlert("$count Ticket(s) added to $project_name"); } redirect(); @@ -311,7 +311,7 @@ if (isset($_POST['link_closed_ticket_to_project'])) { // Get ticket details $sql = mysqli_query($mysqli, "SELECT ticket_id, ticket_prefix, ticket_number, ticket_subject, ticket_updated_at FROM tickets WHERE ticket_number = $ticket_number"); if (mysqli_num_rows($sql) == 0) { - flash_alert("Cannot merge into that ticket.", 'error'); + flashAlert("Cannot merge into that ticket.", 'error'); redirect(); } $row = mysqli_fetch_assoc($sql); @@ -325,7 +325,7 @@ if (isset($_POST['link_closed_ticket_to_project'])) { 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 $project_name"); + flashAlert("Ticket added to $project_name"); redirect(); diff --git a/agent/post/quote.php b/agent/post/quote.php index a2d2eccb..73b279a5 100644 --- a/agent/post/quote.php +++ b/agent/post/quote.php @@ -42,7 +42,7 @@ if (isset($_POST['add_quote'])) { customAction('quote_create', $quote_id); - flash_alert("Quote $config_quote_prefix$quote_number created"); + flashAlert("Quote $config_quote_prefix$quote_number created"); redirect("quote.php?quote_id=$quote_id"); @@ -114,7 +114,7 @@ if (isset($_POST['add_quote_copy'])) { customAction('quote_create', $new_quote_id); - flash_alert("Quote copied"); + flashAlert("Quote copied"); redirect("quote.php?quote_id=$new_quote_id"); @@ -207,7 +207,7 @@ if (isset($_POST['add_quote_to_invoice'])) { customAction('invoice_create', $new_invoice_id); - flash_alert("Invoice created from quote $quote_prefix$quote_number"); + flashAlert("Invoice created from quote $quote_prefix$quote_number"); redirect("invoice.php?invoice_id=$new_invoice_id"); @@ -267,7 +267,7 @@ if (isset($_POST['add_quote_item'])) { logAudit("Quote", "Edit", "$session_name added item $name to quote $quote_prefix$quote_number", $client_id, $quote_id); - flash_alert("Item $name added"); + flashAlert("Item $name added"); redirect(); @@ -326,7 +326,7 @@ if (isset($_POST['edit_quote_item'])) { logAudit("Quote", "Edit", "$session_name edited item $name on quote $quote_prefix$quote_number", $client_id, $quote_id); - flash_alert("Item $name updated"); + flashAlert("Item $name updated"); redirect(); @@ -354,7 +354,7 @@ if (isset($_POST['quote_note'])) { logAudit("Quote", "Edit", "$session_name added notes to quote $quote_prefix$quote_number", $client_id, $quote_id); - flash_alert("Notes added"); + flashAlert("Notes added"); redirect(); @@ -392,7 +392,7 @@ if (isset($_POST['edit_quote'])) { logAudit("Quote", "Edit", "$session_name edited quote $quote_prefix$quote_number", $client_id, $quote_id); - flash_alert("Quote edited"); + flashAlert("Quote edited"); redirect(); @@ -433,7 +433,7 @@ if (isset($_GET['delete_quote'])) { logAudit("Quote", "Delete", "$session_name deleted quote $quote_prefix$quote_number", $client_id); - flash_alert("Quote $quote_prefix$quote_number deleted", 'error'); + flashAlert("Quote $quote_prefix$quote_number deleted", 'error'); if (isset($_GET['client_id'])) { $client_id = intval($_GET['client_id']); @@ -476,7 +476,7 @@ if (isset($_GET['delete_quote_item'])) { logAudit("Quote", "Edit", "$session_name removed item $item_name from $quote_prefix$quote_number", $client_id, $quote_id); - flash_alert("Item $item_name removed", 'error'); + flashAlert("Item $item_name removed", 'error'); redirect(); @@ -504,7 +504,7 @@ if (isset($_GET['mark_quote_sent'])) { logAudit("Quote", "Sent", "$session_name marked quote $quote_prefix$quote_number as sent", $client_id, $quote_id); - flash_alert("Quote marked sent"); + flashAlert("Quote marked sent"); redirect(); @@ -534,7 +534,7 @@ if (isset($_GET['accept_quote'])) { customAction('quote_accept', $quote_id); - flash_alert("Quote accepted"); + flashAlert("Quote accepted"); redirect(); @@ -564,7 +564,7 @@ if (isset($_GET['decline_quote'])) { logAudit("Quote", "Edit", "$session_name marked quote $quote_prefix$quote_number as declined", $client_id, $quote_id); - flash_alert("Quote declined", 'error'); + flashAlert("Quote declined", 'error'); redirect(); @@ -641,7 +641,7 @@ if (isset($_GET['email_quote'])) { logAudit("Quote", "Email", "$session_name emailed quote $quote_prefix$quote_number to $contact_email", $client_id, $quote_id); - flash_alert("Quote sent!"); + flashAlert("Quote sent!"); //Don't change the status to sent if the status is anything but draft if ($quote_status == 'Draft') { @@ -674,7 +674,7 @@ if (isset($_GET['mark_quote_invoiced'])) { logAudit("Quote", "Sent", "$session_name marked quote $quote_prefix$quote_number as invoiced", $client_id, $quote_id); - flash_alert("Quote marked invoiced"); + flashAlert("Quote marked invoiced"); redirect(); @@ -707,7 +707,7 @@ if(isset($_POST['export_quotes_csv'])){ $delimiter = ","; $enclosure = '"'; $escape = '\\'; // backslash - $filename = sanitize_filename($file_name_prepend . "Quotes-" . date('Y-m-d_H-i-s') . ".csv"); + $filename = sanitizeFilename($file_name_prepend . "Quotes-" . date('Y-m-d_H-i-s') . ".csv"); //create a file pointer $f = fopen('php://memory', 'w'); @@ -735,7 +735,7 @@ if(isset($_POST['export_quotes_csv'])){ logAudit("Quote", "Export", "$session_name exported $num_rows quote(s) to a CSV file"); - flash_alert("Exported $num_rows quote(s)"); + flashAlert("Exported $num_rows quote(s)"); exit; diff --git a/agent/post/rack.php b/agent/post/rack.php index ed6db65c..2ce68561 100644 --- a/agent/post/rack.php +++ b/agent/post/rack.php @@ -47,7 +47,7 @@ if (isset($_POST['add_rack'])) { logAudit("Rack", "Create", "$session_name created rack $name", $client_id, $rack_id); - flash_alert("Rack $name created"); + flashAlert("Rack $name created"); redirect(); @@ -94,7 +94,7 @@ if (isset($_POST['edit_rack'])) { logAudit("Rack", "Edit", "$session_name edited rack $name", $client_id, $rack_id); - flash_alert("Rack $name edited"); + flashAlert("Rack $name edited"); redirect(); @@ -120,7 +120,7 @@ if (isset($_GET['archive_rack'])) { logAudit("Rack", "Archive", "$session_name archived rack $rack_name", $client_id, $rack_id); - flash_alert("Rack $rack_name archived", 'error'); + flashAlert("Rack $rack_name archived", 'error'); redirect(); @@ -146,7 +146,7 @@ if (isset($_GET['restore_rack'])) { logAudit("Rack", "Restore", "$session_name restored rack $rack_name", $client_id, $rack_id); - flash_alert("Rack $rack_name Restored"); + flashAlert("Rack $rack_name Restored"); redirect(); @@ -178,7 +178,7 @@ if (isset($_GET['delete_rack'])) { logAudit("Rack", "Delete", "$session_name deleted rack $rack_name", $client_id); - flash_alert("Rack $rack_name deleted", 'error'); + flashAlert("Rack $rack_name deleted", 'error'); redirect(); @@ -206,7 +206,7 @@ if (isset($_POST['add_rack_unit'])) { // **New Validation Check** if ($unit_start > $unit_end) { - flash_alert("Unit Start number cannot be higher than Unit End number.", 'error'); + flashAlert("Unit Start number cannot be higher than Unit End number.", 'error'); redirect(); } @@ -215,7 +215,7 @@ if (isset($_POST['add_rack_unit'])) { if (mysqli_num_rows($check_sql) > 0) { // If there is an overlap, return an error message; - flash_alert("Units $unit_start to $unit_end are already in use by another device.", 'error'); + flashAlert("Units $unit_start to $unit_end are already in use by another device.", 'error'); redirect(); } @@ -226,7 +226,7 @@ if (isset($_POST['add_rack_unit'])) { 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 $name added to units $unit_start - $unit_end in rack."); + flashAlert("Device $name added to units $unit_start - $unit_end in rack."); redirect(); @@ -257,7 +257,7 @@ if (isset($_POST['edit_rack_unit'])) { logAudit("Rack", "Edit", "$session_name edited device $name in rack $rack_name", $client_id, $rack_id); - flash_alert("Device $name edited on the rack"); + flashAlert("Device $name edited on the rack"); redirect(); @@ -285,7 +285,7 @@ if (isset($_GET['remove_rack_unit'])) { logAudit("Rack", "Edit", "$session_name removed device $device_name from rack $rack_name", $client_id, $rack_id); - flash_alert("Device $device_name removed from rack", 'error'); + flashAlert("Device $device_name removed from rack", 'error'); redirect(); diff --git a/agent/post/recurring_expense.php b/agent/post/recurring_expense.php index 16c249e1..1db7e087 100644 --- a/agent/post/recurring_expense.php +++ b/agent/post/recurring_expense.php @@ -35,7 +35,7 @@ if (isset($_POST['create_recurring_expense'])) { logAudit("Recurring Expense", "Create", "$session_name created recurring expense $description", $client_id, $recurring_expense_id); - flash_alert("Recurring Expense created"); + flashAlert("Recurring Expense created"); redirect(); @@ -69,7 +69,7 @@ if (isset($_POST['edit_recurring_expense'])) { logAudit("Recurring Expense", "Edit", "$session_name edited recurring expense $description", $client_id, $recurring_expense_id); - flash_alert("Recurring Expense edited"); + flashAlert("Recurring Expense edited"); redirect(); @@ -93,7 +93,7 @@ if (isset($_GET['delete_recurring_expense'])) { logAudit("Recurring Expense", "Delete", "$session_name deleted recurring expense $recurring_expense_description", $client_id); - flash_alert("Recurring Expense deleted", 'error'); + flashAlert("Recurring Expense deleted", 'error'); redirect(); diff --git a/agent/post/recurring_invoice.php b/agent/post/recurring_invoice.php index a6f8d6ec..7b9c7eb6 100644 --- a/agent/post/recurring_invoice.php +++ b/agent/post/recurring_invoice.php @@ -64,7 +64,7 @@ if (isset($_POST['add_invoice_recurring'])) { 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 $invoice_prefix$invoice_number"); + flashAlert("Created recurring Invoice from Invoice $invoice_prefix$invoice_number"); redirect("recurring_invoice.php?recurring_invoice_id=$recurring_invoice_id"); @@ -103,7 +103,7 @@ if (isset($_POST['add_recurring_invoice'])) { 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 $config_recurring_invoice_prefix$recurring_invoice_number created"); + flashAlert("Recurring Invoice $config_recurring_invoice_prefix$recurring_invoice_number created"); redirect("recurring_invoice.php?recurring_invoice_id=$recurring_invoice_id"); @@ -147,7 +147,7 @@ if (isset($_POST['edit_recurring_invoice'])) { 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 $recurring_invoice_prefix$recurring_invoice_number edited"); + flashAlert("Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number edited"); redirect(); @@ -189,7 +189,7 @@ if (isset($_GET['delete_recurring_invoice'])) { logAudit("Recurring Invoice", "Delete", "$session_name deleted recurring invoice $recurring_invoice_prefix$recurring_invoice_number - $recurring_invoice_scope", $client_id); - flash_alert("Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number deleted", 'error'); + flashAlert("Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number deleted", 'error'); redirect(); @@ -249,7 +249,7 @@ if (isset($_POST['add_recurring_invoice_item'])) { 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 $name added to Recurring Invoice"); + flashAlert("Item $name added to Recurring Invoice"); redirect(); @@ -309,7 +309,7 @@ if (isset($_POST['edit_recurring_invoice_item'])) { // Logging 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 $name updated"); + flashAlert("Item $name updated"); redirect(); @@ -337,7 +337,7 @@ if (isset($_POST['recurring_invoice_note'])) { 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"); + flashAlert("Notes added"); redirect(); @@ -375,7 +375,7 @@ if (isset($_GET['delete_recurring_invoice_item'])) { logAudit("Recurring Invoice", "Edit", "$session_name removed item $item_name from recurring invoice $recurring_invoice_prefix$recurring_invoice_number", $client_id); - flash_alert("Item $item_name removed", 'error'); + flashAlert("Item $item_name removed", 'error'); redirect(); @@ -542,7 +542,7 @@ if (isset($_GET['force_recurring'])) { customAction('invoice_create', $new_invoice_id); - flash_alert("Recurring Invoice Forced"); + flashAlert("Recurring Invoice Forced"); redirect(); @@ -591,14 +591,14 @@ if (isset($_POST['set_recurring_payment'])) { 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 $saved_payment_description enabled for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number"); + flashAlert("Automatic Payment $saved_payment_description enabled for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number"); } else { // Delete mysqli_query($mysqli, "DELETE FROM recurring_payments WHERE recurring_payment_recurring_invoice_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 Disabled for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number", 'error'); + flashAlert("Automatic Payment Disabled for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number", 'error'); } redirect(); @@ -687,7 +687,7 @@ if (isset($_GET['recurring_invoice_email_notify'])) { 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 $notify_wording", 'error'); + flashAlert("Email Notifications $notify_wording", 'error'); redirect(); diff --git a/agent/post/recurring_ticket.php b/agent/post/recurring_ticket.php index 88be7762..f5f0e377 100644 --- a/agent/post/recurring_ticket.php +++ b/agent/post/recurring_ticket.php @@ -34,7 +34,7 @@ if (isset($_POST['add_recurring_ticket'])) { logAudit("Recurring Ticket", "Create", "$session_name created recurring ticket for $subject - $frequency", $client_id, $recurring_ticket_id); - flash_alert("Recurring ticket $subject - $frequency created"); + flashAlert("Recurring ticket $subject - $frequency created"); redirect(); @@ -68,7 +68,7 @@ if (isset($_POST['edit_recurring_ticket'])) { logAudit("Recurring Ticket", "Edit", "$session_name edited recurring ticket $subject", $client_id, $recurring_ticket_id); - flash_alert("Recurring ticket $subject - $frequency updated"); + flashAlert("Recurring ticket $subject - $frequency updated"); redirect(); @@ -211,7 +211,7 @@ if (isset($_POST['bulk_force_recurring_tickets'])) { } - flash_alert("$count Recurring Tickets Forced"); + flashAlert("$count Recurring Tickets Forced"); } redirect(); @@ -347,12 +347,12 @@ if (isset($_GET['force_recurring_ticket'])) { 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"); + flashAlert("Recurring Ticket Forced"); redirect(); } else { - flash_alert("Recurring Ticket Force failed", 'error'); + flashAlert("Recurring Ticket Force failed", 'error'); redirect(); } @@ -380,7 +380,7 @@ if (isset($_GET['delete_recurring_ticket'])) { logAudit("Recurring Ticket", "Delete", "$session_name deleted recurring ticket $subject", $client_id, $recurring_ticket_id); - flash_alert("Recurring ticket $subject - $frequency deleted", 'error'); + flashAlert("Recurring ticket $subject - $frequency deleted", 'error'); redirect(); @@ -418,7 +418,7 @@ if (isset($_POST['bulk_delete_recurring_tickets'])) { logAudit("Recurring Ticket", "Bulk Delete", "$session_name deleted $count recurring ticket(s)"); - flash_alert("Deleted $count recurring ticket(s)", 'error'); + flashAlert("Deleted $count recurring ticket(s)", 'error'); } redirect(); @@ -464,7 +464,7 @@ if (isset($_POST['bulk_assign_recurring_ticket'])) { $agent_email = escapeSql($agent_details['user_email']); if (!$agent_name) { - flash_alert("Invalid agent!", 'error'); + flashAlert("Invalid agent!", 'error'); redirect(); } } @@ -511,7 +511,7 @@ if (isset($_POST['bulk_assign_recurring_ticket'])) { } } - flash_alert("Assigned $recurring_ticket_count Recurring Tickets to $agent_name"); + flashAlert("Assigned $recurring_ticket_count Recurring Tickets to $agent_name"); redirect(); @@ -553,7 +553,7 @@ if (isset($_POST['bulk_edit_recurring_ticket_priority'])) { logAudit("Recurring Ticket", " Bulk Edit", "$session_name updated the priority to $priority on $recurring_ticket_count Recurring Tickets"); - flash_alert("Priority updated to $priority for $recurring_ticket_count Recurring Tickets"); + flashAlert("Priority updated to $priority for $recurring_ticket_count Recurring Tickets"); } redirect(); @@ -595,7 +595,7 @@ if (isset($_POST['bulk_edit_recurring_ticket_category'])) { 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 $recurring_ticket_count Recurring Tickets"); + flashAlert("Category set to $category_name for $recurring_ticket_count Recurring Tickets"); } redirect(); @@ -646,7 +646,7 @@ if (isset($_POST['bulk_edit_recurring_ticket_billable'])) { 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 $recurring_ticket_count Recurring Tickets"); + flashAlert("Billable status set to $billable_status for $recurring_ticket_count Recurring Tickets"); } redirect(); @@ -686,7 +686,7 @@ if (isset($_POST['bulk_edit_recurring_ticket_next_run_date'])) { 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 $next_run_date for $recurring_ticket_count Recurring Tickets"); + flashAlert("Next run date set to $next_run_date for $recurring_ticket_count Recurring Tickets"); } redirect(); diff --git a/agent/post/revenue.php b/agent/post/revenue.php index a76e6be2..3c98f5ce 100644 --- a/agent/post/revenue.php +++ b/agent/post/revenue.php @@ -26,7 +26,7 @@ if (isset($_POST['add_revenue'])) { logAudit("Revenue", "Create", "$session_name added revenue $description", 0, $revenue_id); - flash_alert("Revenue added"); + flashAlert("Revenue added"); redirect(); @@ -51,7 +51,7 @@ if (isset($_POST['edit_revenue'])) { logAudit("Revenue", "Edit", "$session_name edited revenue $description", 0, $revenue_id); - flash_alert("Revenue edited"); + flashAlert("Revenue edited"); redirect(); @@ -72,7 +72,7 @@ if (isset($_GET['delete_revenue'])) { logAudit("Revenue", "Delete", "$session_name deleted revenue $revenue_description"); - flash_alert("Revenue removed", 'error'); + flashAlert("Revenue removed", 'error'); redirect(); diff --git a/agent/post/service.php b/agent/post/service.php index 8386e000..6e9542cf 100644 --- a/agent/post/service.php +++ b/agent/post/service.php @@ -80,7 +80,7 @@ if (isset($_POST['add_service'])) { logAudit("Service", "Create", "$session_name created service $service_name", $client_id, $service_id); - flash_alert("Service $service_name created"); + flashAlert("Service $service_name created"); redirect(); @@ -168,7 +168,7 @@ if (isset($_POST['edit_service'])) { logAudit("Service", "Edit", "$session_name edited service $service_name", $client_id, $service_id); - flash_alert("Service $service_name edited"); + flashAlert("Service $service_name edited"); redirect(); @@ -195,7 +195,7 @@ if (isset($_GET['delete_service'])) { logAudit("Service", "Delete", "$session_name deleted service $service_name", $client_id); - flash_alert("Service $service_name deleted", 'error'); + flashAlert("Service $service_name deleted", 'error'); redirect(); diff --git a/agent/post/software.php b/agent/post/software.php index 3fa7d1d3..4423165d 100644 --- a/agent/post/software.php +++ b/agent/post/software.php @@ -36,7 +36,7 @@ if (isset($_POST['add_software_from_template'])) { logAudit("Software", "Create", "$session_name created software $name using template", $client_id, $software_id); - flash_alert("Software $name created from template"); + flashAlert("Software $name created from template"); redirect(); @@ -99,7 +99,7 @@ if (isset($_POST['add_software'])) { logAudit("Software", "Create", "$session_name created software $name", $client_id, $software_id); - flash_alert("Software $name created $alert_extended"); + flashAlert("Software $name created $alert_extended"); redirect(); @@ -163,7 +163,7 @@ if (isset($_POST['edit_software'])) { logAudit("Software", "Edit", "$session_name edited software $name", $client_id, $software_id); - flash_alert("Software $name updated"); + flashAlert("Software $name updated"); redirect(); @@ -193,7 +193,7 @@ if (isset($_GET['archive_software'])) { logAudit("Software", "Archive", "$session_name archived software $software_name and removed all device/user license associations", $client_id, $software_id); - flash_alert("Software $software_name archived and removed all device/user license associations", 'error'); + flashAlert("Software $software_name archived and removed all device/user license associations", 'error'); redirect(); @@ -219,7 +219,7 @@ if (isset($_GET['delete_software'])) { logAudit("Software", "Delete", "$session_name deleted software $software_name and removed all device/user license associations", $client_id); - flash_alert("Software $software_name deleted and removed all device/user license associations", 'error'); + flashAlert("Software $software_name deleted and removed all device/user license associations", 'error'); redirect(); @@ -250,7 +250,7 @@ if (isset($_POST['export_software_csv'])) { $delimiter = ","; $enclosure = '"'; $escape = '\\'; // backslash - $filename = sanitize_filename($file_name_prepend . "Software-" . date('Y-m-d_H-i-s') . ".csv"); + $filename = sanitizeFilename($file_name_prepend . "Software-" . date('Y-m-d_H-i-s') . ".csv"); //create a file pointer $f = fopen('php://memory', 'w'); diff --git a/agent/post/tag.php b/agent/post/tag.php index 460d708f..ac88feec 100644 --- a/agent/post/tag.php +++ b/agent/post/tag.php @@ -16,7 +16,7 @@ if (isset($_POST['add_tag'])) { logAudit("Tag", "Create", "$session_name created tag $name", 0, $tag_id); - flash_alert("Tag $name created"); + flashAlert("Tag $name created"); redirect(); diff --git a/agent/post/task.php b/agent/post/task.php index 22280f6b..b988fbc6 100644 --- a/agent/post/task.php +++ b/agent/post/task.php @@ -24,7 +24,7 @@ if (isset($_POST['add_task'])) { logAudit("Task", "Create", "$session_name created task $task_name", $client_id, $task_id); - flash_alert("You created Task $task_name"); + flashAlert("You created Task $task_name"); redirect(); @@ -50,7 +50,7 @@ if (isset($_POST['edit_ticket_task'])) { logAudit("Task", "Edit", "$session_name edited task $task_name", $client_id, $task_id); - flash_alert("Task $task_name edited"); + flashAlert("Task $task_name edited"); redirect(); @@ -71,7 +71,7 @@ if (isset($_POST['edit_ticket_template_task'])) { logAudit("Task", "Edit", "$session_name edited task $task_name", 0, $task_template_id); - flash_alert("Task $task_name edited"); + flashAlert("Task $task_name edited"); redirect(); @@ -95,7 +95,7 @@ if (isset($_GET['delete_task'])) { logAudit("Task", "Delete", "$session_name deleted task $task_name", $client_id, $task_id); - flash_alert("Task $task_name deleted", 'error'); + flashAlert("Task $task_name deleted", 'error'); redirect(); @@ -129,7 +129,7 @@ if (isset($_GET['complete_task'])) { logAudit("Task", "Edit", "$session_name completed task $task_name", $client_id, $task_id); - flash_alert("Task $task_name Completed"); + flashAlert("Task $task_name Completed"); redirect(); @@ -159,7 +159,7 @@ if (isset($_GET['undo_complete_task'])) { logAudit("Task", "Edit", "$session_name marked task $task_name as incomplete", $client_id, $task_id); - flash_alert("Task $task_name marked as incomplete", 'error'); + flashAlert("Task $task_name marked as incomplete", 'error'); redirect(); @@ -335,7 +335,7 @@ if (isset($_POST['add_ticket_task_approver'])) { // Logging logAudit("Task", "Edit", "$session_name added task approver for $task_name", $client_id, $task_id); - flash_alert("Added approver"); + flashAlert("Added approver"); redirect(); } @@ -358,19 +358,19 @@ if (isset($_GET['approve_ticket_task'])) { $ticket_id = intval($approval_row['task_ticket_id']); if (!$approval_row) { - flash_alert("Cannot find/approve that task", 'error'); + flashAlert("Cannot find/approve that task", 'error'); redirect(); exit; } // Validate approver (deny) if ($required_user > 0 && $required_user !== $session_user_id) { - flash_alert("You cannot approve that task", 'error'); + flashAlert("You cannot approve that task", 'error'); redirect(); exit; } if ($required_user == 0 && $type == 'any' && $created_by == $session_user_id) { - flash_alert("You cannot approve your own task", 'error'); + flashAlert("You cannot approve your own task", 'error'); redirect(); exit; } @@ -385,7 +385,7 @@ if (isset($_GET['approve_ticket_task'])) { // Logging logAudit("Task", "Edit", "$session_name approved task $task_name (approval $approval_id)", 0, $task_id); - flash_alert("Approved"); + flashAlert("Approved"); redirect(); } @@ -402,7 +402,7 @@ if (isset($_GET['delete_ticket_task_approver'])) { logAudit("Task", "Delete", "$session_name deleted task approval request ($approval_id)", 0, 0); - flash_alert("Approval request deleted", 'error'); + flashAlert("Approval request deleted", 'error'); redirect(); @@ -428,7 +428,7 @@ if (isset($_GET['complete_all_tasks'])) { logAudit("Ticket", "Edit", "$session_name marked all tasks complete for ticket", $client_id, $ticket_id); - flash_alert("Marked all tasks Complete"); + flashAlert("Marked all tasks Complete"); redirect(); @@ -454,7 +454,7 @@ if (isset($_GET['undo_complete_all_tasks'])) { logAudit("Ticket", "Edit", "$session_name marked all tasks as incomplete for ticket", $client_id, $ticket_id); - flash_alert("Marked all tasks Incomplete", 'error'); + flashAlert("Marked all tasks Incomplete", 'error'); redirect(); diff --git a/agent/post/ticket.php b/agent/post/ticket.php index 8a9c5443..6b05352e 100644 --- a/agent/post/ticket.php +++ b/agent/post/ticket.php @@ -190,7 +190,7 @@ if (isset($_POST['add_ticket'])) { logAudit("Ticket", "Create", "$session_name created ticket $config_ticket_prefix$ticket_number - $ticket_subject", $client_id, $ticket_id); - flash_alert("Ticket $config_ticket_prefix$ticket_number created"); + flashAlert("Ticket $config_ticket_prefix$ticket_number created"); redirect("ticket.php?client_id=$client_id&ticket_id=$ticket_id"); @@ -308,7 +308,7 @@ if (isset($_POST['edit_ticket'])) { logAudit("Ticket", "Edit", "$session_name edited ticket $ticket_prefix$ticket_number", $client_id, $ticket_id); - flash_alert("Ticket $ticket_prefix$ticket_number updated"); + flashAlert("Ticket $ticket_prefix$ticket_number updated"); redirect(); @@ -352,7 +352,7 @@ if (isset($_POST['edit_ticket_priority'])) { customAction('ticket_update', $ticket_id); - flash_alert("Priority updated from $original_priority to $priority"); + flashAlert("Priority updated from $original_priority to $priority"); redirect(); @@ -443,7 +443,7 @@ if (isset($_POST['edit_ticket_contact'])) { 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 $original_contact_name to $contact_name"); + flashAlert("Contact changed from $original_contact_name to $contact_name"); redirect(); @@ -472,7 +472,7 @@ if (isset($_POST['edit_ticket_project'])) { logAudit("Ticket", "Edit", "$session_name set ticket $ticket_prefix$ticket_number project to $project_name", $client_id, $ticket_id); - flash_alert("Project changed to $project_name for Ticket $ticket_prefix$ticket_number"); + flashAlert("Project changed to $project_name for Ticket $ticket_prefix$ticket_number"); redirect(); @@ -557,7 +557,7 @@ if (isset($_POST['add_ticket_watcher'])) { } - flash_alert("Added watcher(s)"); + flashAlert("Added watcher(s)"); redirect(); @@ -598,7 +598,7 @@ if (isset($_GET['delete_ticket_watcher'])) { 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 $watcher_email", 'error'); + flashAlert("Removed ticket watcher $watcher_email", 'error'); redirect(); @@ -639,7 +639,7 @@ if (isset($_GET['delete_ticket_additional_asset'])) { logAudit("Ticket", "Edit", "$session_name removed asset $asset_name from ticket $ticket_prefix$ticket_number", $client_id, $ticket_id); - flash_alert("Removed asset $asset_name from ticket.", 'error'); + flashAlert("Removed asset $asset_name from ticket.", 'error'); redirect(); @@ -692,7 +692,7 @@ if (isset($_POST['edit_ticket_asset'])) { logAudit("Ticket", "Edit", "$session_name changed asset to $asset_name for ticket $ticket_prefix$ticket_number", $client_id, $ticket_id); - flash_alert("Ticket $ticket_prefix$ticket_number asset updated to $asset_name"); + flashAlert("Ticket $ticket_prefix$ticket_number asset updated to $asset_name"); redirect(); @@ -732,7 +732,7 @@ if (isset($_POST['edit_ticket_vendor'])) { 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 $vendor_name for ticket $ticket_prefix$ticket_number"); + flashAlert("Set vendor to $vendor_name for ticket $ticket_prefix$ticket_number"); redirect(); @@ -768,7 +768,7 @@ if (isset($_POST['assign_ticket'])) { $ticket_reply = "Ticket re-assigned to $agent_name."; if (!$agent_name) { - flash_alert("Invalid agent!", 'error'); + flashAlert("Invalid agent!", 'error'); redirect(); } } @@ -789,7 +789,7 @@ if (isset($_POST['assign_ticket'])) { } if (!$ticket_subject) { - flash_alert("Invalid ticket!", 'error'); + flashAlert("Invalid ticket!", 'error'); redirect(); } @@ -841,7 +841,7 @@ if (isset($_POST['assign_ticket'])) { customAction('ticket_assign', $ticket_id); - flash_alert("Ticket $ticket_prefix$ticket_number assigned to $agent_name"); + flashAlert("Ticket $ticket_prefix$ticket_number assigned to $agent_name"); redirect(); @@ -890,7 +890,7 @@ if (isset($_GET['delete_ticket'])) { logAudit("Ticket", "Delete", "$session_name deleted $ticket_prefix$ticket_number along with all replies", $client_id); - flash_alert("Ticket $ticket_prefix$ticket_number along with all replies deleted", 'error'); + flashAlert("Ticket $ticket_prefix$ticket_number along with all replies deleted", 'error'); customAction('ticket_delete', $ticket_id); @@ -944,7 +944,7 @@ if (isset($_POST['bulk_delete_tickets'])) { logAudit("Ticket", "Bulk Delete", "$session_name deleted $count ticket(s)"); - flash_alert("Deleted $count ticket(s)", 'error'); + flashAlert("Deleted $count ticket(s)", 'error'); } redirect(); @@ -1001,7 +1001,7 @@ if (isset($_POST['bulk_assign_ticket'])) { $ticket_reply = "Ticket re-assigned to $agent_name."; if (!$agent_name) { - flash_alert("Invalid agent!", 'error'); + flashAlert("Invalid agent!", 'error'); redirect(); } } @@ -1052,7 +1052,7 @@ if (isset($_POST['bulk_assign_ticket'])) { } } - flash_alert("You assigned $ticket_count Tickets to $agent_name"); + flashAlert("You assigned $ticket_count Tickets to $agent_name"); redirect(); @@ -1102,7 +1102,7 @@ if (isset($_POST['bulk_edit_ticket_priority'])) { logAudit("Ticket", " Bulk Edit", "$session_name updated the priority on $ticket_count"); - flash_alert("You updated the priority for $ticket_count Tickets to $priority"); + flashAlert("You updated the priority for $ticket_count Tickets to $priority"); } redirect(); @@ -1154,7 +1154,7 @@ if (isset($_POST['bulk_edit_ticket_category'])) { logAudit("Ticket", " Bulk Edit", "$session_name updated the category to $category_name on $ticket_count"); - flash_alert("Category set to $category_name for $ticket_count Tickets"); + flashAlert("Category set to $category_name for $ticket_count Tickets"); } redirect(); @@ -1175,7 +1175,7 @@ if (isset($_POST['bulk_merge_tickets'])) { // Get merge into ticket id (as it may differ from the number) $sql = mysqli_query($mysqli, "SELECT ticket_id, ticket_number FROM tickets WHERE ticket_id = $merge_into_ticket_id"); if (mysqli_num_rows($sql) == 0) { - flash_alert("Cannot merge into that ticket.", 'error'); + flashAlert("Cannot merge into that ticket.", 'error'); redirect(); } $merge_row = mysqli_fetch_assoc($sql); @@ -1227,7 +1227,7 @@ if (isset($_POST['bulk_merge_tickets'])) { mysqli_query($mysqli, "UPDATE tickets SET ticket_updated_at = NOW() WHERE ticket_id = $merge_into_ticket_id"); - flash_alert("$ticket_count tickets merged into $ticket_prefix$merge_into_ticket_number"); + flashAlert("$ticket_count tickets merged into $ticket_prefix$merge_into_ticket_number"); } @@ -1369,10 +1369,10 @@ if (isset($_POST['bulk_resolve_tickets'])) { } // End Loop } // End Array Empty Check - flash_alert("Resolved $ticket_count Tickets"); + flashAlert("Resolved $ticket_count Tickets"); if ($skipped_count > 0) { - flash_alert("Resolved $ticket_count Tickets $skipped_count ticket(s) could not be resolved because they have open tasks.", 'info'); + flashAlert("Resolved $ticket_count Tickets $skipped_count ticket(s) could not be resolved because they have open tasks.", 'info'); } redirect(); @@ -1542,7 +1542,7 @@ if (isset($_POST['bulk_ticket_reply'])) { } - flash_alert("Updated $ticket_count tickets"); + flashAlert("Updated $ticket_count tickets"); redirect(); @@ -1595,7 +1595,7 @@ if (isset($_POST['bulk_add_ticket_project'])) { } // End For Each Ticket ID Loop - flash_alert("$ticket_count Tickets added to Project $project_name"); + flashAlert("$ticket_count Tickets added to Project $project_name"); } @@ -1715,7 +1715,7 @@ if (isset($_POST['bulk_add_asset_ticket'])) { logAudit("Ticket", "Bulk Create", "$session_name created $asset_count tickets for $asset_count"); - flash_alert("You created $asset_count tickets for the selected assets"); + flashAlert("You created $asset_count tickets for the selected assets"); } @@ -1895,10 +1895,10 @@ if (isset($_POST['add_ticket_reply'])) { customAction('reply_reply_agent_public', $ticket_id); } - flash_alert("Ticket $ticket_prefix$ticket_number has been updated with your reply and was $ticket_reply_type"); + flashAlert("Ticket $ticket_prefix$ticket_number has been updated with your reply and was $ticket_reply_type"); } else { - flash_alert("Ticket updated"); + flashAlert("Ticket updated"); } 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); @@ -1929,7 +1929,7 @@ if (isset($_POST['edit_ticket_reply'])) { logAudit("Ticket", "Reply", "$session_name edited ticket_reply", $client_id, $ticket_reply_id); - flash_alert("Ticket reply updated"); + flashAlert("Ticket reply updated"); redirect(); @@ -1955,7 +1955,7 @@ if (isset($_POST['redact_ticket_reply'])) { logAudit("Ticket", "Reply", "$session_name redacted ticket_reply", $client_id, $ticket_reply_id); - flash_alert("Ticket reply redacted"); + flashAlert("Ticket reply redacted"); redirect(); @@ -1981,7 +1981,7 @@ if (isset($_GET['archive_ticket_reply'])) { logAudit("Ticket Reply", "Archive", "$session_name archived ticket_reply", $client_id, $ticket_reply_id); - flash_alert("Ticket reply archived", 'error'); + flashAlert("Ticket reply archived", 'error'); redirect(); @@ -2002,7 +2002,7 @@ if (isset($_POST['merge_ticket'])) { // Get current ticket details $sql = mysqli_query($mysqli, "SELECT ticket_prefix, ticket_number, ticket_subject, ticket_details FROM tickets WHERE ticket_id = $ticket_id"); if (mysqli_num_rows($sql) == 0) { - flash_alert("No ticket with that ID found.", 'error'); + flashAlert("No ticket with that ID found.", 'error'); redirect(); } // CURRENT ticket details @@ -2017,7 +2017,7 @@ if (isset($_POST['merge_ticket'])) { // Get merge into ticket id (as it may differ from the number) $sql = mysqli_query($mysqli, "SELECT ticket_id, ticket_number, ticket_client_id FROM tickets WHERE ticket_id = $merge_into_ticket_id"); if (mysqli_num_rows($sql) == 0) { - flash_alert("Cannot merge into that ticket.", 'error'); + flashAlert("Cannot merge into that ticket.", 'error'); redirect(); } $merge_row = mysqli_fetch_assoc($sql); @@ -2034,7 +2034,7 @@ if (isset($_POST['merge_ticket'])) { } // Sanity check if ($ticket_id == $merge_into_ticket_id) { - flash_alert("Cannot merge into the same ticket.", 'error'); + flashAlert("Cannot merge into the same ticket.", 'error'); redirect(); } @@ -2061,7 +2061,7 @@ if (isset($_POST['merge_ticket'])) { customAction('ticket_merge', $ticket_id); - flash_alert("Ticket merged into $ticket_prefix$merge_into_ticket_number"); + flashAlert("Ticket merged into $ticket_prefix$merge_into_ticket_number"); redirect("ticket.php?ticket_id=$merge_into_ticket_id$has_client"); @@ -2092,7 +2092,7 @@ if (isset($_POST['change_client_ticket'])) { customAction('ticket_update', $ticket_id); - flash_alert("Ticket client updated"); + flashAlert("Ticket client updated"); redirect(); @@ -2204,7 +2204,7 @@ if (isset($_GET['resolve_ticket'])) { } //End Mail IF - flash_alert("Ticket resolved"); + flashAlert("Ticket resolved"); redirect(); @@ -2303,7 +2303,7 @@ if (isset($_GET['close_ticket'])) { } //End Mail IF - flash_alert("Ticket Closed, this cannot not be reopened but you may start another one"); + flashAlert("Ticket Closed, this cannot not be reopened but you may start another one"); redirect(); @@ -2330,7 +2330,7 @@ if (isset($_GET['reopen_ticket'])) { customAction('ticket_update', $ticket_id); - flash_alert("Ticket re-opened"); + flashAlert("Ticket re-opened"); redirect(); @@ -2451,7 +2451,7 @@ if (isset($_POST['add_invoice_from_ticket'])) { 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"); + flashAlert("Invoice $invoice_prefix$invoice_number created from ticket"); redirect("invoice.php?invoice_id=$invoice_id"); @@ -2527,7 +2527,7 @@ if (isset($_POST['add_quote_from_ticket'])) { customAction('quote_create', $quote_id); - flash_alert("Quote $config_quote_prefix$quote_number created"); + flashAlert("Quote $config_quote_prefix$quote_number created"); redirect("quote.php?quote_id=$quote_id"); } @@ -2560,7 +2560,7 @@ if (isset($_POST['export_tickets_csv'])) { $delimiter = ","; $enclosure = '"'; $escape = '\\'; // backslash - $filename = sanitize_filename($file_name_prepend . "Tickets-" . date('Y-m-d_H-i-s') . ".csv"); + $filename = sanitizeFilename($file_name_prepend . "Tickets-" . date('Y-m-d_H-i-s') . ".csv"); //create a file pointer $f = fopen('php://memory', 'w'); @@ -2618,7 +2618,7 @@ if (isset($_POST['edit_ticket_billable_status'])) { logAudit("Ticket", "Edit", "$session_name marked ticket $ticket_prefix$ticket_number as $billable_wording Billable", $client_id, $ticket_id); - flash_alert("Ticket marked $billable_wording Billable"); + flashAlert("Ticket marked $billable_wording Billable"); redirect(); @@ -2792,11 +2792,11 @@ if (isset($_POST['edit_ticket_schedule'])) { customAction('ticket_schedule', $ticket_id); if (empty($conflicting_tickets)) { - flash_alert("Ticket scheduled for $email_datetime"); + flashAlert("Ticket scheduled for $email_datetime"); redirect(); } else { $_SESSION['alert_type'] = "error"; - flash_alert("Ticket scheduled for $email_datetime. Yet there are conflicting tickets scheduled for the same time:
" . implode(",
", $conflicting_tickets), 'error'); + flashAlert("Ticket scheduled for $email_datetime. Yet there are conflicting tickets scheduled for the same time:
" . implode(",
", $conflicting_tickets), 'error'); redirect("calendar.php"); } @@ -2955,7 +2955,7 @@ if (isset($_GET['cancel_ticket_schedule'])) { customAction('ticket_unschedule', $ticket_id); - flash_alert("Ticket schedule cancelled", 'error'); + flashAlert("Ticket schedule cancelled", 'error'); redirect(); diff --git a/agent/post/transfer.php b/agent/post/transfer.php index b52c589c..5be5b4ff 100644 --- a/agent/post/transfer.php +++ b/agent/post/transfer.php @@ -37,7 +37,7 @@ if (isset($_POST['add_transfer'])) { 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 " . numfmt_format_currency($currency_format, $amount, $account_currency_code) . " from $source_account_name to $destination_account_name"); + flashAlert("Transferred " . numfmt_format_currency($currency_format, $amount, $account_currency_code) . " from $source_account_name to $destination_account_name"); redirect(); @@ -63,7 +63,7 @@ if (isset($_POST['edit_transfer'])) { logAudit("Account Transfer", "Edit", "$session_name edited transfer", 0, $transfer_id); - flash_alert("Transfer edited"); + flashAlert("Transfer edited"); redirect(); @@ -90,7 +90,7 @@ if (isset($_GET['delete_transfer'])) { logAudit("Account Transfer", "Delete", "$session_name deleted transfer"); - flash_alert("Transfer deleted", 'error'); + flashAlert("Transfer deleted", 'error'); redirect(); diff --git a/agent/post/trip.php b/agent/post/trip.php index 7bb1edd9..1792b4d9 100644 --- a/agent/post/trip.php +++ b/agent/post/trip.php @@ -26,7 +26,7 @@ if (isset($_POST['add_trip'])) { logAudit("Trip", "Create", "$session_name logged trip from $source to $destination", $client_id , $trip_id); - flash_alert("Trip from $source to $destination logged"); + flashAlert("Trip from $source to $destination logged"); redirect(); @@ -50,7 +50,7 @@ if (isset($_POST['edit_trip'])) { logAudit("Trip", "Edit", "$session_name edited trip", $client_id , $trip_id); - flash_alert("Trip edited"); + flashAlert("Trip edited"); redirect(); @@ -78,7 +78,7 @@ if (isset($_GET['delete_trip'])) { logAudit("Trip", "Delete", "$session_name deleted trip ($trip_source - $trip_destination)", $client_id); - flash_alert("Trip ($trip_source - $trip_destination) deleted", 'error'); + flashAlert("Trip ($trip_source - $trip_destination) deleted", 'error'); redirect(); @@ -127,7 +127,7 @@ if (isset($_POST['export_trips_csv'])) { $delimiter = ","; $enclosure = '"'; $escape = '\\'; // backslash - $filename = sanitize_filename($file_name_prepend . "Trips-" . date('Y-m-d_H-i-s') . ".csv"); + $filename = sanitizeFilename($file_name_prepend . "Trips-" . date('Y-m-d_H-i-s') . ".csv"); //create a file pointer $f = fopen('php://memory', 'w'); diff --git a/agent/user/post/profile.php b/agent/user/post/profile.php index 6d623ee0..66ffd790 100644 --- a/agent/user/post/profile.php +++ b/agent/user/post/profile.php @@ -82,7 +82,7 @@ if (isset($_POST['edit_your_user_details'])) { logAudit("User Account", "Edit", "$session_name edited their account $extended_log_description"); - flash_alert("User details updated"); + flashAlert("User details updated"); if ($logout) { redirect('post.php?logout'); @@ -104,7 +104,7 @@ if (isset($_GET['clear_your_user_avatar'])) { logAudit("User Account", "Edit", "$session_name cleared their avatar"); - flash_alert("Avatar cleared", 'error'); + flashAlert("Avatar cleared", 'error'); redirect(); @@ -156,7 +156,7 @@ if (isset($_POST['edit_your_user_password'])) { logAudit("User Account", "Edit", "$session_name changed their password"); - flash_alert("Your password was updated"); + flashAlert("Your password was updated"); redirect('post.php?logout'); } @@ -192,7 +192,7 @@ if (isset($_POST['edit_your_user_preferences'])) { logAudit("User Account", "Edit", "$session_name $extended_log_description"); - flash_alert("User preferences updated"); + flashAlert("User preferences updated"); redirect(); @@ -225,7 +225,7 @@ if (isset($_POST['enable_mfa'])) { logAudit("User Account", "Edit", "$session_name enabled MFA on their account"); - flash_alert("Multi-Factor authentication enabled"); + flashAlert("Multi-Factor authentication enabled"); // Clear the mfa_token from the session to avoid re-use. unset($_SESSION['mfa_token']); @@ -242,7 +242,7 @@ if (isset($_POST['enable_mfa'])) { } else { // FAILURE - flash_alert("Verification code invalid, please try again.", 'error'); + flashAlert("Verification code invalid, please try again.", 'error'); // Set a flag to automatically open the MFA modal again $_SESSION['show_mfa_modal'] = true; @@ -264,7 +264,7 @@ if (isset($_POST['enable_mfa'])) { if (isset($_GET['disable_mfa'])){ if ($session_user_config_force_mfa) { - flash_alert("Multi-Factor authentication cannot be disabled for your account", 'error'); + flashAlert("Multi-Factor authentication cannot be disabled for your account", 'error'); redirect(); } @@ -300,7 +300,7 @@ if (isset($_GET['disable_mfa'])){ logAudit("User Account", "Edit", "$session_name disabled MFA on their account"); - flash_alert("Multi-Factor authentication disabled", 'error'); + flashAlert("Multi-Factor authentication disabled", 'error'); redirect(); @@ -315,7 +315,7 @@ if (isset($_POST['revoke_your_2fa_remember_tokens'])) { logAudit("User Account", "Edit", "$session_name revoked all their remember-me tokens"); - flash_alert("Remember me tokens revoked", 'error'); + flashAlert("Remember me tokens revoked", 'error'); redirect(); diff --git a/client/post.php b/client/post.php index cef785a8..13a213c4 100644 --- a/client/post.php +++ b/client/post.php @@ -91,7 +91,7 @@ if (isset($_POST['add_ticket_comment'])) { // After stripping bad HTML, check the comment isn't just empty if (empty($comment)) { - flash_alert("You must enter a comment", 'danger'); + flashAlert("You must enter a comment", 'danger'); redirect(); } @@ -207,7 +207,7 @@ if (isset($_GET['approve_ticket_task'])) { $ticket_id = intval($approval_row['task_ticket_id']); if (!$approval_row) { - flash_alert("Cannot find/approve that task", 'warning'); + flashAlert("Cannot find/approve that task", 'warning'); redirect(); exit; } @@ -223,7 +223,7 @@ if (isset($_GET['approve_ticket_task'])) { // Logging logAudit("Task", "Edit", "Contact $session_contact_email approved task $task_name (approval $approval_id)", $session_client_id, $task_id); - flash_alert("Task Approved"); + flashAlert("Task Approved"); redirect(); } @@ -411,7 +411,7 @@ if (isset($_POST['add_contact'])) { // Check the email isn't already in use $sql = mysqli_query($mysqli, "SELECT user_id FROM users WHERE user_email = '$contact_email'"); if ($sql && mysqli_num_rows($sql) > 0) { - flash_alert("Cannot add contact as that email address is already in use", 'danger'); + flashAlert("Cannot add contact as that email address is already in use", 'danger'); redirect('contact_add.php'); } @@ -437,7 +437,7 @@ if (isset($_POST['add_contact'])) { customAction('contact_create', $contact_id); - flash_alert("Contact $contact_name created"); + flashAlert("Contact $contact_name created"); redirect('contacts.php'); @@ -466,7 +466,7 @@ if (isset($_POST['edit_contact'])) { // Check the email isn't already in use $sql = mysqli_query($mysqli, "SELECT user_id FROM users WHERE user_email = '$contact_email' AND user_id != $contact_user_id"); if ($sql && mysqli_num_rows($sql) > 0) { - flash_alert("Cannot update contact as that email address is already in use", 'danger'); + flashAlert("Cannot update contact as that email address is already in use", 'danger'); redirect('contact_edit.php?id=' . $contact_id); } @@ -487,7 +487,7 @@ if (isset($_POST['edit_contact'])) { 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"); + flashAlert("Contact $contact_name updated"); redirect('contacts.php'); @@ -560,19 +560,19 @@ if (isset($_GET['add_payment_by_provider'])) { // Sanity checks // Check to make invoice belongs to logged in client if ($client_id !== $session_client_id) { - flash_alert("Invoice does not belong to you!", 'danger'); + flashAlert("Invoice does not belong to you!", 'danger'); redirect(); } elseif ($payment_client_id !== $session_client_id) { - flash_alert("Saved Payment method does not belong to you!", 'danger'); + flashAlert("Saved Payment method does not belong to you!", 'danger'); redirect(); } elseif (!$payment_provider_client || !$saved_payment_method) { - flash_alert("Stripe not enabled or no client card saved", 'error'); + flashAlert("Stripe not enabled or no client card saved", 'error'); redirect(); } elseif ($invoice_status !== 'Sent' && $invoice_status !== 'Viewed') { - flash_alert("Invalid invoice state (draft/partial/paid/not billable)", 'error'); + flashAlert("Invalid invoice state (draft/partial/paid/not billable)", 'error'); redirect(); } elseif ($invoice_amount == 0) { - flash_alert("Invalid invoice amount", 'error'); + flashAlert("Invalid invoice amount", 'error'); redirect(); } @@ -680,7 +680,7 @@ if (isset($_GET['add_payment_by_provider'])) { 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); - flash_alert("The amount " . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . " paid Invoice $invoice_prefix$invoice_number"); + flashAlert("The amount " . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . " paid Invoice $invoice_prefix$invoice_number"); redirect(); @@ -688,7 +688,7 @@ if (isset($_GET['add_payment_by_provider'])) { 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"); 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'); + flashAlert("Payment failed", 'error'); redirect(); } @@ -713,7 +713,7 @@ if (isset($_POST['create_stripe_customer'])) { $stripe_provider = mysqli_fetch_assoc($stripe_provider_result); if (!$stripe_provider) { - flash_alert("Stripe provider is not configured in the system.", 'danger'); + flashAlert("Stripe provider is not configured in the system.", 'danger'); redirect("saved_payment_methods.php"); } @@ -721,7 +721,7 @@ if (isset($_POST['create_stripe_customer'])) { $stripe_secret_key = escapeHtml($stripe_provider['payment_provider_private_key']); if (empty($stripe_secret_key)) { - flash_alert("Stripe credentials missing. Please contact support.", 'danger'); + flashAlert("Stripe credentials missing. Please contact support.", 'danger'); redirect("saved_payment_methods.php"); } @@ -763,7 +763,7 @@ if (isset($_POST['create_stripe_customer'])) { 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."); + flashAlert("Stripe customer created. Thank you for your consent."); } catch (Exception $e) { $error = $e->getMessage(); @@ -772,12 +772,12 @@ if (isset($_POST['create_stripe_customer'])) { logApp("Stripe", "error", "Failed to create Stripe customer for $session_client_name: $error"); - flash_alert("An error occurred while creating your Stripe customer. Please try again.", 'danger'); + flashAlert("An error occurred while creating your Stripe customer. Please try again.", 'danger'); } } else { - flash_alert("Stripe customer already exists for your account.", 'danger'); + flashAlert("Stripe customer already exists for your account.", 'danger'); } redirect('saved_payment_methods.php'); @@ -873,7 +873,7 @@ if (isset($_GET['stripe_save_card'])) { $stripe_provider = mysqli_fetch_assoc($stripe_provider_result); if (!$stripe_provider) { - flash_alert("Stripe provider not configured.", 'danger'); + flashAlert("Stripe provider not configured.", 'danger'); redirect("saved_payment_methods.php"); } @@ -881,7 +881,7 @@ if (isset($_GET['stripe_save_card'])) { $stripe_secret_key = escapeHtml($stripe_provider['payment_provider_private_key']); if (empty($stripe_secret_key)) { - flash_alert("Stripe credentials missing.", 'danger'); + flashAlert("Stripe credentials missing.", 'danger'); redirect("saved_payment_methods.php"); } @@ -897,7 +897,7 @@ if (isset($_GET['stripe_save_card'])) { $stripe_customer_id = escapeSql($client_provider['payment_provider_client'] ?? ''); if (empty($stripe_customer_id)) { - flash_alert("Stripe customer ID not found for client.", 'danger'); + flashAlert("Stripe customer ID not found for client.", 'danger'); redirect("saved_payment_methods.php"); } @@ -942,7 +942,7 @@ if (isset($_GET['stripe_save_card'])) { error_log("Stripe error while saving payment method: $error"); logApp("Stripe", "error", "Exception saving payment method: $error"); - flash_alert("An error occurred while saving your payment method.", 'danger'); + flashAlert("An error occurred while saving your payment method.", 'danger'); redirect("saved_payment_methods.php"); } @@ -982,7 +982,7 @@ if (isset($_GET['stripe_save_card'])) { 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."); + flashAlert("Payment method saved – thank you."); redirect("saved_payment_methods.php"); } @@ -1006,7 +1006,7 @@ if (isset($_GET['delete_saved_payment'])) { $stripe_provider = mysqli_fetch_assoc($stripe_provider_result); if (!$stripe_provider) { - flash_alert("Stripe provider is not configured.", 'danger'); + flashAlert("Stripe provider is not configured.", 'danger'); redirect("saved_payment_methods.php"); } @@ -1014,7 +1014,7 @@ if (isset($_GET['delete_saved_payment'])) { $stripe_secret_key = escapeHtml($stripe_provider['payment_provider_private_key']); if (empty($stripe_secret_key)) { - flash_alert("Stripe credentials are missing.", 'danger'); + flashAlert("Stripe credentials are missing.", 'danger'); redirect("saved_payment_methods.php"); } @@ -1030,7 +1030,7 @@ if (isset($_GET['delete_saved_payment'])) { $saved_payment = mysqli_fetch_assoc($saved_payment_result); if (!$saved_payment) { - flash_alert("Payment method not found or does not belong to you.", 'danger'); + flashAlert("Payment method not found or does not belong to you.", 'danger'); redirect("saved_payment_methods.php"); } @@ -1054,7 +1054,7 @@ if (isset($_GET['delete_saved_payment'])) { logApp("Stripe", "error", "Exception removing payment method $payment_method_id: $error"); - flash_alert("An error occurred while removing your payment method.", 'danger'); + flashAlert("An error occurred while removing your payment method.", 'danger'); redirect("saved_payment_methods.php"); @@ -1085,7 +1085,7 @@ if (isset($_GET['delete_saved_payment'])) { 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."); + flashAlert("Payment method $saved_payment_description removed."); redirect("saved_payment_methods.php"); } @@ -1130,14 +1130,14 @@ if (isset($_POST['set_recurring_payment'])) { 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"); + flashAlert("Automatic Payment $saved_payment_description enabled for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number"); } else { // Delete mysqli_query($mysqli, "DELETE FROM recurring_payments WHERE recurring_payment_recurring_invoice_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"); + flashAlert("Automatic Payment Disabled for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number"); } redirect(); @@ -1184,7 +1184,7 @@ if (isset($_POST['client_add_document'])) { logAudit("Document", "Create", "Client contact $session_contact_name created document $document_name", $session_client_id, $document_id); - flash_alert("Document $document_name created successfully"); + flashAlert("Document $document_name created successfully"); redirect('documents.php'); @@ -1262,18 +1262,18 @@ if (isset($_POST['client_upload_document'])) { logAudit("Document", "Upload", "Client contact $session_contact_name uploaded document $document_name with file $file_name", $session_client_id, $document_id); - flash_alert("Document $document_name uploaded successfully"); + flashAlert("Document $document_name uploaded successfully"); } else { - flash_alert('Error uploading file. Please try again.', 'error'); + flashAlert('Error uploading file. Please try again.', 'error'); } } else { - flash_alert('Invalid file type. Please upload PDF, Word documents, or text files only.', 'error'); + flashAlert('Invalid file type. Please upload PDF, Word documents, or text files only.', 'error'); } } else { - flash_alert('Please select a file to upload.', 'error'); + flashAlert('Please select a file to upload.', 'error'); } redirect('documents.php'); diff --git a/functions/app.php b/functions/app.php index 925fd223..0d0b7c7f 100644 --- a/functions/app.php +++ b/functions/app.php @@ -169,7 +169,7 @@ function getFieldById($table, $id, $field, $escape_method = 'sql') { } // Recursive function to display folder options - Used in folders files and documents -function display_folder_options($parent_folder_id, $client_id, $indent = 0) { +function displayFolderOptions($parent_folder_id, $client_id, $indent = 0) { global $mysqli; $sql_folders = mysqli_query($mysqli, "SELECT * FROM folders WHERE parent_folder = $parent_folder_id AND folder_client_id = $client_id ORDER BY folder_name ASC"); @@ -190,7 +190,7 @@ function display_folder_options($parent_folder_id, $client_id, $indent = 0) { echo ""; // Recursively display subfolders - display_folder_options($folder_id, $client_id, $indent + 1); + displayFolderOptions($folder_id, $client_id, $indent + 1); } } diff --git a/functions/auth.php b/functions/auth.php index 581ebea8..16ab06fe 100644 --- a/functions/auth.php +++ b/functions/auth.php @@ -78,7 +78,7 @@ function enforceClientAccess($client_id = null) { $session_user_id = (int) $session_user_id; if (empty($client_id) || empty($session_user_id)) { - flash_alert('Access Denied.', 'error'); + flashAlert('Access Denied.', 'error'); redirect('clients.php'); } @@ -116,6 +116,6 @@ function enforceClientAccess($client_id = null) { $client_id ); - flash_alert('Access Denied - You do not have permission to access that client!', 'error'); + flashAlert('Access Denied - You do not have permission to access that client!', 'error'); redirect('clients.php'); } diff --git a/functions/request.php b/functions/request.php index bd1d7a31..a870c73e 100644 --- a/functions/request.php +++ b/functions/request.php @@ -94,7 +94,7 @@ function redirect($url = null, $permanent = false) { } //Flash Alert Function -function flash_alert(string $message, string $type = 'success'): void { +function flashAlert(string $message, string $type = 'success'): void { $_SESSION['alert_type'] = $type; $_SESSION['alert_message'] = $message; } diff --git a/functions/sanitize.php b/functions/sanitize.php index 9c9961b0..b22edaac 100644 --- a/functions/sanitize.php +++ b/functions/sanitize.php @@ -77,7 +77,7 @@ function sanitize_url($url) { } // Sanitize File Names -function sanitize_filename($filename, $strict = false) { +function sanitizeFilename($filename, $strict = false) { // Remove path information and dots around the filename $filename = basename($filename); diff --git a/guest/guest_post.php b/guest/guest_post.php index ea75b549..464914a3 100644 --- a/guest/guest_post.php +++ b/guest/guest_post.php @@ -63,7 +63,7 @@ if (isset($_GET['accept_quote'], $_GET['url_key'])) { $mail = addToMailQueue($data); } - flash_alert("Quote Accepted"); + flashAlert("Quote Accepted"); redirect(); @@ -127,7 +127,7 @@ if (isset($_GET['decline_quote'], $_GET['url_key'])) { $mail = addToMailQueue($data); } - flash_alert("Quote Declined", 'danger'); + flashAlert("Quote Declined", 'danger'); redirect(); @@ -154,7 +154,7 @@ if (isset($_GET['reopen_ticket'], $_GET['url_key'])) { customAction('ticket_update', $ticket_id); - flash_alert("Ticket reopened"); + flashAlert("Ticket reopened"); redirect(); @@ -182,7 +182,7 @@ if (isset($_GET['close_ticket'], $_GET['url_key'])) { customAction('ticket_close', $ticket_id); - flash_alert("Ticket closed"); + flashAlert("Ticket closed"); redirect(); @@ -213,7 +213,7 @@ if (isset($_GET['add_ticket_feedback'], $_GET['url_key'])) { appNotify("Feedback", "Guest rated ticket number $ticket_prefix$ticket_number (ID: $ticket_id) as bad", "/agent/ticket.php?ticket_id=$ticket_id"); } - flash_alert("Feedback recorded - thank you"); + flashAlert("Feedback recorded - thank you"); redirect(); @@ -253,7 +253,7 @@ if (isset($_GET['approve_ticket_task'])) { // Logging logAudit("Task", "Edit", "Guest user approved task $task_name via link (approval $approval_id)", 0, $task_id); - flash_alert("Task Approved"); + flashAlert("Task Approved"); redirect(); } @@ -758,7 +758,7 @@ if (isset($_POST['guest_quote_upload_file'])) { mysqli_query($mysqli, "INSERT INTO quote_files SET quote_id = $quote_id, file_id = $file_id"); // Logging & feedback - flash_alert('File uploaded!'); + flashAlert('File uploaded!'); appNotify("Quote File", "$file_name was uploaded to quote $quote_prefix$quote_number", "/agent/quote.php?quote_id=$quote_id", $client_id); @@ -767,7 +767,7 @@ if (isset($_POST['guest_quote_upload_file'])) { logAudit("File", "Upload", "Guest uploaded file $file_name to quote $quote_prefix$quote_number", $client_id); } else { - flash_alert('Something went wrong uploading the file - please let the support team know.', 'error'); + flashAlert('Something went wrong uploading the file - please let the support team know.', 'error'); logApp("Guest", "error", "Error uploading file to invoice"); }