X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;ds=inline;f=lib%2Ffunctions.php;h=eb48c4b75ada85a3ee21d79a75cb3653185627b2;hb=1a03841178f8c990b3b196b915c5b288f629879f;hp=2b35663b66097a8c6613d996943c333abed052e0;hpb=7840fb6e5f99fcc6c9b25e05c6f40d73137f6d79;p=readifood.git
diff --git a/lib/functions.php b/lib/functions.php
index 2b35663..eb48c4b 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());
@@ -418,9 +428,9 @@
function show_role_form($role, $roles) {
for ($i = 0; $i < count($roles); $i++) {
- echo " $roles[$i]\n";
+ echo ">\n";
}
}
@@ -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() {