m.batchcreate.html.php 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. /**
  3. * The batchCreate mobile view file of effort 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 effort
  9. * @version $Id$
  10. * @link http://www.zentao.net
  11. */
  12. ?>
  13. <div class='heading divider'>
  14. <div class='title'><strong><?php echo $lang->effort->batchCreate;?></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' method='post' action='<?php echo $this->createLink('effort', 'batchCreate');?>' target='hiddenwin' id='batchCreateForm' data-form-refresh='#page'>
  18. <div class='control'>
  19. <label for='date'><?php echo $lang->effort->date?></label>
  20. <input type='date' name='date' value='<?php echo date(DT_DATE1)?>' class='input' />
  21. </div>
  22. <?php for($i = 0; $i < 1; $i ++):?>
  23. <?php echo html::hidden("id[]", $i);?>
  24. <div class="control">
  25. <label for='objectType'><?php echo $lang->effort->objectType;?></label>
  26. <div class='select'>
  27. <?php echo html::select('objectType[]', $typeList, 'custom');?>
  28. </div>
  29. </div>
  30. <div class="control">
  31. <label for='execution'><?php echo $lang->effort->execution;?></label>
  32. <div class='select'>
  33. <?php echo html::select('execution[]', $executions, 0);?>
  34. </div>
  35. </div>
  36. <div class='row'>
  37. <div class='cell-6'>
  38. <div class='control'>
  39. <label for='consumed'><?php echo $lang->effort->consumed?></label>
  40. <input type='number' name='consumed[]' value='' step='0.01' class='input' />
  41. </div>
  42. </div>
  43. <div class='cell-6'>
  44. <div class='control'>
  45. <label for='left'><?php echo $lang->effort->left?></label>
  46. <input type='number' name='left[<?php echo $i?>]' value='' step='0.01' class='input' />
  47. </div>
  48. </div>
  49. </div>
  50. <div class='control'>
  51. <label for='work'><?php echo $lang->effort->work?></label>
  52. <?php echo html::input('work[]', '', "class='input'");?>
  53. </div>
  54. <div class='control'>
  55. <button type='submit' class='btn primary'><?php echo $lang->save;?></button>
  56. </div>
  57. <?php endfor;?>
  58. </form>
  59. <?php js::set('executionTask', $executionTask);?>
  60. <script>
  61. $(function()
  62. {
  63. $("input[name*='left']").each(function(){
  64. $(this).closest('div.control').hide();
  65. });
  66. $(document).on('change', 'select#objectType', function()
  67. {
  68. var value = $(this).val();
  69. var executionID = executionTask[value] ? executionTask[value] : 0
  70. var $execution = $(this).parent('div').parent('div').next('div.control').find('select#execution');
  71. $execution.val(executionID);
  72. var $leftInput = $(this).parent('div').parent('div').next().next('div.row').find("input[name*='left']");
  73. if(value.indexOf('task_') >= 0)
  74. {
  75. $leftInput.closest('div.control').show();
  76. }
  77. else
  78. {
  79. $leftInput.closest('div.control').hide();
  80. $execution.val(0);
  81. }
  82. });
  83. });
  84. </script>