* Refactor projectrelease::notify.
This commit is contained in:
@@ -254,36 +254,7 @@ class projectrelease extends control
|
||||
*/
|
||||
public function notify($releaseID)
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
if(isset($_POST['notify']))
|
||||
{
|
||||
$notify = implode(',', $this->post->notify);
|
||||
$this->dao->update(TABLE_RELEASE)->set('notify')->eq($notify)->where('id')->eq($releaseID)->exec();
|
||||
|
||||
$this->release->sendmail($releaseID);
|
||||
}
|
||||
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
|
||||
}
|
||||
|
||||
$release = $this->release->getByID($releaseID);
|
||||
$project = $this->loadModel('project')->getByID($this->session->project);
|
||||
|
||||
if(!$project->hasProduct)
|
||||
{
|
||||
unset($this->lang->release->notifyList['FB']);
|
||||
unset($this->lang->release->notifyList['PO']);
|
||||
unset($this->lang->release->notifyList['QD']);
|
||||
}
|
||||
|
||||
if(!$project->multiple) unset($this->lang->release->notifyList['ET']);
|
||||
|
||||
$this->view->release = $release;
|
||||
$this->view->actions = $this->loadModel('action')->getList('release', $releaseID);
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter|noclosed');
|
||||
$this->view->notifyList = $this->lang->release->notifyList;
|
||||
$this->display();
|
||||
echo $this->fetch('release', 'notify', "releaseID={$releaseID}&projectID={$this->session->project}");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -281,7 +281,7 @@ class release extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function notify($releaseID)
|
||||
public function notify(int $releaseID, int $projectID = 0)
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
@@ -294,7 +294,21 @@ class release extends control
|
||||
$this->loadModel('action')->create('release', $releaseID, 'notified');
|
||||
}
|
||||
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'load' => true));
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'load' => true, 'closeModal' => true));
|
||||
}
|
||||
|
||||
if($this->app->tab == 'project' && $projectID != 0)
|
||||
{
|
||||
$project = $this->loadModel('project')->getByID($this->session->project);
|
||||
|
||||
if(!$project->hasProduct)
|
||||
{
|
||||
unset($this->lang->release->notifyList['FB']);
|
||||
unset($this->lang->release->notifyList['PO']);
|
||||
unset($this->lang->release->notifyList['QD']);
|
||||
}
|
||||
|
||||
if(!$project->multiple) unset($this->lang->release->notifyList['ET']);
|
||||
}
|
||||
|
||||
$this->view->release = $this->release->getById($releaseID);
|
||||
|
||||
Reference in New Issue
Block a user