log = LoggerManager::getLogger('ContactCaseRelationship'); $this->db = new PearDatabase(); } function fill_in_additional_detail_fields() { if(isset($this->contact_id) && $this->contact_id != "") { $query = "SELECT first_name, last_name from contacts where id='$this->contact_id' AND deleted=0"; $result = $this->db->query($query,true," Error filling in additional detail fields: "); // Get the id and the name. $row = $this->db->fetchByAssoc($result); if($row != null) { $this->contact_name = return_name($row, 'first_name', 'last_name'); } } if(isset($this->case_id) && $this->case_id != "") { $query = "SELECT name from cases where id='$this->case_id' AND deleted=0"; $result =$this->db->query($query,true," Error filling in additional detail fields: "); // Get the id and the name. $row = $this->db->fetchByAssoc($result); if($row != null) { $this->case_name = $row['name']; } } } function create_list_query(&$order_by, &$where) { $query = "SELECT id, yahoo_id, first_name, last_name, phone_work, title, email1 FROM contacts "; $where_auto = "deleted=0"; if($where != "") $query .= "where $where AND ".$where_auto; else $query .= "where ".$where_auto; $query .= " ORDER BY last_name, first_name"; return $query; } } ?>