From c5fb790a7fa53100d2c3373603c82812265c7a6a Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Mon, 13 May 2013 04:41:38 -0400 Subject: [PATCH] Show links from order display. Show links back to the requester, beneficiary, hub and driver from an order display. --- lib/order.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/lib/order.php b/lib/order.php index 38a235a..e9aaeda 100644 --- a/lib/order.php +++ b/lib/order.php @@ -239,7 +239,10 @@ foreach ($contacts as $contact) { option("requester_id", $contact->getId(), $contact->getDisplayname(), $order->getRequesterId()); } - echo "\n"; + echo ""; + $contact = get_contact_by_id($order->getRequesterId(), false); + if ($contact) echo " " . get_small_link($contact->getDisplayname(), $contact->getURL()); + echo "\n"; echo "\n"; /* Beneficiary. */ @@ -257,7 +260,10 @@ option("beneficiary_id", $contact->getId(), $contact->getDisplayname(), $order->getBeneficiaryId()); } } - echo "\n"; + echo ""; + $contact = get_contact_by_id($order->getBeneficiaryId(), false); + if ($contact) echo " " . get_small_link($contact->getDisplayname(), $contact->getURL()); + echo "\n"; echo "\n"; /* Hub. */ @@ -269,7 +275,10 @@ foreach ($hubs as $hub) { option("hub_id", $hub->getId(), $hub->getDisplayname(), $order->getHubId()); } - echo "\n"; + echo ""; + $hub = get_hub_by_id($order->getHubId(), false); + if ($hub) echo " " . get_small_link($hub->getDisplayname(), $hub->getURL()); + echo "\n"; echo "\n"; /* Parcel type. */ @@ -305,7 +314,10 @@ foreach ($contacts as $contact) { option("driver_id", $contact->getId(), $contact->getDisplayname(), $driver_id); } - echo "\n"; + echo ""; + $contact = get_contact_by_id($driver_id, false); + if ($contact) echo " " . get_small_link($contact->getDisplayname(), $contact->getURL()); + echo "\n"; } else echo " No drivers!\n"; echo "\n"; -- 2.7.4