From 91cab4543002ef26385e99e649dbc728e52b7049 Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Thu, 24 Sep 2020 13:57:14 +0800 Subject: [PATCH] * Jump to project jump link. --- module/program/control.php | 16 +++++++++------- module/program/model.php | 3 ++- module/program/view/pgmproject.html.php | 2 +- module/program/view/prjbrowse.html.php | 2 +- module/program/view/prjgroup.html.php | 2 +- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/module/program/control.php b/module/program/control.php index 90a643dc06..364354e8d9 100644 --- a/module/program/control.php +++ b/module/program/control.php @@ -609,6 +609,8 @@ class program extends control $this->lang->program->switcherMenu = $this->program->getPGMCommonAction() . $this->program->getPGMSwitcher($programID); $this->program->setPGMViewMenu($programID); + $this->app->session->set('PRJBrowse', $this->app->getURI(true)); + /* Load pager and get tasks. */ $this->app->loadClass('pager', $static = true); $pager = new pager($recTotal, $recPerPage, $pageID); @@ -967,7 +969,6 @@ class program extends control public function PRJGroup($projectID = 0, $programID = 0) { $this->lang->navGroup->program = 'project'; - $this->session->set('PRJ', $projectID); $title = $this->lang->company->orgView . $this->lang->colon . $this->lang->group->browse; $position[] = $this->lang->group->browse; @@ -975,12 +976,15 @@ class program extends control $groupUsers = array(); foreach($groups as $group) $groupUsers[$group->id] = $this->group->getUserPairs($group->id); + $goback = $this->session->PRJBrowse ? $this->session->PRJBrowse : inLink('PRJBrowse', "programID=$programID"); + $this->view->title = $title; $this->view->position = $position; $this->view->groups = $groups; $this->view->projectID = $projectID; $this->view->programID = $programID; $this->view->groupUsers = $groupUsers; + $this->view->goback = $goback; $this->display(); } @@ -996,7 +1000,6 @@ class program extends control public function PRJCreateGroup($projectID = 0, $programID = 0) { $this->lang->navGroup->program = 'project'; - $this->session->set('PRJ', $projectID); if(!empty($_POST)) { @@ -1023,7 +1026,6 @@ class program extends control public function PRJManageView($groupID, $projectID, $programID) { $this->lang->navGroup->program = 'project'; - $this->session->set('PRJ', $projectID); if($_POST) { @@ -1123,7 +1125,6 @@ class program extends control public function PRJManageMembers($projectID, $dept = '') { $this->lang->navGroup->program = 'project'; - $this->session->set('PRJ', $projectID); if(!empty($_POST)) { @@ -1172,6 +1173,7 @@ class program extends control if(isonlybody()) die(js::closeModal('parent.parent', 'this')); die(js::locate($this->createLink('group', 'browse'), 'parent')); } + $group = $this->group->getById($groupID); $groupUsers = $this->group->getUserPairs($groupID); $allUsers = $this->loadModel('dept')->getDeptUserPairs($deptID); @@ -1393,7 +1395,7 @@ class program extends control * @access public * @return void */ - public function PRJDelete($projectID, $confirm = 'no', $from = 'PRJ', $programID = 0) + public function PRJDelete($projectID, $confirm = 'no') { if($confirm == 'no') { @@ -1408,8 +1410,8 @@ class program extends control $this->project->updateUserView($projectID); $this->session->set('project', ''); - $link = $from == 'PRJ' ? inLink('PRJBrowse', 'programID=' . $programID) : inLink('PGMProject', 'programID=' . $programID); - die(js::locate($link, 'parent')); + $url = $this->session->PRJBrowse ? $this->session->PRJBrowse : inLink('PRJBrowse'); + die(js::locate($url, 'parent')); } } diff --git a/module/program/model.php b/module/program/model.php index 23ed336a24..0202873aa3 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -857,6 +857,7 @@ class programModel extends model return $this->dao->select('*')->from(TABLE_PROJECT) ->where('type')->in('project,program') ->andWhere('status')->ne('closed') + ->andWhere('deleted')->eq('0') ->beginIF($projectID > 0)->andWhere('path')->like($path . '%')->fi() ->orderBy('grade desc, `order`') ->get(); @@ -876,7 +877,7 @@ class programModel extends model ->where('type')->eq('project') ->beginIF($programID)->andWhere('parent')->eq($programID)->fi() ->andWhere('model')->eq($model) - ->andWhere('deleted')->eq(0) + ->andWhere('deleted')->eq('0') ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->programs)->fi() ->orderBy('id_desc') ->fetchPairs(); diff --git a/module/program/view/pgmproject.html.php b/module/program/view/pgmproject.html.php index e7cdd639c5..312c5ba368 100644 --- a/module/program/view/pgmproject.html.php +++ b/module/program/view/pgmproject.html.php @@ -88,7 +88,7 @@ js::set('browseType', $browseType); id", $project, 'list', 'pause', '', 'iframe', true);?> id", $project, 'list', 'off', '', 'iframe', true);?> createLink("program", "PRJEdit", "programID=$project->id"), "", '', "class='btn' title='{$lang->edit}'");?> - id&confirm=no&from=PGM&programID=$programID", $project, 'list', 'trash', 'hiddenwin', '', true);?> + id", $project, 'list', 'trash', 'hiddenwin', '', true);?> diff --git a/module/program/view/prjbrowse.html.php b/module/program/view/prjbrowse.html.php index 0277d0f9e6..982a584713 100644 --- a/module/program/view/prjbrowse.html.php +++ b/module/program/view/prjbrowse.html.php @@ -107,7 +107,7 @@ js::set('browseType', $browseType); id", $project, 'list', 'pause', '', 'iframe', true);?> id", $project, 'list', 'off', '', 'iframe', true);?> createLink("program", "PRJEdit", "programID=$project->id"), "", '', "class='btn' title='{$lang->edit}'");?> - id&confirm=no&from=PRJ&programID=$programID", $project, 'list', 'trash', 'hiddenwin', '', true);?> + id", $project, 'list', 'trash', 'hiddenwin', '', true);?> diff --git a/module/program/view/prjgroup.html.php b/module/program/view/prjgroup.html.php index aa4afb8ea0..8ddb244e9b 100644 --- a/module/program/view/prjgroup.html.php +++ b/module/program/view/prjgroup.html.php @@ -15,7 +15,7 @@ group->confirmDelete);?>