* Adjust the program module code.

This commit is contained in:
leiyong
2020-12-23 16:32:18 +08:00
parent 8ce295828e
commit 143fb5a04c
3 changed files with 65 additions and 20 deletions
+36
View File
@@ -285,6 +285,42 @@ class program extends control
$this->display();
}
/**
* Suspend a program.
*
* @param int $programID
* @access public
* @return void
*/
public function PGMSuspend($programID)
{
$this->lang->navGroup->program = 'program';
$program = $this->program->getPGMByID($programID);
if(!empty($_POST))
{
$this->loadModel('action');
$changes = $this->project->suspend($programID);
if(dao::isError()) die(js::error(dao::getError()));
if($this->post->comment != '' or !empty($changes))
{
$actionID = $this->action->create('program', $programID, 'Suspended', $this->post->comment);
$this->action->logHistory($actionID, $changes);
}
$this->executeHooks($programID);
die(js::reload('parent.parent'));
}
$this->view->title = $this->lang->project->suspend;
$this->view->position[] = $this->lang->project->suspend;
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->actions = $this->loadModel('action')->getList('project', $programID);
$this->view->project = $program;
$this->display('project', 'suspend');
}
/**
* Delete a program.
*