Merge branch 'sprint/180_sunhao/task46524' into sprint/180
This commit is contained in:
@@ -1,24 +1 @@
|
||||
<?php if($extView = $this->getExtViewFile(__FILE__)){include $extView; return helper::cd();}?>
|
||||
<?php if($config->debug):?>
|
||||
<?php css::import($jsRoot . 'zui/picker/zui.picker.min.css'); ?>
|
||||
<?php js::import($jsRoot . 'zui/picker/zui.picker.min.js'); ?>
|
||||
<?php endif;?>
|
||||
<style>
|
||||
.picker-single .picker-selection-remove{z-index: 1000;}
|
||||
.picker-selection-single:after, .picker-multi.picker-focus .picker-selections:before{font-family: ZentaoIcon !important; content: '\f0d7' !important;}
|
||||
</style>
|
||||
<script>
|
||||
var chooseUsersToMail = '<?php echo $lang->chooseUsersToMail;?>';
|
||||
if($.fn.picker)
|
||||
{
|
||||
$(document).ready(function()
|
||||
{
|
||||
$(".picker-select[data-pickertype!='remote']").picker({chosenMode: true});
|
||||
$("[data-pickertype='remote']").each(function()
|
||||
{
|
||||
var pickerremote = $(this).attr('data-pickerremote');
|
||||
$(this).picker({chosenMode: true, remote: pickerremote});
|
||||
})
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -171,6 +171,7 @@ class program extends control
|
||||
$this->view->pmUsers = $this->loadModel('user')->getPairs('noclosed|nodeleted|pmfirst');
|
||||
$this->view->poUsers = $this->user->getPairs('noclosed|nodeleted|pofirst');
|
||||
$this->view->users = $this->user->getPairs('noclosed|nodeleted');
|
||||
$this->view->userInfos = $this->user->getUserDisplayInfos(array_keys($this->view->users));
|
||||
$this->view->parentProgram = $parentProgram;
|
||||
$this->view->parents = $this->program->getParentPairs();
|
||||
$this->view->programList = $this->program->getList();
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
<?php js::set('PGMParentBudget', $lang->program->parentBudget);?>
|
||||
<?php js::set('future', $lang->project->future);?>
|
||||
<?php js::set('programList', $programList);?>
|
||||
<?php js::set('pickerUsers', $userInfos);?>
|
||||
<?php $aclList = $parentProgram ? $lang->program->subAclList : $lang->program->aclList;?>
|
||||
<?php $requiredFields = $config->program->create->requiredFields;?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
@@ -60,7 +61,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->program->PM;?></th>
|
||||
<td><?php echo html::select('PM', $pmUsers, '', "class='form-control chosen'" . (strpos($requiredFields, 'PM') !== false ? ' required' : ''));?></td>
|
||||
<td><?php echo html::select('PM', $pmUsers, '', "class='form-control user-picker'" . (strpos($requiredFields, 'PM') !== false ? ' required' : ''));?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->program->budget;?></th>
|
||||
@@ -116,7 +117,7 @@
|
||||
<th><?php echo $lang->whitelist;?></th>
|
||||
<td colspan='2'>
|
||||
<div class='input-group'>
|
||||
<?php echo html::select('whitelist[]', $users, '', 'class="form-control chosen" multiple');?>
|
||||
<?php echo html::select('whitelist[]', $users, '', 'class="form-control user-picker" multiple');?>
|
||||
<?php echo $this->fetch('my', 'buildContactLists', "dropdownName='whitelist'");?>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@@ -479,6 +479,7 @@ class project extends control
|
||||
$this->view->gobackLink = (isset($output['from']) and $output['from'] == 'global') ? $this->createLink('project', 'browse') : '';
|
||||
$this->view->pmUsers = $this->loadModel('user')->getPairs('noclosed|nodeleted|pmfirst');
|
||||
$this->view->users = $this->user->getPairs('noclosed|nodeleted');
|
||||
$this->view->userInfos = $this->user->getUserDisplayInfos(array_keys($this->view->users));
|
||||
$this->view->copyProjects = $this->project->getPairsByModel($model);
|
||||
$this->view->products = $products;
|
||||
$this->view->allProducts = array('0' => '') + $this->program->getProductPairs($programID, 'assign', 'noclosed');
|
||||
@@ -1335,6 +1336,7 @@ class project extends control
|
||||
$users = $this->user->getPairs('noclosed|nodeleted|devfirst|nofeedback');
|
||||
$roles = $this->user->getUserRoles(array_keys($users));
|
||||
$deptUsers = $dept === '' ? array() : $this->dept->getDeptUserPairs($dept);
|
||||
$userInfos = $this->user->getUserDisplayInfos(array_keys($users), $dept);
|
||||
|
||||
$currentMembers = $this->project->getTeamMembers($projectID);
|
||||
$members2Import = $this->project->getMembers2Import($copyProjectID, array_keys($currentMembers));
|
||||
@@ -1345,6 +1347,7 @@ class project extends control
|
||||
$this->view->project = $project;
|
||||
$this->view->users = $users;
|
||||
$this->view->deptUsers = $deptUsers;
|
||||
$this->view->userInfos = $userInfos;
|
||||
$this->view->roles = $roles;
|
||||
$this->view->dept = $dept;
|
||||
$this->view->depts = array('' => '') + $this->dept->getOptionMenu();
|
||||
|
||||
@@ -36,7 +36,7 @@ function saveMembers()
|
||||
$('#submit').removeClass('hidden');
|
||||
if(result) $('#removeExecution').val('yes');
|
||||
$('#submit').click();
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,9 +50,7 @@ function saveMembers()
|
||||
*/
|
||||
function setRole(account, roleID)
|
||||
{
|
||||
role = roles[account]; // get role according the account.
|
||||
roleOBJ = $(document.getElementById('roles[' + roleID + ']')); // get role object.
|
||||
roleOBJ.val(role) // set the role.
|
||||
$('#roles\\[' + roleID + '\\]').val(roles[account]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -65,11 +63,11 @@ function setRole(account, roleID)
|
||||
function addItem(obj)
|
||||
{
|
||||
var item = $('#addItem').html().replace(/%i%/g, i);
|
||||
$(obj).closest('tr').after('<tr class="addedItem">' + item + '</tr>');
|
||||
var accounts = $(obj).closest('tr').next('tr').find('select:first');
|
||||
accounts.trigger('liszt:updated');
|
||||
accounts.chosen();
|
||||
i ++;
|
||||
var $tr = $('<tr class="addedItem">' + item + '</tr>').insertAfter($(obj).closest('tr'));
|
||||
$tr.find('select:first')
|
||||
.trigger('liszt:updated')
|
||||
.picker({type: 'user'});
|
||||
i++;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
<?php js::set('multiBranchProducts', $multiBranchProducts);?>
|
||||
<?php js::set('selectedProductID', $productID);?>
|
||||
<?php js::set('selectedBranchID', $branchID);?>
|
||||
<?php js::set('pickerUsers', $userInfos);?>
|
||||
<?php $requiredFields = $config->project->create->requiredFields;?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='center-block'>
|
||||
@@ -55,7 +56,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->project->PM;?></th>
|
||||
<td><?php echo html::select('PM', $pmUsers, '', "class='form-control chosen'" . (strpos($requiredFields, 'PM') !== false ? ' required' : ''));?></td>
|
||||
<td><?php echo html::select('PM', $pmUsers, '', "class='form-control user-picker'" . (strpos($requiredFields, 'PM') !== false ? ' required' : ''));?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->project->budget;?></th>
|
||||
@@ -161,7 +162,7 @@
|
||||
<th><?php echo $lang->whitelist;?></th>
|
||||
<td colspan='2'>
|
||||
<div class='input-group'>
|
||||
<?php echo html::select('whitelist[]', $users, '', 'class="form-control chosen" multiple');?>
|
||||
<?php echo html::select('whitelist[]', $users, '', 'class="form-control user-picker" multiple');?>
|
||||
<?php echo $this->fetch('my', 'buildContactLists', "dropdownName='whitelist'");?>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<?php js::set('projectID', $project->id);?>
|
||||
<?php js::set('roles', $roles);?>
|
||||
<?php js::set('deptID', $dept);?>
|
||||
<?php js::set('pickerUsers', $userInfos);?>
|
||||
<?php js::set('copyProjectID', $copyProjectID);?>
|
||||
<?php js::set('oldAccountList', array_keys($currentMembers));?>
|
||||
<?php js::set('unlinkExecutionMembers', $lang->project->unlinkExecutionMembers);?>
|
||||
@@ -75,7 +76,7 @@
|
||||
<?php foreach($members2Import as $member2Import):?>
|
||||
<?php if(!isset($users[$member2Import->account])) continue;?>
|
||||
<tr class='addedItem'>
|
||||
<td><?php echo html::select("accounts[$i]", $users, $member2Import->account, "class='form-control chosen' onchange='setRole(this.value, $i)'");?></td>
|
||||
<td><?php echo html::select("accounts[$i]", $users, $member2Import->account, "class='form-control user-picker' onchange='setRole(this.value, $i)'");?></td>
|
||||
<td><?php echo html::input("roles[$i]", $member2Import->role, "class='form-control'");?></td>
|
||||
<td><?php echo html::input("days[$i]", $project->days, "class='form-control'");?></td>
|
||||
<td><?php echo html::input("hours[$i]", $member2Import->hours, "class='form-control'");?></td>
|
||||
@@ -91,7 +92,7 @@
|
||||
|
||||
<?php for($j = 0; $j < 5; $j ++):?>
|
||||
<tr class='addedItem'>
|
||||
<td><?php echo html::select("accounts[$i]", $users, '', "class='form-control chosen' onchange='setRole(this.value, $i)'");?></td>
|
||||
<td><?php echo html::select("accounts[$i]", $users, '', "class='form-control user-picker' onchange='setRole(this.value, $i)'");?></td>
|
||||
<td><?php echo html::input("roles[$i]", '', "class='form-control'");?></td>
|
||||
<td><?php echo html::input("days[$i]", $project->days, "class='form-control'");?></td>
|
||||
<td><?php echo html::input("hours[$i]", $config->execution->defaultWorkhours, "class='form-control'");?></td>
|
||||
|
||||
@@ -319,6 +319,7 @@ class story extends control
|
||||
$this->view->gobackLink = (isset($output['from']) and $output['from'] == 'global') ? $this->createLink('product', 'browse', "productID=$productID") : '';
|
||||
$this->view->products = $products;
|
||||
$this->view->users = $users;
|
||||
$this->view->userInfos = $this->user->getUserDisplayInfos(array_keys($users));
|
||||
$this->view->moduleID = $moduleID ? $moduleID : (int)$this->cookie->lastStoryModule;
|
||||
$this->view->moduleOptionMenu = $moduleOptionMenu;
|
||||
$this->view->plans = $this->loadModel('productplan')->getPairsForStory($productID, $branch, 'skipParent|unexpired');
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
<?php js::set('blockID', $blockID); ?>
|
||||
<?php js::set('feedbackSource', $config->story->feedbackSource); ?>
|
||||
<?php js::set('storyType', $type);?>
|
||||
<?php js::set('pickerUsers', $userInfos);?>
|
||||
<?php if(common::checkNotCN()):?>
|
||||
<style> .sourceTd > .input-group > .input-group > .input-group-addon:first-child{padding: 5px 18px} </style>
|
||||
<?php endif;?>
|
||||
@@ -106,7 +107,7 @@
|
||||
<td colspan='<?php echo $type == 'story' ? 4 : 2;?>' id='reviewerBox'>
|
||||
<div class="table-row">
|
||||
<div class="table-col">
|
||||
<?php echo html::select('reviewer[]', $reviewers, empty($needReview) ? $product->PO : '', "class='form-control chosen' multiple");?>
|
||||
<?php echo html::select('reviewer[]', $reviewers, empty($needReview) ? $product->PO : '', "class='form-control' multiple");?>
|
||||
</div>
|
||||
<?php if(!$this->story->checkForceReview()):?>
|
||||
<div class="table-col w-130px">
|
||||
@@ -250,7 +251,7 @@
|
||||
<th><?php echo $lang->story->mailto;?></th>
|
||||
<td colspan="4">
|
||||
<div class="input-group">
|
||||
<?php echo html::select('mailto[]', $users, str_replace(' ' , '', $mailto), "class='form-control chosen' data-placeholder='{$lang->chooseUsersToMail}' multiple");?>
|
||||
<?php echo html::select('mailto[]', $users, str_replace(' ' , '', $mailto), "class='form-control user-picker' data-placeholder='{$lang->chooseUsersToMail}' multiple");?>
|
||||
<?php echo $this->fetch('my', 'buildContactLists');?>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@@ -205,6 +205,39 @@ class userModel extends model
|
||||
return $users;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get users info list for displaying
|
||||
*
|
||||
* @param array $accounts
|
||||
* @param int $deptID
|
||||
* @param string $type
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getUserDisplayInfos($accounts, $deptID = 0, $type = 'inside')
|
||||
{
|
||||
$users = $this->dao->select('account, realname, avatar, dept, role')->from(TABLE_USER)
|
||||
->where('deleted')->eq(0)
|
||||
->beginIF($accounts)->andWhere('type')->eq($type)->fi()
|
||||
->beginIF($accounts)->andWhere('account')->in($accounts)->fi()
|
||||
->fetchAll('account');
|
||||
|
||||
$depts = $this->loadModel('dept')->getDeptPairs($deptID);
|
||||
|
||||
$infos = array();
|
||||
foreach($users as $info)
|
||||
{
|
||||
$info->roleName = zget($this->lang->user->roleList, $info->role, '');
|
||||
if(isset($depts[$info->dept])) $info->deptName = $depts[$info->dept];
|
||||
if(empty($info->avatar)) unset($info->avatar);
|
||||
if(empty($info->realname)) unset($info->realname);
|
||||
if(empty($info->role)) unset($info->role);
|
||||
if(empty($info->roleName)) unset($info->roleName);
|
||||
$infos[$info->account] = $info;
|
||||
}
|
||||
return $infos;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user info by ID.
|
||||
*
|
||||
|
||||
@@ -16,7 +16,6 @@ $jsFiles[] = $jqueryRoot . 'lib.js';
|
||||
$jsFiles[] = $jqueryRoot . 'tablesorter/min.js';
|
||||
$jsFiles[] = $jqueryRoot . 'tablesorter/metadata.js';
|
||||
$jsFiles[] = $jsRoot . 'zui/min.js';
|
||||
$jsFiles[] = $jsRoot . 'zui/picker/zui.picker.min.js';
|
||||
$jsFiles[] = $jsRoot . 'my.full.js';
|
||||
|
||||
/* Combine these js files. */
|
||||
@@ -58,7 +57,6 @@ $themes = array_keys($lang->themes);
|
||||
|
||||
/* Create css files for every them and every lang. */
|
||||
$zuiCode = str_replace(array('/*!', '../fonts'), array('/*', '../zui/fonts'), file_get_contents($themeRoot . 'zui/css/min.css'));
|
||||
$zuiCode .= "\n" . str_replace('/*!', '/*', file_get_contents($jsRoot . 'zui/picker/zui.picker.min.css')) . "\n";
|
||||
foreach($langs as $lang)
|
||||
{
|
||||
foreach($themes as $theme)
|
||||
|
||||
+15
-14
File diff suppressed because one or more lines are too long
Vendored
-6
File diff suppressed because one or more lines are too long
Vendored
-7
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user