2009_06_14.patch (5,698 bytes)
1969-12-31 16:00
Index: modules/companies/vw_contacts.php
===================================================================
--- modules/companies/vw_contacts.php (revision 440)
+++ modules/companies/vw_contacts.php (working copy)
@@ -13,13 +13,14 @@
require_once $AppUI->getModuleClass('contacts');
require_once $AppUI->getModuleClass('departments');
-$contacts = CCompany::getContacts($AppUI, $obj->company_id);
+$contacts = CCompany::getContacts($AppUI, $company_id);
?><table width="100%" border="0" cellpadding="2" cellspacing="1" class="tbl"><?php
if (count($contacts) > 0) {
?>
<tr>
<th><?php echo $AppUI->_('Name'); ?></th>
+ <th><?php echo $AppUI->_('Job Title'); ?></th>
<th><?php echo $AppUI->_('e-mail'); ?></th>
<th><?php echo $AppUI->_('Phone'); ?></th>
<th><?php echo $AppUI->_('Department'); ?></th>
@@ -31,6 +32,7 @@
echo $contact_data['contact_first_name'] . ' ' . $contact_data['contact_last_name'];
echo '</a>';
echo '</td>';
+ echo '<td class="hilite">' . $contact_data['contact_job'] . '</td>';
echo '<td class="hilite"><a href="mailto:' . $contact_data['contact_email'] . '">' . $contact_data['contact_email'] . '</a></td>';
echo '<td class="hilite">' . $contact_data['contact_phone'] . '</td>';
echo '<td class="hilite">' . $contact_data['dept_name'] . '</td>';
Index: modules/contacts/contacts.class.php
===================================================================
--- modules/contacts/contacts.class.php (revision 440)
+++ modules/contacts/contacts.class.php (working copy)
@@ -319,7 +319,7 @@
}
public static function searchContacts($AppUI, $where = '', $searchString = '') {
- $showfields = array('contact_address1' => 'contact_address1', 'contact_address2' => 'contact_address2', 'contact_city' => 'contact_city', 'contact_state' => 'contact_state', 'contact_zip' => 'contact_zip', 'contact_country' => 'contact_country', 'contact_company' => 'contact_company', 'company_name' => 'company_name', 'dept_name' => 'dept_name', 'contact_phone' => 'contact_phone', 'contact_phone2' => 'contact_phone2', 'contact_mobile' => 'contact_mobile', 'contact_fax' => 'contact_fax', 'contact_email' => 'contact_email');
+ $showfields = array('contact_address1' => 'contact_address1', 'contact_address2' => 'contact_address2', 'contact_city' => 'contact_city', 'contact_state' => 'contact_state', 'contact_zip' => 'contact_zip', 'contact_country' => 'contact_country', 'contact_company' => 'contact_company', 'company_name' => 'company_name', 'dept_name' => 'dept_name', 'contact_phone' => 'contact_phone', 'contact_phone2' => 'contact_phone2', 'contact_mobile' => 'contact_mobile', 'contact_fax' => 'contact_fax', 'contact_email' => 'contact_email', 'contact_job'=>'contact_job');
if ($searchString != '') {
$additional_filter = "OR contact_first_name like '%$searchString%' OR contact_last_name like '%$searchString%'
Index: modules/contacts/index.php
===================================================================
--- modules/contacts/index.php (revision 440)
+++ modules/contacts/index.php (working copy)
@@ -34,7 +34,7 @@
$search_map = array($orderby, 'contact_first_name', 'contact_last_name');
// optional fields shown in the list (could be modified to allow breif and verbose, etc)
-$showfields = array('contact_address1' => 'contact_address1', 'contact_address2' => 'contact_address2', 'contact_city' => 'contact_city', 'contact_state' => 'contact_state', 'contact_zip' => 'contact_zip', 'contact_country' => 'contact_country', 'contact_company' => 'contact_company', 'company_name' => 'company_name', 'dept_name' => 'dept_name', 'contact_phone' => 'contact_phone', 'contact_phone2' => 'contact_phone2', 'contact_mobile' => 'contact_mobile', 'contact_fax' => 'contact_fax', 'contact_email' => 'contact_email');
+$showfields = array('contact_job' => 'contact_job', 'contact_address1' => 'contact_address1', 'contact_address2' => 'contact_address2', 'contact_city' => 'contact_city', 'contact_state' => 'contact_state', 'contact_zip' => 'contact_zip', 'contact_country' => 'contact_country', 'contact_company' => 'contact_company', 'company_name' => 'company_name', 'dept_name' => 'dept_name', 'contact_phone' => 'contact_phone', 'contact_phone2' => 'contact_phone2', 'contact_mobile' => 'contact_mobile', 'contact_fax' => 'contact_fax', 'contact_email' => 'contact_email');
// assemble the sql statement
//$q = new DBQuery;
@@ -75,7 +75,7 @@
* Contact search form
*/
// Let's remove the first '%' that we previously added to ContIdxWhere
-$default_search_string = w2PformSafe(substr($AppUI->getState('ContIdxWhere'), 1, strlen($AppUI->getState('ContIdxWhere'))), true);
+$default_search_string = w2PformSafe($AppUI->getState('ContIdxWhere'), true);
$form = '<form action="./index.php" method="get">' . $AppUI->_('Search for') . '
<input type="text" class="text" name="search_string" value="' . $default_search_string . '" />
@@ -197,6 +197,8 @@
//Don't do a thing
} elseif ($val == 'company_name') {
$s .= '<tr><td width="35%"><strong>' . $AppUI->_('Company') . ':</strong></td><td class="hilite" width="65%">' . $carr[$z][$x][$key] . '</td></tr>';
+ } elseif ($val == 'contact_job') {
+ $s .= '<tr><td width="35%"><strong>' . $AppUI->_('Job Title') . ':</strong></td><td class="hilite" width="65%">' . $carr[$z][$x][$key] . '</td></tr>';
} elseif ($val == 'dept_name') {
$s .= '<tr><td width="35%"><strong>' . $AppUI->_('Department') . ':</strong></td><td class="hilite" width="65%">' . $carr[$z][$x][$key] . '</td></tr>';
} elseif ($val == 'contact_phone') {