Ejemplo n.º 1
0
 function fill_in_additional_detail_fields()
 {
     // jmorais@dri Bug #56269
     parent::fill_in_additional_detail_fields();
     // ~jmorais@dri
     global $locale;
     $query = "SELECT u1.first_name, u1.last_name from users  u1, users  u2 where u1.id = u2.reports_to_id AND u2.id = '{$this->id}' and u1.deleted=0";
     $result = $this->db->query($query, true, "Error filling in additional detail fields");
     $row = $this->db->fetchByAssoc($result);
     if ($row != null) {
         $this->reports_to_name = stripslashes($row['first_name'] . ' ' . $row['last_name']);
     } else {
         $this->reports_to_name = '';
     }
     $this->_create_proper_name_field();
 }
Ejemplo n.º 2
0
 function fill_in_additional_detail_fields()
 {
     global $locale;
     $query = "SELECT u1.first_name, u1.last_name from users u1, users u2 where u1.id = u2.reports_to_id AND u2.id = '{$this->id}' and u1.deleted=0";
     $result = $this->db->query($query, true, "Error filling in additional detail fields");
     $row = $this->db->fetchByAssoc($result);
     if ($row != null) {
         $this->reports_to_name = $locale->formatName($this->module_name, $row);
     } else {
         $this->reports_to_name = '';
     }
     parent::fill_in_additional_detail_fields();
 }
Ejemplo n.º 3
0
 function fill_in_additional_detail_fields()
 {
     // jmorais@dri Bug #56269
     parent::fill_in_additional_detail_fields();
     // ~jmorais@dri
     global $locale;
     $query = "SELECT u1.first_name, u1.last_name from users  u1, users  u2 where u1.id = u2.reports_to_id AND u2.id = '{$this->id}' and u1.deleted=0";
     $result = $this->db->query($query, true, "Error filling in additional detail fields");
     $row = $this->db->fetchByAssoc($result);
     if ($row != null) {
         global $locale;
         $this->reports_to_name = $locale->formatName('Users', $row);
     } else {
         $this->reports_to_name = '';
     }
     // Must set team_id for team widget purposes (default_team is primary team id)
     if (empty($this->team_id)) {
         $this->team_id = $this->default_team;
     }
     //set the team info if the team id has already been set.
     //running only if team class exists will prevent breakage during upgrade/flavor conversions
     if (class_exists('Team')) {
         // Set default_team_name for Campaigns WebToLeadCreation
         $this->default_team_name = Team::getTeamName($this->team_id);
     } else {
         //if no team id exists, set the team info to blank
         $this->default_team = '';
         $this->default_team_name = '';
         $this->team_set_id = '';
     }
     $this->_create_proper_name_field();
 }
Ejemplo n.º 4
0
 function fill_in_additional_detail_fields()
 {
     parent::fill_in_additional_detail_fields();
     if (empty($this->id)) {
         return;
     }
     global $locale, $app_list_strings, $current_user;
     // retrieve the account information and the information about the person the contact reports to.
     $query = "SELECT acc.id, acc.name, con_reports_to.first_name, con_reports_to.last_name\n\t\tfrom contacts\n\t\tleft join accounts_contacts a_c on a_c.contact_id = '" . $this->id . "' and a_c.deleted=0\n\t\tleft join accounts acc on a_c.account_id = acc.id and acc.deleted=0\n\t\tleft join contacts con_reports_to on con_reports_to.id = contacts.reports_to_id\n\t\twhere contacts.id = '" . $this->id . "'";
     // Bug 43196 - If a contact is related to multiple accounts, make sure we pull the one we are looking for
     // Bug 44730  was introduced due to this, fix is to simply clear any whitespaces around the account_id first
     $clean_account_id = trim($this->account_id);
     if (!empty($clean_account_id)) {
         $query .= " and acc.id = '{$this->account_id}'";
     }
     $query .= " ORDER BY a_c.date_modified DESC";
     $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->account_name = $row['name'];
         $this->account_id = $row['id'];
         $this->report_to_name = $locale->getLocaleFormattedName($row['first_name'], $row['last_name'], '', '', '', null, true);
     } else {
         $this->account_name = '';
         $this->account_id = '';
         $this->report_to_name = '';
     }
     $this->load_contacts_users_relationship();
     /** concating this here because newly created Contacts do not have a
      * 'name' attribute constructed to pass onto related items, such as Tasks
      * Notes, etc.
      */
     $this->name = $locale->getLocaleFormattedName($this->first_name, $this->last_name);
     if (!empty($this->contacts_users_id)) {
         $this->sync_contact = true;
     }
     if (!empty($this->portal_active) && $this->portal_active == 1) {
         $this->portal_active = true;
     }
     // Set campaign name if there is a campaign id
     if (!empty($this->campaign_id)) {
         $camp = new Campaign();
         $where = "campaigns.id='{$this->campaign_id}'";
         $campaign_list = $camp->get_full_list("campaigns.name", $where, true);
         $this->campaign_name = $campaign_list[0]->name;
     }
 }
