issue.html.php 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?php
  2. /**
  3. * The issue view file of my 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 Chunsheng Wang <chunsheng@cnezsoft.com>
  8. * @package my
  9. * @version $Id
  10. * @link http://www.zentao.net
  11. */
  12. ?>
  13. <?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
  14. <?php js::set('mode', $mode);?>
  15. <?php js::set('total', $pager->recTotal);?>
  16. <?php js::set('rawMethod', $app->rawMethod);?>
  17. <?php js::set('mode', $mode);?>
  18. <?php js::set('todoCount', $todoCount);?>
  19. <?php js::set('isMax', $isMax);?>
  20. <?php js::set('isBiz', $isBiz);?>
  21. <?php js::set('isOpenedURAndSR', $isOpenedURAndSR);?>
  22. <style>
  23. .c-id {width: 50px;}
  24. .c-type, .c-owner, .c-severity {width: 80px;}
  25. .c-createdDate{width: 100px;}
  26. .c-assignedTo {padding-left: 29px !important;}
  27. .c-actions-8 {width: 240px !important;}
  28. </style>
  29. <div id="mainMenu" class="clearfix">
  30. <div class="btn-toolbar pull-left">
  31. <?php
  32. foreach($lang->my->featureBar[$app->rawMethod] as $key => $name)
  33. {
  34. $label = "<span class='text'>{$name}</span>";
  35. $label .= $key == $type ? " <span class='label label-light label-badge'>{$pager->recTotal}</span>" : '';
  36. $active = $key == $type ? 'btn-active-text' : '';
  37. echo html::a(inlink($app->rawMethod, "mode=$mode&type=$key"), $label, '', "class='btn btn-link $active'");
  38. }
  39. ?>
  40. <a class="btn btn-link querybox-toggle" id='bysearchTab'><i class="icon icon-search muted"></i> <?php echo $lang->user->search;?></a>
  41. </div>
  42. </div>
  43. <div id="mainContent">
  44. <div class="cell<?php if($type == 'bySearch') echo ' show';?>" id="queryBox" data-url="<?php echo $this->createLink('search', 'buildOldForm', 'module=issue');?>" data-module='issue'></div>
  45. <?php if(empty($issues)):?>
  46. <div class="table-empty-tip">
  47. <p><span class="text-muted"><?php echo $lang->noData;?></span></p>
  48. </div>
  49. <?php else:?>
  50. <form id='myTaskForm' class="main-table table-issue" data-ride="table" method="post">
  51. <table class="table has-sort-head table-fixed" id='issuetable'>
  52. <?php $vars = "mode=$mode&type=$type&param=$param&orderBy=%s&recTotal=$pager->recTotal&recPerPage=$pager->recPerPage&pageID=$pager->pageID"; ?>
  53. <thead>
  54. <tr>
  55. <th class="c-id"><?php echo common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
  56. <th class="c-name"><?php echo common::printOrderLink('title', $orderBy, $vars, $lang->issue->title);?></th>
  57. <th><?php echo common::printOrderLink('project', $orderBy, $vars, $lang->issue->project);?></th>
  58. <th class="c-pri text-center"><?php echo common::printOrderLink('pri', $orderBy, $vars, $lang->issue->priAB);?></th>
  59. <th class="c-severity"><?php echo common::printOrderLink('severity', $orderBy, $vars, $lang->issue->severity);?></th>
  60. <th class="c-type"><?php echo common::printOrderLink('type', $orderBy, $vars, $lang->issue->type);?></th>
  61. <th class="c-owner"><?php echo common::printOrderLink('owner', $orderBy, $vars, $lang->issue->owner);?></th>
  62. <th class="c-createdDate"><?php echo common::printOrderLink('createdDate', $orderBy, $vars, $lang->issue->createdDate);?></th>
  63. <?php if($type == 'assignedTo'):?>
  64. <th class="c-assignedTo"><?php echo common::printOrderLink('assignedBy', $orderBy, $vars, $lang->issue->assignedBy);?></th>
  65. <?php else:?>
  66. <th class="c-assignedTo text-center"><?php echo common::printOrderLink('assignedTo', $orderBy, $vars, $lang->issue->assignedTo);?></th>
  67. <?php endif;?>
  68. <th class="c-status"><?php echo common::printOrderLink('status', $orderBy, $vars, $lang->issue->status);?></th>
  69. <th class="c-actions-8 text-center"><?php echo $lang->actions;?></th>
  70. </tr>
  71. </thead>
  72. <tbody>
  73. <?php $showDividing = ((common::hasPriv('issue', 'confirm') or common::hasPriv('issue', 'resolve') or common::hasPriv('issue', 'close') or common::hasPriv('issue', 'cancel')) and (common::hasPriv('issue', 'activate') or common::hasPriv('effort', 'createForObject') or common::hasPriv('issue', 'edit')));?>
  74. <?php foreach($issues as $issue):?>
  75. <tr>
  76. <td class="c-id"><?php printf('%03d', $issue->id);?></td>
  77. <td class="text-ellipsis" title="<?php echo $issue->title;?>"><?php echo html::a($this->createLink('issue', 'view', "id=$issue->id", '', '', $issue->project), $issue->title, '', "data-group='project'");?></td>
  78. <td title="<?php echo zget($projectList, $issue->project, '');?>"><?php echo zget($projectList, $issue->project, '');?></td>
  79. <td class="c-pri text-center" title="<?php echo $issue->pri;?>"><span class='label-pri <?php echo 'label-pri-' . $issue->pri;?>'><?php echo $issue->pri;?></span></td>
  80. <td class='severity-issue severity-<?php echo $issue->severity;?>' title="<?php echo zget($lang->issue->severityList, $issue->severity);?>"><?php echo zget($lang->issue->severityList, $issue->severity);?></td>
  81. <td title="<?php echo zget($lang->issue->typeList, $issue->type);?>"><?php echo zget($lang->issue->typeList, $issue->type);?></td>
  82. <td title="<?php echo zget($users, $issue->owner);?>"><?php echo zget($users, $issue->owner);?></td>
  83. <?php $issue->createdDate = substr($issue->createdDate, 0, 10)?>
  84. <td title="<?php echo $issue->createdDate;?>"><?php echo $issue->createdDate;?></td>
  85. <?php
  86. $assignedClass = '';
  87. if($issue->assignedTo == $app->user->account) $assignedClass = 'assigned-current';
  88. if(!empty($issue->assignedTo) and $issue->assignedTo != $app->user->account) $assignedClass = 'assigned-other';
  89. ?>
  90. <?php if($type == 'assignedTo'):?>
  91. <td title="<?php echo zget($users, $issue->assignedBy);?>" class="c-assignedTo"><?php echo zget($users, $issue->assignedBy);?></td>
  92. <?php else:?>
  93. <td class="c-assignedTo <?php echo $assignedClass;?>"><?php echo $this->issue->printAssignedHtml($issue, $users);?></td>
  94. <?php endif;?>
  95. <td class='status-issue status-<?php echo $issue->status;?>' title="<?php echo zget($lang->issue->statusList, $issue->status);?>"><?php echo zget($lang->issue->statusList, $issue->status);?></td>
  96. <td class="c-actions">
  97. <?php
  98. $params = "issueID=$issue->id";
  99. echo common::printIcon('issue', 'confirm', $params, $issue, 'list', 'ok', '', 'iframe', 'yes', '', $lang->issue->confirm);
  100. echo common::printIcon('issue', 'resolve', $params, $issue, 'list', 'checked', '', 'iframe', 'yes', '', $lang->issue->resolve);
  101. echo common::printIcon('issue', 'close', $params, $issue, 'list', 'off', '', 'iframe', 'yes');
  102. echo common::printIcon('issue', 'cancel', $params, $issue, 'list', 'ban-circle', '', 'iframe', 'yes');
  103. echo common::printIcon('issue', 'activate', $params, $issue, 'list', 'magic', '', 'iframe', 'yes', '', $lang->issue->activate);
  104. if($showDividing) echo '<div class="dividing-line"></div>';
  105. echo common::printIcon('effort', 'createForObject', "objectType=issue&objectID=$issue->id", '', 'list', 'time', '', 'iframe', true, '', $lang->issue->effort);
  106. echo common::printIcon('issue', 'edit', $params, $issue, 'list', 'edit', '', 'iframe', 'yes');
  107. $deleteClass = common::hasPriv('issue', 'delete') ? 'btn' : 'btn disabled';
  108. echo html::a($this->createLink('issue', 'delete', $params), '<i class="icon-trash"></i>', 'hiddenwin', "title='{$lang->issue->delete}' class='$deleteClass'");
  109. ?>
  110. </td>
  111. </tr>
  112. <?php endforeach;?>
  113. </tbody>
  114. </table>
  115. <div class="table-footer">
  116. <?php $pager->show('right', 'pagerjs');?>
  117. </div>
  118. </form>
  119. <?php endif;?>
  120. </div>
  121. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>