Merge branch 'sprint/tianshujie_fixbug' into 'master'

Sprint/tianshujie fixbug

See merge request easycorp/zentaopms!2671
This commit is contained in:
孙广明
2022-03-31 06:26:21 +00:00
7 changed files with 67 additions and 26 deletions
+1 -1
View File
@@ -38,6 +38,6 @@ function adjustTableFooter()
{
$('.table.with-footer-fixed').css('margin-bottom', '0');
$('.table-footer').removeClass('fixed-footer');
$('.table-footer').css({"left":"0", "bottom":"0", "width":"unset"});
$('.table-footer').css({'left': 0, 'bottom': 0, 'width': 'unset'});
}
}
+1 -1
View File
@@ -497,7 +497,7 @@ class personnelModel extends model
{
$path = $this->dao->select('path')->from(TABLE_PROJECT)->where('id')->eq($objectID)->fetch('path');
$path = explode(',', trim($path, ','));
$parentID = $path[0];
$parentID = $path[0] == $objectID ? 0 : $path[0];
$objects = $this->loadModel('project')->getPairsByProgram($parentID);
}
elseif($objectType == 'product')
+2
View File
@@ -13,3 +13,5 @@
#budgetUnit {border-left: 0px;}
#projectName {display: inline-block; width: 32%;}
#productsBox a {border-radius: 2px !important;}
#productsBox .addProduct {padding-left: 0px !important;}
#productsBox > .required:after{right: -6px !important;}
+32 -17
View File
@@ -102,19 +102,32 @@ function addNewProduct(obj)
{
if($(obj).attr('checked'))
{
$('#productName').removeAttr('disabled', true);
$('#productName').closest('tr').removeClass('hidden');
$('#plansBox .col-sm-4').find('select').attr('disabled', true).trigger("chosen:updated");
/* Hide product and plan dropdown controls. */
$('#productsBox .row .col-sm-4').addClass('hidden');
$('#productsBox .row .col-sm-4 .input-group').find('select').attr('disabled', true).trigger("chosen:updated");
$('#plansBox').closest('tr').addClass('hidden');
$('#productsBox .col-sm-4 .input-group').find('select').attr('disabled', true).trigger("chosen:updated");
$('#plansBox .col-sm-4').find('select').attr('disabled', true).trigger("chosen:updated");
/* Displays the input box for creating a product. */
$("[name^='newProduct']").prop('checked', true);
$('#productName').removeAttr('disabled', true);
$('#productsBox .addProduct').removeClass('hidden');
$('#productTitle').html(productName);
}
else
{
$('#productName').attr('disabled', true);
$('#productName').closest('tr').addClass('hidden');
$('#plansBox .col-sm-4').find('select').removeAttr('disabled', true).trigger("chosen:updated");
/* Show product and product dropdown controls. */
$('#productsBox .row .col-sm-4').removeClass('hidden');
$('#productsBox .row .col-sm-4 .input-group').find('select').removeAttr('disabled').trigger("chosen:updated");
$('#plansBox').closest('tr').removeClass('hidden');
$('#productsBox .col-sm-4 .input-group').find('select').removeAttr('disabled').trigger("chosen:updated");
$('#plansBox .col-sm-4').find('select').removeAttr('disabled', true).trigger("chosen:updated");
/* Hide the input box for creating a product. */
$("[name^='newProduct']").prop('checked', false);
$('#productName').attr('disabled', true);
$('#productsBox .addProduct').addClass('hidden');
$('#productTitle').html(manageProducts);
}
}
@@ -159,16 +172,16 @@ function loadBranches(product, branchID)
}
});
if($('#productsBox .input-group:last select:first').val() != 0)
if($('#productsBox .row .input-group:last select:first').val() != 0)
{
var length = $('#productsBox .input-group').size();
var $html = $('#productsBox .col-sm-4:last').html();
$('#productsBox .col-sm-4:last').find('.input-group-addon').remove();
var length = $('#productsBox .row .input-group').size();
var $html = $('#productsBox .row .col-sm-4:last').html();
$('#productsBox .row .col-sm-4:last').find('.input-group-addon').remove();
$('#productsBox .row').append('<div class="col-sm-4">' + $html + '</div>');
if($('#productsBox .input-group:last select').size() >= 2) $('#productsBox .input-group:last select:last').remove();
$('#productsBox .input-group:last .chosen-container').remove();
$('#productsBox .input-group:last select:first').attr('name', 'products[' + length + ']').attr('id', 'products' + length);
$('#productsBox .input-group:last .chosen').chosen();
if($('#productsBox .row .input-group:last select').size() >= 2) $('#productsBox .row .input-group:last select:last').remove();
$('#productsBox .row .input-group:last .chosen-container').remove();
$('#productsBox .row .input-group:last select:first').attr('name', 'products[' + length + ']').attr('id', 'products' + length);
$('#productsBox .row .input-group:last .chosen').chosen();
adjustProductBoxMargin();
}
@@ -235,7 +248,8 @@ function adjustProductBoxMargin()
{
for(i = 1; i <= productRows - 1; i++)
{
$('#productsBox .col-sm-4:lt(' + (i * 3) + ')').css('margin-bottom', '10px');
$('#productsBox .row .col-sm-4:lt(' + (i * 3) + ')').css('margin-bottom', '10px');
$('#productsBox .row .col-sm-4').eq(i * 3).css('padding-right', '6px');
}
}
}
@@ -254,6 +268,7 @@ function adjustPlanBoxMargin()
for(j = 1; j <= planRows - 1; j++)
{
$('#plansBox .col-sm-4:lt(' + (j * 3) + ')').css('margin-bottom', '10px');
$('#plansBox .col-sm-4').eq(j * 3).css('padding-right', '6px');
}
}
}
+9 -5
View File
@@ -24,6 +24,8 @@
<?php js::set('multiBranchProducts', $multiBranchProducts);?>
<?php js::set('selectedProductID', $productID);?>
<?php js::set('selectedBranchID', $branchID);?>
<?php js::set('productName', $lang->product->name);?>
<?php js::set('manageProducts', $lang->project->manageProducts);?>
<?php $requiredFields = $config->project->create->requiredFields;?>
<div id='mainContent' class='main-content'>
<div class='center-block'>
@@ -101,7 +103,7 @@
</td><td></td><td></td>
</tr>
<tr>
<th><?php echo $lang->project->manageProducts;?></th>
<th id='productTitle'><?php echo $lang->project->manageProducts;?></th>
<td class='text-left' id='productsBox' colspan="3">
<div class='row'>
<?php $i = 0;?>
@@ -125,12 +127,14 @@
</div>
</div>
</div>
<div class="col-sm-4 addProduct hidden <?php if($programID) echo 'required';?>">
<div class='input-group'>
<?php echo html::input('productName', '', "class='form-control'");?>
<span class='input-group-addon'><?php echo html::checkBox('newProduct', $lang->project->addProduct, '', "onchange=addNewProduct(this);");?></span>
</div>
</div>
</td>
</tr>
<tr class='hidden'>
<th><?php echo $lang->product->name;?></th>
<td><?php echo html::input('productName', '', "class='form-control' required");?></td><td></td><td></td>
</tr>
<tr>
<th><?php echo $lang->execution->linkPlan;?></th>
<td colspan="3" id="plansBox">
+20
View File
@@ -0,0 +1,20 @@
$(function()
{
adjustTableFooter();
});
/**
* Adjust the table footer style.
*
* @access public
* @return void
*/
function adjustTableFooter()
{
if($('#mainContent').height() < $(window).height())
{
$('.table').removeClass('with-footer-fixed');
$('.table-footer').removeClass('fixed-footer');
$('.table-footer').css({'left': 0, 'bottom': 0, 'width': 'unset'});
}
}
+2 -2
View File
@@ -35,7 +35,7 @@
{
$suiteName = $suite->name;
if($suite->type == 'public') $suiteName .= " <span class='label label-info'>{$lang->testsuite->authorList[$suite->type]}</span>";
echo "<li>" . html::a(inlink('linkCase', "taskID=$taskID&type=bysuite&param=$suiteID"), $suiteName) . "</li>";
echo "<li>" . html::a(inlink('linkCase', "taskID=$taskID&type=bysuite&param=$suiteID"), $suiteName, '', "data-app='$app->tab'") . "</li>";
}
}
else
@@ -53,7 +53,7 @@
{
foreach($testTask as $tmpID => $tmpTitle)
{
echo "<li>" . html::a(inlink('linkCase', "taskID=$taskID&type=bybuild&param=$tmpID"), $tmpTitle) . "</li>";
echo "<li>" . html::a(inlink('linkCase', "taskID=$taskID&type=bybuild&param=$tmpID"), $tmpTitle, '', "data-app='{$app->tab}'") . "</li>";
}
}
else