diff --git a/module/my/config/table.php b/module/my/config/table.php index ae14d70f0d..a2c8d3fce3 100644 --- a/module/my/config/table.php +++ b/module/my/config/table.php @@ -178,11 +178,12 @@ $config->my->task->actionList['close']['hint'] = $lang->task->close; $config->my->task->actionList['close']['url'] = array('module' => 'task', 'method' => 'close', 'params' => 'taskID={id}'); $config->my->task->actionList['close']['data-toggle'] = 'modal'; -$config->my->task->actionList['record']['icon'] = 'time'; -$config->my->task->actionList['record']['text'] = $lang->task->logEfforts; -$config->my->task->actionList['record']['hint'] = $lang->task->logEfforts; -$config->my->task->actionList['record']['url'] = array('module' => 'task', 'method' => 'recordEstimate', 'params' => 'taskID={id}'); -$config->my->task->actionList['record']['data-toggle'] = 'modal'; +$config->my->task->actionList['record']['icon'] = 'time'; +$config->my->task->actionList['record']['text'] = $lang->task->logEfforts; +$config->my->task->actionList['record']['hint'] = $lang->task->logEfforts; +$config->my->task->actionList['record']['url'] = array('module' => 'task', 'method' => 'recordWorkhour', 'params' => 'taskID={id}'); +$config->my->task->actionList['record']['data-toggle'] = 'modal'; +$config->my->task->actionList['record']['data-position'] = 'center'; $config->my->task->actionList['edit']['icon'] = 'edit'; $config->my->task->actionList['edit']['text'] = $lang->task->edit; diff --git a/module/my/ui/bug.html.php b/module/my/ui/bug.html.php index f16159d2e6..db18e0dd17 100644 --- a/module/my/ui/bug.html.php +++ b/module/my/ui/bug.html.php @@ -56,7 +56,7 @@ $footToolbar = $canBatchAction ? array('items' => array $assignedToItems = array(); foreach ($memberPairs as $key => $value) { - $assignedToItems[] = array('text' => $value, 'class' => 'batch-btn ajax-btn', 'data-url' => createLink('bug', 'batchAssignTo', "assignedTo=$key&productID=0&type=my")); + $assignedToItems[] = array('text' => $value, 'class' => 'batch-btn ajax-btn not-open-url', 'data-url' => createLink('bug', 'batchAssignTo', "assignedTo=$key&productID=0&type=my")); } menu diff --git a/module/my/ui/story.html.php b/module/my/ui/story.html.php index 20a1450566..24a2608c53 100644 --- a/module/my/ui/story.html.php +++ b/module/my/ui/story.html.php @@ -26,10 +26,10 @@ $canBatchClose = common::hasPriv('story', 'batchClose'); $canBatchAction = $canBatchEdit || $canBatchReview || $canBatchAssignTo || $canBatchClose; $footToolbar = array('items' => array ( - $canBatchEdit ? array('text' => $lang->edit, 'className' => 'batch-btn', 'data-url' => helper::createLink('story', 'batchEdit', "productID=0&executionID=0&branch=0&storyType=story&from={$app->rawMethod}")) : null, - $canBatchReview ? array('caret' => 'up', 'text' => $lang->story->review, 'url' => '#navReview', 'data-toggle' => 'dropdown', 'data-placement' => 'top-start') : null, + $canBatchEdit ? array('text' => $lang->edit, 'className' => 'batch-btn', 'data-url' => helper::createLink('story', 'batchEdit', "productID=0&executionID=0&branch=0&storyType=story&from={$app->rawMethod}")) : null, + $canBatchReview ? array('caret' => 'up', 'text' => $lang->story->review, 'url' => '#navReview', 'data-toggle' => 'dropdown', 'data-placement' => 'top-start') : null, $canBatchAssignTo ? array('caret' => 'up', 'text' => $lang->story->assignedTo, 'url' => '#navAssignedTo', 'data-toggle' => 'dropdown', 'data-placement' => 'top-start') : null, - $canBatchClose ? array('text' => $lang->story->close, 'className' => 'batch-btn ajax-btn', 'data-url' => helper::createLink('story', 'batchClose', "productID=0&executionID=0&storyType=story&from={$app->rawMethod}")) : null, + $canBatchClose ? array('text' => $lang->story->close, 'className' => 'batch-btn', 'data-url' => helper::createLink('story', 'batchClose', "productID=0&executionID=0&storyType=story&from={$app->rawMethod}")) : null, ), 'btnProps' => array('size' => 'sm', 'btnType' => 'secondary')); if($canBatchReview) @@ -38,7 +38,7 @@ if($canBatchReview) foreach($lang->story->reasonList as $key => $reason) { if(!$key || $key == 'subdivided' || $key == 'duplicate') continue; - $rejectItems[] = array('text' => $reason, 'class' => 'batch-btn ajax-btn', 'data-url' => helper::createLink('story', 'batchReview', "result=reject&reason={$key}&storyType=story")); + $rejectItems[] = array('text' => $reason, 'class' => 'batch-btn ajax-btn not-open-url', 'data-url' => helper::createLink('story', 'batchReview', "result=reject&reason={$key}&storyType=story")); } $reviewItems = array(); @@ -51,7 +51,7 @@ if($canBatchReview) } else { - $reviewItems[] = array('text' => $result, 'class' => 'batch-btn ajax-btn', 'data-url' => helper::createLink('story', 'batchReview', "result={$key}&reason=&storyType=story")); + $reviewItems[] = array('text' => $result, 'class' => 'batch-btn ajax-btn not-open-url', 'data-url' => helper::createLink('story', 'batchReview', "result={$key}&reason=&storyType=story")); } } @@ -69,7 +69,7 @@ if($canBatchAssignTo) foreach($users as $key => $value) { if(empty($key) || $key == 'closed') continue; - $assignedToItems[] = array('text' => $value, 'class' => 'batch-btn ajax-btn', 'data-url' => helper::createLink('story', 'batchAssignTo', "storyType=story&assignedTo={$key}")); + $assignedToItems[] = array('text' => $value, 'class' => 'batch-btn ajax-btn not-open-url', 'data-url' => helper::createLink('story', 'batchAssignTo', "storyType=story&assignedTo={$key}")); } menu diff --git a/module/story/control.php b/module/story/control.php index 516e4289ac..5bfe91821c 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -975,9 +975,10 @@ class story extends control $storyIdList = array_unique($storyIdList); $this->story->batchReview($storyIdList, $result, $reason); - if(dao::isError()) return print(js::error(dao::getError())); - if(!dao::isError()) $this->loadModel('score')->create('ajax', 'batchOther'); - echo js::reload('parent'); + if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); + + $this->loadModel('score')->create('ajax', 'batchOther'); + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'load' => true)); } /** diff --git a/module/testtask/control.php b/module/testtask/control.php index ee4857cd98..a4de26d63d 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -1007,46 +1007,25 @@ class testtask extends control * Delete a test task. * * @param int $taskID - * @param string $confirm yes|no * @access public * @return void */ - public function delete($taskID, $confirm = 'no') + public function delete($taskID) { - if($confirm == 'no') - { - return print(js::confirm($this->lang->testtask->confirmDelete, inlink('delete', "taskID=$taskID&confirm=yes"))); - } - else - { - $task = $this->testtask->getByID($taskID); - $this->testtask->delete(TABLE_TESTTASK, $taskID); + $task = $this->testtask->getByID($taskID); + $this->testtask->delete(TABLE_TESTTASK, $taskID); - $message = $this->executeHooks($taskID); - if($message) $response['message'] = $message; + $message = $this->executeHooks($taskID); + if($message) $response['message'] = $message; - /* if ajax request, send result. */ - if($this->server->ajax) - { - if(dao::isError()) - { - $response['result'] = 'fail'; - $response['message'] = dao::getError(); - } - else - { - $response['result'] = 'success'; - $response['message'] = ''; - } - return $this->send($response); - } + if(dao::isError()) return $this->send(array('result' => 'success', 'message' => dao::getError())); - $browseList = $this->createLink('testtask', 'browse', "productID=$task->product"); - if($this->app->tab == 'execution') $browseList = $this->createLink('execution', 'testtask', "executionID=$task->execution"); - if($this->app->tab == 'project') $browseList = $this->createLink('project', 'testtask', "projectID=$task->project"); - if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success')); - return print(js::locate($browseList, 'parent')); - } + $browseList = $this->createLink('testtask', 'browse', "productID=$task->product"); + if($this->app->tab == 'execution') $browseList = $this->createLink('execution', 'testtask', "executionID=$task->execution"); + if($this->app->tab == 'project') $browseList = $this->createLink('project', 'testtask', "projectID=$task->project"); + if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success')); + + $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'load' => $this->app->methodName == 'view' ? $browseList : true)); } /**