* code for task#1889.

This commit is contained in:
xia0ta0
2014-06-17 17:19:15 +08:00
parent 6b2601d870
commit 9b7eb2f9c4
3 changed files with 18 additions and 3 deletions
+14
View File
@@ -12,3 +12,17 @@ function updateAction(date)
link = createLink('todo', 'batchCreate', 'date=' + date);
location.href=link;
}
function switchDateList(number)
{
if($('#switchDate' + number).attr('checked') == 'checked')
{
$('#begins' + number).attr('disabled', 'disabled');
$('#ends' + number).attr('disabled', 'disabled');
}
else
{
$('#begins' + number).removeAttr('disabled');
$('#ends' + number).removeAttr('disabled');
}
}
+2 -2
View File
@@ -71,8 +71,8 @@ class todoModel extends model
$todo->pri = $todos->pris[$i];
$todo->name = isset($todos->names[$i]) ? htmlspecialchars($todos->names[$i]) : '';
$todo->desc = htmlspecialchars($todos->descs[$i]);
$todo->begin = $todos->begins[$i];
$todo->end = $todos->ends[$i];
$todo->begin = isset($todos->begins[$i]) ? $todos->begins[$i] : 2400;
$todo->end = isset($todos->ends[$i]) ? $todos->ends[$i] : 2400;
$todo->status = "wait";
$todo->private = 0;
$todo->idvalue = 0;
+2 -1
View File
@@ -32,7 +32,7 @@
<th class='w-80px'><?php echo $lang->todo->pri;?></th>
<th class='w-p40 red'><?php echo $lang->todo->name;?></th>
<th><?php echo $lang->todo->desc;?></th>
<th class='w-200px'><?php echo $lang->todo->beginAndEnd;?></th>
<th class='w-300ox'><?php echo $lang->todo->beginAndEnd;?></th>
</tr>
</thead>
<?php $pri = 3;?>
@@ -49,6 +49,7 @@
<td>
<div class='input-group'>
<?php echo html::select("begins[$i]", $times, $time, "onchange=\"setBeginsAndEnds($i, 'begin');\" class='form-control' style='width: 50%'") . html::select("ends[$i]", $times, '', "onchange=\"setBeginsAndEnds($i, 'end');\" class='form-control' style='width: 50%'");?>
<span class='input-group-addon'><input type='checkbox' name="switchDate[<?php echo $i?>]" id="switchDate<?php echo $i?>" onclick='switchDateList(<?php echo $i?>);'><?php echo $lang->todo->periods['future'];?></span>
</div>
</td>
</tr>