* Correct code and milestone fields on the stage creation page.

This commit is contained in:
chentao
2023-07-19 17:30:26 +08:00
parent 61bb831566
commit 14ec5b35ca
5 changed files with 33 additions and 5 deletions
+2 -2
View File
@@ -30,12 +30,12 @@ $config->programplan->form->create['planIDList'] = array('type' => 'array', 'con
$config->programplan->form->create['orders'] = array('type' => 'array', 'control' => 'text', 'required' => false, 'default' => '');
$config->programplan->form->create['type'] = array('label' => $lang->execution->method, 'type' => 'array', 'control' => 'select', 'required' => true, 'default' => '', 'options' => $lang->execution->typeList);
$config->programplan->form->create['name'] = array('label' => $lang->nameAB, 'type' => 'array', 'control' => 'text', 'required' => true, 'default' => '', 'base' => true);
$config->programplan->form->create['code'] = array('label' => $lang->code, 'type' => 'array', 'control' => 'select', 'required' => false, 'default' => '', 'options' => array());
$config->programplan->form->create['code'] = array('label' => $lang->code, 'type' => 'array', 'control' => 'text', 'required' => false, 'default' => '', 'options' => array());
$config->programplan->form->create['PM'] = array('label' => $lang->programplan->PMAB, 'type' => 'array', 'control' => 'select', 'required' => false, 'default' => '', 'options' => array());
$config->programplan->form->create['percent'] = array('label' => $lang->programplan->percent, 'type' => 'array', 'control' => 'number', 'required' => false, 'default' => 0, 'options' => array());
$config->programplan->form->create['attribute'] = array('label' => $lang->programplan->attribute, 'type' => 'array', 'control' => 'select', 'required' => false, 'default' => 0, 'options' => $lang->stage->typeList);
$config->programplan->form->create['acl'] = array('label' => $lang->programplan->acl, 'type' => 'array', 'control' => 'select', 'required' => false, 'default' => 'open', 'options' => $lang->execution->aclList);
$config->programplan->form->create['milestone'] = array('label' => $lang->programplan->milestone, 'type' => 'array', 'control' => 'select', 'required' => false, 'default' => 0, 'options' => $lang->programplan->milestoneList);
$config->programplan->form->create['milestone'] = array('label' => $lang->programplan->milestone, 'type' => 'array', 'control' => 'radioList','required' => false, 'default' => 0, 'options' => $lang->programplan->milestoneList);
$config->programplan->form->create['begin'] = array('label' => $lang->programplan->begin, 'type' => 'array', 'control' => 'text', 'required' => true, 'default' => '');
$config->programplan->form->create['end'] = array('label' => $lang->programplan->end, 'type' => 'array', 'control' => 'text', 'required' => true, 'default' => '');
$config->programplan->form->create['realBegan'] = array('label' => $lang->programplan->realBegan, 'type' => 'array', 'control' => 'text', 'required' => false, 'default' => '');
+1
View File
@@ -1,2 +1,3 @@
.panel-actions {display: flex; width: 100%; flex-direction: row-reverse; justify-content: space-between;}
menu .panel-actions {width: auto;}
td .check-list {flex-direction:row;}
+21 -1
View File
@@ -8,7 +8,27 @@ window.onRenderRow = function(row, rowIdx, data)
/* Use the flag variable 'setMilestone' to toggle the enable/disable status of the milestone field. */
if(!data.setMilestone)
{
row.children('[data-name=milestone]').children('select').attr('disabled', 'disabled');
let name = '';
let value = '';
const checkBoxList = row.children('[data-name=milestone]').find('input');
Object.values(checkBoxList).forEach(function(ele){
if(typeof ele !== 'object') return;
name = ele.name;
if(ele.checked)
{
value = ele.value;
}
});
checkBoxList.attr('disabled', 'disabled');
/* Append hidden input element for passing value. */
let inputEle = document.createElement('input');
inputEle.setAttribute('name', name);
inputEle.setAttribute('value', value);
inputEle.setAttribute('type', 'hidden');
row.children('[data-name=milestone]').append(inputEle);
}
};
+1 -1
View File
@@ -528,7 +528,7 @@ class programplanModel extends model
$desc = $formData->get('desc');
$orders = $formData->get('orders');
$type = $formData->get('type');
$codes = $formData->get('codes');
$codes = $formData->get('code');
$output = $formData->get('output');
/* Determine if a task has been created under the parent phase. */
+8 -1
View File
@@ -105,11 +105,18 @@ $fnGenerateSubPlanManageFields = function() use ($lang, $planID, $project, $exec
};
/* Generate form fields. */
$fnGenerateFields = function() use ($lang, $requiredFields, $showFields, $fields, $PMUsers, $enableOptionalAttr, $programPlan, $planID, $executionType)
$fnGenerateFields = function() use ($config, $lang, $requiredFields, $showFields, $fields, $PMUsers, $enableOptionalAttr, $programPlan, $planID, $executionType)
{
$items = array();
$items[] = array('name' => 'id', 'label' => $lang->idAB, 'control' => 'index', 'width' => '32px');
/* If enabled set stage code, then append 'code' field to the required fields list. */
if(isset($config->setCode) && $config->setCode == 1)
{
$requiredFields = array_merge($requiredFields, array('code'=> true));
$fields['code']['required'] = true;
}
$renderFields = implode(',', array_keys($requiredFields));
$renderFields = ",$renderFields,$showFields,";