* code for task #3579.

This commit is contained in:
wangyidong
2018-01-05 09:15:59 +08:00
parent 607076205e
commit cf8b8902b4
9 changed files with 32 additions and 24 deletions
+1
View File
@@ -0,0 +1 @@
#begin_chosen{width:50% !important;}
+1
View File
@@ -0,0 +1 @@
#begin_chosen{width:50% !important;}
+4 -4
View File
@@ -17,12 +17,12 @@ function switchDateList(number)
{
if($('#switchDate' + number).attr('checked') == 'checked')
{
$('#begins' + number).attr('disabled', 'disabled');
$('#ends' + number).attr('disabled', 'disabled');
$('#begins' + number).attr('disabled', 'disabled').trigger('chosen:updated');
$('#ends' + number).attr('disabled', 'disabled').trigger('chosen:updated');
}
else
{
$('#begins' + number).removeAttr('disabled');
$('#ends' + number).removeAttr('disabled');
$('#begins' + number).removeAttr('disabled').trigger('chosen:updated');
$('#ends' + number).removeAttr('disabled').trigger('chosen:updated');
}
}
+9 -4
View File
@@ -62,6 +62,7 @@ function loadList(type, id)
function selectNext()
{
$("#end ")[0].selectedIndex = $("#begin ")[0].selectedIndex + 3;
$('#end').trigger('chosen:updated');
}
function setBeginsAndEnds(i, beginOrEnd)
@@ -72,6 +73,7 @@ function setBeginsAndEnds(i, beginOrEnd)
{
if(j != 0) $("#begins" + j)[0].selectedIndex = $("#ends" + (j - 1))[0].selectedIndex;
$("#ends" + j)[0].selectedIndex = $("#begins" + j)[0].selectedIndex + 3;
$("#ends" + j).trigger('chosen:updated');
}
}
else
@@ -79,11 +81,14 @@ function setBeginsAndEnds(i, beginOrEnd)
if(beginOrEnd == 'begin')
{
$("#ends" + i)[0].selectedIndex = $("#begins" + i)[0].selectedIndex + 3;
$("#ends" + j).trigger('chosen:updated');
}
for(j = i+1; j < batchCreateNum; j++)
{
$("#begins" + j)[0].selectedIndex = $("#ends" + (j - 1))[0].selectedIndex;
$("#ends" + j)[0].selectedIndex = $("#begins" + j)[0].selectedIndex + 3;
$("#begins" + j).trigger('chosen:updated');
$("#ends" + j).trigger('chosen:updated');
}
}
}
@@ -92,12 +97,12 @@ function switchDateFeature(switcher)
{
if(switcher.checked)
{
$('#begin').attr('disabled','disabled');
$('#end').attr('disabled','disabled');
$('#begin').attr('disabled','disabled').trigger('chosen:updated');
$('#end').attr('disabled','disabled').trigger('chosen:updated');
}
else
{
$('#begin').removeAttr('disabled');
$('#end').removeAttr('disabled');
$('#begin').removeAttr('disabled').trigger('chosen:updated');
$('#end').removeAttr('disabled').trigger('chosen:updated');
}
}
+1
View File
@@ -5,6 +5,7 @@ $(function()
{
var selectTime = $(this).val() != today ? start : nowTime;
$('#begin').val(selectTime);
$('#begin').trigger("chosen:updated");
selectNext();
})
+7 -7
View File
@@ -40,7 +40,7 @@
<tr>
<th class='w-30px'><?php echo $lang->idAB;?></th>
<th class='w-120px<?php echo zget($visibleFields, 'type', ' hidden')?>'><?php echo $lang->todo->type;?></th>
<th class='w-80px<?php echo zget($visibleFields, 'pri', ' hidden')?>'><?php echo $lang->todo->pri;?></th>
<th class='w-90px<?php echo zget($visibleFields, 'pri', ' hidden')?>'><?php echo $lang->todo->pri;?></th>
<th><?php echo $lang->todo->name;?><span class='required'></span></th>
<th <?php echo zget($visibleFields, 'desc', "class='hidden'")?>><?php echo $lang->todo->desc;?></th>
<th class='w-230px<?php echo zget($visibleFields, 'beginAndEnd', ' hidden')?>'><?php echo $lang->todo->beginAndEnd;?></th>
@@ -49,20 +49,20 @@
<?php $pri = 3;?>
<?php $time = $date != date('Y-m-d') ? key($times) : $time;?>
<?php for($i = 0; $i < $config->todo->batchCreate; $i++):?>
<tr class='text-center'>
<tr class='text-left'>
<td><?php echo $i+1;?></td>
<td <?php echo zget($visibleFields, 'type', "class='hidden'")?>><?php echo html::select("types[$i]", $lang->todo->typeList, '', "onchange='loadList(this.value, " . ($i + 1) . ")' class='form-control'");?></td>
<td <?php echo zget($visibleFields, 'pri', "class='hidden'")?>><?php echo html::select("pris[$i]", $lang->todo->priList, $pri, 'class=form-control');?></td>
<td <?php echo zget($visibleFields, 'type', "class='hidden'")?> style='overflow:visible'><?php echo html::select("types[$i]", $lang->todo->typeList, '', "onchange='loadList(this.value, " . ($i + 1) . ")' class='form-control chosen'");?></td>
<td <?php echo zget($visibleFields, 'pri', "class='hidden'")?> style='overflow:visible'><?php echo html::select("pris[$i]", $lang->todo->priList, $pri, "class='form-control chosen'");?></td>
<td class='text-left' style='overflow:visible'>
<div id='<?php echo "nameBox" . ($i+1);?>' class='hidden'><?php echo html::input("names[$i]", '', 'class="text-left form-control" autocomplete="off"');?></div>
<div class='<?php echo "nameBox" . ($i+1);?>'><?php echo html::input("names[$i]", '', 'class="text-left form-control" autocomplete="off"');?></div>
</td>
<td <?php echo zget($visibleFields, 'desc', "class='hidden'")?>><?php echo html::textarea("descs[$i]", '', "rows='1' class='form-control'");?></td>
<td <?php echo zget($visibleFields, 'beginAndEnd', "class='hidden'")?>>
<td <?php echo zget($visibleFields, 'beginAndEnd', "class='hidden'")?> style='overflow:visible'>
<div class='input-group'>
<?php
echo html::select("begins[$i]", $times, $time, "onchange=\"setBeginsAndEnds($i, 'begin');\" class='form-control' style='width: 50%'" . (isset($visibleFields['beginAndEnd']) ? '' : " disabled"));
echo html::select("ends[$i]", $times, '', "onchange=\"setBeginsAndEnds($i, 'end');\" class='form-control' style='width: 50%'" . (isset($visibleFields['beginAndEnd']) ? '' : " disabled"));
echo html::select("begins[$i]", $times, $time, "onchange=\"setBeginsAndEnds($i, 'begin');\" class='form-control chosen' style='width: 50%'" . (isset($visibleFields['beginAndEnd']) ? '' : " disabled"));
echo html::select("ends[$i]", $times, '', "onchange=\"setBeginsAndEnds($i, 'end');\" class='form-control chosen' style='width: 50%'" . (isset($visibleFields['beginAndEnd']) ? '' : " disabled"));
?>
<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>
+3 -3
View File
@@ -38,7 +38,7 @@ $columns = count($visibleFields) + 3;
<tr>
<th class='w-40px'> <?php echo $lang->idAB;?></th>
<th class='w-100px'> <?php echo $lang->todo->date;?></th>
<th class='w-120px'> <?php echo $lang->todo->type;?></th>
<th class='w-80px'> <?php echo $lang->todo->type;?></th>
<th class='w-100px<?php echo zget($visibleFields, 'pri', ' hidden')?>'> <?php echo $lang->todo->pri;?></th>
<th class='red'><?php echo $lang->todo->name;?></th>
<th <?php echo zget($visibleFields, 'desc', "class='hidden'")?>><?php echo $lang->todo->desc;?></th>
@@ -48,10 +48,10 @@ $columns = count($visibleFields) + 3;
</thead>
<tbody>
<?php foreach($editedTodos as $todo):?>
<tr class='text-center'>
<tr class='text-left'>
<td><?php echo $todo->id . html::hidden("todoIDList[$todo->id]", $todo->id);?></td>
<td><?php echo html::input("dates[$todo->id]", $todo->date, "class='form-control form-date'");?></td>
<td><?php echo zget($lang->todo->typeList, $todo->type);?></td>
<td class='text-center'><?php echo zget($lang->todo->typeList, $todo->type);?></td>
<td style='overflow:visible' <?php echo zget($visibleFields, 'pri', "class='hidden'")?>><?php echo html::select("pris[$todo->id]", $lang->todo->priList, $todo->pri, "class='form-control chosen'");?></td>
<td style='overflow:visible'>
<div id='<?php echo "nameBox" . $todo->id;?>' class='hidden'><? echo html::input("names[$todo->id]", '', "class='text-left form-control hiddenwin' autocomplete='off'"); ?></div>
+3 -3
View File
@@ -82,7 +82,7 @@
</tr>
<tr>
<th><?php echo $lang->todo->pri;?></th>
<td><?php echo html::select('pri', $lang->todo->priList, '', "class='form-control'");?></td>
<td><?php echo html::select('pri', $lang->todo->priList, '', "class='form-control chosen'");?></td>
</tr>
<tr>
<th><?php echo $lang->todo->name;?></th>
@@ -97,13 +97,13 @@
</tr>
<tr>
<th><?php echo $lang->todo->status;?></th>
<td><?php echo html::select('status', $lang->todo->statusList, '', "class='form-control'");?></td>
<td><?php echo html::select('status', $lang->todo->statusList, '', "class='form-control chosen'");?></td>
</tr>
<tr>
<th><?php echo $lang->todo->beginAndEnd;?></th>
<td>
<div class='input-group'>
<?php echo html::select('begin', $times, date('Y-m-d') != $date ? key($times) : $time, 'onchange=selectNext(); class="form-control" style="width: 50%;"') . html::select('end', $times, '', 'class="form-control" style="width: 50%; margin-left:-1px"');?>
<?php echo html::select('begin', $times, date('Y-m-d') != $date ? key($times) : $time, 'onchange=selectNext(); class="form-control chosen" style="width: 50%;"') . html::select('end', $times, '', 'class="form-control chosen" style="width: 50%; margin-left:-1px"');?>
</div>
</td>
<td><input type='checkbox' id='switchDate' onclick='switchDateFeature(this);'> <?php echo $lang->todo->lblDisableDate;?></td>
+3 -3
View File
@@ -87,7 +87,7 @@
</tr>
<tr>
<th><?php echo $lang->todo->pri;?></th>
<td><?php echo html::select('pri', $lang->todo->priList, $todo->pri, "class='form-control'");?></td>
<td><?php echo html::select('pri', $lang->todo->priList, $todo->pri, "class='form-control chosen'");?></td>
</tr>
<tr>
<th><?php echo $lang->todo->name;?></th>
@@ -105,13 +105,13 @@
</tr>
<tr>
<th><?php echo $lang->todo->status;?></th>
<td><?php echo html::select('status', $lang->todo->statusList, $todo->status, "class='form-control'");?></td>
<td><?php echo html::select('status', $lang->todo->statusList, $todo->status, "class='form-control chosen'");?></td>
</tr>
<tr>
<th><?php echo $lang->todo->beginAndEnd;?></th>
<td>
<div class='input-group'>
<?php echo html::select('begin', $times, $todo->begin, 'onchange=selectNext(); class="form-control" style="width: 50%"') . html::select('end', $times, $todo->end, 'class="form-control" style="width: 50%"');?>
<?php echo html::select('begin', $times, $todo->begin, 'onchange=selectNext(); class="form-control chosen" style="width: 50%"') . html::select('end', $times, $todo->end, 'class="form-control chosen" style="width: 50%"');?>
</div>
</td>
<td>