From cefd614900bdc01de28ba8410c49faeb22c94e64 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 29 Jun 2021 14:31:58 +0800 Subject: [PATCH] * fix bug and adjust for createLink params. --- module/action/model.php | 10 ++++------ module/product/view/project.html.php | 4 ++-- module/productplan/view/linkbug.html.php | 2 +- module/productplan/view/view.html.php | 2 +- module/search/model.php | 10 +++++----- module/story/view/track.html.php | 2 +- module/user/view/bug.html.php | 4 ++-- module/user/view/execution.html.php | 2 +- module/user/view/task.html.php | 6 +++--- module/user/view/testcase.html.php | 4 ++-- module/user/view/testtask.html.php | 6 +++--- 11 files changed, 25 insertions(+), 27 deletions(-) diff --git a/module/action/model.php b/module/action/model.php index 2db2f1c184..f1db696a80 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -443,12 +443,10 @@ class actionModel extends model $action->extra = strtolower($extra); if($id) { - $table = $this->config->objectTables[$action->extra]; - $field = $this->config->action->objectNameFields[$action->extra]; - $object = $this->dao->select($field . ',project')->from($table)->where('id')->eq($id)->fetch(); - $name = $object->$field; - $projectID = $object->project; - if($name) $action->appendLink = html::a(helper::createLink($action->extra, 'view', "id=$id", '', '', $projectID), "#$id " . $name); + $table = $this->config->objectTables[$action->extra]; + $field = $this->config->action->objectNameFields[$action->extra]; + $name = $this->dao->select($field)->from($table)->where('id')->eq($id)->fetch($field); + if($name) $action->appendLink = html::a(helper::createLink($action->extra, 'view', "id=$id"), "#$id " . $name); } } } diff --git a/module/product/view/project.html.php b/module/product/view/project.html.php index 5f23536dab..48e82067cb 100644 --- a/module/product/view/project.html.php +++ b/module/product/view/project.html.php @@ -55,11 +55,11 @@ systemMode == 'new') { - echo html::a($this->createLink('project', 'index', 'project=' . $project->id, '', false, $project->id), $project->name, '_parent'); + echo html::a($this->createLink('project', 'index', 'project=' . $project->id), $project->name, '_parent'); } else { - echo html::a($this->createLink('execution', 'task', 'project=' . $project->id, '', false, $project->id), $project->name, '_parent'); + echo html::a($this->createLink('execution', 'task', 'project=' . $project->id), $project->name, '_parent'); } ?> diff --git a/module/productplan/view/linkbug.html.php b/module/productplan/view/linkbug.html.php index 3bc64c4af9..9ac556f6d4 100644 --- a/module/productplan/view/linkbug.html.php +++ b/module/productplan/view/linkbug.html.php @@ -42,7 +42,7 @@ id => sprintf('%03d', $bug->id)));?> bug->priList, $bug->pri, $bug->pri)?> - createLink('bug', 'view', "bugID=$bug->id", '', true, $bug->project), $bug->title, '', "data-toggle='modal' data-type='iframe' data-width='90%'");?> + createLink('bug', 'view', "bugID=$bug->id", '', true), $bug->title, '', "data-toggle='modal' data-type='iframe' data-width='90%'");?> openedBy);?> assignedTo);?> diff --git a/module/productplan/view/view.html.php b/module/productplan/view/view.html.php index 230ed30e44..6ae0af8f1e 100644 --- a/module/productplan/view/view.html.php +++ b/module/productplan/view/view.html.php @@ -392,7 +392,7 @@ bug->priList, $bug->pri, $bug->pri);?> - createLink('bug', 'view', "bugID=$bug->id", '', false, $bug->project), $bug->title);?> + createLink('bug', 'view', "bugID=$bug->id"), $bug->title);?> openedBy);?> assignedTo);?> diff --git a/module/search/model.php b/module/search/model.php index 19faf9d00f..0048bc94ea 100644 --- a/module/search/model.php +++ b/module/search/model.php @@ -577,29 +577,29 @@ class searchModel extends model if(!isset($this->config->objectTables[$record->objectType])) continue; $table = $this->config->objectTables[$record->objectType]; $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); + $record->url = helper::createLink($module, $method, "id={$record->objectID}"); } elseif($module == 'issue') { $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->url = helper::createLink($module, $method, "id={$record->objectID}"); $record->extraType = empty($issue->owner) ? 'commonIssue' : 'stakeholderIssue'; } elseif($module == 'execution') { $execution = $this->dao->select('id,type,project')->from(TABLE_EXECUTION)->where('id')->eq($record->objectID)->fetch(); - $record->url = helper::createLink('execution', $method, "id={$record->objectID}", '', false, $execution->project); + $record->url = helper::createLink('execution', $method, "id={$record->objectID}"); $record->extraType = $execution->type; } elseif($module == 'story') { $story = $this->dao->select('id,type')->from(TABLE_STORY)->where('id')->eq($record->objectID)->fetch(); - $record->url = helper::createLink($module, $method, "id={$record->objectID}", '', false, 0, true); + $record->url = helper::createLink($module, $method, "id={$record->objectID}"); $record->extraType = $story->type; } else { - $record->url = helper::createLink($module, $method, "id={$record->objectID}", '', false, 0, true); + $record->url = helper::createLink($module, $method, "id={$record->objectID}"); } } diff --git a/module/story/view/track.html.php b/module/story/view/track.html.php index 29e9ca847a..6eeb36a2ba 100644 --- a/module/story/view/track.html.php +++ b/module/story/view/track.html.php @@ -84,7 +84,7 @@ cases as $caseID => $case):?> - createLink('testcase', 'view', "caseID=$caseID", '', false, $case->project), $case->title, '', "title='$case->title'") . '
';?> + createLink('testcase', 'view', "caseID=$caseID"), $case->title, '', "title='$case->title'") . '
';?> maxVersion)):?> diff --git a/module/user/view/bug.html.php b/module/user/view/bug.html.php index 800d00814d..36773e479f 100644 --- a/module/user/view/bug.html.php +++ b/module/user/view/bug.html.php @@ -51,11 +51,11 @@ - createLink('bug', 'view', "bugID=$bug->id", '', false, $bug->project), $bug->id, '_blank');?> + createLink('bug', 'view', "bugID=$bug->id"), $bug->id, '_blank');?> bug->severityList, $bug->severity, $bug->severity)?>'>bug->severityList, $bug->severity, $bug->severity)?> bug->priList, $bug->pri, $bug->pri)?>'>bug->priList, $bug->pri, $bug->pri)?> bug->typeList[$bug->type]?> - createLink('bug', 'view', "bugID=$bug->id", '', false, $bug->project), $bug->title);?> + createLink('bug', 'view', "bugID=$bug->id"), $bug->title);?> openedBy);?> resolvedBy);?> bug->resolutionList, $bug->resolution);?> diff --git a/module/user/view/execution.html.php b/module/user/view/execution.html.php index cbad243c6c..1ef21cb199 100644 --- a/module/user/view/execution.html.php +++ b/module/user/view/execution.html.php @@ -31,7 +31,7 @@ - createLink('execution', 'view', "executionID=$execution->id", '', false, $execution->project);?> + createLink('execution', 'view', "executionID=$execution->id");?> id);?> diff --git a/module/user/view/task.html.php b/module/user/view/task.html.php index 2e1c249c7a..2eb5f672d4 100644 --- a/module/user/view/task.html.php +++ b/module/user/view/task.html.php @@ -55,13 +55,13 @@ - createLink('task', 'view', "taskID=$task->id", '', false, $task->project), sprintf('%03d', $task->id));?> + createLink('task', 'view', "taskID=$task->id"), sprintf('%03d', $task->id));?> task->priList, $task->pri, $task->pri);?>'>pri == '0' ? '' : zget($lang->task->priList, $task->pri, $task->pri)?> - createLink('execution', 'browse', "executionID=$task->executionID", '', false, $task->project), $task->executionName);?> + createLink('execution', 'browse', "executionID=$task->executionID"), $task->executionName);?> team)) echo '' . $this->lang->task->multipleAB . ' ';?> parent > 0) echo '' . $this->lang->task->childrenAB . ' ';?> - createLink('task', 'view', "taskID=$task->id", '', false, $task->project), $task->name, null, "style='color: $task->color'");?> + createLink('task', 'view', "taskID=$task->id"), $task->name, null, "style='color: $task->color'");?> estimate . $lang->execution->workHourUnit;?> consumed . $lang->execution->workHourUnit;?> diff --git a/module/user/view/testcase.html.php b/module/user/view/testcase.html.php index 8aa687ab1d..d42fe144c7 100755 --- a/module/user/view/testcase.html.php +++ b/module/user/view/testcase.html.php @@ -49,9 +49,9 @@ case : $case->id?> - createLink('testcase', 'view', "testcaseID=$caseID&version=$case->version", '', false, $case->project), sprintf('%03d', $caseID));?> + createLink('testcase', 'view', "testcaseID=$caseID&version=$case->version"), sprintf('%03d', $caseID));?> testcase->priList, $case->pri, $case->pri)?>'>testcase->priList, $case->pri, $case->pri)?> - createLink('testcase', 'view', "testcaseID=$caseID&version=$case->version", '', false, $case->project), $case->title);?> + createLink('testcase', 'view', "testcaseID=$caseID&version=$case->version"), $case->title);?> testcase->typeList[$case->type];?> openedBy);?> lastRunner);?> diff --git a/module/user/view/testtask.html.php b/module/user/view/testtask.html.php index d81b0e4705..c8072ba532 100755 --- a/module/user/view/testtask.html.php +++ b/module/user/view/testtask.html.php @@ -39,10 +39,10 @@ - createLink('testtask', 'view', "taskID=$task->id", '', false, $task->project), sprintf('%03d', $task->id));?> - createLink('testtask', 'view', "taskID=$task->id", '', false, $task->project), $task->name);?> + createLink('testtask', 'view', "taskID=$task->id"), sprintf('%03d', $task->id));?> + createLink('testtask', 'view', "taskID=$task->id"), $task->name);?> executionName?> - build == 'trunk' ? print($lang->trunk) : print(html::a($this->createLink('build', 'view', "buildID=$task->build", '', false, $task->project), $task->buildName));?> + build == 'trunk' ? print($lang->trunk) : print(html::a($this->createLink('build', 'view', "buildID=$task->build"), $task->buildName));?> begin?> end?> processStatus('testtask', $task);?>