Merge branch 'spring/hufangzhou_task_84583' into 'master'

* Code for task #84583.

See merge request easycorp/zentaopms!6992
This commit is contained in:
孙广明
2023-02-19 10:46:34 +00:00
5 changed files with 32 additions and 33 deletions
+2
View File
@@ -4,3 +4,5 @@ REPLACE INTO `zt_lang` (`lang`, `module`, `section`, `key`, `value`, `system`, `
REPLACE INTO `zt_lang` (`lang`, `module`, `section`, `key`, `value`, `system`, `vision`) SELECT `lang`, `module`, 'agileplusClassify', `key`, `value`, `system`, `vision` FROM `zt_lang` WHERE `module` = 'process' and `section` = 'classify' ORDER BY id ASC;
UPDATE `zt_project` AS parent INNER JOIN (select `id`,`parent`,`attribute` from `zt_project` where `parent` != 0 and `type` = 'stage') AS child ON parent.`id` = child.`parent` SET parent.`attribute`='mix' where parent.`grade`=1 and parent.`type`='stage' and parent.`attribute` != child.`attribute`;
REPLACE INTO `zt_grouppriv` (SELECT `group`,`module`,'batchChangeStatus' FROM `zt_grouppriv` WHERE `module` = 'execution' AND `method` = 'batchEdit');
+17
View File
@@ -52,3 +52,20 @@ function setBadgeStyle(obj, isShow)
$label.find('.label-badge').css({"color":"#838a9d", "border-color":"#838a9d"});
}
}
function buildForm(action, target)
{
var tempform = document.createElement("form");
tempform.action = action;
tempform.method = "post";
tempform.target = typeof(target) == 'undefined' ? '' : target;
tempform.style.display = "none";
var opt = document.createElement("input");
opt.name = 'executionIDList';
opt.value = checkItems;
tempform.appendChild(opt);
document.body.appendChild(tempform);
tempform.submit();
}
+5 -4
View File
@@ -985,12 +985,13 @@ class executionModel extends model
$this->loadModel('programplan');
$this->loadModel('action');
$selfAndChildrenList = $this->programplan->getSelfAndChildrenList($executionIdList);
$siblingStages = $this->programplan->getSiblings($executionIdList);
$pointOutStages = '';
$pointOutStages = '';
foreach($executionIdList as $executionID)
{
/* The state of the parent stage or the sibling stage may be affected by the child stage before the change, so it cannot be checked in advance. */
$selfAndChildrenList = $this->programplan->getSelfAndChildrenList($executionID);
$siblingStages = $this->programplan->getSiblings($executionID);
$selfAndChildren = $selfAndChildrenList[$executionID];
$execution = $selfAndChildren[$executionID];
$executionType = $execution->type;
+2 -27
View File
@@ -160,37 +160,12 @@ js::set('isCNLang', !$this->loadModel('common')->checkNotCN());
$('#batchEditBtn').click(function()
{
var batchEditLink = createLink('execution', 'batchEdit');
var tempform = document.createElement("form");
tempform.action = batchEditLink;
tempform.method = "post";
tempform.style.display = "none";
var opt = document.createElement("input");
opt.name = 'executionIDList';
opt.value = checkItems;
tempform.appendChild(opt);
document.body.appendChild(tempform);
tempform.submit();
buildForm(createLink('execution', 'batchEdit'));
})
$('.statusLink').click(function()
{
var changeStatusLink = $(this).data('link');
var tempform = document.createElement("form");
tempform.action = changeStatusLink;
tempform.method = "post";
tempform.target = "hiddenwin";
tempform.style.display = "none";
var opt = document.createElement("input");
opt.name = 'executionIDList';
opt.value = checkItems;
tempform.appendChild(opt);
document.body.appendChild(tempform);
tempform.submit();
buildForm($(this).data('link'), 'hiddenwin');
})
</script>
<?php endif;?>
+6 -2
View File
@@ -1620,12 +1620,14 @@ class programplanModel extends model
/**
* Get plan and its children.
*
* @param array $planIdList
* @param string|int|array $planIdList
* @access public
* @return array
*/
public function getSelfAndChildrenList($planIdList)
{
if(is_numeric($planIdList)) $planIdList = (array)$planIdList;
$planList = $this->dao->select('t2.*')->from(TABLE_EXECUTION)->alias('t1')
->leftJoin(TABLE_EXECUTION)->alias('t2')->on('FIND_IN_SET(t1.id,t2.`path`)')
->where('t1.id')->in($planIdList)
@@ -1648,12 +1650,14 @@ class programplanModel extends model
/**
* Get plan's siblings.
*
* @param array $planIdList
* @param string|int|array $planIdList
* @access public
* @return array
*/
public function getSiblings($planIdList)
{
if(is_numeric($planIdList)) $planIdList = (array)$planIdList;
$siblingsList = $this->dao->select('t1.*')->from(TABLE_EXECUTION)->alias('t1')
->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.parent=t2.parent')
->where('t2.id')->in($planIdList)