diff --git a/module/bug/control.php b/module/bug/control.php index 6d7d0d8ae2..bd8750599c 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -112,7 +112,6 @@ class bug extends control $bugs = $this->bug->processBuildForBugs($bugs); /* Build the search form. */ - $this->config->bug->search['style'] = 'shortcut'; $actionURL = $this->createLink('bug', 'browse', "productID=$productID&branch=$branch&browseType=bySearch&queryID=myQueryID"); $this->bug->buildSearchForm($productID, $this->products, $queryID, $actionURL); $this->loadModel('search')->mergeFeatureBar('bug', 'browse'); @@ -1118,14 +1117,7 @@ class bug extends control public function saveTemplate() { $this->bug->saveUserBugTemplate(); - if(dao::isError()) - { - $error = js::error(dao::getError()); - /* Remove html and meta tag and only get script */ - $error = substr($error, strpos($error, 'fetch('bug', 'buildTemplates')); } diff --git a/module/bug/view/batchcreate.html.php b/module/bug/view/batchcreate.html.php index a7be6c79d5..462636e75d 100644 --- a/module/bug/view/batchcreate.html.php +++ b/module/bug/view/batchcreate.html.php @@ -143,7 +143,7 @@ foreach(explode(',', $showFields) as $field) -createLink('custom', 'ajaxSaveCustom', 'module=bug§ion=custom&key=batchCreateFields')?> +createLink('custom', 'ajaxSaveCustomFields', 'module=bug§ion=custom&key=batchCreateFields')?> diff --git a/module/bug/view/batchedit.html.php b/module/bug/view/batchedit.html.php index acf769bfaa..d0541246bd 100644 --- a/module/bug/view/batchedit.html.php +++ b/module/bug/view/batchedit.html.php @@ -100,6 +100,6 @@ $columns = count($visibleFields) + 2; -createLink('custom', 'ajaxSaveCustom', 'module=bug§ion=custom&key=batchEditFields')?> +createLink('custom', 'ajaxSaveCustomFields', 'module=bug§ion=custom&key=batchEditFields')?> diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index b729178b38..e1f0135a39 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -268,6 +268,6 @@ js::set('refresh', $lang->refresh); bug->module);?> -createLink('custom', 'ajaxSaveCustom', 'module=bug§ion=custom&key=createFields');?> +createLink('custom', 'ajaxSaveCustomFields', 'module=bug§ion=custom&key=createFields');?> diff --git a/module/common/model.php b/module/common/model.php index 6cb41db5bc..a1a6cea711 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -140,7 +140,7 @@ class commonModel extends model { if(defined('IN_UPGRADE')) return; if(!$this->config->db->name) return; - $records = $this->loadModel('custom')->getAll(); + $records = $this->loadModel('custom')->getAllLang(); if(!$records) return; $this->lang->db = new stdclass(); $this->lang->db->custom = $records; @@ -160,11 +160,15 @@ class commonModel extends model if($module == 'api' and $method == 'getsessionid') return true; if($module == 'misc' and $method == 'ping') return true; if($module == 'misc' and $method == 'checktable') return true; - if($module == 'block') return true; + if($module == 'misc' and $method == 'qrcode') return true; + if($module == 'misc' and $method == 'about') return true; + if($module == 'misc' and $method == 'checkupdate') return true; + if($module == 'misc' and $method == 'changelog') return true; if($module == 'sso' and $method == 'login') return true; if($module == 'sso' and $method == 'logout') return true; if($module == 'sso' and $method == 'bind') return true; if($module == 'product' and $method == 'showerrornone') return true; + if($module == 'block') return true; if($this->loadModel('user')->isLogon()) { @@ -176,9 +180,6 @@ class commonModel extends model if(stripos($method, 'ajaxgetdropmenu') !== false) return true; if(stripos($method, 'ajaxgetmatcheditems') !== false) return true; - if($module == 'misc' and $method == 'qrcode') return true; - if($module == 'misc' and $method == 'about') return true; - if($module == 'misc' and $method == 'checkupdate') return true; return false; } @@ -297,7 +298,7 @@ class commonModel extends model if($app->company->backyard) echo html::a($app->company->backyard, $lang->company->backyard, '_blank'); if(!commonModel::isTutorialMode() and self::hasPriv('tutorial', 'start')) echo html::a(helper::createLink('tutorial', 'start'), $lang->tutorial, '', "class='iframe' data-width='800' data-headerless='true'"); - echo html::a(helper::createLink('misc', 'feature'), $lang->feature, '', "class='iframe' data-width='800' data-headerless='true'"); + echo html::a(helper::createLink('misc', 'changeLog'), $lang->feature, '', "class='iframe' data-width='800' data-headerless='true'"); echo html::a('javascript:;', $lang->help, '', "class='open-help-tab'"); echo html::a(helper::createLink('misc', 'about'), $lang->aboutZenTao, '', "class='about iframe' data-width='900' data-headerless='true' data-class='modal-about'"); } diff --git a/module/common/view/footer.html.php b/module/common/view/footer.html.php index ff87bb55cb..ba420313d0 100755 --- a/module/common/view/footer.html.php +++ b/module/common/view/footer.html.php @@ -27,6 +27,15 @@ function ajaxIgnoreBrowser(){$.get(createLink('misc', 'ajaxIgnoreBrowser'));} $(function(){showBrowserNotice()}); +global->novice) and $this->loadModel('tutorial')->checkNovice()):?> + + app->user->account; $fields = $this->post->fields; diff --git a/module/custom/model.php b/module/custom/model.php index 4fadb8cb8d..8604e908d8 100644 --- a/module/custom/model.php +++ b/module/custom/model.php @@ -17,7 +17,7 @@ class customModel extends model * @access public * @return array */ - public function getAll() + public function getAllLang() { $allCustomLang = $this->dao->select('*')->from(TABLE_LANG)->orderBy('lang,id')->fetchAll('id'); @@ -71,7 +71,7 @@ class customModel extends model */ public function getItems($paramString) { - return $this->createDAO($this->parseItemParam($paramString), 'select')->orderBy('lang,id')->fetchAll('key'); + return $this->prepareSQL($this->parseItemParam($paramString), 'select')->orderBy('lang,id')->fetchAll('key'); } /** @@ -83,7 +83,7 @@ class customModel extends model */ public function deleteItems($paramString) { - $this->createDAO($this->parseItemParam($paramString), 'delete')->exec(); + $this->prepareSQL($this->parseItemParam($paramString), 'delete')->exec(); } /** @@ -114,7 +114,7 @@ class customModel extends model * @access public * @return object */ - public function createDAO($params, $method = 'select') + public function prepareSQL($params, $method = 'select') { return $this->dao->$method('*')->from(TABLE_LANG)->where('1 = 1') ->beginIF($params['lang'])->andWhere('lang')->in($params['lang'])->fi() @@ -164,7 +164,7 @@ class customModel extends model } } } - else if(is_array($menuConfig)) + elseif(is_array($menuConfig)) { foreach($menuConfig as $menuConfigItem) { @@ -219,6 +219,7 @@ class customModel extends model } $hidden = !$fixed && $isSetMenuConfig && isset($menuConfigMap[$name]) && isset($menuConfigMap[$name]->hidden) && $menuConfigMap[$name]->hidden; + if(strpos($name, 'QUERY') === 0 and !isset($menuConfigMap[$name])) $hidden = true; $menuItem = new stdclass(); $menuItem->name = $name; @@ -293,7 +294,8 @@ class customModel extends model $menuConfig = ''; if(!commonModel::isTutorialMode() && isset($config->menucustom->$configKey)) $menuConfig = $config->menucustom->$configKey; if(!empty($menuConfig) && is_string($menuConfig)) $menuConfig = json_decode($menuConfig); - return $allMenu ? self::buildMenuConfig($allMenu, $menuConfig) : null; + $menu = $allMenu ? self::buildMenuConfig($allMenu, $menuConfig) : null; + return $menu; } /** diff --git a/module/file/control.php b/module/file/control.php index 241bbd01ac..f88f749758 100644 --- a/module/file/control.php +++ b/module/file/control.php @@ -359,9 +359,9 @@ class file extends control * @access public * @return void */ - public function buildExportTpl($module, $templateID = 0) + public function buildExportTPL($module, $templateID = 0) { - $templates = $this->file->getExportTpl($module); + $templates = $this->file->getExportTemplate($module); $templatePairs[] = ''; foreach($templates as $template) $templatePairs[$template->id] = ($template->public ? "[{$this->lang->public}] " : '') . $template->title; @@ -383,15 +383,10 @@ class file extends control $templateID = $this->file->saveExportTemplate($module); if(dao::isError()) { - $error = js::error(dao::getError()); - /* Remove html and meta tag and only get script */ - $error = substr($error, strpos($error, 'fetch('file', 'buildExportTpl', "module=$module&templateID=$templateID")); + die($this->fetch('file', 'buildExportTPL', "module=$module&templateID=$templateID")); } /** diff --git a/module/file/model.php b/module/file/model.php index 2e75770d80..493ec06d04 100644 --- a/module/file/model.php +++ b/module/file/model.php @@ -185,11 +185,11 @@ class fileModel extends model * @access public * @return object */ - public function getExportTpl($module) + public function getExportTemplate($module) { return $this->dao->select('id,title,content,public')->from(TABLE_USERTPL) ->where('type')->eq("export$module") - ->andwhere('account', true)->eq($this->app->user->account) + ->andwhere('account', $markLeft = true)->eq($this->app->user->account) ->orWhere('public')->eq('1') ->markRight(1) ->orderBy('id') diff --git a/module/file/view/export.html.php b/module/file/view/export.html.php index 9cdbdba0ee..aaed25ed36 100644 --- a/module/file/view/export.html.php +++ b/module/file/view/export.html.php @@ -12,7 +12,7 @@ ?> -app->loadLang('file');?> +app->loadLang('file');?> diff --git a/module/story/view/batchcreate.html.php b/module/story/view/batchcreate.html.php index d955c01809..d676ec37e0 100644 --- a/module/story/view/batchcreate.html.php +++ b/module/story/view/batchcreate.html.php @@ -114,7 +114,7 @@ foreach(explode(',', $showFields) as $field) -createLink('custom', 'ajaxSaveCustom', 'module=story§ion=custom&key=batchCreateFields')?> +createLink('custom', 'ajaxSaveCustomFields', 'module=story§ion=custom&key=batchCreateFields')?> diff --git a/module/story/view/batchedit.html.php b/module/story/view/batchedit.html.php index 3d28812966..6db49de532 100644 --- a/module/story/view/batchedit.html.php +++ b/module/story/view/batchedit.html.php @@ -108,6 +108,6 @@ foreach(explode(',', $showFields) as $field) -createLink('custom', 'ajaxSaveCustom', 'module=story§ion=custom&key=batchEditFields')?> +createLink('custom', 'ajaxSaveCustomFields', 'module=story§ion=custom&key=batchEditFields')?> diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index 105123e181..4b27ee1c4f 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -177,7 +177,7 @@ -createLink('custom', 'ajaxSaveCustom', 'module=story§ion=custom&key=createFields')?> +createLink('custom', 'ajaxSaveCustomFields', 'module=story§ion=custom&key=createFields')?> story->module);?> diff --git a/module/task/view/batchcreate.html.php b/module/task/view/batchcreate.html.php index d282f7ee19..c3280b93c6 100644 --- a/module/task/view/batchcreate.html.php +++ b/module/task/view/batchcreate.html.php @@ -118,7 +118,7 @@ foreach(explode(',', $showFields) as $field) task->ditto);?> -createLink('custom', 'ajaxSaveCustom', 'module=task§ion=custom&key=batchCreateFields')?> +createLink('custom', 'ajaxSaveCustomFields', 'module=task§ion=custom&key=batchCreateFields')?> diff --git a/module/task/view/batchedit.html.php b/module/task/view/batchedit.html.php index 52825b85a3..93c85d9ecd 100755 --- a/module/task/view/batchedit.html.php +++ b/module/task/view/batchedit.html.php @@ -95,6 +95,6 @@ foreach(explode(',', $showFields) as $field) -createLink('custom', 'ajaxSaveCustom', 'module=task§ion=custom&key=batchEditFields')?> +createLink('custom', 'ajaxSaveCustomFields', 'module=task§ion=custom&key=batchEditFields')?> diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php index ffeba0c4b6..58ce1e728c 100644 --- a/module/task/view/create.html.php +++ b/module/task/view/create.html.php @@ -154,6 +154,6 @@ -createLink('custom', 'ajaxSaveCustom', 'module=task§ion=custom&key=createFields')?> +createLink('custom', 'ajaxSaveCustomFields', 'module=task§ion=custom&key=createFields')?> diff --git a/module/testcase/control.php b/module/testcase/control.php index a28b8def44..4d2e459fc8 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -102,7 +102,6 @@ class testcase extends control $cases = $this->loadModel('story')->checkNeedConfirm($cases); /* Build the search form. */ - $this->config->testcase->search['style'] = 'shortcut'; $actionURL = $this->createLink('testcase', 'browse', "productID=$productID&branch=$branch&browseType=bySearch&queryID=myQueryID"); $this->testcase->buildSearchForm($productID, $this->products, $queryID, $actionURL); $this->loadModel('search')->mergeFeatureBar('testcase', 'browse'); diff --git a/module/testcase/view/batchcreate.html.php b/module/testcase/view/batchcreate.html.php index d8d18b55f6..9fbb84b672 100644 --- a/module/testcase/view/batchcreate.html.php +++ b/module/testcase/view/batchcreate.html.php @@ -95,7 +95,7 @@ foreach(explode(',', $showFields) as $field) -createLink('custom', 'ajaxSaveCustom', 'module=testcase§ion=custom&key=batchCreateFields')?> +createLink('custom', 'ajaxSaveCustomFields', 'module=testcase§ion=custom&key=batchCreateFields')?> diff --git a/module/testcase/view/batchedit.html.php b/module/testcase/view/batchedit.html.php index 4999606320..063deef2ca 100644 --- a/module/testcase/view/batchedit.html.php +++ b/module/testcase/view/batchedit.html.php @@ -75,6 +75,6 @@ foreach(explode(',', $showFields) as $field) -createLink('custom', 'ajaxSaveCustom', 'module=testcase§ion=custom&key=batchEditFields')?> +createLink('custom', 'ajaxSaveCustomFields', 'module=testcase§ion=custom&key=batchEditFields')?> diff --git a/module/testcase/view/create.html.php b/module/testcase/view/create.html.php index 18c57c3c94..6bd1018044 100644 --- a/module/testcase/view/create.html.php +++ b/module/testcase/view/create.html.php @@ -180,7 +180,7 @@ -createLink('custom', 'ajaxSaveCustom', 'module=testcase§ion=custom&key=createFields');?> +createLink('custom', 'ajaxSaveCustomFields', 'module=testcase§ion=custom&key=createFields');?> testcase->module)?> diff --git a/module/testtask/control.php b/module/testtask/control.php index 88c7de686e..a7882f6f48 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -262,7 +262,6 @@ class testtask extends control /* Build the search form. */ $this->loadModel('testcase'); - $this->config->testcase->search['style'] = 'shortcut'; $this->config->testcase->search['module'] = 'testtask'; $this->config->testcase->search['params']['product']['values'] = array($productID => $this->products[$productID], 'all' => $this->lang->testcase->allProduct); $this->config->testcase->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'case'); diff --git a/module/testtask/lang/en.php b/module/testtask/lang/en.php index c223e9d842..e0f4557527 100644 --- a/module/testtask/lang/en.php +++ b/module/testtask/lang/en.php @@ -103,8 +103,3 @@ $lang->testtask->action = new stdclass(); $lang->testtask->action->testtaskopened = '$date, 由 $actor opened test task. $extra。' . "\n"; $lang->testtask->action->testtaskstarted = '$date, 由 $actor started test task. $extra。' . "\n"; $lang->testtask->action->testtaskclosed = '$date, 由 $actor finished test task. $extra。' . "\n"; - -$lang->testtask->featurebar['cases']['all'] = $lang->testtask->allCases; -$lang->testtask->featurebar['cases']['assignedtome'] = $lang->testtask->assignedToMe; -$lang->testtask->featurebar['cases']['group'] = ''; -$lang->testtask->featurebar['groupcase'] = $lang->testtask->featurebar['cases']; diff --git a/module/testtask/lang/zh-cn.php b/module/testtask/lang/zh-cn.php index 7045f9bd12..b07da7ee4d 100644 --- a/module/testtask/lang/zh-cn.php +++ b/module/testtask/lang/zh-cn.php @@ -103,8 +103,3 @@ $lang->testtask->action = new stdclass(); $lang->testtask->action->testtaskopened = '$date, 由 $actor 创建版本 $extra。' . "\n"; $lang->testtask->action->testtaskstarted = '$date, 由 $actor 启动版本 $extra。' . "\n"; $lang->testtask->action->testtaskclosed = '$date, 由 $actor 完成版本 $extra。' . "\n"; - -$lang->testtask->featurebar['cases']['all'] = $lang->testtask->allCases; -$lang->testtask->featurebar['cases']['assignedtome'] = $lang->testtask->assignedToMe; -$lang->testtask->featurebar['cases']['group'] = ''; -$lang->testtask->featurebar['groupcase'] = $lang->testtask->featurebar['cases']; diff --git a/module/testtask/view/caseheader.html.php b/module/testtask/view/caseheader.html.php index 6309753544..80623ee4c3 100644 --- a/module/testtask/view/caseheader.html.php +++ b/module/testtask/view/caseheader.html.php @@ -20,20 +20,11 @@ $hasCasesPriv = common::hasPriv('testtask', 'cases'); $hasGroupPriv = common::hasPriv('testtask', 'groupcase'); ?> - moduleName, $this->methodName) as $menuItem):?> hidden)) continue; - $type = $menuItem->name; - if($hasCasesPriv and strpos($type, 'QUERY') === 0) - { - $queryID = (int)substr($type, 5); - echo "
  • " . html::a($this->inlink('cases', "taskID=$taskID&browseType=bySearch¶m=$queryID"), $menuItem->text) . "
  • "; - } - elseif($hasCasesPriv and ($type == 'all' or $type == 'assignedtome')) - { - echo "
  • " . html::a($this->inlink('cases', "taskID=$taskID&browseType=$type¶m=0"), $menuItem->text) . "
  • "; - } - elseif($hasGroupPriv and $type == 'group') + if($hasCasesPriv) echo "
  • " . html::a($this->inlink('cases', "taskID=$taskID&browseType=all¶m=0"), $lang->testtask->allCases) . "
  • "; + if($hasCasesPriv) echo "
  • " . html::a($this->inlink('cases', "taskID=$taskID&browseType=assignedtome¶m=0"), $lang->testtask->assignedToMe) . "
  • "; + + if($hasGroupPriv) { echo "'; } - ?> - - methodName == 'cases') echo "
  •  {$lang->testcase->bySearch}
  • "; - echo '
  • ' . html::a(inlink('view', "taskID=$taskID"), $lang->testtask->view) . '
  • '; + if(common::hasPriv('testtask', 'view')) echo '
  • ' . html::a(inlink('view', "taskID=$taskID"), $lang->testtask->view) . '
  • '; ?>
    diff --git a/module/todo/view/batchcreate.html.php b/module/todo/view/batchcreate.html.php index 81ddfa07dd..12380cb303 100755 --- a/module/todo/view/batchcreate.html.php +++ b/module/todo/view/batchcreate.html.php @@ -74,7 +74,7 @@ -createLink('custom', 'ajaxSaveCustom', 'module=todo§ion=custom&key=batchCreateFields')?> +createLink('custom', 'ajaxSaveCustomFields', 'module=todo§ion=custom&key=batchCreateFields')?>