From: Iain Patterson Date: Mon, 13 May 2013 08:41:38 +0000 (-0400) Subject: Show links from order display. X-Git-Tag: 2013-05-13~17 X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;h=c5fb790a7fa53100d2c3373603c82812265c7a6a;p=readifood.git Show links from order display. Show links back to the requester, beneficiary, hub and driver from an order display. --- 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";