* Finish task #46527.
This commit is contained in:
@@ -329,7 +329,7 @@ class executionModel extends model
|
||||
->join('whitelist', ',')
|
||||
->add('type', $type)
|
||||
->stripTags($this->config->execution->editor->create['id'], $this->config->allowedTags)
|
||||
->remove('products, workDays, delta, branch, uid, plans, teams, teamMembers')
|
||||
->remove('products, workDays, delta, branch, uid, plans, teams, teamMembers, contactListMenu')
|
||||
->get();
|
||||
|
||||
/* Check the workload format and total. */
|
||||
@@ -487,7 +487,7 @@ class executionModel extends model
|
||||
->setDefault('team', $this->post->name)
|
||||
->join('whitelist', ',')
|
||||
->stripTags($this->config->execution->editor->edit['id'], $this->config->allowedTags)
|
||||
->remove('products, branch, uid, plans, syncStories')
|
||||
->remove('products, branch, uid, plans, syncStories, contactListMenu')
|
||||
->get();
|
||||
|
||||
if($this->config->systemMode == 'new' and (empty($execution->project) or $execution->project == $oldExecution->project)) $this->checkBeginAndEndDate($oldExecution->project, $execution->begin, $execution->end);
|
||||
|
||||
@@ -227,9 +227,12 @@
|
||||
</tr>
|
||||
<tr class="hidden" id="whitelistBox">
|
||||
<th><?php echo $lang->whitelist;?></th>
|
||||
<td><?php echo html::select('whitelist[]', $users, $whitelist, 'class="form-control chosen" multiple');?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<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', 'whitelist');?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='4' class='text-center form-actions'>
|
||||
|
||||
@@ -191,8 +191,12 @@
|
||||
</tr>
|
||||
<tr class="<?php if($execution->acl == 'open') echo 'hidden';?>" id="whitelistBox">
|
||||
<th><?php echo $lang->whitelist;?></th>
|
||||
<td><?php echo html::select('whitelist[]', $users, $execution->whitelist, 'class="form-control chosen" multiple');?></td>
|
||||
<td></td>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<?php echo html::select('whitelist[]', $users, $execution->whitelist, 'class="form-control chosen" multiple');?>
|
||||
<?php echo $this->fetch('my', 'buildContactLists', 'whitelist');?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan='3' class='text-center form-actions'><?php echo html::submitButton() . ' ' . html::backButton();?></td></tr>
|
||||
</table>
|
||||
|
||||
@@ -968,12 +968,14 @@ class my extends control
|
||||
/**
|
||||
* Build contact lists.
|
||||
*
|
||||
* @param dropdownName
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function buildContactLists()
|
||||
public function buildContactLists($dropdownName = 'mailto')
|
||||
{
|
||||
$this->view->contactLists = $this->user->getContactLists($this->app->user->account, 'withnote');
|
||||
$this->view->dropdownName = $dropdownName;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,14 @@
|
||||
<?php
|
||||
if($contactLists)
|
||||
{
|
||||
echo html::select('contactListMenu', $contactLists, '', "class='form-control chosen' onchange=\"setMailto('mailto', this.value)\"");
|
||||
if($dropdownName == 'mailto')
|
||||
{
|
||||
echo html::select('contactListMenu', $contactLists, '', "class='form-control chosen' onchange=\"setMailto('mailto', this.value)\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
echo html::select('contactListMenu', $contactLists, '', "class='form-control chosen' onchange=\"setMailto('whitelist', this.value)\"");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -28,7 +35,7 @@ else
|
||||
<style>
|
||||
#contactListMenu_chosen {width: 100px !important;}
|
||||
#contactListMenu + .chosen-container {min-width: 100px;}
|
||||
td > #mailto + .chosen-container .chosen-choices {border-radius: 2px 2px 0 0;}
|
||||
td > #mailto + .chosen-container + #contactListMenu + .chosen-container > .chosen-single {border-radius: 0 0 2px 2px; border-top-width: 0; padding-top: 6px;}
|
||||
td > <?php echo "#" . $dropdownName;?> + .chosen-container .chosen-choices {border-radius: 2px 2px 0 0;}
|
||||
td > <?php echo "#" . $dropdownName;?> + .chosen-container + #contactListMenu + .chosen-container > .chosen-single {border-radius: 0 0 2px 2px; border-top-width: 0; padding-top: 6px;}
|
||||
#contactListMenu + .chosen-container.chosen-container-active > .chosen-single {border-top-width: 1px !important; padding-top: 5px !important;}
|
||||
</style>
|
||||
|
||||
@@ -577,7 +577,7 @@ class productModel extends model
|
||||
->stripTags($this->config->product->editor->create['id'], $this->config->allowedTags)
|
||||
->join('whitelist', ',')
|
||||
->join('reviewer', ',')
|
||||
->remove('uid,newLine,lineName')
|
||||
->remove('uid,newLine,lineName,contactListMenu')
|
||||
->get();
|
||||
|
||||
if(!empty($_POST['lineName']))
|
||||
@@ -653,7 +653,7 @@ class productModel extends model
|
||||
->join('whitelist', ',')
|
||||
->join('reviewer', ',')
|
||||
->stripTags($this->config->product->editor->edit['id'], $this->config->allowedTags)
|
||||
->remove('uid,changeProjects')
|
||||
->remove('uid,changeProjects,contactListMenu')
|
||||
->get();
|
||||
|
||||
if($this->config->systemMode == 'new')
|
||||
|
||||
@@ -104,8 +104,12 @@
|
||||
</tr>
|
||||
<tr id="whitelistBox">
|
||||
<th><?php echo $lang->whitelist;?></th>
|
||||
<td><?php echo html::select('whitelist[]', $users, '', 'class="form-control chosen" multiple');?></td>
|
||||
<td></td>
|
||||
<td colspan='2'>
|
||||
<div class='input-group'>
|
||||
<?php echo html::select('whitelist[]', $users, '', 'class="form-control chosen" multiple');?>
|
||||
<?php echo $this->fetch('my', 'buildContactLists', 'whitelist');?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='3' class='text-center form-actions'>
|
||||
|
||||
@@ -87,8 +87,12 @@
|
||||
</tr>
|
||||
<tr class="<?php if($product->acl == 'open') echo 'hidden';?>" id="whitelistBox">
|
||||
<th><?php echo $lang->whitelist;?></th>
|
||||
<td><?php echo html::select('whitelist[]', $users, $product->whitelist, 'class="form-control chosen" multiple');?></td>
|
||||
<td></td>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<?php echo html::select('whitelist[]', $users, $product->whitelist, 'class="form-control chosen" multiple');?>
|
||||
<?php echo $this->fetch('my', 'buildContactLists', 'whitelist');?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='3' class='text-center form-actions'>
|
||||
|
||||
@@ -593,7 +593,7 @@ class programModel extends model
|
||||
->add('type', 'program')
|
||||
->join('whitelist', ',')
|
||||
->stripTags($this->config->program->editor->create['id'], $this->config->allowedTags)
|
||||
->remove('delta,future')
|
||||
->remove('delta,future,contactListMenu')
|
||||
->get();
|
||||
|
||||
if($program->parent)
|
||||
@@ -678,7 +678,7 @@ class programModel extends model
|
||||
->setIF(!isset($this->post->budgetUnit), 'budgetUnit', $oldProgram->budgetUnit)
|
||||
->join('whitelist', ',')
|
||||
->stripTags($this->config->program->editor->edit['id'], $this->config->allowedTags)
|
||||
->remove('uid,delta,future,syncPRJUnit,exchangeRate')
|
||||
->remove('uid,delta,future,syncPRJUnit,exchangeRate,contactListMenu')
|
||||
->get();
|
||||
|
||||
$program = $this->loadModel('file')->processImgURL($program, $this->config->program->editor->edit['id'], $this->post->uid);
|
||||
|
||||
@@ -114,9 +114,12 @@
|
||||
</tr>
|
||||
<tr id="whitelistBox">
|
||||
<th><?php echo $lang->whitelist;?></th>
|
||||
<td><?php echo html::select('whitelist[]', $users, '', 'class="form-control chosen" multiple');?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td colspan='2'>
|
||||
<div class='input-group'>
|
||||
<?php echo html::select('whitelist[]', $users, '', 'class="form-control chosen" multiple');?>
|
||||
<?php echo $this->fetch('my', 'buildContactLists', 'whitelist');?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='4' class='text-center form-actions'>
|
||||
|
||||
@@ -99,9 +99,12 @@
|
||||
</tr>
|
||||
<tr class="<?php if($program->acl == 'open') echo 'hidden';?>" id="whitelistBox">
|
||||
<th><?php echo $lang->whitelist;?></th>
|
||||
<td><?php echo html::select('whitelist[]', $users, $program->whitelist, 'class="form-control chosen" multiple');?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<?php echo html::select('whitelist[]', $users, $program->whitelist, 'class="form-control chosen" multiple');?>
|
||||
<?php echo $this->fetch('my', 'buildContactLists', 'whitelist');?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='4' class='text-center form-actions'>
|
||||
|
||||
@@ -772,7 +772,7 @@ class projectModel extends model
|
||||
->add('type', 'project')
|
||||
->join('whitelist', ',')
|
||||
->stripTags($this->config->project->editor->create['id'], $this->config->allowedTags)
|
||||
->remove('products,branch,plans,delta,newProduct,productName,future')
|
||||
->remove('products,branch,plans,delta,newProduct,productName,future,contactListMenu')
|
||||
->get();
|
||||
|
||||
$linkedProductsCount = 0;
|
||||
@@ -985,7 +985,7 @@ class projectModel extends model
|
||||
->setIF($this->post->budget != 0, 'budget', round($this->post->budget, 2))
|
||||
->join('whitelist', ',')
|
||||
->stripTags($this->config->project->editor->edit['id'], $this->config->allowedTags)
|
||||
->remove('products,branch,plans,delta,future')
|
||||
->remove('products,branch,plans,delta,future,contactListMenu')
|
||||
->get();
|
||||
|
||||
if($project->parent)
|
||||
|
||||
@@ -159,9 +159,12 @@
|
||||
</tr>
|
||||
<tr class="hidden" id="whitelistBox">
|
||||
<th><?php echo $lang->whitelist;?></th>
|
||||
<td><?php echo html::select('whitelist[]', $users, '', 'class="form-control chosen" multiple');?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td colspan='2'>
|
||||
<div class='input-group'>
|
||||
<?php echo html::select('whitelist[]', $users, '', 'class="form-control chosen" multiple');?>
|
||||
<?php echo $this->fetch('my', 'buildContactLists', 'whitelist');?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->project->auth;?></th>
|
||||
|
||||
@@ -172,9 +172,12 @@
|
||||
</tr>
|
||||
<tr class="<?php if($project->acl == 'open') echo 'hidden';?>" id="whitelistBox">
|
||||
<th><?php echo $lang->whitelist;?></th>
|
||||
<td><?php echo html::select('whitelist[]', $users, $project->whitelist, 'class="form-control chosen" multiple');?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<?php echo html::select('whitelist[]', $users, $project->whitelist, 'class="form-control chosen" multiple');?>
|
||||
<?php echo $this->fetch('my', 'buildContactLists', 'whitelist');?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->project->auth;?></th>
|
||||
|
||||
@@ -1165,19 +1165,20 @@ class user extends control
|
||||
* AJAX: get users from a contact list.
|
||||
*
|
||||
* @param int $contactListID
|
||||
* @param string $dropdownName
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function ajaxGetContactUsers($contactListID)
|
||||
public function ajaxGetContactUsers($contactListID, $dropdownName = 'mailto')
|
||||
{
|
||||
$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(isset($this->config->user->moreLink)) $this->config->moreLinks[$dropdownName . "[]"] = $this->config->user->moreLink;
|
||||
|
||||
if(!$contactListID) return print(html::select('mailto[]', $users, '', "class='form-control chosen' multiple data-placeholder='{$this->lang->chooseUsersToMail}'"));
|
||||
if(!$contactListID) return print(html::select($dropdownName . "[]", $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}'"));
|
||||
return print(html::select($dropdownName . "[]", $users, $list->userList, "class='form-control chosen' multiple data-placeholder='{$this->lang->chooseUsersToMail}'"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -136,7 +136,7 @@ function showMoreImage(obj)
|
||||
*/
|
||||
function setMailto(mailto, contactListID)
|
||||
{
|
||||
link = createLink('user', 'ajaxGetContactUsers', 'listID=' + contactListID);
|
||||
link = createLink('user', 'ajaxGetContactUsers', 'listID=' + contactListID + '&dropdownName=' + mailto);
|
||||
$.get(link, function(users)
|
||||
{
|
||||
$('#' + mailto).replaceWith(users);
|
||||
|
||||
Reference in New Issue
Block a user