X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=lib%2Ffunctions.php;h=2fcbe0e493e3dace99565a6bbb75e9bdf7674e4b;hb=3b2e8214805eb2bdebb7485ce29c072815361eef;hp=2b35663b66097a8c6613d996943c333abed052e0;hpb=7840fb6e5f99fcc6c9b25e05c6f40d73137f6d79;p=readifood.git diff --git a/lib/functions.php b/lib/functions.php index 2b35663..2fcbe0e 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -277,7 +277,10 @@ } function get_order_summary($order) { - $ret = "Order " . $order->getStrongLink($order->getId()) . ": " . get_order_displayname($order); + $ret = "Order "; + $order_state = get_order_state($order); + if ($order_state) $ret = "" . ucfirst(get_order_state_string($order_state)) . " order "; + $ret .= $order->getStrongLink($order->getId()) . ": " . get_order_displayname($order); if (check_admin(1)) $ret .= " " . $order->getDeleteLink(); @@ -314,6 +317,13 @@ return $q->findOneById($address->getAreaId()); } + function get_address_map_link($address) { + $postcode = trim($address->getPostcode()); + if ($postcode) { + return " " . get_small_link("Map", "http://maps.google.co.uk/maps?q=" . urlencode($postcode)); + } + } + function get_contact_address($contact) { $q = new AddressQuery; return $q->findOneById($contact->getAddressId()); @@ -476,32 +486,54 @@ } function show_date_form($name, $date = null) { - $past = 60; - $future = 60; - echo "\n"; - return; - if (! isset($date)) $date = date('Y-m-d'); - list($y, $m, $d) = iso8601_to_ymd($date); - - echo "Year: "; - echo "Month: "; - echo "Day: "; } function get_small_link() {