From: Iain Patterson Date: Wed, 10 Jul 2013 14:16:19 +0000 (-0400) Subject: Show phone number(s) in delivery schedule. X-Git-Tag: 2013-07-10^0 X-Git-Url: http://git.iain.cx/?p=readifood.git;a=commitdiff_plain;h=d3dba43622775318e70ab6980a271d1702e757f8 Show phone number(s) in delivery schedule. If a contact or hub has one r more phone numbers, show them in the delivery schedule so the driver can phone ahead. --- diff --git a/lib/delivery.php b/lib/delivery.php index 43800ca..3b45558 100644 --- a/lib/delivery.php +++ b/lib/delivery.php @@ -113,16 +113,25 @@ $contact = get_contact_by_id($order->getBeneficiaryId()); if (! $contact) continue; + $phones = array(); $area = get_contact_area($contact); echo "

Order of " . get_order_parcel_string($order) . " for " . htmlspecialchars($contact->getDisplayname()) . " in " . htmlspecialchars(get_area_displayname($area)) . ".

\n"; $hub = get_hub_by_id($order->getHubId(), false); if ($hub) { echo "

Deliver to hub " . htmlspecialchars($hub->getName()) . ""; $address = get_hub_address($hub); + $phone = $hub->getTelephone1(); + if ($phone) $phones[] = $phone; + $phone = $hub->getTelephone2(); + if ($phone) $phones[] = $phone; } else { echo "

Deliver direct to beneficiary"; $address = get_contact_address($contact); + $phone = $contact->getTelephone1(); + if ($phone) $phones[] = $phone; + $phone = $contact->getTelephone2(); + if ($phone) $phones[] = $phone; } $area = get_address_area($address); @@ -131,6 +140,7 @@ echo "\n
" . htmlspecialchars($address->getLine()); echo "\n
" . htmlspecialchars($city->getName()); echo "\n
" . htmlspecialchars($address->getPostcode()); + if (count($phones)) echo "\n

Telephone " . implode(" or ", $phones) . ""; echo "

\n"; $notes = $order->getNotes();