X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;ds=inline;f=lib%2Fcontact.php;h=8ba1fcdc8e2cdc5f932ff40dff55d8f87b4095be;hb=dedb377e98ae2f222f4d8b5dacc175e4d4e73f4b;hp=ccfcd48a349afcbb0f5c21488bb18985669808f3;hpb=b0b9828b27e140f88fb0b7867388376b329959cc;p=readifood.git
diff --git a/lib/contact.php b/lib/contact.php
index ccfcd48..8ba1fcd 100644
--- a/lib/contact.php
+++ b/lib/contact.php
@@ -44,19 +44,25 @@
exit;
}
- function show_contact_summary(&$contact) {
- echo "
\nContact " . $contact->getLink();
+ function show_contact_summary(&$contact, $editing = false) {
+ if ($editing) echo "
Contact: " . htmlspecialchars($contact->getDisplayname()) . "";
+ else echo "
\nContact " . $contact->getStrongLink();
$role = $contact->getRole();
$role_string = get_contact_role_string($contact);
if ($role_string) echo " $role_string";
if ($role & $GLOBALS['ROLE_DONOR']) printf(" Donations", urlencode($contact->getDisplayname()), $contact->getId());
if ($role & $GLOBALS['ROLE_REQUESTER']) printf(" Referred", urlencode($contact->getDisplayname()), $contact->getId());
- if ($role & $GLOBALS['ROLE_BENEFICIARY']) printf(" Orders", urlencode($contact->getDisplayname()), $contact->getId());
+ if ($role & $GLOBALS['ROLE_BENEFICIARY']) {
+ printf(" Orders", urlencode($contact->getDisplayname()), $contact->getId());
+ if (get_contact_area($contact)) printf(" Place", urlencode($contact->getDisplayname()), $contact->getId());
+ }
if (check_admin(1)) {
echo " " . $contact->getDeleteLink();
}
$area = get_contact_area($contact);
echo " in " . $area->getLink();
+ $city = get_contact_city($contact);
+ echo ", " . $city->getLink(get_city_displayname($city));
}
function show_contacts($offset, $per_page, $address_ids) {
@@ -167,17 +173,11 @@
}
function show_contact_role_form($role) {
- global $roles;
-
- for ($i = 0; $i < count($roles); $i++) {
- echo " $roles[$i]\n";
- }
+ return show_role_form($role, $GLOBALS['contact_roles']);
}
- function show_contact_form($contact = null) {
- global $roles;
+ function show_contact_form($contact = null, $new = false) {
+ global $contact_roles, $parcel_sizes, $parcel_contents;
if (! $contact) $contact = new Contact;
@@ -187,6 +187,14 @@
echo "
Add a new contact:
\n"; echo ""; submit("add_contact", "Add"); echo " |