m.create.html.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <?php
  2. /**
  3. * The create mobile view file of todo module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2016 禅道软件(青岛)有限公司(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 Fei Chen <chenfei@cnezsoft.com>
  8. * @package todo
  9. * @version $Id: index.html.php 3830 2016-05-18 09:34:17Z liugang $
  10. * @link http://www.zentao.net
  11. */
  12. ?>
  13. <div class='heading divider'>
  14. <span class='title'><i class='icon-plus'></i> <strong><?php echo $lang->todo->create ?></strong></span>
  15. <nav class='nav'>
  16. <a data-dismiss='display'><i class='icon-remove muted'></i></a>
  17. </nav>
  18. </div>
  19. <form class='has-padding content' method='post' action='<?php echo $this->createLink('todo', 'create', "date=$date")?>' id='createForm' data-form-refresh='#page' target='hiddenwin'>
  20. <div class='row'>
  21. <div class='cell'>
  22. <div class="control">
  23. <label for='pri'><?php echo $lang->todo->pri;?></label>
  24. <div class='select'>
  25. <?php echo html::select('pri', $lang->todo->priList, '3');?>
  26. </div>
  27. </div>
  28. </div>
  29. <div class='cell'>
  30. <div class="control">
  31. <label for='type'><?php echo $lang->todo->type;?></label>
  32. <div class='select'>
  33. <input type='text' class='input' disabled value='<?php echo $lang->todo->typeList['custom'] ?>'>
  34. <?php echo html::hidden('type', 'custom') ?>
  35. </div>
  36. </div>
  37. </div>
  38. </div>
  39. <div class="control">
  40. <label for='name'><?php echo $lang->todo->name;?></label>
  41. <?php echo html::input('name', '', "class='input' placeholder='{$lang->required}'");?>
  42. </div>
  43. <div class="control">
  44. <label for='desc'><?php echo $lang->todo->desc;?></label>
  45. <?php echo html::textarea('desc', '', "rows=4 class='textarea'");?>
  46. </div>
  47. <div class="control">
  48. <label for='status'><?php echo $lang->todo->status;?></label>
  49. <div class='select'>
  50. <?php echo html::select('status', $lang->todo->statusList, 'wait');?>
  51. </div>
  52. </div>
  53. <div class='control'>
  54. <div class='checkbox'>
  55. <input type='checkbox' id='switchDate' checked>
  56. <label for='switchDate' class='strong'> <?php echo $lang->todo->date;?></label>
  57. </div>
  58. <input type="date" value='<?php echo $date ?>' name='date' id='date' class='input'>
  59. </div>
  60. <div class='row' id='beginAndEnd'>
  61. <div class='cell'>
  62. <div class='control'>
  63. <label for='begin'><?php echo $lang->todo->begin;?></label>
  64. <div class='select'>
  65. <?php echo html::select('begin', $times, date('Y-m-d') != $date ? key($times) : $time);?>
  66. </div>
  67. </div>
  68. </div>
  69. <div class='cell'>
  70. <div class='control'>
  71. <label for='end'><?php echo $lang->todo->end;?></label>
  72. <div class='select'>
  73. <?php echo html::select('end', $times, '');?>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. <div class='control'>
  79. <div class='checkbox'>
  80. <input type='checkbox' id='switchTime'>
  81. <label for='switchTime'> <?php echo $lang->todo->lblDisableDate;?></label>
  82. </div>
  83. </div>
  84. <div class='control'>
  85. <div class='checkbox'>
  86. <input type='checkbox' id='private' name='private' value='1'>
  87. <label for='private'> <?php echo $lang->todo->private;?></label>
  88. </div>
  89. </div>
  90. </form>
  91. <div class='footer has-padding'>
  92. <button type='button' id='submitButton' class='btn primary'><?php echo $lang->save ?></button>
  93. </div>
  94. <script>
  95. $(function()
  96. {
  97. var switchDate = function(enable)
  98. {
  99. $('#switchDate').attr('checked', enable ? 'checked' : null);
  100. $('#date').attr('disabled', enable ? null : 'disabled');
  101. if(!enable) switchTime(false);
  102. };
  103. var switchTime = function(enable)
  104. {
  105. $('#switchTime').attr('checked', !enable ? 'checked' : null);
  106. $('#beginAndEnd').toggleClass('disabled', !enable);
  107. $('#begin, #end').attr('disabled', enable ? null : 'disabled');
  108. if(enable) switchDate(true);
  109. };
  110. $('#switchDate').on('change', function()
  111. {
  112. switchDate($(this).is(':checked'));
  113. });
  114. $('#switchTime').on('change', function()
  115. {
  116. switchTime(!$(this).is(':checked'));
  117. });
  118. $('#submitButton').click(function(){$('#createForm').submit()});
  119. $('#begin').on('change', function()
  120. {
  121. $('#end')[0].selectedIndex = $(this)[0].selectedIndex + 3;
  122. }).change();
  123. });
  124. </script>