Ejemplo n.º 5
0
 function fill_in_additional_detail_fields()
 {
     global $locale;
     parent::fill_in_additional_detail_fields();
     $full_name = $locale->getLocaleFormattedName($this->first_name, $this->last_name, $this->salutation, $this->title);
     $this->name = $full_name;
     $this->full_name = $full_name;
 }
Ejemplo n.º 6
0
 function fill_in_additional_detail_fields()
 {
     //Fill in the assigned_user_name
     //if(!empty($this->status))
     //$this->status = translate('lead_status_dom', '', $this->status);
     parent::fill_in_additional_detail_fields();
     $this->_create_proper_name_field();
     $this->get_contact();
     $this->get_opportunity();
     $this->get_account();
     if (!empty($this->campaign_id)) {
         $camp = new Campaign();
         $where = "campaigns.id='{$this->campaign_id}'";
         $campaign_list = $camp->get_full_list("campaigns.name", $where, true);
         if (!empty($campaign_list)) {
             $this->campaign_name = $campaign_list[0]->name;
         }
     }
 }
Ejemplo n.º 7
0
 function fill_in_additional_detail_fields()
 {
     parent::fill_in_additional_detail_fields();
     $this->_create_proper_name_field();
     $this->get_contact();
     $this->get_opportunity();
     $this->get_account();
     if (!empty($this->campaign_id)) {
         $camp = BeanFactory::getBean('Campaigns');
         $where = "campaigns.id='{$this->campaign_id}'";
         $campaign_list = $camp->get_full_list("campaigns.name", $where, true);
         if (!empty($campaign_list)) {
             $this->campaign_name = $campaign_list[0]->name;
         }
     }
 }
Ejemplo n.º 8
0
 function fill_in_additional_detail_fields()
 {
     parent::fill_in_additional_detail_fields();
     global $locale, $app_list_strings, $current_user;
     // retrieve the account information and the information about the person the contact reports to.
     $query = "SELECT acc.id, acc.name, con_reports_to.first_name, con_reports_to.last_name\n\t\tfrom contacts\n\t\tleft join accounts_contacts a_c on a_c.contact_id = '" . $this->id . "' and a_c.deleted=0\n\t\tleft join accounts acc on a_c.account_id = acc.id and acc.deleted=0\n\t\tleft join contacts con_reports_to on con_reports_to.id = contacts.reports_to_id\n\t\twhere contacts.id = '" . $this->id . "'";
     $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->account_name = $row['name'];
         $this->account_id = $row['id'];
         $this->report_to_name = $row['first_name'] . ' ' . $row['last_name'];
     } else {
         $this->account_name = '';
         $this->account_id = '';
         $this->report_to_name = '';
     }
     $this->load_contacts_users_relationship();
     /** concating this here because newly created Contacts do not have a
      * 'name' attribute constructed to pass onto related items, such as Tasks
      * Notes, etc.
      */
     $this->name = $locale->getLocaleFormattedName($this->first_name, $this->last_name);
     if (!empty($this->contacts_users_id)) {
         $this->sync_contact = true;
     }
     if (!empty($this->portal_active) && $this->portal_active == 1) {
         $this->portal_active = true;
     }
     // Set campaign name if there is a campaign id
     if (!empty($this->campaign_id)) {
         $camp = new Campaign();
         $where = "campaigns.id='{$this->campaign_id}'";
         $campaign_list = $camp->get_full_list("campaigns.name", $where, true);
         $this->campaign_name = $campaign_list[0]->name;
     }
 }