diff --git a/site/views/contacts/edit.ctp b/site/views/contacts/edit.ctp index 163af2f..3d1fc26 100644 --- a/site/views/contacts/edit.ctp +++ b/site/views/contacts/edit.ctp @@ -45,6 +45,7 @@ function contactMethodDiv($obj, $type, $legend, $values = null) { ' CLASS="'.$type.'-method-%{id}-source" ' . "\n" . ' ID="'.$type.'-method-%{id}-source-'.$stype.'"' . "\n" . ' VALUE="'.$stype.'"' . "\n" . + ($stype == 'new' ? ' CHECKED' . "\n" : '') . ' />' . "\n" . ' ' . "\n" . ' '; @@ -76,21 +77,30 @@ function contactMethodDiv($obj, $type, $legend, $values = null) { 'fields' => array ( 'preference' => array - ('opts' => array + ('label_attributes' => array('class' => 'required'), + 'opts' => array ('options' => $obj->varstore['methodPreferences'], 'selected' => (isset($values) ? $values['ContactsMethod']['preference'] : null), - )), + ), + 'after' => "Intended purpose for using this method of communication.", + ), 'type' => array - ('opts' => array + ('label_attributes' => array('class' => 'required'), + 'opts' => array ('options' => $obj->varstore['methodTypes'], 'selected' => (isset($values) ? $values['ContactsMethod']['type'] : null), - )), + ), + 'after' => "How / Where this communication reaches the contact.", + ), 'comment' => array - ('opts' => array + ('label_attributes' => array('class' => 'optional empty'), + 'opts' => array ('value' => (isset($values) ? $values['ContactsMethod']['comment'] : null), - )), + ), + 'after' => "Optional: Comments on how this form of communication relates to the contact.", + ), ))) . "\n" . @@ -113,16 +123,23 @@ function contactMethodTypeDiv($obj, $type, $stype, $values = null) { if ($type === 'phone') { if ($stype === 'existing') { $fields = array - ('id' => array('name' => 'Phone/Ext', + ('id' => array('label_attributes' => array('class' => 'required empty'), + 'name' => 'Phone/Ext', 'opts' => array('options' => $obj->varstore['contactPhones'])), ); } elseif ($stype === 'new') { $fields = array - ('type' => array('opts' => array('options' => $obj->varstore['phoneTypes'])), - 'phone' => true, - 'ext' => array('name' => "Extension"), - 'comment' => true, + ('type' => array('label_attributes' => array('class' => 'required'), + 'opts' => array('options' => $obj->varstore['phoneTypes']), + 'after' => "Physical type of the phone."), + 'phone' => array('label_attributes' => array('class' => 'required empty'), + 'after' => "Required: Phone number."), + 'ext' => array('name' => "Extension", + 'label_attributes' => array('class' => 'optional empty'), + 'after' => "Optional: Extension number."), + 'comment' => array('label_attributes' => array('class' => 'optional empty'), + 'after' => "Optional: Comments about this phone number."), ); } elseif ($stype === 'show') { @@ -149,12 +166,19 @@ function contactMethodTypeDiv($obj, $type, $stype, $values = null) { } elseif ($stype === 'new') { $fields = array - ('address' => true, - 'city' => true, - 'state' => true, - 'postcode' => array('name' => 'Zip Code'), - 'country' => true, - 'comment' => true, + ('address' => array('label_attributes' => array('class' => 'required empty'), + 'after' => "Required: First line of mailing address."), + 'city' => array('label_attributes' => array('class' => 'required empty'), + 'after' => "Required."), + 'state' => array('label_attributes' => array('class' => 'required empty'), + 'after' => "Required."), + 'postcode' => array('name' => 'Zip Code', + 'label_attributes' => array('class' => 'required empty'), + 'after' => "Required."), + 'country' => array('label_attributes' => array('class' => 'optional empty'), + 'after' => "Optional: USA is presumed."), + 'comment' => array('label_attributes' => array('class' => 'optional empty'), + 'after' => "Optional: Comments about this mailing address."), ); } elseif ($stype === 'show') { @@ -177,13 +201,16 @@ function contactMethodTypeDiv($obj, $type, $stype, $values = null) { if ($stype === 'existing') { $fields = array ('id' => array('name' => 'Email', + 'label_attributes' => array('class' => 'required'), 'opts' => array('options' => $obj->varstore['contactEmails'])), ); } elseif ($stype === 'new') { $fields = array - ('email' => true, - 'comment' => true, + ('email' => array('label_attributes' => array('class' => 'required empty'), + 'after' => "Required: E-mail address."), + 'comment' => array('label_attributes' => array('class' => 'optional empty'), + 'after' => "Optional: Comments about this email address."), ); } elseif ($stype === 'show') { @@ -204,7 +231,7 @@ function contactMethodTypeDiv($obj, $type, $stype, $values = null) { '