diff --git a/lib/front/front.class.php b/lib/front/front.class.php index 91641384f4..1d4c3f8582 100644 --- a/lib/front/front.class.php +++ b/lib/front/front.class.php @@ -190,6 +190,13 @@ class html extends baseHTML */ class js extends baseJS { + static public function closeXXModal($window = 'self') + { + $js = "'; + return $js; + } } /** diff --git a/module/bug/control.php b/module/bug/control.php index a677d1bcb6..11922e8c6b 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -294,6 +294,7 @@ class bug extends control $this->action->create('todo', $output['todoID'], 'finished', '', "BUG:$bugID"); } + if($this->app->getViewType() == 'xhtml') die(js::closeXXModal()); if(defined('RUN_MODE') && RUN_MODE == 'api') $this->send(array('status' => 'success', 'data' => $bugID)); $location = $this->createLink('bug', 'browse', "productID={$this->post->product}&branch=$branch&type=byModule¶m={$this->post->module}"); @@ -600,6 +601,7 @@ class bug extends control $actionID = $this->action->create('bug', $bugID, $action, $fileAction . $this->post->comment); $this->action->logHistory($actionID, $changes); } + if($this->app->getViewType() == 'xhtml') die(js::closeXXModal('parent')); if(defined('RUN_MODE') && RUN_MODE == 'api') $this->send(array('status' => 'success', 'data' => $bugID)); $bug = $this->bug->getById($bugID); if($bug->toTask != 0) diff --git a/module/doc/control.php b/module/doc/control.php index c406cab72d..c759952ddc 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -310,6 +310,7 @@ class doc extends control $this->send(array('result' => 'fail', 'message' => sprintf($this->lang->duplicate, $this->lang->doc->common), 'locate' => $this->createLink('doc', 'view', "docID=$docID"))); } $this->action->create('doc', $docID, 'Created'); + if($this->app->getViewType() == 'xhtml') die(js::closeXXModal()); $vars = "libID=$libID&browseType=byModule&moduleID={$this->post->module}&orderBy=id_desc&from=$this->from"; $link = $this->createLink('doc', 'browse', $vars); @@ -385,6 +386,7 @@ class doc extends control $actionID = $this->action->create('doc', $docID, $action, $fileAction . $this->post->comment); if(!empty($changes)) $this->action->logHistory($actionID, $changes); } + if($this->app->getViewType() == 'xhtml') die(js::closeXXModal()); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('doc', 'view', "docID=$docID"))); } diff --git a/module/story/control.php b/module/story/control.php index bc5dd02993..b319a78c85 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -113,6 +113,7 @@ class story extends control $this->action->create('todo', $todoID, 'finished', '', "STORY:$storyID"); } + if($this->app->getViewType() == 'xhtml') die(js::closeXXModal()); if($this->post->newStory) { $response['message'] = $this->lang->story->successSaved . $this->lang->story->newStory; @@ -424,6 +425,7 @@ class story extends control $actionID = $this->action->create('story', $storyID, $action, $this->post->comment); $this->action->logHistory($actionID, $changes); } + if($this->app->getViewType() == 'xhtml') die(js::closeXXModal('parent')); if(defined('RUN_MODE') && RUN_MODE == 'api') { die(array('status' => 'success', 'data' => $storyID)); @@ -607,6 +609,7 @@ class story extends control $actionID = $this->action->create('story', $storyID, $action, $fileAction . $this->post->comment); $this->action->logHistory($actionID, $changes); } + if($this->app->getViewType() == 'xhtml') die(js::closeXXModal('parent')); die(js::locate($this->createLink('story', 'view', "storyID=$storyID"), 'parent')); } @@ -751,6 +754,7 @@ class story extends control { $this->action->create('story', $storyID, 'Closed', '', ucfirst($this->post->closedReason)); } + if($this->app->getViewType() == 'xhtml') die(js::closeXXModal('parent')); die(js::locate(inlink('view', "storyID=$storyID"), 'parent')); } diff --git a/module/task/control.php b/module/task/control.php index 84e90f1880..3a208ac944 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -124,6 +124,7 @@ class task extends control } /* If link from no head then reload*/ + if($this->app->getViewType() == 'xhtml') die(js::closeXXModal()); if(isonlybody()) { $response['locate'] = 'reload'; @@ -310,6 +311,7 @@ class task extends control if(!empty($changes)) $this->action->logHistory($actionID, $changes); } + if($this->app->getViewType() == 'xhtml') die(js::closeXXModal('parent')); if($task->fromBug != 0) { foreach($changes as $change) diff --git a/module/testcase/control.php b/module/testcase/control.php index 0adfbd2e6d..b3b19cf329 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -562,6 +562,7 @@ class testcase extends control $actionID = $this->action->create('case', $caseID, $action, $fileAction . $this->post->comment); $this->action->logHistory($actionID, $changes); } + if($this->app->getViewType() == 'xhtml') die(js::closeXXModal('parent')); die(js::locate($this->createLink('testcase', 'view', "caseID=$caseID"), 'parent')); } diff --git a/module/testtask/control.php b/module/testtask/control.php index 8a18e5c109..a4d1722de2 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -855,6 +855,8 @@ class testtask extends control } else { + if($this->app->getViewType() == 'xhtml') die(js::closeXXModal()); + $response['result'] = 'success'; $response['locate'] = 'reload'; $response['target'] = 'parent'; diff --git a/module/todo/control.php b/module/todo/control.php index a2b9d7a105..10e12aabc3 100644 --- a/module/todo/control.php +++ b/module/todo/control.php @@ -62,6 +62,7 @@ class todo extends control $this->send(array('result' => 'success', 'id' => $todoID, 'name' => $todo->name, 'pri' => $todo->pri, 'priName' => $this->lang->todo->priList[$todo->pri], 'time' => date(DT_DATE4, strtotime($todo->date)) . ' ' . $todo->begin)); } + if($this->app->getViewType() == 'xhtml') die(js::closeXXModal('parent')); if(isonlybody()) die(js::locate($this->createLink('my', 'todo', "type=$date"), 'parent.parent')); die(js::locate($this->createLink('my', 'todo', "type=$date"), 'parent')); }