managemembers.html.php 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <?php include $this->app->getModuleRoot() . 'common/view/header.html.php';?>
  2. <?php js::set('projectID', $project->id);?>
  3. <?php js::set('roles', $roles);?>
  4. <?php js::set('deptID', $dept);?>
  5. <?php js::set('pickerUsers', $userInfoList);?>
  6. <?php js::set('copyProjectID', $copyProjectID);?>
  7. <?php js::set('oldAccountList', array_keys($currentMembers));?>
  8. <?php js::set('unlinkExecutionMembers', $lang->project->unlinkExecutionMembers);?>
  9. <div id='mainMenu' class='clearfix'>
  10. <div class='btn-toolbar pull-left'>
  11. <span class='btn btn-link btn-active-text'>
  12. <?php echo html::a($this->createLink('project', 'managemembers', "projectID={$project->id}"), "<span class='text'> {$lang->project->manageMembers}</span>");?>
  13. </span>
  14. <div class='input-group space w-200px'>
  15. <span class='input-group-addon'><?php echo $lang->execution->selectDept?></span>
  16. <?php echo html::select('dept', $depts, $dept, "class='form-control chosen' onchange='setDeptUsers(this)' data-placeholder='{$lang->execution->selectDeptTitle}'");?>
  17. <?php if(count($teams2Import) > 1):?>
  18. <span class='input-group-addon'><?php echo $lang->execution->copyTeam;?></span>
  19. <?php echo html::select('project', $teams2Import, $copyProjectID, "class='form-control chosen' onchange='choseTeam2Copy(this)' data-placeholder='{$lang->project->copyTeamTitle}'");?>
  20. <?php endif;?>
  21. </div>
  22. </div>
  23. </div>
  24. <div id='mainContent' class='main-content'>
  25. <form class='main-form form-ajax' method='post' id='teamForm'>
  26. <table class='table table-form'>
  27. <thead>
  28. <tr class='text-center'>
  29. <th><?php echo $lang->team->account;?></th>
  30. <th><?php echo $lang->team->role;?></th>
  31. <th class='c-days hidden'><?php echo $lang->team->days;?></th>
  32. <th class='c-hours hidden'><?php echo $lang->team->hours;?></th>
  33. <th class='c-limited hidden'><?php echo $lang->team->limited;?></th>
  34. <th class="c-actions"><?php echo $lang->actions;?></th>
  35. </tr>
  36. </thead>
  37. <tbody>
  38. <?php $i = 0;?>
  39. <?php foreach($currentMembers as $member):?>
  40. <?php if(!isset($users[$member->account])) continue;?>
  41. <?php unset($users[$member->account]);?>
  42. <tr>
  43. <td><?php echo html::input("realnames[$i]", $member->realname, "class='form-control' readonly");?></td>
  44. <td><?php echo html::input("roles[$i]", $member->role, "class='form-control'");?></td>
  45. <td class='hidden'><?php echo html::input("days[$i]", $member->days, "class='form-control'");?></td>
  46. <td class='hidden'><?php echo html::input("hours[$i]", $member->hours, "class='form-control'");?></td>
  47. <td class='hidden'><?php echo html::radio("limited[$i]", $lang->team->limitedList, $member->limited);?></td>
  48. <td class='c-actions text-center'>
  49. <?php echo html::hidden("accounts[$i]", $member->account);?>
  50. <?php echo html::a('javascript:;', "<i class='icon-plus'></i>", '', "onclick='addItem(this)' class='btn btn-link'");?>
  51. <?php echo html::a('javascript:;', "<i class='icon icon-close'></i>", '', "onclick='deleteItem(this)' class='btn btn-link'");?>
  52. </td>
  53. </tr>
  54. <?php $i ++;?>
  55. <?php endforeach;?>
  56. <?php foreach($deptUsers as $deptAccount => $userName):?>
  57. <?php if(!isset($users[$deptAccount])) continue;?>
  58. <tr class='addedItem'>
  59. <td><?php echo html::select("accounts[$i]", $users, $deptAccount, "class='form-control chosen' onchange='setRole(this.value, $i)'");?></td>
  60. <td><?php echo html::input("roles[$i]", $roles[$deptAccount], "class='form-control'");?></td>
  61. <td class='hidden'><?php echo html::input("days[$i]", $project->days, "class='form-control'");?></td>
  62. <td class='hidden'><?php echo html::input("hours[$i]", $config->execution->defaultWorkhours, "class='form-control'");?></td>
  63. <td class='hidden'><?php echo html::radio("limited[$i]", $lang->team->limitedList, 'no');?></td>
  64. <td class='c-actions text-center'>
  65. <?php echo html::a('javascript:;', "<i class='icon-plus'></i>", '', "onclick='addItem(this)' class='btn btn-link'");?>
  66. <?php echo html::a('javascript:;', "<i class='icon icon-close'></i>", '', "onclick='deleteItem(this)' class='btn btn-link'");?>
  67. </td>
  68. </tr>
  69. <?php unset($users[$deptAccount]);?>
  70. <?php $i ++;?>
  71. <?php endforeach;?>
  72. <?php foreach($members2Import as $member2Import):?>
  73. <?php if(!isset($users[$member2Import->account])) continue;?>
  74. <tr class='addedItem'>
  75. <td><?php echo html::select("accounts[$i]", $users, $member2Import->account, "class='form-control user-picker' onchange='setRole(this.value, $i)'");?></td>
  76. <td><?php echo html::input("roles[$i]", $member2Import->role, "class='form-control'");?></td>
  77. <td class='hidden'><?php echo html::input("days[$i]", $project->days, "class='form-control'");?></td>
  78. <td class='hidden'><?php echo html::input("hours[$i]", $member2Import->hours, "class='form-control'");?></td>
  79. <td class='hidden'><?php echo html::radio("limited[$i]", $lang->team->limitedList, 'no');?></td>
  80. <td class='c-actions text-center'>
  81. <?php echo html::a('javascript:;', "<i class='icon-plus'></i>", '', "onclick='addItem(this)' class='btn btn-link'");?>
  82. <?php echo html::a('javascript:;', "<i class='icon icon-close'></i>", '', "onclick='deleteItem(this)' class='btn btn-link'");?>
  83. </td>
  84. </tr>
  85. <?php unset($users[$member2Import->account]);?>
  86. <?php $i ++;?>
  87. <?php endforeach;?>
  88. <?php for($j = 0; $j < 5; $j ++):?>
  89. <tr class='addedItem'>
  90. <td><?php echo html::select("accounts[$i]", $users, '', "class='form-control user-picker' onchange='setRole(this.value, $i)'");?></td>
  91. <td><?php echo html::input("roles[$i]", '', "class='form-control'");?></td>
  92. <td class='hidden'><?php echo html::input("days[$i]", $project->days, "class='form-control'");?></td>
  93. <td class='hidden'><?php echo html::input("hours[$i]", $config->execution->defaultWorkhours, "class='form-control'");?></td>
  94. <td class='hidden'><?php echo html::radio("limited[$i]", $lang->team->limitedList, 'no');?></td>
  95. <td class='c-actions text-center'>
  96. <?php echo html::a('javascript:;', "<i class='icon-plus'></i>", '', "onclick='addItem(this)' class='btn btn-link'");?>
  97. <?php echo html::a('javascript:;', "<i class='icon icon-close'></i>", '', "onclick='deleteItem(this)' class='btn btn-link'");?>
  98. </td>
  99. </tr>
  100. <?php $i ++;?>
  101. <?php endfor;?>
  102. </tbody>
  103. <tfoot>
  104. <tr>
  105. <td colspan='3' class='text-center form-actions'>
  106. <?php
  107. echo html::hidden('removeExecution', 'no');
  108. if(commonModel::isTutorialMode())
  109. {
  110. echo html::submitButton($lang->save, '', 'btn btn-wide btn-primary');
  111. }
  112. else
  113. {
  114. echo html::submitButton('', '', 'hidden btn btn-wide btn-primary');
  115. echo html::commonButton($lang->save, 'onclick="saveMembers()" id="saveBtn"', 'btn btn-wide btn-primary');
  116. }
  117. echo html::backButton();
  118. ?>
  119. </td>
  120. </tr>
  121. </tfoot>
  122. </table>
  123. <?php js::set('itemIndex', $i);?>
  124. </form>
  125. </div>
  126. <div>
  127. <?php $i = '%i%';?>
  128. <table class='hidden'>
  129. <tr id='addItem' class='hidden'>
  130. <td><?php echo html::select("accounts[$i]", $users, '', "class='form-control' onchange='setRole(this.value, $i)'");?></td>
  131. <td><?php echo html::input("roles[$i]", '', "class='form-control'");?></td>
  132. <td class='hidden'><?php echo html::input("days[$i]", $project->days, "class='form-control'");?></td>
  133. <td class='hidden'><?php echo html::input("hours[$i]", $config->execution->defaultWorkhours, "class='form-control'");?></td>
  134. <td class='hidden'><?php echo html::radio("limited[$i]", $lang->team->limitedList, 'no');?></td>
  135. <td class='c-actions text-center'>
  136. <?php echo html::a('javascript:;', "<i class='icon-plus'></i>", '', "onclick='addItem(this)' class='btn btn-link'");?>
  137. <?php echo html::a('javascript:;', "<i class='icon icon-close'></i>", '', "onclick='deleteItem(this)' class='btn btn-link'");?>
  138. </td>
  139. </tr>
  140. </table>
  141. </div>
  142. <?php include $this->app->getModuleRoot() . 'common/view/footer.html.php';?>