steps.html.php 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <?php
  2. /**
  3. * The steps view file of deploy module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2015 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
  6. * @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  7. * @author Yidong Wang <yidong@cnezsoft.com>
  8. * @package deploy
  9. * @version $Id$
  10. * @link http://www.zentao.net
  11. */
  12. ?>
  13. <?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
  14. <?php $width = 100 / count($lang->deploy->stageList);?>
  15. <div id='mainMenu' class='clearfix'>
  16. <?php include './nav.html.php';?>
  17. <div class='btn-toolbar pull-right'>
  18. <?php
  19. $browseLink = $this->session->deployList ? $this->session->deployList : inlink('browse');
  20. if(!$deploy->deleted)
  21. {
  22. common::printLink('deploy', 'manageStep', $params, "<i class='icon icon-plus'></i> " . $lang->deploy->manageStep, '', "class='btn btn-primary'");
  23. echo html::linkButton('<i class="icon-back icon-level-up icon-large icon-rotate-270"></i> ' . $lang->goback, $browseLink, 'self', '', 'btn btn-secondary');
  24. }
  25. else
  26. {
  27. echo html::linkButton('<i class="icon-back icon-level-up icon-large icon-rotate-270"></i> ' . $lang->goback, $browseLink, 'self', '', 'btn btn-secondary');
  28. }
  29. ?>
  30. </div>
  31. </div>
  32. <div class='main-content' id='kanban'>
  33. <?php if(empty($stepGroups)):?>
  34. <div class='table-empty-tip'><?php echo $lang->noData;?></div>
  35. <?php else:?>
  36. <table class='boards-layout table' id='kanbanHeader'>
  37. <thead>
  38. <tr>
  39. <?php foreach($lang->deploy->stageList as $stage => $name):?>
  40. <th class='col-<?php echo $stage?>' style='width:<?php echo $width;?>%'><?php echo $name;?></th>
  41. <?php endforeach;?>
  42. </tr>
  43. </thead>
  44. </table>
  45. <table class='boards-layout table active-disabled table-bordered' id='kanbanWrapper'>
  46. <thead>
  47. <tr>
  48. <?php foreach($lang->deploy->stageList as $stage => $name):?>
  49. <th class='col-<?php echo $stage?>' style='width:<?php echo $width;?>%'></th>
  50. <?php endforeach;?>
  51. </tr>
  52. </thead>
  53. <tbody>
  54. <tr>
  55. <?php foreach($lang->deploy->stageList as $stage => $name):?>
  56. <td class='col-droppable col-<?php echo $stage?>' data-id='<?php echo $stage?>'>
  57. <?php if(!isset($stepGroups[$stage])) $stepGroups[$stage] = array();?>
  58. <?php foreach($stepGroups[$stage] as $step):?>
  59. <div class='board board-step board-step-<?php echo $step->status ?>' data-id='<?php echo $step->id?>' id='step-<?php echo $step->id?>'>
  60. <div class='board-title'>
  61. <?php echo html::a($this->createLink('deploy', 'viewStep', "id=$step->id", '', true), substr($step->begin, 11, 5) . ' ~ ' . substr($step->end, 11, 5) . ' ' . $step->title, '', 'class="kanbanFrame" title="' . $step->title . '" data-toggle="modal"');?>
  62. <div class='board-actions'>
  63. <?php if($step->content):?>
  64. <button type="button" class="btn btn-mini btn-link btn-info-toggle"><i class="icon-angle-down"></i></button>
  65. <?php endif;?>
  66. <div class='dropdown'>
  67. <button type='button' class='btn btn-mini btn-link dropdown-toggle' data-toggle='dropdown'>
  68. <span class='icon-ellipsis-v'></span>
  69. </button>
  70. <div class='dropdown-menu pull-right'>
  71. <?php
  72. echo (common::hasPriv('deploy', 'finishStep', $step) and $step->status != 'done') ? html::a($this->createLink('deploy', 'finishStep', "stepID=$step->id", '', true), $lang->deploy->finish, '', "class='kanbanFrame' data-toggle='modal'") : '';
  73. echo (common::hasPriv('deploy', 'assignTo', $step)) ? html::a($this->createLink('deploy', 'assignTo', "stepID=$step->id", '', true), $lang->deploy->assignTo, '', "class='kanbanFrame'") : '';
  74. echo (common::hasPriv('deploy', 'editStep', $step)) ? html::a($this->createLink('deploy', 'editStep', "stepID=$step->id", '', true), $lang->deploy->edit, '', "class='iframe' data-width='1080'") : '';
  75. echo (common::hasPriv('deploy', 'deleteStep', $step)) ? html::a($this->createLink('deploy', 'deleteStep', "stepID=$step->id"), $lang->deploy->delete, 'hiddenwin') : '';
  76. ?>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. <div class='board-body content'><?php echo $step->content?></div>
  82. <div class='board-footer clearfix'>
  83. <span class="step-assignedTo" title='<?php echo $lang->deploy->assignedTo?>'>
  84. <?php echo (common::hasPriv('deploy', 'assignTo', $step)) ? html::a($this->createLink('deploy', 'assignTo', "stepID=$step->id", '', true), "<i class='icon icon-hand-right'></i>", '', "class='kanbanFrame'") : "<i class='icon icon-hand-right'></i>";?>
  85. <small> <?php echo zget($users, $step->assignedTo, $step->assignedTo);?></small>
  86. </span>
  87. <div class='pull-right'>
  88. <?php if($step->status != 'done'):?>
  89. <span class='step-status' title='<?php echo $lang->deploy->finish?>'>
  90. <?php echo (common::hasPriv('deploy', 'finishStep', $step)) ? html::a($this->createLink('deploy', 'finishStep', "stepID=$step->id", '', true), "<i class='icon icon-ok-sign'></i> " . $lang->deploy->finish, '', "class='kanbanFrame'") : '';?>
  91. </span>
  92. <?php endif;?>
  93. <?php if($step->status == 'done'):?>
  94. <span class='step-status' title='<?php echo $lang->deploy->status?>'>
  95. <i class='icon icon-info'></i> <?php echo zget($lang->deploy->statusList, $step->status);?>
  96. </span>
  97. <?php endif;?>
  98. </div>
  99. </div>
  100. </div>
  101. <?php endforeach;?>
  102. <?php if($stage == 'testing' and !empty($stepGroups['cases'])):?>
  103. <?php foreach($stepGroups['cases'] as $case):?>
  104. <div class='board board-step board-step-<?php echo $stage ?>' data-id='<?php echo $case->id?>' id='case-<?php echo $case->id?>'>
  105. <div class='board-title'>
  106. <?php
  107. echo html::a($this->createLink('testcase', 'view', "id=$case->id", '', true), $case->title, '', 'class="kanbanFrame" title="' . $case->title . '"');
  108. ?>
  109. <div class='board-actions'>
  110. <?php echo (common::hasPriv('testtask', 'runDeployCase')) ? html::a($this->createLink('testtask', 'runDeployCase', "deployID={$deploy->id}&caseID=$case->id&version=$case->version", '', true), $lang->testtask->runCase, '', "class='kanbanFrame'") : '';?>
  111. </div>
  112. </div>
  113. <?php $result = zget($results, $case->id, '');?>
  114. <?php if($result):?>
  115. <div class='board-footer clearfix'>
  116. <span class="case-lastRunner" title='<?php echo $lang->testcase->lastRunner?>'>
  117. <i class='icon icon-user'></i>
  118. <small> <?php echo zget($users, $result->lastRunner);?></small>
  119. </span>
  120. <div class='pull-right'>
  121. <span class='step-result' title='<?php echo $lang->testcase->lastRunResult?>'>
  122. <?php $hasResultsPriv = common::hasPriv('testtask', 'deployCaseResults', $case);?>
  123. <?php if($hasResultsPriv):?>
  124. <a href='<?php echo $this->createLink('testtask', 'deployCaseResults', "deployID={$deploy->id}&caseID=$case->id&version=$case->version", '', true)?>' class='iframe' data-width='80%'>
  125. <?php endif;?>
  126. <i class='icon icon-stack'></i> <?php echo zget($lang->testcase->resultList, $result->caseResult);?>
  127. <?php if($hasResultsPriv):?>
  128. </a>
  129. <?php endif;?>
  130. </span>
  131. </div>
  132. </div>
  133. <?php endif;?>
  134. </div>
  135. <?php endforeach;?>
  136. <?php endif;?>
  137. </td>
  138. <?php endforeach;?>
  139. </tr>
  140. </tbody>
  141. </table>
  142. <?php endif;?>
  143. </div>
  144. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>