Added contact registration date.
authorIain Patterson <me@iain.cx>
Wed, 10 Apr 2013 20:50:41 +0000 (16:50 -0400)
committerIain Patterson <me@iain.cx>
Wed, 10 Apr 2013 20:50:41 +0000 (16:50 -0400)
Record date a contact was registered on the system.

lib/contact.php
propel/schema.xml

index 3dd0fc3..98340b8 100644 (file)
     return show_role_form($role, $GLOBALS['contact_roles']);
   }
 
-  function show_contact_form($contact = null) {
+  function show_contact_form($contact = null, $new = false) {
     global $contact_roles;
 
     if (! $contact) $contact = new Contact;
     echo "  <td>"; show_contact_role_form($contact->getRole()); echo "</td>\n";
     echo "</tr>\n";
 
+    /* Date added. */
+    if (! $new) {
+      echo "<tr>\n";
+      echo "  <td>Registered</td>\n";
+      echo "  <td>" . $contact->getAdded() . "</td>\n";
+      echo "</tr>\n";
+    }
+
     /* Forename. */
     echo "<tr>\n";
     echo "  <td>Forename</td>\n";
     echo "<p>Add a new contact:</p>\n";
 
     echo "<table>\n";
-    show_contact_form($contact);
+    show_contact_form($contact, true);
 
     echo "<tr>\n";
     echo "  <td colspan=2>"; submit("add_contact", "Add"); echo "</td></tr>\n";
index 62658f5..7c801b4 100644 (file)
@@ -52,6 +52,7 @@
       <parameter name="Charset" value="utf8"/>
     </vendor>
     <column name="id" type="integer" required="true" primaryKey="true" autoIncrement="true"/>
+    <column name="added" type="date" required="true"/>
     <column name="address_id" type="integer" required="true"/>
     <column name="forename" type="varchar" size="64" required="true"/>
     <column name="middle" type="varchar" size="128" required="true"/>