From c4117611423e9149d5a56d05116c65bb874b512a Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Fri, 7 Aug 2020 16:59:44 +0800 Subject: [PATCH 1/8] * Finish task #7617,7615. --- module/task/control.php | 12 ++++++------ module/task/view/create.html.php | 6 +++++- module/task/view/edit.html.php | 3 ++- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/module/task/control.php b/module/task/control.php index d76f89ebac..c10819bf31 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -43,7 +43,7 @@ class task extends control * @access public * @return void */ - public function create($projectID = 0, $storyID = '', $moduleID = 0, $taskID = 0, $todoID = 0) + public function create($projectID = 0, $storyID = 0, $moduleID = 0, $taskID = 0, $todoID = 0) { $this->project->getLimitedProject(); $limitedProjects = !empty($_SESSION['limitedProjects']) ? $_SESSION['limitedProjects'] : ''; @@ -460,7 +460,7 @@ class task extends control /* Get edited tasks. */ $tasks = $this->dao->select('*')->from(TABLE_TASK)->where('id')->in($taskIDList)->fetchAll('id'); - $teams = $this->dao->select('*')->from(TABLE_TEAM)->where('root')->in($taskIDList)->andWhere('type')->eq('task')->fetchAll('root'); + $teams = $this->dao->select('*')->from(TABLE_TEAM)->where('root')->in($taskIDList)->andWhere('type')->eq('task')->fetchGroup('root', 'account'); /* Judge whether the editedTasks is too large and set session. */ $countInputVars = count($tasks) * (count(explode(',', $this->config->task->custom->batchEditFields)) + 3); @@ -572,19 +572,19 @@ class task extends control { if(!empty($_POST)) { + $this->loadModel('action'); $taskIDList = $this->post->taskIDList; $taskIDList = array_unique($taskIDList); unset($_POST['taskIDList']); if(!is_array($taskIDList)) die(js::locate($this->createLink('project', 'task', "projectID=$project"), 'parent')); $taskIDList = array_unique($taskIDList); - $muletipleTasks = $this->dao->select('root')->from(TABLE_TEAM)->where('type')->eq('task')->andWhere('root')->in($taskIDList)->fetchPairs(); + $muletipleTasks = $this->dao->select('root , account')->from(TABLE_TEAM)->where('type')->eq('task')->andWhere('root')->in($taskIDList)->fetchGroup('root', 'account'); $tasks = $this->task->getByList($taskIDList); foreach($tasks as $taskID => $task) { - $this->loadModel('action'); - if(in_array($taskID, $muletipleTasks) and $task->assignedTo != $this->app->user->account) continue; - + if(isset($muletipleTasks[$taskID]) and $task->assignedTo != $this->app->user->account) continue; + if(isset($muletipleTasks[$taskID]) and !isset($muletipleTasks[$taskID][$this->post->assignedTo])) continue; $changes = $this->task->assign($taskID); if(dao::isError()) die(js::error(dao::getError())); $actionID = $this->action->create('task', $taskID, 'Assigned', $this->post->comment, $this->post->assignedTo); diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php index fede9e1420..c9665e8bb3 100644 --- a/module/task/view/create.html.php +++ b/module/task/view/create.html.php @@ -163,7 +163,11 @@ } $priList = $lang->task->priList; if(end($priList)) unset($priList[0]); - if(!isset($priList[$task->pri])) $task->pri = reset($priList); + if(!isset($priList[$task->pri])) + { + reset($priList); + $task->pri = key($priList); + } ?> pri, "class='form-control'");?> diff --git a/module/task/view/edit.html.php b/module/task/view/edit.html.php index b01134b9fc..bd1c2240b4 100644 --- a/module/task/view/edit.html.php +++ b/module/task/view/edit.html.php @@ -122,7 +122,8 @@ task->assignedTo;?> team) and $task->assignedTo != $this->app->user->account) ? "disabled='disabled'" :'';?> - assignedTo, "class='form-control chosen' {$disableAssignedTo}");?> + team) ? array_intersect_key($members, $task->team) : $members;?> + assignedTo, "class='form-control chosen' {$disableAssignedTo}");?> ' id='teamTr'> task->team;?> From 7de5503bbea0431a46a6c309f1f02990d7eb76a7 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Fri, 7 Aug 2020 17:25:54 +0800 Subject: [PATCH 2/8] * add new version and upgrade. --- db/update12.4.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 db/update12.4.sql diff --git a/db/update12.4.sql b/db/update12.4.sql new file mode 100644 index 0000000000..86a1e93519 --- /dev/null +++ b/db/update12.4.sql @@ -0,0 +1 @@ +update zt_action set `project` = `extra` where action = 'unlinkedfromproject' and `project` = 0; From 99e92ac05fd6b85d4b2211331a77d50090c2a6bd Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Fri, 7 Aug 2020 17:27:54 +0800 Subject: [PATCH 3/8] * Finish task #7611. --- module/repo/control.php | 2 +- module/repo/view/ajaxsidecommits.html.php | 1 - module/repo/view/log.html.php | 5 +---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/module/repo/control.php b/module/repo/control.php index 16bc29735d..3fadef9f41 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -548,7 +548,7 @@ class repo extends control if(isset($pathInfo["extension"])) $suffix = strtolower($pathInfo["extension"]); $arrange = $this->cookie->arrange ? $this->cookie->arrange : 'inline'; - if(!empty($_POST)) + if($this->server->request_method) { $oldRevision = isset($this->post->revision[1]) ?$this->post->revision[1] : ''; $newRevision = isset($this->post->revision[0]) ?$this->post->revision[0] : ''; diff --git a/module/repo/view/ajaxsidecommits.html.php b/module/repo/view/ajaxsidecommits.html.php index 1f8e9453dc..5157efda55 100644 --- a/module/repo/view/ajaxsidecommits.html.php +++ b/module/repo/view/ajaxsidecommits.html.php @@ -50,7 +50,6 @@ if(isset($entry)) $pathInfo .= '&type=file';