diff --git a/VERSION b/VERSION index c175e23c58..80e3420014 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.3.beta +5.0.beta1 diff --git a/config/config.php b/config/config.php index 6059aa9124..cec0bacb39 100644 --- a/config/config.php +++ b/config/config.php @@ -17,7 +17,7 @@ if(!function_exists('getWebRoot')){function getWebRoot(){}} /* Basic settings. */ $config = new config(); -$config->version = '4.2'; // The version of zentaopms. Don't change it. +$config->version = '5.0.beta1'; // The version of zentaopms. Don't change it. $config->charset = 'UTF-8'; // The charset of zentaopms. $config->cookieLife = time() + 2592000; // The cookie life time. $config->timezone = 'Asia/Shanghai'; // The time zone setting, for more see http://www.php.net/manual/en/timezones.php @@ -134,7 +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`'); +define('TABLE_LANG', '`' . $config->db->prefix . 'lang`'); $config->objectTables['product'] = TABLE_PRODUCT; $config->objectTables['story'] = TABLE_STORY; @@ -151,7 +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; +$config->objectTables['custom'] = TABLE_LANG; /* Include extension config files. */ $extConfigFiles = glob($configRoot . 'ext/*.php'); diff --git a/db/update4.3.sql b/db/update4.3.sql index 743ee51395..ab58d360af 100644 --- a/db/update4.3.sql +++ b/db/update4.3.sql @@ -1,4 +1,4 @@ -CREATE TABLE IF NOT EXISTS `zt_custom` ( +CREATE TABLE IF NOT EXISTS `zt_lang` ( `id` mediumint(8) unsigned NOT NULL auto_increment, `lang` varchar(30) NOT NULL, `module` varchar(30) NOT NULL, @@ -9,4 +9,3 @@ CREATE TABLE IF NOT EXISTS `zt_custom` ( PRIMARY KEY (`id`), UNIQUE KEY `lang` (`lang`,`module`,`section`,`key`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; - diff --git a/db/zentao.sql b/db/zentao.sql index 2f2e7af25f..0e45ee81ed 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -139,12 +139,10 @@ CREATE TABLE IF NOT EXISTS `zt_company` ( `zipcode` char(10) default NULL, `website` char(120) default NULL, `backyard` char(120) default NULL, - `pms` char(120) default NULL, `guest` enum('1','0') NOT NULL default '0', `admins` char(255) default NULL, `deleted` enum('0','1') NOT NULL default '0', - PRIMARY KEY (`id`), - UNIQUE KEY `pms` (`pms`) + PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_config`; CREATE TABLE IF NOT EXISTS `zt_config` ( @@ -157,6 +155,18 @@ CREATE TABLE IF NOT EXISTS `zt_config` ( PRIMARY KEY (`id`), UNIQUE KEY `unique` (`owner`,`module`,`section`,`key`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; +-- DROP TABLE IF EXISTS `zt_lang`; +CREATE TABLE IF NOT EXISTS `zt_lang` ( + `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; -- DROP TABLE IF EXISTS `zt_dept`; CREATE TABLE IF NOT EXISTS `zt_dept` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -225,8 +235,9 @@ CREATE TABLE IF NOT EXISTS `zt_extension` ( `license` text NOT NULL, `type` varchar(20) NOT NULL default 'extension', `site` varchar(150) NOT NULL, - `zentaoVersion` varchar(100) NOT NULL, + `zentaoCompatible` varchar(100) NOT NULL, `installedTime` datetime NOT NULL, + `depends` varchar(100) NOT NULL, `dirs` text NOT NULL, `files` text NOT NULL, `status` varchar(20) NOT NULL, diff --git a/framework/router.class.php b/framework/router.class.php index e2fde411c1..11ba2d554f 100755 --- a/framework/router.class.php +++ b/framework/router.class.php @@ -1369,7 +1369,7 @@ class router /* Set the files to include. */ if(!is_file($mainConfigFile)) { - if($exitIfNone) self::error("config file $mainConfigFile not found", __FILE__, __LINE__, true); + if($exitIfNone) self::triggerError("config file $mainConfigFile not found", __FILE__, __LINE__, true); if(empty($extConfigFiles) and !isset($config->system->$moduleName)) return false; // and no extension file or extension in db, exit. $configFiles = $extConfigFiles; } @@ -1505,7 +1505,7 @@ class router */ private function connectByPDO($params) { - if(!isset($params->driver)) self::error('no pdo driver defined, it should be mysql or sqlite', __FILE__, __LINE__, $exit = true); + if(!isset($params->driver)) self::triggerError('no pdo driver defined, it should be mysql or sqlite', __FILE__, __LINE__, $exit = true); if(!isset($params->user)) return false; if($params->driver == 'mysql') { @@ -1530,7 +1530,7 @@ class router } catch (PDOException $exception) { - self::error($exception->getMessage(), __FILE__, __LINE__, $exit = true); + self::triggerError($exception->getMessage(), __FILE__, __LINE__, $exit = true); } } diff --git a/module/bug/control.php b/module/bug/control.php index 9ef85ec620..202263928c 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -221,6 +221,7 @@ class bug extends control { $this->view->users = $this->user->getPairs('nodeleted,devfirst'); if(empty($this->products)) $this->locate($this->createLink('product', 'create')); + $this->app->loadLang('release'); if(!empty($_POST)) { @@ -237,7 +238,9 @@ class bug extends control $actionID = $this->action->create('bug', $bugID, 'Opened'); $this->sendmail($bugID, $actionID); - $response['locate'] = $this->createLink('bug', 'browse', "productID={$this->post->product}&type=byModule¶m={$this->post->module}"); + + $location = $this->createLink('bug', 'browse', "productID={$this->post->product}&type=byModule¶m={$this->post->module}"); + $response['locate'] = isset($_SESSION['bugList']) ? $this->session->bugList : $location; $this->send($response); } @@ -305,9 +308,10 @@ class bug extends control } else { - $builds = $this->loadModel('build')->getProductBuildPairs($productID, 'noempty'); + $builds = $this->loadModel('build')->getProductBuildPairs($productID, 'noempty,release'); $stories = $this->story->getProductStoryPairs($productID); } + $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->create; $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); $this->view->position[] = $this->lang->bug->create; diff --git a/module/bug/js/common.js b/module/bug/js/common.js index 1fb51070c7..0aa33e5fc5 100644 --- a/module/bug/js/common.js +++ b/module/bug/js/common.js @@ -5,12 +5,14 @@ $(function() if(typeof page == 'undefined') page = ''; if(page == 'create') { + productID = $('#product').val(); changeProductConfirmed = true; oldStoryID = 0; oldProjectID = 0; oldOpenedBuild = ''; oldTaskID = 0; - setAssignedTo(); + setAssignedTo(0,productID); + notice(); } if(page == 'create' || page == 'edit' || page == 'assignedto' || page == 'confirmbug') @@ -42,10 +44,9 @@ function loadAll(productID) $('#taskIdBox').innerHTML = ''; // Reset the task. $('#task').chosen({no_results_text: noResultsMatch}); loadProductModules(productID); - loadProductStories(productID); loadProductProjects(productID); loadProductBuilds(productID); - loadProductPlans(productID); + loadProductStories(productID); } } @@ -101,7 +102,7 @@ function loadProductBuilds(productID) if(page == 'create') { - $('#buildBox').load(link); + $('#buildBox').load(link, function(){ notice(); }); } else { @@ -161,20 +162,6 @@ function loadProjectStories(projectID) $('#storyIdBox').load(link, function(){$('#story').chosen({no_results_text:noResultsMatch});}); } -/** - * Load product plans. - * - * @param int $productID - * @access public - * @return void - */ -function loadProductPlans(productID) -{ - if(typeof(planID) == 'undefined') planID = 0; - link = createLink('product', 'ajaxGetPlans', 'productID=' + $('#product').val() + '&planID=' + planID); - $('#planIdBox').load(link, function(){$('#story').chosen({no_results_text:noResultsMatch});}); -} - /** * Load builds of a project. * @@ -221,3 +208,26 @@ function setStories(moduleID, productID) $("#story").chosen({no_results_text: ''}); }); } + +/** + * notice for create build. + * + * @access public + * @return void + */ +function notice() +{ + if($('#openedBuild').find('option').length <= 1) + { + if($('#project').val() == '') + { + $('#buildBox').append('' + createRelease + ''); + $('#buildBox').append('' + refresh + ''); + } + else + { + $('#buildBox').append('' + createBuild + ''); + $('#buildBox').append('' + refresh + ''); + } + } +} diff --git a/module/bug/lang/en.php b/module/bug/lang/en.php index 3c1cb69661..274bf6c60e 100644 --- a/module/bug/lang/en.php +++ b/module/bug/lang/en.php @@ -80,7 +80,7 @@ $lang->bug->assignTo = 'Assign'; $lang->bug->browse = 'Browse Bug'; $lang->bug->view = 'Bug Info'; $lang->bug->resolve = 'Resolve'; -$lang->bug->barchResolve = 'batchResolve'; +$lang->bug->batchResolve = 'Batch resolve'; $lang->bug->close = 'Close'; $lang->bug->activate = 'Activate'; $lang->bug->reportChart = 'Report'; diff --git a/module/bug/lang/zh-tw.php b/module/bug/lang/zh-tw.php index 7611b86ea6..85e1dd97eb 100644 --- a/module/bug/lang/zh-tw.php +++ b/module/bug/lang/zh-tw.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->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/view/create.html.php b/module/bug/view/create.html.php index a5b99f7719..7493f41df2 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -18,6 +18,9 @@ include '../../common/view/alert.html.php'; include '../../common/view/kindeditor.html.php'; js::set('holders', $lang->bug->placeholder); js::set('page', 'create'); +js::set('createRelease', $lang->release->create); +js::set('createBuild', $lang->build->create); +js::set('refresh', $lang->refresh); ?>