revision.html.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?php
  2. /**
  3. * The revision view file of repo module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
  6. * @author Wang Yidong, Zhu Jinyong
  7. * @package repo
  8. * @version $Id: revision.html.php $
  9. */
  10. ?>
  11. <?php
  12. session_start();
  13. $_SESSION['repoList'] = $this->app->getURI(true);
  14. session_write_close();
  15. $pathInfo = empty($path) ? '' : '&path=' . $this->repo->encodePath($path);
  16. $preDir = empty($parentDir) ? $pathInfo : '&path=' . $this->repo->encodePath($parentDir);
  17. $typeInfo = $type == 'file' ? '&type=file' : '';
  18. ?>
  19. <?php include '../../common/view/header.html.php';?>
  20. <div id='mainMenu' class='clearfix'>
  21. <div class='btn-toolbar pull-left'>
  22. <?php if(!isonlybody()):?>
  23. <?php $browseLink = $app->session->revisionList != false ? $app->session->revisionList : $this->repo->createLink('browse', "repoID={$repoID}&branchID=" . helper::safe64Encode(base64_encode($branchID)) . "&objectID=$objectID{$preDir}");?>
  24. <?php echo html::a($browseLink, "<i class='icon icon-back'></i> " . $lang->goback, '', "class='btn btn-link back-btn'");?>
  25. <div class="divider"></div>
  26. <?php endif;?>
  27. <div class="page-title">
  28. <?php echo $lang->repo->revisionA . ' ' . ($repo->SCM == 'Subversion' ? $revision : $this->repo->getGitRevisionName($revision, $log->commit));?>
  29. </div>
  30. </div>
  31. </div>
  32. <div id='mainContent' class='main-row'>
  33. <div class='main-col col-8'>
  34. <div class='cell'>
  35. <div class='detail'>
  36. <div class='detail-title'>
  37. <span><?php echo $lang->repo->changes;?></span>
  38. <span class='pull-right compare-all'><?php if(common::hasPriv('repo', 'diff')) echo html::a($this->repo->createLink('diff', "repoID=$repoID&objectID=$objectID&entry=&fromRevision=$oldRevision&toRevision=$revision"), $lang->repo->diffAll, '', "data-app='{$app->tab}'");?></span>
  39. </div>
  40. <div class='detail-content'>
  41. <table class='table no-margin'>
  42. <?php foreach($changes as $path => $change):?>
  43. <tr>
  44. <td><?php echo "<span class='label label-info label-badge'>" . $change['action'] . '</span> ' . $path;?></td>
  45. <td class='w-80px text-center'><?php echo zget($change, 'view', '') . zget($change, 'diff', '');?></td>
  46. </tr>
  47. <?php endforeach;?>
  48. </table>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. <div class='side-col col-4'>
  54. <div class='cell'>
  55. <div class='detail'>
  56. <div class='detail-title'><?php echo $lang->repo->info;?></div>
  57. <div class='detail-content'>
  58. <table class='table table-data'>
  59. <tr>
  60. <th class='w-80px'><?php echo $lang->repo->committer;?></th>
  61. <td><?php echo $log->committer;?></td>
  62. </tr>
  63. <tr>
  64. <th><?php echo $lang->repo->revisionA;?></th>
  65. <td><?php echo substr($log->revision, 0, 10);?></td>
  66. </tr>
  67. <?php if($repo->SCM != 'Subversion'):?>
  68. <tr>
  69. <th><?php echo $lang->repo->commit;?></th>
  70. <td><?php echo $log->commit;?></td>
  71. </tr>
  72. <?php endif;?>
  73. <tr>
  74. <th><?php echo $lang->repo->comment;?></th>
  75. <td><?php echo $log->comment;?></td>
  76. </tr>
  77. <tr>
  78. <th><?php echo $lang->repo->time;?></th>
  79. <td><?php echo $log->time;?></td>
  80. </tr>
  81. </table>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. <?php if(!isonlybody()):?>
  88. <div id="mainActions" class='main-actions'>
  89. <nav class="container">
  90. <?php if(!empty($preAndNext->pre)) echo html::a($this->repo->createLink('revision', "repoID=$repoID&objectID=$objectID&revision={$preAndNext->pre}" . $pathInfo . $typeInfo, 'html'), "<i class='icon-pre icon-chevron-left'></i>", '', "data-app='{$app->tab}' id='prevPage' class='btn btn-info' title='{$preAndNext->pre}'");?>
  91. <?php if(!empty($preAndNext->next)) echo html::a($this->repo->createLink('revision', "repoID=$repoID&objectID=$objectID&revision={$preAndNext->next}" . $pathInfo . $typeInfo, 'html'), "<i class='icon-pre icon-chevron-right'></i>", '', "data-app='{$app->tab}' id='nextPage' class='btn btn-info' title='{$preAndNext->next}'");?>
  92. </nav>
  93. </div>
  94. <?php endif;?>
  95. <?php include '../../common/view/footer.html.php';?>