From 20648e642ea6d1ce41619d49d7ab354a3c03b3ce Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Sat, 28 Nov 2020 18:29:50 -0700 Subject: [PATCH] Put package=1 in public tracking URL to specify it's a package not a machine --- custom/public.json | 1 + public/index.php | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/custom/public.json b/custom/public.json index 25ea0de..5f96ff9 100644 --- a/custom/public.json +++ b/custom/public.json @@ -5,5 +5,6 @@ "Search box prompt": "Enter a Netsyms Device ID number, serial number, or tracking code.", "Look up another device prompt": "Look up another device:", "No device with ID error": "No device with ID {id} could be found.", + "No package with ID error": "No package with tracking number {id} could be found. Try again in a few hours.", "Component exist but isn't attached to a machine": "This component ID exists in the system but has no associated device." } diff --git a/public/index.php b/public/index.php index 5f4d345..46f85a2 100644 --- a/public/index.php +++ b/public/index.php @@ -160,12 +160,19 @@ if (isset($_GET["backgroundcolor"]) && !empty($_GET["backgroundcolor"]) && preg_ } } if (!$trackingok) { - $body = []; - if (!empty($_GET["id"])) { - $body[] = '

' . str_replace("{id}", htmlspecialchars($_GET['id']), $publicsettings["No device with ID error"]) . "

"; + if (!empty($_GET["package"])) { + printCard(' ' . $Strings->get("Tracking Info", false), [ + '

' . str_replace("{id}", htmlspecialchars($_GET['id']), $publicsettings["No package with ID error"]) . "

", + getSearchBox() + ]); + } else { + $body = []; + if (!empty($_GET["id"])) { + $body[] = '

' . str_replace("{id}", htmlspecialchars($_GET['id']), $publicsettings["No device with ID error"]) . "

"; + } + $body[] = getSearchBox(); + printCard(' ' . $Strings->get("Device Info", false), $body); } - $body[] = getSearchBox(); - printCard(' ' . $Strings->get("Device Info", false), $body); } } else { if (Component::exists($_GET["id"])) {