From e6879f283d3fb3d10ed91af96ac4144c794d77c4 Mon Sep 17 00:00:00 2001 From: z Date: Wed, 26 Aug 2020 10:19:39 +0800 Subject: [PATCH 1/4] * adjust code for update. --- module/program/model.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/program/model.php b/module/program/model.php index 2575f62164..241b941be5 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -353,10 +353,10 @@ class programModel extends model ->get(); $program = $this->loadModel('file')->processImgURL($program, $this->config->program->editor->edit['id'], $this->post->uid); - if(!empty($program->isCat) and $this->checkHasContent($programID)) dao::$errors['isCat'] = $this->lang->program->cannotChangeToCat; - if(empty($program->isCat) and $this->checkHasChildren($programID)) dao::$errors['isCat'] = $this->lang->program->cannotCancelCat; + if(!$oldProgram->isCat and !empty($program->isCat) and $this->checkHasContent($programID)) dao::$errors['isCat'] = $this->lang->program->cannotChangeToCat; + if($oldProgram->isCat and empty($program->isCat) and $this->checkHasChildren($programID)) dao::$errors['isCat'] = $this->lang->program->cannotCancelCat; - if($program->isCat) + if(!empty($program->isCat)) { $minChildBegin = $this->dao->select('min(begin) as minBegin')->from(TABLE_PROJECT)->where('id')->ne($programID)->andWhere('deleted')->eq(0)->andWhere('path')->like("%,{$programID},%")->fetch('minBegin'); $maxChildEnd = $this->dao->select('max(end) as maxEnd')->from(TABLE_PROJECT)->where('id')->ne($programID)->andWhere('deleted')->eq(0)->andWhere('path')->like("%,{$programID},%")->fetch('maxEnd'); From c8e660380a190ac8583bfdcb0abd201e8d5c8623 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Wed, 26 Aug 2020 10:20:32 +0800 Subject: [PATCH 2/4] * Fix bug #3397,3398,3399. --- module/risk/js/common.js | 26 ++++++++++++++++++++++++++ module/risk/view/batchcreate.html.php | 2 +- module/risk/view/view.html.php | 6 +++--- 3 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 module/risk/js/common.js diff --git a/module/risk/js/common.js b/module/risk/js/common.js new file mode 100644 index 0000000000..f315512f29 --- /dev/null +++ b/module/risk/js/common.js @@ -0,0 +1,26 @@ +$(function() +{ + $('#riskindex').attr('readonly', true); + $('#pri').attr('disabled', true); + computeIndex(); + function computeIndex() + { + var impact = $('#impact').val(); + var probability = $('#probability').val(); + var riskindex = parseInt(impact * probability); + var pri = ''; + if(0 < riskindex && riskindex <= 5) pri = 'low'; + if(5 < riskindex && riskindex <= 12) pri = 'middle'; + if(15 <= riskindex && riskindex <= 25) pri = 'high'; + + $('#riskindex').val(riskindex); + $('#pri').val(pri); + $('#pri').trigger("chosen:updated") + $('#pri').chosen(); + $('#pri').attr('disabled', true); + $('input[name="pri"]').remove(); + $('#pri').after(""); + } + + $('#impact, #probability').change(function(){computeIndex()}); +}) diff --git a/module/risk/view/batchcreate.html.php b/module/risk/view/batchcreate.html.php index 454bc77718..22a2e0af8e 100644 --- a/module/risk/view/batchcreate.html.php +++ b/module/risk/view/batchcreate.html.php @@ -8,7 +8,7 @@ risk->id;?> - risk->name;?> + risk->name;?> risk->source;?> risk->category;?> risk->strategy;?> diff --git a/module/risk/view/view.html.php b/module/risk/view/view.html.php index f80420bd91..e0af11b318 100644 --- a/module/risk/view/view.html.php +++ b/module/risk/view/view.html.php @@ -78,7 +78,7 @@ risk->strategy;?> - risk->strategy, $risk->strategy);?> + risk->strategyList, $risk->strategy);?> risk->status;?> @@ -86,11 +86,11 @@ risk->impact;?> - risk->impact, $risk->impact);?> + risk->impactList, $risk->impact);?> risk->probability;?> - risk->probability, $risk->probability);?> + risk->probabilityList, $risk->probability);?> risk->riskindex;?> From 31b533eac1985cb4ea76bd27e97001222105443b Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Wed, 26 Aug 2020 10:24:28 +0800 Subject: [PATCH 3/4] * Fix bug #3404. --- module/risk/control.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/module/risk/control.php b/module/risk/control.php index 916a0d0a0f..21a37ffc06 100644 --- a/module/risk/control.php +++ b/module/risk/control.php @@ -15,6 +15,9 @@ class risk extends control */ public function browse($browseType = 'all', $param = '', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { + $uri = $this->app->getURI(true); + $this->session->set('riskList', $uri); + $queryID = ($browseType == 'bysearch') ? (int)$param : 0; /* Build the search form. */ $actionURL = $this->createLink('risk', 'browse', "browseType=bysearch&queryID=myQueryID"); From 518ca3027e415cfb330b5885d06a6a634fdbbed6 Mon Sep 17 00:00:00 2001 From: z Date: Wed, 26 Aug 2020 10:30:41 +0800 Subject: [PATCH 4/4] * adjust for en lang. --- module/program/lang/en.php | 68 +++++++++++++++----------------------- 1 file changed, 26 insertions(+), 42 deletions(-) diff --git a/module/program/lang/en.php b/module/program/lang/en.php index 8f88d6f2b4..d726527a92 100644 --- a/module/program/lang/en.php +++ b/module/program/lang/en.php @@ -35,17 +35,6 @@ $lang->program->begin = 'Begin'; $lang->program->end = 'End'; $lang->program->status = 'Status'; $lang->program->PM = 'Project Manager'; -$lang->program->create = 'Create'; -$lang->program->createGuide = 'Select the project template'; -$lang->program->browse = 'Program List'; -$lang->program->edit = 'Edit'; -$lang->program->all = 'All'; -$lang->program->start = 'Start'; -$lang->program->finish = 'Finish'; -$lang->program->suspend = 'Suspend'; -$lang->program->delete = 'Delete'; -$lang->program->close = 'Close'; -$lang->program->activate = 'Activate'; $lang->program->budget = 'Budget'; $lang->program->dateRange = 'Date Range'; $lang->program->to = ' to '; @@ -69,19 +58,12 @@ $lang->program->doneStories = 'Done stories'; $lang->program->leftStories = 'Left stories'; $lang->program->allInput = 'All Input'; $lang->program->weekly = 'Program Weekly'; - - $lang->program->pv = 'PV'; $lang->program->ev = 'EV'; $lang->program->sv = 'SV%'; $lang->program->ac = 'AC'; $lang->program->cv = 'CV%'; $lang->program->pm = 'PM'; - -$lang->program->manageGroupMember = 'Manage Group Members'; -$lang->program->durationEstimation = 'Workload estimate'; -$lang->program->noProgram = 'No projects'; -$lang->program->accessDenied = 'You do not have access to this project!'; $lang->program->teamCount = 'The Number Of Team'; $lang->program->unitList[''] = ''; @@ -112,27 +94,29 @@ $lang->program->statusList['doing'] = 'Doing'; $lang->program->statusList['suspended'] = 'Suspended'; $lang->program->statusList['closed'] = 'Closed'; -$lang->program->noProgram = 'No Program'; -$lang->program->accessDenied = 'Has No Access To The Program'; -$lang->program->chooseProgramType = 'Choose management type'; -$lang->program->nextStep = 'Next step'; -$lang->program->hoursUnit = '%s hours'; -$lang->program->membersUnit = '%s members'; -$lang->program->lastIteration = 'Latest iterations'; -$lang->program->ongoingStage = 'Ongoing stage'; -$lang->program->scrum = 'Scrum'; -$lang->program->scrumTitle = 'Scrum development full process project management'; -$lang->program->scrumDesc = 'Introduction: Iterate in small steps, release quickly
Contains function points: Project overview, iterations, plans, stories, etc.'; -$lang->program->cmmi = 'CMMI'; -$lang->program->cmmiTitle = 'CMMI management'; -$lang->program->cmmiDesc = 'Introduction: Standardized management by stages
Contains function points: Estimate, plan, stage, report, etc.'; -$lang->program->cannotCreateChild = 'The project already has actual content and can not add subprojects directly. You can create a parent project for the current project and then add a child project under the new parent project.'; -$lang->program->hasChildren = 'This project has a subproject and can not be deleted.'; -$lang->program->confirmDelete = 'Do you want to delete this project?'; -$lang->program->emptyPM = 'No program manager'; -$lang->program->hasChildren = 'This project has a subproject and can not be deleted.'; -$lang->program->confirmDelete = "Are you sure you want to delete the item [% s ] ?"; -$lang->program->cannotChangeToCat = "The project already has the actual content and can not be modified as a parent project"; -$lang->program->cannotCancelCat = "There are already children under this project. You can not unmark the parent project"; -$lang->program->cannotChangeToCat = "The project already has the actual content and can not be modified as a parent project"; -$lang->program->cannotCancelCat = "There are already children under this project. You can not unmark the parent project"; +$lang->program->noProgram = 'No Program'; +$lang->program->accessDenied = 'Has No Access To The Program'; +$lang->program->chooseProgramType = 'Choose management type'; +$lang->program->nextStep = 'Next step'; +$lang->program->hoursUnit = '%s hours'; +$lang->program->membersUnit = '%s members'; +$lang->program->lastIteration = 'Latest iterations'; +$lang->program->ongoingStage = 'Ongoing stage'; +$lang->program->scrum = 'Scrum'; +$lang->program->scrumTitle = 'Scrum development full process project management'; +$lang->program->scrumDesc = 'Introduction: Iterate in small steps, release quickly
Contains function points: Project overview, iterations, plans, stories, etc.'; +$lang->program->cmmi = 'CMMI'; +$lang->program->cmmiTitle = 'CMMI management'; +$lang->program->cmmiDesc = 'Introduction: Standardized management by stages
Contains function points: Estimate, plan, stage, report, etc.'; +$lang->program->cannotCreateChild = 'The project already has actual content and can not add subprojects directly. You can create a parent project for the current project and then add a child project under the new parent project.'; +$lang->program->hasChildren = 'This project has a subproject and can not be deleted.'; +$lang->program->confirmDelete = 'Do you want to delete this project?'; +$lang->program->emptyPM = 'No program manager'; +$lang->program->cannotChangeToCat = "The project already has the actual content and can not be modified as a parent project"; +$lang->program->cannotCancelCat = "There are already children under this project. You can not unmark the parent project"; +$lang->program->parentBeginEnd = "Begin and end date of parent project: %s ~ %s"; +$lang->program->parentBudget = "Parent project budget: %s"; +$lang->program->beginLetterParent = "Begin date of parent project: %s, Begin date cannot be less than the begin date of parent project."; +$lang->program->endGreaterParent = "End date of parent project: %s, End date cannot be greater than the end date of parent project."; +$lang->program->beginGreateChild = "Minimum begin date of child project: %s, the begin date of parent project cannot be greater than the minimum begin date of child project."; +$lang->program->endLetterChild = "Maximum end date of child project: %s, the end date of parent project cannot be less than the maximum end date of child project.";