createlib.html.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <?php
  2. /**
  3. * The createLib view file of api 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 Shujie Tian<tianshujie@easycorp.ltd>
  7. * @package api
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. jsVar('productLang', $lang->productCommon);
  12. jsVar('projectLang', $lang->projectCommon);
  13. jsVar('window.libType', $type);
  14. formPanel
  15. (
  16. set::className('createLibForm'),
  17. set::title($lang->api->createLib),
  18. formGroup
  19. (
  20. set::label($lang->api->libType),
  21. radioList
  22. (
  23. set::name('libType'),
  24. set::items($lang->api->libTypeList),
  25. set::value($type),
  26. set::inline(true),
  27. on::change('toggleLibType')
  28. )
  29. ),
  30. formRow
  31. (
  32. setID('productBox'),
  33. setClass($type != 'product' ? 'hidden' : ''),
  34. formGroup
  35. (
  36. set::label($lang->api->product),
  37. set::width('3/4'),
  38. set::name('product'),
  39. set::items(createLink('product', 'ajaxGetDropMenu', "objectID=$objectID&module=&method=&extra=selectmode&useLink=0")),
  40. set::value($type == 'product' ? $objectID : 0),
  41. set::required(true)
  42. )
  43. ),
  44. formRow
  45. (
  46. setID('projectBox'),
  47. setClass($type != 'project' ? 'hidden' : ''),
  48. formGroup
  49. (
  50. set::label($lang->api->project),
  51. set::width('3/4'),
  52. set::name('project'),
  53. set::items(createLink('project', 'ajaxGetDropMenu', "objectID=$objectID&module=&method=&extra=selectmode&useLink=0")),
  54. set::value($type == 'project' ? $objectID : 0),
  55. set::required(true)
  56. )
  57. ),
  58. formGroup
  59. (
  60. set::label($lang->api->name),
  61. set::width('3/4'),
  62. set::name('name')
  63. ),
  64. formGroup
  65. (
  66. set::label($lang->api->baseUrl),
  67. set::width('3/4'),
  68. set::name('baseUrl'),
  69. set::placeholder($lang->api->baseUrlDesc)
  70. ),
  71. formRow
  72. (
  73. setID('aclBox'),
  74. formGroup
  75. (
  76. set::label($lang->api->control),
  77. radioList
  78. (
  79. set::name('acl'),
  80. set::items($lang->api->aclList),
  81. set::value('open'),
  82. on::change("toggleAcl('lib')")
  83. )
  84. )
  85. ),
  86. formRow
  87. (
  88. setID('whiteListBox'),
  89. setClass('hidden'),
  90. formGroup
  91. (
  92. set::label($lang->doc->whiteList),
  93. set::width('3/4'),
  94. div
  95. (
  96. setClass('w-full check-list'),
  97. div
  98. (
  99. setClass('w-full'),
  100. inputGroup
  101. (
  102. $lang->doclib->group,
  103. picker
  104. (
  105. set::name('groups[]'),
  106. set::items($groups),
  107. set::multiple(true)
  108. )
  109. )
  110. ),
  111. div
  112. (
  113. setClass('w-full'),
  114. inputGroup
  115. (
  116. $lang->doclib->user,
  117. userPicker(set::items($users))
  118. )
  119. )
  120. )
  121. )
  122. )
  123. );
  124. /* ====== Render page ====== */
  125. render();