* code task #1971,1961.

This commit is contained in:
wangyidong
2014-07-23 01:55:32 +00:00
parent 080ea27752
commit c79840dfa9
12 changed files with 62 additions and 35 deletions

View File

@@ -475,7 +475,7 @@ class product extends control
public function ajaxGetPlans($productID, $planID = 0, $needCreate = false)
{
$plans = $this->loadModel('productplan')->getPairs($productID);
$output = html::select('plan', $plans, $planID, "class='form-control'");
$output = html::select('plan', $plans, $planID, "class='form-control chosen'");
if(count($plans) == 1 and $needCreate)
{
$output .= "<span class='input-group-addon'>";

View File

@@ -72,7 +72,6 @@ class user extends control
/* set menus. */
$this->lang->set('menugroup.user', 'company');
$this->user->setMenu($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
$this->view->title = $this->lang->user->common . $this->lang->colon . $this->lang->user->todo;
@@ -112,7 +111,6 @@ class user extends control
/* Set menu. */
$this->lang->set('menugroup.user', 'company');
$this->user->setMenu($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
/* Assign. */
@@ -149,7 +147,6 @@ class user extends control
/* Set the menu. */
$this->lang->set('menugroup.user', 'company');
$this->user->setMenu($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
/* Assign. */
@@ -188,7 +185,6 @@ class user extends control
/* Set menu. */
$this->lang->set('menugroup.user', 'company');
$this->user->setMenu($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
/* Load the lang of bug module. */
@@ -226,7 +222,6 @@ class user extends control
/* Set menu. */
$this->lang->set('menugroup.user', 'company');
$this->user->setMenu($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
/* Save session. */
@@ -271,7 +266,6 @@ class user extends control
/* Set menu. */
$this->lang->set('menugroup.user', 'company');
$this->user->setMenu($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
$cases = array();
@@ -322,7 +316,6 @@ class user extends control
/* Set the menus. */
$this->loadModel('project');
$this->lang->set('menugroup.user', 'company');
$this->user->setMenu($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclose|nodeleted'), $account);
$this->view->title = $this->lang->user->common . $this->lang->colon . $this->lang->user->project;
@@ -345,7 +338,6 @@ class user extends control
public function profile($account)
{
/* Set menu. */
$this->user->setMenu($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclose|nodeleted'), $account);
$user = $this->user->getById($account);
@@ -767,7 +759,6 @@ class user extends control
{
/* set menus. */
$this->lang->set('menugroup.user', 'company');
$this->user->setMenu($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
/* Save session. */

View File

@@ -20,3 +20,15 @@ function toggleCheck(obj, i)
$('#ditto' + i).removeAttr('checked');
}
}
$(document).on('click', '.chosen-with-drop', function()
{
var select = $(this).prev('select');
if($(select).val() == 'ditto')
{
var index = $(select).parents('td').index();
var value = $(select).parents('tr').prev('tr').find('td').eq(index).find('select').val();
$(select).val(value);
$(select).trigger("chosen:updated");
}
})

View File

@@ -0,0 +1,20 @@
$(document).on('click', '.chosen-with-drop', function()
{
var select = $(this).prev('select');
if($(select).val() == 'ditto')
{
var index = $(select).parents('td').index();
var value = $(select).parents('tr').prev('tr').find('td').eq(index).find('select').val();
$(select).val(value);
$(select).trigger("chosen:updated");
}
})
$(document).on('mousedown', 'select', function()
{
if($(this).val() == 'ditto')
{
var index = $(this).parents('td').index();
var value = $(this).parents('tr').prev('tr').find('td').eq(index).find('select').val();
$(this).val(value);
}
})

View File

@@ -42,7 +42,7 @@ class userModel extends model
*/
public function setUserList($users, $account)
{
return html::select('account', $users, $account, "onchange=\"switchAccount(this.value, '{$this->app->getMethodName()}')\" class='form-control'");
return html::select('account', $users, $account, "onchange=\"switchAccount(this.value, '{$this->app->getMethodName()}')\" class='form-control chosen'");
}
/**

View File

@@ -21,18 +21,18 @@
</div>
<form class='form-condensed' method='post' target='hiddenwin' id='dataform'>
<table class='table table-form table-fixed'>
<table class='table table-form'>
<thead>
<tr>
<th class='w-40px'><?php echo $lang->idAB;?></th>
<th class='w-150px'><?php echo $lang->user->dept;?></th>
<th class='w-130px red'><?php echo $lang->user->account;?></th>
<th class='w-130px red'><?php echo $lang->user->realname;?></th>
<th class='w-100px red'><?php echo $lang->user->role;?></th>
<th class='w-100px'><?php echo $lang->user->group;?></th>
<th class='w-120px red'><?php echo $lang->user->role;?></th>
<th class='w-120px'><?php echo $lang->user->group;?></th>
<th><?php echo $lang->user->email;?></th>
<th class='w-90px'><?php echo $lang->user->gender;?></th>
<th class="red"><?php echo $lang->user->password;?></th>
<th class="w-p20 red"><?php echo $lang->user->password;?></th>
</tr>
</thead>
<?php $depts = $depts + array('ditto' => $lang->user->ditto)?>
@@ -41,11 +41,11 @@
<?php for($i = 0; $i < $config->user->batchCreate; $i++):?>
<tr class='text-center'>
<td><?php echo $i+1;?></td>
<td><?php echo html::select("dept[$i]", $depts, $i > 0 ? 'ditto' : $deptID, "class='form-control'");?></td>
<td class='text-left'><?php echo html::select("dept[$i]", $depts, $i > 0 ? 'ditto' : $deptID, "class='form-control chosen'");?></td>
<td><?php echo html::input("account[$i]", '', "class='form-control account_$i' autocomplete='off' onchange='changeEmail($i)'");?></td>
<td><?php echo html::input("realname[$i]", '', "class='form-control'");?></td>
<td><?php echo html::select("role[$i]", $lang->user->roleList, $i > 0 ? 'ditto' : '', "class='form-control' onchange='changeGroup(this.value, $i)'");?></td>
<td><?php echo html::select("group[$i]", $groupList, $i > 0 ? 'ditto' : '', "class='form-control'");?></td>
<td class='text-left'><?php echo html::select("group[$i]", $groupList, $i > 0 ? 'ditto' : '', "class='form-control chosen'");?></td>
<td><?php echo html::input("email[$i]", '', "class='form-control email_$i' onchange='setDefaultEmail($i)'");?></td>
<td><?php echo html::radio("gender[$i]", (array)$lang->user->genderList, 'm');?></td>
<td align='left'>

View File

@@ -21,14 +21,14 @@
</div>
<form class='form-condensed' method='post' target='hiddenwin' id='dataform'>
<table class='table table-form table-fixed'>
<table class='table table-form'>
<thead>
<tr>
<th class='w-30px'><?php echo $lang->idAB;?></th>
<th class='w-150px'><?php echo $lang->user->dept;?></th>
<th class='w-120px'><?php echo $lang->user->account;?></th>
<th class='w-120px'><?php echo $lang->user->realname;?></th>
<th class='w-100px'><?php echo $lang->user->role;?></th>
<th class='w-150px'><?php echo $lang->user->account;?></th>
<th class='w-150px'><?php echo $lang->user->realname;?></th>
<th class='w-120px'><?php echo $lang->user->role;?></th>
<th><?php echo $lang->user->commiter;?></th>
<th><?php echo $lang->user->email;?></th>
<th class='w-120px'><?php echo $lang->user->join;?></th>
@@ -36,19 +36,25 @@
</thead>
<?php $depts = $depts + array('ditto' => $lang->user->ditto)?>
<?php $lang->user->roleList = $lang->user->roleList + array('ditto' => $lang->user->ditto)?>
<?php $first = true;?>
<?php foreach($users as $user):?>
<?php
$dept = ($first and empty($user->dept)) ? 0 : (empty($user->dept) ? 'ditto' : $user->dept);
$role = ($first and empty($user->role)) ? 0 : (empty($user->role) ? 'ditto' : $user->role);
$first = false;
?>
<tr class='text-center'>
<td><?php echo $user->id;?></td>
<td><?php echo html::select("dept[$user->id]", $depts, empty($user->dept) ? 'ditto' : $user->dept, "class='form-control'");?></td>
<td class='text-left'><?php echo html::select("dept[$user->id]", $depts, $dept, "class='form-control chosen'");?></td>
<td><?php echo html::input("account[$user->id]", $user->account, "class='form-control' autocomplete='off'");?></td>
<td><?php echo html::input("realname[$user->id]", $user->realname, "class='form-control'");?></td>
<td><?php echo html::select("role[$user->id]", $lang->user->roleList, empty($user->role) ? 'ditto' : $user->role, "class='form-control'");?></td>
<td><?php echo html::select("role[$user->id]", $lang->user->roleList, $role, "class='form-control'");?></td>
<td><?php echo html::input("commiter[$user->id]", $user->commiter, "class='form-control'");?></td>
<td><?php echo html::input("email[$user->id]", $user->email, "class='form-control'");?></td>
<td><?php echo html::input("join[$user->id]", $user->join, "class='form-control form-date'");?></td>
</tr>
<?php endforeach;?>
<tr><td colspan='7' class='text-center'><?php echo html::submitButton() . html::backButton();?></td></tr>
<tr><td colspan='8' class='text-center'><?php echo html::submitButton() . html::backButton();?></td></tr>
</table>
</form>
<?php include '../../common/view/footer.html.php';?>

View File

@@ -14,18 +14,18 @@
<?php include '../../common/view/datepicker.html.php';?>
<?php js::set('holders', $lang->user->placeholder);?>
<?php js::set('roleGroup', $roleGroup);?>
<div class='container mw-600px'>
<div class='container mw-700px'>
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['user']);?></span>
<strong><small class='text-muted'><?php echo html::icon($lang->icons['create']);?></small> <?php echo $lang->user->create;?></strong>
</div>
</div>
<form class='form-condensed mw-500px' method='post' target='hiddenwin' id='dataform'>
<form class='form-condensed mw-700px' method='post' target='hiddenwin' id='dataform'>
<table align='center' class='table table-form'>
<tr>
<th class='w-100px'><?php echo $lang->user->dept;?></th>
<td><?php echo html::select('dept', $depts, $deptID, "class='form-control'");?></td>
<td class='w-p50'><?php echo html::select('dept', $depts, $deptID, "class='form-control chosen'");?></td>
</tr>
<tr>
<th><?php echo $lang->user->account;?></th>
@@ -46,10 +46,12 @@
<tr>
<th><?php echo $lang->user->role;?></th>
<td><?php echo html::select('role', $lang->user->roleList, '', "class='form-control' onchange='changeGroup(this.value)'");?></td>
<td><?php echo $lang->user->placeholder->role?></td>
</tr>
<tr>
<th><?php echo $lang->user->group;?></th>
<td><?php echo html::select('group', $groupList, '', "class='form-control'");?></td>
<td><?php echo html::select('group', $groupList, '', "class='form-control chosen'");?></td>
<td><?php echo $lang->user->placeholder->group?></td>
</tr>
<tr>
<th><?php echo $lang->user->email;?></th>

View File

@@ -29,7 +29,7 @@
</tr>
<tr>
<th class='w-90px'><?php echo $lang->user->dept;?></th>
<td class='w-p40'><?php echo html::select('dept', $depts, $user->dept, "class='form-control'");?></td>
<td class='w-p40'><?php echo html::select('dept', $depts, $user->dept, "class='form-control chosen'");?></td>
<th><?php echo $lang->user->role;?></th>
<td><?php echo html::select('role', $lang->user->roleList, $user->role, "class='form-control'");?></td>
</tr>

View File

@@ -6,7 +6,7 @@
if(!isset($period)) $period = 'today';
$date = isset($date) ? $date : helper::today();
echo '<li>' . $userList . '</li>';
echo "<li class='w-150px'>" . $userList . '</li>';
echo '<li> &nbsp; ' . $lang->arrow . ' &nbsp; </li>';
echo "<li id='todoTab'>"; common::printLink('user', 'todo', "account=$account", $lang->user->todo); echo '</li>';
echo "<li id='storyTab'>"; common::printLink('user', 'story', "account=$account", $lang->user->story); echo '</li>';

View File

@@ -26,7 +26,7 @@
</div>
<table class='table table-borderless table-data'>
<tr>
<th classs='w-100px'><?php echo $lang->user->dept;?></th>
<th class='w-100px'><?php echo $lang->user->dept;?></th>
<td>
<?php
if(empty($deptPath))

View File

@@ -262,10 +262,6 @@ function setPlaceholder()
{
$("#" + key).attr('placeholder', holders[key]);
}
else
{
$("#" + key).parent().append("<span class='help-block'>" + holders[key] + '</span>');
}
}
}
}