exit;
}
- function show_contact_summary(&$contact) {
- echo "<br>\nContact " . $contact->getLink();
+ function show_contact_summary(&$contact, $editing = false) {
+ if ($editing) echo "<p>Contact: <span class=\"strong\">" . htmlspecialchars($contact->getDisplayname()) . "</span>";
+ else echo "<br>\nContact " . $contact->getStrongLink();
$role = $contact->getRole();
$role_string = get_contact_role_string($contact);
if ($role_string) echo " $role_string";
}
$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) {
if (! $contact) return;
echo "<form method=\"POST\" action=\"" . $_SERVER['REQUEST_URI'] . "\">\n";
- echo "<p>Contact: <span class=\"strong\">" . $contact->getDisplayname() . "</span>";
- $role = $contact->getRole();
- $role_string = get_contact_role_string($contact);
- if ($role_string) echo " $role_string";
- if ($role & $GLOBALS['ROLE_DONOR']) printf(" <a class=\"small\" href=\"/donation/from/contact/%s/%d\">Donations</a>", urlencode($contact->getDisplayname()), $contact->getId());
- if ($role & $GLOBALS['ROLE_REQUESTER']) printf(" <a class=\"small\" href=\"/order/from/referrer/%s/%d\">Referred</a>", urlencode($contact->getDisplayname()), $contact->getId());
- if ($role & $GLOBALS['ROLE_BENEFICIARY']) printf(" <a class=\"small\" href=\"/order/to/beneficiary/%s/%d\">Orders</a>", urlencode($contact->getDisplayname()), $contact->getId());
- if (check_admin(1)) {
- echo " " . $contact->getDeleteLink();
- }
- $city = get_contact_city($contact);
- if ($city) echo " in " . $city->getLink(get_city_displayname($city));
+ show_contact_summary($contact, true);
echo ": ";
echo "\n</p>";