* Fix bug #18147,18149.

This commit is contained in:
mayue
2022-01-06 13:38:10 +08:00
parent 0325b07527
commit fcb699c84d
11 changed files with 25 additions and 21 deletions
+1 -1
View File
@@ -230,7 +230,7 @@
<td colspan='2'>
<div class='input-group'>
<?php echo html::select('whitelist[]', $users, $whitelist, 'class="form-control chosen" multiple');?>
<?php echo $this->fetch('my', 'buildContactLists', "dropdownName='whitelist'");?>
<?php echo $this->fetch('my', 'buildContactLists', "dropdownName=whitelist");?>
</div>
</td>
</tr>
+2 -2
View File
@@ -191,10 +191,10 @@
</tr>
<tr class="<?php if($execution->acl == 'open') echo 'hidden';?>" id="whitelistBox">
<th><?php echo $lang->whitelist;?></th>
<td>
<td colspan='1'>
<div class='input-group'>
<?php echo html::select('whitelist[]', $users, $execution->whitelist, 'class="form-control chosen" multiple');?>
<?php echo $this->fetch('my', 'buildContactLists', "dropdownName='whitelist'");?>
<?php echo $this->fetch('my', 'buildContactLists', "dropdownName=whitelist");?>
</div>
</td>
</tr>
+1 -1
View File
@@ -21,7 +21,7 @@ else
echo '<a title="' . $lang->user->contacts->manage . '" href="' . $this->createLink('my', 'managecontacts', "listID=0&mode=new", '', true) . "\" target='_blank' data-icon='cog' data-title='{$lang->user->contacts->manage}' class='btn btn-icon iframe'><i class='icon icon-cog'></i></a>";
echo '</span>';
echo '<span class="input-group-btn">';
echo '<button type="button" title="' . $lang->refresh . '" class="btn btn-icon" onclick="ajaxGetContacts(this)"><i class="icon icon-refresh"></i></button>';
echo '<button type="button" title="' . $lang->refresh . '" class="btn btn-icon"' . "onclick=\"ajaxGetContacts(this, '$dropdownName')\"" . '><i class="icon icon-refresh"></i></button>';
echo '</span>';
}
?>
+2 -2
View File
@@ -104,10 +104,10 @@
</tr>
<tr id="whitelistBox">
<th><?php echo $lang->whitelist;?></th>
<td colspan='2'>
<td colspan='1'>
<div class='input-group'>
<?php echo html::select('whitelist[]', $users, '', 'class="form-control chosen" multiple');?>
<?php echo $this->fetch('my', 'buildContactLists', "dropdownName='whitelist'");?>
<?php echo $this->fetch('my', 'buildContactLists', "dropdownName=whitelist");?>
</div>
</td>
</tr>
+2 -2
View File
@@ -87,10 +87,10 @@
</tr>
<tr class="<?php if($product->acl == 'open') echo 'hidden';?>" id="whitelistBox">
<th><?php echo $lang->whitelist;?></th>
<td>
<td colspan='1'>
<div class='input-group'>
<?php echo html::select('whitelist[]', $users, $product->whitelist, 'class="form-control chosen" multiple');?>
<?php echo $this->fetch('my', 'buildContactLists', "dropdownName='whitelist'");?>
<?php echo $this->fetch('my', 'buildContactLists', "dropdownName=whitelist");?>
</div>
</td>
</tr>
+1 -1
View File
@@ -117,7 +117,7 @@
<td colspan='2'>
<div class='input-group'>
<?php echo html::select('whitelist[]', $users, '', 'class="form-control chosen" multiple');?>
<?php echo $this->fetch('my', 'buildContactLists', "dropdownName='whitelist'");?>
<?php echo $this->fetch('my', 'buildContactLists', "dropdownName=whitelist");?>
</div>
</td>
</tr>
+2 -2
View File
@@ -99,10 +99,10 @@
</tr>
<tr class="<?php if($program->acl == 'open') echo 'hidden';?>" id="whitelistBox">
<th><?php echo $lang->whitelist;?></th>
<td>
<td colspan='2'>
<div class='input-group'>
<?php echo html::select('whitelist[]', $users, $program->whitelist, 'class="form-control chosen" multiple');?>
<?php echo $this->fetch('my', 'buildContactLists', "dropdownName='whitelist'");?>
<?php echo $this->fetch('my', 'buildContactLists', "dropdownName=whitelist");?>
</div>
</td>
</tr>
+1 -1
View File
@@ -162,7 +162,7 @@
<td colspan='2'>
<div class='input-group'>
<?php echo html::select('whitelist[]', $users, '', 'class="form-control chosen" multiple');?>
<?php echo $this->fetch('my', 'buildContactLists', "dropdownName='whitelist'");?>
<?php echo $this->fetch('my', 'buildContactLists', "dropdownName=whitelist");?>
</div>
</td>
</tr>
+2 -2
View File
@@ -176,10 +176,10 @@
</tr>
<tr class="<?php if($project->acl == 'open') echo 'hidden';?>" id="whitelistBox">
<th><?php echo $lang->whitelist;?></th>
<td>
<td colspan='2'>
<div class='input-group'>
<?php echo html::select('whitelist[]', $users, $project->whitelist, 'class="form-control chosen" multiple');?>
<?php echo $this->fetch('my', 'buildContactLists', "dropdownName='whitelist'");?>
<?php echo $this->fetch('my', 'buildContactLists', "dropdownName=whitelist");?>
</div>
</td>
</tr>
+7 -4
View File
@@ -1173,25 +1173,28 @@ class user extends control
{
$list = $contactListID ? $this->user->getContactListByID($contactListID) : '';
$class = $dropdownName == 'mailto' ? "data-placeholder='{$this->lang->chooseUsersToMail}'" : '';
$users = $this->user->getPairs('devfirst|nodeleted', $list ? $list->userList : '', $this->config->maxCount);
if(isset($this->config->user->moreLink)) $this->config->moreLinks[$dropdownName . "[]"] = $this->config->user->moreLink;
if(!$contactListID) return print(html::select($dropdownName . "[]", $users, '', "class='form-control chosen' multiple data-placeholder='{$this->lang->chooseUsersToMail}'"));
if(!$contactListID) return print(html::select($dropdownName . "[]", $users, '', "class='form-control chosen' multiple $class"));
return print(html::select($dropdownName . "[]", $users, $list->userList, "class='form-control chosen' multiple data-placeholder='{$this->lang->chooseUsersToMail}'"));
return print(html::select($dropdownName . "[]", $users, $list->userList, "class='form-control chosen' multiple $class"));
}
/**
* Ajax get contact list.
*
* @param $dropdownName mailto|whitelist
* @access public
* @return string
*/
public function ajaxGetContactList()
public function ajaxGetContactList($dropdownName = 'mailto')
{
$contactList = $this->user->getContactLists($this->app->user->account, 'withnote');
if(empty($contactList)) return false;
return print(html::select('', $contactList, '', "class='form-control' onchange=\"setMailto('mailto', this.value)\""));
return print(html::select('', $contactList, '', "class='form-control' onchange=\"setMailto('$dropdownName', this.value)\""));
}
/**
+4 -3
View File
@@ -162,13 +162,14 @@ function setMailto(mailto, contactListID)
/**
* Ajax get contacts.
*
* @param obj $obj
* @param object $obj
* @param string $dropdownName mailto|whitelist
* @access public
* @return void
*/
function ajaxGetContacts(obj)
function ajaxGetContacts(obj, dropdownName = 'mailto')
{
link = createLink('user', 'ajaxGetContactList');
link = createLink('user', 'ajaxGetContactList', 'dropdownName=' + dropdownName);
$.get(link, function(contacts)
{
if(!contacts) return false;