* Finish task #40003.

This commit is contained in:
tianshujie98
2021-07-10 10:12:49 +08:00
parent 5e1e83721a
commit 55130c2ee9
3 changed files with 290 additions and 13 deletions
+5 -1
View File
@@ -13,7 +13,8 @@
div.divider {vertical-align: middle;}
.main-row {margin-top: 20px; padding: 20px; background: #f1f1f1;}
.main-row .side-col .nav li.active a {background: #006af1; color: #fff; border-radius: 4px;}
.main-row .side-col .nav li.active div a {background: #006af1; color: #fff; border-radius: 4px;}
.main-row .side-col .nav li div a {width: 80%; display: inline-block; padding: 8px 15px;}
#source > .cell {padding: 0; position: relative; height: 450px;}
#source > .cell > .lineGroup-title {position: absolute; top: 0; left: 0; right: 0; padding: 10px;}
@@ -25,3 +26,6 @@ div.divider {vertical-align: middle;}
#source .lineGroup+.lineGroup {margin-top: 10px;}
#source .lineGroup .productList {vertical-align: middle; padding: 6px;}
#source .lineGroup .projectList .scroll-handle {max-height: 200px; overflow-y: scroll; padding: 6px;}
#source .lineGroup .productList {width: 170px;}
#lineList .checkbox-primary {display: inline-block;}
.main-row .side-col .check-allLine > label {font-weight: 700}
+270 -4
View File
@@ -1,9 +1,165 @@
$(function()
{
var checkedProduct = true;
var productLine = $('.nav li.active').attr('lineid');
$("[id^='products\[" + productLine + "\]']").each(function()
{
if(!$(this).prop('checked')) checkedProduct = false;
})
$("[id^='productLines\[" + productLine + "\]']").prop('checked', checkedProduct);
$('#checkAllProducts').prop('checked', checkedProduct);
$('#checkAllProjects').prop('checked', checkedProduct);
var options = {
selector: 'input',
listenClick: false,
clickBehavior:"single",
select: function(e)
{
$('[data-id=' + e.id + ']').prop('checked', true);
},
unselect: function(e)
{
$('[data-id=' + e.id + ']').prop('checked', false);
},
finish: function(e)
{
var lineID = $('.nav li.active').attr('lineid');
var checkedLines = true;
var checkedProduct = true;
var checkedProject = true;
/* All projects selected. */
$("[id^='sprints\[" + lineID + "\]']").each(function()
{
if(!$(this).prop('checked'))
{
checkedProject = false;
}
else
{
var productID = $(this).attr('data-product');
if(productID && $('[data-productid=' + productID + ']').length > 0 && !$('[data-productid=' + productID + ']').prop('checked')) $('[data-productid=' + productID + ']').prop('checked', true);
}
})
$('#checkAllProjects').prop('checked', checkedProject);
$('#checkAllProducts').prop('checked', checkedProject);
$("[id^='productLines\[" + lineID + "\]']").prop('checked', checkedProject);
/* All products selected. */
$("[id^='products\[" + lineID + "\]']").each(function()
{
if(!$(this).prop('checked')) checkedProduct = false;
})
$('#checkAllProducts').prop('checked', checkedProduct);
$("[id^='productLines\[" + lineID + "\]']").prop('checked', checkedProduct);
/* Select the product line of the current page. */
if($('.nav li.active').find('[id^=productLines]').prop('checked'))
{
var lineID = $('.nav li.active').attr('lineid');
$('#checkAllProducts').prop('checked', true);
$('#checkAllProjects').prop('checked', true);
$("[id^='products\[" + lineID + "\]']").prop('checked', true);
$("[id^='sprints\[" + lineID + "\]'").prop('checked', true);
}
/* All product lines selected. */
$('[name^=productLines]').each(function()
{
if(!$(this).prop('checked'))
{
checkedLines = false;
}
else
{
var productLine = $(this).val();
$("[id^='products\[" + productLine + "\]']").prop('checked', true);
$("[id^='sprints\[" + productLine + "\]']").prop('checked', true);
}
})
$('#checkAllLines').prop('checked', checkedLines);
$('[id^=sprints]').each(function()
{
if($(this).prop('checked'))
{
hiddenProject();
var projectType = $('input[name="projectType"]:checked').val();
if(projectType == 'project') $('.projectName').addClass('hidden');
if(projectType == 'execution') $('.projectName').removeClass('hidden');
return false;
}
})
}
};
$('#lineBox').selectable(options);
$('#source').selectable(options);
$('.side-col .cell').height($('.side-col').height() - 20);
$('#source .cell').height($('#source').height());
$('#programBox .cell').height($('#programBox').height() - 20);
$('#checkAllLines').click(function()
{
if($(this).is(':checked'))
{
$('#checkAllProducts').prop('checked', true);
$('#checkAllProjects').prop('checked', true);
$('[name^=productLines]').prop('checked', true);
$('[name^=products]').prop('checked', true);
$('[name^=sprints]').prop('checked', true);
}
else
{
$('#checkAllProducts').prop('checked', false);
$('#checkAllProjects').prop('checked', false);
$('[name^=productLines]').prop('checked', false);
$('[name^=products]').prop('checked', false);
$('[name^=sprints]').prop('checked', false);
}
})
$('#checkAllProducts').click(function()
{
var lineID = $('li.active').attr('lineid');
if($(this).is(':checked'))
{
$("[id^='productLines\[" + lineID + "\]']").prop('checked', true);
$('#checkAllProjects').prop('checked', true);
$('[name^=products]').prop('checked', true);
$('[name^=sprints]').prop('checked', true);
}
else
{
$("[id^='productLines\[" + lineID + "\]']").prop('checked', false);
$('#checkAllProjects').prop('checked', false);
$('[name^=products]').prop('checked', false);
$('[name^=sprints]').prop('checked', false);
}
})
$('#checkAllProjects').click(function()
{
var lineID = $('li.active').attr('lineid');
if($(this).is(':checked'))
{
$("[id^='productLines\[" + lineID + "\]']").prop('checked', true);
$('#checkAllProducts').prop('checked', true);
$('[name^=products]').prop('checked', true);
$('[name^=sprints]').prop('checked', true);
}
else
{
$("[id^='productLines\[" + lineID + "\]']").prop('checked', false);
$('#checkAllProducts').prop('checked', false);
$('[name^=products]').prop('checked', false);
$('[name^=sprints]').prop('checked', false);
}
})
programBegin = $('.programParams #begin').val();
programEnd = $('.programParams #end').val();
setProgramBegin(programBegin);
@@ -12,16 +168,48 @@ $(function()
setProgramByProduct($(':checkbox:checked[data-productid]'));
$('[name^=productLines]').change(function()
{
var value = $(this).val();
var hidden = $('#line' + value).is(':hidden');
if($(this).prop('checked'))
{
if(!hidden)
{
$('#checkAllProducts').prop('checked', true);
$('#checkAllProjects').prop('checked', true);
$('[data-line=' + value + ']').prop('checked', true);
}
}
else
{
$('#checkAllLines').prop('checked', false);
if(!hidden)
{
$('#checkAllProducts').prop('checked', false);
$('#checkAllProjects').prop('checked', false);
$('[data-line=' + value + ']').prop('checked', false);
}
}
var checked = true;
$('[name^=productLines]').each(function()
{
if(!$(this).prop('checked') && $(this).val()) checked = false;
})
$('#checkAllLines').prop('checked', checked);
})
$('[name^=lines]').change(function()
{
value = $(this).val();
if($(this).prop('checked'))
{
$('[data-line=' + value + ']').prop('checked', true)
$('[data-line=' + value + ']').prop('checked', true);
}
else
{
$('[data-line=' + value + ']').prop('checked', false)
$('[data-line=' + value + ']').prop('checked', false);
}
setProgramBegin(programBegin);
setProgramEnd(programEnd);
@@ -79,24 +267,70 @@ $(function()
setProgramBegin(programBegin);
setProgramEnd(programEnd);
setProjectPM();
if($('#checkAllLines').is(':checked'))
{
$('#checkAllProducts').prop('checked', true);
$('#checkAllProjects').prop('checked', true);
$('[name^=productLines]').prop('checked', true);
$('[name^=products]').prop('checked', true);
$('[name^=sprints]').prop('checked', true);
}
else if($(this).closest("li").find('[id^=productLines]').prop('checked'))
{
var productLine = $('.nav li.active').attr('lineid');
$('#checkAllProducts').prop('checked', true);
$('#checkAllProjects').prop('checked', true);
$('[data-line=' + productLine + ']').prop('checked', true);
}
else
{
$('#checkAllProducts').prop('checked', false);
$('#checkAllProjects').prop('checked', false);
}
var checkedProduct = true;
var productLine = $('.nav li.active').attr('lineid');
$("[id^='products\[" + productLine + "\]']").each(function()
{
if(!$(this).prop('checked')) checkedProduct = false;
})
$('#checkAllProducts').prop('checked', checkedProduct);
$('#checkAllProjects').prop('checked', checkedProduct);
})
$('[name^=products]').change(function()
{
setProgramByProduct($(this));
var checked = true;
var lineID = $(this).attr('data-line');
$("[id^='products\[" + lineID + "\]']").each(function()
{
if(!$(this).prop('checked')) checked = false;
})
$('#checkAllProducts').prop('checked', checked);
$("[id^='productLines\[" + lineID + "\]']").prop('checked', checked);
value = $(this).val();
if($(this).prop('checked'))
{
$('[data-product=' + value + ']').prop('checked', true)
var lineID = $(this).attr('data-line');
if(lineID && $('[data-lineid=' + lineID + ']').length > 0 && !$('[data-lineid=' + lineID + ']').prop('checked')) $('[data-lineid=' + lineID + ']').prop('checked', true);
}
else
{
$('[data-product=' + value + ']').prop('checked', false)
}
var checkedSprint = true;
$("[id^='sprints\[" + lineID + "\]']").each(function()
{
if(!$(this).prop('checked')) checkedSprint = false;
})
$('#checkAllProjects').prop('checked', checkedSprint);
setProgramBegin(programBegin);
setProgramEnd(programEnd);
setProjectPM();
@@ -106,9 +340,24 @@ $(function()
$('[name^=sprints]').change(function()
{
var checked = true;
var checkedProduct = true;
var lineID = $(this).attr('data-line');
$("[id^='sprints\[" + lineID + "\]']").each(function()
{
if(!$(this).prop('checked')) checked = false;
})
$('#checkAllProjects').prop('checked', checked);
$("[id^='products\[" + lineID + "\]']").each(function()
{
if(!$(this).prop('checked')) checkedProduct = false;
})
$('#checkAllProducts').prop('checked', checkedProduct);
if($(this).prop('checked'))
{
var lineID = $(this).attr('data-line');
if(lineID && $('[data-lineid=' + lineID + ']').length > 0 && !$('[data-lineid=' + lineID + ']').prop('checked')) $('[data-lineid=' + lineID + ']').prop('checked', true);
var productID = $(this).attr('data-product');
@@ -128,6 +377,23 @@ $(function()
toggleProject($('form #newLine0'));
hiddenProject();
$('input[name="projectType"]').change(function()
{
if($(this).val() == 'execution')
{
$('.createExecutionTip').removeClass('hidden');
$('.createProjectTip').addClass('hidden');
$('.projectName').removeClass('hidden');
}
if($(this).val() == 'project')
{
$('.createProjectTip').removeClass('hidden');
$('.createExecutionTip').addClass('hidden');
$('.projectName').addClass('hidden');
}
})
});
/**
+15 -8
View File
@@ -1,4 +1,3 @@
<style> #source .lineGroup .productList{width: 170px;} </style>
<?php reset($productlines);?>
<?php $selected = key($productlines);?>
<div class='alert alert-info'>
@@ -8,15 +7,19 @@
?>
</div>
<div class='main-row'>
<div class='side-col'>
<div class='side-col' id='lineBox'>
<div class='cell'>
<div class='detial'>
<div class="detail-title"><?php echo $lang->upgrade->line;?></div>
<div class="checkbox-primary" title="<?php echo $lang->selectAll?>">
<input type='checkbox' id='checkAllLines'><label for='checkAllLines'><strong><?php echo $lang->upgrade->allLines;?></strong></label>
</div>
<div class="detail-content article-content">
<ul class='nav scrollbar-hover' id='lineList'>
<?php foreach($productlines as $line):?>
<li <?php if($line->id == $selected) echo "class='active' id='activeLine'";?> lineID='<?php echo $line->id;?>'>
<?php echo html::a("###", $line->name, '', "data-target=#line{$line->id}");?>
<div>
<?php echo html::checkbox("productLines[$line->id]", array($line->id => ''), '' ,"class='tile'") . html::a("###", $line->name, '', "data-target=#line{$line->id}");?>
</div>
</li>
<?php endforeach;?>
</ul>
@@ -28,8 +31,12 @@
<div class='table-col' id='source'>
<div class='cell'>
<div class='lineGroup-title'>
<div class='item'><strong><?php echo $lang->productCommon;?></strong></div>
<div class='item'><strong><?php echo $lang->projectCommon;?></strong></div>
<div class='item checkbox-primary' title="<?php echo $lang->selectAll?>">
<input type='checkbox' id='checkAllProducts'><label for='checkAllProducts'><strong><?php echo $lang->productCommon;?></strong></label>
</div>
<div class='item checkbox-primary' title="<?php echo $lang->selectAll?>">
<input type='checkbox' id='checkAllProjects'><label for='checkAllProjects'><strong><?php echo $lang->projectCommon;?></strong></label>
</div>
</div>
<div class='line-groups'>
<?php $i = 0;?>
@@ -38,14 +45,14 @@
<?php foreach($lineGroups[$line->id] as $productID => $product):?>
<div class='lineGroup'>
<div class='productList'>
<?php echo html::checkBox("products[$line->id]", array($productID => $product->name), $i == 0 ? $product->id : 0, "title='{$product->name}' data-productid='{$product->id}' data-line='{$line->id}' data-begin='{$product->createdDate}' data-programid='{$product->program}'");?>
<?php echo html::checkBox("products[$line->id]", array($productID => $product->name), $i == 0 ? $product->id : 0, "title='{$product->name}' data-productid='{$product->id}' data-line='{$line->id}' data-begin='{$product->createdDate}' data-programid='{$product->program}' class='tile'");?>
<?php echo html::hidden("productIdList[$line->id][$productID]", $productID);?>
</div>
<div class='projectList'>
<div class='scroll-handle'>
<?php if(isset($productGroups[$productID])):?>
<?php foreach($productGroups[$productID] as $sprint):?>
<?php echo html::checkBox("sprints[$line->id][$productID]", array($sprint->id => $sprint->name), $i == 0 ? $sprint->id : 0, "title='{$sprint->name}' data-product='{$product->id}' data-line='{$line->id}' data-begin='{$sprint->begin}' data-end='{$sprint->end}' data-status='{$sprint->status}' data-pm='{$sprint->PM}'");?>
<?php echo html::checkBox("sprints[$line->id][$productID]", array($sprint->id => $sprint->name), $i == 0 ? $sprint->id : 0, "title='{$sprint->name}' data-product='{$product->id}' data-line='{$line->id}' data-begin='{$sprint->begin}' data-end='{$sprint->end}' data-status='{$sprint->status}' data-pm='{$sprint->PM}' class='tile'");?>
<?php echo html::hidden("sprintIdList[$line->id][$productID][$sprint->id]", $sprint->id);?>
<?php endforeach;?>
<?php endif;?>