From 680c880b5a696f115447138f0c1ababb0ee0815f Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Fri, 30 Oct 2020 17:32:19 +0800 Subject: [PATCH] * Fix bug. --- module/common/model.php | 2 +- module/issue/model.php | 2 +- module/my/control.php | 2 +- module/my/view/program.html.php | 40 +++++++++++++------------- module/product/control.php | 2 +- module/product/model.php | 2 +- module/program/control.php | 2 +- module/program/model.php | 9 ++++-- module/program/view/prjbrowse.html.php | 1 + module/project/model.php | 4 +-- 10 files changed, 36 insertions(+), 30 deletions(-) diff --git a/module/common/model.php b/module/common/model.php index 466f067780..1cc61db138 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -562,7 +562,7 @@ class commonModel extends model foreach($recentProjects as $key => $project) { if($key == 5) continue; - echo '
  • ' . html::a(helper::createLink('project', 'task', 'projectID=' . $project->id, '', false, $project->parent), $project->name, '', "style='padding: 2px 8px 2px 8px;' class='main-recent-text' title='$project->name'") . '
  • '; + echo '
  • ' . html::a(helper::createLink('project', 'task', 'projectID=' . $project->id, '', false, $project->project), $project->name, '', "style='padding: 2px 8px 2px 8px;' class='main-recent-text' title='$project->name'") . '
  • '; } if(count($recentProjects) > 5) echo '
  • ' . $lang->more . '
  • '; } diff --git a/module/issue/model.php b/module/issue/model.php index 9273b7eb1f..9b68651987 100644 --- a/module/issue/model.php +++ b/module/issue/model.php @@ -279,7 +279,7 @@ class issueModel extends model $issue['createdBy'] = $this->app->user->account; $issue['createdDate'] = $now; - $issue['program'] = $this->session->PRJ; + $issue['PRJ'] = $this->session->PRJ; if($issue['assignedTo']) { diff --git a/module/my/control.php b/module/my/control.php index e9e88676b3..546a4c8fe9 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -422,7 +422,7 @@ class my extends control $this->view->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->myProgram; $this->view->position[] = $this->lang->my->myProgram; $this->view->users = $this->loadModel('user')->getPairs('noletter'); - $this->view->programs = $this->user->getProjects($this->app->user->account, 'project', $pager); + $this->view->projects = $this->user->getProjects($this->app->user->account, 'project', $pager); $this->view->pager = $pager; $this->view->status = $status; $this->display(); diff --git a/module/my/view/program.html.php b/module/my/view/program.html.php index ee3bd0c497..4f0c899acb 100644 --- a/module/my/view/program.html.php +++ b/module/my/view/program.html.php @@ -17,7 +17,7 @@
    - +

    program->noPRJ;?> @@ -45,31 +45,31 @@ - + - id);?> + id);?> - code;?> - + code;?> + - createLink('program', 'pgmview', "programID=$program->id", '', '', $program->id), $program->name);?> + createLink('program', 'index', "projectID=$project->id", '', '', $project->id), $project->name);?> - project->statusList, $program->status, '');?> - begin;?> - end == '0000-00-00' ? '' : $program->end;?> - budget . ' ' . zget($lang->program->unitList, $program->budgetUnit);?> - PM);?> + project->statusList, $project->status, '');?> + begin;?> + end == '0000-00-00' ? '' : $project->end;?> + budget . ' ' . zget($lang->program->unitList, $project->budgetUnit);?> + PM);?> - id", $program, 'list', 'group');?> - id", $program, 'list', 'persons');?> - id", $program, 'list', '', '', 'iframe', true);?> - id", $program, 'list', '', '', 'iframe', true);?> - id", $program, 'list', '', '', 'iframe', true);?> - id", $program, 'list', '', '', 'iframe', true);?> - createLink("program", "edit", "programID=$program->id"), "", '', "class='btn' title='{$lang->edit}'");?> - id", '', 'list', 'treemap-alt', '', '', '', '', $this->lang->program->PRJChildren);?> - createLink("program", "delete", "programID=$program->id"), "", 'hiddenwin', "class='btn' title='{$lang->delete}'");?> + id", $project, 'list', 'group');?> + id", $project, 'list', 'persons');?> + id", $project, 'list', 'start', '', 'iframe', true);?> + id", $project, 'list', 'magic', '', 'iframe', true);?> + id", $project, 'list', 'pause', '', 'iframe', true);?> + id", $project, 'list', 'off', '', 'iframe', true);?> + createLink("program", "edit", "projectID=$project->id"), "", '', "class='btn' title='{$lang->edit}'");?> + id", '', 'list', 'treemap-alt', '', '', '', '', $this->lang->program->PRJChildren);?> + createLink("program", "delete", "projectID=$project->id"), "", 'hiddenwin', "class='btn' title='{$lang->delete}'");?> diff --git a/module/product/control.php b/module/product/control.php index e794fb72ae..66ade4a8f7 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -373,7 +373,7 @@ class product extends control */ public function batchEdit($productID = 0) { - $this->lang->product->switcherMenu = $this->product->getSwitcher(); + $this->lang->product->switcherMenu = ''; if($this->post->names) { $allChanges = $this->product->batchUpdate(); diff --git a/module/product/model.php b/module/product/model.php index ee409f80b5..8178dfea6b 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -446,7 +446,7 @@ class productModel extends model $output .= '

    '; $output .= "
    "; - if($currentProduct->type != 'normal') + if(isset($currentProduct->type) && $currentProduct->type != 'normal') { $branches = $this->loadModel('branch')->getPairs($productID); $branchName = isset($branches[$branch]) ? $branches[$branch] : $branches[0]; diff --git a/module/program/control.php b/module/program/control.php index 4c44ab36da..64f3811957 100644 --- a/module/program/control.php +++ b/module/program/control.php @@ -650,7 +650,7 @@ class program extends control { foreach($recentProjects as $project) { - echo html::a(helper::createLink('project', 'task', 'projectID=' . $project->id, '', false, $project->parent), '' . $project->name, '', "class='text-ellipsis' title='$project->name'"); + echo html::a(helper::createLink('project', 'task', 'projectID=' . $project->id, '', false, $project->project), '' . $project->name, '', "class='text-ellipsis' title='$project->name'"); } } } diff --git a/module/program/model.php b/module/program/model.php index f2158ce6d0..9a2bc5b547 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -980,9 +980,14 @@ class programModel extends model */ public function getPRJRecent() { - return $this->dao->select('id,parent,name')->from(TABLE_PROJECT) + if(!$this->app->user->admin && (empty($this->app->user->view->sprints) || empty($this->app->user->view->projects))) + { + return array(); + } + return $this->dao->select('id,project,name')->from(TABLE_PROJECT) ->where('type')->in('stage,sprint') - ->beginIF(!$this->app->user->admin && $this->app->user->view->projects)->andWhere('parent')->in($this->app->user->view->projects)->fi() + ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->sprints)->fi() + ->beginIF(!$this->app->user->admin)->andWhere('project')->in($this->app->user->view->projects)->fi() ->andWhere('status')->ne('status') ->andWhere('deleted')->eq('0') ->orderBy('id_desc') diff --git a/module/program/view/prjbrowse.html.php b/module/program/view/prjbrowse.html.php index 12a3fe768b..9ac891cf09 100644 --- a/module/program/view/prjbrowse.html.php +++ b/module/program/view/prjbrowse.html.php @@ -96,4 +96,5 @@ js::set('browseType', $browseType); + diff --git a/module/project/model.php b/module/project/model.php index 7bbfa66467..75e7caf336 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2024,8 +2024,8 @@ class projectModel extends model $childSprints = $this->dao->select('id')->from(TABLE_PROJECT)->where('project')->eq($project->id)->andWhere('type')->in('stage,sprint')->andWhere('deleted')->eq('0')->fetchPairs(); $linkedProducts = $this->loadModel('product')->getProductsByProject($project->id); - if(!empty($childSprints)) $this->user->updateUserView($childSprints, 'sprint', $changedAccounts); - if(!empty($linkedProducts)) $this->user->updateUserView(array_keys($linkedProducts), 'product', $changedAccounts); + if(!empty($childSprints)) $this->loadModel('user')->updateUserView($childSprints, 'sprint', $changedAccounts); + if(!empty($linkedProducts)) $this->loadModel('user')->updateUserView(array_keys($linkedProducts), 'product', $changedAccounts); } /* Add iteration or phase team members to the project team. */