diff --git a/config/config.php b/config/config.php index d6bd0803c3..6059aa9124 100644 --- a/config/config.php +++ b/config/config.php @@ -134,6 +134,7 @@ define('TABLE_FILE', '`' . $config->db->prefix . 'file`'); define('TABLE_HISTORY', '`' . $config->db->prefix . 'history`'); define('TABLE_EXTENSION', '`' . $config->db->prefix . 'extension`'); define('TABLE_WEBAPP', '`' . $config->db->prefix . 'webapp`'); +define('TABLE_CUSTOM', '`' . $config->db->prefix . 'custom`'); $config->objectTables['product'] = TABLE_PRODUCT; $config->objectTables['story'] = TABLE_STORY; @@ -150,6 +151,7 @@ $config->objectTables['user'] = TABLE_USER; $config->objectTables['doc'] = TABLE_DOC; $config->objectTables['doclib'] = TABLE_DOCLIB; $config->objectTables['todo'] = TABLE_TODO; +$config->objectTables['custom'] = TABLE_CUSTOM; /* Include extension config files. */ $extConfigFiles = glob($configRoot . 'ext/*.php'); diff --git a/db/update4.3.sql b/db/update4.3.sql index 487f80922f..743ee51395 100644 --- a/db/update4.3.sql +++ b/db/update4.3.sql @@ -1,7 +1,12 @@ -REATE TABLE `demoTTT`.`zt_customLang` ( - `id` MEDIUMINT( 8 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , - `lang` VARCHAR( 30 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , - `module` VARCHAR( 30 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , - `key` VARCHAR( 60 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , - `value` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL -) ENGINE = MYISAM; +CREATE TABLE IF NOT EXISTS `zt_custom` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `lang` varchar(30) NOT NULL, + `module` varchar(30) NOT NULL, + `section` varchar(30) NOT NULL, + `key` varchar(60) NOT NULL, + `value` text NOT NULL, + `system` enum('0','1') NOT NULL default '1', + PRIMARY KEY (`id`), + UNIQUE KEY `lang` (`lang`,`module`,`section`,`key`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + diff --git a/framework/router.class.php b/framework/router.class.php index 707ea028ef..e2fde411c1 100755 --- a/framework/router.class.php +++ b/framework/router.class.php @@ -1218,6 +1218,7 @@ class router /* If the not strict mode, the keys of passed params and defaaul params msut be the same. */ if(!isset($this->config->strictParams) or $this->config->strictParams == false) { + unset($passedParams['onlybody']); $passedParams = array_values($passedParams); $i = 0; foreach($defaultParams as $key => $defaultValue) @@ -1463,6 +1464,19 @@ class router $loadedLangs[] = $langFile; } + /* Merge from the db lang. */ + if($moduleName != 'common' and isset($lang->db->custom[$moduleName])) + { + foreach($lang->db->custom[$moduleName] as $section => $fields) + { + foreach($fields as $key => $value) + { + unset($lang->{$moduleName}->{$section}[$key]); + $lang->{$moduleName}->{$section}[$key] = $value; + } + } + } + $this->lang = $lang; return $lang; } diff --git a/module/bug/control.php b/module/bug/control.php index 498efd42d6..9ef85ec620 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,21 @@ 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->builds = $this->loadModel('build')->getProductBuildPairs($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 +668,25 @@ class bug extends control $this->view->actions = $this->action->getList('bug', $bugID); $this->display(); } + + /** + * Batch confirm bugs. + * + * @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 +730,27 @@ class bug extends control $this->display(); } + /** + * Batch resolve bugs. + * + * @param string $resolution + * @param string $resolvedBuild + * @access public + * @return void + */ + public function batchResolve($resolution, $resolvedBuild = '') + { + $bugIDList = $this->post->bugIDList ? $this->post->bugIDList : die(js::locate($this->session->bugList, 'parent')); + $this->bug->batchResolve($bugIDList, $resolution, $resolvedBuild); + if(dao::isError()) die(js::error(dao::getError())); + foreach($bugIDList as $bugID) + { + $actionID = $this->action->create('bug', $bugID, 'Resolved', '', $resolution); + $this->sendmail($bugID, $actionID); + } + die(js::locate($this->session->bugList, 'parent')); + } + /** * 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..ea6a08c3fb 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. * @@ -426,6 +451,38 @@ class bugModel extends model ->exec(); } + /** + * Batch resolve bugs. + * + * @param array $bugIDList + * @param string $resolution + * @param string $resolvedBuild + * @access public + * @return void + */ + public function batchResolve($bugIDList, $resolution, $resolvedBuild) + { + $now = helper::now(); + foreach($bugIDList as $bugID) + { + $oldBug = $this->getById($bugID); + if($oldBug->status != 'active') continue; + $bug = new stdClass(); + $bug->resolution = $resolution; + $bug->resolvedBuild = $resolution == 'fixed' ? $resolvedBuild : ''; + $bug->resolvedBy = $this->app->user->account; + $bug->resolvedDate = $now; + $bug->status = 'resolved'; + $bug->confirmed = 1; + $bug->assignedTo = $oldBug->openedBy; + $bug->assignedDate = $now; + $bug->lastEditedBy = $this->app->user->account; + $bug->lastEditedDate = $now; + + $this->dao->update(TABLE_BUG)->data($bug)->where('id')->eq($bugID)->exec(); + } + } + /** * Activate a bug. * diff --git a/module/bug/view/browse.html.php b/module/bug/view/browse.html.php index b0ef9656cd..e7a25d3d58 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"); ?>
+ +
'>
 
-
'> + - - + - + - - + + diff --git a/module/build/control.php b/module/build/control.php index a658687809..51f89211ed 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -42,6 +42,10 @@ class build extends control $orderBy = 'status_asc, stage_asc, id_desc'; $stories = $this->story->getProjectStories($projectID, $orderBy); $bugs = $this->bug->getProjectBugs($projectID); + foreach($bugs as $key => $bug) + { + if($bug->status == 'closed') unset($bugs[$key]); + } /* Assign. */ $project = $this->loadModel('project')->getById($projectID); diff --git a/module/build/model.php b/module/build/model.php index 225d71712c..672b0ae2fc 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -125,8 +125,9 @@ class buildModel extends model $this->dao->insert(TABLE_BUILD)->data($build)->autoCheck()->batchCheck($this->config->build->create->requiredFields, 'notempty')->check('name', 'unique', "product = {$build->product}")->exec(); if(!dao::isError()) { + $buildID = $this->dao->lastInsertID(); $this->updateLinkedBug($build); - return $this->dao->lastInsertID(); + return $buildID; } } @@ -186,7 +187,7 @@ class buildModel extends model if(!$bugs) return false; foreach($bugs as $bug) { - if($bug->status == 'resolved') continue; + if($bug->status == 'resolved' or $bug->status == 'closed') continue; $bug->resolvedBy = $resolvedPairs[$bug->id]; $bug->resolvedDate = $now; diff --git a/module/build/view/create.html.php b/module/build/view/create.html.php index 928db52764..59ef60e253 100644 --- a/module/build/view/create.html.php +++ b/module/build/view/create.html.php @@ -86,7 +86,7 @@ - +
+
@@ -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,58 @@ js::set('customed', $customed);
+ + + + + + + diff --git a/module/bug/view/confirmbug.html.php b/module/bug/view/confirmbug.html.php index 3ce7fa410e..ca43f7015d 100755 --- a/module/bug/view/confirmbug.html.php +++ b/module/bug/view/confirmbug.html.php @@ -22,11 +22,11 @@ js::set('page', 'confirmbug');
title;?>
bug->assignedTo;?>assignedTo, "class='text-3'");?>assignedTo, "class='select-2'");?>
bug->severity;?>bug->severityList, $bug->severity, 'class=select-2');?>bug->pri;?>bug->priList, $bug->pri, 'class=select-2');?>
bug->mailto;?> title, '', "class='preview'");?> bug->statusList[$bug->status];?>status == 'resolved' ? $bug->resolvedBy : html::select('resolvedBy[]', $users, $this->app->user->account, "class='w-70px'");?>status == 'resolved' ? substr($users[$bug->resolvedBy], 2) : html::select('resolvedBy[]', $users, $this->app->user->account, "class='w-70px'");?>
diff --git a/module/build/view/edit.html.php b/module/build/view/edit.html.php index e0ceb4703a..2c5ec6b3a3 100644 --- a/module/build/view/edit.html.php +++ b/module/build/view/edit.html.php @@ -105,7 +105,7 @@ bugs . ',', ',' . $bug->id . ',') !== false) echo 'checked';?>> id);?> title, '', "class='preview'");?> bug->statusList[$bug->status];?> - status == 'resolved' ? $bug->resolvedBy : html::select('resolvedBy[]', $users, $this->app->user->account, "class='w-70px'");?> + status == 'resolved' or $bug->status == 'closed') ? substr($users[$bug->resolvedBy], 2) : html::select('resolvedBy[]', $users, $this->app->user->account, "class='w-70px'");?> diff --git a/module/common/control.php b/module/common/control.php index c6ef323199..87386cdc45 100644 --- a/module/common/control.php +++ b/module/common/control.php @@ -25,6 +25,7 @@ class common extends control $this->common->setCompany(); $this->common->setUser(); $this->common->loadConfigFromDB(); + $this->common->loadCustomFromDB(); if($this->app->getViewType() == 'mhtml') $this->common->setMobileMenu(); $this->app->loadLang('company'); } @@ -163,18 +164,20 @@ class common extends control if(empty($method)) $method = $app->getMethodName(); $className = 'header'; - if(strpos($orderBy, $fieldName) !== false) + $order = explode('_', $orderBy); + $order[0] = trim($order[0], '`'); + if($order[0] == $fieldName) { - if(stripos($orderBy, 'desc') !== false) + if(isset($order[1]) and $order[1] == 'asc') { - $orderBy = str_ireplace('desc', 'asc', $orderBy); - $className = 'headerSortUp'; - } - elseif(stripos($orderBy, 'asc') !== false) - { - $orderBy = str_ireplace('asc', 'desc', $orderBy); + $orderBy = "`{$order[0]}`_desc"; $className = 'headerSortDown'; } + else + { + $orderBy = "`{$order[0]}`_asc"; + $className = 'headerSortUp'; + } } else { diff --git a/module/common/lang/en.php b/module/common/lang/en.php index 10bf4a6765..265923f82b 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -270,32 +270,32 @@ $lang->user->menu = $lang->company->menu; /* Admin menu. */ $lang->admin = new stdclass(); $lang->admin->menu = new stdclass(); -$lang->admin->menu->index = array('link' => 'Index|admin|index'); -$lang->admin->menu->extension = array('link' => 'Extension|extension|browse', 'subModule' => 'extension,editor'); -$lang->admin->menu->customlang = array('link' => 'Custom lang|customlang|index', 'subModule' => 'customlang'); -$lang->admin->menu->mail = array('link' => 'Email|mail|index', 'subModule' => 'mail'); -$lang->admin->menu->clearData = array('link' => 'Clear data|admin|cleardata'); -$lang->admin->menu->convert = array('link' => 'Import|convert|index', 'subModule' => 'convert'); -$lang->admin->menu->trashes = array('link' => 'Trash|action|trash', 'subModule' => 'action'); -$lang->admin->menu->sso = array('link' => 'SSO|sso|browse', 'subModule' => 'sso'); +$lang->admin->menu->index = array('link' => 'Index|admin|index'); +$lang->admin->menu->extension = array('link' => 'Extension|extension|browse', 'subModule' => 'extension,editor'); +$lang->admin->menu->custom = array('link' => 'Custom|custom|index', 'subModule' => 'custom'); +$lang->admin->menu->mail = array('link' => 'Email|mail|index', 'subModule' => 'mail'); +$lang->admin->menu->clearData = array('link' => 'Clear data|admin|cleardata'); +$lang->admin->menu->convert = array('link' => 'Import|convert|index', 'subModule' => 'convert'); +$lang->admin->menu->trashes = array('link' => 'Trash|action|trash', 'subModule' => 'action'); +$lang->admin->menu->sso = array('link' => 'SSO|sso|browse', 'subModule' => 'sso'); -$lang->convert = new stdclass(); -$lang->upgrade = new stdclass(); -$lang->action = new stdclass(); -$lang->extension = new stdclass(); -$lang->customlang = new stdclass(); -$lang->editor = new stdclass(); -$lang->mail = new stdclass(); -$lang->sso = new stdclass(); +$lang->convert = new stdclass(); +$lang->upgrade = new stdclass(); +$lang->action = new stdclass(); +$lang->extension = new stdclass(); +$lang->custom = new stdclass(); +$lang->editor = new stdclass(); +$lang->mail = new stdclass(); +$lang->sso = new stdclass(); -$lang->convert->menu = $lang->admin->menu; -$lang->upgrade->menu = $lang->admin->menu; -$lang->action->menu = $lang->admin->menu; -$lang->extension->menu = $lang->admin->menu; -$lang->customlang->menu = $lang->admin->menu; -$lang->editor->menu = $lang->admin->menu; -$lang->mail->menu = $lang->admin->menu; -$lang->sso->menu = $lang->admin->menu; +$lang->convert->menu = $lang->admin->menu; +$lang->upgrade->menu = $lang->admin->menu; +$lang->action->menu = $lang->admin->menu; +$lang->extension->menu = $lang->admin->menu; +$lang->custom->menu = $lang->admin->menu; +$lang->editor->menu = $lang->admin->menu; +$lang->mail->menu = $lang->admin->menu; +$lang->sso->menu = $lang->admin->menu; /* Groups. */ $lang->menugroup = new stdclass(); diff --git a/module/common/lang/menuOrder.php b/module/common/lang/menuOrder.php index 1df47d8c05..653733efd9 100644 --- a/module/common/lang/menuOrder.php +++ b/module/common/lang/menuOrder.php @@ -108,17 +108,19 @@ $lang->user->menuOrder = $lang->company->menuOrder; /* admin menu order. */ $lang->admin->menuOrder[5] = 'index'; $lang->admin->menuOrder[10] = 'extension'; -$lang->admin->menuOrder[15] = 'customlang'; +$lang->admin->menuOrder[15] = 'custom'; $lang->admin->menuOrder[20] = 'editor'; $lang->admin->menuOrder[25] = 'mail'; -$lang->admin->menuOrder[30] = 'sso'; -$lang->admin->menuOrder[35] = 'convert'; -$lang->admin->menuOrder[40] = 'trashes'; -$lang->convert->menuOrder = $lang->admin->menuOrder; -$lang->upgrade->menuOrder = $lang->admin->menuOrder; -$lang->action->menuOrder = $lang->admin->menuOrder; -$lang->extension->menuOrder = $lang->admin->menuOrder; -$lang->customlang->menuOrder = $lang->admin->menuOrder; -$lang->editor->menuOrder = $lang->admin->menuOrder; -$lang->mail->menuOrder = $lang->admin->menuOrder; -$lang->sso->menuOrder = $lang->admin->menuOrder; +$lang->admin->menuOrder[30] = 'custom'; +$lang->admin->menuOrder[35] = 'sso'; +$lang->admin->menuOrder[40] = 'convert'; +$lang->admin->menuOrder[45] = 'trashes'; +$lang->convert->menuOrder = $lang->admin->menuOrder; +$lang->upgrade->menuOrder = $lang->admin->menuOrder; +$lang->action->menuOrder = $lang->admin->menuOrder; +$lang->extension->menuOrder = $lang->admin->menuOrder; +$lang->custom->menuOrder = $lang->admin->menuOrder; +$lang->editor->menuOrder = $lang->admin->menuOrder; +$lang->mail->menuOrder = $lang->admin->menuOrder; +$lang->custom->menuOrder = $lang->admin->menuOrder; +$lang->sso->menuOrder = $lang->admin->menuOrder; diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index 26b747a785..de0d6594bf 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -270,32 +270,32 @@ $lang->user->menu = $lang->company->menu; /* 后台管理菜单设置。*/ $lang->admin = new stdclass(); $lang->admin->menu = new stdclass(); -$lang->admin->menu->index = array('link' => '首页|admin|index'); -$lang->admin->menu->extension = array('link' => '扩展|extension|browse', 'subModule' => 'extension,editor'); -$lang->admin->menu->customlang = array('link' => '语言配置|customlang|index', 'subModule' => 'customlang'); -$lang->admin->menu->mail = array('link' => '发信|mail|index', 'subModule' => 'mail'); -$lang->admin->menu->clearData = array('link' => '清除数据|admin|cleardata'); -$lang->admin->menu->convert = array('link' => '导入|convert|index', 'subModule' => 'convert'); -$lang->admin->menu->trashes = array('link' => '回收站|action|trash', 'subModule' => 'action'); -$lang->admin->menu->sso = array('link' => '单点登录|sso|browse', 'subModule' => 'sso'); +$lang->admin->menu->index = array('link' => '首页|admin|index'); +$lang->admin->menu->extension = array('link' => '扩展|extension|browse', 'subModule' => 'extension,editor'); +$lang->admin->menu->custom = array('link' => '自定义|custom|index', 'subModule' => 'custom'); +$lang->admin->menu->mail = array('link' => '发信|mail|index', 'subModule' => 'mail'); +$lang->admin->menu->clearData = array('link' => '清除数据|admin|cleardata'); +$lang->admin->menu->convert = array('link' => '导入|convert|index', 'subModule' => 'convert'); +$lang->admin->menu->trashes = array('link' => '回收站|action|trash', 'subModule' => 'action'); +$lang->admin->menu->sso = array('link' => '单点登录|sso|browse', 'subModule' => 'sso'); $lang->convert = new stdclass(); $lang->upgrade = new stdclass(); $lang->action = new stdclass(); $lang->extension = new stdclass(); -$lang->customlang = new stdclass(); +$lang->custom = new stdclass(); $lang->editor = new stdclass(); $lang->mail = new stdclass(); $lang->sso = new stdclass(); -$lang->convert->menu = $lang->admin->menu; -$lang->upgrade->menu = $lang->admin->menu; -$lang->action->menu = $lang->admin->menu; -$lang->extension->menu = $lang->admin->menu; -$lang->customlang->menu = $lang->admin->menu; -$lang->editor->menu = $lang->admin->menu; -$lang->mail->menu = $lang->admin->menu; -$lang->sso->menu = $lang->admin->menu; +$lang->convert->menu = $lang->admin->menu; +$lang->upgrade->menu = $lang->admin->menu; +$lang->action->menu = $lang->admin->menu; +$lang->extension->menu = $lang->admin->menu; +$lang->custom->menu = $lang->admin->menu; +$lang->editor->menu = $lang->admin->menu; +$lang->mail->menu = $lang->admin->menu; +$lang->sso->menu = $lang->admin->menu; /* 菜单分组。*/ $lang->menugroup = new stdclass(); @@ -316,6 +316,7 @@ $lang->menugroup->dept = 'company'; $lang->menugroup->todo = 'my'; $lang->menugroup->action = 'admin'; $lang->menugroup->extension = 'admin'; +$lang->menugroup->custom = 'admin'; $lang->menugroup->editor = 'admin'; $lang->menugroup->mail = 'admin'; $lang->menugroup->sso = 'admin'; diff --git a/module/common/model.php b/module/common/model.php index 923eae6290..a9bd1fa173 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -118,6 +118,21 @@ class commonModel extends model } } + /** + * Load custom lang from db. + * + * @access public + * @return void + */ + public function loadCustomFromDB() + { + if(!$this->config->db->name) return; + $records = $this->loadModel('custom')->getAll(); + if(!$records) return; + $this->lang->db = new stdclass(); + $this->lang->db->custom = $records; + } + /** * Juage a method of one module is open or not? * 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"); + ?>
-
'>
+ +
'>
 
- - + - + 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"); + ?>
+ +
'>
 
+
@@ -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/productplan/control.php b/module/productplan/control.php index 875cd55558..50f3eaaa5a 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -45,9 +45,18 @@ class productplan extends control $this->commonAction($product); $lastPlan = $this->productplan->getLast($product); + if($lastPlan) + { + $timestamp = strtotime($lastPlan->end); + $weekday = date('w', $timestamp); + $delta = 1; + if($weekday == '5' or $weekday == '6') $delta = 8 - $weekday; + + $begin = date('Y-m-d', strtotime("+$delta days", $timestamp)); + } + $this->view->begin = $lastPlan ? $begin : ''; $this->view->title = $this->view->product->name . $this->lang->colon . $this->lang->productplan->create; - $this->view->begin = $lastPlan ? $lastPlan->end : ''; $this->display(); } 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/model.php b/module/project/model.php index 4a6d2cbf9c..182b0f2677 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -940,7 +940,8 @@ class projectModel extends model $BugToTasks = fixer::input('post')->get(); foreach($BugToTasks->import as $key => $value) { - $bug = $this->bug->getById($key); + $bug = $this->bug->getById($key); + $task = new stdClass(); $task->project = $projectID; $task->story = $bug->story; $task->storyVersion = $bug->story; @@ -975,13 +976,14 @@ class projectModel extends model $taskID = $this->dao->lastInsertID(); if($task->story != false) $this->story->setStage($task->story); $actionID = $this->loadModel('action')->create('task', $taskID, 'Opened', ''); + $mails[$key] = new stdClass(); $mails[$key]->taskID = $taskID; $mails[$key]->actionID = $actionID; $this->action->create('bug', $key, 'Totask', '', $taskID); $this->dao->update(TABLE_BUG)->set('toTask')->eq($taskID)->where('id')->eq($key)->exec(); - if($task->assignedTo and $task->assignedTo != $bug->assignedTo) + if(isset($task->assignedTo) and $task->assignedTo and $task->assignedTo != $bug->assignedTo) { $newBug = new stdClass(); $newBug->lastEditedBy = $this->app->user->account; @@ -1439,7 +1441,7 @@ class projectModel extends model * @access public * @return bool */ - public function isClickable($project, $action) + public static function isClickable($project, $action) { $action = strtolower($action); 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/report/model.php b/module/report/model.php index f7a5dba3cf..42dd2d83aa 100644 --- a/module/report/model.php +++ b/module/report/model.php @@ -121,7 +121,7 @@ $(function () series: {lines:{show: true, lineWidth: 2}, points: {show: true},hoverable: true}, legend: {noColumns: 1}, grid: { hoverable: true, clickable: true }, - xaxis: { ticks:ticks, tickFormatter: function(val) {tick = new Date(dateList[val]);;if(dateList[val] != undefined){return (tick.getMonth() + 1) + '-' + tick.getDate()}else{return ''}}}, + xaxis: { ticks:ticks, tickFormatter: function(val) {tick = new Date(dateList[val]);;if(dateList[val] != undefined){return tick.getDate() + '/' + (tick.getMonth() + 1)}else{return ''}}}, yaxis: {mode: null, min: 0, minTickSize: [1, "day"]}}; var placeholder = $("#placeholder"); diff --git a/module/story/control.php b/module/story/control.php index bc94d75b90..d35074d55a 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -805,7 +805,7 @@ class story extends control $moduleID = $this->tree->getAllChildID($moduleID); } $stories = $this->story->getProductStoryPairs($productID, $moduleID); - $select = html::select('story' . $index, $stories, $storyID, "class=''"); + $select = html::select('story', $stories, $storyID, "class=''"); /* If only need options, remove select wrap. */ if($onlyOption == 'true') die(substr($select, strpos($select, '>') + 1, -10)); 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/task/view/batchedit.html.php b/module/task/view/batchedit.html.php index 3d3b8eb054..beaf4af3f5 100755 --- a/module/task/view/batchedit.html.php +++ b/module/task/view/batchedit.html.php @@ -72,7 +72,8 @@ -
    + type != 'sprint')) ? $this->config->task->batchEdit->columns + 1 : $this->config->task->batchEdit->columns;?> +
    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/css/batchedit.css b/module/testcase/css/batchedit.css index 10b4561986..b78baac20e 100755 --- a/module/testcase/css/batchedit.css +++ b/module/testcase/css/batchedit.css @@ -1 +1,2 @@ .w-340px {width:340px} +.chosen {z-index:99} diff --git a/module/testcase/js/batchedit.js b/module/testcase/js/batchedit.js new file mode 100644 index 0000000000..8bf7fc4fff --- /dev/null +++ b/module/testcase/js/batchedit.js @@ -0,0 +1,4 @@ +$(function() +{ + $(".chosen").chosen({no_results_text:noResultsMatch}); +}) 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 5b2a8a9d42..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'; @@ -135,13 +135,6 @@ $lang->testcase->stageList['system'] = 'System testing'; $lang->testcase->stageList['smoke'] = 'Smoking testing'; $lang->testcase->stageList['bvt'] = 'BVT testing'; -$lang->testcase->stageListAB['unittest'] = 'Unit'; -$lang->testcase->stageListAB['feature'] = 'Feature'; -$lang->testcase->stageListAB['intergrate'] = 'Integrate'; -$lang->testcase->stageListAB['system'] = 'System'; -$lang->testcase->stageListAB['smoke'] = 'Smoking'; -$lang->testcase->stageListAB['bvt'] = 'BVT'; - $lang->testcase->statusList[''] = ''; $lang->testcase->statusList['normal'] = 'Normal'; $lang->testcase->statusList['blocked'] = 'Blocked'; diff --git a/module/testcase/lang/zh-cn.php b/module/testcase/lang/zh-cn.php index a99ed5e829..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 = '确认需求变动'; @@ -135,13 +135,6 @@ $lang->testcase->stageList['system'] = '系统测试阶段'; $lang->testcase->stageList['smoke'] = '冒烟测试阶段'; $lang->testcase->stageList['bvt'] = '版本验证阶段'; -$lang->testcase->stageListAB['unittest'] = '单元'; -$lang->testcase->stageListAB['feature'] = '功能'; -$lang->testcase->stageListAB['intergrate'] = '集成'; -$lang->testcase->stageListAB['system'] = '系统'; -$lang->testcase->stageListAB['smoke'] = '冒烟'; -$lang->testcase->stageListAB['bvt'] = '版本'; - $lang->testcase->statusList[''] = ''; $lang->testcase->statusList['normal'] = '正常'; $lang->testcase->statusList['blocked'] = '被阻塞'; diff --git a/module/testcase/model.php b/module/testcase/model.php index 9ffa244a84..6c50a5abe5 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -381,7 +381,7 @@ class testcaseModel extends model * @access public * @return void */ - public function isClickable($case, $action) + public static function isClickable($case, $action) { $action = strtolower($action); diff --git a/module/testcase/view/batchedit.html.php b/module/testcase/view/batchedit.html.php index bc69532211..d26bef31bd 100644 --- a/module/testcase/view/batchedit.html.php +++ b/module/testcase/view/batchedit.html.php @@ -32,21 +32,7 @@
    module, "class='select-1'");?> title, 'class=text-1'); echo "*";?> testcase->typeList, $cases[$caseID]->type, 'class=select-1');?> - testcase->stageListAB as $key => $stage) - { - if(in_array($key, explode(',', $cases[$caseID]->stage))) - { - echo "$stage "; - } - else - { - echo "$stage "; - } - } - ?> - testcase->stageList, $cases[$caseID]->stage, "class='select-1 chosen' multiple data-placeholder='{$lang->testcase->stage}'");?>
    - - +
    +
    @@ -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/testcase/view/import.html.php b/module/testcase/view/import.html.php index 6b4f5fcfc7..87d61214bd 100755 --- a/module/testcase/view/import.html.php +++ b/module/testcase/view/import.html.php @@ -1,7 +1,7 @@
    - +
    testcase->importCase?>testcase->import?>
    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/model.php b/module/testtask/model.php index b217ee495d..77584b03c6 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -483,7 +483,7 @@ class testtaskModel extends model * @access public * @return void */ - public function isClickable($testtask, $action) + public static function isClickable($testtask, $action) { $action = strtolower($action); 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/module/todo/model.php b/module/todo/model.php index 365f6ee9cb..da6fe23075 100644 --- a/module/todo/model.php +++ b/module/todo/model.php @@ -333,7 +333,7 @@ class todoModel extends model * @access public * @return bool */ - public function isClickable($todo, $action) + public static function isClickable($todo, $action) { $action = strtolower($action); diff --git a/module/tree/model.php b/module/tree/model.php index 11339b6f65..6ded9af09d 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -883,6 +883,7 @@ class treeModel extends model /* The new modules. */ if(is_numeric($moduleID)) { + $module = new stdClass(); $module->root = $rootID; $module->name = strip_tags($moduleName); $module->parent = $parentModuleID; diff --git a/module/user/view/dynamic.html.php b/module/user/view/dynamic.html.php index debb912874..5322255232 100644 --- a/module/user/view/dynamic.html.php +++ b/module/user/view/dynamic.html.php @@ -27,7 +27,7 @@ ?> - +
    diff --git a/module/webapp/control.php b/module/webapp/control.php index 9bca1db02d..d6932ed716 100644 --- a/module/webapp/control.php +++ b/module/webapp/control.php @@ -57,6 +57,7 @@ class webapp extends control if($type == 'bysearch') $param = helper::safe64Encode($this->post->key); /* Get results from the api. */ + $recPerPage = $this->cookie->pagerWebappObtain ? $this->cookie->pagerWebappObtain : $recPerPage; $results = $this->webapp->getAppsByAPI($type, $param, $recTotal, $recPerPage, $pageID); if($results) { diff --git a/tools/minifyfront.php b/tools/minifyfront.php index 747ce05f8d..8bf7b82796 100755 --- a/tools/minifyfront.php +++ b/tools/minifyfront.php @@ -21,6 +21,7 @@ $jsFiles[] = $jqueryRoot . 'datepicker/date.js'; $jsFiles[] = $jqueryRoot . 'datepicker/min.js'; $jsFiles[] = $jqueryRoot . 'alert/min.js'; $jsFiles[] = $jqueryRoot . 'colorize/min.js'; +$jsFiles[] = $jqueryRoot . 'dropmenu/dropmenu.js'; /* Combine these js files. */ $allJSFile = $jsRoot . 'all.js'; @@ -70,6 +71,7 @@ foreach($langs as $lang) $cssCode .= file_get_contents($themeRoot . 'default/treeview.css'); $cssCode .= file_get_contents($themeRoot . 'default/datepicker.css'); $cssCode .= file_get_contents($themeRoot . 'default/alert.css'); + $cssCode .= file_get_contents($themeRoot . 'default/dropmenu.css'); /* Css file for current lang and current them. */ $cssCode .= file_get_contents($themeRoot . "lang/$lang.css"); diff --git a/www/js/my.full.js b/www/js/my.full.js index af06c77518..7c102ff032 100644 --- a/www/js/my.full.js +++ b/www/js/my.full.js @@ -464,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. * diff --git a/www/theme/default/dropmenu.css b/www/theme/default/dropmenu.css index 13cea56999..9e3b3e32b6 100644 --- a/www/theme/default/dropmenu.css +++ b/www/theme/default/dropmenu.css @@ -5,6 +5,9 @@ border: 1px solid rgba(0,0,0,0.2); border-radius: 6px 6px 6px 6px; box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + max-height:400px; + overflow:auto; + overflow-x:hidden; } .listMenu ul diff --git a/www/upgrade.php b/www/upgrade.php index 9f1d1518af..e2bad61d14 100644 --- a/www/upgrade.php +++ b/www/upgrade.php @@ -37,7 +37,7 @@ $app->setDebug(); /* Check the installed version is the latest or not. */ $config->installedVersion = $common->loadModel('setting')->getVersion(); -if(version_compare($config->version, $config->installedVersion) <= 0) die(header('location: index.php')); +if(!$_SERVER['HTTP_X_REQUESTED_WITH'] and version_compare($config->version, $config->installedVersion) <= 0) die(header('location: index.php')); /* Run it. */ $app->parseRequest();
    action->date;?>