diff --git a/module/bug/control.php b/module/bug/control.php index 498efd42d6..ed4c37eebb 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -61,7 +61,7 @@ class bug extends control * @access public * @return void */ - public function browse($productID = 0, $browseType = 'byModule', $param = 0, $orderBy = '', $recTotal = 0, $recPerPage = 20, $pageID = 1) + public function browse($productID = 0, $browseType = 'all', $param = 0, $orderBy = '', $recTotal = 0, $recPerPage = 20, $pageID = 1) { /* Set browseType, productID, moduleID and queryID. */ $browseType = strtolower($browseType); @@ -148,21 +148,20 @@ class bug extends control $position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); $position[] = $this->lang->bug->common; - $this->view->title = $title; - $this->view->position = $position; - $this->view->productID = $productID; - $this->view->productName = $this->products[$productID]; - $this->view->moduleTree = $this->tree->getTreeMenu($productID, $viewType = 'bug', $startModuleID = 0, array('treeModel', 'createBugLink')); - $this->view->browseType = $browseType; - $this->view->bugs = $bugs; - $this->view->users = $users; - $this->view->pager = $pager; - $this->view->param = $param; - $this->view->orderBy = $orderBy; - $this->view->moduleID = $moduleID; - $this->view->customed = $customed; - $this->view->customFields= explode(',', str_replace(' ', '', trim($customFields))); - $this->view->treeClass = $browseType == 'bymodule' ? '' : 'hidden'; + $this->view->title = $title; + $this->view->position = $position; + $this->view->productID = $productID; + $this->view->productName = $this->products[$productID]; + $this->view->moduleTree = $this->tree->getTreeMenu($productID, $viewType = 'bug', $startModuleID = 0, array('treeModel', 'createBugLink')); + $this->view->browseType = $browseType; + $this->view->bugs = $bugs; + $this->view->users = $users; + $this->view->pager = $pager; + $this->view->param = $param; + $this->view->orderBy = $orderBy; + $this->view->moduleID = $moduleID; + $this->view->customed = $customed; + $this->view->customFields = explode(',', str_replace(' ', '', trim($customFields))); $this->display(); } @@ -668,6 +667,25 @@ class bug extends control $this->view->actions = $this->action->getList('bug', $bugID); $this->display(); } + + /** + * Batch confirm. + * + * @access public + * @return void + */ + public function batchConfirm() + { + $bugIDList = $this->post->bugIDList ? $this->post->bugIDList : die(js::locate($this->session->bugList, 'parent')); + $this->bug->batchConfirm($bugIDList); + if(dao::isError()) die(js::error(dao::getError())); + foreach($bugIDList as $bugID) + { + $actionID = $this->action->create('bug', $bugID, 'bugConfirmed'); + $this->sendmail($bugID, $actionID); + } + die(js::locate($this->session->bugList, 'parent')); + } /** * Resolve a bug. @@ -711,6 +729,11 @@ class bug extends control $this->display(); } + public function batchResolve() + { + + } + /** * Activate a bug. * diff --git a/module/bug/js/browse.js b/module/bug/js/browse.js index 55f6788f5d..f2938ef993 100644 --- a/module/bug/js/browse.js +++ b/module/bug/js/browse.js @@ -1,13 +1,3 @@ -/* Browse by module. */ -function browseByModule(active) -{ - $('#treebox').removeClass('hidden'); - $('.divider').removeClass('hidden'); - $('#bymoduleTab').addClass('active'); - $('#querybox').addClass('hidden'); - $('#' + active + 'Tab').removeClass('active'); -} - $(document).ready(function() { $("a.customFields").colorbox({width:540, height:340, iframe:true, transition:'none'}); diff --git a/module/bug/lang/en.php b/module/bug/lang/en.php index c35cfa613a..3c1cb69661 100644 --- a/module/bug/lang/en.php +++ b/module/bug/lang/en.php @@ -73,12 +73,14 @@ $lang->bug->index = 'Index'; $lang->bug->create = 'Create Bug'; $lang->bug->batchCreate = 'Batch create'; $lang->bug->confirmBug = 'Confirm Bug'; +$lang->bug->batchConfirm = 'Batch confirm'; $lang->bug->edit = 'Edit Bug'; $lang->bug->batchEdit = 'Batch edit'; $lang->bug->assignTo = 'Assign'; $lang->bug->browse = 'Browse Bug'; $lang->bug->view = 'Bug Info'; $lang->bug->resolve = 'Resolve'; +$lang->bug->barchResolve = 'batchResolve'; $lang->bug->close = 'Close'; $lang->bug->activate = 'Activate'; $lang->bug->reportChart = 'Report'; diff --git a/module/bug/lang/zh-cn.php b/module/bug/lang/zh-cn.php index 2c0a2c4f11..d89714dc2f 100644 --- a/module/bug/lang/zh-cn.php +++ b/module/bug/lang/zh-cn.php @@ -73,16 +73,18 @@ $lang->bug->index = '首页'; $lang->bug->create = '提Bug'; $lang->bug->batchCreate = '批量添加'; $lang->bug->confirmBug = '确认'; +$lang->bug->batchConfirm = '批量确认'; $lang->bug->edit = '编辑'; $lang->bug->batchEdit = '批量编辑'; $lang->bug->assignTo = '指派'; $lang->bug->browse = 'Bug列表'; $lang->bug->view = 'Bug详情'; $lang->bug->resolve = '解决'; +$lang->bug->batchResolve = '批量解决'; $lang->bug->close = '关闭'; $lang->bug->activate = '激活'; $lang->bug->reportChart = '报表统计'; -$lang->bug->export = '导出'; +$lang->bug->export = '导出数据'; $lang->bug->delete = '删除'; $lang->bug->saveTemplate = '保存模板'; $lang->bug->deleteTemplate = '删除模板'; diff --git a/module/bug/model.php b/module/bug/model.php index c2b54c6153..787a00a799 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -393,6 +393,31 @@ class bugModel extends model $this->dao->update(TABLE_BUG)->data($bug)->where('id')->eq($bugID)->exec(); } + /** + * Batch confirm bugs. + * + * @param array $bugIDList + * @access public + * @return void + */ + public function batchConfirm($bugIDList) + { + $now = helper::now(); + foreach($bugIDList as $bugID) + { + $oldBug = $this->getById($bugID); + if($oldBug->confirmed) continue; + + $bug = new stdclass(); + $bug->assignedTo = $this->app->user->account; + $bug->lastEditedBy = $this->app->user->account; + $bug->lastEditedDate = $now; + $bug->confirmed = 1; + + $this->dao->update(TABLE_BUG)->data($bug)->where('id')->eq($bugID)->exec(); + } + } + /** * Resolve a bug. * diff --git a/module/bug/view/browse.html.php b/module/bug/view/browse.html.php index b0ef9656cd..cbfef527bc 100644 --- a/module/bug/view/browse.html.php +++ b/module/bug/view/browse.html.php @@ -14,6 +14,7 @@ include '../../common/view/header.html.php'; include '../../common/view/treeview.html.php'; include '../../common/view/colorize.html.php'; +include '../../common/view/dropmenu.html.php'; js::set('browseType', $browseType); js::set('moduleID', $moduleID); js::set('customed', $customed); @@ -22,7 +23,7 @@ js::set('customed', $customed);
" . $lang->bug->moduleBugs . " "; + echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=all¶m=0&orderBy=$orderBy&recTotal=0&recPerPage=200"), $lang->bug->allBugs) . ""; echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=assignToMe¶m=0"), $lang->bug->assignToMe) . ""; echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=openedByMe¶m=0"), $lang->bug->openedByMe) . ""; echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=resolvedByMe¶m=0"), $lang->bug->resolvedByMe) . ""; @@ -31,21 +32,35 @@ js::set('customed', $customed); echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=unclosed¶m=0"), $lang->bug->unclosed) . ""; echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=longLifeBugs¶m=0"), $lang->bug->longLifeBugs) . ""; echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=postponedBugs¶m=0"), $lang->bug->postponedBugs) . ""; - echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=all¶m=0&orderBy=$orderBy&recTotal=0&recPerPage=200"), $lang->bug->allBugs) . ""; echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=needconfirm¶m=0"), $lang->bug->needConfirm) . ""; echo "{$lang->bug->byQuery} "; ?>
'; + echo html::a("#", " ", '', "id='exportAction' class='icon-green-common-export' onclick=toggleSubMenu(this.id,'bottom',0) title='{$lang->export}'"); + echo html::a("#", $lang->export, '', "id='exportAction' onclick=toggleSubMenu(this.id,'bottom',0) title='{$lang->export}'"); + echo ''; + common::printIcon('bug', 'report', "productID=$productID&browseType=$browseType&moduleID=$moduleID"); - if($browseType != 'needconfirm') common::printIcon('bug', 'export', "productID=$productID&orderBy=$orderBy"); common::printIcon('bug', 'customFields'); common::printIcon('bug', 'batchCreate', "productID=$productID&projectID=0&moduleID=$moduleID"); common::printIcon('bug', 'create', "productID=$productID&extra=moduleID=$moduleID"); ?>
+ +
'>
 
-
'> + - - +
+
@@ -71,7 +86,7 @@ js::set('customed', $customed);
recTotal}&recPerPage={$pager->recPerPage}"; ?> @@ -110,14 +125,11 @@ js::set('customed', $customed); - id");?> @@ -170,11 +182,19 @@ js::set('customed', $customed); if($browseType == 'needconfirm') $columns = $this->cookie->windowWidth >= $this->config->wideSize ? 7 : 6; ?>
- - id));?> severity;?>'>severity;?> - +
edit); + echo "
"; + echo html::selectAll() . html::selectReverse(); + echo "
"; + + $actionLink = $this->createLink('bug', 'batchEdit', "productID=$productID"); + $misc = common::hasPriv('bug', 'batchEdit') ? "onclick=setFormAction('$actionLink')" : "disabled='disabled'"; + echo "
"; + echo html::commonButton($lang->edit, $misc); + echo ""; + echo "
"; ?>
@@ -187,4 +207,36 @@ js::set('customed', $customed);
+ + + + + diff --git a/module/common/view/action.html.php b/module/common/view/action.html.php index 36500a98bf..cd2f2c0e57 100755 --- a/module/common/view/action.html.php +++ b/module/common/view/action.html.php @@ -132,14 +132,14 @@ $(function(){ action->printAction($action);?> history)) echo " ";?> - - id)'")?> - comment) or !empty($action->history)):?> comment)) echo "
";?> + + id)'")?> + comment) { @@ -148,7 +148,6 @@ $(function(){ echo "
"; } ?> - diff --git a/module/my/view/testcase.html.php b/module/my/view/testcase.html.php index ca7a21ee59..e80d2736a2 100644 --- a/module/my/view/testcase.html.php +++ b/module/my/view/testcase.html.php @@ -89,12 +89,12 @@ if($canBatchEdit) { $actionLink = $this->createLink('testcase', 'batchEdit'); - echo html::submitButton($lang->edit, "onclick=changeAction('myCaseForm','batchEdit','$actionLink')"); + echo html::submitButton($lang->edit, "onclick=setFormAction('$actionLink')"); } if($canBatchRun) { $actionLink = $this->createLink('testtask', 'batchRun', "productID=0&orderBy=$orderBy&from=testcase"); - echo html::submitButton($lang->testtask->runCase, "onclick=changeAction('myCaseForm','batchEdit','$actionLink')"); + echo html::submitButton($lang->testtask->runCase, "onclick=setFormAction('$actionLink')"); } ?> diff --git a/module/my/view/todo.html.php b/module/my/view/todo.html.php index 20b7f9dfd7..d218a8aa13 100644 --- a/module/my/view/todo.html.php +++ b/module/my/view/todo.html.php @@ -104,19 +104,19 @@ if(common::hasPriv('todo', 'batchEdit')) { $actionLink = $this->createLink('todo', 'batchEdit', "from=myTodo&type=$type&account=$account&status=$status"); - echo html::commonButton($lang->edit, "onclick=\"changeAction('todoform', 'batchEdit', '$actionLink')\""); + echo html::commonButton($lang->edit, "onclick=\"setFormAction('$actionLink')\""); } if(common::hasPriv('todo', 'batchFinish')) { $actionLink = $this->createLink('todo', 'batchFinish'); - echo html::commonButton($lang->todo->finish, "onclick=\"changeAction('todoform', 'batchFinish', '$actionLink')\""); + echo html::commonButton($lang->todo->finish, "onclick=\"setFormAction('$actionLink','hiddenwin')\""); } if(common::hasPriv('todo', 'import2Today') and $importFuture) { $actionLink = $this->createLink('todo', 'import2Today'); - echo html::commonButton($lang->todo->import, "onclick=\"changeAction('todoform', 'import2Today', '$actionLink')\""); + echo html::commonButton($lang->todo->import, "onclick=\"setFormAction('$actionLink')\""); echo html::input('date', date('Y-m-d'), "class='date w-80px'"); } ?> diff --git a/module/product/control.php b/module/product/control.php index 6863eee4e9..9ba407d28c 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -93,7 +93,7 @@ class product extends control * @access public * @return void */ - public function browse($productID = 0, $browseType = 'byModule', $param = 0, $orderBy = '', $recTotal = 0, $recPerPage = 20, $pageID = 1) + public function browse($productID = 0, $browseType = 'allStory', $param = 0, $orderBy = '', $recTotal = 0, $recPerPage = 20, $pageID = 1) { /* Lower browse type. */ $browseType = strtolower($browseType); @@ -162,7 +162,6 @@ class product extends control $this->view->orderBy = $orderBy; $this->view->browseType = $browseType; $this->view->moduleID = $moduleID; - $this->view->treeClass = $browseType == 'bymodule' ? '' : 'hidden'; $this->display(); } diff --git a/module/product/js/browse.js b/module/product/js/browse.js index 5fe0cf9db2..55a80528c5 100644 --- a/module/product/js/browse.js +++ b/module/product/js/browse.js @@ -1,27 +1,3 @@ -/* Browse by module. */ -function browseByModule() -{ - $('#treebox').removeClass('hidden'); - $('.divider').removeClass('hidden'); - $('#querybox').addClass('hidden'); - $('#featurebar .active').removeClass('active'); - $('#bymoduleTab').addClass('active'); -} - -/** - * Change form action. - * - * @param url $actionLink - * @param bool $hiddenwin - * @access public - * @return void - */ -function changeAction(actionLink, hiddenwin) -{ - if(hiddenwin) $('form').attr('target', 'hiddenwin'); - $('form').attr('action', actionLink).submit(); -} - $(function() { if(browseType == 'bysearch') ajaxGetSearchForm(); diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index a615f6926b..c3f600b5c0 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -14,12 +14,10 @@ - +
- inlink('browse',"productID=$productID"), $lang->product->moduleStory);?> + inlink('browse', "productID=$productID&browseType=allStory"), $lang->product->allStory);?> inlink('browse', "productID=$productID&browseType=assignedtome"), $lang->product->assignedToMe);?> inlink('browse', "productID=$productID&browseType=openedByMe"), $lang->product->openedByMe);?> inlink('browse', "productID=$productID&browseType=reviewedByMe"), $lang->product->reviewedByMe);?> @@ -28,23 +26,37 @@ var browseType = ''; inlink('browse', "productID=$productID&browseType=activeStory"), $lang->product->activeStory);?> inlink('browse', "productID=$productID&browseType=changedStory"), $lang->product->changedStory);?> inlink('browse', "productID=$productID&browseType=closedStory"), $lang->product->closedStory);?> - inlink('browse', "productID=$productID&browseType=allStory"), $lang->product->allStory);?> product->searchStory;?>
- - - - + '; + echo html::a("#", " ", '', "id='exportAction' class='icon-green-common-export' onclick=toggleSubMenu(this.id,'bottom',0) title='{$lang->export}'"); + echo html::a("#", $lang->export, '', "id='exportAction' onclick=toggleSubMenu(this.id,'bottom',0) title='{$lang->export}'"); + echo ''; + + common::printIcon('story', 'report', "productID=$productID&browseType=$browseType&moduleID=$moduleID"); + common::printIcon('story', 'batchCreate', "productID=$productID&moduleID=$moduleID"); + common::printIcon('story', 'create', "productID=$productID&moduleID=$moduleID"); + ?>
-
'>
+ +
'>
 
