Merge branch 'master' of github.com:easysoft/zentaopms

This commit is contained in:
leiyong
2020-07-19 23:20:55 -07:00
19 changed files with 118 additions and 51 deletions
+1
View File
@@ -222,6 +222,7 @@ $lang->story->mustChoosePreVersion = 'Version wählen um es umzukhren.';
$lang->story->noStory = 'Keine Storys. ';
$lang->story->ignoreChangeStage = 'Story %s is a draft. Please review it..';
$lang->story->cannotDeleteParent = "Can not delete parent {$lang->storyCommon}";
$lang->story->moveChildrenTips = "Move child {$lang->storyCommon} to selected product when modified product property of parent {$lang->storyCommon}.";
$lang->story->form = new stdclass();
$lang->story->form->area = 'Story Bereich';
+1
View File
@@ -225,6 +225,7 @@ $lang->story->mustChoosePreVersion = 'Select a version to revert to.';
$lang->story->noStory = 'No stories yet. ';
$lang->story->ignoreChangeStage = 'Story %s is a draft. Please review it..';
$lang->story->cannotDeleteParent = "Can not delete parent {$lang->storyCommon}";
$lang->story->moveChildrenTips = "Move child {$lang->storyCommon} to selected product when modified product property of parent {$lang->storyCommon}.";
$lang->story->form = new stdclass();
$lang->story->form->area = 'Scope';
+1
View File
@@ -222,6 +222,7 @@ $lang->story->mustChoosePreVersion = 'Sélect une version pour revenir en arri
$lang->story->noStory = "Aucune story pour l'instant. ";
$lang->story->ignoreChangeStage = "Story %s est à l'état brouillon et nécessite d'être complétée et validée...";
$lang->story->cannotDeleteParent = "Can not delete parent {$lang->storyCommon}";
$lang->story->moveChildrenTips = "Move child {$lang->storyCommon} to selected product when modified product property of parent {$lang->storyCommon}.";
$lang->story->form = new stdclass();
$lang->story->form->area = 'Périmètre';
+1
View File
@@ -222,6 +222,7 @@ $lang->story->mustChoosePreVersion = 'Chọn một phiên bản để chuyển t
$lang->story->noStory = 'Không có câu chuyện nào';
$lang->story->ignoreChangeStage = 'Câu chuyện %s là bản nháp. Vui lòng xét duyệt nó..';
$lang->story->cannotDeleteParent = "Không thể xóa {$lang->storyCommon} mẹ";
$lang->story->moveChildrenTips = "Move child {$lang->storyCommon} to selected product when modified product property of parent {$lang->storyCommon}.";
$lang->story->form = new stdclass();
$lang->story->form->area = 'Phạm vi';
+1
View File
@@ -225,6 +225,7 @@ $lang->story->mustChoosePreVersion = '必须选择回溯的版本';
$lang->story->noStory = "暂时没有{$lang->storyCommon}。";
$lang->story->ignoreChangeStage = "{$lang->storyCommon} %s 为草稿状态,没有修改其阶段。";
$lang->story->cannotDeleteParent = "不能删除父{$lang->storyCommon}";
$lang->story->moveChildrenTips = "修改父{$lang->storyCommon}的所属产品会将其下的子{$lang->storyCommon}也移动到所选产品下。";
$lang->story->form = new stdclass();
$lang->story->form->area = "该{$lang->storyCommon}所属范围";
+28 -9
View File
@@ -597,16 +597,11 @@ class storyModel extends model
{
if($story->product != $oldStory->product)
{
$this->dao->update(TABLE_PROJECTSTORY)->set('product')->eq($story->product)->where('story')->eq($storyID)->exec();
$storyProjects = $this->dao->select('project')->from(TABLE_PROJECTSTORY)->where('story')->eq($storyID)->orderBy('project')->fetchPairs('project', 'project');
$linkedProjects = $this->dao->select('project')->from(TABLE_PROJECTPRODUCT)->where('project')->in($storyProjects)->andWhere('product')->eq($story->product)->orderBy('project')->fetchPairs('project','project');
$unlinkedProjects = array_diff($storyProjects, $linkedProjects);
foreach($unlinkedProjects as $projectID)
$this->updateStoryProduct($storyID, $story->product);
if($oldStory->parent == '-1')
{
$data = new stdclass();
$data->project = $projectID;
$data->product = $story->product;
$this->dao->replace(TABLE_PROJECTPRODUCT)->data($data)->exec();
$childStories = $this->dao->select('id')->from(TABLE_STORY)->where('parent')->eq($storyID)->andWhere('deleted')->eq(0)->fetchPairs('id');
foreach($childStories as $childStoryID) $this->updateStoryProduct($childStoryID, $story->product);
}
}
@@ -667,6 +662,30 @@ class storyModel extends model
}
}
/**
* Update story product.
*
* @param int $storyID
* @param int $productID
* @access public
* @return void
*/
public function updateStoryProduct($storyID, $productID)
{
$this->dao->update(TABLE_STORY)->set('product')->eq($productID)->where('id')->eq($storyID)->exec();
$this->dao->update(TABLE_PROJECTSTORY)->set('product')->eq($productID)->where('story')->eq($storyID)->exec();
$storyProjects = $this->dao->select('project')->from(TABLE_PROJECTSTORY)->where('story')->eq($storyID)->orderBy('project')->fetchPairs('project', 'project');
$linkedProjects = $this->dao->select('project')->from(TABLE_PROJECTPRODUCT)->where('project')->in($storyProjects)->andWhere('product')->eq($productID)->orderBy('project')->fetchPairs('project','project');
$unlinkedProjects = array_diff($storyProjects, $linkedProjects);
foreach($unlinkedProjects as $projectID)
{
$data = new stdclass();
$data->project = $projectID;
$data->product = $productID;
$this->dao->replace(TABLE_PROJECTPRODUCT)->data($data)->exec();
}
}
/**
* Update parent status.
*
+2
View File
@@ -11,6 +11,8 @@
*/
?>
<?php include './header.html.php';?>
<?php js::set('parentStory', !empty($story->children));?>
<?php js::set('moveChildrenTips', $lang->story->moveChildrenTips);?>
<div class='main-content' id='mainContent'>
<form method='post' enctype='multipart/form-data' target='hiddenwin' id='dataform'>
<div class='main-header'>
+2
View File
@@ -3,6 +3,8 @@
<script>
function loadProduct(productID)
{
if(parentStory) alert(moveChildrenTips);
loadProductBranches(productID)
loadProductModules(productID);
loadProductPlans(productID);
+1 -1
View File
@@ -59,7 +59,7 @@
<?php if(empty($task->team) or $task->assignedTo == $this->app->user->account):?>
<td align='center' class='c-actions'>
<?php
if($task->status == 'wait' or $task->status == 'pause' or $task->status == 'doing')
if(($task->status == 'wait' or $task->status == 'pause' or $task->status == 'doing') and ($this->app->user->admin or $this->app->user->account == $estimate->account))
{
common::printIcon('task', 'editEstimate', "estimateID=$estimate->id", '', 'list', 'pencil', '', 'showinonlybody', true);
common::printIcon('task', 'deleteEstimate', "estimateID=$estimate->id", '', 'list', 'close', 'hiddenwin', 'showinonlybody');
+9 -8
View File
@@ -783,14 +783,15 @@ class testcase extends control
$this->view->showFields = $this->config->testcase->custom->batchEditFields;
/* Assign. */
$this->view->position[] = $this->lang->testcase->common;
$this->view->position[] = $this->lang->testcase->batchEdit;
$this->view->caseIDList = $caseIDList;
$this->view->productID = $productID;
$this->view->branchProduct = $branchProduct;
$this->view->priList = array('ditto' => $this->lang->testcase->ditto) + $this->lang->testcase->priList;
$this->view->typeList = array('' => '', 'ditto' => $this->lang->testcase->ditto) + $this->lang->testcase->typeList;
$this->view->cases = $cases;
$this->view->position[] = $this->lang->testcase->common;
$this->view->position[] = $this->lang->testcase->batchEdit;
$this->view->caseIDList = $caseIDList;
$this->view->productID = $productID;
$this->view->branchProduct = $branchProduct;
$this->view->priList = array('ditto' => $this->lang->testcase->ditto) + $this->lang->testcase->priList;
$this->view->typeList = array('' => '', 'ditto' => $this->lang->testcase->ditto) + $this->lang->testcase->typeList;
$this->view->cases = $cases;
$this->view->forceNotReview = $this->testcase->forceNotReview();
$this->display();
}
+1 -1
View File
@@ -858,7 +858,6 @@ class testcaseModel extends model
$case->lastEditedBy = $this->app->user->account;
$case->lastEditedDate = $now;
$case->pri = $data->pris[$caseID];
$case->status = $data->statuses[$caseID];
$case->branch = $data->branches[$caseID];
$case->module = $data->modules[$caseID];
$case->story = $data->stories[$caseID];
@@ -868,6 +867,7 @@ class testcaseModel extends model
$case->keywords = $data->keywords[$caseID];
$case->type = $data->types[$caseID];
$case->stage = empty($data->stages[$caseID]) ? '' : implode(',', $data->stages[$caseID]);
if(isset($data->statuses[$caseID])) $case->status = $data->statuses[$caseID];
foreach($extendFields as $extendField)
{
+12 -1
View File
@@ -85,7 +85,18 @@
<tr class='text-center'>
<td><?php echo $caseID . html::hidden("caseIDList[$caseID]", $caseID);?></td>
<td class='<?php echo zget($visibleFields, 'pri', 'hidden')?>'> <?php echo html::select("pris[$caseID]", $priList, $cases[$caseID]->pri, 'class=form-control');?></td>
<td class='<?php echo zget($visibleFields, 'status', 'hidden')?>'><?php echo html::select("statuses[$caseID]", (array)$lang->testcase->statusList, $cases[$caseID]->status, 'class=form-control');?></td>
<td class='<?php echo zget($visibleFields, 'status', 'hidden')?>'>
<?php
if(!$forceNotReview and $cases[$caseID]->status == 'wait')
{
echo $lang->testcase->statusList['wait'];
}
else
{
echo html::select("statuses[$caseID]", (array)$lang->testcase->statusList, $cases[$caseID]->status, 'class=form-control');
}
?>
</td>
<?php if($branchProduct):?>
<td class='text-left<?php echo zget($visibleFields, 'branch', ' hidden')?>' style='overflow:visible'>
<?php $branchProductID = $productID ? $productID : $product->id;?>
+1 -1
View File
@@ -129,7 +129,7 @@
common::printIcon('testcase', 'edit',"caseID=$case->id", $case, 'button', '', '', 'showinonlybody');
if(!$isLibCase and $case->auto != 'unit') common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase&param=$case->id", $case, 'button', 'copy');
if($isLibCase and common::hasPriv('caselib', 'createCase')) echo html::a($this->createLink('caselib', 'createCase', "libID=$case->lib&moduleID=$case->module&param=$case->id", $case), "<i class='icon-copy'></i>", '', "class='btn' title='{$lang->testcase->copy}'");
common::printIcon('testcase', 'delete', "caseID=$case->id", $case, 'button', 'trash', 'hiddenwin', 'showinonlybody');
common::printIcon('testcase', 'delete', "caseID=$case->id", $case, 'button', 'trash', 'hiddenwin', '');
?>
<?php endif;?>
</div>
+29 -26
View File
@@ -38,15 +38,10 @@
<?php $actionFormLink = $this->createLink('action', 'comment', "objectType=todo&objectID=$todo->id");?>
<?php include '../../common/view/action.html.php';?>
</div>
<div class='main-actions'>
<div class="btn-toolbar">
<?php
if($todo->status == 'wait') common::printLink('todo', 'start', "todoID=$todo->id", "<i class='icon icon-play'></i>", 'hiddenwin', "title='{$lang->todo->start}' class='btn showinonlybody'");
if($todo->status == 'done' || $todo->status == 'closed') common::printLink('todo', 'activate', "todoID=$todo->id", "<i class='icon icon-magic'></i>", 'hiddenwin', "title='{$lang->todo->activate}' class='btn showinonlybody'");
if($todo->status == 'done') common::printLink('todo', 'close', "todoID=$todo->id", "<i class='icon icon-off'></i>", 'hiddenwin', "title='{$lang->todo->close}' class='btn showinonlybody'");
common::printLink('todo', 'edit', "todoID=$todo->id", "<i class='icon icon-edit'></i>", '', "title='{$lang->todo->edit}' class='btn showinonlybody'");
common::printLink('todo', 'delete', "todoID=$todo->id", "<i class='icon icon-trash'></i>", 'hiddenwin', "title='{$lang->todo->delete}' class='btn showinonlybody'");
if($this->session->todoList)
{
$browseLink = $this->session->todoList;
@@ -60,28 +55,36 @@
$browseLink = $this->createLink('user', 'todo', "account=$todo->account");
}
if($todo->status != 'done' && $todo->status != 'closed')
if($this->app->user->admin or ($this->app->user->account == $todo->account) or ($this->app->user->account == $todo->assignedTo))
{
echo "<div class='btn-group dropup'>";
echo html::a($this->createLink('todo', 'finish', "id=$todo->id", 'html', true), "<i class='icon icon-checked'></i>", 'hiddenwin', "title='{$lang->todo->finish}' class='btn showinonlybody btn-success'");
$createStoryPriv = common::hasPriv('story', 'create');
$createTaskPriv = common::hasPriv('task', 'create');
$createBugPriv = common::hasPriv('bug', 'create');
if($createStoryPriv or $createTaskPriv or $createBugPriv)
{
$isonlybody = isonlybody();
unset($_GET['onlybody']);
echo "<button type='button' class='btn btn-success dropdown-toggle' data-toggle='dropdown'><span class='caret'></span></button>";
echo "<ul class='dropdown-menu pull-right' role='menu'>";
if($createStoryPriv) echo '<li>' . html::a('###', $lang->todo->reasonList['story'], '', "data-toggle='modal' data-target='#productModal' data-backdrop='false' data-moveable='true' data-position='center' id='toStoryLink'") . '</li>';
if($createTaskPriv) echo '<li>' . html::a('###', $lang->todo->reasonList['task'], '', "data-toggle='modal' data-target='#projectModal' data-backdrop='false' data-moveable='true' data-position='center' id='toTaskLink'") . '</li>';
if($createBugPriv) echo '<li>' . html::a('###', $lang->todo->reasonList['bug'], '', "data-toggle='modal' data-target='#productModal' data-backdrop='false' data-moveable='true' data-position='center' id='toBugLink'") . '</li>';
echo "</ul>";
if($isonlybody) $_GET['onlybody'] = 'yes';
}
echo "</div>";
}
if($todo->status == 'wait') common::printLink('todo', 'start', "todoID=$todo->id", "<i class='icon icon-play'></i>", 'hiddenwin', "title='{$lang->todo->start}' class='btn showinonlybody'");
if($todo->status == 'done' || $todo->status == 'closed') common::printLink('todo', 'activate', "todoID=$todo->id", "<i class='icon icon-magic'></i>", 'hiddenwin', "title='{$lang->todo->activate}' class='btn showinonlybody'");
if($todo->status == 'done') common::printLink('todo', 'close', "todoID=$todo->id", "<i class='icon icon-off'></i>", 'hiddenwin', "title='{$lang->todo->close}' class='btn showinonlybody'");
common::printLink('todo', 'edit', "todoID=$todo->id", "<i class='icon icon-edit'></i>", '', "title='{$lang->todo->edit}' class='btn showinonlybody'");
common::printLink('todo', 'delete', "todoID=$todo->id", "<i class='icon icon-trash'></i>", 'hiddenwin', "title='{$lang->todo->delete}' class='btn showinonlybody'");
if($todo->status != 'done' && $todo->status != 'closed')
{
echo "<div class='btn-group dropup'>";
echo html::a($this->createLink('todo', 'finish', "id=$todo->id", 'html', true), "<i class='icon icon-checked'></i>", 'hiddenwin', "title='{$lang->todo->finish}' class='btn showinonlybody btn-success'");
$createStoryPriv = common::hasPriv('story', 'create');
$createTaskPriv = common::hasPriv('task', 'create');
$createBugPriv = common::hasPriv('bug', 'create');
if($createStoryPriv or $createTaskPriv or $createBugPriv)
{
$isonlybody = isonlybody();
unset($_GET['onlybody']);
echo "<button type='button' class='btn btn-success dropdown-toggle' data-toggle='dropdown'><span class='caret'></span></button>";
echo "<ul class='dropdown-menu pull-right' role='menu'>";
if($createStoryPriv) echo '<li>' . html::a('###', $lang->todo->reasonList['story'], '', "data-toggle='modal' data-target='#productModal' data-backdrop='false' data-moveable='true' data-position='center' id='toStoryLink'") . '</li>';
if($createTaskPriv) echo '<li>' . html::a('###', $lang->todo->reasonList['task'], '', "data-toggle='modal' data-target='#projectModal' data-backdrop='false' data-moveable='true' data-position='center' id='toTaskLink'") . '</li>';
if($createBugPriv) echo '<li>' . html::a('###', $lang->todo->reasonList['bug'], '', "data-toggle='modal' data-target='#productModal' data-backdrop='false' data-moveable='true' data-position='center' id='toBugLink'") . '</li>';
echo "</ul>";
if($isonlybody) $_GET['onlybody'] = 'yes';
}
echo "</div>";
}
}
common::printRPN($browseLink);
?>
</div>
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.
Binary file not shown.