selecttemplate.html.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <?php
  2. /**
  3. * The select template view file of doc module of ZenTaoPMS.
  4. * @copyright Copyright 2009-2024 禅道软件(青岛)有限公司(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 Xin Zhou<zhouxin@chandao.net>
  7. * @package doc
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. modalHeader(set::title($lang->doc->selectTemplate), set::titleClass('panel-title text-lg'));
  12. featureBar
  13. (
  14. set::current($scopeID),
  15. set::isModal(true),
  16. set::linkParams("scopeID={key}"),
  17. div
  18. (
  19. set::className('pb-1.5'),
  20. zui::searchBox
  21. (
  22. set::circle(true),
  23. set::delay(1000),
  24. set::defaultValue($searchName),
  25. set::onChange(jsRaw('window.handleSearchBoxChange'))
  26. )
  27. )
  28. );
  29. $buildScopeCards = function($templates) use ($lang)
  30. {
  31. $cardItems = array();
  32. foreach($templates as $template)
  33. {
  34. $cardDesc = $template->templateDesc ? $template->templateDesc : $lang->docTemplate->noDesc;
  35. $viewLink = createLink('doc', 'view', "docID=$template->id");
  36. $cardItems[] = div
  37. (
  38. on::click()->do("clickCard(event)"),
  39. setClass('doc-space-card-lib p-2 w-1/4 group'),
  40. div
  41. (
  42. setClass('templateCard canvas border rounded py-2 px-3 col gap-1 hover:shadow-lg hover:border-primary relative cursor-pointer'),
  43. setData('templateID', $template->id),
  44. div
  45. (
  46. setClass('flex gap-2 items-center py-2'),
  47. icon
  48. (
  49. setClass('icon-file-archive text-2xl')
  50. ),
  51. div
  52. (
  53. setClass('font-bold text-clip'),
  54. a(set::href($viewLink), $template->title, set::title($template->title), set(array('data-toggle' => 'modal', 'data-size' => 'lg')))
  55. )
  56. ),
  57. div
  58. (
  59. setClass('text-gray text-clip text-sm py-1'),
  60. set::title($cardDesc),
  61. $cardDesc
  62. )
  63. )
  64. );
  65. }
  66. return $cardItems;
  67. };
  68. div
  69. (
  70. setClass('templateCardPanel ring rounded pb-5'),
  71. div
  72. (
  73. setClass('py-2 px-1.5 h-600px'),
  74. empty($templateList) ? div
  75. (
  76. setClass('flex h-full justify-center items-center'),
  77. div
  78. (
  79. setClass('text-gray-500'),
  80. $lang->docTemplate->noTemplate
  81. )
  82. ) : div
  83. (
  84. setClass('flex flex-wrap'),
  85. $buildScopeCards($templateList)
  86. )
  87. )
  88. );
  89. div
  90. (
  91. setClass('center nextButton fixed bottom-0 left-0 right-0 bg-white py-2 shadow-lg z-10'),
  92. button
  93. (
  94. setClass('btn primary disabled'),
  95. span($lang->docTemplate->next),
  96. set::onclick('clickNextButton()')
  97. )
  98. );