managemembers.html.php 7.8 KB

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