コード例 #1
1
ファイル: Call.php プロジェクト: eggsurplus/SuiteCRM
	function get_notification_recipients() {
		if($this->special_notification) {
			return parent::get_notification_recipients();
		}

//		$GLOBALS['log']->debug('Call.php->get_notification_recipients():'.print_r($this,true));
		$list = array();
        if(!is_array($this->contacts_arr)) {
			$this->contacts_arr =	array();
		}

		if(!is_array($this->users_arr)) {
			$this->users_arr =	array();
		}

        if(!is_array($this->leads_arr)) {
			$this->leads_arr =	array();
		}

		foreach($this->users_arr as $user_id) {
			$notify_user = new User();
			$notify_user->retrieve($user_id);
			$notify_user->new_assigned_user_name = $notify_user->full_name;
			$GLOBALS['log']->info("Notifications: recipient is $notify_user->new_assigned_user_name");
			$list[$notify_user->id] = $notify_user;
		}

		foreach($this->contacts_arr as $contact_id) {
			$notify_user = new Contact();
			$notify_user->retrieve($contact_id);
			$notify_user->new_assigned_user_name = $notify_user->full_name;
			$GLOBALS['log']->info("Notifications: recipient is $notify_user->new_assigned_user_name");
			$list[$notify_user->id] = $notify_user;
		}

        foreach($this->leads_arr as $lead_id) {
			$notify_user = new Lead();
			$notify_user->retrieve($lead_id);
			$notify_user->new_assigned_user_name = $notify_user->full_name;
			$GLOBALS['log']->info("Notifications: recipient is $notify_user->new_assigned_user_name");
			$list[$notify_user->id] = $notify_user;
		}
		global $sugar_config;
		if(isset($sugar_config['disable_notify_current_user']) && $sugar_config['disable_notify_current_user']) {
			global $current_user;
			if(isset($list[$current_user->id]))
				unset($list[$current_user->id]);
		}
//		$GLOBALS['log']->debug('Call.php->get_notification_recipients():'.print_r($list,true));
		return $list;
	}
コード例 #2
0
ファイル: Meeting.php プロジェクト: butschster/sugarcrm_dev
 protected function get_notification_recipients()
 {
     if ($this->special_notification) {
         return parent::get_notification_recipients();
     }
     $list = [];
     if (!is_array($this->contacts_arr)) {
         $this->contacts_arr = [];
     }
     if (!is_array($this->users_arr)) {
         $this->users_arr = [];
     }
     if (!is_array($this->leads_arr)) {
         $this->leads_arr = [];
     }
     foreach ($this->users_arr as $user_id) {
         $notify_user = new User();
         $notify_user->retrieve($user_id);
         $notify_user->new_assigned_user_name = $notify_user->full_name;
         Log::info("Notifications: recipient is {$notify_user->new_assigned_user_name}");
         $list[$notify_user->id] = $notify_user;
     }
     foreach ($this->contacts_arr as $contact_id) {
         $notify_user = new Contact();
         $notify_user->retrieve($contact_id);
         $notify_user->new_assigned_user_name = $notify_user->full_name;
         Log::info("Notifications: recipient is {$notify_user->new_assigned_user_name}");
         $list[$notify_user->id] = $notify_user;
     }
     foreach ($this->leads_arr as $lead_id) {
         $notify_user = new Lead();
         $notify_user->retrieve($lead_id);
         $notify_user->new_assigned_user_name = $notify_user->full_name;
         Log::info("Notifications: recipient is {$notify_user->new_assigned_user_name}");
         $list[$notify_user->id] = $notify_user;
     }
     global $sugar_config;
     if (isset($sugar_config['disable_notify_current_user']) && $sugar_config['disable_notify_current_user']) {
         global $current_user;
         if (isset($list[$current_user->id])) {
             unset($list[$current_user->id]);
         }
     }
     return $list;
 }
