m.edit.html.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <?php
  2. /**
  3. * The edit mobile view file of bug 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 Yidong Wang <yidong@cnezsoft.com>
  8. * @package bug
  9. * @version $Id$
  10. * @link http://www.zentao.net
  11. */
  12. js::set('page' , 'edit');
  13. js::set('changeExecutionConfirmed' , false);
  14. js::set('oldExecutionID' , $bug->execution);
  15. js::set('oldStoryID' , $bug->story);
  16. js::set('oldTaskID' , $bug->task);
  17. js::set('oldOpenedBuild' , $bug->openedBuild);
  18. js::set('oldResolvedBuild' , $bug->resolvedBuild);
  19. ?>
  20. <div class='heading divider'>
  21. <div class='title'><strong><?php echo $lang->bug->edit; ?></strong> #<?php echo $bug->id ?></div>
  22. <nav class='nav'><a data-dismiss='display'><i class='icon icon-remove muted'></i></a></nav>
  23. </div>
  24. <form class='has-padding content ajaxform' method='post' target='hiddenwin' action='<?php echo $this->createLink('bug', 'edit', "id=$bug->id")?>' id='editForm' data-form-refresh='#page' enctype='multipart/form-data'>
  25. <div class="box">
  26. <nav class="nav" data-display="" data-selector="a" data-show-single="true" data-active-class="active" data-animate="false">
  27. <a class="active" data-target="#editView"><?php echo $lang->bug->view?></a>
  28. <a data-target="#editBasicInfo"><?php echo $lang->bug->legendBasicInfo?></a>
  29. <a data-target="#editLife"><?php echo $lang->bug->legendLife?></a>
  30. <a data-target="#editExecStoryTask"><?php echo $lang->bug->legendExecStoryTask?></a>
  31. </nav>
  32. <div>
  33. <div class="box display in" id="editView">
  34. <div class="control">
  35. <label for='title'><?php echo $lang->bug->title;?></label>
  36. <?php echo html::input('title', str_replace("'","&#039;",$bug->title), "class='input'");?>
  37. </div>
  38. <div class="control">
  39. <label for='steps'><?php echo $lang->bug->legendSteps;?></label>
  40. <?php echo html::textarea('steps', htmlspecialchars($bug->steps), "rows='4' class='textarea'");?>
  41. </div>
  42. <div class='control'>
  43. <label for='comment'><?php echo $lang->story->comment;?></label>
  44. <?php echo html::textarea('comment', '', 'rows=2 class="textarea"');?>
  45. </div>
  46. <div class='control'>
  47. <?php echo $this->fetch('file', 'buildform');?>
  48. </div>
  49. </div>
  50. <div class="box display hidden" id="editBasicInfo">
  51. <?php if($this->session->currentProductType != 'normal'):?>
  52. <div class='control'>
  53. <label for='branch'><?php echo $lang->bug->branch;?></label>
  54. <div class='select'> <?php echo html::select('branch', $branches, $bug->branch, "onchange='loadBranch()'");?></div>
  55. </div>
  56. <?php endif;?>
  57. <div class='control'>
  58. <label for='module'><?php echo $lang->bug->module;?></label>
  59. <div class='select' id='moduleIdBox'><?php echo html::select('module', $moduleOptionMenu, $currentModuleID, "onchange='loadModuleRelated()'");?></div>
  60. </div>
  61. <div class='control'>
  62. <label for='plan'><?php echo $lang->bug->productplan;?></label>
  63. <div class='select' id="planIdBox"><?php echo html::select('plan', $plans, $bug->plan);?></div>
  64. </div>
  65. <div class='control'>
  66. <label for='type'><?php echo $lang->bug->type;?></label>
  67. <div class='select'>
  68. <?php
  69. /**
  70. * Remove designchange, newfeature, trackings from the typeList, because should be tracked in story or task.
  71. * These thress types if upgrade from bugfree2.x.
  72. */
  73. if($bug->type != 'designchange') unset($lang->bug->typeList['designchange']);
  74. if($bug->type != 'newfeature') unset($lang->bug->typeList['newfeature']);
  75. if($bug->type != 'trackthings') unset($lang->bug->typeList['trackthings']);
  76. echo html::select('type', $lang->bug->typeList, $bug->type);
  77. ?>
  78. </div>
  79. </div>
  80. <div class='control'>
  81. <label for='severity'><?php echo $lang->bug->severity;?></label>
  82. <div class='select'><?php echo html::select('severity', $lang->bug->severityList, $bug->severity);?></div>
  83. </div>
  84. <div class='control'>
  85. <label for='pri'><?php echo $lang->bug->pri;?></label>
  86. <div class='select'><?php echo html::select('pri', $lang->bug->priList, $bug->pri);?></div>
  87. </div>
  88. <div class='control'>
  89. <label for='status'><?php echo $lang->bug->status;?></label>
  90. <div class='select'><?php echo html::select('status', $lang->bug->statusList, $bug->status);?></div>
  91. </div>
  92. <div class='control'>
  93. <label for='confirmed'><?php echo $lang->bug->confirmed;?></label>
  94. <?php echo $lang->bug->confirmedList[$bug->confirmed];?>
  95. </div>
  96. <div class='control'>
  97. <label for='assignedTo'><?php echo $lang->bug->assignedTo;?></label>
  98. <div class='select'><?php echo html::select('assignedTo', $users, $bug->assignedTo);?></div>
  99. </div>
  100. <div class='control'>
  101. <label for='deadline'><?php echo $lang->bug->deadline;?></label>
  102. <input type='date' name='deadline' id='deadline' value='<?php echo helper::isZeroDate($bug->deadline) ? '' : $bug->deadline?>' class='input' />
  103. </div>
  104. <div class='control'>
  105. <label for='os'><?php echo $lang->bug->os;?></label>
  106. <div class='select'><?php echo html::select('os', $lang->bug->osList, $bug->os);?></div>
  107. </div>
  108. <div class='control'>
  109. <label for='browser'><?php echo $lang->bug->browser;?></label>
  110. <div class='select'><?php echo html::select('browser', $lang->bug->browserList, $bug->browser);?></div>
  111. </div>
  112. <div class='control'>
  113. <label for='keywords'><?php echo $lang->bug->keywords;?></label>
  114. <?php echo html::input('keywords', $bug->keywords, 'class="input"');?>
  115. </div>
  116. <div class='control'>
  117. <label for='mailto'><?php echo $lang->bug->mailto;?></label>
  118. <div class='select'><?php echo html::select('mailto[]', $users, str_replace(' ', '', $bug->mailto), 'multiple');?></div>
  119. </div>
  120. </div>
  121. <div class="box display hidden" id="editLife">
  122. <div class='control'>
  123. <label for='openedBy'><?php echo $lang->bug->openedBy;?></label>
  124. <div><?php echo $users[$bug->openedBy];?></div>
  125. </div>
  126. <div class='control'>
  127. <div>
  128. <label for='openedBuild'><strong><?php echo $lang->bug->openedBuild;?></strong></label>
  129. <span><?php echo html::commonButton($lang->bug->allBuilds, "class='btn btn-default' onclick='loadAllBuilds(this)'")?></span>
  130. </div>
  131. <div class='select' id='openedBuildBox'>
  132. <?php echo html::select('openedBuild[]', $openedBuilds, $bug->openedBuild, 'multiple');?>
  133. </div>
  134. </div>
  135. <div class='control'>
  136. <label for='resolvedBy'><?php echo $lang->bug->resolvedBy;?></label>
  137. <div class='select'><?php echo html::select('resolvedBy', $users, $bug->resolvedBy);?></div>
  138. </div>
  139. <div class='control'>
  140. <label for='resolvedDate'><?php echo $lang->bug->resolvedDate;?></label>
  141. <?php echo html::input('resolvedDate', $bug->resolvedDate, "class='input'");?>
  142. </div>
  143. <div class='control'>
  144. <div>
  145. <label for='resolvedBuild'><strong><?php echo $lang->bug->resolvedBuild;?></strong></label>
  146. <span><?php echo html::commonButton($lang->bug->allBuilds, "class='btn btn-default' onclick='loadAllBuilds(this)'")?></span>
  147. </div>
  148. <div class='select' id='resolvedBuildBox'><?php echo html::select('resolvedBuild', $resolvedBuilds, $bug->resolvedBuild);?></div>
  149. </div>
  150. <div class='control'>
  151. <label for='resolution'><?php echo $lang->bug->resolution;?></label>
  152. <div class='select'><?php echo html::select('resolution', $lang->bug->resolutionList, $bug->resolution, 'onchange=setDuplicate(this.value)');?></div>
  153. </div>
  154. <div class='control <?php if($bug->resolution != 'duplicate') echo 'hidden'?>' id='duplicateBugBox'>
  155. <label for='duplicateBug'><?php echo $lang->bug->duplicateBug;?></label>
  156. <?php echo html::input('duplicateBug', $bug->duplicateBug, "class='input'");?>
  157. </div>
  158. <div class='control'>
  159. <label for='closedBy'><?php echo $lang->bug->closedBy;?></label>
  160. <div class='select'><?php echo html::select('closedBy', $users, $bug->closedBy);?></div>
  161. </div>
  162. <div class='control'>
  163. <label for='closedDate'><?php echo $lang->bug->closedDate;?></label>
  164. <?php echo html::input('closedDate', $bug->closedDate, "class='input'");?>
  165. </div>
  166. </div>
  167. <?php if($config->global->flow != 'onlyTest'):?>
  168. <div class="box display hidden" id="editExecStoryTask">
  169. <div class='control'>
  170. <label for='execution'><?php echo $lang->bug->execution;?></label>
  171. <div class='select' id='executionIdBox'><?php echo html::select('execution', $executions, $bug->execution, "onchange='loadExecutionRelated(this.value)'");?></div>
  172. </div>
  173. <div class='control'>
  174. <label for='story'><?php echo $lang->bug->story;?></label>
  175. <div class='select' id='storyIdBox'><?php echo html::select('story', $stories, $bug->story);?></div>
  176. </div>
  177. <div class='control'>
  178. <label for='task'><?php echo $lang->bug->task;?></label>
  179. <div class='select' id='taskIdBox'><?php echo html::select('task', $tasks, $bug->task);?></div>
  180. </div>
  181. </div>
  182. <?php endif;?>
  183. </div>
  184. </div>
  185. <?php echo html::hidden('product', $bug->product);?>
  186. </form>
  187. <div class='footer has-padding'>
  188. <button type='submit' id='submitButton' class='btn primary'><?php echo $lang->save ?></button>
  189. </div>
  190. <script>
  191. $(function()
  192. {
  193. $('#submitButton').click(function(){$('#editForm').submit()});
  194. });
  195. </script>