X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=lib%2Fdelivery.php;h=9cdd3385e0ed814ea1a2d789923db78c1b2e386f;hb=ea0e53db8b5a264b6e231038815d2c350076d02a;hp=3b45558917aac13e623e501179d9e88d8614ffc5;hpb=d3dba43622775318e70ab6980a271d1702e757f8;p=readifood.git diff --git a/lib/delivery.php b/lib/delivery.php index 3b45558..9cdd338 100644 --- a/lib/delivery.php +++ b/lib/delivery.php @@ -109,10 +109,29 @@ $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 "
\n"; + echo "

Drag delivery details to reorder the schedule.

\n"; + } + foreach ($orders as $order) { $contact = get_contact_by_id($order->getBeneficiaryId()); if (! $contact) continue; + echo "\n"; + $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"; @@ -150,8 +169,11 @@ echo "

\n"; } - echo "
\n\n"; + echo "
\n"; + echo "
\n\n"; } + + if ($count > 1) echo "
\n"; } function show_delivery_date_form($date = null) {