diff --git a/module/mail/model.php b/module/mail/model.php index f890fad97f..2e48a302ce 100644 --- a/module/mail/model.php +++ b/module/mail/model.php @@ -331,16 +331,8 @@ class mailModel extends model $toList = explode(',', str_replace(' ', '', $toList)); foreach($toList as $account) { - if(!isset($emails[$account]) or isset($emails[$account]->sended)) continue; - if($this->config->mail->mta == 'sendcloud') - { - $this->mta->addAddress($account); - } - else - { - if(strpos($emails[$account]->email, '@') == false) continue; - $this->mta->addAddress($emails[$account]->email, $this->convertCharset($emails[$account]->realname)); - } + if(!isset($emails[$account]) or isset($emails[$account]->sended) or strpos($emails[$account]->email, '@') == false) continue; + $this->mta->addAddress($emails[$account]->email, $this->convertCharset($emails[$account]->realname)); $emails[$account]->sended = true; } } @@ -359,16 +351,8 @@ class mailModel extends model if(!is_array($ccList)) return; foreach($ccList as $account) { - if(!isset($emails[$account]) or isset($emails[$account]->sended)) continue; - if($this->config->mail->mta == 'sendcloud') - { - $this->mta->addAddress($account); - } - else - { - if(strpos($emails[$account]->email, '@') == false) continue; - $this->mta->addCC($emails[$account]->email, $this->convertCharset($emails[$account]->realname)); - } + if(!isset($emails[$account]) or isset($emails[$account]->sended) or strpos($emails[$account]->email, '@') == false) continue; + $this->mta->addCC($emails[$account]->email, $this->convertCharset($emails[$account]->realname)); $emails[$account]->sended = true; } } diff --git a/module/release/control.php b/module/release/control.php index 7b3862bca2..fc82523821 100644 --- a/module/release/control.php +++ b/module/release/control.php @@ -144,8 +144,10 @@ class release extends control if($build->project) { $generatedBugs = $this->dao->select('*')->from(TABLE_BUG)->where('deleted')->eq(0) - ->andWhere("(project = '" . (int)$projectID . "' " . (empty($build) ? '' : "OR CONCAT(',', openedBuild, ',') like '%,$build,%'") . ")") + ->andWhere('product')->eq($release->product) + ->andWhere("(project = '" . (int)$build->project . "'" . (empty($build->id) ? '' : " OR CONCAT(',', openedBuild, ',') like '%,$build->id,%'") . ")") ->andWhere('status')->eq('active') + ->andWhere('toStory')->eq(0) ->orderBy('id_desc')->fetchAll(); $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'newBugs'); }