showscript.html.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /**
  3. * The show script view file of testcase module of ZenTaoPMS.
  4. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
  5. * @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  6. * @author Gang Liu <liugang@easycorp.ltd>
  7. * @package testcase
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. modalHeader
  12. (
  13. set::title($lang->testcase->showScript),
  14. set::entityID($case->id),
  15. set::entityText($case->title)
  16. );
  17. if(empty($case->script))
  18. {
  19. div
  20. (
  21. setClass('dtable-empty-tip'),
  22. div
  23. (
  24. setClass('row gap-4 items-center'),
  25. span
  26. (
  27. setClass('text-gray'),
  28. $lang->noData
  29. )
  30. )
  31. );
  32. }
  33. else
  34. {
  35. $rows = array();
  36. $lines = explode("\n", $case->script);
  37. foreach($lines as $key => $line)
  38. {
  39. $rows[] = h::tr
  40. (
  41. h::td
  42. (
  43. setClass('align-top text-right border-r gray-pale px-1 py-0'),
  44. ++$key
  45. ),
  46. h::td
  47. (
  48. setClass('px-1 py-0 w-full'),
  49. html_entity_decode(str_replace(' ', '&nbsp;', $line))
  50. )
  51. );
  52. }
  53. h::table
  54. (
  55. setClass('border'),
  56. $rows
  57. );
  58. }
  59. render();