browse.html.php 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <?php
  2. /**
  3. * The browse of gapanalysis module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2021 禅道软件(青岛)有限公司(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 Fangzhou <hufangzhou@easycorp.ltd>
  8. * @package gapanalysis
  9. * @version $Id: browse.html.php 4903 2021-05-28 13:55:59Z hfz $
  10. * @link https://www.zentao.net
  11. */
  12. ?>
  13. <?php include $app->getModuleRoot() . "common/view/header.html.php"?>
  14. <div id="mainMenu" class="clearfix">
  15. <div class="btn-toobar pull-left">
  16. <?php
  17. $menus = customModel::getFeatureMenu($this->moduleName, $this->methodName);
  18. foreach($menus as $menuItem)
  19. {
  20. $active = $menuItem->name == $browseType ? ' btn-active-text' : '';
  21. echo html::a($this->createLink('gapanalysis', 'browse', "projectID=$projectID&browseType=$menuItem->name"), "<span class='text'>{$menuItem->text}</span>", '', "class='btn btn-link $active'");
  22. }
  23. ?>
  24. <a class="btn btn-link querybox-toggle" id='bysearchTab'><i class="icon icon-search muted"></i> <?php echo $lang->gapanalysis->byQuery;?></a>
  25. </div>
  26. <div class="btn-toolbar pull-right">
  27. <div class='btn-group dropdown'>
  28. <?php
  29. $createGapanalysisLink = $this->createLink('gapanalysis', 'create', "projectID=$projectID");
  30. $batchCreateLink = $this->createLink('gapanalysis', 'batchCreate', "project=$projectID");
  31. $buttonLink = '';
  32. $buttonTitle = '';
  33. $canModify = common::canModify('project', $project);
  34. if($canModify && common::hasPriv('gapanalysis', 'batchCreate'))
  35. {
  36. $buttonLink = $batchCreateLink;
  37. $buttonTitle = $lang->gapanalysis->batchCreate;
  38. }
  39. if($canModify && common::hasPriv('gapanalysis', 'create'))
  40. {
  41. $buttonLink = $createGapanalysisLink;
  42. $buttonTitle = $lang->gapanalysis->create;
  43. }
  44. $hidden = empty($buttonLink) ? 'hidden' : '';
  45. echo html::a($buttonLink, "<i class='icon icon-plus'></i> $buttonTitle", '', "class='btn btn-primary $hidden'");
  46. ?>
  47. <?php if($canModify && common::hasPriv('gapanalysis', 'batchCreate') and common::hasPriv('gapanalysis', 'create')): ?>
  48. <button type='button' class="btn btn-primary dropdown-toggle" data-toggle='dropdown'><span class='caret'></span></button>
  49. <ul class='dropdown-menu pull-right'>
  50. <li><?php echo html::a($createGapanalysisLink, $lang->gapanalysis->create);?></li>
  51. <li><?php echo html::a($batchCreateLink, $lang->gapanalysis->batchCreate);?></li>
  52. </ul>
  53. <?php endif;?>
  54. </div>
  55. </div>
  56. </div>
  57. <div class="cell<?php if($browseType == 'bysearch') echo ' show';?>" id="queryBox" data-url="<?php echo $this->createLink('search', 'buildOldForm', 'module=gapanalysis');?>" data-module='gapanalysis'></div>
  58. <div id="mainContent" class="main-table">
  59. <?php if(empty($gapanalysises)):?>
  60. <div class="table-empty-tip">
  61. <p>
  62. <span class="text-muted"><?php echo $lang->noData;?></span>
  63. <?php if($canModify && common::hasPriv('gapanalysis', 'create')):?>
  64. <?php echo html::a($this->createLink('gapanalysis', 'create', "projectID=$projectID"), "<i class='icon icon-plus'></i> " . $lang->gapanalysis->create, '', "class='btn btn-info'");?>
  65. <?php endif;?>
  66. </p>
  67. </div>
  68. <?php else:?>
  69. <form class='main-table' id='gapanalysisForm' method='post' data-ride="table">
  70. <table class="table has-sort-head" id='gapanalysisList'>
  71. <?php
  72. $vars = "projectID=$projectID&browseType=$browseType&param=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";
  73. $canBatchEdit = common::hasPriv('gapanalysis', 'batchEdit');
  74. ?>
  75. <thead>
  76. <tr>
  77. <th class='text-left w-120px'>
  78. <?php
  79. if($canBatchEdit) echo "<div class='checkbox-primary check-all' title='{$this->lang->selectAll}'><label></label></div>";
  80. common::printOrderLink('id', $orderBy, $vars, $lang->gapanalysis->id);
  81. ?>
  82. </th>
  83. <th class='text-left'><?php common::printOrderLink('account', $orderBy, $vars, $lang->gapanalysis->account);?></th>
  84. <th class='c-role'><?php common::printOrderLink('role', $orderBy, $vars, $lang->gapanalysis->role);?></th>
  85. <th class='c-needTrain'><?php common::printOrderLink('needTrain', $orderBy, $vars, $lang->gapanalysis->needTrain);?></th>
  86. <th class='c-actions-1'><?php echo $lang->actions;?></th>
  87. </tr>
  88. </thead>
  89. <tbody>
  90. <?php foreach($gapanalysises as $gapanalysisID => $gapanalysis):?>
  91. <tr>
  92. <?php $viewLink = $this->createLink('gapanalysis', 'view', "gapanalysisID=$gapanalysis->id");?>
  93. <td>
  94. <?php
  95. if($canBatchEdit)
  96. {
  97. echo html::checkbox('gapanalysisIDList', array($gapanalysis->id => '')) . html::a($viewLink, sprintf('%03d', $gapanalysis->id));
  98. }
  99. else
  100. {
  101. echo html::a($viewLink, sprintf('%03d', $gapanalysis->id));
  102. }
  103. ?>
  104. </td>
  105. <td><?php echo html::a($viewLink, zget($users, $gapanalysis->account));?></td>
  106. <td class="c-name" title="<?php echo $gapanalysis->role?>"><?php echo $gapanalysis->role?></td>
  107. <td><?php echo zget($lang->gapanalysis->needTrainList, $gapanalysis->needTrain);?></td>
  108. <td class='c-actions'><?php common::printIcon('gapanalysis', 'edit', "gapanalysisID=$gapanalysis->id", $gapanalysis, "list");?></td>
  109. </tr>
  110. <?php endforeach;?>
  111. </tbody>
  112. </table>
  113. <div class='table-footer'>
  114. <?php if($canBatchEdit):?>
  115. <div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
  116. <?php endif;?>
  117. <div class="table-actions btn-toolbar">
  118. <?php
  119. $batchEditActionLink = $this->createLink('gapanalysis', 'batchEdit', "projectID=$projectID");
  120. $batchEditDisabled = $canBatchEdit ? '' : "disabled='disabled'";
  121. echo html::commonButton($lang->edit, "data-form-action='$batchEditActionLink' $batchEditDisabled");
  122. ?>
  123. </div>
  124. <?php $pager->show('right', 'pagerjs');?>
  125. </div>
  126. </form>
  127. <?php endif;?>
  128. </div>
  129. <?php include $app->getModuleRoot() . "common/view/footer.html.php"?>