create.html.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <?php
  2. /**
  3. * The create view file of doc 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 doc
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. $isOfficeType = ($docType && strpos($config->doc->officeTypes, $docType) !== false);
  12. $openedCollabora = (!empty($config->file->libreOfficeTurnon) && $config->file->convertType == 'collabora');
  13. if($config->requestType == 'PATH_INFO' && $isOfficeType && $openedCollabora)
  14. {
  15. jsVar('libType', $objectType);
  16. jsVar('docType', $docType);
  17. jsVar('officeTypes', $config->doc->officeTypes);
  18. formPanel(set::title($lang->doc->create), set::submitBtnText($lang->save), on::change('[name=lib]', 'checkLibPriv'), on::change('[name^=users]', 'checkLibPriv'), $objectType == 'project' ? formRow
  19. (
  20. formGroup
  21. (
  22. setClass('projectBox'),
  23. set::label($lang->doc->project),
  24. set::name('project'),
  25. set::items($objects),
  26. set::value($objectID),
  27. on::change('loadExecutions'),
  28. set::required(true)
  29. ),
  30. $app->tab == 'doc' ? formGroup
  31. (
  32. set::width('1/2'),
  33. setClass('executionBox'),
  34. set::label($lang->doc->execution),
  35. set::name('execution'),
  36. set::items($executions),
  37. set::placeholder($lang->doc->placeholder->execution),
  38. on::change('loadObjectModules')
  39. ) : null
  40. ) : null, $objectType == 'execution' ? formGroup
  41. (
  42. set::label($lang->doc->execution),
  43. set::name('execution'),
  44. set::items($objects),
  45. set::value($objectID),
  46. on::change('loadObjectModules'),
  47. set::required(true)
  48. ) : null, $objectType == 'product' ? formGroup
  49. (
  50. set::label($lang->doc->product),
  51. set::name('product'),
  52. set::items($objects),
  53. set::value($objectID),
  54. on::change('loadObjectModules'),
  55. set::required(true)
  56. ) : null, isset($spaces) ? formGroup
  57. (
  58. set::label($lang->doc->space),
  59. set::name('space'),
  60. set::items($spaces),
  61. set::value($objectID),
  62. set::disabled($lib->type == 'mine'),
  63. set::required(true),
  64. on::change('loadObjectModules')
  65. ) : null, formGroup
  66. (
  67. set::label($lang->doc->lib),
  68. set::name('lib'),
  69. set::items($libs),
  70. set::value($libID),
  71. on::change('loadLibModules'),
  72. set::required(true)
  73. ), formGroup
  74. (
  75. setClass('moduleBox'),
  76. set::label($lang->doc->module),
  77. set::name('module'),
  78. set::items($optionMenu),
  79. set::value($moduleID),
  80. set::required(true)
  81. ), formGroup
  82. (
  83. set::label($lang->doc->title),
  84. set::name('title'),
  85. set::required(true)
  86. ), formGroup
  87. (
  88. set::label($lang->doc->keywords),
  89. set::name('keywords')
  90. ), formRow
  91. (
  92. setID('aclBox'),
  93. formGroup
  94. (
  95. set::label($lang->doclib->control),
  96. radioList
  97. (
  98. set::name('acl'),
  99. set::items($lang->doc->aclList),
  100. set::value($objectType == 'mine' ? 'private' : 'open'),
  101. on::change("toggleAcl('doc')")
  102. )
  103. )
  104. ), formRow
  105. (
  106. setID('readListBox'),
  107. setClass('hidden'),
  108. formGroup
  109. (
  110. set::label($lang->doc->readonly),
  111. div
  112. (
  113. setClass('w-full check-list'),
  114. inputGroup
  115. (
  116. setClass('w-full'),
  117. $lang->doc->groupLabel,
  118. picker
  119. (
  120. set::name('readGroups[]'),
  121. set::items($groups),
  122. set::multiple(true)
  123. )
  124. ),
  125. div
  126. (
  127. setClass('w-full'),
  128. userPicker
  129. (
  130. set::label($lang->doc->userLabel),
  131. set::name('readUsers[]'),
  132. set::items($users)
  133. )
  134. )
  135. )
  136. )
  137. ), formRow
  138. (
  139. setID('whiteListBox'),
  140. setClass('hidden'),
  141. formGroup
  142. (
  143. set::label($lang->doc->editable),
  144. div
  145. (
  146. setClass('w-full check-list'),
  147. div
  148. (
  149. setClass('w-full'),
  150. inputGroup
  151. (
  152. $lang->doclib->group,
  153. picker
  154. (
  155. set::name('groups[]'),
  156. set::items($groups),
  157. set::multiple(true)
  158. )
  159. )
  160. ),
  161. div
  162. (
  163. setClass('w-full'),
  164. userPicker(set::label($lang->doclib->user), set::items($users))
  165. )
  166. )
  167. )
  168. ), formHidden('status', 'normal'), formHidden('type', $docType), formHidden('contentType', 'html'));
  169. }
  170. else
  171. {
  172. include $app->getModuleRoot() . 'doc/ui/create.html.php';
  173. }