edit.html.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <?php
  2. /**
  3. * The edit view file of story module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2015 禅道软件(青岛)有限公司(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 Chunsheng Wang <chunsheng@cnezsoft.com>
  8. * @package story
  9. * @version $Id: edit.html.php 4645 2013-04-11 08:32:09Z chencongzhi520@gmail.com $
  10. * @link http://www.zentao.net
  11. */
  12. ?>
  13. <?php include $this->app->getModuleRoot() . 'common/view/header.html.php';?>
  14. <?php include $this->app->getModuleRoot() . 'common/view/kindeditor.html.php';?>
  15. <?php js::set('page', 'edit')?>
  16. <?php js::set('oldProductID', $story->product);?>
  17. <?php js::set('storyID', $story->id);?>
  18. <?php js::set('parentStory', !empty($story->children));?>
  19. <?php js::set('moveChildrenTips', $lang->story->moveChildrenTips);?>
  20. <?php js::set('rawModule', $this->app->rawModule);?>
  21. <?php js::set('reviewedReviewer', $reviewedReviewer);?>
  22. <?php js::set('storyModule', $lang->story->module);?>
  23. <?php js::set('reviewers', $reviewers);?>
  24. <?php js::set('reviewerNotEmpty', $lang->story->notice->reviewerNotEmpty);?>
  25. <?php js::set('feedbackSource', $config->story->feedbackSource); ?>
  26. <?php js::set('storyStatus', $story->status);?>
  27. <div class='main-content' id='mainContent'>
  28. <form method='post' enctype='multipart/form-data' target='hiddenwin' id='dataform'>
  29. <div class='main-header'>
  30. <h2>
  31. <span class='label label-id'><?php echo $story->id;?></span>
  32. <?php echo html::a($this->createLink('story', 'view', "storyID=$story->id"), $story->title, '', 'class="story-title"');?>
  33. <small><?php echo $lang->arrow . ' ' . $lang->story->edit;?></small>
  34. </h2>
  35. </div>
  36. <div class='main-row'>
  37. <div class='main-col col-8'>
  38. <div class='cell'>
  39. <div class='form-group titleBox'>
  40. <div class="input-control has-icon-right">
  41. <div class="colorpicker">
  42. <button type="button" class="btn btn-link dropdown-toggle" data-toggle="dropdown" title="<?php echo $lang->task->colorTag ?>"><span class="cp-title"></span><span class="color-bar"></span><i class="ic"></i></button>
  43. <ul class="dropdown-menu clearfix">
  44. <li class="heading"><?php echo $lang->story->colorTag;?><i class="icon icon-close"></i></li>
  45. </ul>
  46. <input type="hidden" class="colorpicker" id="color" name="color" value="<?php echo $story->color ?>" data-icon="color" data-wrapper="input-control-icon-right" data-update-color=".story-title" data-provide="colorpicker">
  47. </div>
  48. <?php echo html::input('title', $story->title, 'class="form-control disabled story-title"' . (strpos('draft,changing', $story->status) !== false ? '' : ' disabled="disabled"'));?>
  49. </div>
  50. </div>
  51. <?php if(strpos('draft,changing', $story->status) !== false):?>
  52. <div class='detail'>
  53. <div class='detail-title'><?php echo $lang->story->reviewers;?></div>
  54. <div class='detail-content'>
  55. <div class="table-row">
  56. <?php if(!$this->story->checkForceReview()):?>
  57. <div class="table-col">
  58. <?php echo html::select('reviewer[]', $productReviewers, $reviewers, 'class="form-control picker-select" multiple')?>
  59. </div>
  60. <div class="table-col needNotReviewBox">
  61. <span class="input-group-addon" style="border: 1px solid #dcdcdc; border-left-width: 0px;">
  62. <div class='checkbox-primary'>
  63. <input id='needNotReview' name='needNotReview' value='1' type='checkbox' class='no-margin' <?php echo empty($reviewers) ? 'checked' : '';?>/>
  64. <label for='needNotReview'><?php echo $lang->story->needNotReview;?></label>
  65. </div>
  66. </span>
  67. </div>
  68. <?php else:?>
  69. <div class="table-col">
  70. <?php echo html::select('reviewer[]', $productReviewers, $reviewers, 'class="form-control picker-select" multiple required')?>
  71. </div>
  72. <?php endif;?>
  73. </div>
  74. </div>
  75. </div>
  76. <?php endif;?>
  77. <div class='detail'>
  78. <div class='detail-title'><?php echo $lang->story->legendSpec;?></div>
  79. <div class='detail-content article-content'>
  80. <?php echo strpos('draft,changing', $story->status) !== false ? html::textarea('spec', htmlSpecialString($story->spec), "rows='5' class='form-control'") : $story->spec;?>
  81. </div>
  82. </div>
  83. <?php $showFile = (strpos('draft,changing', $story->status) === false and empty($files)) ? false : true;?>
  84. <?php if($showFile):?>
  85. <div class='detail'>
  86. <div class='detail-title'><?php echo $lang->attach;?></div>
  87. <div class='form-group'>
  88. <?php $canChangeFile = strpos('draft,changing', $story->status) !== false ? true : false;?>
  89. <?php echo $this->fetch('file', 'printFiles', array('files' => $story->files, 'fieldset' => 'false', 'object' => $story, 'method' => 'edit', 'showDelete' => $canChangeFile));?>
  90. <?php echo $canChangeFile ? $this->fetch('file', 'buildform') : '';?>
  91. </div>
  92. </div>
  93. <?php endif;?>
  94. <?php $this->printExtendFields($story, 'div', 'position=left');?>
  95. <div class='detail'>
  96. <div class='detail-title'><?php echo $lang->story->comment;?></div>
  97. <div class='form-group'>
  98. <?php echo html::textarea('comment', '', "rows='5' class='form-control'");?>
  99. </div>
  100. </div>
  101. <div class='actions form-actions text-center'>
  102. <?php
  103. echo html::hidden('lastEditedDate', $story->lastEditedDate);
  104. echo html::hidden('product', $story->product);
  105. if(strpos('draft,changing', $story->status) !== false)
  106. {
  107. echo html::commonButton($lang->save, "id='saveButton'", 'btn btn-primary btn-wide');
  108. echo html::commonButton($story->status == 'changing' ? $lang->story->doNotSubmit : $lang->story->saveDraft, "id='saveDraftButton'", 'btn btn-secondary btn-wide');
  109. }
  110. else
  111. {
  112. echo html::submitButton($lang->save);
  113. }
  114. if(!isonlybody()) echo html::backButton();
  115. ?>
  116. </div>
  117. <hr class='small' />
  118. <?php include $this->app->getModuleRoot() . 'common/view/action.html.php';?>
  119. </div>
  120. </div>
  121. <div class='side-col col-4'>
  122. <div class='cell'>
  123. <div class='detail'>
  124. <div class='detail-title'><?php echo $lang->story->legendBasicInfo;?></div>
  125. <table class='table table-form'>
  126. <tr>
  127. <th class='thWidth'><?php echo $lang->story->module;?></th>
  128. <td>
  129. <div class='input-group' id='moduleIdBox'>
  130. <?php
  131. echo html::select('module', $moduleOptionMenu, $story->module, "class='form-control chosen'");
  132. if(count($moduleOptionMenu) == 1)
  133. {
  134. echo "<span class='input-group-addon'>";
  135. echo html::a($this->createLink('tree', 'browse', "rootID=$story->product&view=story&currentModuleID=0&branch=$story->branch", '', true), $lang->tree->manage, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='95%'");
  136. echo '&nbsp; ';
  137. echo html::a("javascript:void(0)", $lang->refreshIcon, '', "class='refresh' title='$lang->refresh' onclick='loadProductModules($story->product)'");
  138. echo '</span>';
  139. }
  140. ?>
  141. </div>
  142. </td>
  143. </tr>
  144. <?php if($story->parent >= 0 and $story->type == 'story'):?>
  145. <tr>
  146. <th><?php echo $lang->story->parent;?></th>
  147. <td><?php echo html::select('parent', $stories, $story->parent, "class='form-control chosen'");?></td>
  148. </tr>
  149. <?php endif;?>
  150. <tr>
  151. <th><?php echo $lang->story->status;?></th>
  152. <td>
  153. <span class='story-<?php echo $story->status;?>'><?php echo $this->processStatus('story', $story);?></span>
  154. <?php echo html::hidden('status', $story->status);?>
  155. </td>
  156. </tr>
  157. <tr>
  158. <th><?php echo $lang->story->pri;?></th>
  159. <td><?php echo html::select('pri', $lang->story->priList, $story->pri, "class='form-control chosen'");?></td>
  160. </tr>
  161. <tr>
  162. <th><?php echo $lang->story->estimate;?></th>
  163. <td><?php echo $story->parent >= 0 ? html::input('estimate', $story->estimate, "class='form-control'") : $story->estimate;?></td>
  164. </tr>
  165. <tr class='feedbackBox <?php echo in_array($story->source, $config->story->feedbackSource) ? '' : 'hidden';?>'>
  166. <th><?php echo $lang->story->feedbackBy;?></th>
  167. <td><?php echo html::input('feedbackBy', $story->feedbackBy, "class='form-control'");?></td>
  168. </tr>
  169. <tr class='feedbackBox <?php echo in_array($story->source, $config->story->feedbackSource) ? '' : 'hidden';?>'>
  170. <th><?php echo $lang->story->notifyEmail;?></th>
  171. <td><?php echo html::input('notifyEmail', $story->notifyEmail, "class='form-control'");?></td>
  172. </tr>
  173. <tr>
  174. <th><?php echo $lang->story->keywords;?></th>
  175. <td><?php echo html::input('keywords', $story->keywords, "class='form-control'");?></td>
  176. </tr>
  177. <tr>
  178. <th><?php echo $lang->story->mailto;?></th>
  179. <td>
  180. <div class='input-group'>
  181. <?php echo html::select('mailto[]', $users, str_replace(' ' , '', $story->mailto), "class='form-control picker-select' multiple");?>
  182. <?php echo $this->fetch('my', 'buildContactLists');?>
  183. </div>
  184. </td>
  185. </tr>
  186. </table>
  187. </div>
  188. <div class='detail'>
  189. <div class='detail-title'><?php echo $lang->story->legendLifeTime;?></div>
  190. <table class='table table-form'>
  191. <tr>
  192. <th class='thWidth'><?php echo $lang->story->openedBy;?></th>
  193. <td><?php echo zget($users, $story->openedBy);?></td>
  194. </tr>
  195. <tr>
  196. <th><?php echo $lang->story->assignedTo;?></th>
  197. <?php $assignedToList = $story->status == 'closed' ? $users + array('closed' => 'Closed') : $users;?>
  198. <td><?php echo html::select('assignedTo', $assignedToList, $story->assignedTo, 'class="form-control chosen"');?></td>
  199. </tr>
  200. <?php if($story->status == 'reviewing'):?>
  201. <tr>
  202. <th><?php echo $lang->story->reviewers;?></th>
  203. <td><?php echo html::select('reviewer[]', $productReviewers, $reviewers, 'class="form-control picker-select" multiple')?></td>
  204. </tr>
  205. <?php endif;?>
  206. <?php if($story->status == 'closed'):?>
  207. <tr>
  208. <th><?php echo $lang->story->closedBy;?></th>
  209. <td><?php echo html::select('closedBy', $users, $story->closedBy, 'class="form-control chosen"');?></td>
  210. </tr>
  211. <tr>
  212. <th><?php echo $lang->story->closedReason;?></th>
  213. <td><?php echo html::select('closedReason', $lang->story->reasonList, $story->closedReason, "class='form-control' onchange='setStory(this.value)'");?></td>
  214. </tr>
  215. <?php endif;?>
  216. </table>
  217. </div>
  218. <?php $this->printExtendFields($story, 'div', 'position=right');?>
  219. </div>
  220. </div>
  221. </div>
  222. </form>
  223. </div>
  224. <?php js::set('storyType', $story->type);?>
  225. <?php js::set('executionID', isset($objectID) ? $objectID : 0);?>
  226. <script>
  227. function loadProductModules(productID)
  228. {
  229. var branch = 0;
  230. var currentModule = $('#module').val();
  231. var moduleLink = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=&needManage=true&extra=&currentModuleID=' + currentModule);
  232. var $moduleIDBox = $('#moduleIdBox');
  233. $moduleIDBox.load(moduleLink, function()
  234. {
  235. $moduleIDBox.find('#module').chosen();
  236. });
  237. }
  238. </script>
  239. <?php include $this->app->getModuleRoot() . 'common/view/footer.html.php';?>