browse.html.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?php
  2. /**
  3. * The browse view file of holiday 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 Mengyi Liu <liumengyi@easycorp.ltd>
  7. * @package holiday
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. jsVar('changeYearLink', createLink('holiday', 'browse', 'year={year}'));
  12. sidebar
  13. (
  14. set::showToggle(false),
  15. div
  16. (
  17. setClass('cell p-2.5 bg-white'),
  18. menu
  19. (
  20. setClass('menu'),
  21. hasPriv('custom', 'hours') ? li
  22. (
  23. setClass('menu-item'),
  24. a
  25. (
  26. set::href(createLink('custom', 'hours', 'type=hours')),
  27. $lang->custom->setHours
  28. )
  29. ) : null,
  30. hasPriv('custom', 'hours') ? li
  31. (
  32. setClass('menu-item'),
  33. a
  34. (
  35. set::href(createLink('custom', 'hours', 'type=weekend')),
  36. $lang->custom->setWeekend
  37. )
  38. ) : null,
  39. li
  40. (
  41. setClass('menu-item'),
  42. a
  43. (
  44. setClass('active'),
  45. set::href(createLink('holiday', 'browse')),
  46. $lang->custom->setHoliday
  47. )
  48. )
  49. )
  50. )
  51. );
  52. $tableData = initTableData($holidays, $this->config->holiday->dtable->fieldList, $this->holiday);
  53. panel
  54. (
  55. div
  56. (
  57. setClass('flex'),
  58. featureBar
  59. (
  60. div
  61. (
  62. setClass('check-year'),
  63. span
  64. (
  65. setClass('form-name'),
  66. h::strong($lang->holiday->checkYear)
  67. ),
  68. picker
  69. (
  70. set::name('year'),
  71. set::value($currentYear),
  72. set::items($yearList),
  73. set::required(true),
  74. set::className('w-20'),
  75. on::change('changeYear')
  76. )
  77. )
  78. ),
  79. toolbar
  80. (
  81. hasPriv('holiday', 'create') ? btn
  82. (
  83. setClass('btn primary'),
  84. set::icon('plus'),
  85. set::url(helper::createLink('holiday', 'create')),
  86. set('data-toggle', 'modal'),
  87. set('data-size', 'sm'),
  88. $lang->holiday->create
  89. ) : null
  90. )
  91. ),
  92. dtable
  93. (
  94. set::cols($this->config->holiday->dtable->fieldList),
  95. set::data($tableData),
  96. set::footer()
  97. ),
  98. center
  99. (
  100. setClass('mt-2'),
  101. div
  102. (
  103. setClass('table-import shadow-sm'),
  104. html(sprintf($lang->holiday->importTip, html::a(helper::createLink('holiday', 'import', "year={$currentYear}"), $lang->import, '', "class='text-primary' data-toggle='modal' data-size='480px'")))
  105. )
  106. )
  107. );
  108. render();