Merge branch 'zentaopms_284' of https://gitlab.zcorp.cc/easycorp/zentaopms into zentaopms_284

This commit is contained in:
Yagami
2023-02-07 16:58:51 +08:00
7 changed files with 87 additions and 37 deletions
+21
View File
@@ -215,6 +215,7 @@ class programplan extends control
$this->loadModel('project');
$this->app->loadLang('execution');
$this->app->loadLang('stage');
$plan = $this->programplan->getByID($planID);
global $lang;
@@ -332,6 +333,13 @@ class programplan extends control
}
}
/**
* AJAX: Get attributes.
*
* @param int $stageID
* @access public
* @return int
*/
public function ajaxGetAttribute($stageID)
{
$this->app->loadLang('stage');
@@ -346,4 +354,17 @@ class programplan extends control
return print(zget($this->lang->stage->typeList, $attribute));
}
}
/**
* AJAX: Get stage's attribute.
*
* @param int $stageID
* @access public
* @return int
*/
public function ajaxGetStageAttr($stageID)
{
$stage = $this->dao->select('attribute')->from(TABLE_EXECUTION)->where('id')->eq($stageID)->fetch('attribute');
return print($stage);
}
}
+39
View File
@@ -8,3 +8,42 @@ function changeParentStage(stageID)
$("#attribute").chosen();
})
}
$(function()
{
$("#parent").change(function()
{
var parent = $(this).children("option:selected").val();
if(parent == 0)
{
$("#acl").attr('disabled', false);
}
else
{
$("#acl").attr('disabled', true);
}
changeParentStage(parent);
});
$('#submit').click(function(event)
{
if(plan.parent != $('#parent').val() && $('#parent').val() != 0)
{
var result = true;
$.ajaxSettings.async = false;
$.get(createLink('programplan', 'ajaxGetStageAttr', 'stageID=' + $('#parent').val()), function(attribute)
{
if(attribute != 'mix' && plan.attribute != attribute)
{
result = confirm(changeAttrLang.replace('%s', stageTypeList[attribute]));
}
})
$.ajaxSettings.async = true;
if(!result) return false;
}
})
})
+6 -5
View File
@@ -79,11 +79,12 @@ $lang->programplan->delayList = array();
$lang->programplan->delayList[1] = 'Yes';
$lang->programplan->delayList[0] = 'No';
$lang->programplan->noData = 'No Data';
$lang->programplan->children = 'Sub Plan';
$lang->programplan->childrenAB = 'Child';
$lang->programplan->confirmDelete = 'Do you want to delete the current plan?';
$lang->programplan->workloadTips = 'The proportion of the sub stage workload is divided by 100%.';
$lang->programplan->noData = 'No Data';
$lang->programplan->children = 'Sub Plan';
$lang->programplan->childrenAB = 'Child';
$lang->programplan->confirmDelete = 'Do you want to delete the current plan?';
$lang->programplan->confirmChangeAttr = 'The type of the sub-stage will be adjusted to "%s" synchronously according to the type of the parent stage after modification. Do you want to save?';
$lang->programplan->workloadTips = 'The proportion of the sub stage workload is divided by 100%.';
$lang->programplan->stageCustom = new stdClass();
$lang->programplan->stageCustom->date = 'Show Date';
+6 -5
View File
@@ -79,11 +79,12 @@ $lang->programplan->delayList = array();
$lang->programplan->delayList[1] = 'Yes';
$lang->programplan->delayList[0] = 'No';
$lang->programplan->noData = 'No Data';
$lang->programplan->children = 'Sub Plan';
$lang->programplan->childrenAB = 'Child';
$lang->programplan->confirmDelete = 'Do you want to delete the current plan?';
$lang->programplan->workloadTips = 'The workload of the sub stage is divided by 100%.';
$lang->programplan->noData = 'No Data';
$lang->programplan->children = 'Sub Plan';
$lang->programplan->childrenAB = 'Child';
$lang->programplan->confirmDelete = 'Do you want to delete the current plan?';
$lang->programplan->confirmChangeAttr = 'The type of the sub-stage will be adjusted to "%s" synchronously according to the type of the parent stage after modification. Do you want to save?';
$lang->programplan->workloadTips = 'The workload of the sub stage is divided by 100%.';
$lang->programplan->stageCustom = new stdClass();
$lang->programplan->stageCustom->date = 'Show Date';
+6 -5
View File
@@ -79,11 +79,12 @@ $lang->programplan->delayList = array();
$lang->programplan->delayList[1] = 'Yes';
$lang->programplan->delayList[0] = 'No';
$lang->programplan->noData = 'No Data';
$lang->programplan->children = 'Sub Plan';
$lang->programplan->childrenAB = 'Child';
$lang->programplan->confirmDelete = 'Do you want to delete the current plan?';
$lang->programplan->workloadTips = 'The proportion of the sub stage workload is divided by 100%.';
$lang->programplan->noData = 'No Data';
$lang->programplan->children = 'Sub Plan';
$lang->programplan->childrenAB = 'Child';
$lang->programplan->confirmDelete = 'Do you want to delete the current plan?';
$lang->programplan->confirmChangeAttr = 'The type of the sub-stage will be adjusted to "%s" synchronously according to the type of the parent stage after modification. Do you want to save?';
$lang->programplan->workloadTips = 'The proportion of the sub stage workload is divided by 100%.';
$lang->programplan->stageCustom = new stdClass();
$lang->programplan->stageCustom->date = 'Show Date';
+6 -5
View File
@@ -79,11 +79,12 @@ $lang->programplan->delayList = array();
$lang->programplan->delayList[1] = '是';
$lang->programplan->delayList[0] = '否';
$lang->programplan->noData = '暂无数据。';
$lang->programplan->children = '二级计划';
$lang->programplan->childrenAB = '子';
$lang->programplan->confirmDelete = '确定要删除当前计划吗?';
$lang->programplan->workloadTips = '子阶段工作量占比按百分百的比例进行拆分';
$lang->programplan->noData = '暂无数据。';
$lang->programplan->children = '二级计划';
$lang->programplan->childrenAB = '子';
$lang->programplan->confirmDelete = '确定要删除当前计划吗?';
$lang->programplan->confirmChangeAttr = '修改后子阶段的类型将根据父阶段类型同步调整为“%s”,是否保存?';
$lang->programplan->workloadTips = '子阶段工作量占比按百分百的比例进行拆分';
$lang->programplan->stageCustom = new stdClass();
$lang->programplan->stageCustom->date = '显示日期';
+3 -17
View File
@@ -12,6 +12,9 @@
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<?php js::set('plan', $plan);?>
<?php js::set('stageTypeList', $lang->stage->typeList);?>
<?php js::set('changeAttrLang', $lang->programplan->confirmChangeAttr);?>
<div id="mainContent" class="main-content fade">
<div class="center-block">
<div class="main-header">
@@ -99,21 +102,4 @@
</form>
</div>
</div>
<script>
$("#parent").change(function()
{
var parent = $(this).children("option:selected").val();
if(parent == 0)
{
$("#acl").attr('disabled', false);
}
else
{
$("#acl").attr('disabled', true);
}
changeParentStage(parent);
});
</script>
<?php include '../../common/view/footer.html.php';?>