m.caseheader.html.php 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. $featureMenu = $config->global->flow == 'full' ? customModel::getFeatureMenu('testcase', 'browse') : array();
  3. if($featureMenu) $bodyClass = 'with-menu-top';
  4. ?>
  5. <?php $isProjectApp = $this->app->rawModule == 'project'?>
  6. <?php $currentModule = $isProjectApp ? 'project' : 'testcase';?>
  7. <?php $currentMethod = $isProjectApp ? 'testcase' : 'browse';?>
  8. <?php $projectParam = $isProjectApp ? "projectID={$this->session->project}&" : '';?>
  9. <?php include '../../common/view/m.header.html.php';?>
  10. <?php
  11. $hasBrowsePriv = common::hasPriv('testcase', 'browse');
  12. $hasGroupPriv = !$isProjectApp and common::hasPriv('testcase', 'groupcase');
  13. $hasZeroPriv = !$isProjectApp and common::hasPriv('story', 'zerocase');
  14. ?>
  15. <nav id='menu' class='menu nav affix dock-top canvas'>
  16. <?php foreach($featureMenu as $menuItem):?>
  17. <?php
  18. if(isset($menuItem->hidden)) continue;
  19. $menuType = $menuItem->name;
  20. if(!$config->testcase->needReview and $menuType == 'wait') continue;
  21. if($hasBrowsePriv and strpos($menuType, 'QUERY') === 0)
  22. {
  23. $queryID = (int)substr($menuType, 5);
  24. echo html::a($this->createLink($currentModule, $currentMethod, $projectParam . "productID=$productID&branch=$branch&browseType=bySearch&param=$queryID"), $menuItem->text, '', "id='{$menuType}Tab'");
  25. }
  26. elseif($hasBrowsePriv and ($menuType == 'all' or $menuType == 'needconfirm' or $menuType == 'wait'))
  27. {
  28. echo html::a($this->createLink($currentModule, $currentMethod, $projectParam . "productID=$productID&branch=$branch&browseType=$menuType"), $menuItem->text, '', "id='{$menuType}Tab'");
  29. }
  30. elseif($hasBrowsePriv and $menuType == 'suite')
  31. {
  32. $currentSuiteID = isset($suiteID) ? (int)$suiteID : 0;
  33. $currentSuite = zget($suiteList, $currentSuiteID, '');
  34. echo html::a('###', $lang->testsuite->common . "&nbsp;<span class='icon-caret-down'></span>", '', ($browseType == 'bysuite' ? "class='active'" : '') . "data-display='modal' data-target='#suiteModal' data-backdrop='true' data-placement='bottom'");
  35. }
  36. elseif($hasGroupPriv and $menuType == 'group')
  37. {
  38. $groupBy = isset($groupBy) ? $groupBy : '';
  39. echo html::a($this->createLink('testcase', 'groupCase', "productID=$productID&branch=$branch&groupBy=story"), $lang->testcase->groupByStories, '', "id='groupcaseTab'");
  40. }
  41. elseif($hasZeroPriv and $menuType == 'zerocase')
  42. {
  43. echo html::a($this->createLink('story', 'zeroCase', "productID=$productID"), $lang->story->zeroCase, '', "id='zerocaseTab'");
  44. }
  45. ?>
  46. <?php endforeach;?>
  47. <a class='moreMenu hidden' data-display='dropdown' data-placement='beside-bottom'><?php echo $lang->more;?></a>
  48. <div id='moreMenu' class='list dropdown-menu'></div>
  49. </nav>
  50. <?php
  51. if($hasBrowsePriv)
  52. {
  53. echo "<div class='list hidden affix enter-from-bottom layer' id='suiteModal'>";
  54. if(empty($suiteList))
  55. {
  56. $tipMessage = "<div class='heading'>";
  57. $tipMessage .= "<div class='title'><strong>{$lang->testcase->tips}</strong></div>";
  58. $tipMessage .= "<nav class='nav'><a data-dismiss='display'><i class='icon-remove muted'></i></a></nav>";
  59. $tipMessage .= "</div>";
  60. $tipMessage .= "<div class='content article box'>";
  61. $tipMessage .= "<p>{$lang->testcase->noSuite}</p>";
  62. $tipMessage .= "</div>";
  63. echo $tipMessage;
  64. }
  65. foreach($suiteList as $suiteID => $suite)
  66. {
  67. $suiteName = $suite->name;
  68. if($suite->type == 'public') $suiteName .= " <span class='label label-info'>{$lang->testsuite->authorList[$suite->type]}</span>";
  69. echo html::a($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch&browseType=bySuite&param=$suiteID"), $suiteName, '', "class='item " . ($suiteID == (int)$currentSuiteID ? 'active' : '') . "'");
  70. }
  71. echo '</div>';
  72. }
  73. if($hasGroupPriv)
  74. {
  75. echo "<div class='list hidden affix enter-from-bottom layer' id='groupModal'>";
  76. foreach ($lang->testcase->groups as $key => $value)
  77. {
  78. if($key == '') continue;
  79. echo html::a($this->createLink('testcase', 'groupCase', "productID=$productID&branch=$branch&groupBy=$key"), $value, '', "class='item " . ($key == $groupBy ? "active" : '') . "'");
  80. }
  81. echo '</div>';
  82. }
  83. ?>
  84. <?php
  85. $headerHooks = glob(dirname(dirname(__FILE__)) . "/ext/view/m.featurebar.*.html.hook.php");
  86. if(!empty($headerHooks))
  87. {
  88. foreach($headerHooks as $fileName) include($fileName);
  89. }
  90. ?>