- - +
+
@@ -54,7 +66,7 @@ var browseType = '';
@@ -122,7 +134,7 @@ var browseType = ''; $actionLink = $this->createLink('story', 'batchEdit', "productID=$productID&projectID=0"); echo "
"; - echo html::commonButton($lang->edit, "onclick=\"changeAction('$actionLink')\" $disabled"); + echo html::commonButton($lang->edit, "onclick=\"setFormAction('$actionLink')\" $disabled"); echo ""; echo "
"; } @@ -143,7 +155,7 @@ var browseType = ''; $canBatchClose = common::hasPriv('story', 'batchClose') and strtolower($browseType) != 'closedbyme' and strtolower($browseType) != 'closedstory'; $actionLink = $this->createLink('story', 'batchClose', "productID=$productID&projectID=0"); - $misc = $canBatchClose ? "onclick=changeAction('$actionLink')" : $class; + $misc = $canBatchClose ? "onclick=setFormAction('$actionLink')" : $class; echo "
  • " . html::a('#', $lang->close, '', $misc) . "
  • "; $misc = common::hasPriv('story', 'batchReview') ? "onmouseover='toggleSubMenu(this.id)' onmouseout='toggleSubMenu(this.id)' id='reviewItem'" : $class; @@ -173,7 +185,7 @@ var browseType = ''; } else { - echo html::a('#', $result, '', "onclick=\"changeAction('$actionLink',true)\""); + echo html::a('#', $result, '', "onclick=\"setFormAction('$actionLink','hiddenwin')\""); } echo ""; } @@ -192,7 +204,7 @@ var browseType = ''; { $actionLink = $this->createLink('story', 'batchReview', "result=reject&reason=$key"); echo "
  • "; - echo html::a('#', $reason, '', "onclick=\"changeAction('$actionLink',true)\""); + echo html::a('#', $reason, '', "onclick=\"setFormAction('$actionLink','hiddenwin')\""); echo "
  • "; } ?> @@ -207,7 +219,7 @@ var browseType = ''; foreach($plans as $planID => $plan) { $actionLink = $this->createLink('story', 'batchChangePlan', "planID=$planID"); - echo "
  • " . html::a('#', $plan, '', "onclick=\"changeAction('$actionLink',true)\"") . "
  • "; + echo "
  • " . html::a('#', $plan, '', "onclick=\"setFormAction('$actionLink','hiddenwin')\"") . "
  • "; } ?> @@ -220,7 +232,7 @@ var browseType = ''; foreach($lang->story->stageList as $key => $stage) { $actionLink = $this->createLink('story', 'batchChangeStage', "stage=$key"); - echo "
  • " . html::a('#', $stage, '', "onclick=\"changeAction('$actionLink',true)\"") . "
  • "; + echo "
  • " . html::a('#', $stage, '', "onclick=\"setFormAction('$actionLink','hiddenwin')\"") . "
  • "; } ?> diff --git a/module/project/js/story.js b/module/project/js/story.js index 3eee9acf9b..bf4d0687b5 100644 --- a/module/project/js/story.js +++ b/module/project/js/story.js @@ -2,17 +2,3 @@ $(document).ready(function() { $("a.iframe").colorbox({width:640, height:480, iframe:true, transition:'none'}); }); - -/** - * Change form action. - * - * @param formName $formName - * @param actionName $actionName - * @param actionLink $actionLink - * @access public - * @return void - */ -function changeAction(formName, actionName, actionLink) -{ - $('#' + formName).attr('action', actionLink).submit(); -} diff --git a/module/project/js/task.js b/module/project/js/task.js index f2cb074c39..b0367af308 100644 --- a/module/project/js/task.js +++ b/module/project/js/task.js @@ -4,10 +4,5 @@ $(function() if(browseType == 'bysearch') ajaxGetSearchForm(); }); -function changeAction(formName, actionName, actionLink) -{ - if(actionName == 'batchClose') $('#' + formName).attr('target', 'hiddenwin'); - $('#' + formName).attr('action', actionLink).submit(); -} $('#module' + moduleID).addClass('active'); $('#product' + productID).addClass('active'); diff --git a/module/project/view/story.html.php b/module/project/view/story.html.php index 01d8ba966f..8543bc77c5 100644 --- a/module/project/view/story.html.php +++ b/module/project/view/story.html.php @@ -106,12 +106,12 @@ if($canBatchEdit) { $actionLink = $this->createLink('story', 'batchEdit', "productID=0&projectID=$project->id"); - echo html::commonButton($lang->edit, "onclick=\"changeAction('projectStoryForm', 'batchEdit', '$actionLink')\""); + echo html::commonButton($lang->edit, "onclick=\"setFormAction('$actionLink')\""); } if($canBatchClose) { $actionLink = $this->createLink('story', 'batchClose', "productID=0&projectID=$project->id"); - echo html::commonButton($lang->close, "onclick=\"changeAction('projectStoryForm', 'batchClose', '$actionLink')\""); + echo html::commonButton($lang->close, "onclick=\"setFormAction('$actionLink')\""); } } echo $summary; diff --git a/module/project/view/task.html.php b/module/project/view/task.html.php index 34465ac24f..545f4a3e2d 100644 --- a/module/project/view/task.html.php +++ b/module/project/view/task.html.php @@ -150,13 +150,13 @@ var browseType = ''; echo ""; $actionLink = $this->createLink('task', 'batchEdit', "projectID=$projectID"); - $misc = $canBatchEdit ? "onclick=changeAction('$actionLink')" : "disabled='disabled'"; + $misc = $canBatchEdit ? "onclick=setFormAction('$actionLink')" : "disabled='disabled'"; echo "
    "; - echo html::commonButton($lang->edit, "onclick=\"changeAction('projectTaskForm', 'batchEdit', '$actionLink')\" $misc"); + echo html::commonButton($lang->edit, $misc); echo ""; echo "
    "; } - echo $summary; + echo "" . $summary . ""; ?> show();?> @@ -173,7 +173,7 @@ var browseType = '';
      createLink('task', 'batchClose'); - $misc = $canBatchClose ? "onclick=changeAction('projectTaskForm','batchClose','$actionLink')" : "class='disabled'"; + $misc = $canBatchClose ? "onclick=setFormAction('$actionLink','hiddenwin')" : "class='disabled'"; echo "
    • " . html::a('#', $lang->close, '', $misc) . "
    • "; ?>
    diff --git a/module/project/view/taskheader.html.php b/module/project/view/taskheader.html.php index 826209656c..b5190ad469 100644 --- a/module/project/view/taskheader.html.php +++ b/module/project/view/taskheader.html.php @@ -22,7 +22,11 @@ if(!isset($browseType)) $browseType = ''; if(!isset($orderBy)) $orderBy = ''; common::printIcon('task', 'report', "project=$projectID&browseType=$browseType"); - if($browseType != 'needconfirm') common::printIcon('task', 'export', "projectID=$projectID&orderBy=$orderBy"); + + echo ''; + echo html::a("#", " ", '', "id='exportAction' class='icon-green-common-export' onclick=toggleSubMenu(this.id,'bottom',0) title='{$lang->export}'"); + echo html::a("#", $lang->export, '', "id='exportAction' onclick=toggleSubMenu(this.id,'bottom',0) title='{$lang->export}'"); + echo ''; echo ''; echo html::a("#", " ", '', "id='importAction' class='icon-green-task-import' onclick=toggleSubMenu(this.id,'bottom',0) title='{$lang->import}'"); @@ -35,11 +39,26 @@ + + diff --git a/module/story/lang/en.php b/module/story/lang/en.php index 7efd42928b..c8adc9fc71 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -28,7 +28,7 @@ $lang->story->tasks = "Tasks"; $lang->story->taskCount = 'Tasks count'; $lang->story->bugs = "Bug"; $lang->story->linkStory = 'Related story'; -$lang->story->export = "Export"; +$lang->story->export = "Export data"; $lang->story->reportChart = "Report"; $lang->story->batchChangePlan = "Batch change plan"; $lang->story->batchChangeStage = "Batch change stage"; diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 0a0728d689..00df06d663 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -28,7 +28,7 @@ $lang->story->tasks = "相关任务"; $lang->story->taskCount = '任务数'; $lang->story->bugs = "Bug"; $lang->story->linkStory = '关联需求'; -$lang->story->export = "导出"; +$lang->story->export = "导出数据"; $lang->story->reportChart = "统计报表"; $lang->story->batchChangePlan = "批量修改计划"; $lang->story->batchChangeStage = "批量修改阶段"; diff --git a/module/task/lang/en.php b/module/task/lang/en.php index 2c3885ae64..c605ae0175 100644 --- a/module/task/lang/en.php +++ b/module/task/lang/en.php @@ -25,7 +25,7 @@ $lang->task->close = "Close"; $lang->task->batchClose = "Batch close"; $lang->task->cancel = "Cancel"; $lang->task->activate = "Activate"; -$lang->task->export = "Export"; +$lang->task->export = "Export data"; $lang->task->reportChart = "Report chart"; $lang->task->fromBug = 'From Bug'; $lang->task->confirmStoryChange = "Confirm story change"; diff --git a/module/task/lang/zh-cn.php b/module/task/lang/zh-cn.php index 3f33fb0d34..07f4ba8d20 100644 --- a/module/task/lang/zh-cn.php +++ b/module/task/lang/zh-cn.php @@ -25,7 +25,7 @@ $lang->task->close = "关闭"; $lang->task->batchClose = "批量关闭"; $lang->task->cancel = "取消"; $lang->task->activate = "激活"; -$lang->task->export = "导出"; +$lang->task->export = "导出数据"; $lang->task->reportChart = "报表统计"; $lang->task->fromBug = '来源Bug'; $lang->task->confirmStoryChange = "确认需求变动"; diff --git a/module/testcase/control.php b/module/testcase/control.php index c472c3d706..b9cddebc7b 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -52,7 +52,7 @@ class testcase extends control * @access public * @return void */ - public function browse($productID = 0, $browseType = 'byModule', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) + public function browse($productID = 0, $browseType = 'all', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { /* Set browseType, productID, moduleID and queryID. */ $browseType = strtolower($browseType); @@ -154,7 +154,6 @@ class testcase extends control $this->view->orderBy = $orderBy; $this->view->browseType = $browseType; $this->view->param = $param; - $this->view->treeClass = $browseType == 'bymodule' ? '' : 'hidden'; $this->display(); } diff --git a/module/testcase/js/browse.js b/module/testcase/js/browse.js index 4501bab2e9..747583cee2 100644 --- a/module/testcase/js/browse.js +++ b/module/testcase/js/browse.js @@ -1,14 +1,3 @@ -/* Switch to module browse. */ -function browseByModule(active) -{ - $('.side').removeClass('hidden'); - $('.divider').removeClass('hidden'); - $('#bymoduleTab').addClass('active'); - $('#' + active + 'Tab').removeClass('active'); - $('#bysearchTab').removeClass('active'); - $('#querybox').addClass('hidden'); -} - /* Swtich to search module. */ function browseBySearch(active) { @@ -20,11 +9,6 @@ function browseBySearch(active) $('#bymoduleTab').removeClass('active'); } -function changeAction(url) -{ - $('#batchForm').attr('action', url); -} - $(document).ready(function() { setModal4List('runCase', 'caseList', function(){$(".results").colorbox({width:900, height:550, iframe:true, transition:'none'});}); diff --git a/module/testcase/lang/en.php b/module/testcase/lang/en.php index 78d1723562..3c943d2679 100644 --- a/module/testcase/lang/en.php +++ b/module/testcase/lang/en.php @@ -65,7 +65,7 @@ $lang->testcase->import = "Import"; $lang->testcase->importID = "Linenum"; $lang->testcase->showImport = "Show import"; $lang->testcase->exportTemplet = "Export templet"; -$lang->testcase->export = "Export"; +$lang->testcase->export = "Export data"; $lang->testcase->confirmChange = 'Confirm case change'; $lang->testcase->confirmStoryChange = 'Confirm story change'; diff --git a/module/testcase/lang/zh-cn.php b/module/testcase/lang/zh-cn.php index 70ae7811fd..39c17a6ae9 100644 --- a/module/testcase/lang/zh-cn.php +++ b/module/testcase/lang/zh-cn.php @@ -65,7 +65,7 @@ $lang->testcase->import = "导入"; $lang->testcase->importID = "行号"; $lang->testcase->showImport = "显示导入内容"; $lang->testcase->exportTemplet = "导出模板"; -$lang->testcase->export = "导出"; +$lang->testcase->export = "导出数据"; $lang->testcase->confirmChange = '确认用例变动'; $lang->testcase->confirmStoryChange = '确认需求变动'; diff --git a/module/testcase/view/browse.html.php b/module/testcase/view/browse.html.php index 6f380c7568..27ea34a6a3 100644 --- a/module/testcase/view/browse.html.php +++ b/module/testcase/view/browse.html.php @@ -15,6 +15,7 @@ include '../../common/view/header.html.php'; include '../../common/view/datepicker.html.php'; include '../../common/view/treeview.html.php'; include '../../common/view/colorize.html.php'; +include '../../common/view/dropmenu.html.php'; js::set('browseType', $browseType); js::set('moduleID' , $moduleID); js::set('confirmDelete', $lang->testcase->confirmDelete); @@ -23,26 +24,45 @@ js::set('confirmDelete', $lang->testcase->confirmDelete);
    " . $lang->testcase->moduleCases . " "; echo "" . html::a($this->createLink('testcase', 'browse', "productid=$productID&browseType=all¶m=0&orderBy=$orderBy&recTotal=0&recPerPage=200"), $lang->testcase->allCases) . ""; echo "" . html::a($this->createLink('testcase', 'browse', "productid=$productID&browseType=needconfirm¶m=0"), $lang->testcase->needConfirm) . ""; echo "{$lang->testcase->bySearch} "; ?>
    - - - - - + '; + echo html::a("#", " ", '', "id='exportAction' class='icon-green-common-export' onclick=toggleSubMenu(this.id,'bottom',0) title='{$lang->export}'"); + echo html::a("#", $lang->export, '', "id='exportAction' onclick=toggleSubMenu(this.id,'bottom',0) title='{$lang->export}'"); + echo ''; + + common::printIcon('testcase', 'batchCreate', "productID=$productID&moduleID=$moduleID"); + common::printIcon('testcase', 'create', "productID=$productID&moduleID=$moduleID"); + ?>
    + +
    '>
     
    - - +
    +
    @@ -52,7 +72,7 @@ js::set('confirmDelete', $lang->testcase->confirmDelete);
    recTotal}&recPerPage={$pager->recPerPage}"; ?> @@ -74,17 +94,11 @@ js::set('confirmDelete', $lang->testcase->confirmDelete); - id");?> @@ -123,9 +137,14 @@ js::set('confirmDelete', $lang->testcase->confirmDelete);
    edit, "onclick='changeAction(\"" . inLink('batchEdit', "productID=$productID") . "\")'"); - if($canBatchRun) echo html::submitButton($lang->testtask->runCase, "onclick='changeAction(\"" . $this->createLink('testtask', 'batchRun', "productID=$productID&orderBy=$orderBy") . "\")'"); + echo "
    " . html::selectAll() . html::selectReverse() . "
    "; + + $actionLink = $this->createLink('testcase', 'batchEdit', "productID=$productID"); + $misc = common::hasPriv('testcase', 'batchEdit') ? "onclick=setFormAction('$actionLink')" : "disabled='disabled'"; + echo "
    "; + echo html::commonButton($lang->edit, $misc); + echo ""; + echo "
    "; ?>
    @@ -138,4 +157,15 @@ js::set('confirmDelete', $lang->testcase->confirmDelete);
    actions;?>
    - - id));?> pri?>'>pri?>
    + + + diff --git a/module/testtask/js/cases.js b/module/testtask/js/cases.js index c7ee62f297..de106f2099 100644 --- a/module/testtask/js/cases.js +++ b/module/testtask/js/cases.js @@ -18,11 +18,6 @@ function browseBySearch(active) $('#bymoduleTab').removeClass('active'); } -function changeAction(url) -{ - $('#batchForm').attr('action', url); -} - $(document).ready(function() { setModal4List('runCase', 'caseList', function(){$(".results").colorbox({width:900, height:550, iframe:true, transition:'none'});}); diff --git a/module/testtask/view/cases.html.php b/module/testtask/view/cases.html.php index 9c09ab0691..433f42a846 100644 --- a/module/testtask/view/cases.html.php +++ b/module/testtask/view/cases.html.php @@ -106,20 +106,25 @@ var moduleID = '';
    - - - - ';casesform.submit();"> - - - - - id");?>';casesform.submit();"> - - - - ';casesform.submit();"> - + createLink('testcase', 'batchEdit', "productID=$productID"); + echo html::commonButton($lang->edit, "onclick=\"setFormAction('$actionLink')\""); + } + if($canBatchAssign) + { + $actionLink = inLink('batchAssign', "taskID=$task->id"); + echo html::select('assignedTo', $users); + echo html::commonButton($lang->testtask->assign, "onclick=\"setFormAction('$actionLink')\""); + } + if($canBatchRun) + { + $actionLink = inLink('batchRUN', "productID=$productID&orderBy=id_desc&from=testtask"); + echo html::commonButton($lang->testtask->runCase, "onclick=\"setFormAction('$actionLink')\""); + } + ?>
    diff --git a/www/js/my.full.js b/www/js/my.full.js index 19193fc2bb..7c102ff032 100644 --- a/www/js/my.full.js +++ b/www/js/my.full.js @@ -300,12 +300,14 @@ function toggleTreeBox() function() { $('.side').hide() + $('.divider').hide() $('.treeSlider span').css("border-right", "0 none"); $('.treeSlider span').css("border-left", "4px solid #000000"); }, function() { $('.side').show() + $('.divider').show() $('.treeSlider span').css("border-right", "4px solid #000000"); $('.treeSlider span').css("border-left", "0 none"); } @@ -462,6 +464,20 @@ function setForm() }); } +/** + * Set form action and submit. + * + * @param url $actionLink + * @param string $hiddenwin 'hiddenwin' + * @access public + * @return void + */ +function setFormAction(actionLink, hiddenwin) +{ + if(hiddenwin) $('form').attr('target', hiddenwin); + $('form').attr('action', actionLink).submit(); +} + /** * Set the max with of image. *