* Modify replicable projects.

This commit is contained in:
leiyong
2020-11-19 15:48:32 +08:00
parent 7c8ec20264
commit def7c10ea5
9 changed files with 15 additions and 8 deletions

View File

@@ -747,7 +747,7 @@ class program extends control
$this->view->pmUsers = $this->loadModel('user')->getPairs('noclosed|nodeleted|pmfirst');
$this->view->users = $this->user->getPairs('noclosed|nodeleted');
$this->view->programs = array('' => '') + $this->program->getPRJPairsByModel($model, $programID);
$this->view->copyProjects = $this->program->getPRJPairsByModel($model, $programID);
$this->view->products = $products;
$this->view->allProducts = array('0' => '') + $allProducts;
$this->view->productPlans = array('0' => '') + $productPlans;

View File

@@ -33,6 +33,7 @@ $lang->program->unbindWhielist = 'Project Remove Whitelist';
$lang->program->PRJManageProducts = 'Manage Products';
$lang->program->copyTitle = 'Please select an project to copy';
$lang->program->errorSameProducts = 'Project cannot be associated with multiple identical products.';
$lang->program->copyNoProject = 'There are no items available to copy.';
/* Fields. */
$lang->program->common = 'Project';

View File

@@ -33,6 +33,7 @@ $lang->program->unbindWhielist = 'Project Remove Whitelist';
$lang->program->PRJManageProducts = 'Manage Products';
$lang->program->copyTitle = 'Please select an project to copy';
$lang->program->errorSameProducts = 'Project cannot be associated with multiple identical products.';
$lang->program->copyNoProject = 'There are no items available to copy.';
/* Fields. */
$lang->program->common = 'Project';

View File

@@ -33,6 +33,7 @@ $lang->program->unbindWhielist = 'Project Remove Whitelist';
$lang->program->PRJManageProducts = 'Manage Products';
$lang->program->copyTitle = 'Please select an project to copy';
$lang->program->errorSameProducts = 'Project cannot be associated with multiple identical products.';
$lang->program->copyNoProject = 'There are no items available to copy.';
/* Fields. */
$lang->program->common = 'Project';

View File

@@ -33,6 +33,7 @@ $lang->program->unbindWhielist = 'Project Remove Whitelist';
$lang->program->PRJManageProducts = 'Manage Products';
$lang->program->copyTitle = 'Please select an project to copy';
$lang->program->errorSameProducts = 'Project cannot be associated with multiple identical products.';
$lang->program->copyNoProject = 'There are no items available to copy.';
/* Fields. */
$lang->program->common = 'Project';

View File

@@ -33,6 +33,7 @@ $lang->program->unbindWhielist = '项目删除白名单';
$lang->program->PRJManageProducts = '项目关联产品';
$lang->program->copyTitle = '请选择一个项目来复制';
$lang->program->errorSameProducts = '项目不能关联多个相同的产品。';
$lang->program->copyNoProject = '没有可用的项目来复制';
/* Fields. */
$lang->program->common = '项目集';

View File

@@ -33,6 +33,7 @@ $lang->program->unbindWhielist = '項目刪除白名單';
$lang->program->PRJManageProducts = '項目關聯產品';
$lang->program->copyTitle = '請選擇一個項目來複制';
$lang->program->errorSameProducts = '項目不能關聯多個相同的產品。';
$lang->program->copyNoProject = '沒有可用的項目來複制';
/* Fields. */
$lang->program->common = '項目集';
@@ -80,7 +81,7 @@ $lang->program->sv = 'SV%';
$lang->program->ac = 'AC';
$lang->program->cv = 'CV%';
$lang->program->PRJTeamCount = '項目成員';
$lang->program->PRJLongTime = '長期項目';
$lang->program->PRJLongTime = '長期';
$lang->program->productNotEmpty = '關聯產品不能為空!';
@@ -123,6 +124,7 @@ $lang->program->endList[31] = '一個月';
$lang->program->endList[93] = '三個月';
$lang->program->endList[186] = '半年';
$lang->program->endList[365] = '一年';
$lang->program->endList[999] = '長期';
$lang->program->noPRJ = '暫時沒有項目';
$lang->program->accessDenied = '您無權訪問該項目!';

View File

@@ -1080,7 +1080,7 @@ class programModel extends model
}
/**
* Get project pairs by model.
* Get project pairs by model and program.
*
* @param string $model
* @param int $programID
@@ -1089,9 +1089,9 @@ class programModel extends model
*/
public function getPRJPairsByModel($model, $programID = 0)
{
return $this->dao->select('id, name')->from(TABLE_PROGRAM)
return $this->dao->select('id, name')->from(TABLE_PROJECT)
->where('type')->eq('project')
->beginIF($programID)->andWhere('parent')->eq($programID)->fi()
->andWhere('parent')->eq($programID)
->andWhere('model')->eq($model)
->andWhere('deleted')->eq('0')
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi()

View File

@@ -175,14 +175,14 @@
<h4 class='modal-title' id='myModalLabel'><?php echo $lang->program->copyTitle;?></h4>
</div>
<div class='modal-body'>
<?php if(count($programs) == 1):?>
<?php if(empty($copyProjects)):?>
<div class='alert with-icon'>
<i class='icon-exclamation-sign'></i>
<div class='content'><?php echo $lang->project->copyNoProject;?></div>
<div class='content'><?php echo $lang->program->copyNoProject;?></div>
</div>
<?php else:?>
<div id='copyProjects' class='row'>
<?php foreach ($programs as $id => $name):?>
<?php foreach ($copyProjects as $id => $name):?>
<?php if(empty($id)):?>
<?php if($copyProjectID != 0):?>
<div class='col-md-4 col-sm-6'><a href='javascript:;' data-id='' class='cancel'><?php echo html::icon($lang->icons['cancel']) . ' ' . $lang->project->cancelCopy;?></a></div>