From 463ff11e9dffaf21958879cf7d794fe7c8494740 Mon Sep 17 00:00:00 2001 From: zenggang Date: Thu, 19 May 2022 07:03:55 +0000 Subject: [PATCH] * Add project name --- module/execution/css/importtask.css | 2 +- module/execution/model.php | 20 ++++++++------------ module/execution/view/importtask.html.php | 2 +- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/module/execution/css/importtask.css b/module/execution/css/importtask.css index 942bf6c0f9..f05cfeace0 100644 --- a/module/execution/css/importtask.css +++ b/module/execution/css/importtask.css @@ -1,2 +1,2 @@ #fromproject_chosen .chosen-single {width: 220px;} -.c-name {width: 150px;} +.c-name {width: 200px;} diff --git a/module/execution/model.php b/module/execution/model.php index 689ec1dcfb..108f02118b 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1929,18 +1929,14 @@ class executionModel extends model */ public function getToImport($executionIds, $type) { - $executions = $this->dao->select('*')->from(TABLE_EXECUTION) - ->where('id')->in($executionIds) - ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->sprints)->fi() - ->andWhere('type')->eq($type) - ->andWhere('deleted')->eq(0) - ->orderBy('id desc') - ->fetchAll('id'); - - $pairs = array(); - $now = date('Y-m-d'); - foreach($executions as $id => $execution) $pairs[$id] = $execution->name; - return $pairs; + return $this->dao->select('t1.id,concat_ws(" / ", t2.name, t1.name) as name')->from(TABLE_EXECUTION)->alias('t1') + ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t2.id=t1.project') + ->where('t1.id')->in($executionIds) + ->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->sprints)->fi() + ->andWhere('t1.type')->eq($type) + ->andWhere('t1.deleted')->eq(0) + ->orderBy('t1.id desc') + ->fetchPairs('id', 'name'); } /** diff --git a/module/execution/view/importtask.html.php b/module/execution/view/importtask.html.php index 5baf2ceadd..e03a6f48d7 100644 --- a/module/execution/view/importtask.html.php +++ b/module/execution/view/importtask.html.php @@ -53,7 +53,7 @@ id);?> - execution];?> + execution];?> pri == '0' ? '' : zget($lang->task->priList, $task->pri, $task->pri);?> id", $task->name)) echo $task->name;?> >assignedToRealName;?>