diff --git a/module/project/control.php b/module/project/control.php index bdf641474d..3c561f7fd4 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -447,10 +447,11 @@ class project extends control * Edit a project. * * @param int $projectID + * @param string $from * @access public * @return void */ - public function edit($projectID = 0) + public function edit($projectID = 0, $from = '') { $this->loadModel('action'); $this->loadModel('custom'); @@ -485,7 +486,7 @@ class project extends control if(isonlybody()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); - $locateLink = $this->session->projectList ? $this->session->projectList : inLink('view', "projectID=$projectID"); + $locateLink = ($this->session->projectList and $from != 'view') ? $this->session->projectList : inLink('view', "projectID=$projectID"); return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locateLink)); } @@ -609,7 +610,6 @@ class project extends control } $this->project->setMenu($projectID); - $this->session->set('projectList', $this->app->getURI(true), 'project'); $products = $this->loadModel('product')->getProducts($projectID); $linkedBranches = array(); diff --git a/module/project/view/view.html.php b/module/project/view/view.html.php index 96df6f4b10..9d938a30fd 100644 --- a/module/project/view/view.html.php +++ b/module/project/view/view.html.php @@ -104,7 +104,7 @@ echo $this->buildOperateMenu($project, 'view'); echo "
"; - common::printIcon('project', 'edit', $params, $project, 'button', 'edit', '', '', '', '', $lang->edit); + common::printIcon('project', 'edit', $params . '&from=view', $project, 'button', 'edit', '', '', '', '', $lang->edit); common::printIcon('project', 'delete', $params, $project, 'button', 'trash', 'hiddenwin', '', '', '', $lang->delete); } ?>