browse.html.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <?php
  2. /**
  3. * The browse view of issue 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 Congzhi Chen <congzhi@cnezsoft.com>
  8. * @package issue
  9. * @version $Id$
  10. * @link http://www.zentao.net
  11. */
  12. ?>
  13. <?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
  14. <?php $hasIssuelib = helper::hasFeature('issuelib');?>
  15. <?php $canBatchImportToLib = (common::hasPriv('issue', 'batchImportToLib') and $hasIssuelib);?>
  16. <?php $canImportFromLib = (common::hasPriv('issue', 'importFromLib') and $hasIssuelib);?>
  17. <style>
  18. .c-actions-8 {width:220px !important; text-align: center;}
  19. </style>
  20. <div id="mainMenu" class="clearfix">
  21. <div class="btn-toolbar pull-left">
  22. <?php
  23. foreach($lang->issue->featureBar['browse'] as $label => $labelName)
  24. {
  25. $active = $browseType == $label ? 'btn-active-text' : '';
  26. echo html::a($this->createLink('issue', 'browse', "projectID=$projectID&from=$from&browseType=" . $label), '<span class="text">' . $labelName . '</span> ' . ($browseType == $label ? "<span class='label label-light label-badge'>{$pager->recTotal}</span>" : ''), '', "class='btn btn-link $active' data-app='{$app->tab}'");
  27. }
  28. ?>
  29. <a class="btn btn-link querybox-toggle" id='bysearchTab'><i class="icon icon-search muted"></i> <?php echo $lang->issue->search;?></a>
  30. </div>
  31. <div class="btn-toolbar pull-right">
  32. <div class='btn-group'>
  33. <button class="btn btn-link" data-toggle="dropdown"><i class="icon icon-export muted"></i> <span class="text"><?php echo $lang->export ?></span> <span class="caret"></span></button>
  34. <ul class='dropdown-menu pull-right' id='exportActionMenu'>
  35. <?php
  36. $class = common::hasPriv('issue', 'export') ? "" : "class='disabled'";
  37. $misc = common::hasPriv('issue', 'export') ? "class='export'" : "class='disabled'";
  38. $link = common::hasPriv('issue', 'export') ? $this->createLink('issue', 'export', "objectID={$projectID}&from={$from}&browseType={$browseType}&orderBy={$orderBy}") : '#';
  39. echo "<li $class>" . html::a($link, $lang->issue->export, '', $misc) . "</li>";
  40. ?>
  41. </ul>
  42. </div>
  43. <div class='btn-group'>
  44. <button class="btn btn-link" data-toggle="dropdown"><i class="icon icon-import muted"></i> <span class="text"><?php echo $lang->import;?></span> <span class="caret"></span></button>
  45. <ul class='dropdown-menu pull-right' id='importActionMenu'>
  46. <?php
  47. $class = $canImportFromLib ? '' : "class=disabled";
  48. $misc = $canImportFromLib ? "data-app='{$app->tab}'" : "class=disabled";
  49. $link = $canImportFromLib ? $this->createLink('issue', 'importFromLib', "projectID=$projectID&from=$from") : '#';
  50. echo "<li $class>" . html::a($link, $lang->issue->importFromLib, '', $misc) . "</li>";
  51. ?>
  52. </ul>
  53. </div>
  54. <?php if(common::hasPriv('issue', 'create') and common::hasPriv('issue', 'batchCreate')):?>
  55. <div class='btn-group dropdown'>
  56. <?php
  57. $actionLink = $this->createLink('issue', 'create', "projectID=$projectID&from=$from");
  58. echo html::a($actionLink, "<i class='icon icon-plus'></i> {$lang->issue->create}", '', "class='btn btn-primary'");
  59. ?>
  60. <button type='button' class='btn btn-primary dropdown-toggle' data-toggle='dropdown'><span class='caret'></span></button>
  61. <ul class='dropdown-menu pull-right'>
  62. <li><?php echo html::a($actionLink, $lang->issue->create);?></li>
  63. <li><?php echo html::a($this->createLink('issue', 'batchCreate', "projectID=$projectID&from=$from"), $lang->issue->batchCreate);?></li>
  64. </ul>
  65. </div>
  66. <?php else:?>
  67. <?php common::printLink('issue', 'batchCreate', "projectID=$projectID&from=$from", "<i class='icon icon-plus'></i>" . $lang->issue->batchCreate, '', "class='btn btn-secondary'");?>
  68. <?php common::printLink('issue', 'create', "projectID=$projectID&from=$from", "<i class='icon icon-plus'></i>" . $lang->issue->create, '', "class='btn btn-primary'");?>
  69. <?php endif;?>
  70. </div>
  71. </div>
  72. <div id="mainContent" class="main-row">
  73. <div class="main-col">
  74. <div class="cell<?php if($browseType == 'bysearch') echo ' show';?>" id="queryBox" data-url="<?php echo $this->createLink('search', 'buildOldForm', 'module=issue');?>" data-module="issue"></div>
  75. <?php if($issueList):?>
  76. <form class="main-table table-issue" data-ride="table" method="post" id="issueForm">
  77. <table id="issueList" class="table has-sort-head" id="issueTable">
  78. <thead>
  79. <tr>
  80. <?php $vars = "projectID=$projectID&from=$from&browseType=$browseType&param=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";?>
  81. <th class="c-id w-90px">
  82. <?php
  83. if($canBatchImportToLib) echo "<div class='checkbox-primary check-all' title='{$this->lang->selectAll}'><label></label></div>";
  84. echo common::printOrderLink('id', $orderBy, $vars, $lang->idAB);
  85. ?>
  86. </th>
  87. <th class="w-auto"><?php common::printOrderLink('title', $orderBy, $vars, $lang->issue->title);?></th>
  88. <th class="w-70px text-center" title='<?php echo $lang->issue->pri;?>'><?php common::printOrderLink('pri', $orderBy, $vars, $lang->issue->priAB);?></th>
  89. <th class="w-80px"><?php common::printOrderLink('severity', $orderBy, $vars, $lang->issue->severity);?></th>
  90. <th class="w-80px"><?php common::printOrderLink('type', $orderBy, $vars, $lang->issue->type);?></th>
  91. <th class="w-100px"><?php common::printOrderLink('owner', $orderBy, $vars, $lang->issue->owner);?></th>
  92. <th class="w-140px"><?php common::printOrderLink('createdDate', $orderBy, $vars, $lang->issue->createdDate);?></th>
  93. <?php if($browseType == 'assignto'):?>
  94. <th class="w-100px"><?php common::printOrderLink('assignedBy', $orderBy, $vars, $lang->issue->assignedBy);?></th>
  95. <?php else:?>
  96. <th class="w-100px text-center"><?php common::printOrderLink('assignedTo', $orderBy, $vars, $lang->issue->assignedTo);?></th>
  97. <?php endif;?>
  98. <th class="w-80px"><?php common::printOrderLink('status', $orderBy, $vars, $lang->issue->status);?></th>
  99. <th class="c-actions-8"><?php echo $lang->actions;?></th>
  100. </tr>
  101. </thead>
  102. <tbody>
  103. <?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')));?>
  104. <?php foreach($issueList as $id => $issue):?>
  105. <tr>
  106. <td class="c-id">
  107. <?php echo $canBatchImportToLib ? html::checkbox('issueIDList', array($issue->id => '')) . sprintf('%03d',$issue->id) : sprintf('%03d',$issue->id);?>
  108. </td>
  109. <td class="text-ellipsis" title="<?php echo $issue->title;?>">
  110. <?php
  111. if(commonModel::hasPriv('issue', 'view'))
  112. {
  113. echo html::a(helper::createLink('issue', 'view', "id=$issue->id&from=$from"), $issue->title);
  114. }
  115. else
  116. {
  117. echo $issue->title;
  118. }
  119. ?>
  120. </td>
  121. <td class='text-center' title="<?php echo zget($lang->issue->priList, $issue->pri, '');?>"><span class="label-pri label-pri-<?php echo $issue->pri?>"><?php echo zget($lang->issue->priList, $issue->pri, '');?></span></td>
  122. <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>
  123. <td title="<?php echo zget($lang->issue->typeList, $issue->type, '');?>"><?php echo zget($lang->issue->typeList, $issue->type);?></td>
  124. <td title="<?php echo zget($users, $issue->owner);?>"><?php echo zget($users, $issue->owner);?></td>
  125. <td title="<?php echo substr($issue->createdDate, 0, 10);?>"><?php echo substr($issue->createdDate, 0, 10);?></td>
  126. <?php
  127. $assignedClass = '';
  128. if($issue->assignedTo == $app->user->account) $assignedClass = 'assigned-current';
  129. if(!empty($issue->assignedTo) and $issue->assignedTo != $app->user->account) $assignedClass = 'assigned-other';
  130. ?>
  131. <?php if($browseType == 'assignto'):?>
  132. <td title="<?php echo zget($users, $issue->assignedBy);?>"><?php echo zget($users, $issue->assignedBy);?></td>
  133. <?php else:?>
  134. <td class="c-assignedTo <?php echo $assignedClass;?>">
  135. <?php echo $this->issue->printAssignedHtml($issue, $users);?>
  136. </td>
  137. <?php endif;?>
  138. <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>
  139. <td class="c-actions">
  140. <?php
  141. $params = "issueID=$issue->id";
  142. echo common::printIcon('issue', 'confirm', $params, $issue, 'list', 'ok', '', 'iframe', true, '', $lang->issue->confirm);
  143. echo common::printIcon('issue', 'resolve', $params . "&from=$from", $issue, 'list', 'checked', '', 'iframe', true, '', $lang->issue->resolve);
  144. echo common::printIcon('issue', 'close', $params, $issue, 'list', 'off', '', 'iframe', true);
  145. echo common::printIcon('issue', 'cancel', $params, $issue, 'list', 'ban-circle', '', 'iframe', true);
  146. if($showDividing) echo '<div class="dividing-line"></div>';
  147. echo common::printIcon('issue', 'activate', $params . "&from=$from", $issue, 'list', 'magic', '', 'iframe', true, '', $lang->issue->activate);
  148. echo common::printIcon('effort', 'createForObject', "objectType=issue&objectID=$issue->id", '', 'list', 'time', '', 'iframe', true, '', $lang->issue->effort);
  149. echo common::printIcon('issue', 'edit', $params . "&from=$from", $issue, 'list', 'edit');
  150. ?>
  151. </td>
  152. </tr>
  153. <?php endforeach;?>
  154. </tbody>
  155. </table>
  156. <?php if($issueList):?>
  157. <div class='table-footer'>
  158. <?php if($canBatchImportToLib):?>
  159. <div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
  160. <div class="table-actions btn-toolbar">
  161. <?php echo html::a('#batchImportToLib', $lang->issue->importToLib, '', 'class="btn" data-toggle="modal" id="importToLib"');?>
  162. <div class="table-statistic"></div>
  163. </div>
  164. <?php endif;?>
  165. <?php $pager->show('right', 'pagerjs');?>
  166. </div>
  167. <?php endif;?>
  168. </form>
  169. <?php else:?>
  170. <div class="table-empty-tip">
  171. <p>
  172. <span class="text-muted"><?php echo $lang->noData;?></span>
  173. <?php if(common::hasPriv('issue', 'create')):?>
  174. <?php echo html::a($this->createLink('issue', 'create', "projectID=$projectID&from=$from"), '<i class="icon icon-plus"></i> ' . $lang->issue->create, '', "class='btn btn-info' data-app='{$app->tab}'")?>
  175. <?php endif;?>
  176. </p>
  177. </div>
  178. <?php endif;?>
  179. </div>
  180. </div>
  181. <div class="modal fade" id="batchImportToLib">
  182. <div class="modal-dialog mw-500px">
  183. <div class="modal-content">
  184. <div class="modal-header">
  185. <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="icon icon-close"></i></button>
  186. <h4 class="modal-title"><?php echo $lang->issue->importToLib;?></h4>
  187. </div>
  188. <div class="modal-body">
  189. <form method='post' class='form-ajax' action='<?php echo $this->createLink('issue', 'batchImportToLib');?>'>
  190. <table class='table table-form'>
  191. <tr>
  192. <th><?php echo $lang->issue->lib;?></th>
  193. <td>
  194. <?php echo html::select('lib', $libs, '', "class='form-control chosen' required");?>
  195. </td>
  196. </tr>
  197. <?php if(!common::hasPriv('assetlib', 'approveIssue') and !common::hasPriv('assetlib', 'batchApproveIssue')):?>
  198. <tr>
  199. <th><?php echo $lang->issue->approver;?></th>
  200. <td>
  201. <?php echo html::select('assignedTo', $approvers, '', "class='form-control chosen'");?>
  202. </td>
  203. </tr>
  204. <?php endif;?>
  205. <tr>
  206. <td colspan='2' class='text-center'>
  207. <?php echo html::hidden('issueIDList', '');?>
  208. <?php echo html::submitButton($lang->import, '', 'btn btn-primary');?>
  209. </td>
  210. </tr>
  211. </table>
  212. </form>
  213. </div>
  214. </div>
  215. </div>
  216. </div>
  217. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>