diff --git a/module/bug/js/common.js b/module/bug/js/common.js index a32cc168da..0406661ea4 100644 --- a/module/bug/js/common.js +++ b/module/bug/js/common.js @@ -17,7 +17,8 @@ $(function() { $("#story").chosen({no_results_text:noResultsMatch}); $("#task").chosen({no_results_text:noResultsMatch}); - $("#mailto").autocomplete(userList, { multiple: true, mustMatch: true}); + $("#mailto").chosen({no_results_text:noResultsMatch}); + $(".chzn-container-multi .chzn-choices li.search-field input").attr('value', mailto); } }); diff --git a/module/bug/lang/en.php b/module/bug/lang/en.php index 09506b40eb..5ba3ad9eb3 100644 --- a/module/bug/lang/en.php +++ b/module/bug/lang/en.php @@ -358,5 +358,7 @@ $lang->bug->action->tostory = array('main' => '$date, To story by $acto $lang->bug->action->totask = array('main' => '$date, To task by $actor, ID is $extra.'); $lang->bug->placeholder = new stdclass(); -$lang->bug->placeholder->mailto = 'you can input the user account to select users to mail to.'; $lang->bug->placeholder->chooseBuilds = 'Choose builds...'; + +$lang->bug->chosen = new stdClass(); +$lang->bug->chosen->mailto = 'Select users to mail...'; diff --git a/module/bug/lang/zh-cn.php b/module/bug/lang/zh-cn.php index d8055a9828..af67720f5e 100644 --- a/module/bug/lang/zh-cn.php +++ b/module/bug/lang/zh-cn.php @@ -358,5 +358,7 @@ $lang->bug->action->tostory = array('main' => '$date, 由 $actorbug->action->totask = array('main' => '$date, 由 $actor 导入为任务,编号为 $extra。'); $lang->bug->placeholder = new stdclass(); -$lang->bug->placeholder->mailto = '输入用户名自动选择'; $lang->bug->placeholder->chooseBuilds = '选择相关版本...'; + +$lang->bug->chosen = new stdClass(); +$lang->bug->chosen->mailto = '输入用户名自动选择...'; diff --git a/module/bug/model.php b/module/bug/model.php index 992c97c30b..85738aa33f 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -51,6 +51,7 @@ class bugModel extends model ->specialChars('title,keyword') ->cleanInt('product, module, severity') ->join('openedBuild', ',') + ->join('mailto', ',') ->remove('files, labels') ->get(); $this->dao->insert(TABLE_BUG)->data($bug)->autoCheck()->batchCheck($this->config->bug->create->requiredFields, 'notempty')->exec(); @@ -208,6 +209,7 @@ class bugModel extends model ->add('lastEditedBy', $this->app->user->account) ->add('lastEditedDate', $now) ->join('openedBuild', ',') + ->join('mailto', ',') ->setIF($this->post->assignedTo != $oldBug->assignedTo, 'assignedDate', $now) ->setIF($this->post->resolvedBy != '' and $this->post->resolvedDate == '', 'resolvedDate', $now) ->setIF($this->post->resolution != '' and $this->post->resolvedDate == '', 'resolvedDate', $now) @@ -332,6 +334,7 @@ class bugModel extends model ->setDefault('lastEditedDate', $now) ->setDefault('assignedDate', $now) ->remove('comment') + ->join('mailto', ',') ->get(); $this->dao->update(TABLE_BUG) @@ -358,6 +361,7 @@ class bugModel extends model ->setDefault('lastEditedBy', $this->app->user->account) ->setDefault('lastEditedDate', $now) ->remove('comment') + ->join('mailto', ',') ->get(); $this->dao->update(TABLE_BUG)->data($bug)->where('id')->eq($bugID)->exec(); diff --git a/module/bug/view/assignto.html.php b/module/bug/view/assignto.html.php index 297b486885..c7bd08f39f 100644 --- a/module/bug/view/assignto.html.php +++ b/module/bug/view/assignto.html.php @@ -13,10 +13,10 @@ bug->placeholder); -js::set('userList', array_keys($users)); js::set('page', 'assignedto'); +js::set('mailto', $lang->bug->chosen->mailto); ?>
@@ -27,7 +27,7 @@ js::set('page', 'assignedto'); - + diff --git a/module/bug/view/confirmbug.html.php b/module/bug/view/confirmbug.html.php index dd46c2ba65..2af3175df6 100755 --- a/module/bug/view/confirmbug.html.php +++ b/module/bug/view/confirmbug.html.php @@ -13,12 +13,11 @@ bug->placeholder); -js::set('userList', array_keys($users)); js::set('page', 'confirmbug'); +js::set('mailto', $lang->bug->chosen->mailto); ?> -
bug->mailto;?>mailto, 'class="text-1"');?>mailto), 'class="text-1" multiple');?>
comment;?>
@@ -28,7 +27,7 @@ js::set('page', 'confirmbug'); - + diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index 8e3dce804a..33895507c3 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -13,12 +13,12 @@ bug->placeholder); -js::set('userList', array_keys($users)); js::set('page', 'create'); +js::set('mailto', $lang->bug->chosen->mailto); ?> @@ -85,8 +85,8 @@ js::set('page', 'create'); diff --git a/module/bug/view/edit.html.php b/module/bug/view/edit.html.php index 488508221b..b996186492 100644 --- a/module/bug/view/edit.html.php +++ b/module/bug/view/edit.html.php @@ -13,7 +13,7 @@ story); js::set('oldTaskID' , $bug->task); js::set('oldOpenedBuild' , $bug->openedBuild); js::set('oldResolvedBuild' , $bug->resolvedBuild); -js::set('userList' , array_keys($users)); +js::set('mailto' , $lang->bug->chosen->mailto); ?> @@ -119,6 +119,10 @@ js::set('userList' , array_keys($users)); + + + +
title;?>
bug->mailto;?>mailto, 'class="text-1"');?>mailto), 'class="text-1" multiple');?>
comment;?>bug->lblMailto;?>
bug->keywords;?> keywords, 'class="text-3"');?>
bug->mailto;?>mailto), 'class="text-3" multiple');?>
@@ -185,10 +189,6 @@ js::set('userList' , array_keys($users));
bug->legendMisc;?> - - - - diff --git a/module/story/lang/en.php b/module/story/lang/en.php index 05ecd81f06..d6c422e334 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -265,4 +265,7 @@ $lang->story->report->storysPerChange->graph->xAxisName = 'Change'; $lang->story->placeholder = new stdclass(); $lang->story->placeholder->estimate = 'Estimate the story point.'; -$lang->story->placeholder->mailto = 'Mail to'; + +$lang->story->chosen = new stdClass(); +$lang->story->chosen->reviewedBy = 'Choose users who review...'; +$lang->story->chosen->mailto = 'Choose users to mail...'; diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 6d7b51a68c..4bb2360781 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -265,4 +265,7 @@ $lang->story->report->storysPerChange->graph->xAxisName = '变更次数'; $lang->story->placeholder = new stdclass(); $lang->story->placeholder->estimate = "完成该需求的工作量"; -$lang->story->placeholder->mailto = '输入用户名自动完成'; + +$lang->story->chosen = new stdClass(); +$lang->story->chosen->reviewedBy = '选择评审人...'; +$lang->story->chosen->mailto = '输入用户名自动完成...'; diff --git a/module/story/model.php b/module/story/model.php index a73f52a634..fa7cbe9aec 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -119,6 +119,7 @@ class storyModel extends model ->setIF($projectID > 0, 'stage', 'projected') ->setIF($bugID > 0, 'fromBug', $bugID) ->remove('files,labels,spec,verify,needNotReview,newStory') + ->join('mailto', ',') ->get(); $this->dao->insert(TABLE_STORY)->data($story)->autoCheck()->batchCheck($this->config->story->create->requiredFields, 'notempty')->exec(); @@ -333,6 +334,8 @@ class storyModel extends model ->setIF($this->post->closedBy != false or $this->post->closedReason != false, 'status', 'closed') ->setIF($this->post->closedReason != false and $this->post->closedBy == false, 'closedBy', $this->app->user->account) ->remove('files,labels,comment') + ->join('reviewedBy', ',') + ->join('mailto', ',') ->get(); $this->dao->update(TABLE_STORY) @@ -459,7 +462,9 @@ class storyModel extends model ->removeIF($this->post->result != 'reject', 'closedReason, duplicateStory, childStories') ->removeIF($this->post->result == 'reject' and $this->post->closedReason != 'duplicate', 'duplicateStory') ->removeIF($this->post->result == 'reject' and $this->post->closedReason != 'subdivided', 'childStories') + ->join('reviewedBy', ',') ->get(); + $this->dao->update(TABLE_STORY)->data($story) ->autoCheck() ->batchCheck($this->config->story->review->requiredFields, 'notempty') diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index 88496a58ab..282833f892 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -60,8 +60,8 @@ diff --git a/module/story/view/edit.html.php b/module/story/view/edit.html.php index 4d038df099..db22fc6e69 100644 --- a/module/story/view/edit.html.php +++ b/module/story/view/edit.html.php @@ -84,6 +84,10 @@ + + + +
bug->mailto;?>mailto, 'class="text-3"');?>
bug->linkBug;?> linkBug, 'class="text-3"');?>story->mailto;?>
story->keywords;?> keywords, 'class=text-1');?>
story->mailto;?>mailto), "class='select-1' multiple");?>
@@ -100,7 +104,7 @@ reviewedBy):?> story->reviewedBy;?> - reviewedBy, 'class="area-1"');?> + reviewedBy), 'class="area-1" multiple');?> status == 'closed'):?> @@ -131,11 +135,7 @@ story->childStories;?> childStories, "class='text-1'");?> - - story->mailto;?> - mailto, "class='area-1'");?> - - +
diff --git a/module/story/view/header.html.php b/module/story/view/header.html.php index 64fce3444f..57a8322bb7 100644 --- a/module/story/view/header.html.php +++ b/module/story/view/header.html.php @@ -1,7 +1,8 @@ - + - +story->chosen->reviewedBy);?> +story->chosen->mailto);?> diff --git a/module/story/view/review.html.php b/module/story/view/review.html.php index 0cafb1cfd2..e910380e00 100644 --- a/module/story/view/review.html.php +++ b/module/story/view/review.html.php @@ -49,7 +49,7 @@ var assignedTo = 'lastEditedBy ? print($story->lastEditedBy) : pri story->reviewedBy;?> - user->account . ', ', 'class=text-1');?> + user->account, "class='text-1' multiple");?> story->comment;?> diff --git a/module/task/js/create.js b/module/task/js/create.js index f0fe84f665..2646f4cd1e 100644 --- a/module/task/js/create.js +++ b/module/task/js/create.js @@ -85,5 +85,6 @@ $(document).ready(function() { setPreview(); $("#story").chosen({no_results_text: noResultsMatch}); - $("#mailto").autocomplete(userList, { multiple: true, mustMatch: true}); + $("#mailto").chosen({no_results_text: noResultsMatch}); + $("#mailto_chzn .chzn-choices li.search-field input").attr('value', mailto); }); diff --git a/module/task/js/edit.js b/module/task/js/edit.js index 141aac0ca2..931ccf6656 100644 --- a/module/task/js/edit.js +++ b/module/task/js/edit.js @@ -1,7 +1,8 @@ $(function() { $("#story").chosen({no_results_text: noResultsMatch}); - $("#mailto").autocomplete(userList, { multiple: true, mustMatch: true}); + $("#mailto").chosen({no_results_text: noResultsMatch}); + $("#mailto_chzn .chzn-choices li.search-field input").attr('value', mailto); $('.iframe').colorbox({width:900, height:500, iframe:true, transition:'none', onCleanup:function(){parent.location.href=parent.location.href;}}); }) diff --git a/module/task/lang/en.php b/module/task/lang/en.php index b875a24e2f..69f62abec4 100644 --- a/module/task/lang/en.php +++ b/module/task/lang/en.php @@ -233,4 +233,6 @@ $lang->task->report->finishedTasksPerDay->graph->rotateNames = '1'; $lang->task->placeholder = new stdclass(); $lang->task->placeholder->estimate = 'The estimated time for this task'; -$lang->task->placeholder->mailto = 'Mail to'; + +$lang->task->chosen = new stdclass(); +$lang->task->chosen->mailto = 'Choose users to mail...'; diff --git a/module/task/lang/zh-cn.php b/module/task/lang/zh-cn.php index c9e66a9198..3fc1d06340 100644 --- a/module/task/lang/zh-cn.php +++ b/module/task/lang/zh-cn.php @@ -233,4 +233,6 @@ $lang->task->report->finishedTasksPerDay->graph->rotateNames = '1'; $lang->task->placeholder = new stdclass(); $lang->task->placeholder->estimate = '对该任务最初的预计'; -$lang->task->placeholder->mailto = '输入用户名进行选择'; + +$lang->task->chosen = new stdclass(); +$lang->task->chosen->mailto = '输入用户名进行选择...'; diff --git a/module/task/model.php b/module/task/model.php index f61cc1a59b..fc538ee2b4 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -41,6 +41,7 @@ class taskModel extends model ->setDefault('openedBy', $this->app->user->account) ->setDefault('openedDate', helper::now()) ->remove('after,files,labels') + ->join('mailto', ',') ->get(); if($assignedTo) $task->assignedDate = helper::now(); @@ -171,6 +172,7 @@ class taskModel extends model ->add('lastEditedBy', $this->app->user->account) ->add('lastEditedDate', $now) ->remove('comment,files,labels') + ->join('mailto', ',') ->get(); $task->statusCustom = strpos(self::CUSTOM_STATUS_ORDER, $task->status) + 1; diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php index b199b08b0a..efb79ab61d 100644 --- a/module/task/view/create.html.php +++ b/module/task/view/create.html.php @@ -13,11 +13,10 @@ - -task->placeholder);?> - +task->placeholder);?> +task->chosen->mailto);?> diff --git a/module/task/view/edit.html.php b/module/task/view/edit.html.php index d665ae1519..4aef81e032 100644 --- a/module/task/view/edit.html.php +++ b/module/task/view/edit.html.php @@ -13,12 +13,11 @@ - -story); ?> task->confirmChangeProject); ?> +task->chosen->mailto);?>
TASK #id . $lang->colon . html::input('name', $task->name, 'class="text-1"');?>
@@ -82,7 +81,7 @@
- +
@@ -84,8 +83,8 @@
task->mailto;?> mailto, 'class="text-1"'); - if($contactLists) echo html::select('', $contactLists, '', "onchange=\"setMailto('mailto', this.value)\""); + echo html::select('mailto[]', $users, str_replace(' ', '', $task->mailto), 'class="text-1" multiple'); + if($contactLists) echo html::select('', $contactLists, '', "class='f-right' onchange=\"setMailto('mailto', this.value)\""); ?>
task->mailto;?>mailto, 'class="text-1"');?>mailto), 'class="text-1" multiple');?>
diff --git a/module/user/control.php b/module/user/control.php index 54b05b7fc5..400324b9de 100644 --- a/module/user/control.php +++ b/module/user/control.php @@ -901,12 +901,19 @@ class user extends control */ public function ajaxGetContactUsers($contactListID) { - $list = $this->user->getContactListByID($contactListID); - if($list) + if(!$contactListID) { - $users = str_replace(',', ', ', $list->userList) . ', '; - echo $users; + $users = $this->user->getPairs('nodeleted,devfirst'); + echo html::select('mailto[]', $users, '', "class='text-1' multiple"); + } + else + { + $list = $this->user->getContactListByID($contactListID); + if($list) + { + $users = explode(',', $list->userList); + echo html::select('mailto[]', $users, '', "class='text-1' multiple"); + } } - die(); } } diff --git a/www/js/my.full.js b/www/js/my.full.js index fbdd0a4cf4..08cdd2145c 100644 --- a/www/js/my.full.js +++ b/www/js/my.full.js @@ -483,11 +483,12 @@ function setExport() */ function setMailto(mailto, contactListID) { - if(!contactListID) return; link = createLink('user', 'ajaxGetContactUsers', 'listID=' + contactListID); $.get(link, function(users) { - $('#' + mailto).val(users); + $('#' + mailto).replaceWith(users); + $('#' + mailto + '_chzn').remove(); + $('#' + mailto).chosen({no_results_text: noResultsMatch}); }); }