From 4acf8e3990028a88f607fc4d05b7ff7a6ba3ed56 Mon Sep 17 00:00:00 2001 From: z Date: Fri, 7 Aug 2020 15:14:20 +0800 Subject: [PATCH] * finish task #7603,7603. --- module/bug/js/common.js | 7 ++++++- module/product/control.php | 2 +- module/task/control.php | 4 ++-- module/task/view/create.html.php | 2 +- module/user/control.php | 5 ++++- module/user/model.php | 2 ++ www/js/my.full.js | 2 +- 7 files changed, 17 insertions(+), 7 deletions(-) diff --git a/module/bug/js/common.js b/module/bug/js/common.js index 3e95235c75..90ddf72002 100644 --- a/module/bug/js/common.js +++ b/module/bug/js/common.js @@ -247,11 +247,16 @@ function loadProductStories(productID) */ function loadProductProjects(productID) { + required = $('#project_chosen').hasClass('required'); branch = $('#branch').val(); if(typeof(branch) == 'undefined') branch = 0; link = createLink('product', 'ajaxGetProjects', 'productID=' + productID + '&projectID=' + oldProjectID + '&branch=' + branch); - $('#projectIdBox').load(link, function(){$(this).find('select').chosen()}); + $('#projectIdBox').load(link, function() + { + $(this).find('select').chosen(); + if(required) $(this).addClass('required'); + }); } /** diff --git a/module/product/control.php b/module/product/control.php index 16c09aad2d..241fe0a34b 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -616,7 +616,7 @@ class product extends control if($number === '') { - die(html::select('project', $projects, $projectID, 'class=form-control onchange=loadProjectRelated(this.value)')); + die(html::select('project', $projects, $projectID, "class='form-control' onchange='loadProjectRelated(this.value)'")); } else { diff --git a/module/task/control.php b/module/task/control.php index d76f89ebac..f3520285a9 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'] : ''; @@ -580,9 +580,9 @@ class task extends control $muletipleTasks = $this->dao->select('root')->from(TABLE_TEAM)->where('type')->eq('task')->andWhere('root')->in($taskIDList)->fetchPairs(); $tasks = $this->task->getByList($taskIDList); + $this->loadModel('action'); foreach($tasks as $taskID => $task) { - $this->loadModel('action'); if(in_array($taskID, $muletipleTasks) and $task->assignedTo != $this->app->user->account) continue; $changes = $this->task->assign($taskID); diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php index fede9e1420..426bbdbc8f 100644 --- a/module/task/view/create.html.php +++ b/module/task/view/create.html.php @@ -78,7 +78,7 @@ task->noticeLinkStory, html::a($this->createLink('project', 'linkStory', "projectID=$project->id"), $lang->project->linkStory, '_blank', 'class="text-primary"'), html::a("javascript:loadStories($project->id)", $lang->refresh, '', 'class="text-primary"'));?>
- story => $stories[$task->story]), $task->story, "class='form-control chosen' onchange='setStoryRelated();'");?> + story, "class='form-control chosen' onchange='setStoryRelated();'");?> preview;?>
diff --git a/module/user/control.php b/module/user/control.php index 52b143739e..6b252267e9 100644 --- a/module/user/control.php +++ b/module/user/control.php @@ -1024,10 +1024,13 @@ class user extends control */ public function ajaxGetContactUsers($contactListID) { - $list = $contactListID ? $this->user->getContactListByID($contactListID) : ''; + $list = $contactListID ? $this->user->getContactListByID($contactListID) : ''; + $users = $this->user->getPairs('devfirst|nodeleted', $list ? $list->userList : '', $this->config->maxCount); if(isset($this->config->user->moreLink)) $this->config->moreLinks['mailto[]'] = $this->config->user->moreLink; + if(!$contactListID) return print(html::select('mailto[]', $users, '', "class='form-control chosen' multiple data-placeholder='{$this->lang->chooseUsersToMail}'")); + return print(html::select('mailto[]', $users, $list->userList, "class='form-control chosen' multiple data-placeholder='{$this->lang->chooseUsersToMail}'")); } diff --git a/module/user/model.php b/module/user/model.php index 2fd6973bfc..a840d90217 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -66,6 +66,7 @@ class userModel extends model * * @param string $params noletter|noempty|nodeleted|noclosed|withguest|pofirst|devfirst|qafirst|pmfirst|realname, can be sets of theme * @param string $usersToAppended account1,account2 + * @param int $maxCount * @access public * @return array */ @@ -96,6 +97,7 @@ class userModel extends model ->orderBy($orderBy) ->beginIF($maxCount)->limit($maxCount)->fi() ->fetchAll('account'); + if($maxCount and $maxCount == count($users)) { if(is_array($usersToAppended)) $usersToAppended = join(',', $usersToAppended); diff --git a/www/js/my.full.js b/www/js/my.full.js index be69ed9922..f9c19969af 100644 --- a/www/js/my.full.js +++ b/www/js/my.full.js @@ -141,7 +141,7 @@ function setMailto(mailto, contactListID) { $('#' + mailto).replaceWith(users); $('#' + mailto + '_chosen').remove(); - $('.picker').remove(); + $('.picker').remove(); if($("[data-pickertype='remote']").length == 0 && $('.picker-select').length == 0) {