managemembers.html.php 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <?php include '../../common/view/header.html.php';?>
  2. <?php js::set('projectID', $project->id);?>
  3. <?php js::set('roles', $roles);?>
  4. <div id='mainMenu' class='clearfix'>
  5. <div class='btn-toolbar pull-left'>
  6. <span class='btn btn-link btn-active-text'>
  7. <?php echo html::a($this->createLink('project', 'managemembers', "projectID={$project->id}"), "<span class='text'> {$lang->project->manageMembers}</span>");?>
  8. </span>
  9. <div class='input-group space w-200px'>
  10. <span class='input-group-addon'><?php echo $lang->execution->selectDept?></span>
  11. <?php echo html::select('dept', $depts, $dept, "class='form-control chosen' onchange='setDeptUsers(this)' data-placeholder='{$lang->execution->selectDeptTitle}'");?>
  12. </div>
  13. </div>
  14. </div>
  15. <div id='mainContent' class='main-content'>
  16. <form class='main-form' method='post' id='teamForm' target='hiddenwin'>
  17. <table class='table table-form'>
  18. <thead>
  19. <tr class='text-center'>
  20. <th><?php echo $lang->team->account;?></th>
  21. <th><?php echo $lang->team->role;?></th>
  22. <th class='w-100px'><?php echo $lang->team->days;?></th>
  23. <th class='w-100px'><?php echo $lang->team->hours;?></th>
  24. <th class='w-110px'><?php echo $lang->team->limited;?></th>
  25. <th class="w-90px"> <?php echo $lang->actions;?></th>
  26. </tr>
  27. </thead>
  28. <tbody>
  29. <?php $i = 0; $memberCount = 0;?>
  30. <?php foreach($currentMembers as $member):?>
  31. <?php if(!isset($users[$member->account])) continue;?>
  32. <?php unset($users[$member->account]);?>
  33. <tr>
  34. <td><input type='text' name='realnames[]' id='account<?php echo $i;?>' value='<?php echo $member->realname;?>' readonly class='form-control' /></td>
  35. <td><input type='text' name='roles[]' id='role<?php echo $i;?>' value='<?php echo $member->role;?>' class='form-control' /></td>
  36. <td><input type='text' name='days[] ' id='days<?php echo $i;?>' value='<?php echo $member->days;?>' class='form-control' /></td>
  37. <td>
  38. <input type='text' name='hours[]' id='hours<?php echo $i;?>' value='<?php echo $member->hours;?>' class='form-control' />
  39. <input type='hidden' name='accounts[]' value='<?php echo $member->account;?>' />
  40. </td>
  41. <td><?php echo html::radio("limited[$i]", $lang->team->limitedList, $member->limited);?></td>
  42. <td class='c-actions text-center'>
  43. <a href='javascript:;' onclick='addItem(this)' class='btn btn-link'><i class='icon-plus'></i></a>
  44. <a href='javascript:;' onclick='deleteItem(this)' class='btn btn-link'><i class='icon icon-close'></i></a>
  45. </td>
  46. </tr>
  47. <?php $i ++; $memberCount ++;?>
  48. <?php endforeach;?>
  49. <?php foreach($deptUsers as $deptAccount => $userName):?>
  50. <?php if(!isset($users[$deptAccount])) continue;?>
  51. <tr class='addedItem'>
  52. <td><?php echo html::select("accounts[]", $users, $deptAccount, "class='form-control chosen' onchange='setRole(this.value, $i)'");?></td>
  53. <td><input type='text' name='roles[]' id='role<?php echo $i;?>' class='form-control' value='<?php echo $roles[$deptAccount]?>'/></td>
  54. <td><input type='text' name='days[]' id='days<?php echo $i;?>' class='form-control' value='<?php echo $project->days?>'/></td>
  55. <td>
  56. <input type='text' name='hours[]' id='hours<?php echo $i;?>' class='form-control' value='<?php echo $config->project->defaultWorkhours?>' />
  57. </td>
  58. <td><?php echo html::radio("limited[$i]", $lang->team->limitedList, 'no');?></td>
  59. <td class='c-actions text-center'>
  60. <a href='javascript:;' onclick='addItem(this)' class='btn btn-link'><i class='icon-plus'></i></a>
  61. <a href='javascript:;' onclick='deleteItem(this)' class='btn btn-link'><i class='icon icon-close'></i></a>
  62. </td>
  63. </tr>
  64. <?php unset($users[$deptAccount]);?>
  65. <?php $i ++; $memberCount ++;?>
  66. <?php endforeach;?>
  67. <?php for($j = 0; $j < 5; $j ++):?>
  68. <tr class='addedItem'>
  69. <td><?php echo html::select("accounts[]", $users, '', "class='form-control chosen' onchange='setRole(this.value, $i)'");?></td>
  70. <td><input type='text' name='roles[]' id='role<?php echo ($i);?>' class='form-control' /></td>
  71. <td><input type='text' name='days[]' id='days<?php echo ($i);?>' class='form-control' value='<?php echo $project->days?>'/></td>
  72. <td>
  73. <input type='text' name='hours[]' id='hours<?php echo ($i);?>' class='form-control' value='<?php echo $config->project->defaultWorkhours?>' />
  74. </td>
  75. <td><?php echo html::radio("limited[$i]", $lang->team->limitedList, 'no');?></td>
  76. <td class='c-actions text-center'>
  77. <a href='javascript:;' onclick='addItem(this)' class='btn btn-link'><i class='icon-plus'></i></a>
  78. <a href='javascript:;' onclick='deleteItem(this)' class='btn btn-link'><i class='icon icon-close'></i></a>
  79. </td>
  80. </tr>
  81. <?php $i ++; $memberCount ++;?>
  82. <?php endfor;?>
  83. </tbody>
  84. <tfoot><tr><td colspan='6' class='text-center form-actions'><?php echo html::submitButton() . ' ' . html::backButton(); ?></td></tr></tfoot>
  85. </table>
  86. <?php js::set('i', $i);?>
  87. </form>
  88. </div>
  89. <div>
  90. <?php $i = '%i%';?>
  91. <table class='hidden'>
  92. <tr id='addItem' class='hidden'>
  93. <td><?php echo html::select("accounts[]", $users, '', "class='form-control' onchange='setRole(this.value, $i)'");?></td>
  94. <td><input type='text' name='roles[]' id='role<?php echo ($i);?>' class='form-control' /></td>
  95. <td><input type='text' name='days[]' id='days<?php echo ($i);?>' class='form-control' value='<?php echo $project->days?>'/></td>
  96. <td>
  97. <input type='text' name='hours[]' id='hours<?php echo ($i);?>' class='form-control' value='<?php echo $config->project->defaultWorkhours?>' />
  98. </td>
  99. <td><?php echo html::radio("limited[$i]", $lang->team->limitedList, 'no');?></td>
  100. <td class='c-actions text-center'>
  101. <a href='javascript:;' onclick='addItem(this)' class='btn btn-link'><i class='icon-plus'></i></a>
  102. <a href='javascript:;' onclick='deleteItem(this)' class='btn btn-link'><i class='icon icon-close'></i></a>
  103. </td>
  104. </tr>
  105. </table>
  106. </div>
  107. <?php include '../../common/view/footer.html.php';?>