diff --git a/module/user/control.php b/module/user/control.php index 25a5cae3ef..d5147d4803 100644 --- a/module/user/control.php +++ b/module/user/control.php @@ -1185,19 +1185,21 @@ class user extends control * @param int $contactListID * @param string $dropdownName mailto|whitelist * @param string $oldUsers + * @param string $extra * @access public * @return string */ - public function ajaxGetContactUsers($contactListID, $dropdownName = 'mailto', $oldUsers = '') + public function ajaxGetContactUsers($contactListID, $dropdownName = 'mailto', $oldUsers = '', $extra = '') { $list = $contactListID ? $this->user->getContactListByID($contactListID) : ''; - $attr = $dropdownName == 'mailto' ? "data-placeholder='{$this->lang->chooseUsersToMail}'" : ''; $users = $this->user->getPairs('devfirst|nodeleted|noclosed', $list ? $list->userList : '', $this->config->maxCount); + if(!empty($extra) && $extra == 'flow') $users = array_merge(array('deptManager' => $this->lang->workflowdatasource->options['deptManager']), $users); if(isset($this->config->user->moreLink)) $this->config->moreLinks[$dropdownName . "[]"] = $this->config->user->moreLink; $defaultUsers = empty($contactListID) ? '' : $list->userList . ',' . trim($oldUsers); + if($extra == 'flow' && empty($defaultUsers)) $defaultUsers = trim($oldUsers); return print(html::select($dropdownName . "[]", $users, $defaultUsers, "class='form-control chosen' multiple $attr")); }