From 2fe8adcfcabbdb478dc80cdf9591892fc8a16c58 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Wed, 19 Feb 2025 15:58:43 -0500 Subject: [PATCH] Simplified Client URL Handling in global client header logic --- invoices.php | 14 ++++++++++---- payments.php | 14 ++++++++++---- quotes.php | 10 ++++++---- recurring_invoices.php | 10 ++++++---- recurring_tickets.php | 8 +++++--- tickets.php | 14 ++++++++------ tickets_compact.php | 12 ++++++------ tickets_kanban.php | 2 +- tickets_list.php | 10 +++++----- trips.php | 14 ++++++++------ vendors.php | 6 ++++-- 11 files changed, 69 insertions(+), 45 deletions(-) diff --git a/invoices.php b/invoices.php index 0b499074..18d32f02 100644 --- a/invoices.php +++ b/invoices.php @@ -8,9 +8,11 @@ $order = "DESC"; if (isset($_GET['client_id'])) { require_once "includes/inc_all_client.php"; $client_query = "AND invoice_client_id = $client_id"; + $client_url = "client_id=$client_id&"; } else { require_once "includes/inc_all.php"; $client_query = ''; + $client_url = ''; } // Perms @@ -164,7 +166,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
- +
@@ -230,7 +232,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); Scope - + Client @@ -308,9 +310,13 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); ?> - "> + + + + + - + diff --git a/payments.php b/payments.php index 913b6511..03961542 100644 --- a/payments.php +++ b/payments.php @@ -8,9 +8,11 @@ $order = "DESC"; if (isset($_GET['client_id'])) { require_once "includes/inc_all_client.php"; $client_query = "AND invoice_client_id = $client_id"; + $client_url = "client_id=$client_id&"; } else { require_once "includes/inc_all.php"; $client_query = ''; + $client_url = ''; } // Perms @@ -69,7 +71,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
- +
@@ -174,7 +176,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); Invoice - + Client @@ -246,8 +248,12 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); - "> - + + + + + + diff --git a/quotes.php b/quotes.php index f3e94e56..2a2b40d3 100644 --- a/quotes.php +++ b/quotes.php @@ -8,9 +8,11 @@ $order = "DESC"; if (isset($_GET['client_id'])) { require_once "includes/inc_all_client.php"; $client_query = "AND quote_client_id = $client_id"; + $client_url = "client_id=$client_id&"; } else { require_once "includes/inc_all.php"; $client_query = ''; + $client_url = ''; } // Perms @@ -53,7 +55,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
- +
@@ -120,7 +122,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); Scope - + Client @@ -203,12 +205,12 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); - "> + - + diff --git a/recurring_invoices.php b/recurring_invoices.php index dd356e3c..a94f1f24 100644 --- a/recurring_invoices.php +++ b/recurring_invoices.php @@ -8,9 +8,11 @@ $order = "ASC"; if (isset($_GET['client_id'])) { require_once "includes/inc_all_client.php"; $client_query = "AND recurring_client_id = $client_id"; + $client_url = "client_id=$client_id&"; } else { require_once "includes/inc_all.php"; $client_query = ''; + $client_url = ''; } // Perms @@ -44,7 +46,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
- +
@@ -115,7 +117,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); Scope - + Client @@ -208,13 +210,13 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); - "> + - + diff --git a/recurring_tickets.php b/recurring_tickets.php index 0c7c6fac..e74c3ebf 100644 --- a/recurring_tickets.php +++ b/recurring_tickets.php @@ -8,9 +8,11 @@ $order = "ASC"; if (isset($_GET['client_id'])) { require_once "includes/inc_all_client.php"; $client_query = "AND scheduled_ticket_client_id = $client_id"; + $client_url = "client_id=$client_id&"; } else { require_once "includes/inc_all.php"; $client_query = ''; + $client_url = ''; } // Perms @@ -67,7 +69,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
- +
@@ -115,7 +117,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
- + Client @@ -169,7 +171,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
- + diff --git a/tickets.php b/tickets.php index 81627d24..fc218624 100644 --- a/tickets.php +++ b/tickets.php @@ -9,9 +9,11 @@ $order = "DESC"; if (isset($_GET['client_id'])) { require_once "includes/inc_all_client.php"; $client_query = "AND ticket_client_id = $client_id"; + $client_url = "client_id=$client_id&"; } else { require_once "includes/inc_all.php"; $client_query = ''; + $client_url = ''; } // Perms @@ -154,8 +156,8 @@ $sql_categories = mysqli_query(

Tickets - status=Open" class="text-light"> Open | - status=Closed" class="text-light"> Closed + Open | + Closed

@@ -176,7 +178,7 @@ $sql_categories = mysqli_query(
- +
@@ -229,12 +231,12 @@ $sql_categories = mysqli_query( My Tickets
- assigned=unassigned" class="btn btn-outline-danger"> + Unassigned Tickets | diff --git a/tickets_compact.php b/tickets_compact.php index c82e1f21..b0a48c88 100644 --- a/tickets_compact.php +++ b/tickets_compact.php @@ -18,17 +18,17 @@ Ticket - + Client - + - - Client + + Contact @@ -201,7 +201,7 @@
- "> + $ticket_subject"; @@ -230,7 +230,7 @@ - +
diff --git a/tickets_kanban.php b/tickets_kanban.php index 0121e5a6..589d3e51 100644 --- a/tickets_kanban.php +++ b/tickets_kanban.php @@ -111,7 +111,7 @@ $kanban = array_values($statuses); - + Client / Contact - + Contact @@ -193,14 +193,14 @@ - "> + - "> + 0) { ?>
@@ -216,7 +216,7 @@ - +
diff --git a/trips.php b/trips.php index 62d232cc..03b42718 100644 --- a/trips.php +++ b/trips.php @@ -8,9 +8,11 @@ $order = "DESC"; if (isset($_GET['client_id'])) { require_once "includes/inc_all_client.php"; $client_query = "AND trip_client_id = $client_id"; + $client_url = "client_id=$client_id&"; } else { require_once "includes/inc_all.php"; $client_query = ''; + $client_url = ''; } //Rebuild URL @@ -50,7 +52,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));