m.create.html.php 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <?php
  2. /**
  3. * The create 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. ?>
  13. <div class='heading divider'>
  14. <div class='title'><i class='icon-plus muted'></i> <strong><?php echo $lang->bug->create; ?></strong></div>
  15. <nav class='nav'><a data-dismiss='display'><i class='icon icon-remove muted'></i></a></nav>
  16. </div>
  17. <form class='has-padding content ajaxform' method='post' action='<?php echo $this->createLink('bug', 'create', http_build_query($this->app->getParams()))?>' id='createForm' data-form-refresh='#page' enctype='multipart/form-data'>
  18. <?php if($branches):?>
  19. <div class="control">
  20. <label for='branch'><?php echo $lang->bug->branch;?></label>
  21. <div class='select'><?php echo html::select('branch', $branches, $branch, "onchange='loadBranch()'");?></div>
  22. </div>
  23. <?php endif;?>
  24. <div class="control">
  25. <label for='module'><?php echo $lang->bug->module;?></label>
  26. <div id='moduleIdBox' class='select'><?php echo html::select('module', $moduleOptionMenu, $moduleID);?></div>
  27. </div>
  28. <?php if(strpos(",$showFields,", ',execution,') !== false and $config->global->flow != 'onlyTest'):?>
  29. <div class="control">
  30. <label for='execution'><?php echo $lang->bug->execution;?></label>
  31. <div id='executionIdBox' class='select'><?php echo html::select('execution', $executions, $executionID, " onchange='loadExecutionRelated(this.value)'");?></div>
  32. </div>
  33. <?php endif;?>
  34. <div class="control">
  35. <div>
  36. <label for='openedBuild' class='strong'><?php echo $lang->bug->openedBuild;?></label>
  37. <span><?php echo html::commonButton($lang->bug->allBuilds, "class='btn btn-default' data-toggle='tooltip' onclick='loadAllBuilds()'")?></span>
  38. </div>
  39. <div id='buildBox' class='select'><?php echo html::select('openedBuild[]', $builds, $buildID, "multiple");?></div>
  40. </div>
  41. <div class="control">
  42. <div>
  43. <label for='assignedTo' class='strong'><?php echo $lang->bug->lblAssignedTo;?></label>
  44. <span><?php echo html::commonButton($lang->bug->allUsers, "class='btn btn-default' onclick='loadAllUsers()' data-toggle='tooltip'");?></span>
  45. </div>
  46. <div id='assignedToBox' class='select'><?php echo html::select('assignedTo', $productMembers, $assignedTo);?></div>
  47. </div>
  48. <div class="control">
  49. <label for='title'><?php echo $lang->bug->title;?></label>
  50. <?php echo html::input('title', $bugTitle, "class='input'");?>
  51. </div>
  52. <?php $showSeverity = strpos(",$showFields,", ',severity,') !== false;?>
  53. <?php $showPri = strpos(",$showFields,", ',pri,') !== false;?>
  54. <?php if($showSeverity or $showPri):?>
  55. <div class='row'>
  56. <?php if($showSeverity):?>
  57. <div class='cell'>
  58. <div class='control'>
  59. <label for='severity'><?php echo $lang->bug->severity;?></label>
  60. <div class='select'><?php echo html::select('severity', $lang->bug->severityList, $severity);?></div>
  61. </div>
  62. </div>
  63. <?php endif;?>
  64. <?php if($showPri):?>
  65. <div class='cell'>
  66. <div class='control'>
  67. <label for='pri'><?php echo $lang->bug->pri;?></label>
  68. <div class='select'><?php echo html::select('pri', $lang->bug->priList, '');?></div>
  69. </div>
  70. </div>
  71. <?php endif;?>
  72. </div>
  73. <?php endif;?>
  74. <div class="control">
  75. <label for='steps'><?php echo $lang->bug->steps;?></label>
  76. <?php echo html::textarea('steps', $steps, "rows=4 class='textarea'");?>
  77. </div>
  78. <div class='row'>
  79. <div class='cell'>
  80. <div class='control'>
  81. <label for='type'><?php echo $lang->bug->type;?></label>
  82. <?php
  83. unset($lang->bug->typeList['designchange']);
  84. unset($lang->bug->typeList['newfeature']);
  85. unset($lang->bug->typeList['trackthings']);
  86. ?>
  87. <div class='select'><?php echo html::select('type', $lang->bug->typeList, $type);?></div>
  88. </div>
  89. </div>
  90. <?php if(strpos(",$showFields,", ',os,') !== false):?>
  91. <div class='cell'>
  92. <div class='control'>
  93. <label for='os'><?php echo $lang->bug->os;?></label>
  94. <div class='select'><?php echo html::select('os', $lang->bug->osList, $os);?></div>
  95. </div>
  96. </div>
  97. <?php endif;?>
  98. <?php if(strpos(",$showFields,", ',browser,') !== false):?>
  99. <div class='cell'>
  100. <div class='control'>
  101. <label for='browser'><?php echo $lang->bug->browser;?></label>
  102. <div class='select'><?php echo html::select('browser', $lang->bug->browserList, $browser);?></div>
  103. </div>
  104. </div>
  105. <?php endif;?>
  106. </div>
  107. <?php if(strpos(",$showFields,", ',deadline,') !== false):?>
  108. <div class="row">
  109. <div class="control">
  110. <label for='deadline'><?php echo $lang->bug->deadline;?></label>
  111. <input type="date" value='<?php echo $deadline ?>' name='deadline' id='deadline' class='input'>
  112. </div>
  113. </div>
  114. <?php endif;?>
  115. <?php if(strpos(",$showFields,", ',story,') !== false and $config->global->flow != 'onlyTest'):?>
  116. <div class='control'>
  117. <label for='story'><?php echo $lang->bug->story;?></label>
  118. <div class='select' id='storyIdBox'><?php echo html::select('story', empty($stories) ? '' : $stories, $storyID);?></div>
  119. </div>
  120. <?php endif;?>
  121. <?php if(strpos(",$showFields,", ',task,') !== false and $config->global->flow != 'onlyTest'):?>
  122. <div class='control'>
  123. <label for='task'><?php echo $lang->bug->task;?></label>
  124. <div class='select' id='taskIdBox'><?php echo html::select('task', '', $taskID);?></div>
  125. </div>
  126. <?php endif;?>
  127. <?php if(strpos(",$showFields,", ',mailto,') !== false):?>
  128. <div class="row">
  129. <div class="control">
  130. <label for='mailto'><?php echo $lang->bug->mailto;?></label>
  131. <div class='select'> <?php echo html::select('mailto[]', $users, str_replace(' ' , '', $mailto), "multiple");?></div>
  132. </div>
  133. <?php echo $this->fetch('my', 'buildContactLists');?>
  134. </div>
  135. <?php endif;?>
  136. <?php if(strpos(",$showFields,", ',keywords,') !== false):?>
  137. <div class="control">
  138. <label for='keywords'><?php echo $lang->bug->keywords;?></label>
  139. <?php echo html::input('keywords', $keywords, "class='input'");?></div>
  140. </div>
  141. <?php endif;?>
  142. <div class='control'>
  143. <?php echo $this->fetch('file', 'buildForm', 'fileCount=1');?>
  144. </div>
  145. <?php echo html::hidden('product', $productID);?>
  146. </form>
  147. <div class='footer has-padding'>
  148. <button type='submit' data-submit='#createForm' class='btn primary'><?php echo $lang->save ?></button>
  149. </div>
  150. <?php js::set('page', 'create');?>
  151. <?php js::set('oldTaskID', $taskID);?>
  152. <script>
  153. $(function()
  154. {
  155. $('#createForm').modalForm().listenScroll({container: 'parent'});
  156. var textarea = $('#steps');
  157. textarea.val(textarea.val().replace(/<br\/>/g,'\n').replace(/<[^>].*?>/g,''));
  158. })
  159. </script>