Merge branch 'master' of github.com:easysoft/zentaopms

This commit is contained in:
z
2020-07-06 14:30:04 +08:00
3 changed files with 23 additions and 4 deletions
+18
View File
@@ -12,6 +12,24 @@ function setDuplicate(resolution)
$(function()
{
/* Fix bug #3227. */
var requiredFields = config.requiredFields;
if(requiredFields.indexOf('resolvedBuild') == -1)
{
resolvedBuildTd = $('#resolvedBuild').closest('td');
$('#resolution').change(function()
{
if($(this).val() == 'fixed')
{
resolvedBuildTd.addClass('required');
}
else
{
resolvedBuildTd.removeClass('required');
}
});
}
$('#createBuild').change(function()
{
if($(this).prop('checked'))
+4 -3
View File
@@ -15,10 +15,11 @@ class build extends control
* Create a build.
*
* @param int $projectID
* @param int $productID
* @access public
* @return void
*/
public function create($projectID)
public function create($projectID, $productID = 0)
{
if(!empty($_POST))
{
@@ -65,7 +66,7 @@ class build extends control
$project = $this->loadModel('project')->getById($projectID);
$productGroups = $this->project->getProducts($projectID);
$productID = key($productGroups);
$productID = $productID ? $productID : key($productGroups);
$products = array();
foreach($productGroups as $product) $products[$product->id] = $product->name;
@@ -396,7 +397,7 @@ class build extends control
{
if(empty($builds))
{
echo html::a($this->createLink('build', 'create', "projectID=$projectID", '', $onlybody = true), $this->lang->build->create, '', "data-toggle='modal' data-type='iframe'");
echo html::a($this->createLink('build', 'create', "projectID=$projectID&productID=$productID", '', $onlybody = true), $this->lang->build->create, '', "data-toggle='modal' data-type='iframe'");
echo '  ';
echo html::a("javascript:loadProjectBuilds($projectID)", $this->lang->refresh);
}
+1 -1
View File
@@ -44,7 +44,7 @@
<div class='input-group' id='buildBox'>
<?php echo html::select('build', empty($builds) ? '' : $builds, $build, "class='form-control chosen'");?>
<?php if(isset($projectID) and $projectID and empty($builds)):?>
<span class='input-group-addon'><?php echo html::a(helper::createLink('build', 'create', "projectID=$projectID", '', true), $lang->build->create, '', "data-toggle='modal' data-type='iframe' data-width='95%'")?> </span>
<span class='input-group-addon'><?php echo html::a(helper::createLink('build', 'create', "projectID=$projectID&productID=$productID", '', true), $lang->build->create, '', "data-toggle='modal' data-type='iframe' data-width='95%'")?> </span>
</div>
<div class='hidden'><?php echo '&nbsp; ' . html::a("javascript:void(0)", $lang->refresh, '', "class='refresh' onclick='loadProjectBuilds($projectID)'");?></div>
<?php endif;?>