edit.office.html.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <?php
  2. /**
  3. * The edit view file of doc module of ZenTaoPMS.
  4. * @copyright Copyright 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 Sun Hao<sunhao@easycorp.ltd>
  7. * @package doc
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. formPanel
  12. (
  13. modalHeader(),
  14. on::change('[name=product],[name=project],[name=execution],[name=space]', "loadObjectModules"),
  15. on::change('[name=lib]', "loadLibModules"),
  16. on::change('[name=lib]', 'checkLibPriv'),
  17. on::change('[name^=users]', 'checkLibPriv'),
  18. (strpos('product|project|execution', $type) !== false) ? formGroup
  19. (
  20. set::width('1/2'),
  21. set::label($lang->doc->{$type}),
  22. set::required(true),
  23. set::control(array('control' => 'picker', 'name' => $type, 'items' => $objects, 'required' => true, 'value' => $objectID))
  24. ) : null,
  25. ($type == 'mine' || $type == 'custom') ? formGroup
  26. (
  27. set::width('1/2'),
  28. set::label($lang->doc->space),
  29. set::required(true),
  30. set::control(array('control' => 'picker', 'name' => 'space', 'items' => $spaces, 'required' => true, 'value' => $type == 'mine' ? 'mine' : $lib->parent, 'disabled' => $type == 'mine'))
  31. ) : null,
  32. formGroup
  33. (
  34. setData('libType', $type),
  35. set::width('1/2'),
  36. set::label($lang->doc->lib),
  37. set::required(true),
  38. set::control(array('control' => 'picker', 'name' => 'lib', 'items' => $libs, 'required' => true, 'value' => $doc->lib))
  39. ),
  40. formGroup
  41. (
  42. set::width('1/2'),
  43. set::label($lang->doc->module),
  44. set::control(array('control' => 'picker', 'name' => 'module', 'items' => $optionMenu, 'required' => true, 'value' => $doc->module))
  45. ),
  46. formGroup
  47. (
  48. set::label($lang->doc->title),
  49. set::name('title'),
  50. set::value($doc->title),
  51. set::required(true)
  52. ),
  53. formGroup
  54. (
  55. strpos($config->doc->officeTypes, $doc->type) === false ? setClass('hidden') : null,
  56. set::label($lang->doc->keywords),
  57. set::control('input'),
  58. set::name('keywords'),
  59. set::value($doc->keywords)
  60. ),
  61. formGroup
  62. (
  63. set::label($lang->doc->files),
  64. fileSelector()
  65. ),
  66. formGroup
  67. (
  68. set::label($lang->doc->mailto),
  69. mailto(set::items($users), set::value($doc->mailto))
  70. ),
  71. formGroup
  72. (
  73. set::label($lang->doclib->control),
  74. radioList
  75. (
  76. set::name('acl'),
  77. set::items($lang->doc->aclList),
  78. set::value(isset($lang->doc->aclList[$doc->acl]) ? $doc->acl : key($lang->doc->aclList)),
  79. on::change('toggleWhiteList')
  80. )
  81. ),
  82. $lib->type != 'mine' ? formGroup
  83. (
  84. $doc->acl == 'open' ? setClass('hidden') : null,
  85. set::label($lang->doc->whiteList),
  86. set::id('whiteListBox'),
  87. div
  88. (
  89. setClass('w-full check-list'),
  90. inputGroup
  91. (
  92. setClass('w-full'),
  93. $lang->doc->groupLabel,
  94. picker
  95. (
  96. set::name('groups[]'),
  97. set::items($groups),
  98. set::multiple(true),
  99. set::value($doc->groups)
  100. )
  101. ),
  102. div
  103. (
  104. setClass('w-full'),
  105. userPicker(set::label($lang->doc->userLabel), set::items($users), set::value($doc->users))
  106. )
  107. )
  108. ) : null,
  109. formHidden('contentType', $doc->contentType),
  110. formHidden('type', $doc->type),
  111. formHidden('status', $doc->status),
  112. formHidden('parent', $doc->parent)
  113. );