X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fdelivery.php;h=9cdd3385e0ed814ea1a2d789923db78c1b2e386f;hb=refs%2Ftags%2Fuat-2016-03-29;hp=43800caa4edd29d5bfb13058f2425f8651662d7a;hpb=56f5e034aebe1b00dbd1cc976fd165d03420c632;p=readifood.git diff --git a/lib/delivery.php b/lib/delivery.php index 43800ca..9cdd338 100644 --- a/lib/delivery.php +++ b/lib/delivery.php @@ -109,20 +109,48 @@ $q = new OrderQuery; $orders = $q->filterById(get_driver_schedule_by_order_id($contact->getId(), $order_ids))->find(); + + /* + Only allow drag and drop if there's more than one order otherwise IE will + mess up the CSS. + */ + $count = count($orders); + if ($count) { + foreach ($orders as $order) { + if (! get_contact_by_id($order->getBeneficiaryId())) $count--; + } + } + + if ($count > 1) { + 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 +159,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 "