- " AND " .
- "(" . $this->display_object->table_name . "_cstm.jjwg_maps_geocode_status_c = 'OK')";
- $query = $this->display_object->create_new_list_query('', $where_conds, array(), array(), 0, '', false, $this->display_object, false);
- if ($display_module == 'Contacts') { // Contacts - Account Name
- $query = str_replace(' FROM contacts ', ' ,accounts.name AS account_name, accounts.id AS account_id FROM contacts ', $query);
- $query = str_replace(' FROM contacts ', ' FROM contacts LEFT JOIN accounts_contacts ON contacts.id=accounts_contacts.contact_id and accounts_contacts.deleted = 0 LEFT JOIN accounts ON accounts_contacts.account_id=accounts.id AND accounts.deleted=0 ', $query);
- } elseif ($display_module == 'Opportunities') { // Opps - Account Name
- $query = str_replace(' FROM opportunities ', ' ,accounts.name AS account_name, accounts.id AS account_id FROM opportunities ', $query);
- $query = str_replace(' FROM opportunities ', ' FROM opportunities LEFT JOIN accounts_opportunities ON opportunities.id=accounts_opportunities.opportunity_id and accounts_opportunities.deleted = 0 LEFT JOIN accounts ON accounts_opportunities.account_id=accounts.id AND accounts.deleted=0 ', $query);
- }
- //var_dump($query);
-
- $display_result = $this->bean->db->limitQuery($query, 0, $this->settings['map_markers_limit']);
- $this->bean->map_markers = array();
- while ($display = $this->bean->db->fetchByAssoc($display_result)) {
- if (!empty($search_array['where'])) { // Select all records (advanced search) with where clause
- if (in_array($display['id'], $records)) {
- $this->bean->map_markers[] = $this->getMarkerData($display_module, $display, false, $mod_strings_display);
- }
- } elseif (!empty($_REQUEST['uid'])) { // Several records selected or this page selected
- if (in_array($display['id'], $records)) {