m.edit.html.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <?php
  2. /**
  3. * The edit 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-pencil'></i> <strong><?php echo $lang->todo->edit ?></strong> #<?php echo $todo->id ?></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', 'edit', "id=$todo->id")?>' id='editForm' data-form-refresh='#page'>
  20. <div class="control">
  21. <label for='name'><?php echo $lang->todo->name;?></label>
  22. <?php
  23. $readType = $todo->type != 'custom' ? 'readonly' : '';
  24. echo html::input('name', $todo->name, "$readType class='input'");
  25. ?>
  26. </div>
  27. <div class="control">
  28. <label for='desc'><?php echo $lang->todo->desc;?></label>
  29. <?php echo html::textarea('desc', htmlspecialchars($todo->desc), "rows=4 class='textarea'");?>
  30. </div>
  31. <div class='row'>
  32. <div class='cell'>
  33. <div class="control">
  34. <label for='pri'><?php echo $lang->todo->pri;?></label>
  35. <div class='select'>
  36. <?php echo html::select('pri', $lang->todo->priList, $todo->pri);?>
  37. </div>
  38. </div>
  39. </div>
  40. <div class='cell'>
  41. <div class="control">
  42. <label for='status'><?php echo $lang->todo->status;?></label>
  43. <div class='select'>
  44. <?php echo html::select('status', $lang->todo->statusList, $todo->status);?>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. <div class='control'>
  50. <?php $disabledDate = $todo->date === '00000000';?>
  51. <div class='checkbox'>
  52. <input type='checkbox' id='switchDate'<?php if(!$disabledDate) echo " checked" ?>>
  53. <label for='switchDate' class='strong'> <?php echo $lang->todo->date;?></label>
  54. </div>
  55. <input type="date" value='<?php echo $todo->date ?>' name='date' id='date' class='input'<?php if($disabledDate) echo " disabled" ?>>
  56. </div>
  57. <?php $disabledTime = $todo->begin == 2400;?>
  58. <div class='row<?php if($disabledTime) echo " disabled" ?>' id='beginAndEnd'>
  59. <div class='cell'>
  60. <div class='control'>
  61. <label for='begin'><?php echo $lang->todo->begin;?></label>
  62. <div class='select'>
  63. <?php echo html::select('begin', $times, $todo->begin);?>
  64. </div>
  65. </div>
  66. </div>
  67. <div class='cell'>
  68. <div class='control'>
  69. <label for='end'><?php echo $lang->todo->end;?></label>
  70. <div class='select'>
  71. <?php echo html::select('end', $times, $todo->end);?>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. <div class='control'>
  77. <div class='checkbox'>
  78. <input type='checkbox' id='switchTime'<?php if($disabledTime) echo " checked" ?>>
  79. <label for='switchTime'> <?php echo $lang->todo->lblDisableDate;?></label>
  80. </div>
  81. </div>
  82. <div class='control'>
  83. <div class='checkbox'>
  84. <input type='checkbox' id='private' value='1' name='private'<?php if($todo->private) echo " checked" ?>>
  85. <label for='private'> <?php echo $lang->todo->private;?></label>
  86. </div>
  87. </div>
  88. <input type='hidden' name='type' value='<?php echo $todo->type;?>' />
  89. </form>
  90. <div class='footer has-padding'>
  91. <button type='button' id='submitButton' class='btn primary'><?php echo $lang->save ?></button>
  92. </div>
  93. <script>
  94. $(function()
  95. {
  96. var switchDate = function(enable)
  97. {
  98. $('#switchDate').attr('checked', enable ? 'checked' : null);
  99. $('#date').attr('disabled', enable ? null : 'disabled');
  100. if(!enable) switchTime(false);
  101. };
  102. var switchTime = function(enable)
  103. {
  104. $('#switchTime').attr('checked', !enable ? 'checked' : null);
  105. $('#beginAndEnd').toggleClass('disabled', !enable);
  106. $('#begin, #end').attr('disabled', enable ? null : 'disabled');
  107. if(enable) switchDate(true);
  108. };
  109. $('#switchDate').on('change', function()
  110. {
  111. switchDate($(this).is(':checked'));
  112. });
  113. $('#switchTime').on('change', function()
  114. {
  115. switchTime(!$(this).is(':checked'));
  116. });
  117. $('#submitButton').click(function(){ $('#editForm').submit() });
  118. });
  119. </script>