plan.html.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
  2. <?php include $app->getModuleRoot() . 'common/view/datatable.html.php';?>
  3. <?php
  4. $insideWidth = isset($stakeholders['inside']) ? count($stakeholders['inside']) * 200 : 200;
  5. $outsideWidth = isset($stakeholders['outside']) ? count($stakeholders['outside']) * 200 : 200;
  6. $insideWidth = "data-width=$insideWidth" . " style=$insideWidth";
  7. $outsideWidth = "data-width=$outsideWidth" . " style=$outsideWidth";
  8. $insideList = '<th></th>';
  9. $outsideList = '<th></th>';
  10. $insideColspan = 1;
  11. $outsideColspan = 1;
  12. if(isset($stakeholders['inside']))
  13. {
  14. $insideColspan = count($stakeholders['inside']);
  15. $insideList = '';
  16. foreach($stakeholders['inside'] as $user)
  17. {
  18. if($user->role) $user->name .= '(' . zget($lang->user->roleList, $user->role) . ')';
  19. $insideList .= "<th style='width: 200px;'>" . $user->name . '</th>';
  20. }
  21. }
  22. if(isset($stakeholders['outside']))
  23. {
  24. $outsideColspan = count($stakeholders['outside']);
  25. $outsideList = '';
  26. foreach($stakeholders['outside'] as $user)
  27. {
  28. if($user->role) $user->name .= '(' . zget($lang->user->roleList, $user->role) . ')';
  29. $outsideList .= '<th style="width: 200px;">' . $user->name . '</th>';
  30. }
  31. }
  32. js::set('insideList', $insideList);
  33. js::set('insideColspan', $insideColspan);
  34. js::set('outsideList', $outsideList);
  35. js::set('outsideColspan', $outsideColspan);
  36. ?>
  37. <div id='mainContent' class='main-row fade'>
  38. <div class='main-col'>
  39. <?php if(!empty($processGroup)):?>
  40. <form class='main-table form-ajax' method='post'>
  41. <table class="table table-bordered" id='planList'>
  42. <thead>
  43. <tr class='text-center'>
  44. <th data-flex='false'><?php echo $lang->stakeholder->planField->process;?></th>
  45. <th data-flex='false'><?php echo $lang->stakeholder->planField->begin;?></th>
  46. <th data-flex='false'><?php echo $lang->stakeholder->planField->realBegin;?></th>
  47. <th data-flex='false'><?php echo $lang->stakeholder->planField->status;?></th>
  48. <th data-flex='false'><?php echo $lang->stakeholder->planField->situation;?></th>
  49. <th data-flex='true' <?php echo $insideWidth;?>><?php echo $lang->stakeholder->planField->inside;?></th>
  50. <th data-flex='true' <?php echo $outsideWidth;?>><?php echo $lang->stakeholder->planField->outside;?></th>
  51. <th data-flex='false'><?php echo $lang->actions;?></th>
  52. </tr>
  53. </thead>
  54. <tbody>
  55. <?php foreach($processGroup as $processID => $activityGroup):?>
  56. <tr class='process'>
  57. <td colspan='5' title=<?php echo zget($processes, $processID);?>>
  58. <?php echo '<strong>' . zget($processes, $processID) . '</strong>';?>
  59. </td>
  60. </tr>
  61. <?php foreach($activityGroup as $activity):?>
  62. <tr>
  63. <td title=<?php echo zget($activities, $activity->activity);?>>
  64. <?php echo zget($activities, $activity->activity);?>
  65. </td>
  66. <td class='text-center'><?php echo isset($plans[$activity->activity]) ? $plans[$activity->activity]->begin : '';?></td>
  67. <td class='text-center'><?php echo isset($plans[$activity->activity]) ? $plans[$activity->activity]->realBegin : '';?></td>
  68. <td class='text-center'><?php echo isset($plans[$activity->activity]) ? zget($lang->stakeholder->planField->stautsList, $plans[$activity->activity]->status) : '';?></td>
  69. <td class='text-center'><?php echo isset($plans[$activity->activity]) ? zget($lang->stakeholder->situationList, $plans[$activity->activity]->situation) : '';?></td>
  70. <td class='inside'>
  71. <?php
  72. $partake = isset($plans[$activity->activity]) ? json_decode($plans[$activity->activity]->partake) : new stdclass();
  73. if(isset($stakeholders['inside']))
  74. {
  75. foreach($stakeholders['inside'] as $user)
  76. {
  77. if(isset($partake->{$user->account}))
  78. {
  79. echo '<span class="text-center">' . zget($lang->stakeholder->planField->partakeList, $partake->{$user->account}) . '</span>';
  80. }
  81. else
  82. {
  83. echo '<span></span>';
  84. }
  85. }
  86. }
  87. ?>
  88. </td>
  89. <td class='outside'>
  90. <?php
  91. if(isset($stakeholders['outside']))
  92. {
  93. foreach($stakeholders['outside'] as $user)
  94. {
  95. if(isset($partake->{$user->account}))
  96. {
  97. echo '<span class="text-center">' . zget($lang->stakeholder->planField->partakeList, $partake->{$user->account}) . '</span>';
  98. }
  99. else
  100. {
  101. echo '<span></span>';
  102. }
  103. }
  104. }
  105. ?>
  106. </td>
  107. <td class='c-actions text-center'>
  108. <?php echo html::a('javascript:void(0)', '<i class="icon icon-edit"></i>', '', "class='btn edit-btn' title=$lang->edit activity=$activity->activity");?>
  109. <?php common::printIcon('stakeholder', 'viewIssue', "activityID=$activity->activity", '', 'list', 'eye', '', 'iframe', true, '', $lang->stakeholder->planField->issue);?>
  110. </td>
  111. </tr>
  112. <?php endforeach;?>
  113. <?php endforeach;?>
  114. </tbody>
  115. </table>
  116. <div class='table-footer fixed-footer'>
  117. <div class="table-statistic"><?php echo $lang->stakeholder->planField->statusTips . '; ' . $lang->stakeholder->planField->partakeTips;?></div>
  118. </div>
  119. </form>
  120. <?php else:?>
  121. <div class="table-empty-tip">
  122. <p><span class="text-muted"><?php echo $lang->stakeholder->noPlan;?></span></p>
  123. </div>
  124. <?php endif;?>
  125. </div>
  126. </div>
  127. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>