diff --git a/module/action/control.php b/module/action/control.php index 2d67b28ee0..6220eac8c6 100755 --- a/module/action/control.php +++ b/module/action/control.php @@ -28,17 +28,19 @@ class action extends control /* Save session. */ $uri = $this->app->getURI(true); - $this->session->set('productList', $uri); - $this->session->set('productPlanList', $uri); - $this->session->set('releaseList', $uri); - $this->session->set('storyList', $uri); - $this->session->set('projectList', $uri); - $this->session->set('taskList', $uri); - $this->session->set('buildList', $uri); - $this->session->set('bugList', $uri); - $this->session->set('caseList', $uri); - $this->session->set('testtaskList', $uri); - $this->session->set('docList', $uri); + $this->session->set('productList', $uri, 'product'); + $this->session->set('productPlanList', $uri, 'product'); + $this->session->set('storyList', $uri, 'product'); + $this->session->set('releaseList', $uri, 'execution'); + $this->session->set('programList', $uri, 'program'); + $this->session->set('projectList', $uri, 'project'); + $this->session->set('executionList', $uri, 'execution'); + $this->session->set('taskList', $uri, 'execution'); + $this->session->set('buildList', $uri, 'execution'); + $this->session->set('bugList', $uri, 'qa'); + $this->session->set('caseList', $uri, 'qa'); + $this->session->set('testtaskList', $uri, 'qa'); + $this->session->set('docList', $uri, 'doc'); /* Get deleted objects. */ $this->app->loadClass('pager', $static = true); diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index 79b3a7443b..e87f3f5f70 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -9,6 +9,8 @@ * @version $Id: zh-cn.php 4955 2013-07-02 01:47:21Z chencongzhi520@gmail.com $ * @link http://www.zentao.net */ +global $config; + $lang->action->common = '系统日志'; $lang->action->product = $lang->productCommon; $lang->action->project = '项目'; @@ -73,7 +75,7 @@ $lang->action->objectTypes['productplan'] = '计划'; $lang->action->objectTypes['release'] = '发布'; $lang->action->objectTypes['program'] = '项目集'; $lang->action->objectTypes['project'] = '项目'; -$lang->action->objectTypes['execution'] = $lang->executionCommon; +$lang->action->objectTypes['execution'] = $config->systemMode == 'new' ? '执行' : $lang->executionCommon; $lang->action->objectTypes['task'] = '任务'; $lang->action->objectTypes['build'] = '版本'; $lang->action->objectTypes['job'] = '构建'; @@ -427,7 +429,6 @@ $lang->action->dynamicAction->entry['created'] = '添加应用'; $lang->action->dynamicAction->entry['edited'] = '编辑应用'; /* 用来生成相应对象的链接。*/ -global $config; $lang->action->label->product = $lang->productCommon . '|product|view|productID=%s'; $lang->action->label->productplan = "计划|productplan|view|productID=%s"; $lang->action->label->release = '发布|release|view|productID=%s'; diff --git a/module/action/model.php b/module/action/model.php index ed30c6d03b..40a2f8e63b 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -501,7 +501,7 @@ class actionModel extends model foreach($typeTrashes as $objectType => $objectIds) { - if(!isset($this->config->objectTables[$objectType]))continue; + if(!isset($this->config->objectTables[$objectType])) continue; $objectIds = array_unique($objectIds); $table = $this->config->objectTables[$objectType]; diff --git a/module/action/view/trash.html.php b/module/action/view/trash.html.php index 9f41580d6d..918bd224d7 100755 --- a/module/action/view/trash.html.php +++ b/module/action/view/trash.html.php @@ -12,7 +12,6 @@ ?> + diff --git a/module/program/control.php b/module/program/control.php index 01a907690e..9e515e8d08 100644 --- a/module/program/control.php +++ b/module/program/control.php @@ -47,7 +47,7 @@ class program extends control if(common::hasPriv('program', 'create')) $this->lang->pageActions = html::a($this->createLink('program', 'create'), " " . $this->lang->program->create, '', "class='btn btn-secondary'"); - $this->app->session->set('programList', $this->app->getURI(true)); + $this->session->set('programList', $this->app->getURI(true)); $programType = $this->cookie->programType ? $this->cookie->programType : 'bylist'; @@ -368,7 +368,7 @@ class program extends control if($confirm == 'no') die(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', '', $extra = ACTIONMODEL::CAN_UNDELETED); + $this->loadModel('action')->create('program', $programID, 'deleted', '', ACTIONMODEL::CAN_UNDELETED); die(js::reload('parent')); } diff --git a/module/project/config.php b/module/project/config.php index 3e000a43ec..a0892f2c03 100644 --- a/module/project/config.php +++ b/module/project/config.php @@ -69,7 +69,7 @@ $config->project->datatable->fieldList['budget']['required'] = 'yes'; $config->project->datatable->fieldList['teamCount']['title'] = 'teamCount'; $config->project->datatable->fieldList['teamCount']['fixed'] = 'no'; -$config->project->datatable->fieldList['teamCount']['width'] = '40'; +$config->project->datatable->fieldList['teamCount']['width'] = '70'; $config->project->datatable->fieldList['teamCount']['required'] = 'no'; $config->project->datatable->fieldList['teamCount']['sort'] = 'no'; diff --git a/module/project/control.php b/module/project/control.php index bf9dc57219..ec0ced4940 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -1325,13 +1325,22 @@ class project extends control } else { - $projectIdList = $this->project->getExecutionsByProject($projectID); - $this->project->delete(TABLE_PROJECT, $projectID); - $this->dao->update(TABLE_PROJECT)->set('deleted')->eq(1)->where('id')->in(array_keys($projectIdList))->exec(); - $this->dao->update(TABLE_DOCLIB)->set('deleted')->eq(1)->where('project')->eq($projectID)->exec(); - $this->project->updateUserView($projectID); - $this->session->set('project', ''); + $this->loadModel('user'); + $this->loadModel('action'); + $this->project->delete(TABLE_PROJECT, $projectID); + $this->dao->update(TABLE_DOCLIB)->set('deleted')->eq(1)->where('execution')->eq($projectID)->exec(); + $this->user->updateUserView($projectID, 'project'); + + /* Delete the execution under the project. */ + $executionIdList = $this->execution->getByProject($projectID); + if(empty($executionIdList)) die(js::reload('parent')); + + $this->dao->update(TABLE_EXECUTION)->set('deleted')->eq(1)->where('id')->in(array_keys($executionIdList))->exec(); + foreach($executionIdList as $executionID => $execution) $this->action->create('execution', $executionID, 'deleted', '', ACTIONMODEL::CAN_UNDELETED); + $this->user->updateUserView($executionIdList, 'sprint'); + + $this->session->set('project', ''); die(js::reload('parent')); } } diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 502fe346b9..3f08fa2def 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -41,6 +41,7 @@ $lang->project->errorSameProducts = '项目不能关联多个相同的产品。' $lang->project->errorNoProducts = '最少关联一个产品'; $lang->project->copyNoProject = '没有可用的项目来复制'; $lang->project->searchByName = '输入项目名称进行检索'; +$lang->project->deleted = '已删除'; /* Fields. */ $lang->project->common = '项目'; diff --git a/module/project/view/ajaxgetdropmenu.html.php b/module/project/view/ajaxgetdropmenu.html.php index d50f5f6b15..9336ed065a 100644 --- a/module/project/view/ajaxgetdropmenu.html.php +++ b/module/project/view/ajaxgetdropmenu.html.php @@ -20,34 +20,35 @@ $projectsPinYin = common::convert2Pinyin($projectNames); foreach($projects as $project) { - $link = helper::createLink('project', 'index', "projectID=%s", '', '', $project->id); + $selected = $project->id == $projectID ? 'selected' : ''; + $link = helper::createLink('project', 'index', "projectID=%s", '', '', $project->id); $projectName = zget($programs, $project->parent, '') ? zget($programs, $project->parent) . '/' . $project->name : $project->name; if($project->status != 'done' and $project->status != 'closed' and $project->PM == $this->app->user->account) { - $myProjectsHtml .= html::a(sprintf($link, $project->id), $projectName, '', "class='text-important' title='{$projectName}' data-key='" . zget($projectsPinYin, $projectName, '') . "'"); + $myProjectsHtml .= html::a(sprintf($link, $project->id), $projectName, '', "class='text-important $selected' title='{$projectName}' data-key='" . zget($projectsPinYin, $projectName, '') . "'"); } else if($project->status != 'done' and $project->status != 'closed' and !($project->PM == $this->app->user->account)) { - $normalProjectsHtml .= html::a(sprintf($link, $project->id), $projectName, '', "title='{$projectName}' data-key='" . zget($projectsPinYin, $projectName, '') . "'"); + $normalProjectsHtml .= html::a(sprintf($link, $project->id), $projectName, '', "class='$selected' title='{$projectName}' data-key='" . zget($projectsPinYin, $projectName, '') . "'"); } - else if($project->status == 'done' or $project->status == 'closed') $closedProjectsHtml .= html::a(sprintf($link, $project->id), $projectName, '', "title='{$projectName}' data-key='" . zget($projectsPinYin, $projectName, '') . "'"); + else if($project->status == 'done' or $project->status == 'closed') $closedProjectsHtml .= html::a(sprintf($link, $project->id), $projectName, '', "class='$selected' title='{$projectName}' data-key='" . zget($projectsPinYin, $projectName, '') . "'"); } ?>
- {$lang->project->myProject}
"; - echo $myProjectsHtml; - if(!empty($myProjectsHtml)) - { - echo "
{$lang->project->other}
"; - } - } - echo $normalProjectsHtml; - ?> + {$lang->project->myProject}
"; + echo $myProjectsHtml; + if(!empty($myProjectsHtml)) + { + echo "
{$lang->project->other}
"; + } + } + echo $normalProjectsHtml; + ?>
-
- -
+
+ diff --git a/module/project/view/build.html.php b/module/project/view/build.html.php index 6ceca83724..388b786cc3 100644 --- a/module/project/view/build.html.php +++ b/module/project/view/build.html.php @@ -60,11 +60,11 @@ $builds):?> $build):?> - id"), sprintf('%03d', $build->id));?> + id"), sprintf('%03d', $build->id), '', "data-app='project'");?> productName;?> branchName) echo "{$build->branchName}"?> - createLink('build', 'view', "build=$build->id"), $build->name);?> + createLink('build', 'view', "build=$build->id"), $build->name, '', "data-app='project'");?> executionName;?> scmPath, 'http') === 0 ? html::a($build->scmPath) : $build->scmPath;?> @@ -79,7 +79,7 @@ } common::printIcon('testtask', 'create', "product=$build->product&executionID={$build->execution}&build=$build->id&projectID=$projectID", $build, 'list', 'bullhorn', '', '', '', "data-app='execution'"); $lang->project->bug = $lang->execution->viewBug; - common::printIcon('execution', 'bug', "project={$build->execution}&orderBy=status&build=$build->id", $build, 'list', '', '', '', '', "data-app='execution'"); + common::printIcon('build', 'view', "buildID=$build->id&type=generatedBug", $build, 'list', 'bug', '', '', '', "data-app='project'"); common::printIcon('build', 'edit', "buildID=$build->id", $build, 'list'); if(common::hasPriv('build', 'delete', $build)) { diff --git a/module/project/view/view.html.php b/module/project/view/view.html.php index a95bfa7f60..a4143dd277 100644 --- a/module/project/view/view.html.php +++ b/module/project/view/view.html.php @@ -90,8 +90,9 @@
id"; - common::printBack(inlink('browse')); + $params = "project=$project->id"; + $browseLink = $this->session->projectList ? $this->session->projectList : inlink('browse'); + common::printBack($browseLink); if(!$project->deleted) { echo "
"; diff --git a/module/search/model.php b/module/search/model.php index 194c103036..093c0a245c 100644 --- a/module/search/model.php +++ b/module/search/model.php @@ -578,13 +578,13 @@ class searchModel extends model { if(!isset($this->config->objectTables[$record->objectType])) continue; $table = $this->config->objectTables[$record->objectType]; - $executionID = $this->dao->select('execution')->from($table)->where('id')->eq($record->objectID)->fetch('execution'); - $record->url = helper::createLink($module, $method, "id={$record->objectID}", '', false, $executionID); + $projectID = $this->dao->select('project')->from($table)->where('id')->eq($record->objectID)->fetch('project'); + $record->url = helper::createLink($module, $method, "id={$record->objectID}", '', false, $projectID); } elseif($module == 'issue') { - $issue = $this->dao->select('id,execution,owner')->from(TABLE_ISSUE)->where('id')->eq($record->objectID)->fetch(); - $record->url = helper::createLink($module, $method, "id={$record->objectID}", '', false, $issue->execution); + $issue = $this->dao->select('id,project,owner')->from(TABLE_ISSUE)->where('id')->eq($record->objectID)->fetch(); + $record->url = helper::createLink($module, $method, "id={$record->objectID}", '', false, $issue->project); $record->extraType = empty($issue->owner) ? 'commonIssue' : 'stakeholderIssue'; } elseif($module == 'story') diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php index a6bda3ae77..766abc2f33 100644 --- a/module/story/view/view.html.php +++ b/module/story/view/view.html.php @@ -12,7 +12,7 @@ ?> -session->storyList != false ? $app->session->storyList : $this->createLink('product', 'browse', "productID=$story->product&branch=$story->branch&moduleID=$story->module");?> +session->storyList ? $app->session->storyList : $this->createLink('product', 'browse', "productID=$story->product&branch=$story->branch&moduleID=$story->module");?>