Merge branch '185'

This commit is contained in:
孙广明
2022-02-28 08:58:20 +08:00
505 changed files with 19184 additions and 2533 deletions
+19 -19
View File
@@ -243,10 +243,10 @@ class program extends control
{
/* Only when all subprograms and subprojects are closed can the program be closed. */
$hasUnfinished = $this->program->hasUnfinished($program);
if($hasUnfinished) die(js::error($this->lang->program->closeErrorMessage));
if($hasUnfinished) return print(js::error($this->lang->program->closeErrorMessage));
$changes = $this->project->close($programID);
if(dao::isError()) die(js::error(dao::getError()));
if(dao::isError()) return print(js::error(dao::getError()));
if($this->post->comment != '' or !empty($changes))
{
@@ -255,7 +255,7 @@ class program extends control
}
$this->executeHooks($programID);
die(js::reload('parent.parent'));
return print(js::reload('parent.parent'));
}
$this->view->title = $this->lang->program->close;
@@ -281,7 +281,7 @@ class program extends control
if(!empty($_POST))
{
$changes = $this->project->start($programID, 'program');
if(dao::isError()) die(js::error(dao::getError()));
if(dao::isError()) return print(js::error(dao::getError()));
if($this->post->comment != '' or !empty($changes))
{
@@ -291,7 +291,7 @@ class program extends control
$this->loadModel('common')->syncPPEStatus($programID);
$this->executeHooks($programID);
die(js::reload('parent.parent'));
return print(js::reload('parent.parent'));
}
$this->view->title = $this->lang->program->start;
@@ -317,14 +317,14 @@ class program extends control
if(!empty($_POST))
{
$changes = $this->project->activate($programID);
if(dao::isError()) die(js::error(dao::getError()));
if(dao::isError()) return print(js::error(dao::getError()));
if($this->post->comment != '' or !empty($changes))
{
$actionID = $this->action->create('program', $programID, 'Activated', $this->post->comment);
$this->action->logHistory($actionID, $changes);
}
die(js::reload('parent.parent'));
return print(js::reload('parent.parent'));
}
$newBegin = date('Y-m-d');
@@ -355,7 +355,7 @@ class program extends control
if(!empty($_POST))
{
$changes = $this->project->suspend($programID);
if(dao::isError()) die(js::error(dao::getError()));
if(dao::isError()) return print(js::error(dao::getError()));
if($this->post->comment != '' or !empty($changes))
{
@@ -363,7 +363,7 @@ class program extends control
$this->action->logHistory($actionID, $changes);
}
$this->executeHooks($programID);
die(js::reload('parent.parent'));
return print(js::reload('parent.parent'));
}
$this->view->title = $this->lang->program->suspend;
@@ -389,19 +389,19 @@ class program extends control
if($childrenCount)
{
if($this->viewType == 'json' or (defined('RUN_MODE') && RUN_MODE == 'api')) return $this->send(array('result' => 'fail', 'message' => 'Cannot delete the program has children'));
die(js::alert($this->lang->program->hasChildren));
return print(js::alert($this->lang->program->hasChildren));
}
$productCount = $this->dao->select('count(*) as count')->from(TABLE_PRODUCT)->where('program')->eq($programID)->andWhere('deleted')->eq(0)->fetch('count');
if($productCount) die(js::alert($this->lang->program->hasProduct));
if($productCount) return print(js::alert($this->lang->program->hasProduct));
$program = $this->dao->select('*')->from(TABLE_PROGRAM)->where('id')->eq($programID)->fetch();
if($confirm == 'no') die(js::confirm($this->lang->program->confirmDelete, $this->createLink('program', 'delete', "programID=$programID&confirm=yes")));
if($confirm == 'no') return print(js::confirm($this->lang->program->confirmDelete, $this->createLink('program', 'delete', "programID=$programID&confirm=yes")));
$this->dao->update(TABLE_PROGRAM)->set('deleted')->eq(1)->where('id')->eq($programID)->exec();
$this->loadModel('action')->create('program', $programID, 'deleted', '', ACTIONMODEL::CAN_UNDELETED);
die(js::reload('parent'));
echo js::reload('parent');
}
/**
@@ -508,7 +508,7 @@ class program extends control
{
if($confirm == 'no')
{
die(js::confirm($this->lang->program->confirmDelete, $this->inlink('unlinkStakeholder', "stakeholderID=$stakeholderID&programID=$programID&confirm=yes")));
return print(js::confirm($this->lang->program->confirmDelete, $this->inlink('unlinkStakeholder', "stakeholderID=$stakeholderID&programID=$programID&confirm=yes")));
}
else
{
@@ -518,7 +518,7 @@ class program extends control
$this->loadModel('user')->updateUserView($programID, 'program', array($account));
$this->updateChildUserView($programID, $account);
die(js::reload('parent'));
return print(js::reload('parent'));
}
}
@@ -537,7 +537,7 @@ class program extends control
if($confirm == 'no')
{
die(js::confirm($this->lang->program->confirmBatchUnlink, $this->inlink('batchUnlinkStakeholders', "programID=$programID&stakeholderIDList=$stakeholderIDList&confirm=yes")));
return print(js::confirm($this->lang->program->confirmBatchUnlink, $this->inlink('batchUnlinkStakeholders', "programID=$programID&stakeholderIDList=$stakeholderIDList&confirm=yes")));
}
else
{
@@ -547,7 +547,7 @@ class program extends control
$this->loadModel('user')->updateUserView($programID, 'program', $account);
$this->updateChildUserView($programID, $account);
die(js::reload('parent'));
return print(js::reload('parent'));
}
}
@@ -611,7 +611,7 @@ class program extends control
}
}
if(isset($this->config->bizVersion)) list($fields, $projectStats) = $this->loadModel('workflowfield')->appendDataFromFlow($fields, $projectStats);
if($this->config->edition != 'open') list($fields, $projectStats) = $this->loadModel('workflowfield')->appendDataFromFlow($fields, $projectStats);
$this->post->set('fields', $fields);
$this->post->set('rows', $programs);
@@ -723,7 +723,7 @@ class program extends control
{
$programID = (int)$programID;
$program = $this->program->getByID($programID);
if(!$program) die(js::error($this->lang->notFound) . js::locate('back'));
if(!$program) return print(js::error($this->lang->notFound) . js::locate('back'));
echo $this->fetch('program', 'product', "programID=$programID");
}
+5 -3
View File
@@ -11,12 +11,12 @@ class programModel extends model
{
echo(js::alert($this->lang->program->accessDenied));
if(!$this->server->http_referer) die(js::locate(helper::createLink('my', 'index')));
if(!$this->server->http_referer) return print(js::locate(helper::createLink('my', 'index')));
$loginLink = $this->config->requestType == 'GET' ? "?{$this->config->moduleVar}=user&{$this->config->methodVar}=login" : "user{$this->config->requestFix}login";
if(strpos($this->server->http_referer, $loginLink) !== false) die(js::locate(helper::createLink('my', 'index')));
if(strpos($this->server->http_referer, $loginLink) !== false) return print(js::locate(helper::createLink('my', 'index')));
die(js::locate('back'));
echo js::locate('back');
}
/**
@@ -133,6 +133,7 @@ class programModel extends model
return $this->dao->select('*')->from(TABLE_PROGRAM)
->where('type')->in('program,project')
->andWhere('deleted')->eq(0)
->andWhere('vision')->eq($this->config->vision)
->beginIF(!$this->app->user->admin)
->andWhere('(id')->in($this->app->user->view->programs)
->orWhere('id')->in($this->app->user->view->projects)
@@ -449,6 +450,7 @@ class programModel extends model
->leftJoin(TABLE_TEAM)->alias('t2')->on('t1.id=t2.root')
->leftJoin(TABLE_STAKEHOLDER)->alias('t3')->on('t1.id=t3.objectID')
->where('t1.deleted')->eq('0')
->andWhere('t1.vision')->eq($this->config->vision)
->beginIF($this->config->systemMode == 'new')->andWhere('t1.type')->eq('project')->fi()
->beginIF($this->config->systemMode == 'new' and ($this->cookie->involved or $involved))->andWhere('t2.type')->eq('project')->fi()
->beginIF($browseType != 'all' and $browseType != 'undone')->andWhere('t1.status')->eq($browseType)->fi()
+1 -1
View File
@@ -53,7 +53,7 @@
<?php
$icon = '';
if($program->type == 'program') $icon = ' icon-program';
if($program->type == 'project') $icon = ' icon-common icon-' . (isset($this->config->maxVersion) ? $program->model : $program->type);
if($program->type == 'project') $icon = ' icon-common icon-' . ($this->config->edition == 'max' ? $program->model : $program->type);
$class = $program->type == 'program' ? ' table-nest-toggle' : '';
?>
<span class="table-nest-icon icon <?php echo $class . $icon;?>"></span>
+1 -1
View File
@@ -25,7 +25,7 @@
</div>
</body>
</html>
<?php exit;?>
<?php helper::end();?>
<?php endif;?>
<?php include '../../common/view/header.html.php';?>