X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=lib%2Fcontact.php;h=3dd0fc3f5b1501151fcac5b73459e4f0b6c7c70f;hb=7910a9551304a4789ba1fde0c85eeaf5bb21003b;hp=166fd9784b98ca8a5d84f5c443dcea8fc17b8afc;hpb=8549c1776033e924ea50328bd2434529d85b5669;p=readifood.git diff --git a/lib/contact.php b/lib/contact.php index 166fd97..3dd0fc3 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) { @@ -247,6 +250,12 @@ } echo " \n"; echo "\n"; + + /* Notes. */ + echo "\n"; + echo " Notes\n"; + echo " \n"; + echo "\n"; } function show_new_contact_form($city_id = null) { @@ -351,6 +360,7 @@ $telephone1 = $_POST['telephone1']; $telephone2 = $_POST['telephone2']; $email = $_POST['email']; + $notes = $_POST['notes']; $contact->setRole($role); $contact->setForename($forename); @@ -360,6 +370,7 @@ $contact->setTelephone1($telephone1); $contact->setTelephone2($telephone2); $contact->setEmail($email); + $contact->setNotes($notes); $contact->setAddressId($address->getId()); try { @@ -422,18 +433,7 @@ if (! $contact) return; echo "

\n"; - echo "

Contact: " . $contact->getDisplayname() . ""; - $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 (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

";