コード例 #3
0
ファイル: Call.php プロジェクト: jglaine/sugar761-ent
 function get_notification_recipients()
 {
     if ($this->special_notification) {
         return parent::get_notification_recipients();
     }
     //		$GLOBALS['log']->debug('Call.php->get_notification_recipients():'.print_r($this,true));
     $list = array();
     if (!is_array($this->contacts_arr)) {
         $this->contacts_arr = array();
     }
     if (empty($this->contacts_arr) && $this->load_relationship('contacts')) {
         $this->contacts_arr = $this->contacts->get();
     }
     if (!is_array($this->users_arr)) {
         $this->users_arr = array();
     }
     if (empty($this->users_arr) && $this->load_relationship('users')) {
         $this->users_arr = $this->users->get();
     }
     if (!is_array($this->leads_arr)) {
         $this->leads_arr = array();
     }
     if (empty($this->leads_arr) && $this->load_relationship('leads')) {
         $this->leads_arr = $this->leads->get();
     }
     foreach ($this->users_arr as $user_id) {
         $notify_user = BeanFactory::getBean('Users', $user_id);
         if (!empty($notify_user->id)) {
             $notify_user->new_assigned_user_name = $notify_user->full_name;
             $GLOBALS['log']->info("Notifications: recipient is {$notify_user->new_assigned_user_name}");
             $list[$notify_user->id] = $notify_user;
         }
     }
     foreach ($this->contacts_arr as $contact_id) {
         $notify_user = BeanFactory::getBean('Contacts', $contact_id);
         if (!empty($notify_user->id) && !empty($notify_user->email1)) {
             $notify_user->new_assigned_user_name = $notify_user->full_name;
             $GLOBALS['log']->info("Notifications: recipient is {$notify_user->new_assigned_user_name}");
             $list[$notify_user->id] = $notify_user;
         }
     }
     foreach ($this->leads_arr as $lead_id) {
         $notify_user = BeanFactory::getBean('Leads', $lead_id);
         if (!empty($notify_user->id)) {
             $notify_user->new_assigned_user_name = $notify_user->full_name;
             $GLOBALS['log']->info("Notifications: recipient is {$notify_user->new_assigned_user_name}");
             $list[$notify_user->id] = $notify_user;
         }
     }
     //		$GLOBALS['log']->debug('Call.php->get_notification_recipients():'.print_r($list,true));
     return $list;
 }
コード例 #4
-1
ファイル: Meeting.php プロジェクト: jgera/sugarcrm_dev
 function get_notification_recipients()
 {
     if ($this->special_notification) {
         return parent::get_notification_recipients();
     }
     $list = array();
     if (!is_array($this->contacts_arr)) {
         $this->contacts_arr = array();
     }
     if (!is_array($this->users_arr)) {
         $this->users_arr = array();
     }
     if (!is_array($this->leads_arr)) {
         $this->leads_arr = array();
     }
     foreach ($this->users_arr as $user_id) {
         $notify_user = new User();
         $notify_user->retrieve($user_id);
         $notify_user->new_assigned_user_name = $notify_user->full_name;
         $GLOBALS['log']->info("Notifications: recipient is {$notify_user->new_assigned_user_name}");
         $list[$notify_user->id] = $notify_user;
     }
     foreach ($this->contacts_arr as $contact_id) {
         $notify_user = new Contact();
         $notify_user->retrieve($contact_id);
         $notify_user->new_assigned_user_name = $notify_user->full_name;
         $GLOBALS['log']->info("Notifications: recipient is {$notify_user->new_assigned_user_name}");
         $list[$notify_user->id] = $notify_user;
     }
     foreach ($this->leads_arr as $lead_id) {
         $notify_user = new Lead();
         $notify_user->retrieve($lead_id);
         $notify_user->new_assigned_user_name = $notify_user->full_name;
         $GLOBALS['log']->info("Notifications: recipient is {$notify_user->new_assigned_user_name}");
         $list[$notify_user->id] = $notify_user;
     }
     return $list;
 }