* code for task#892.

This commit is contained in:
chencongzhi520@gmail.com
2012-09-01 07:46:30 +00:00
parent 647d6d65a0
commit 7a942a3686
4 changed files with 17 additions and 18 deletions

View File

@@ -42,8 +42,6 @@ $lang->todo->desc = 'Desc';
$lang->todo->private = 'Private';
$lang->todo->idvalue = 'Task or bug';
$lang->todo->notes = '(Notes: the name must be written, otherwise it is no use)';
$lang->todo->week = '(l)'; // date function's param.
$lang->todo->today = 'Today';
$lang->todo->weekDateList = '';

View File

@@ -42,8 +42,6 @@ $lang->todo->desc = '描述';
$lang->todo->private = '私人事务';
$lang->todo->idvalue = '任务或Bug';
$lang->todo->notes = '(注:“名称”必需填写,否则此行无效)';
$lang->todo->week = '星期';
$lang->todo->today = '今天';
$lang->todo->weekDateList = '一,二,三,四,五,六,天';

View File

@@ -36,15 +36,15 @@
<div class='<?php echo "nameBox" . ($i+1);?>'><?php echo html::input("names[$i]", '', 'class="f-left text-1"'); echo "<span class='star'>*</span>";?></div>
</td>
<td><?php echo html::textarea("descs[$i]", '', "rows='1' class=text-1");?></td>
<td><?php echo html::select("begins[$i]", $times, $time, "onchange=setBeginsAndEnds($i)") . html::select("ends[$i]", $times, '');?><td>
<td>
<?php
echo html::select("begins[$i]", $times, $time, "onchange=setBeginsAndEnds($i,'begin')");
echo html::select("ends[$i]", $times, '', "onchange=setBeginsAndEnds($i,'end')");
?>
<td>
</tr>
<?php endfor;?>
<tr>
<td colspan='6'>
<div class='half-left red'><?php echo $lang->todo->notes;?></div>
<div class='half-right'><?php echo html::submitButton() . html::resetButton();?></div>
</td>
</tr>
<tr><td colspan='6' class='a-center'><?php echo html::submitButton() . html::resetButton();?></td></tr>
</table>
</form>
<?php include './footer.html.php';?>

View File

@@ -52,23 +52,26 @@ function selectNext()
$("#end ").get(0).selectedIndex = $("#begin ").get(0).selectedIndex + 3;
}
function setBeginsAndEnds(i)
function setBeginsAndEnds(i, beginOrEnd)
{
if(typeof i == 'undefined')
{
for(j = 0; j < batchCreateNum; j++)
{
endIndex = $("#begins" + j).get(0).selectedIndex + 3;
$("#ends" + j).get(0).selectedIndex = endIndex;
if(j != 0) $("#begins" + j).get(0).selectedIndex = $("#ends" + (j - 1)).get(0).selectedIndex;
$("#ends" + j).get(0).selectedIndex = $("#begins" + j).get(0).selectedIndex + 3;
}
}
else
{
begin = $("#begins" + i).val();
for(j = i; j < batchCreateNum; j++)
if(beginOrEnd == 'begin')
{
$("#begins" + j).val(begin);
$("#ends" + j).get(0).selectedIndex = $("#begins" + i).get(0).selectedIndex + 3;
$("#ends" + i).get(0).selectedIndex = $("#begins" + i).get(0).selectedIndex + 3;
}
for(j = i+1; j < batchCreateNum; j++)
{
$("#begins" + j).get(0).selectedIndex = $("#ends" + (j - 1)).get(0).selectedIndex;
$("#ends" + j).get(0).selectedIndex = $("#begins" + j).get(0).selectedIndex + 3;
}
}
}