X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;ds=inline;f=lib%2Fcontact.php;h=98340b8ce095b845acfbecc989e9d4c20a649218;hb=d11f3b9f2da834281ab505d371d4b23bae80251a;hp=ccfcd48a349afcbb0f5c21488bb18985669808f3;hpb=b0b9828b27e140f88fb0b7867388376b329959cc;p=readifood.git
diff --git a/lib/contact.php b/lib/contact.php
index ccfcd48..98340b8 100644
--- a/lib/contact.php
+++ b/lib/contact.php
@@ -44,8 +44,9 @@
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";
@@ -57,6 +58,8 @@
}
$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 +170,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;
if (! $contact) $contact = new Contact;
@@ -187,6 +184,14 @@
echo "
Add a new contact:
\n"; echo ""; submit("add_contact", "Add"); echo " |