diff --git a/lib/front/front.class.php b/lib/front/front.class.php index 1d4c3f8582..91641384f4 100644 --- a/lib/front/front.class.php +++ b/lib/front/front.class.php @@ -190,13 +190,6 @@ 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 11922e8c6b..47491ef04b 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -294,10 +294,10 @@ 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}"); + if($this->app->getViewType() == 'xhtml') $location = $this->createLink('bug', 'view', "bugID=$bugID"); $response['locate'] = $location; $this->send($response); } @@ -601,7 +601,6 @@ 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 c759952ddc..4deb163d97 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -310,10 +310,10 @@ 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); + if($this->app->getViewType() == 'xhtml') $link = $this->createLink('doc', 'view', "docID=$docID"); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $link)); } @@ -386,7 +386,6 @@ 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/doc/js/x.create.js b/module/doc/js/x.create.js new file mode 100644 index 0000000000..dfcc7eeb63 --- /dev/null +++ b/module/doc/js/x.create.js @@ -0,0 +1,9 @@ +window.injectWithXXC = function(message) +{ + $('#title').val(message.content); + if(message.type == 'url') + { + $('#typeurl').attr('checked', 'checked'); + $('input[name="type"]').change(); + } +} diff --git a/module/story/control.php b/module/story/control.php index b319a78c85..feeb48e404 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -113,7 +113,6 @@ 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; @@ -124,6 +123,7 @@ class story extends control $moduleID = $this->post->module ? $this->post->module : 0; $response['locate'] = $this->createLink('project', 'story', "projectID=$projectID&branch=&browseType=byModule&moduleID=$moduleID"); if($projectID == 0) $response['locate'] = $this->createLink('story', 'view', "storyID=$storyID"); + if($this->app->getViewType() == 'xhtml') $response['locate'] = $this->createLink('story', 'view', "storyID=$storyID"); $this->send($response); } @@ -425,7 +425,6 @@ 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)); @@ -609,7 +608,6 @@ 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')); } @@ -754,7 +752,6 @@ 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 3a208ac944..46ecb8b6f2 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -124,7 +124,6 @@ class task extends control } /* If link from no head then reload*/ - if($this->app->getViewType() == 'xhtml') die(js::closeXXModal()); if(isonlybody()) { $response['locate'] = 'reload'; @@ -139,6 +138,13 @@ class task extends control } /* Locate the browser. */ + if($this->app->getViewType() == 'xhtml') + { + $taskLink = $this->createLink('task', 'view', "taskID=$taskID"); + $response['locate'] = $taskLink; + $this->send($response); + } + if($this->post->after == 'continueAdding') { $response['message'] = $this->lang->task->successSaved . $this->lang->task->afterChoices['continueAdding']; @@ -311,7 +317,6 @@ 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 b3b19cf329..0adfbd2e6d 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -562,7 +562,6 @@ 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 a4d1722de2..8a18e5c109 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -855,8 +855,6 @@ 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 10e12aabc3..c902d01c65 100644 --- a/module/todo/control.php +++ b/module/todo/control.php @@ -62,7 +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($this->app->getViewType() == 'xhtml') die(js::locate($this->createLink('todo', 'view', "todoID=$todoID"), 'parent')); if(isonlybody()) die(js::locate($this->createLink('my', 'todo', "type=$date"), 'parent.parent')); die(js::locate($this->createLink('my', 'todo', "type=$date"), 'parent')); } diff --git a/xuanxuan/module/message/ext/model/class/xuanxuan.class.php b/xuanxuan/module/message/ext/model/class/xuanxuan.class.php index 4051ae9bc8..3fecafbf76 100644 --- a/xuanxuan/module/message/ext/model/class/xuanxuan.class.php +++ b/xuanxuan/module/message/ext/model/class/xuanxuan.class.php @@ -15,7 +15,9 @@ class xuanxuanMessage extends messageModel $field = $this->config->action->objectNameFields[$objectType]; $title = $this->app->user->realname . $this->lang->action->label->$actionType . $this->lang->action->objectTypes[$objectType]; $text = $title . ' ' . "[#{$objectID}::{$object->$field}]"; - $url = common::getSysURL() . helper::createLink($objectType, 'view', "id=$objectID"); + + unset($_GET['onlybody']); + $url = common::getSysURL() . helper::createLink($objectType, 'view', "id=$objectID", 'html'); $target = ''; if(!empty($object->assignedTo)) $target .= $object->assignedTo;