ajaxgetdropmenu.html.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * The ajaxgetdropmenu file of testtask module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(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 Shujie Tian<tianshujie@easycorp.ltd>
  8. * @package testtask
  9. * @version $Id: ajaxgetdropmenu.html.php 935 2022-06-27 16:44:24Z $
  10. * @link https://www.zentao.net
  11. */
  12. ?>
  13. <style>
  14. #currentTesttask + #dropMenu {max-width: 250px;}
  15. #currentTesttask + #dropMenu > .list-group {overflow-x: hidden;}
  16. #currentTesttask + #dropMenu .table-row > .table-col > .list-group {max-width: 248px;}
  17. </style>
  18. <?php
  19. $selectHtml = '';
  20. foreach($testtasks as $testtaskID => $testtask)
  21. {
  22. if($objectType == 'project' and $testtask->project != $objectID) continue;
  23. if($objectType == 'execution' and $testtask->execution != $objectID) continue;
  24. $selected = (string)$testtaskID == $currentTaskID ? 'selected' : '';
  25. $param = $method == 'report' ? "productID=$productID&taskID=$testtaskID&browseType=all&branch=$branch" : "taskID=$testtaskID";
  26. $selectHtml .= html::a($this->createLink($module, $method, $param), $testtask->name, '', "class='$selected' data-key='{$testtasksPinyin[$testtask->name]}' data-app='{$this->app->tab}' title='{$testtask->name}'");
  27. }
  28. ?>
  29. <div class="table-row">
  30. <div class="table-col">
  31. <div class='list-group'><?php echo $selectHtml;?></div>
  32. </div>
  33. </div>
  34. <script>
  35. $(function()
  36. {
  37. $('#currentTesttask + #dropMenu .list-group .table-row .table-col a').mouseout(function()
  38. {
  39. $(this).removeClass('active');
  40. })
  41. })
  42. </script>