diff --git a/.gitignore b/.gitignore index 6680ff1e..f83f4883 100644 --- a/.gitignore +++ b/.gitignore @@ -28,11 +28,11 @@ post/xcustom !post/xcustom/readme.php admin/custom/* !admin/custom/readme.php +agent/custom/* +!agent/custom/readme.php client/custom/* !client/custom/readme.php guest/custom/* !guest/custom/readme.php -user/custom/* -!user/custom/readme.php .zed diff --git a/agent/post/invoice.php b/agent/post/invoice.php index 1a050bc1..069fe47e 100644 --- a/agent/post/invoice.php +++ b/agent/post/invoice.php @@ -1205,7 +1205,7 @@ if (isset($_POST['add_payment_stripe'])) { } // Notify/log - appNotify("Invoice Paid", "Invoice $invoice_prefix$invoice_number automatically paid", "invoice.php?invoice_id=$invoice_id", $client_id); + appNotify("Invoice Paid", "Invoice $invoice_prefix$invoice_number automatically paid", "/agent/invoice.php?invoice_id=$invoice_id", $client_id); logAction("Invoice", "Payment", "$session_name initiated Stripe payment amount of " . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . " added to invoice $invoice_prefix$invoice_number - $pi_id $extended_log_desc", $client_id, $invoice_id); customAction('invoice_pay', $invoice_id); diff --git a/agent/post/recurring_invoice.php b/agent/post/recurring_invoice.php deleted file mode 100644 index e69de29b..00000000 diff --git a/client/post.php b/client/post.php index 4b4b9925..ce0f4a38 100644 --- a/client/post.php +++ b/client/post.php @@ -194,7 +194,7 @@ if (isset($_POST['add_ticket_feedback'])) { if ($feedback == "Bad") { $ticket_details = mysqli_fetch_array(mysqli_query($mysqli, "SELECT ticket_number FROM tickets WHERE ticket_id = $ticket_id LIMIT 1")); $ticket_number = intval($ticket_details['ticket_number']); - appNotify("Feedback", "$session_contact_name rated ticket $config_ticket_prefix$ticket_number as bad (ID: $ticket_id)", "ticket.php?ticket_id=$ticket_id", $session_client_id, $ticket_id); + appNotify("Feedback", "$session_contact_name rated ticket $config_ticket_prefix$ticket_number as bad (ID: $ticket_id)", "/agent/ticket.php?ticket_id=$ticket_id", $session_client_id, $ticket_id); } // Custom action/notif handler @@ -608,7 +608,7 @@ if (isset($_GET['add_payment_by_provider'])) { } // Notify/log - appNotify("Invoice Paid", "Invoice $invoice_prefix$invoice_number automatically paid", "invoice.php?invoice_id=$invoice_id", $client_id); + appNotify("Invoice Paid", "Invoice $invoice_prefix$invoice_number automatically paid", "/agent/invoice.php?invoice_id=$invoice_id", $client_id); logAction("Invoice", "Payment", "$session_name initiated Stripe payment amount of " . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . " added to invoice $invoice_prefix$invoice_number - $pi_id $extended_log_desc", $client_id, $invoice_id); customAction('invoice_pay', $invoice_id); diff --git a/cron/ticket_email_parser.php b/cron/ticket_email_parser.php index 0a1fd284..34361c46 100644 --- a/cron/ticket_email_parser.php +++ b/cron/ticket_email_parser.php @@ -212,7 +212,7 @@ function addReply($from_email, $date, $subject, $ticket_number, $message, $attac $config_ticket_prefix_esc = mysqli_real_escape_string($mysqli, $config_ticket_prefix); $ticket_number_esc2 = mysqli_real_escape_string($mysqli, $ticket_number); - appNotify("Ticket", "Email parser: $from_email attempted to re-open ticket $config_ticket_prefix_esc$ticket_number_esc2 (ID $ticket_id) - check inbox manually to see email", "ticket.php?ticket_id=$ticket_id", $client_id); + appNotify("Ticket", "Email parser: $from_email attempted to re-open ticket $config_ticket_prefix_esc$ticket_number_esc2 (ID $ticket_id) - check inbox manually to see email", "/agent/ticket.php?ticket_id=$ticket_id", $client_id); $email_subject = "Action required: This ticket is already closed"; $email_body = "Hi there,

You've tried to reply to a ticket that is closed - we won't see your response.

Please raise a new ticket by sending a new e-mail to our support address below.

--
$company_name - Support
$config_ticket_from_email
$company_phone"; diff --git a/guest/guest_pay_invoice_stripe.php b/guest/guest_pay_invoice_stripe.php index 34124a7a..21526022 100644 --- a/guest/guest_pay_invoice_stripe.php +++ b/guest/guest_pay_invoice_stripe.php @@ -242,7 +242,7 @@ if (isset($_GET['invoice_id'], $_GET['url_key']) && !isset($_GET['payment_intent mysqli_query($mysqli, "INSERT INTO history SET history_status = 'Paid', history_description = 'Online Payment added (client) - $ip - $os - $browser', history_invoice_id = $invoice_id"); // Notify - appNotify("Invoice Paid", "Invoice $invoice_prefix$invoice_number has been paid by $client_name - $ip - $os - $browser", "invoice.php?invoice_id=$invoice_id", $pi_client_id); + appNotify("Invoice Paid", "Invoice $invoice_prefix$invoice_number has been paid by $client_name - $ip - $os - $browser", "/agent/invoice.php?invoice_id=$invoice_id", $pi_client_id); customAction('invoice_pay', $invoice_id); diff --git a/guest/guest_post.php b/guest/guest_post.php index 89defa40..800cee90 100644 --- a/guest/guest_post.php +++ b/guest/guest_post.php @@ -27,7 +27,7 @@ if (isset($_GET['accept_quote'], $_GET['url_key'])) { mysqli_query($mysqli, "INSERT INTO history SET history_status = 'Accepted', history_description = 'Client accepted Quote!', history_quote_id = $quote_id"); // Notification - appNotify("Quote Accepted", "Quote $quote_prefix$quote_number has been accepted by $client_name", "quote.php?quote_id=$quote_id", $client_id); + appNotify("Quote Accepted", "Quote $quote_prefix$quote_number has been accepted by $client_name", "/agent/quote.php?quote_id=$quote_id", $client_id); customAction('quote_accept', $quote_id); // Internal email notification @@ -92,7 +92,7 @@ if (isset($_GET['decline_quote'], $_GET['url_key'])) { mysqli_query($mysqli, "INSERT INTO history SET history_status = 'Declined', history_description = 'Client declined Quote!', history_quote_id = $quote_id"); // Notification - appNotify("Quote Declined", "Quote $quote_prefix$quote_number has been declined by $client_name", "quote.php?quote_id=$quote_id", $client_id); + appNotify("Quote Declined", "Quote $quote_prefix$quote_number has been declined by $client_name", "/agent/quote.php?quote_id=$quote_id", $client_id); customAction('quote_decline', $quote_id); // Internal email notification @@ -210,7 +210,7 @@ if (isset($_GET['add_ticket_feedback'], $_GET['url_key'])) { $ticket_prefix = sanitizeInput($ticket_details['ticket_prefix']); $ticket_number = intval($ticket_details['ticket_number']); - appNotify("Feedback", "Guest rated ticket number $ticket_prefix$ticket_number (ID: $ticket_id) as bad", "ticket.php?ticket_id=$ticket_id"); + 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"); @@ -727,7 +727,7 @@ if (isset($_POST['guest_quote_upload_file'])) { // Logging & feedback flash_alert('File uploaded!'); - appNotify("Quote File", "$file_name was uploaded to quote $quote_prefix$quote_number", "quote.php?quote_id=$quote_id", $client_id); + appNotify("Quote File", "$file_name was uploaded to quote $quote_prefix$quote_number", "/agent/quote.php?quote_id=$quote_id", $client_id); mysqli_query($mysqli, "INSERT INTO history SET history_status = 'Upload', history_description = 'Client uploaded file $file_name', history_quote_id = $quote_id"); diff --git a/guest/guest_view_invoice.php b/guest/guest_view_invoice.php index 05879292..ddc8ae10 100644 --- a/guest/guest_view_invoice.php +++ b/guest/guest_view_invoice.php @@ -112,7 +112,7 @@ mysqli_query($mysqli, "INSERT INTO history SET history_status = '$invoice_status if ($invoice_status !== 'Paid') { - appNotify("Invoice Viewed", "Invoice $invoice_prefix$invoice_number has been viewed by $client_name_escaped - $ip - $os - $browser", "invoice.php?invoice_id=$invoice_id", $client_id); + appNotify("Invoice Viewed", "Invoice $invoice_prefix$invoice_number has been viewed by $client_name_escaped - $ip - $os - $browser", "/agent/invoice.php?invoice_id=$invoice_id", $client_id); } $sql_payments = mysqli_query($mysqli, "SELECT * FROM payments, accounts WHERE payment_account_id = account_id AND payment_invoice_id = $invoice_id ORDER BY payments.payment_id DESC"); diff --git a/guest/guest_view_item.php b/guest/guest_view_item.php index 1a4ed46b..553da300 100644 --- a/guest/guest_view_item.php +++ b/guest/guest_view_item.php @@ -83,7 +83,7 @@ $client_id = intval($row['item_client_id']); $item_type_sql_escaped = sanitizeInput($row['item_type']); $item_recipient_sql_escaped = sanitizeInput($row['item_recipient']); -appNotify("Share Viewed", "$item_type_sql_escaped has been viewed by $item_recipient_sql_escaped", "client_overview.php?client_id=$client_id", $client_id); +appNotify("Share Viewed", "$item_type_sql_escaped has been viewed by $item_recipient_sql_escaped", "/agent/client_overview.php?client_id=$client_id", $client_id); ?> diff --git a/guest/guest_view_quote.php b/guest/guest_view_quote.php index 90c7c044..7497f654 100644 --- a/guest/guest_view_quote.php +++ b/guest/guest_view_quote.php @@ -112,7 +112,7 @@ mysqli_query($mysqli, "INSERT INTO history SET history_status = '$quote_status', if ($quote_status == "Draft" || $quote_status == "Sent" || $quote_status == "Viewed") { - appNotify("Quote Viewed", "Quote $quote_prefix$quote_number has been viewed by $client_name_escaped - $ip - $os - $browser", "quote.php?quote_id=$quote_id", $client_id); + appNotify("Quote Viewed", "Quote $quote_prefix$quote_number has been viewed by $client_name_escaped - $ip - $os - $browser", "/agent/quote.php?quote_id=$quote_id", $client_id); } ?> diff --git a/scripts/cron.php b/scripts/cron.php index 624e090b..14d34a9a 100644 --- a/scripts/cron.php +++ b/scripts/cron.php @@ -189,7 +189,7 @@ if ($config_enable_alert_domain_expire == 1) { $client_id = intval($row['client_id']); $client_name = sanitizeInput($row['client_name']); - appNotify("Domain Expiring", "Domain $domain_name for $client_name will expire in $day Days on $domain_expire", "domains.php?client_id=$client_id", $client_id); + appNotify("Domain Expiring", "Domain $domain_name for $client_name will expire in $day Days on $domain_expire", "/agent/domains.php?client_id=$client_id", $client_id); } @@ -234,12 +234,12 @@ foreach ($certificateAlertArray as $day) { } else { // This certificate is either expiring in 1 or 7 days or is a non-LE certificate expiring in 45 days - appNotify("Certificate Expiring", "Certificate $certificate_name for $client_name will expire in $day day(s) on $certificate_expire", "certificates.php?client_id=$client_id", $client_id); + appNotify("Certificate Expiring", "Certificate $certificate_name for $client_name will expire in $day day(s) on $certificate_expire", "/agent/certificates.php?client_id=$client_id", $client_id); } } else { // No public key - notify anyway as we can't check the validity period - appNotify("Certificate Expiring", "Certificate $certificate_name for $client_name will expire in $day day(s) on $certificate_expire", "certificates.php?client_id=$client_id", $client_id); + appNotify("Certificate Expiring", "Certificate $certificate_name for $client_name will expire in $day day(s) on $certificate_expire", "/agent/certificates.php?client_id=$client_id", $client_id); } } @@ -269,7 +269,7 @@ foreach ($warranty_alert_array as $day) { $client_id = intval($row['client_id']); $client_name = sanitizeInput($row['client_name']); - appNotify("Asset Warranty Expiring", "Asset $asset_name warranty for $client_name will expire in $day Days on $asset_warranty_expire", "assets.php?client_id=$client_id", $client_id); + appNotify("Asset Warranty Expiring", "Asset $asset_name warranty for $client_name will expire in $day Days on $asset_warranty_expire", "/agent/assets.php?client_id=$client_id", $client_id); } @@ -285,7 +285,7 @@ $tickets_pending_assignment = mysqli_num_rows($sql_tickets_pending_assignment); if ($tickets_pending_assignment > 0) { - appNotify("Pending Tickets", "There are $tickets_pending_assignment new tickets pending assignment", "tickets.php?status=New"); + appNotify("Pending Tickets", "There are $tickets_pending_assignment new tickets pending assignment", "/agent/tickets.php?status=New"); // Logging logApp("Cron", "info", "Cron created notifications for new tickets that are pending assignment"); @@ -435,7 +435,7 @@ if (mysqli_num_rows($sql_recurring_tickets) > 0) { $sql_invalid_recurring_tickets = mysqli_query($mysqli, "SELECT * FROM recurring_tickets WHERE recurring_ticket_next_run < CURDATE()"); while ($row = mysqli_fetch_array($sql_invalid_recurring_tickets)) { $subject = sanitizeInput($row['recurring_ticket_subject']); - appNotify("Ticket", "Recurring ticket $subject next run date is in the past!", "recurring_tickets.php"); + appNotify("Ticket", "Recurring ticket $subject next run date is in the past!", "/agent/recurring_tickets.php"); } // Logging @@ -523,11 +523,11 @@ if ($config_send_invoice_reminders == 1) { mysqli_query($mysqli, "INSERT INTO history SET history_status = 'Sent', history_description = 'Cron applied a late fee of $late_fee_amount', history_invoice_id = $invoice_id"); - appNotify("Invoice Late Charge", "Invoice $invoice_prefix$invoice_number for $client_name in the amount of $invoice_amount was charged a late fee of $late_fee_amount", "invoice.php?invoice_id=$invoice_id", $client_id); + appNotify("Invoice Late Charge", "Invoice $invoice_prefix$invoice_number for $client_name in the amount of $invoice_amount was charged a late fee of $late_fee_amount", "/agent/invoice.php?invoice_id=$invoice_id", $client_id); } - appNotify("Invoice Overdue", "Invoice $invoice_prefix$invoice_number for $client_name in the amount of $invoice_amount is overdue by $day days", "invoice.php?invoice_id=$invoice_id", $client_id); + appNotify("Invoice Overdue", "Invoice $invoice_prefix$invoice_number for $client_name in the amount of $invoice_amount is overdue by $day days", "/agent/invoice.php?invoice_id=$invoice_id", $client_id); $subject = "Overdue Invoice $invoice_prefix$invoice_number"; $body = "Hello $contact_name,

Our records indicate that we have not yet received payment for the invoice $invoice_prefix$invoice_number. We kindly request that you submit your payment as soon as possible. If you have any questions or concerns, please do not hesitate to contact us at $company_email or $company_phone. @@ -633,7 +633,7 @@ while ($row = mysqli_fetch_array($sql_recurring_invoices)) { mysqli_query($mysqli, "INSERT INTO history SET history_status = 'Sent', history_description = 'Invoice Generated from Recurring!', history_invoice_id = $new_invoice_id"); - appNotify("Recurring Sent", "Recurring Invoice $config_invoice_prefix$new_invoice_number for $client_name Sent", "invoice.php?invoice_id=$new_invoice_id", $client_id); + appNotify("Recurring Sent", "Recurring Invoice $config_invoice_prefix$new_invoice_number for $client_name Sent", "/agent/invoice.php?invoice_id=$new_invoice_id", $client_id); customAction('invoice_create', $new_invoice_id); @@ -726,7 +726,7 @@ $sql_invalid_recurring_invoices = mysqli_query($mysqli, "SELECT * FROM recurring while ($row = mysqli_fetch_array($sql_invalid_recurring_invoices)) { $invoice_prefix = sanitizeInput($row['recurring_invoice_prefix']); $invoice_number = intval($row['recurring_invoice_number']); - appNotify("Invoice", "Recurring invoice $invoice_prefix$invoice_number next run date is in the past!", "recurring_invoices.php"); + appNotify("Invoice", "Recurring invoice $invoice_prefix$invoice_number next run date is in the past!", "/agent/recurring_invoices.php"); } // End Flag any active recurring "next run" dates that are in the past @@ -889,7 +889,7 @@ while ($row = mysqli_fetch_array($sql_recurring_payments)) { // LOGGING $extended_log_desc = !$pi_livemode ? '(DEV MODE)' : ''; - appNotify("Invoice Paid", "Invoice $invoice_prefix$invoice_number automatically paid", "invoice.php?invoice_id=$invoice_id", $client_id); + appNotify("Invoice Paid", "Invoice $invoice_prefix$invoice_number automatically paid", "/agent/invoice.php?invoice_id=$invoice_id", $client_id); logAction("Invoice", "Payment", "Auto Stripe payment amount of " . numfmt_format_currency($currency_format, $invoice_amount, $recurring_payment_currency_code) . " added to invoice $invoice_prefix$invoice_number - $pi_id $extended_log_desc", $client_id, $invoice_id); customAction('invoice_pay', $invoice_id); @@ -944,7 +944,7 @@ while ($row = mysqli_fetch_array($sql_recurring_expenses)) { $expense_id = mysqli_insert_id($mysqli); - appNotify("Expense Created", "Expense $recurring_expense_description created from recurring expenses", "expenses.php", $recurring_expense_client_id); + appNotify("Expense Created", "Expense $recurring_expense_description created from recurring expenses", "/agent/expenses.php", $recurring_expense_client_id); // Update recurring dates using calculated next billing date @@ -957,7 +957,7 @@ while ($row = mysqli_fetch_array($sql_recurring_expenses)) { $sql_invalid_recurring_expenses = mysqli_query($mysqli, "SELECT * FROM recurring_expenses WHERE recurring_expense_next_date < CURDATE() AND recurring_expense_status = 1"); while ($row = mysqli_fetch_array($sql_invalid_recurring_expenses)) { $recurring_expense_description = sanitizeInput($row['recurring_expense_description']); - appNotify("Expense", "Recurring expense $recurring_expense_description next run date is in the past!", "recurring_expenses.php"); + appNotify("Expense", "Recurring expense $recurring_expense_description next run date is in the past!", "/agent/recurring_expenses.php"); } // Logging diff --git a/scripts/cron_ticket_email_parser.php b/scripts/cron_ticket_email_parser.php index 51adc6b7..f5ad0b04 100644 --- a/scripts/cron_ticket_email_parser.php +++ b/scripts/cron_ticket_email_parser.php @@ -232,7 +232,7 @@ function addReply($from_email, $date, $subject, $ticket_number, $message, $attac $config_ticket_prefix_esc = mysqli_real_escape_string($mysqli, $config_ticket_prefix); $ticket_number_esc = mysqli_real_escape_string($mysqli, $ticket_number); - appNotify("Ticket", "Email parser: $from_email attempted to re-open ticket $config_ticket_prefix_esc$ticket_number_esc (ID $ticket_id) - check inbox manually to see email", "ticket.php?ticket_id=$ticket_id", $client_id); + appNotify("Ticket", "Email parser: $from_email attempted to re-open ticket $config_ticket_prefix_esc$ticket_number_esc (ID $ticket_id) - check inbox manually to see email", "/agent/ticket.php?ticket_id=$ticket_id", $client_id); $email_subject = "Action required: This ticket is already closed"; $email_body = "Hi there,

You've tried to reply to a ticket that is closed - we won't see your response.

Please raise a new ticket by sending a new e-mail to our support address below.

--
$company_name - Support
$config_ticket_from_email
$company_phone";