Added contact notes field.
authorIain Patterson <me@iain.cx>
Wed, 10 Apr 2013 08:20:18 +0000 (04:20 -0400)
committerIain Patterson <me@iain.cx>
Wed, 10 Apr 2013 10:11:26 +0000 (06:11 -0400)
Allow freeform notes for a contact, for instance for quickly noting the
family makeup and dietary requirements during a phone call so that more
details attributes can be specified when time pressure is relaxed.

lib/contact.php
propel/schema.xml

index ccc932c..3dd0fc3 100644 (file)
     }
     echo "  </select></td>\n";
     echo "</tr>\n";
+
+    /* Notes. */
+    echo "<tr>\n";
+    echo "  <td>Notes</td>\n";
+    echo "  <td><textarea name=\"notes\">" . $contact->getNotes() . "</textarea></td>\n";
+    echo "</tr>\n";
   }
 
   function show_new_contact_form($city_id = null) {
     $telephone1 = $_POST['telephone1'];
     $telephone2 = $_POST['telephone2'];
     $email = $_POST['email'];
+    $notes = $_POST['notes'];
 
     $contact->setRole($role);
     $contact->setForename($forename);
     $contact->setTelephone1($telephone1);
     $contact->setTelephone2($telephone2);
     $contact->setEmail($email);
+    $contact->setNotes($notes);
     $contact->setAddressId($address->getId());
 
     try {
index 445574d..b6a4804 100644 (file)
@@ -61,6 +61,7 @@
     <column name="telephone1" type="varchar" size="32" required="true"/>
     <column name="telephone2" type="varchar" size="32" required="true"/>
     <column name="email" type="varchar" size="64" required="true"/>
+    <column name="notes" type="longvarchar" lazyLoad="true"/>
     <foreign-key foreignTable="Address" phpName="Address" refPhpName="Contact">
       <reference local="address_id" foreign="id"/>
     </foreign-key>