This commit is contained in:
tianshujie98
2021-01-18 15:09:36 +08:00
21 changed files with 105 additions and 70 deletions
+1
View File
@@ -94,6 +94,7 @@ class custom extends control
{
$data = fixer::input('post')->join('unitList', ',')->get();
if(empty($data->unitList)) $this->send(array('result' => 'fail', 'message' => $this->lang->custom->currencyNotEmpty));
if(empty($data->mainCurrency)) $this->send(array('result' => 'fail', 'message' => $this->lang->custom->mainCurrencyNotEmpty));
$this->loadModel('setting')->setItems("system.$module", $data);
}
elseif($module == 'story' and $field == 'review')
+22
View File
@@ -13,3 +13,25 @@ $(function()
$('#' + module + 'Tab').addClass('btn-active-text');
$('#' + field + 'Tab').addClass('active');
})
$('[name*=unitList]').change(function()
{
var mainCurrency = $('#mainCurrency').val();
$('#mainCurrency').empty().append('<option></option>');
$('[name*=unitList]').each(function()
{
if($(this).prop('checked'))
{
var text = $(this).parent().html();
var firstStr = $(this).val() + '">';
text = text.substring(text.lastIndexOf(firstStr) + firstStr.length, text.lastIndexOf('<'));
$('#mainCurrency').append("<option value='" + $(this).val() + "'>" + text + '</option>');
}
});
$('#mainCurrency').val(mainCurrency);
$("#mainCurrency").trigger("chosen:updated");
});
$('[name*=unitList]').change();
+4 -3
View File
@@ -67,9 +67,10 @@ $lang->custom->tipCostList['CV'] = 'Cost Variance(CV%)';
$lang->custom->tipRangeList[0] = 'No';
$lang->custom->tipRangeList[1] = 'Yes';
$lang->custom->regionMustNumber = 'The interval must be a number!';
$lang->custom->tipNotEmpty = 'The prompt can not be empty!';
$lang->custom->currencyNotEmpty = 'You have to select one currency at least.';
$lang->custom->regionMustNumber = 'The interval must be a number!';
$lang->custom->tipNotEmpty = 'The prompt can not be empty!';
$lang->custom->currencyNotEmpty = 'You have to select one currency at least.';
$lang->custom->mainCurrencyNotEmpty = 'The main currency can not bu empty';
$lang->custom->numberError = 'The interval must be greater than zero!';
+4 -3
View File
@@ -67,9 +67,10 @@ $lang->custom->tipCostList['CV'] = 'Cost Variance(CV%)';
$lang->custom->tipRangeList[0] = 'No';
$lang->custom->tipRangeList[1] = 'Yes';
$lang->custom->regionMustNumber = 'The interval must be a number!';
$lang->custom->tipNotEmpty = 'The prompt can not be empty!';
$lang->custom->currencyNotEmpty = 'You have to select one currency at least.';
$lang->custom->regionMustNumber = 'The interval must be a number!';
$lang->custom->tipNotEmpty = 'The prompt can not be empty!';
$lang->custom->currencyNotEmpty = 'You have to select one currency at least.';
$lang->custom->mainCurrencyNotEmpty = 'The main currency can not bu empty';
$lang->custom->numberError = 'The interval must be greater than zero!';
+4 -3
View File
@@ -67,9 +67,10 @@ $lang->custom->tipCostList['CV'] = 'Cost Variance(CV%)';
$lang->custom->tipRangeList[0] = 'No';
$lang->custom->tipRangeList[1] = 'Yes';
$lang->custom->regionMustNumber = 'The interval must be a number!';
$lang->custom->tipNotEmpty = 'The prompt can not be empty!';
$lang->custom->currencyNotEmpty = 'You have to select one currency at least.';
$lang->custom->regionMustNumber = 'The interval must be a number!';
$lang->custom->tipNotEmpty = 'The prompt can not be empty!';
$lang->custom->currencyNotEmpty = 'You have to select one currency at least.';
$lang->custom->mainCurrencyNotEmpty = 'The main currency can not bu empty';
$lang->custom->numberError = 'The interval must be greater than zero!';
+4 -3
View File
@@ -67,9 +67,10 @@ $lang->custom->tipCostList['CV'] = 'Cost Variance(CV%)';
$lang->custom->tipRangeList[0] = 'No';
$lang->custom->tipRangeList[1] = 'Yes';
$lang->custom->regionMustNumber = 'The interval must be a number!';
$lang->custom->tipNotEmpty = 'The prompt can not be empty!';
$lang->custom->currencyNotEmpty = 'You have to select one currency at least.';
$lang->custom->regionMustNumber = 'The interval must be a number!';
$lang->custom->tipNotEmpty = 'The prompt can not be empty!';
$lang->custom->currencyNotEmpty = 'You have to select one currency at least.';
$lang->custom->mainCurrencyNotEmpty = 'The main currency can not bu empty';
$lang->custom->numberError = 'The interval must be greater than zero!';
+4 -3
View File
@@ -67,9 +67,10 @@ $lang->custom->tipCostList['CV'] = '成本偏差率(CV%)';
$lang->custom->tipRangeList[0] = '否';
$lang->custom->tipRangeList[1] = '是';
$lang->custom->regionMustNumber = '区间必须是数字';
$lang->custom->tipNotEmpty = '提示语不能为空';
$lang->custom->currencyNotEmpty = '至少选择一种货币';
$lang->custom->regionMustNumber = '区间必须是数字';
$lang->custom->tipNotEmpty = '提示语不能为空';
$lang->custom->currencyNotEmpty = '至少选择一种货币';
$lang->custom->mainCurrencyNotEmpty = '主要货币不能为空';
$lang->custom->numberError = '区间必须大于零';
+4 -3
View File
@@ -64,9 +64,10 @@ $lang->custom->tipCostList['CV'] = '成本偏差率(CV%)';
$lang->custom->tipRangeList[0] = '否';
$lang->custom->tipRangeList[1] = '是';
$lang->custom->regionMustNumber = '區間必須是數字';
$lang->custom->tipNotEmpty = '提示語不能為空';
$lang->custom->currencyNotEmpty = '至少選擇一種貨幣';
$lang->custom->regionMustNumber = '區間必須是數字';
$lang->custom->tipNotEmpty = '提示語不能為空';
$lang->custom->currencyNotEmpty = '至少選擇一種貨幣';
$lang->custom->mainCurrencyNotEmpty = '主要貨幣不能為空';
$lang->custom->numberError = '區間必須大於零';
+2 -4
View File
@@ -57,16 +57,14 @@ EOT;
<?php if($module == 'program' and $field == 'unitList'):?>
<table class='table table-form'>
<tr>
<th class='text-left'><?php echo $lang->custom->program->currencySetting;?></th>
<th class='<?php echo strpos($this->app->getClientLang(), 'zh') === false ? 'w-120px' : 'w-70px';?> text-left'><?php echo $lang->custom->program->currencySetting;?></th>
</tr>
<tr>
<td colspan='4'><?php echo html::checkbox('unitList', $lang->program->unitList, $unitList);?></td>
<td colspan='5'><?php echo html::checkbox('unitList', $lang->program->unitList, $unitList);?></td>
</tr>
<tr>
<th class='text-left'><?php echo $lang->custom->program->mainCurrency;?></th>
<td><?php echo html::select('mainCurrency', $lang->program->unitList, $mainCurrency, "class='form-control chosen' required");?></td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan='4' class='text-center'><?php echo html::submitButton();?></td>
+1 -1
View File
@@ -23,7 +23,7 @@
<table align='center' class='table table-form'>
<tr>
<th><?php echo $lang->group->name;?></th>
<td><?php echo html::input('name', $group->name, "class='form-control'");?></td>
<td class='required'><?php echo html::input('name', $group->name, "class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->group->desc;?></th>
+1
View File
@@ -361,6 +361,7 @@
reload: reloadTab,
updateUrl: updateTabUrl,
getGroup: getGroupFromUrl,
getLastTab: getLastTab,
openedTabs: openedTabs,
groupsMap: groupsMap
};
+1 -1
View File
@@ -37,7 +37,7 @@ include '../../common/view/header.html.php';
<?php foreach($users as $user):?>
<tr>
<td class='c-id'><?php printf('%03d', $user->id);?></td>
<td><?php if(!common::printLink('user', 'view', "userID=$user->id&from=my", $user->realname, '', "title='$user->realname'")) echo $user->realname;?></td>
<td><?php if(!common::printLink('user', 'view', "userID=$user->id&from=my", $user->realname, '', "title='$user->realname' data-group='my'")) echo $user->realname;?></td>
<td><?php echo $user->account;?></td>
<td class="w-90px" title='<?php echo zget($lang->user->roleList, $user->role, '');?>'><?php echo zget($lang->user->roleList, $user->role, '');?></td>
<td class="c-url" title="<?php echo $user->email;?>"><?php echo html::mailto($user->email);?></td>
+1 -1
View File
@@ -206,7 +206,7 @@ class product extends control
}
/* Process the sql, get the conditon partion, save it to session. */
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story', $browseType != 'bysearch');
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story', $browseType != 'bysearch' && $this->app->rawModule != 'projectstory');
/* Get related tasks, bugs, cases count of each story. */
$storyIdList = array();
+29 -22
View File
@@ -213,7 +213,7 @@ class program extends control
$this->view->PGMList = $this->program->getPGMList();
$this->view->budgetUnitList = $this->program->getBudgetUnitList();
$this->view->parentProgram = $parentProgram;
$this->view->remainBudget = $this->program->getParentRemainBudget($parentProgram);
$this->view->remainBudget = $this->program->getParentRemainBudget($parentProgram) + $program->budget;
$this->display();
}
@@ -887,31 +887,34 @@ class program extends control
}
}
$allProducts = $this->program->getPGMProductPairs($programID);
$allProducts = $this->program->getPGMProductPairs($programID);
$parentProgram = $this->program->getPGMByID($programID);
$this->view->title = $this->lang->program->PRJCreate;
$this->view->position[] = $this->lang->program->PRJCreate;
$this->view->pmUsers = $this->loadModel('user')->getPairs('noclosed|nodeleted|pmfirst');
$this->view->users = $this->user->getPairs('noclosed|nodeleted');
$this->view->copyProjects = $this->program->getPRJPairsByModel();
$this->view->products = $products;
$this->view->allProducts = array('0' => '') + $allProducts;
$this->view->productPlans = array('0' => '') + $productPlans;
$this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products));
$this->view->programID = $programID;
$this->view->model = $model;
$this->view->name = $name;
$this->view->code = $code;
$this->view->team = $team;
$this->view->acl = $acl;
$this->view->auth = $auth;
$this->view->whitelist = $whitelist;
$this->view->copyProjectID = $copyProjectID;
$this->view->from = $from;
$this->view->programList = $this->program->getParentPairs();
$this->view->parentProgram = $this->program->getPGMByID($programID);
$this->view->URSRPairs = $this->loadModel('custom')->getURSRPairs();
$this->view->pmUsers = $this->loadModel('user')->getPairs('noclosed|nodeleted|pmfirst');
$this->view->users = $this->user->getPairs('noclosed|nodeleted');
$this->view->copyProjects = $this->program->getPRJPairsByModel();
$this->view->products = $products;
$this->view->allProducts = array('0' => '') + $allProducts;
$this->view->productPlans = array('0' => '') + $productPlans;
$this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products));
$this->view->programID = $programID;
$this->view->model = $model;
$this->view->name = $name;
$this->view->code = $code;
$this->view->team = $team;
$this->view->acl = $acl;
$this->view->auth = $auth;
$this->view->whitelist = $whitelist;
$this->view->copyProjectID = $copyProjectID;
$this->view->from = $from;
$this->view->programList = $this->program->getParentPairs();
$this->view->parentProgram = $parentProgram;
$this->view->URSRPairs = $this->loadModel('custom')->getURSRPairs();
$this->view->remainBudget = $this->program->getParentRemainBudget($parentProgram);
$this->view->budgetUnitList = $this->program->getBudgetUnitList();
$this->display();
}
@@ -963,6 +966,7 @@ class program extends control
$productPlans = array(0 => '');
$allProducts = $programID != $project->parent ? $this->program->getPGMProductPairs($programID) : $this->program->getPGMProductPairs($project->parent, 'assign', 'noclosed');
$linkedProducts = $programID != $project->parent ? array() : $this->project->getProducts($projectID);
$parentProgram = $this->program->getPGMByID($programID);
foreach($linkedProducts as $product)
{
@@ -989,6 +993,9 @@ class program extends control
$this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($linkedProducts), '', $linkedBranches);
$this->view->URSRPairs = $this->loadModel('custom')->getURSRPairs();
$this->view->from = $from;
$this->view->parentProgram = $parentProgram;
$this->view->remainBudget = $this->program->getParentRemainBudget($parentProgram) + $project->budget;
$this->view->budgetUnitList = $this->program->getBudgetUnitList();
$this->display();
}
+5 -16
View File
@@ -293,7 +293,7 @@ class programModel extends model
if($program->budget != 0 and $parentProgram->budget != 0)
{
$parentRemainBudget = $this->getParentRemainBudget($parentProgram);
if($program->budget > $parentRemainBudget + $program->budget) dao::$errors['budget'] = $this->lang->program->beyondParentBudget;
if($program->budget > $parentRemainBudget + $oldProgram->budget) dao::$errors['budget'] = $this->lang->program->beyondParentBudget;
}
}
if(dao::isError()) return false;
@@ -1389,13 +1389,8 @@ class programModel extends model
/* The budget of a child project cannot beyond the remaining budget of the parent program. */
if(isset($project->budget) and $parentProgram->budget != 0)
{
$childGrade = $parentProgram->grade + 1;
$childSumBudget = $this->dao->select("sum(budget) as sumBudget")->from(TABLE_PROJECT)
->where('path')->like("%{$project->parent}%")
->andWhere('grade')->eq($childGrade)
->fetch('sumBudget');
if($project->budget > $parentProgram->budget - $childSumBudget) dao::$errors['budget'] = $this->lang->program->beyondParentBudget;
$parentRemainBudget = $this->getParentRemainBudget($parentProgram);
if($project->budget > $parentRemainBudget) dao::$errors['budget'] = $this->lang->program->beyondParentBudget;
}
/* Judge products not empty. */
@@ -1573,14 +1568,8 @@ class programModel extends model
/* The budget of a child project cannot beyond the remaining budget of the parent program. */
if($project->budget != 0 and $parentProgram->budget != 0)
{
$childGrade = $parentProgram->grade + 1;
$childSumBudget = $this->dao->select("sum(budget) as sumBudget")->from(TABLE_PROJECT)
->where('path')->like("%{$project->parent}%")
->andWhere('grade')->eq($childGrade)
->andWhere('id')->ne($projectID)
->fetch('sumBudget');
if($project->budget > $parentProgram->budget - $childSumBudget) dao::$errors['budget'] = $this->lang->program->beyondParentBudget;
$parentRemainBudget = $this->getParentRemainBudget($parentProgram);
if($project->budget > $parentRemainBudget + $oldProject->budget) dao::$errors['budget'] = $this->lang->program->beyondParentBudget;
}
}
+1 -1
View File
@@ -66,7 +66,7 @@
<th><?php echo $lang->program->PGMBudget;?></th>
<td>
<div class='input-group'>
<?php $placeholder = $parentProgram and $parentProgram->budget != 0 ? 'placeholder=' . $lang->program->PGMParentBudget . $remainBudget : '';?>
<?php $placeholder = ($parentProgram and $parentProgram->budget != 0) ? 'placeholder=' . $lang->program->PGMParentBudget . $remainBudget : '';?>
<?php echo html::input('budget', '', "class='form-control' " . (strpos($requiredFields, 'budget') !== false ? 'required ' : '') . $placeholder);?>
<?php if($parentProgram):?>
<span class='input-group-addon fix-border'><?php echo zget($budgetUnitList, $parentProgram->budgetUnit);?></span>
+1 -1
View File
@@ -44,7 +44,7 @@
<th><?php echo $lang->program->PGMBudget;?></th>
<td>
<div class='input-group'>
<?php $placeholder = $parentProgram and $parentProgram->budget != 0 ? 'placeholder=' . $lang->program->PGMParentBudget . $remainBudget : '';?>
<?php $placeholder = ($parentProgram and $parentProgram->budget != 0) ? 'placeholder=' . $lang->program->PGMParentBudget . $remainBudget : '';?>
<?php echo html::input('budget', $program->budget != 0 ? $program->budget : '', "class='form-control' " . (strpos($requiredFields, 'budget') !== false ? 'required ' : '') . ($program->budget == 0 ? 'disabled ' : '') . $placeholder);?>
<?php if($parentProgram):?>
<span class='input-group-addon'><?php echo zget($budgetUnitList, $program->budgetUnit);?></span>
+7 -2
View File
@@ -51,9 +51,14 @@
<th><?php echo $lang->program->PRJBudget;?></th>
<td>
<div class='input-group'>
<?php echo html::input('budget', '', "class='form-control' " . (strpos($requiredFields, 'budget') !== false ? ' required' : ''));?>
<?php $placeholder = ($parentProgram and $parentProgram->budget != 0) ? 'placeholder=' . $lang->program->PGMParentBudget . $remainBudget : '';?>
<?php echo html::input('budget', '', "class='form-control' " . (strpos($requiredFields, 'budget') !== false ? 'required ' : '') . $placeholder);?>
<?php if($parentProgram):?>
<span class='input-group-addon'><?php echo zget($budgetUnitList, $parentProgram->budgetUnit);?></span>
<?php else:?>
<span class='input-group-addon'></span>
<?php echo html::select('budgetUnit', $lang->program->unitList, empty($parentProgram->budgetUnit) ? 'wanyuan' : $parentProgram->budgetUnit, "class='form-control'");?>
<?php echo html::select('budgetUnit', $budgetUnitList, $config->program->mainCurrency, "class='form-control'");?>
<?php endif;?>
</div>
</td>
<td>
+7 -2
View File
@@ -53,9 +53,14 @@
<th><?php echo $lang->program->PRJBudget;?></th>
<td>
<div class='input-group'>
<?php echo html::input('budget', $project->budget != 0 ? $project->budget : '', "class='form-control' " . (strpos($requiredFields, 'budget') !== false ? ' required' : '') . ($project->budget == 0 ? 'disabled' : ''));?>
<?php $placeholder = ($parentProgram and $parentProgram->budget != 0) ? 'placeholder=' . $lang->program->PGMParentBudget . $remainBudget : '';?>
<?php echo html::input('budget', $project->budget != 0 ? $project->budget : '', "class='form-control' " . (strpos($requiredFields, 'budget') !== false ? 'required ' : '') . ($project->budget == 0 ? 'disabled ' : '') . $placeholder);?>
<?php if($parentProgram):?>
<span class='input-group-addon'><?php echo zget($budgetUnitList, $project->budgetUnit);?></span>
<?php else:?>
<span class='input-group-addon'></span>
<?php echo html::select('budgetUnit', $lang->program->unitList, $project->budgetUnit, "class='form-control'");?>
<?php echo html::select('budgetUnit', $budgetUnitList, $project->budgetUnit, "class='form-control'");?>
<?php endif;?>
</div>
</td>
<td>
+1
View File
@@ -644,6 +644,7 @@ class programplanModel extends model
$childrenTotalPercent = $this->getTotalPercent($parentStage, true);
$childrenTotalPercent = $plan->parent == $oldPlan->parent ? ($childrenTotalPercent - $oldPlan->percent + $plan->percent) : ($childrenTotalPercent + $plan->percent);
if($childrenTotalPercent > 100) return dao::$errors['percent'][] = $this->lang->programplan->error->percentOver;
/* If child plan has milestone, update parent plan set milestone eq 0 . */
if($plan->milestone and $parentStage->milestone) $this->dao->update(TABLE_PROJECT)->set('milestone')->eq(0)->where('id')->eq($oldPlan->parent)->exec();
+1 -1
View File
@@ -36,7 +36,7 @@
<th class='w-110px'>
<?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-content=<?php echo $lang->programplan->workloadTips;?>></i>
<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>