reviewblock.html.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <?php
  2. /**
  3. * The task block view file of block module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(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 block
  9. * @version $Id$
  10. * @link https://www.zentao.net
  11. */
  12. ?>
  13. <?php if(empty($reviews)): ?>
  14. <div class='empty-tip'><?php echo $lang->block->emptyTip;?></div>
  15. <?php else:?>
  16. <div class='panel-body has-table scrollbar-hover'>
  17. <table class='table table-borderless table-hover table-fixed table-fixed-head tablesorter block-tasks <?php if(!$longBlock) echo 'block-sm';?>'>
  18. <thead class='text-center'>
  19. <tr>
  20. <th class='c-id'> <?php print($lang->idAB);?></th>
  21. <th class='c-title text-left'><?php print($lang->my->auditField->title);?></th>
  22. <th class='c-type w-120px'> <?php print($lang->my->auditField->type);?></th>
  23. <th class='c-date w-150px'> <?php print($lang->my->auditField->time);?></th>
  24. <th class='c-status w-110px'> <?php print($lang->my->auditField->status);?></th>
  25. <th class='c-actions-1'><?php print($lang->actions)?></th>
  26. </tr>
  27. </thead>
  28. <tbody class='text-center'>
  29. <?php foreach($reviews as $review):?>
  30. <?php
  31. $type = $review->type;
  32. if($type == 'projectreview') $type = 'review';
  33. $typeName = '';
  34. if(isset($lang->{$review->type}->common)) $typeName = $lang->{$review->type}->common;
  35. if($type == 'story') $typeName = $lang->SRCommon;
  36. if($review->type == 'projectreview') $typeName = $lang->project->common;
  37. if(isset($flows[$review->type])) $typeName = $flows[$review->type];
  38. $statusList = array();
  39. if(isset($lang->$type->statusList)) $statusList = $lang->$type->statusList;
  40. if($type == 'attend') $statusList = $lang->attend->reviewStatusList;
  41. if(!in_array($type, array('story', 'testcase', 'feedback', 'review')) and strpos(",{$config->my->oaObjectType},", ",$type,") === false)
  42. {
  43. $statusList = $lang->approval->nodeList;
  44. }
  45. ?>
  46. <tr>
  47. <td class='c-id'><?php echo $review->id?></td>
  48. <td class='c-title text-left' title='<?php echo $review->title?>'>
  49. <?php
  50. $titleHtml = $review->title;
  51. if($type == 'attend')
  52. {
  53. $titleHtml = html::a($this->createLink($type, 'review', "objectID=$review->id", 'html', true), $review->title, '', "data-toggle='modal'");
  54. }
  55. else
  56. {
  57. $class = "class='iframe' data-width='90%'";
  58. if(strpos(",{$config->my->oaObjectType},", ",{$type},") !== false) $class = "data-toggle='modal'";
  59. $titleHtml = html::a($this->createLink($type, 'view', "objectID=$review->id", 'html', true), $review->title, '', $class);
  60. }
  61. echo $titleHtml;
  62. ?>
  63. </td>
  64. <td class='c-type'><?php echo $typeName;?></td>
  65. <td class='c-time text-left'><?php echo $review->time?></td>
  66. <td class='c-status'><?php echo zget($statusList, $review->status, '')?></td>
  67. <td class='c-actions text-left'>
  68. <?php
  69. $module = $type;
  70. $method = 'review';
  71. $params = "id=$review->id";
  72. $reviewIcon = '<i class="icon-glasses"></i>';
  73. $passIcon = '<i class="icon-check"></i>';
  74. $rejectIcon = '<i class="icon-close"></i>';
  75. if($module == 'review')
  76. {
  77. $method = 'assess';
  78. $params = "reviewID=$review->id";
  79. common::printLink($module, $method, $params, $reviewIcon, '', "class='btn' title='{$lang->review->common}'");
  80. }
  81. elseif($module == 'attend')
  82. {
  83. common::printLink($module, 'review', "attendID={$review->id}&status=", $reviewIcon, '', "class='btn' data-toggle='modal' title='{$lang->review->common}'", true, true);
  84. }
  85. elseif(strpos(",{$config->my->oaObjectType},", ",$module,") !== false)
  86. {
  87. common::printLink($module, 'view', $params, $reviewIcon, '', "class='btn' data-toggle='modal' title='{$lang->review->common}'", true, true);
  88. }
  89. elseif(!in_array($module, array('story', 'testcase', 'feedback')))
  90. {
  91. common::printLink($module, 'approvalreview', $params, $reviewIcon, '', "class='btn' data-toggle='modal' title='{$lang->review->common}'", true, true);
  92. }
  93. else
  94. {
  95. common::printLink($module, $method, $params, $reviewIcon, '', "class='btn iframe' title='{$lang->review->common}'", true, true);
  96. }
  97. ?>
  98. </td>
  99. </tr>
  100. <?php endforeach;?>
  101. </tbody>
  102. </table>
  103. </div>
  104. <?php endif;?>