Merge branch 'sprint/32_zhouxin_46683' into 'master'

Sprint/32 zhouxin 46683

See merge request easycorp/zentaopms!1253
This commit is contained in:
孙广明
2022-01-04 07:48:53 +00:00
5 changed files with 85 additions and 50 deletions
+4
View File
@@ -52,3 +52,7 @@ $config->programplan->datatable->fieldList['actions']['fixed'] = 'right';
$config->programplan->datatable->fieldList['actions']['width'] = '150';
$config->programplan->datatable->fieldList['actions']['required'] = 'yes';
$config->programplan->datatable->fieldList['actions']['sort'] = 'no';
$config->programplan->customCreateFields = 'PM,percent,attribute,acl,milestone,realBegan,realEnd';
$config->programplan->custom = new stdclass();
$config->programplan->custom->createFields = 'PM,percent,attribute,acl,milestone';
+32 -9
View File
@@ -137,15 +137,38 @@ class programplan extends control
$this->view->position[] = html::a($this->createLink('programplan', 'browse', "projectID=$projectID"), $project->name);
$this->view->position[] = $this->lang->programplan->create;
$this->view->productList = $productList;
$this->view->project = $project;
$this->view->productID = $productID ? $productID : key($productList);
$this->view->stages = empty($planID) ? $this->loadModel('stage')->getStages('id_asc') : array();
$this->view->programPlan = $this->project->getById($planID, 'stage');
$this->view->plans = $this->programplan->getStage($planID ? $planID : $projectID, $this->productID, 'parent');
$this->view->planID = $planID;
$this->view->type = 'lists';
$this->view->PMUsers = $this->loadModel('user')->getPairs('noclosed|nodeleted|pmfirst', $project->PM);
$visibleFields = array();
$requiredFields = array();
foreach(explode(',', $this->config->programplan->customCreateFields) as $field) $customFields[$field] = $this->lang->programplan->$field;
$showFields = $this->config->programplan->custom->createFields;
foreach(explode(',', $showFields) as $field)
{
if($field) $visibleFields[$field] = '';
}
foreach(explode(',', $this->config->programplan->create->requiredFields) as $field)
{
if($field)
{
$requiredFields[$field] = '';
if(strpos(",{$this->config->programplan->customCreateFields},", ",{$field},") !== false) $visibleFields[$field] = '';
}
}
$this->view->productList = $productList;
$this->view->project = $project;
$this->view->productID = $productID ? $productID : key($productList);
$this->view->stages = empty($planID) ? $this->loadModel('stage')->getStages('id_asc') : array();
$this->view->programPlan = $this->project->getById($planID, 'stage');
$this->view->plans = $this->programplan->getStage($planID ? $planID : $projectID, $this->productID, 'parent');
$this->view->planID = $planID;
$this->view->type = 'lists';
$this->view->PMUsers = $this->loadModel('user')->getPairs('noclosed|nodeleted|pmfirst', $project->PM);
$this->view->customFields = $customFields;
$this->view->showFields = $showFields;
$this->view->visibleFields = $visibleFields;
$this->view->requiredFields = $requiredFields;
$this->view->colspan = count($visibleFields) + 3;
$this->display();
}
+1
View File
@@ -22,6 +22,7 @@ $lang->programplan->parent = 'Parent Stage';
$lang->programplan->emptyParent = 'N/A';
$lang->programplan->name = 'Stage Name';
$lang->programplan->PM = 'Stage Manager';
$lang->programplan->acl = 'Access Control';
$lang->programplan->subStageName = 'Sub Stage Name';
$lang->programplan->percent = 'Workload Ratio';
$lang->programplan->percentAB = 'Ratio';
+1
View File
@@ -22,6 +22,7 @@ $lang->programplan->parent = '父阶段';
$lang->programplan->emptyParent = '无';
$lang->programplan->name = '阶段名称';
$lang->programplan->PM = '阶段负责人';
$lang->programplan->acl = '访问控制';
$lang->programplan->subStageName = '子阶段名称';
$lang->programplan->percent = '工作量占比';
$lang->programplan->percentAB = '工作量占比';
+47 -41
View File
@@ -40,29 +40,34 @@
<?php $class = $planID == 0 ? '' : "disabled='disabled'"?>
<?php $name = $planID == 0 ? $lang->programplan->name : $lang->programplan->subStageName;?>
<div id='mainContent' class='main-content'>
<div class="pull-right btn-toolbar">
<?php $customLink = $this->createLink('custom', 'ajaxSaveCustomFields', 'module=programplan&section=custom&key=createFields')?>
<?php include '../../common/view/customfield.html.php';?>
</div>
<form class='main-form form-ajax' method='post' id='planForm' enctype='multipart/form-data'>
<div class='table-responsive'>
<table class='table table-form'>
<thead>
<tr class='text-center'>
<th class='required'><?php echo $name;?></th>
<th class='w-110px'><?php echo $lang->programplan->PM;?></th>
<th class='w-110px'>
<th class='c-name required'><?php echo $name;?></th>
<th class='c-pm <?php echo zget($visibleFields, 'PM', ' hidden') . zget($requiredFields, 'PM', '', ' required');?>'><?php echo $lang->programplan->PM;?></th>
<th class='c-percent <?php echo zget($visibleFields, 'percent', ' hidden') . zget($requiredFields, 'percent', '', ' required');?>'>
<?php echo $lang->programplan->percent;?>
<?php if($planID):?>
<i class='icon-help' data-toggle='popover' data-trigger='focus hover' data-placement='right' data-tip-class='text-muted popover-sm' data-container="body" data-content="<?php echo $lang->programplan->workloadTips;?>"></i>
<?php endif;?>
</th>
<th class='w-110px <?php echo $hideAttribute?>'><?php echo $lang->programplan->attribute;?></th>
<th class='w-110px'><?php echo $lang->project->acl;?></th>
<th class='w-110px'><?php echo $lang->programplan->milestone;?></th>
<th class='w-110px required'><?php echo $lang->programplan->begin;?></th>
<th class='w-110px required'><?php echo $lang->programplan->end;?></th>
<th class='w-110px'><?php echo $lang->programplan->realBegan;?></th>
<th class='w-110px'><?php echo $lang->programplan->realEnd;?></th>
<th class='c-attribute <?php echo zget($visibleFields, 'attribute', ' hidden') . zget($requiredFields, 'attribute', '', ' required');?> <?php echo $hideAttribute?>'><?php echo $lang->programplan->attribute;?></th>
<th class='c-acl <?php echo zget($visibleFields, 'acl', ' hidden') . zget($requiredFields, 'acl', '', ' required');?>'><?php echo $lang->programplan->acl;?></th>
<th class='c-milestone w-110px <?php echo zget($visibleFields, 'milestone', ' hidden') . zget($requiredFields, 'milestone', '', ' required');?>'><?php echo $lang->programplan->milestone;?></th>
<th class='c-date required'><?php echo $lang->programplan->begin;?></th>
<th class='c-date required'><?php echo $lang->programplan->end;?></th>
<th class='c-date <?php echo zget($visibleFields, 'realBegan', ' hidden') . zget($requiredFields, 'realBegan', '', ' required');?>'><?php echo $lang->programplan->realBegan;?></th>
<th class='c-date <?php echo zget($visibleFields, 'realEnd', ' hidden') . zget($requiredFields, 'realEnd', '', ' required');?>'><?php echo $lang->programplan->realEnd;?></th>
<?php if(isset($this->config->qcVersion)):?>
<th class='w-110px'><?php echo $lang->programplan->output;?></th>
<?php endif;?>
<th class="w-70px text-center"> <?php echo $lang->actions;?></th>
<th class="c-action text-center w-110px"> <?php echo $lang->actions;?></th>
</tr>
</thead>
<tbody>
@@ -71,20 +76,20 @@
<?php foreach($stages as $stage):?>
<tr>
<td><input type='text' name='names[<?php echo $i;?>]' id='names<?php echo $i;?>' value='<?php echo $stage->name;?>' class='form-control' /></td>
<td><?php echo html::select("PM[$i]", $PMUsers, '', "class='form-control chosen'");?></td>
<td>
<td <?php echo zget($visibleFields, 'PM', ' hidden') . zget($requiredFields, 'PM', '', ' required');?>><?php echo html::select("PM[$i]", $PMUsers, $stage->PM, "class='form-control chosen'");?></td>
<td <?php echo zget($visibleFields, 'percent', ' hidden') . zget($requiredFields, 'percent', '', ' required');?>>
<div class='input-group'>
<input type='text' name='percents[<?php echo $i;?>]' id='percent<?php echo $i;?>' value='<?php echo $stage->percent;?>' class='form-control'/>
<span class='input-group-addon'>%</span>
</div>
</td>
<td class='<?php echo $hideAttribute?>'><?php echo html::select("attributes[$i]", $lang->stage->typeList, $stage->type, "class='form-control'");?></td>
<td><?php echo html::select("acl[$i]", $lang->project->aclList, 'open', "class='form-control' $class");?></td>
<td><?php echo html::radio("milestone[$i]", $lang->programplan->milestoneList, 0);?></td>
<td class='<?php echo $hideAttribute?> <?php echo zget($visibleFields, 'attribute', ' hidden') . zget($requiredFields, 'attribute', '', ' required');?>'><?php echo html::select("attributes[$i]", $lang->stage->typeList, $stage->type, "class='form-control'");?></td>
<td class='<?php echo zget($visibleFields, 'acl', ' hidden') . zget($requiredFields, 'acl', '', ' required');?>'><?php echo html::select("acl[$i]", $lang->project->aclList, 'open', "class='form-control' $class");?></td>
<td <?php echo zget($visibleFields, 'milestone', ' hidden') . zget($requiredFields, 'milestone', '', ' required');?>><?php echo html::radio("milestone[$i]", $lang->programplan->milestoneList, 0);?></td>
<td><input type='text' name='begin[<?php echo $i;?>]' id='begin<?php echo $i;?>' value='' class='form-control form-date' /></td>
<td><input type='text' name='end[<?php echo $i;?>]' id='end<?php echo $i;?>' value='' class='form-control form-date' /></td>
<td><input type='text' name='realBegan[<?php echo $i;?>]' id='realBegan<?php echo $i;?>' value='' class='form-control form-date' /></td>
<td><input type='text' name='realEnd[<?php echo $i;?>]' id='realEnd<?php echo $i;?>' value='' class='form-control form-date' /></td>
<td <?php echo zget($visibleFields, 'realBegan', ' hidden') . zget($requiredFields, 'realBegan', '', ' required');?>><input type='text' name='realBegan[<?php echo $i;?>]' id='realBegan<?php echo $i;?>' value='' class='form-control form-date' /></td>
<td <?php echo zget($visibleFields, 'realEnd', ' hidden') . zget($requiredFields, 'realEnd', '', ' required');?>><input type='text' name='realEnd[<?php echo $i;?>]' id='realEnd<?php echo $i;?>' value='' class='form-control form-date' /></td>
<?php if(isset($this->config->qcVersion)):?>
<td><?php echo html::select("output[$i][]", $documentList, '', "class='form-control chosen' multiple");?></td>
<?php endif;?>
@@ -103,20 +108,20 @@
<?php echo html::hidden("planIDList[$i]", $plan->id);?>
<tr>
<td><input type='text' name="names[<?php echo $i;?>]" id='names<?php echo $i;?>' value='<?php echo $plan->name;?>' class='form-control' /></td>
<td><?php echo html::select("PM[$i]", $PMUsers, '', "class='form-control chosen'");?></td>
<td>
<td <?php echo zget($visibleFields, 'PM', ' hidden') . zget($requiredFields, 'PM', '', ' required');?>><?php echo html::select("PM[$i]", $PMUsers, $plan->PM, "class='form-control chosen'");?></td>
<td <?php echo zget($visibleFields, 'percent', ' hidden') . zget($requiredFields, 'percent', '', ' required');?>>
<div class='input-group'>
<input type='text' name='percents[<?php echo $i;?>]' id='percent<?php echo $i;?>' value='<?php echo $plan->percent;?>' class='form-control' />
<span class='input-group-addon'>%</span>
</div>
</td>
<td class='<?php echo $hideAttribute?>'><?php echo html::select("attributes[$i]", $lang->stage->typeList, $plan->attribute, "class='form-control'");?></td>
<td><?php echo html::select("acl[$i]", $lang->project->aclList, $plan->acl, "class='form-control' $class");?></td>
<td><?php echo html::radio("milestone[$i]", $lang->programplan->milestoneList, $plan->milestone, $disabled);?></td>
<td class='<?php echo $hideAttribute?> <?php echo zget($visibleFields, 'attribute', ' hidden') . zget($requiredFields, 'attribute', '', ' required');?>'><?php echo html::select("attributes[$i]", $lang->stage->typeList, $plan->attribute, "class='form-control'");?></td>
<td <?php echo zget($visibleFields, 'acl', ' hidden') . zget($requiredFields, 'acl', '', ' required');?>><?php echo html::select("acl[$i]", $lang->project->aclList, $plan->acl, "class='form-control' $class");?></td>
<td <?php echo zget($visibleFields, 'milestone', ' hidden') . zget($requiredFields, 'milestone', '', ' required');?>><?php echo html::radio("milestone[$i]", $lang->programplan->milestoneList, $plan->milestone, $disabled);?></td>
<td><input type='text' name='begin[<?php echo $i;?>] ' id='begin<?php echo $i;?>' value='<?php echo $plan->begin;?>' class='form-control form-date' /></td>
<td><input type='text' name='end[<?php echo $i;?>]' id='end<?php echo $i;?>' value='<?php echo $plan->end;?>' class='form-control form-date' /></td>
<td><input type='text' name='realBegan[<?php echo $i;?>] ' id='realBegan<?php echo $i;?>' value='<?php echo $plan->realBegan;?>' class='form-control form-date' /></td>
<td><input type='text' name='realEnd[<?php echo $i;?>]' id='realEnd<?php echo $i;?>' value='<?php echo $plan->realEnd;?>' class='form-control form-date' /></td>
<td <?php echo zget($visibleFields, 'realBegan', ' hidden') . zget($requiredFields, 'realBegan', '', ' required');?>><input type='text' name='realBegan[<?php echo $i;?>] ' id='realBegan<?php echo $i;?>' value='<?php echo $plan->realBegan;?>' class='form-control form-date' /></td>
<td <?php echo zget($visibleFields, 'realEnd', ' hidden') . zget($requiredFields, 'realEnd', '', ' required');?>><input type='text' name='realEnd[<?php echo $i;?>]' id='realEnd<?php echo $i;?>' value='<?php echo $plan->realEnd;?>' class='form-control form-date' /></td>
<?php if(isset($this->config->qcVersion)):?>
<?php $option = empty($plan->output) ? 0 : explode(',', $plan->output);?>
<td><?php echo html::select("output[$i][]", $documentList, $option, "class='form-control chosen' multiple");?></td>
@@ -132,20 +137,20 @@
<?php for($j = 0; $j < 5; $j ++):?>
<tr class='addedItem'>
<td><input type='text' name='names[<?php echo $i;?>]' id='names<?php echo $i;?>' value='' class='form-control' /></td>
<td><?php echo html::select("PM[$i]", $PMUsers, '', "class='form-control chosen'");?></td>
<td>
<td <?php echo zget($visibleFields, 'PM', ' hidden') . zget($requiredFields, 'PM', '', ' required');?>><?php echo html::select("PM[$i]", $PMUsers, '', "class='form-control chosen'");?></td>
<td <?php echo zget($visibleFields, 'percent', ' hidden') . zget($requiredFields, 'percent', '', ' required');?>>
<div class='input-group'>
<input type='text' name='percents[<?php echo $i;?>]' id='percent<?php echo $i;?>' value='' class='form-control' />
<span class='input-group-addon'>%</span>
</div>
</td>
<td class='<?php echo $hideAttribute?>'><?php echo html::select("attributes[$i]", $lang->stage->typeList, '', "class='form-control'");?></td>
<td><?php echo html::select("acl[$i]", $lang->project->aclList, 'open', "class='form-control' $class");?></td>
<td><?php echo html::radio("milestone[$i]", $lang->programplan->milestoneList, 0);?></td>
<td class='<?php echo $hideAttribute?> <?php echo zget($visibleFields, 'attribute', ' hidden') . zget($requiredFields, 'attribute', '', ' required');?>'><?php echo html::select("attributes[$i]", $lang->stage->typeList, '', "class='form-control'");?></td>
<td <?php echo zget($visibleFields, 'acl', ' hidden') . zget($requiredFields, 'acl', '', ' required');?>><?php echo html::select("acl[$i]", $lang->project->aclList, 'open', "class='form-control' $class");?></td>
<td <?php echo zget($visibleFields, 'milestone', ' hidden') . zget($requiredFields, 'milestone', '', ' required');?>><?php echo html::radio("milestone[$i]", $lang->programplan->milestoneList, 0);?></td>
<td><input type='text' name='begin[<?php echo $i;?>] ' id='begin<?php echo $i;?>' value='' class='form-control form-date' /></td>
<td><input type='text' name='end[<?php echo $i;?>]' id='end<?php echo $i;?>' value='' class='form-control form-date' /></td>
<td><input type='text' name='realBegan[<?php echo $i;?>] ' id='realBegan<?php echo $i;?>' value='' class='form-control form-date' /></td>
<td><input type='text' name='realEnd[<?php echo $i;?>]' id='realEnd<?php echo $i;?>' value='' class='form-control form-date' /></td>
<td <?php echo zget($visibleFields, 'realBegan', ' hidden') . zget($requiredFields, 'realBegan', '', ' required');?>><input type='text' name='realBegan[<?php echo $i;?>] ' id='realBegan<?php echo $i;?>' value='' class='form-control form-date' /></td>
<td <?php echo zget($visibleFields, 'realEnd', ' hidden') . zget($requiredFields, 'realEnd', '', ' required');?>><input type='text' name='realEnd[<?php echo $i;?>]' id='realEnd<?php echo $i;?>' value='' class='form-control form-date' /></td>
<?php if(isset($this->config->qcVersion)):?>
<td><?php echo html::select("output[$i][]", $documentList, '', "class='form-control chosen' multiple");?></td>
<?php endif;?>
@@ -159,11 +164,12 @@
</tbody>
<tfoot>
<tr>
<?php $colspan = $planID == 0 ? 9 : 8;?>
<?php $colspan = $planID == 0 ? $colspan : $colspan - 1;?>
<td colspan='<?php echo $colspan?>' class='text-center form-actions'><?php echo html::submitButton() . ' ' . html::backButton(); ?></td>
</tr>
</tfoot>
</table>
</div>
<?php js::set('i', $i);?>
</form>
</div>
@@ -172,25 +178,25 @@
<table class='hidden'>
<tr id='addItem' class='hidden'>
<td><input type='text' name='<?php echo "names[$i]";?>' id='names<?php echo $i;?>' class='form-control' /></td>
<td><?php echo html::select("PM[$i]", $PMUsers, '', "class='form-control chosen' id='PM$i'");?></td>
<td <?php echo zget($visibleFields, 'PM', ' hidden') . zget($requiredFields, 'PM', '', ' required');?>><?php echo html::select("PM[$i]", $PMUsers, '', "class='form-control chosen' id='PM$i'");?></td>
<?php echo html::hidden("planIDList[$i]", 0);?>
<td>
<td <?php echo zget($visibleFields, 'percent', ' hidden') . zget($requiredFields, 'percent', '', ' required');?>>
<div class='input-group'>
<input type='text' name='<?php echo "percents[$i]";?>' id='percent<?php echo $i;?>' class='form-control' />
<span class='input-group-addon'>%</span>
</div>
</td>
<td class='<?php echo $hideAttribute?>'><?php echo html::select("attributes[$i]", $lang->stage->typeList, '', "class='form-control'");?></td>
<td><?php echo html::select("acl[$i]", $lang->project->aclList, 'open', "class='form-control' $class");?></td>
<td><?php echo html::radio("milestone[$i]", $lang->programplan->milestoneList, 0);?></td>
<td class='<?php echo $hideAttribute?> <?php echo zget($visibleFields, 'attribute', ' hidden') . zget($requiredFields, 'attribute', '', ' required');?>'><?php echo html::select("attributes[$i]", $lang->stage->typeList, '', "class='form-control'");?></td>
<td <?php echo zget($visibleFields, 'acl', ' hidden') . zget($requiredFields, 'acl', '', ' required');?>><?php echo html::select("acl[$i]", $lang->project->aclList, 'open', "class='form-control' $class");?></td>
<td <?php echo zget($visibleFields, 'milestone', ' hidden') . zget($requiredFields, 'milestone', '', ' required');?>><?php echo html::radio("milestone[$i]", $lang->programplan->milestoneList, 0);?></td>
<td><input type='text' name='<?php echo "begin[$i]";?>' id='begin<?php echo $i;?>' class='form-control form-date' /></td>
<td><input type='text' name='<?php echo "end[$i]";?>' id='end<?php echo $i;?>' class='form-control form-date' /></td>
<td><input type='text' name='<?php echo "realBegan[$i]";?>' id='realBegan<?php echo $i;?>' class='form-control form-date' /></td>
<td><input type='text' name='<?php echo "realEnd[$i]";?>' id='realEnd<?php echo $i;?>' class='form-control form-date' /></td>
<td <?php echo zget($visibleFields, 'realBegan', ' hidden') . zget($requiredFields, 'realBegan', '', ' required');?>><input type='text' name='<?php echo "realBegan[$i]";?>' id='realBegan<?php echo $i;?>' class='form-control form-date' /></td>
<td <?php echo zget($visibleFields, 'realEnd', ' hidden') . zget($requiredFields, 'realEnd', '', ' required');?>><input type='text' name='<?php echo "realEnd[$i]";?>' id='realEnd<?php echo $i;?>' class='form-control form-date' /></td>
<?php if(isset($this->config->qcVersion)):?>
<td><?php echo html::select("output[$i][]", $documentList, '', "class='form-control chosen ' multiple");?></td>
<?php endif;?>
<td class='c-actions text-center'>
<td class='c-actions'>
<a href='javascript:;' onclick='addItem(this)' class='btn btn-link'><i class='icon-plus'></i></a>
<a href='javascript:;' onclick='deleteItem(this)' class='btn btn-link'><i class='icon icon-close'></i></a>
</td>