Hello,
I'm trying to add a second and third line to each address of my contact objects (e.g. w_address2, h_address3).
Based on comments on this thread ->
http://forums.fengoffice.com/index.php?topic=619.0 I have added my fields to the mysql db, added them to the columns array, added getters and setters based on existing fields, and now I'm looking for errata. I just don't think adding a few lines to print functions is going to do it in this case.
Through a series of piped greps I've got the list of files that mention w_address (excluding other languages, for now):
/usr/share/fengoffice/language/en_us/fields.php: 'field Contacts w_address' => 'Work address',
/usr/share/fengoffice/language/en_us/project_interface.php: 'field w_address' => 'Work address',
/usr/share/fengoffice/public/install/installation/templates/sql/mysql_schema.php: `w_address` varchar(200) <?php echo $default_collation ?> default NULL,
/usr/share/fengoffice/application/views/contact/edit_contact.php: <td><?php echo text_field('contact[w_address]', array_var($contact_data, 'w_address'), array('id' => $genid.'profileFormWAddress', 'tabindex' => '75', 'maxlength' => 200)) ?></td>
/usr/share/fengoffice/application/controllers/ContactController.class.php: 'w_address'=> $contact->getWAddress(),
/usr/share/fengoffice/application/controllers/ContactController.class.php: $comp['address'] = array_var($contact_data, 'w_address');
/usr/share/fengoffice/application/controllers/ContactController.class.php: if (isset($checked['w_address']) && $checked['w_address']) $contact_data['w_address'] = array_var($fields, $position['w_address']);
/usr/share/fengoffice/application/controllers/ContactController.class.php: if (isset($checked['w_address']) && $checked['w_address'] == 'checked') $str .= self::build_csv_field($contact->getWAddress());
/usr/share/fengoffice/application/controllers/ContactController.class.php: $block_data["w_address"] = $addr[0];
/usr/share/fengoffice/application/models/contacts/Contacts.class.php: 'contact[w_address]' => lang('address'),
/usr/share/fengoffice/application/models/contacts/Contact.class.php: protected $searchable_columns = array('email', 'email2', 'email3', 'firstname', 'w_address', 'h_address', 'o_address');
/usr/share/fengoffice/application/models/contacts/Contact.class.php: 'w_address' => array('w_address', 'w_city', 'w_state', 'w_zipcode', 'w_country'),
/usr/share/fengoffice/application/models/contacts/Contact.class.php: } else if($column_name == 'w_address') {
/usr/share/fengoffice/application/models/contacts/base/BaseContacts.class.php: 'w_address' => DATA_TYPE_STRING,
/usr/share/fengoffice/application/models/contacts/base/BaseContact.class.php: * Return value of 'w_address' field
/usr/share/fengoffice/application/models/contacts/base/BaseContact.class.php: return $this->getColumnValue('w_address');
/usr/share/fengoffice/application/models/contacts/base/BaseContact.class.php: * Set value of 'w_address' field
/usr/share/fengoffice/application/models/contacts/base/BaseContact.class.php: return $this->setColumnValue('w_address', $value);
You would think that I could just update them all, such as the 'get all address fields' type functions and it would all be dandy (assuming I'm updating h_address and etc. fields, too). However if you notice...those lines include things like '$addr[0]' which I see has references in:
/usr/share/fengoffice/environment/classes/mail/MailUtilities.class.php: $name = $address != trim($addr[0]) ? trim($addr[0]) : "";
/usr/share/fengoffice/environment/classes/mail/MailUtilities.class.php: $address = trim($addr[0]);
/usr/share/fengoffice/application/functions.php: if ($addr[0] == '"') {
/usr/share/fengoffice/application/controllers/ContactController.class.php: $block_data["h_address"] = $addr[0];
/usr/share/fengoffice/application/controllers/ContactController.class.php: $block_data["w_address"] = $addr[0];
/usr/share/fengoffice/application/controllers/ContactController.class.php: $block_data["o_address"] = $addr[0];
If someone wants to clarify for me to the last detail what to do that would be fantastic...but more realistically I'm curious if I'm
close to the end of the trail or if this 'method' I'm using is going to drag me upside down through the source for the next two weeks.