* Finish task#62937,62950

This commit is contained in:
zenggang
2022-08-02 08:19:56 +00:00
parent b76ebc1857
commit 8f6ca19bf7
12 changed files with 142 additions and 7 deletions
+1
View File
@@ -412,6 +412,7 @@ $lang->execution->storyDragError = "The {$lang->SRCommon} is still
$lang->execution->countTip = ' (%s member)';
$lang->execution->pleaseInput = "Enter";
$lang->execution->week = 'week';
$lang->execution->checkedExecutions = 'Seleted %s items';
/* Statistics. */
$lang->execution->charts = new stdclass();
+1
View File
@@ -412,6 +412,7 @@ $lang->execution->storyDragError = "The {$lang->SRCommon} is still
$lang->execution->countTip = ' (%s member)';
$lang->execution->pleaseInput = "Enter";
$lang->execution->week = 'week';
$lang->execution->checkedExecutions = 'Seleted %s items';
/* Statistics. */
$lang->execution->charts = new stdclass();
+1
View File
@@ -412,6 +412,7 @@ $lang->execution->storyDragError = "The {$lang->SRCommon} is still
$lang->execution->countTip = ' (%s member)';
$lang->execution->pleaseInput = "Enter";
$lang->execution->week = 'week';
$lang->execution->checkedExecutions = "Pour s électionner l'élément%s";
/* Statistics. */
$lang->execution->charts = new stdclass();
+1
View File
@@ -412,6 +412,7 @@ $lang->execution->storyDragError = "该{$lang->SRCommon}还是草
$lang->execution->countTip = '(%s人)';
$lang->execution->pleaseInput = "请输入";
$lang->execution->week = '周';
$lang->execution->checkedExecutions = '已选择%s项';
/* 统计。*/
$lang->execution->charts = new stdclass();
+3 -2
View File
@@ -670,6 +670,7 @@ class executionModel extends model
}
}
$this->lang->error->unique = $this->lang->error->repeat;
$extendFields = $this->getFlowExtendFields();
foreach($data->executionIDList as $executionID)
{
@@ -788,8 +789,8 @@ class executionModel extends model
->checkIF($execution->begin != '', 'begin', 'date')
->checkIF($execution->end != '', 'end', 'date')
->checkIF($execution->end != '', 'end', 'ge', $execution->begin)
->checkIF((!empty($execution->name) and $this->config->systemMode == 'new'), 'name', 'unique', "id != $executionID and type in ('sprint','stage') and `project` = $projectID")
->checkIF(!empty($execution->code), 'code', 'unique', "id != $executionID and type in ('sprint','stage')")
->checkIF((!empty($execution->name) and $this->config->systemMode == 'new'), 'name', 'unique', "id != $executionID and type in ('sprint','stage','kanban') and `project` = $projectID and `deleted` = '0'")
->checkIF(!empty($execution->code), 'code', 'unique', "id != $executionID and type in ('sprint','stage','kanban') and `deleted` = '0'")
->checkFlow()
->where('id')->eq($executionID)
->limit(1)
+2 -1
View File
@@ -833,6 +833,7 @@ class productModel extends model
$unlinkProducts = array();
$linkProducts = array();
$this->lang->error->unique = $this->lang->error->repeat;
foreach($products as $productID => $product)
{
$oldProduct = $oldProducts[$productID];
@@ -842,7 +843,7 @@ class productModel extends model
->data($product)
->autoCheck()
->batchCheck($this->config->product->edit->requiredFields , 'notempty')
->checkIF((!empty($product->name) and $this->config->systemMode == 'new'), 'name', 'unique', "id != $productID and `program` = $programID")
->checkIF((!empty($product->name) and $this->config->systemMode == 'new'), 'name', 'unique', "id != $productID and `program` = $programID and `deleted` = '0'")
->checkFlow()
->where('id')->eq($productID)
->exec();
+1
View File
@@ -964,6 +964,7 @@ class project extends control
$this->loadModel('execution');
$this->loadModel('task');
$this->loadModel('programplan');
$this->session->set('executionList', $this->app->getURI(true), 'project');
if($this->cookie->showTask) $this->session->set('taskList', $this->app->getURI(true), 'project');
+1
View File
@@ -1,4 +1,5 @@
#executionList > thead > tr > th .table-nest-toggle-global {top: 6px}
#executionList > thead > tr > th .table-nest-toggle-global:before {color: #a6aab8;}
#executionsSummary {padding-left: 10px;}
#mainMenu .pull-left .checkbox-primary {margin-top: 5px;}
.main-table tbody>tr>td:first-child, .main-table thead>tr>th:first-child { padding-left: 8px; }
+121
View File
@@ -4,8 +4,92 @@ $(function()
{
var show = $(this).is(':checked') ? 1 : 0;
$.cookie('showTask', show, {expires:config.cookieLife, path:config.webRoot});
if(show == 1) $('input#editExecution1').prop('disabled', true);
if(show == 0) $('input#editExecution1').prop('disabled', false);
window.location.reload();
});
if($.cookie('showTask') == 1) $('input#editExecution1').prop('disabled', true);
$('input#editExecution1').click(function()
{
var editExecution = $(this).is(':checked') ? 1 : 0;
$.cookie('editExecution', editExecution, {expires:config.cookieLife, path:config.webRoot});
if(editExecution == 1) $('input[name^="showTask"]').prop('disabled', true);
if(editExecution == 0) $('input[name^="showTask"]').prop('disabled', false);
showEditCheckbox(editExecution);
});
if($.cookie('editExecution') == 1)
{
$('input#editExecution1').prop('checked', 'true');
showEditCheckbox(true);
$('input[name^="showTask"]').prop('disabled', true);
}
$(document).on('click', ":checkbox[name^='executionIDList']", function()
{
var notCheckedLength = $(":checkbox[name^='executionIDList']:not(:checked)").length;
var checkedLength = $(":checkbox[name^='executionIDList']:checked").length;
if(checkedLength > 0) $('#executionForm').addClass('has-row-checked');
if(notCheckedLength == 0) $('.table-footer #checkAll').prop('checked', true);
if(checkedLength == 0)
{
$('.table-footer #checkAll').prop('checked', false);
$('#executionForm').removeClass('has-row-checked');
}
var summary = checkedExecutions.replace('%s', checkedLength);
if(cilentLang == "en" && checkedLength < 2) summary = summary.replace('items', 'item');
var statistic = "<div id='executionsSummary' class='table-statistic'>" + summary + "</div>";
if(checkedLength > 0)
{
$('#executionSummary').addClass('hidden');
$('#executionsSummary').remove();
$('.editCheckbox').after(statistic);
}
else
{
$('#executionSummary').removeClass('hidden');
$('#executionsSummary').addClass('hidden');
}
});
$(document).on('click', ".table-footer #checkAll", function()
{
if($(this).prop('checked'))
{
$(":checkbox[name^='executionIDList']").prop('checked', true);
$('#executionForm').addClass('has-row-checked');
var checkedLength = $(":checkbox[name^='executionIDList']:checked").length;
var summary = checkedExecutions.replace('%s', checkedLength);
if(cilentLang == "en" && checkedLength < 2) summary = summary.replace('items', 'item');
var statistic = "<div id='executionsSummary' class='table-statistic'>" + summary + "</div>";
$('#executionSummary').addClass('hidden');
$('#executionsSummary').remove();
$('.editCheckbox').after(statistic);
$(this).next('label').addClass('hover');
}
else
{
$(":checkbox[name^='executionIDList']").prop('checked', false);
$('#executionForm').removeClass('has-row-checked');
$('#executionSummary').removeClass('hidden');
$('#executionsSummary').addClass('hidden');
$(this).next('label').removeClass('hover');
}
});
/* Solve the problem that clicking the browser back button causes the checkbox to be selected by default. */
setTimeout(function()
{
$(":checkbox[name^='executionIDList']").each(function()
{
$(this).prop('checked', false);
});
$('.table-footer #checkAll').prop('checked', false);
}, 10);
})
window.addEventListener('scroll', this.handleScroll)
@@ -81,3 +165,40 @@ function getWindowHeight()
{
return document.compatMode == "CSS1Compat" ? windowHeight = document.documentElement.clientHeight : windowHeight = document.body.clientHeight
}
function showEditCheckbox(show)
{
$('.project-type-label').each(function()
{
$this = $(this);
$tr = $(this).closest('tr');
executionID = $tr.attr('data-id');
if(show)
{
var marginLeft = $tr.find('td:first').find('span.table-nest-icon').css('margin-left');
$tr.find('td:first').prepend("<div class='checkbox-primary'><input type='checkbox' name='executionIDList[]' value='" + executionID + "' id='executionIDList" + executionID + "'/><label for='executionIDList" + executionID + "'></lable></div>");
$tr.find('td:first').find('.checkbox-primary').css('margin-left', marginLeft).css('width', '14');
$tr.find('td:first').find('span.table-nest-icon').css('margin-left', '0');
}
else
{
var marginLeft = $tr.find('td:first').find('.checkbox-primary').css('margin-left');
$tr.find('td:first').find('span.table-nest-icon').css('margin-left', marginLeft);
$tr.find('td:first').find('[name^="executionIDList"]').parent().remove();
}
});
if(show)
{
var tableFooter = "<div class='editCheckbox'><div class='checkbox-primary check-all'><input type='checkbox' id='checkAll' /><label>" + selectAll + "</label></div><div class='table-actions btn-toolbar'><button type='submit' class='btn'>" + edit + "</button></div></div>";
$('#executionForm').attr('action', createLink('execution', 'batchEdit'));
$('.table-footer').prepend(tableFooter).show();
$('body').scroll();
}
else
{
$('#executionForm').find('.editCheckbox').remove();
if($('#executionForm .pager').length == 0) $('.table-footer').hide();
$('#executionForm').removeAttr('action');
}
}
+3 -2
View File
@@ -1583,6 +1583,7 @@ class projectModel extends model
}
if(dao::isError()) return false;
$this->lang->error->unique = $this->lang->error->repeat;
foreach($projects as $projectID => $project)
{
$oldProject = $oldProjects[$projectID];
@@ -1594,8 +1595,8 @@ class projectModel extends model
->checkIF($project->begin != '', 'begin', 'date')
->checkIF($project->end != '', 'end', 'date')
->checkIF($project->end != '', 'end', 'gt', $project->begin)
->checkIF(!empty($project->name), 'name', 'unique', "id != $projectID and `type`='project' and `parent` = $parentID and `model` = '{$project->model}'")
->checkIF(!empty($project->code), 'code', 'unique', "id != $projectID and `type`='project' and `model` = '{$project->model}'")
->checkIF(!empty($project->name), 'name', 'unique', "id != $projectID and `type`='project' and `parent` = $parentID and `model` = '{$project->model}' and `deleted` = '0'")
->checkIF(!empty($project->code), 'code', 'unique', "id != $projectID and `type`='project' and `model` = '{$project->model}' and `deleted` = '0'")
->checkFlow()
->where('id')->eq($projectID)
->exec();
+6 -1
View File
@@ -1,5 +1,9 @@
<?php include '../../common/view/header.html.php';?>
<?php js::set('projectID', $projectID);?>
<?php js::set('edit', $lang->edit);?>
<?php js::set('selectAll', $lang->selectAll);?>
<?php js::set('checkedExecutions', $lang->execution->checkedExecutions);?>
<?php js::set('cilentLang', $this->app->getClientLang());?>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left'>
<div class='btn-group'>
@@ -23,7 +27,8 @@
<?php if($status == $key) $label .= " <span class='label label-light label-badge'>{$pager->recTotal}</span>";?>
<?php echo html::a($this->createLink('project', 'execution', "status=$key&projectID=$projectID&orderBy=$orderBy&productID=$productID"), $label, '', "class='btn btn-link' id='{$key}Tab'");?>
<?php endforeach;?>
<?php echo html::checkbox('showTask', array('1' => $lang->programplan->stageCustom->task), '', $this->cookie->showTask ? 'checked=checked' : '');?>
<?php if(common::hasPriv('execution', 'batchEdit') and !empty($executionStats)) echo html::checkbox('editExecution', array('1' => $lang->edit . $lang->executionCommon), '', $this->cookie->editExecution ? 'checked=checked' : '');?>
<?php if(common::hasPriv('execution', 'task')) echo html::checkbox('showTask', array('1' => $lang->programplan->stageCustom->task), '', $this->cookie->showTask ? 'checked=checked' : '');?>
</div>
<div class='btn-toolbar pull-right'>
<?php common::printLink('execution', 'export', "status=$status&productID=$productID&orderBy=$orderBy&from=project", "<i class='icon-export muted'> </i> " . $lang->export, '', "class='btn btn-link export'")?>
+1 -1
View File
@@ -2517,7 +2517,7 @@ class taskModel extends model
->beginIF($type == 'assignedTo' and ($this->app->rawModule == 'my' or $this->app->rawModule == 'block'))->andWhere('t2.status', true)->ne('suspended')->orWhere('t4.status')->ne('suspended')->markRight(1)->fi()
->beginIF($type != 'all' and $type != 'finishedBy' and $type != 'assignedTo')->andWhere("t1.`$type`")->eq($account)->fi()
->beginIF($type == 'assignedTo')->andWhere("(t1.assignedTo = '{$account}' or (t1.mode = 'multi' and t5.`account` = '{$account}') )")->fi()
->beginIF($type == 'assignedTo' and $this->app->rawModule == 'my' and $this->app->rawMethod == 'work')->andWhere('t1.status')->ne('closed')->fi()
->beginIF($type == 'assignedTo' and $this->app->rawModule == 'my' and $this->app->rawMethod == 'work')->andWhere('t1.status')->notin('closed,cancel,pause')->fi()
->orderBy($orderBy)
->beginIF($limit > 0)->limit($limit)->fi()
->page($pager)