Merge branch 'sprint/180_mayue_bug18147,18149' into 'master'
* Fix bug #18147,18149. See merge request easycorp/zentaopms!1290
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -194,7 +194,7 @@
|
||||
<td>
|
||||
<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>
|
||||
|
||||
@@ -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>';
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
<td>
|
||||
<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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
+13
-5
@@ -1173,25 +1173,33 @@ class user extends control
|
||||
{
|
||||
$list = $contactListID ? $this->user->getContactListByID($contactListID) : '';
|
||||
|
||||
$attr = $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}'"));
|
||||
|
||||
return print(html::select($dropdownName . "[]", $users, $list->userList, "class='form-control chosen' multiple data-placeholder='{$this->lang->chooseUsersToMail}'"));
|
||||
if(!$contactListID)
|
||||
{
|
||||
return print(html::select($dropdownName . "[]", $users, '', "class='form-control chosen' multiple $attr"));
|
||||
}
|
||||
else
|
||||
{
|
||||
return print(html::select($dropdownName . "[]", $users, $list->userList, "class='form-control chosen' multiple $attr"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user