storyform.html.php 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <?php
  2. /**
  3. * The create story view of issue 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 Congzhi Chen <congzhi@cnezsoft.com>
  8. * @package issue
  9. * @version $Id$
  10. * @link http://www.zentao.net
  11. */
  12. ?>
  13. <tr>
  14. <th><?php echo $lang->issue->resolution;?></th>
  15. <td colspan='2'>
  16. <?php echo html::select('resolution', $lang->issue->resolveMethods, $resolution, 'class="form-control chosen" onchange="getSolutions()"');?>
  17. </td>
  18. </tr>
  19. <tr>
  20. <th><?php echo $lang->story->reviewedBy;?></th>
  21. <td colspan='2'><?php echo html::select('reviewer[]', $users, '', "class='form-control chosen' multiple");?></td>
  22. <?php if(!$this->story->checkForceReview()):?>
  23. <td colspan='2'>
  24. <div class='checkbox-primary'>
  25. <input id='needNotReview' name='needNotReview' value='1' type='checkbox' class='no-margin'/>
  26. <label for='needNotReview'><?php echo $lang->story->needNotReview;?></label>
  27. </div>
  28. </td>
  29. <?php endif;?>
  30. </tr>
  31. <tr>
  32. <th class='planTh'><?php echo $lang->story->planAB;?></th>
  33. <td colspan='2'>
  34. <div class='input-group' id='planIdBox'>
  35. <?php
  36. echo html::select('plan', $plans, 0, "class='form-control chosen'");
  37. if(count($plans) == 1)
  38. {
  39. echo "<div class='input-group-btn'>";
  40. echo html::a($this->createLink('productplan', 'create', "productID=$productID&branch=$branch", '', true), "<i class='icon icon-plus'></i>", '', "class='btn btn-icon' data-toggle='modal' data-type='iframe' data-width='95%' title='{$lang->productplan->create}'");
  41. echo '</div>';
  42. echo "<div class='input-group-btn'>";
  43. echo html::a("javascript:void(0)", "<i class='icon icon-refresh'></i>", '', "class='btn btn-icon refresh' data-toggle='tooltip' title='{$lang->refresh}' onclick='loadProductPlans($productID)'");
  44. echo '</div>';
  45. }
  46. ?>
  47. </div>
  48. </td>
  49. <?php if(strpos(",$showFields,", ',source,') !== false):?>
  50. <td colspan="2" class='sourceTd'>
  51. <div class="input-group">
  52. <div class="input-group">
  53. <div class="input-group-addon"><?php echo $lang->story->source;?></div>
  54. <?php echo html::select('source', $lang->story->sourceList, 0, "class='form-control chosen'");?>
  55. <span class='input-group-addon'><?php echo $lang->story->sourceNote;?></span>
  56. <?php echo html::input('sourceNote', '', "class='form-control' style='width:100px;'");?>
  57. </div>
  58. </div>
  59. </td>
  60. <?php endif;?>
  61. </tr>
  62. <tr>
  63. <th class='w-110px'><?php echo $lang->story->product;?></th>
  64. <td colspan='2'>
  65. <div class='input-group'>
  66. <?php echo html::select('product', $products, $productID, "onchange='loadProduct(this.value);' class='form-control chosen control-product'");?>
  67. <?php if($this->session->currentProductType != 'normal' and isset($products[$productID])):?>
  68. <?php echo html::select('branch', $branches, $branch, "onchange='loadBranch();' class='form-control chosen control-branch'");?>
  69. <?php endif;?>
  70. </div>
  71. </td>
  72. <td colspan='2'>
  73. <div class='input-group' id='moduleIdBox'>
  74. <span class="input-group-addon"><?php echo $lang->story->module;?></span>
  75. <?php
  76. echo html::select('module', $moduleOptionMenu, $moduleID, "class='form-control chosen'");
  77. if(count($moduleOptionMenu) == 1)
  78. {
  79. echo "<span class='input-group-addon'>";
  80. echo html::a($this->createLink('tree', 'browse', "rootID=$productID&view=bug&currentModuleID=0&branch=$branch", '', true), $lang->tree->manage, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='90%'");
  81. echo '&nbsp; ';
  82. echo html::a("javascript:void(0)", $lang->refresh, '', "class='refresh' onclick='loadProductModules($productID)'");
  83. echo '</span>';
  84. }
  85. ?>
  86. </div>
  87. </td>
  88. </tr>
  89. <tr>
  90. <th><?php echo $lang->story->title;?></th>
  91. <td colspan="4">
  92. <div class="input-group title-group">
  93. <div class="input-control has-icon-right required">
  94. <?php echo html::input('title', $issue->title, "class='form-control'");?>
  95. </div>
  96. <span class="input-group-addon fix-border br-0"><?php echo $lang->story->pri;?></span>
  97. <div class="input-group-btn pri-selector w-80px" data-type="pri">
  98. <?php echo html::select('pri', $lang->story->priList, $issue->pri, "class='form-control'");?>
  99. </div>
  100. <div class='table-col w-120px'>
  101. <div class="input-group">
  102. <span class="input-group-addon fix-border br-0"><?php echo $lang->story->estimateAB;?></span>
  103. <input type="text" name="estimate" id="estimate" value="" class="form-control" autocomplete="off" placeholder='<?php echo $lang->story->hour;?>' />
  104. </div>
  105. </div>
  106. </div>
  107. </td>
  108. </tr>
  109. <tr>
  110. <th><?php echo $lang->story->spec;?></th>
  111. <td colspan="4">
  112. <?php echo html::textarea('spec', $issue->desc, "rows='9' class='form-control kindeditor disabled-ie-placeholder' hidefocus='true' placeholder='" . htmlspecialchars($lang->story->specTemplate . "\n" . $lang->noticePasteImg) . "'");?>
  113. </td>
  114. </tr>
  115. <?php if(strpos(",$showFields,", ',verify,') !== false):?>
  116. <tr>
  117. <th><?php echo $lang->story->verify;?></th>
  118. <td colspan="4"><?php echo html::textarea('verify', '', "rows='6' class='form-control kindeditor' hidefocus='true'");?></td>
  119. </tr>
  120. <?php endif;?>
  121. <tr>
  122. <th><?php echo $lang->issue->resolvedBy;?></th>
  123. <td colspan='2'>
  124. <?php echo html::select('resolvedBy', $users, $this->app->user->account, "class='form-control chosen'");?>
  125. </td>
  126. </tr>
  127. <tr>
  128. <th><?php echo $lang->issue->resolvedDate;?></th>
  129. <td colspan='2'>
  130. <div class='input-group has-icon-right'>
  131. <?php echo html::input('resolvedDate', date('Y-m-d'), "class='form-control form-date'");?>
  132. <label for="date" class="input-control-icon-right"><i class="icon icon-delay"></i></label>
  133. </div>
  134. </td>
  135. </tr>
  136. <tr>
  137. <td></td>
  138. <td>
  139. <input type="hidden" name="type" value="story">
  140. <div class='form-action'><?php echo html::submitButton();?></div>
  141. </td>
  142. </tr>
  143. <?php js::set('storyModule', $lang->story->module);?>
  144. <script>
  145. $("#product").change();
  146. /**
  147. * Load branches and modules according to the product.
  148. *
  149. * @param int productID
  150. * @access public
  151. * @return void
  152. */
  153. function loadProduct(productID)
  154. {
  155. loadProductBranches(productID)
  156. loadProductModules(productID);
  157. loadProductPlans(productID);
  158. }
  159. /**
  160. * Get modules and plans by branch.
  161. *
  162. * @access public
  163. * @return void
  164. */
  165. function loadBranch()
  166. {
  167. var branch = $('#branch').val();
  168. if(typeof(branch) == 'undefined') branch = 0;
  169. loadProductModules($('#product').val(), branch);
  170. loadProductPlans($('#product').val(), branch);
  171. }
  172. /**
  173. * Acquire plans based on products and product branches.
  174. *
  175. * @param int productID
  176. * @param int branch
  177. * @access public
  178. * @return void
  179. */
  180. function loadProductPlans(productID, branch)
  181. {
  182. if(typeof(branch) == 'undefined') branch = 0;
  183. if(!branch) branch = 0;
  184. var planLink = createLink('product', 'ajaxGetPlans', 'productID=' + productID + '&branch=' + branch + '&planID=' + $('#plan').val() + '&fieldID=&needCreate=true');
  185. var planIdBox = $('#planIdBox');
  186. planIdBox.load(planLink, function()
  187. {
  188. planIdBox.find('#plan').chosen();
  189. planIdBox.fixInputGroup();
  190. });
  191. }
  192. /**
  193. * Get product branches.
  194. *
  195. * @param int productID
  196. * @access public
  197. * @return void
  198. */
  199. function loadProductBranches(productID)
  200. {
  201. $('#branch').remove();
  202. $('#branch_chosen').remove();
  203. $.get(createLink('branch', 'ajaxGetBranches', "productID=" + productID), function(data)
  204. {
  205. var $product = $('#product');
  206. var $inputGroup = $product.closest('.input-group');
  207. $inputGroup.find('.input-group-addon').toggleClass('hidden', !data);
  208. if(data)
  209. {
  210. $inputGroup.append(data);
  211. $('#branch').css('width', config.currentMethod == 'create' ? '120px' : '65px').chosen();
  212. }
  213. $inputGroup.fixInputGroup();
  214. })
  215. }
  216. /**
  217. * Get the product module.
  218. *
  219. * @param int productID
  220. * @param int branch
  221. * @access public
  222. * @return void
  223. */
  224. function loadProductModules(productID, branch)
  225. {
  226. if(typeof(branch) == 'undefined') branch = 0;
  227. if(!branch) branch = 0;
  228. var moduleLink = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=&needManage=true');
  229. var moduleIdBox = $('#moduleIdBox');
  230. moduleIdBox.load(moduleLink, function()
  231. {
  232. moduleIdBox.find('#module').chosen();
  233. if(typeof(storyModule) == 'string') moduleIdBox.prepend("<span class='input-group-addon'>" + storyModule + "</span>");
  234. moduleIdBox.fixInputGroup();
  235. });
  236. }
  237. </script>