createtexttype.html.php 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <?php
  2. /**
  3. * The create text view of doc module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
  6. * @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  7. * @author Fangzhou Hu <hufangzhou@easycorp.ltd>
  8. * @package doc
  9. * @version $Id: createtext.html.php 975 2022-07-14 13:49:25Z $
  10. * @link https://www.zentao.net
  11. */
  12. ?>
  13. <?php include '../../common/view/header.lite.html.php';?>
  14. <?php include '../../common/view/kindeditor.html.php';?>
  15. <?php include '../../common/view/markdown.html.php';?>
  16. <style>
  17. #main {padding: 0;}
  18. .container {padding: 0 !important;}
  19. #mainContent {padding: 0 !important;}
  20. </style>
  21. <?php if($objectType == 'custom' and empty($libs)):?>
  22. <?php echo html::a(helper::createLink('doc', 'createLib', "type=custom&objectID=$objectID"), '<i class="icon icon-plus"></i> ' . $lang->doc->createLib, '', 'class="iframe hidden createCustomLib"');?>
  23. <?php endif;?>
  24. <div id="mainContent" class="main-content">
  25. <form class="load-indicator main-form form-ajax form-watched" id="dataform" method='post' enctype='multipart/form-data'>
  26. <table class='table table-form'>
  27. <tbody>
  28. <tr id='headerBox'>
  29. <td width='90px'><?php echo html::backButton("<i class='icon icon-back icon-sm'></i> " . $lang->goback, "id='backBtn'", 'btn btn-secondary');?></td>
  30. <td class="doc-title" colspan='3'><?php echo html::input('title', '', "placeholder='{$lang->doc->titlePlaceholder}' id='editorTitle' class='form-control' required maxlength='100'");?></td>
  31. <td class="text-right btn-tools">
  32. <?php echo html::commonButton($lang->doc->saveDraft, "id='saveDraft' data-placement='bottom'", "btn btn-secondary");?>
  33. <?php echo html::a('#modalBasicInfo', $lang->release->common, '', "data-toggle='modal' id='basicInfoLink' class='btn btn-primary'");?>
  34. </td>
  35. </tr>
  36. <tr>
  37. <td colspan='5' id="editorContent">
  38. <div class="main-row fade in">
  39. <div id='contentBox' class="main-col">
  40. <?php $contentRequired = strpos($config->doc->create->requiredFields, 'content') !== false ? 'required' : '';?>
  41. <div class='contenthtml <?php echo $contentRequired?>'><?php echo html::textarea('content', '', "style='width:100%;'");?></div>
  42. <div class='contentmarkdown <?php echo $contentRequired;?> hidden'><?php echo html::textarea('contentMarkdown', '', "style='width:100%;'");?></div>
  43. <?php echo html::hidden('contentType', 'html');?>
  44. <?php echo html::hidden('type', 'text');?>
  45. <?php echo html::hidden('status', 'normal');?>
  46. </div>
  47. </div>
  48. </td>
  49. </tr>
  50. </tbody>
  51. </table>
  52. <div class='modal fade modal-basic' id='modalBasicInfo'>
  53. <div class='modal-dialog'>
  54. <div class='modal-content'>
  55. <div class='modal-body'>
  56. <button type='button' class='close' data-dismiss='modal'>
  57. <i class="icon icon-close"></i>
  58. </button>
  59. <table class='table table-form' id="basicInfoBox">
  60. <tbody>
  61. <tr><th class='w-110px'></th><td></td><th class='w-110px'></th><td></td><td class='w-30px'></td></tr>
  62. <tr>
  63. <th><?php echo $lang->doc->title?></th>
  64. <td colspan='3' id='copyTitle'></td>
  65. </tr>
  66. <?php if($linkType == 'project'):?>
  67. <tr>
  68. <th><?php echo $lang->doc->project;?></th>
  69. <td class='required'><?php echo html::select('project', $objects, isset($execution) ? $execution->project : $objectID, "class='form-control picker-select' onchange=loadExecutions(this.value)");?></td>
  70. <?php if($this->app->tab == 'doc' and $config->vision == 'rnd'):?>
  71. <th><?php echo $lang->doc->execution?></th>
  72. <td id='executionBox'><?php echo html::select('execution', $executions, isset($execution) ? $objectID : '', "class='form-control chosen' onchange='loadObjectModules(\"execution\", this.value)'")?></td>
  73. <td class='pl-0px'><i class='icon icon-help' title='<?php echo $lang->doc->placeholder->execution;?>'></i></td>
  74. <?php endif;?>
  75. </tr>
  76. <?php elseif($linkType == 'execution'):?>
  77. <tr>
  78. <th><?php echo $lang->doc->execution;?></th>
  79. <td class='required'><?php echo html::select('execution', $objects, $objectID, "class='form-control picker-select' onchange='loadObjectModules(\"execution\", this.value)'");?></td>
  80. </tr>
  81. <?php elseif($linkType == 'product'):?>
  82. <tr>
  83. <th><?php echo $lang->doc->product;?></th>
  84. <td class='required'><?php echo html::select('product', $objects, $objectID, "class='form-control picker-select' onchange='loadObjectModules(\"product\", this.value)'");?></td>
  85. </tr>
  86. <?php endif;?>
  87. <tr>
  88. <th class='w-110px'><?php echo $lang->doc->libAndModule?></th>
  89. <td colspan='3' class='required'><span id='moduleBox'><?php echo html::select('module', $moduleOptionMenu, $moduleID, "class='form-control picker-select'");?></span></td>
  90. </tr>
  91. <tr>
  92. <th><?php echo $lang->doc->keywords;?></th>
  93. <td colspan='3' class='<?php if(strpos($config->doc->create->requiredFields, 'keywords') !== false) echo 'required'?>'><?php echo html::input('keywords', '', "id='modalKeywords' class='form-control' placeholder='{$lang->doc->keywordsTips}'");?></td>
  94. </tr>
  95. <tr id='fileBox'>
  96. <th><?php echo $lang->doc->files;?></th>
  97. <td colspan='3'><?php echo $this->fetch('file', 'buildform');?></td>
  98. </tr>
  99. <tr>
  100. <th><?php echo $lang->doc->mailto;?></th>
  101. <td colspan="3">
  102. <div class="input-group">
  103. <?php
  104. echo html::select('mailto[]', $users, '', "multiple class='form-control picker-select' data-drop-direction='top'");
  105. echo $this->fetch('my', 'buildContactLists');
  106. ?>
  107. </div>
  108. </td>
  109. </tr>
  110. <tr>
  111. <th class="th-control text-top"><?php echo $lang->doclib->control;?></th>
  112. <td colspan='3' class='aclBox'>
  113. <?php echo html::radio('acl', $lang->doc->aclList, $objectType == 'mine' ? 'private' : 'open', "onchange='toggleAcl(this.value, \"doc\")'");?>
  114. </td>
  115. </tr>
  116. <?php if($objectType != 'mine'):?>
  117. <tr id='whiteListBox' class='hidden'>
  118. <th><?php echo $lang->doc->whiteList;?></th>
  119. <td colspan='3'>
  120. <div class='input-group'>
  121. <span class='input-group-addon groups-addon'><?php echo $lang->doclib->group?></span>
  122. <?php echo html::select('groups[]', $groups, '', "class='form-control picker-select' multiple data-drop-direction='top'")?>
  123. </div>
  124. <div class='input-group'>
  125. <span class='input-group-addon'><?php echo $lang->doclib->user?></span>
  126. <?php echo html::select('users[]', $users, '', "class='form-control picker-select' multiple data-drop-direction='top'")?>
  127. <?php echo $this->fetch('my', 'buildContactLists', "dropdownName=users");?>
  128. </div>
  129. </td>
  130. </tr>
  131. <?php endif;?>
  132. </tbody>
  133. <tfoot>
  134. <tr>
  135. <td colspan='4' class='text-center'>
  136. <?php echo html::commonButton($lang->release->common, "id='releaseBtn'", 'btn btn-primary btn-wide');?>
  137. <?php echo html::commonButton($lang->cancel, "data-dismiss='modal'", "btn btn-wide");?>
  138. </td>
  139. </tr>
  140. </tfoot>
  141. </table>
  142. </div>
  143. </div>
  144. </div>
  145. </div>
  146. </form>
  147. </div>
  148. <?php js::set('textType', $config->doc->textTypes);?>
  149. <?php js::set('docType', $docType);?>
  150. <?php js::set('objectType', $objectType);?>
  151. <?php js::set('type', 'doc');?>
  152. <?php js::set('requiredFields', ',' . $config->doc->create->requiredFields . ',');?>
  153. <?php js::set('libNotEmpty', sprintf($lang->error->notempty, $lang->doc->lib));?>
  154. <?php js::set('keywordsNotEmpty', sprintf($lang->error->notempty, $lang->doc->keywords));?>
  155. <?php js::set('from', $from);?>
  156. <?php js::set('titleNotEmpty', sprintf($lang->error->notempty, $lang->doc->title));?>
  157. <?php js::set('contentNotEmpty', sprintf($lang->error->notempty, $lang->doc->content));?>
  158. <?php include '../../common/view/footer.lite.html.php';?>