X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=lib%2Ffunctions.php;h=eb48c4b75ada85a3ee21d79a75cb3653185627b2;hb=refs%2Ftags%2Fuat-2013-10-31;hp=7a02b2af054808cd98dd7b2343ab35354c7c5c49;hpb=a646a2cfbd63d70043e60d88afff0add11ad7e81;p=readifood.git diff --git a/lib/functions.php b/lib/functions.php index 7a02b2a..eb48c4b 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -317,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()); @@ -421,9 +428,9 @@ function show_role_form($role, $roles) { for ($i = 0; $i < count($roles); $i++) { - echo " $roles[$i]\n"; + echo ">\n"; } } @@ -479,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() {