edittexttype.html.php 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <?php
  2. /**
  3. * The create 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 Jia Fu <fujia@cnezsoft.com>
  8. * @package doc
  9. * @version $Id: create.html.php 975 2010-07-29 03:30:25Z jajacn@126.com $
  10. * @link https://www.zentao.net
  11. */
  12. ?>
  13. <?php include '../../common/view/header.html.php';?>
  14. <?php if($doc->contentType == 'html') include '../../common/view/kindeditor.html.php';?>
  15. <?php if($doc->contentType == 'markdown') 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 $backLink = $app->session->docList ? $app->session->docList : $this->createLink('doc', 'view', "docID={$doc->id}") . "#app={$this->app->tab}";?>
  22. <div id="mainContent" class="main-content">
  23. <form class="load-indicator main-form form-ajax form-watched" id="dataform" method='post' enctype='multipart/form-data'>
  24. <table class='table table-form'>
  25. <tbody>
  26. <tr id='headerBox'>
  27. <td width='90px'><?php echo html::a($backLink, "<i class='icon icon-back icon-sm'></i> " . $lang->goback, '', "id='backBtn' class='btn btn-secondary'");?></td>
  28. <td class="doc-title" colspan='3'><?php echo html::input('title', $doc->title, "placeholder='{$lang->doc->titlePlaceholder}'' id='editorTitle' class='form-control' required maxlength='100'");?></td>
  29. <td class="text-right btn-tools">
  30. <?php if($doc->status == 'draft'):?>
  31. <?php echo html::commonButton($lang->doc->saveDraft, "id='saveDraft'", "btn btn-secondary");?>
  32. <?php echo html::commonButton($lang->release->common, "id='saveRelease'", "btn btn-primary");?>
  33. <?php else:?>
  34. <?php echo html::submitButton($lang->release->common, "", "btn btn-primary");?>
  35. <?php endif;?>
  36. <?php echo html::a('#modalBasicInfo', "<i class='icon icon-cog-outline'></i> " . $lang->settings, '', "data-toggle='modal' id='basicInfoLink' class='btn'");?>
  37. </td>
  38. </tr>
  39. <tr>
  40. <td colspan='5' id="editorContent">
  41. <div class="main-row fade in">
  42. <div id='contentBox' class="main-col">
  43. <div class='contenthtml'><?php echo html::textarea('content', htmlSpecialString($doc->content), "style='width:100%;'");?></div>
  44. <?php echo html::hidden('contentType', $doc->contentType);?>
  45. <?php echo html::hidden('type', 'text');?>
  46. <?php echo html::hidden('status', $doc->status);?>
  47. </div>
  48. </div>
  49. </td>
  50. </tr>
  51. </tbody>
  52. </table>
  53. <div class='modal fade modal-basic' id='modalBasicInfo'>
  54. <div class='modal-dialog'>
  55. <div class='modal-content'>
  56. <div class='modal-header'>
  57. <h2 class='modal-title'>
  58. <?php echo $lang->doc->basicInfo;?>
  59. <button type='button' class='close' data-dismiss='modal'>
  60. <i class="icon icon-close"></i>
  61. </button>
  62. </h2>
  63. </div>
  64. <div class='modal-body'>
  65. <table class='table table-form' id="basicInfoBox">
  66. <tbody>
  67. <?php if(strpos('product|project|execution', $type) !== false):?>
  68. <tr>
  69. <th><?php echo $lang->doc->{$type};?></th>
  70. <td class='required'><?php echo html::select($type, $objects, $objectID, "class='form-control picker-select' onchange='loadObjectModules(\"{$type}\", this.value)'");?></td>
  71. </tr>
  72. <?php endif;?>
  73. <tr>
  74. <th class='w-110px'><?php echo $lang->doc->libAndModule?></th>
  75. <td colspan='3' class='required'><span id='moduleBox'><?php echo html::select('module', $moduleOptionMenu, $doc->lib . '_' . $doc->module, "class='form-control picker-select'");?></span></td>
  76. </tr>
  77. <tr>
  78. <th><?php echo $lang->doc->keywords;?></th>
  79. <td colspan='3' class='<?php if(strpos($config->doc->edit->requiredFields, 'keywords') !== false) echo 'required'?>'><?php echo html::input('keywords', $doc->keywords, "id='modalKeywords' class='form-control' placeholder='{$lang->doc->keywordsTips}'");?></td>
  80. </tr>
  81. <tr id='fileBox'>
  82. <th><?php echo $lang->doc->files;?></th>
  83. <td colspan='3'><?php echo $this->fetch('file', 'buildform');?></td>
  84. </tr>
  85. <tr>
  86. <th><?php echo $lang->doc->mailto;?></th>
  87. <td colspan="3">
  88. <div class="input-group">
  89. <?php
  90. echo html::select('mailto[]', $users, $doc->mailto, "multiple class='form-control picker-select' data-drop-direction='top'");
  91. echo $this->fetch('my', 'buildContactLists');
  92. ?>
  93. </div>
  94. </td>
  95. </tr>
  96. <tr>
  97. <th class="th-control text-top"><?php echo $lang->doclib->control;?></th>
  98. <td colspan='3' class='aclBox'>
  99. <?php echo html::radio('acl', $lang->doc->aclList, $doc->acl, "onchange='toggleAcl(this.value, \"doc\")'")?>
  100. </td>
  101. </tr>
  102. <?php if($lib->type != 'mine'):?>
  103. <tr id='whiteListBox' class='<?php if($doc->acl == 'open') echo 'hidden';?>'>
  104. <th><?php echo $lang->doc->whiteList;?></th>
  105. <td colspan='3'>
  106. <div class='input-group'>
  107. <span class='input-group-addon groups-addon'><?php echo $lang->doclib->group?></span>
  108. <?php echo html::select('groups[]', $groups, $doc->groups, "class='form-control picker-select' multiple data-drop-direction='top'")?>
  109. </div>
  110. <div class='input-group'>
  111. <span class='input-group-addon'><?php echo $lang->doclib->user?></span>
  112. <?php echo html::select('users[]', $users, $doc->users, "class='form-control picker-select' multiple data-drop-direction='top'")?>
  113. <?php echo $this->fetch('my', 'buildContactLists', "dropdownName=users");?>
  114. </div>
  115. </td>
  116. </tr>
  117. <?php endif;?>
  118. </tbody>
  119. <tfoot>
  120. <tr>
  121. <td colspan='4' class='text-center'><?php echo html::commonButton($lang->doc->confirm, "data-dismiss='modal'", "btn btn-primary btn-wide");?></td>
  122. </tr>
  123. </tfoot>
  124. </table>
  125. </div>
  126. </div>
  127. </div>
  128. </div>
  129. </form>
  130. </div>
  131. <script>
  132. $(function()
  133. {
  134. /* Automatically save document contents. */
  135. setInterval("saveDraft()", <?php echo $config->doc->saveDraftInterval;?> * 1000);
  136. <?php if($otherEditing):?>
  137. bootbox.confirm(
  138. {
  139. message: '<?php echo $lang->doc->confirmOtherEditing;?>',
  140. callback: function(result){if(!result) location.href='<?php echo $backLink;?>'}
  141. });
  142. <?php endif;?>
  143. })
  144. </script>
  145. <?php js::set('needUpdateContent', $doc->content != $doc->draft);?>
  146. <?php js::set('confirmUpdateContent', $lang->doc->confirmUpdateContent);?>
  147. <?php js::set('docID', $doc->id);?>
  148. <?php js::set('draft', $doc->draft);?>
  149. <?php js::set('type', 'doc');?>
  150. <?php js::set('titleNotEmpty', sprintf($lang->error->notempty, $lang->doc->title));?>
  151. <?php include '../../common/view/footer.html.php';?>