diff --git a/db/update20.0.sql b/db/update20.0.sql index a20efbdc37..6479d2e285 100644 --- a/db/update20.0.sql +++ b/db/update20.0.sql @@ -19,24 +19,24 @@ ADD `planDuration` int(11) NOT NULL AFTER `parentVersion`, ADD `realDuration` int(11) NOT NULL AFTER `planDuration`, ADD `output` text NOT NULL AFTER `milestone`; -ALTER TABLE `zt_product` ADD `program` mediumint(8) unsigned NOT NULL AFTER `id`; -ALTER TABLE `zt_task` ADD `program` mediumint(8) unsigned NOT NULL AFTER `id`; -ALTER TABLE `zt_doc` ADD `program` mediumint(8) unsigned NOT NULL AFTER `id`; -ALTER TABLE `zt_story` ADD `program` mediumint(8) unsigned NOT NULL AFTER `id`; -ALTER TABLE `zt_repo` ADD `program` varchar(255) NOT NULL AFTER `id`; -ALTER TABLE `zt_bug` ADD `program` mediumint(8) unsigned NOT NULL AFTER `id`; -ALTER TABLE `zt_case` ADD `program` mediumint(8) unsigned NOT NULL AFTER `id`; -ALTER TABLE `zt_testtask` ADD `program` mediumint(8) unsigned NOT NULL AFTER `id`; -ALTER TABLE `zt_testreport` ADD `program` mediumint(8) unsigned NOT NULL AFTER `id`; -ALTER TABLE `zt_testsuite` ADD `program` mediumint(8) unsigned NOT NULL AFTER `id`; -ALTER TABLE `zt_build` ADD `program` mediumint(8) unsigned NOT NULL AFTER `id`; -ALTER TABLE `zt_release` ADD `program` mediumint(8) unsigned NOT NULL AFTER `id`; +ALTER TABLE `zt_product` ADD `PRJ` mediumint(8) unsigned NOT NULL AFTER `id`; +ALTER TABLE `zt_task` ADD `PRJ` mediumint(8) unsigned NOT NULL AFTER `id`; +ALTER TABLE `zt_doc` ADD `PRJ` mediumint(8) unsigned NOT NULL AFTER `id`; +ALTER TABLE `zt_story` ADD `PRJ` mediumint(8) unsigned NOT NULL AFTER `id`; +ALTER TABLE `zt_repo` ADD `PRJ` varchar(255) NOT NULL AFTER `id`; +ALTER TABLE `zt_bug` ADD `PRJ` mediumint(8) unsigned NOT NULL AFTER `id`; +ALTER TABLE `zt_case` ADD `PRJ` mediumint(8) unsigned NOT NULL AFTER `id`; +ALTER TABLE `zt_testtask` ADD `PRJ` mediumint(8) unsigned NOT NULL AFTER `id`; +ALTER TABLE `zt_testreport` ADD `PRJ` mediumint(8) unsigned NOT NULL AFTER `id`; +ALTER TABLE `zt_testsuite` ADD `PRJ` mediumint(8) unsigned NOT NULL AFTER `id`; +ALTER TABLE `zt_build` ADD `PRJ` mediumint(8) unsigned NOT NULL AFTER `id`; +ALTER TABLE `zt_release` ADD `PRJ` mediumint(8) unsigned NOT NULL AFTER `id`; -INSERT INTO `zt_group` (`name`, `role`, `desc`) VALUES ('项目管理员', 'pgmadmin', '项目管理员可以维护项目的权限'); +INSERT INTO `zt_group` (`name`, `role`, `desc`) VALUES ('项目管理员', 'PRJadmin', '项目管理员可以维护项目的权限'); -ALTER TABLE `zt_usergroup` ADD `program` text NOT NULL; +ALTER TABLE `zt_usergroup` ADD `PRJ` text NOT NULL; -ALTER TABLE `zt_userview` ADD `programs` mediumtext COLLATE 'utf8_general_ci' NOT NULL AFTER `account`; +ALTER TABLE `zt_userview` ADD `PRJ` mediumtext COLLATE 'utf8_general_ci' NOT NULL AFTER `account`; ALTER TABLE `zt_user` ADD `type` char(30) NOT NULL default 'inside' AFTER `account`; @@ -64,7 +64,7 @@ INSERT INTO `zt_stage` (`name`,`percent`,`type`,`createdBy`,`createdDate`,`edite -- DROP TABLE IF EXISTS `zt_design`; CREATE TABLE `zt_design` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `program` varchar(255) NOT NULL, + `PRJ` varchar(255) NOT NULL, `product` varchar(255) NOT NULL, `commit` text NOT NULL, `project` mediumint(9) NOT NULL DEFAULT '0', @@ -102,7 +102,7 @@ CREATE TABLE `zt_designspec` ( CREATE TABLE `zt_issue` ( `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT, `resolvedBy` varchar(30) NOT NULL, - `program` varchar(255) NOT NULL, + `PRJ` varchar(255) NOT NULL, `title` varchar(255) NOT NULL, `desc` text NOT NULL, `pri` char(30) NOT NULL, @@ -133,7 +133,7 @@ CREATE TABLE `zt_issue` ( CREATE TABLE `zt_risk` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `program` varchar(255) NOT NULL, + `PRJ` varchar(255) NOT NULL, `name` varchar(255) NOT NULL, `source` char(30) NOT NULL, `category` char(30) NOT NULL, @@ -183,7 +183,7 @@ CREATE TABLE `zt_projectspec` ( -- DROP TABLE IF EXISTS `zt_budget`; CREATE TABLE `zt_budget` ( `id` int(8) NOT NULL AUTO_INCREMENT, - `program` mediumint(8) NOT NULL, + `PRJ` mediumint(8) NOT NULL, `stage` char(30) NOT NULL, `subject` mediumint(8) NOT NULL, `amount` char(30) NOT NULL, @@ -200,7 +200,7 @@ CREATE TABLE `zt_budget` ( -- DROP TABLE IF EXISTS `zt_durationestimation`; CREATE TABLE `zt_durationestimation` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `program` mediumint(8) unsigned NOT NULL, + `PRJ` mediumint(8) unsigned NOT NULL, `stage` mediumint(9) NOT NULL, `workload` varchar(255) NOT NULL, `worktimeRate` varchar(255) NOT NULL, @@ -218,7 +218,7 @@ CREATE TABLE `zt_durationestimation` ( -- DROP TABLE IF EXISTS `zt_workestimation`; CREATE TABLE `zt_workestimation` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `program` mediumint(8) unsigned NOT NULL, + `PRJ` mediumint(8) unsigned NOT NULL, `scale` mediumint(8) unsigned NOT NULL, `productivity` smallint(3) unsigned NOT NULL, `duration` mediumint(8) unsigned NOT NULL, @@ -272,7 +272,7 @@ CREATE TABLE `zt_taskspec` ( CREATE TABLE `zt_weeklyreport`( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `program` mediumint(8) unsigned NOT NULL, + `PRJ` mediumint(8) unsigned NOT NULL, `weekStart` date NOT NULL, `pv` float(9,2) NOT NULL, `ev` float(9,2) NOT NULL, @@ -283,7 +283,7 @@ CREATE TABLE `zt_weeklyreport`( `progress` varchar(255) NOT NULL, `workload` varchar(255) NOT NULL, PRIMARY KEY (`id`), - UNIQUE KEY `week` (`program`,`weekStart`) + UNIQUE KEY `week` (`PRJ`,`weekStart`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; ALTER TABLE `zt_project` ADD `path` varchar(255) NOT NULL AFTER `parent`; diff --git a/db/zentao.sql b/db/zentao.sql index 0b6f4e9cab..53ae2036cb 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -48,7 +48,7 @@ CREATE TABLE IF NOT EXISTS `zt_branch` ( -- DROP TABLE IF EXISTS `zt_bug`; CREATE TABLE IF NOT EXISTS `zt_bug` ( `id` mediumint(8) NOT NULL auto_increment, - `program` mediumint(8) unsigned NOT NULL, + `PRJ` mediumint(8) unsigned NOT NULL, `product` mediumint(8) unsigned NOT NULL default '0', `branch` mediumint(8) unsigned NOT NULL default '0', `module` mediumint(8) unsigned NOT NULL default '0', @@ -115,7 +115,7 @@ CREATE TABLE IF NOT EXISTS `zt_bug` ( -- DROP TABLE IF EXISTS `zt_budget`; CREATE TABLE `zt_budget` ( `id` int(8) NOT NULL AUTO_INCREMENT, - `program` mediumint(8) NOT NULL, + `PRJ` mediumint(8) NOT NULL, `stage` char(30) NOT NULL, `subject` mediumint(8) NOT NULL, `amount` char(30) NOT NULL, @@ -131,7 +131,7 @@ CREATE TABLE `zt_budget` ( -- DROP TABLE IF EXISTS `zt_build`; CREATE TABLE IF NOT EXISTS `zt_build` ( `id` mediumint(8) unsigned NOT NULL auto_increment, - `program` mediumint(8) unsigned NOT NULL, + `PRJ` mediumint(8) unsigned NOT NULL, `product` mediumint(8) unsigned NOT NULL default '0', `branch` mediumint(8) unsigned NOT NULL default '0', `project` mediumint(8) unsigned NOT NULL default '0', @@ -163,7 +163,7 @@ CREATE TABLE IF NOT EXISTS `zt_burn` ( -- DROP TABLE IF EXISTS `zt_case`; CREATE TABLE IF NOT EXISTS `zt_case` ( `id` mediumint(8) unsigned NOT NULL auto_increment, - `program` mediumint(8) unsigned NOT NULL, + `PRJ` mediumint(8) unsigned NOT NULL, `product` mediumint(8) unsigned NOT NULL default '0', `branch` mediumint(8) unsigned NOT NULL default '0', `lib` mediumint(8) unsigned NOT NULL default '0', @@ -312,7 +312,7 @@ CREATE TABLE IF NOT EXISTS `zt_dept` ( -- DROP TABLE IF EXISTS `zt_design`; CREATE TABLE `zt_design` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `program` varchar(255) NOT NULL, + `PRJ` varchar(255) NOT NULL, `product` varchar(255) NOT NULL, `commit` varchar(30) NOT NULL, `project` mediumint(9) NOT NULL DEFAULT '0', @@ -348,7 +348,7 @@ CREATE TABLE `zt_designspec` ( -- DROP TABLE IF EXISTS `zt_doc`; CREATE TABLE IF NOT EXISTS `zt_doc` ( `id` mediumint(8) unsigned NOT NULL auto_increment, - `program` mediumint(8) unsigned NOT NULL, + `PRJ` mediumint(8) unsigned NOT NULL, `product` mediumint(8) unsigned NOT NULL, `project` mediumint(8) unsigned NOT NULL, `lib` varchar(30) NOT NULL, @@ -406,7 +406,7 @@ CREATE TABLE IF NOT EXISTS `zt_doclib` ( -- DROP TABLE IF EXISTS `zt_durationestimation`; CREATE TABLE `zt_durationestimation` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `program` mediumint(8) unsigned NOT NULL, + `PRJ` mediumint(8) unsigned NOT NULL, `stage` mediumint(9) NOT NULL, `workload` varchar(255) NOT NULL, `worktimeRate` varchar(255) NOT NULL, @@ -479,7 +479,7 @@ CREATE TABLE IF NOT EXISTS `zt_file` ( -- DROP TABLE IF EXISTS `zt_group`; CREATE TABLE IF NOT EXISTS `zt_group` ( `id` mediumint(8) unsigned NOT NULL auto_increment, - `program` mediumint(8) unsigned NOT NULL DEFAULT 0, + `PRJ` mediumint(8) unsigned NOT NULL DEFAULT 0, `name` char(30) NOT NULL, `role` char(30) NOT NULL default '', `desc` char(255) NOT NULL default '', @@ -521,7 +521,7 @@ CREATE TABLE IF NOT EXISTS `zt_holiday` ( CREATE TABLE `zt_issue` ( `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT, `resolvedBy` varchar(30) NOT NULL, - `program` varchar(255) NOT NULL, + `PRJ` varchar(255) NOT NULL, `title` varchar(255) NOT NULL, `desc` text NOT NULL, `pri` char(30) NOT NULL, @@ -637,7 +637,7 @@ CREATE TABLE IF NOT EXISTS `zt_oauth` ( -- DROP TABLE IF EXISTS `zt_product`; CREATE TABLE IF NOT EXISTS `zt_product` ( `id` mediumint(8) unsigned NOT NULL auto_increment, - `program` mediumint(8) unsigned NOT NULL, + `PRJ` mediumint(8) unsigned NOT NULL, `name` varchar(90) NOT NULL, `code` varchar(45) NOT NULL, `line` mediumint(8) NOT NULL, @@ -762,7 +762,7 @@ CREATE TABLE IF NOT EXISTS `zt_projectstory` ( -- DROP TABLE IF EXISTS `zt_release`; CREATE TABLE IF NOT EXISTS `zt_release` ( `id` mediumint(8) unsigned NOT NULL auto_increment, - `program` mediumint(8) unsigned NOT NULL, + `PRJ` mediumint(8) unsigned NOT NULL, `product` mediumint(8) unsigned NOT NULL default '0', `branch` mediumint(8) unsigned NOT NULL default '0', `build` mediumint(8) unsigned NOT NULL, @@ -783,7 +783,7 @@ CREATE TABLE IF NOT EXISTS `zt_release` ( -- DROP TABLE IF EXISTS `zt_repo`; CREATE TABLE IF NOT EXISTS `zt_repo` ( `id` mediumint(9) NOT NULL AUTO_INCREMENT, - `program` varchar(255) NOT NULL, + `PRJ` varchar(255) NOT NULL, `name` varchar(255) NOT NULL, `path` varchar(255) NOT NULL, `prefix` varchar(100) NOT NULL, @@ -841,7 +841,7 @@ CREATE TABLE IF NOT EXISTS `zt_repohistory` ( -- DROP TABLE IF EXISTS `zt_risk`; CREATE TABLE `zt_risk` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `program` varchar(255) NOT NULL, + `PRJ` varchar(255) NOT NULL, `name` varchar(255) NOT NULL, `source` char(30) NOT NULL, `category` char(30) NOT NULL, @@ -879,7 +879,7 @@ CREATE TABLE `zt_risk` ( -- DROP TABLE IF EXISTS `zt_story`; CREATE TABLE IF NOT EXISTS `zt_story` ( `id` mediumint(8) unsigned NOT NULL auto_increment, - `program` mediumint(8) unsigned NOT NULL, + `PRJ` mediumint(8) unsigned NOT NULL, `parent` mediumint(9) NOT NULL default '0', `product` mediumint(8) unsigned NOT NULL default '0', `branch` mediumint(8) unsigned NOT NULL default '0', @@ -964,7 +964,7 @@ CREATE TABLE IF NOT EXISTS `zt_suitecase` ( -- DROP TABLE IF EXISTS `zt_task`; CREATE TABLE IF NOT EXISTS `zt_task` ( `id` mediumint(8) unsigned NOT NULL auto_increment, - `program` mediumint(8) unsigned NOT NULL, + `PRJ` mediumint(8) unsigned NOT NULL, `parent` mediumint(8) NOT NULL DEFAULT '0', `project` mediumint(8) unsigned NOT NULL default '0', `module` mediumint(8) unsigned NOT NULL default '0', @@ -1053,7 +1053,7 @@ CREATE TABLE IF NOT EXISTS `zt_team` ( -- DROP TABLE IF EXISTS `zt_testreport`; CREATE TABLE IF NOT EXISTS `zt_testreport` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `program` mediumint(8) unsigned NOT NULL, + `PRJ` mediumint(8) unsigned NOT NULL, `product` mediumint(8) unsigned NOT NULL, `project` mediumint(8) unsigned NOT NULL, `tasks` varchar(255) NOT NULL, @@ -1110,7 +1110,7 @@ CREATE TABLE IF NOT EXISTS `zt_testrun` ( -- DROP TABLE IF EXISTS `zt_testsuite`; CREATE TABLE IF NOT EXISTS `zt_testsuite` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `program` mediumint(8) unsigned NOT NULL, + `PRJ` mediumint(8) unsigned NOT NULL, `product` mediumint(8) unsigned NOT NULL, `name` varchar(255) NOT NULL, `desc` text NOT NULL, @@ -1126,7 +1126,7 @@ CREATE TABLE IF NOT EXISTS `zt_testsuite` ( -- DROP TABLE IF EXISTS `zt_testtask`; CREATE TABLE IF NOT EXISTS `zt_testtask` ( `id` mediumint(8) unsigned NOT NULL auto_increment, - `program` mediumint(8) unsigned NOT NULL, + `PRJ` mediumint(8) unsigned NOT NULL, `product` mediumint(8) unsigned NOT NULL, `name` char(90) NOT NULL, `project` mediumint(8) unsigned NOT NULL default '0', @@ -1229,7 +1229,7 @@ CREATE TABLE IF NOT EXISTS `zt_usercontact` ( CREATE TABLE IF NOT EXISTS `zt_usergroup` ( `account` char(30) NOT NULL default '', `group` mediumint(8) unsigned NOT NULL default '0', - `program` text NOT NULL, + `PRJ` text NOT NULL, UNIQUE KEY `account` (`account`,`group`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_userquery`; @@ -1259,7 +1259,7 @@ CREATE TABLE IF NOT EXISTS `zt_usertpl` ( -- DROP TABLE IF EXISTS `zt_userview`; CREATE TABLE IF NOT EXISTS `zt_userview` ( `account` char(30) NOT NULL, - `programs` mediumtext NOT NULL, + `PRJ` mediumtext NOT NULL, `products` mediumtext NOT NULL, `projects` mediumtext NOT NULL, UNIQUE KEY `account` (`account`) @@ -1307,7 +1307,7 @@ CREATE TABLE IF NOT EXISTS `zt_webhook` ( -- DROP TABLE IF EXISTS `zt_weeklyreport`; CREATE TABLE `zt_weeklyreport`( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `program` mediumint(8) unsigned NOT NULL, + `PRJ` mediumint(8) unsigned NOT NULL, `weekStart` date NOT NULL, `pv` float(9,2) NOT NULL, `ev` float(9,2) NOT NULL, @@ -1318,12 +1318,12 @@ CREATE TABLE `zt_weeklyreport`( `progress` varchar(255) NOT NULL, `workload` varchar(255) NOT NULL, PRIMARY KEY (`id`), - UNIQUE KEY `week` (`program`,`weekStart`) + UNIQUE KEY `week` (`PRJ`,`weekStart`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_workestimation`; CREATE TABLE `zt_workestimation` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `program` mediumint(8) unsigned NOT NULL, + `PRJ` mediumint(8) unsigned NOT NULL, `scale` mediumint(8) unsigned NOT NULL, `productivity` smallint(3) unsigned NOT NULL, `duration` mediumint(8) unsigned NOT NULL, @@ -1374,7 +1374,7 @@ CREATE TABLE `zt_score` ( -- DROP TABLE IF EXISTS `zt_relation`; CREATE TABLE IF NOT EXISTS `zt_relation` ( `id` int(8) NOT NULL AUTO_INCREMENT PRIMARY KEY, - `program` mediumint(8) NOT NULL, + `PRJ` mediumint(8) NOT NULL, `product` mediumint(8) NOT NULL, `project` mediumint(8) NOT NULL, `AType` char(30) NOT NULL, diff --git a/framework/base/control.class.php b/framework/base/control.class.php index f5227132f3..13aebfc8ac 100644 --- a/framework/base/control.class.php +++ b/framework/base/control.class.php @@ -930,10 +930,10 @@ class baseControl * @access public * @return string the link string. */ - public function createLink($moduleName, $methodName = 'index', $vars = array(), $viewType = '', $onlybody = false, $programID = 0) + public function createLink($moduleName, $methodName = 'index', $vars = array(), $viewType = '', $onlybody = false, $PRJID = 0) { if(empty($moduleName)) $moduleName = $this->moduleName; - return helper::createLink($moduleName, $methodName, $vars, $viewType, $onlybody, $programID); + return helper::createLink($moduleName, $methodName, $vars, $viewType, $onlybody, $PRJID); } /** diff --git a/framework/base/helper.class.php b/framework/base/helper.class.php index 4e876f6d55..7867e3c442 100644 --- a/framework/base/helper.class.php +++ b/framework/base/helper.class.php @@ -60,11 +60,11 @@ class baseHelper * @access public * @return string the link string. */ - static public function createLink($moduleName, $methodName = 'index', $vars = '', $viewType = '', $onlyBody = false, $programID = 0) + static public function createLink($moduleName, $methodName = 'index', $vars = '', $viewType = '', $onlyBody = false, $PRJID = 0) { /* 设置$appName和$moduleName。Set appName and moduleName. */ global $app, $config; - $programID = $programID ? $programID : $app->session->program; + $PRJID = $PRJID ? $PRJID : $app->session->PRJ; if(strpos($moduleName, '.') !== false) { @@ -97,7 +97,7 @@ class baseHelper foreach($vars as $key => $value) $link .= "&$key=$value"; $link = self::processOnlyBodyParam($link, $onlyBody); - return self::processProgramParam($link, $programID, $onlyBody); + return self::processPRJParam($link, $PRJID, $onlyBody); } /** @@ -113,7 +113,7 @@ class baseHelper $link .= '.' . $viewType; $link = self::processOnlyBodyParam($link, $onlyBody); - return self::processProgramParam($link, $programID, $onlyBody); + return self::processPRJParam($link, $PRJID, $onlyBody); } /** @@ -125,7 +125,7 @@ class baseHelper { $link .= $config->default->method . '.' . $viewType; $link = self::processOnlyBodyParam($link, $onlyBody); - return self::processProgramParam($link, $programID, $onlyBody); + return self::processPRJParam($link, $PRJID, $onlyBody); } /** @@ -137,7 +137,7 @@ class baseHelper { $link .= $moduleName . '/'; $link = self::processOnlyBodyParam($link, $onlyBody); - return self::processProgramParam($link, $programID, $onlyBody); + return self::processPRJParam($link, $PRJID, $onlyBody); } /** @@ -147,28 +147,28 @@ class baseHelper */ $link .= $moduleName . '.' . $viewType; $link = self::processOnlyBodyParam($link, $onlyBody); - return self::processProgramParam($link, $programID, $onlyBody); + return self::processPRJParam($link, $PRJID, $onlyBody); } /** - * 处理program 参数。 - * Process the programID param in url. + * 处理PRJ 参数。 + * Process the PRJID param in url. * - * 如果传参的时候设定了$programID,在生成链接的时候继续追加。 + * 如果传参的时候设定了$PRJID,在生成链接的时候继续追加。 * If $progrmID in the url, append it to the link. * * @param string $link - * @param int $programID + * @param int $PRJID * @param bool $onlybody * @static * @access public * @return string */ - public static function processProgramParam($link, $programID = '', $onlybody = false) + public static function processPRJParam($link, $PRJID = '', $onlybody = false) { global $config; - if(!$programID) return $link; - $link .= strpos($link, '?') === false ? "?pgm=$programID" : "&pgm=$programID"; + if(!$PRJID) return $link; + $link .= strpos($link, '?') === false ? "?PRJ=$PRJID" : "&PRJ=$PRJID"; return $link; } diff --git a/framework/base/router.class.php b/framework/base/router.class.php index 80dd51529c..3cda125117 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -372,7 +372,7 @@ class baseRouter $this->setErrorHandler(); $this->setTimezone(); $this->startSession(); - $this->setProgram(); + $this->setPRJ(); if($this->config->framework->multiSite) $this->setSiteCode() && $this->loadExtraConfig(); if($this->config->framework->autoConnectDB) $this->connectDB(); @@ -847,9 +847,9 @@ class baseRouter * @access public * @return void */ - public function setProgram() + public function setPRJ() { - if(isset($_GET['pgm'])) $this->session->set('program', $_GET['pgm']); //Set program id into session. + if(isset($_GET['PRJ'])) $this->session->set('PRJ', $_GET['PRJ']); //Set PRJ id into session. } /** diff --git a/framework/router.class.php b/framework/router.class.php index 90aac12d30..1e0defae6a 100755 --- a/framework/router.class.php +++ b/framework/router.class.php @@ -150,7 +150,7 @@ class router extends baseRouter $productIndex = $storyIndex = $hourIndex = $planIndex = $URAndSR = 0; $projectIndex = empty($this->config->isINT) ? 0 : 1; - if($this->session->program) $model = $this->dbh->query('SELECT model FROM' . TABLE_PROJECT . "WHERE id = {$this->session->program}")->fetch(); + if($this->session->PRJ) $model = $this->dbh->query('SELECT model FROM' . TABLE_PROJECT . "WHERE id = {$this->session->PRJ}")->fetch(); foreach($commonSettings as $setting) { diff --git a/module/block/control.php b/module/block/control.php index 6a75a5f5ee..f074c3ae92 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -215,7 +215,7 @@ class block extends control $commonField = 'common'; if($module == 'program') { - $program = $this->loadModel('project')->getByID($this->session->program); + $program = $this->loadModel('project')->getByID($this->session->PRJ); $commonField = $program->template . 'common'; } $inited = empty($this->config->$module->$commonField->blockInited) ? '' : $this->config->$module->$commonField->blockInited; @@ -422,7 +422,7 @@ class block extends control /* Create a program block. */ if($dashboard == 'program') { - $program = $this->loadModel('project')->getByID($this->session->program); + $program = $this->loadModel('project')->getByID($this->session->PRJ); $template = $program->template; } @@ -578,7 +578,7 @@ class block extends control $this->session->set('storyList', $uri); if(preg_match('/[^a-zA-Z0-9_]/', $this->params->type)) die(); - $programID = $this->view->block->module == 'my' ? 0 : (int)$this->session->program; + $programID = $this->view->block->module == 'my' ? 0 : (int)$this->session->PRJ; $this->view->tasks = $this->loadModel('task')->getUserTasks($this->app->user->account, $this->params->type, $this->viewType == 'json' ? 0 : (int)$this->params->count, null, $this->params->orderBy, $programID); } @@ -593,7 +593,7 @@ class block extends control $this->session->set('bugList', $this->app->getURI(true)); if(preg_match('/[^a-zA-Z0-9_]/', $this->params->type)) die(); - $programID = $this->view->block->module == 'my' ? 0 : (int)$this->session->program; + $programID = $this->view->block->module == 'my' ? 0 : (int)$this->session->PRJ; $this->view->bugs = $this->loadModel('bug')->getUserBugs($this->app->user->account, $this->params->type, $this->params->orderBy, $this->viewType == 'json' ? 0 : (int)$this->params->count, null, $programID); } @@ -620,7 +620,7 @@ class block extends control ->andWhere('t3.status')->ne('done') ->andWhere('t3.deleted')->eq(0) ->andWhere('t2.deleted')->eq(0) - ->beginIF($this->view->block->module != 'my' and $this->session->program)->andWhere('t2.program')->eq((int)$this->session->program)->fi() + ->beginIF($this->view->block->module != 'my' and $this->session->PRJ)->andWhere('t2.program')->eq((int)$this->session->PRJ)->fi() ->orderBy($this->params->orderBy) ->beginIF($this->viewType != 'json')->limit((int)$this->params->count)->fi() ->fetchAll(); @@ -629,7 +629,7 @@ class block extends control { $cases = $this->dao->findByOpenedBy($this->app->user->account)->from(TABLE_CASE) ->andWhere('deleted')->eq(0) - ->beginIF($this->view->block->module != 'my' and $this->session->program)->andWhere('program')->eq((int)$this->session->program)->fi() + ->beginIF($this->view->block->module != 'my' and $this->session->PRJ)->andWhere('program')->eq((int)$this->session->PRJ)->fi() ->orderBy($this->params->orderBy) ->beginIF($this->viewType != 'json')->limit((int)$this->params->count)->fi() ->fetchAll(); @@ -654,7 +654,7 @@ class block extends control ->leftJoin(TABLE_PROJECT)->alias('t4')->on('t1.project=t4.id') ->leftJoin(TABLE_PROJECTPRODUCT)->alias('t5')->on('t1.project=t5.project') ->where('t1.deleted')->eq('0') - ->beginIF($this->view->block->module != 'my' and $this->session->program)->andWhere('t1.program')->eq((int)$this->session->program)->fi() + ->beginIF($this->view->block->module != 'my' and $this->session->PRJ)->andWhere('t1.program')->eq((int)$this->session->PRJ)->fi() ->beginIF(!$this->app->user->admin)->andWhere('t1.product')->in($this->app->user->view->products)->fi() ->andWhere('t1.product = t5.product') ->beginIF($this->params->type != 'all')->andWhere('t1.status')->eq($this->params->type)->fi() @@ -679,7 +679,7 @@ class block extends control $type = isset($this->params->type) ? $this->params->type : 'assignedTo'; $orderBy = isset($this->params->type) ? $this->params->orderBy : 'id_asc'; - $programID = $this->view->block->module == 'my' ? 0 : (int)$this->session->program; + $programID = $this->view->block->module == 'my' ? 0 : (int)$this->session->PRJ; $this->view->stories = $this->loadModel('story')->getUserStories($this->app->user->account, $type, $orderBy, $this->viewType != 'json' ? $pager : '', 'story', $programID); } @@ -696,7 +696,7 @@ class block extends control $this->view->plans = $this->dao->select('t1.*,t2.name as productName')->from(TABLE_PRODUCTPLAN)->alias('t1') ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id') ->where('t1.deleted')->eq('0') - ->beginIF($this->view->block->module != 'my' and $this->session->program)->andWhere('t2.program')->eq((int)$this->session->program)->fi() + ->beginIF($this->view->block->module != 'my' and $this->session->PRJ)->andWhere('t2.program')->eq((int)$this->session->PRJ)->fi() ->beginIF(!$this->app->user->admin)->andWhere('t1.product')->in($this->app->user->view->products)->fi() ->orderBy('t1.begin desc') ->beginIF($this->viewType != 'json')->limit((int)$this->params->count)->fi() @@ -717,7 +717,7 @@ class block extends control ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id') ->leftJoin(TABLE_BUILD)->alias('t3')->on('t1.build=t3.id') ->where('t1.deleted')->eq('0') - ->beginIF($this->view->block->module != 'my' and $this->session->program)->andWhere('t1.program')->eq((int)$this->session->program)->fi() + ->beginIF($this->view->block->module != 'my' and $this->session->PRJ)->andWhere('t1.program')->eq((int)$this->session->PRJ)->fi() ->beginIF(!$this->app->user->admin)->andWhere('t1.product')->in($this->app->user->view->products)->fi() ->orderBy('t1.id desc') ->beginIF($this->viewType != 'json')->limit((int)$this->params->count)->fi() @@ -738,7 +738,7 @@ class block extends control ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id') ->where('t1.deleted')->eq('0') ->beginIF(!$this->app->user->admin)->andWhere('t1.project')->in($this->app->user->view->projects)->fi() - ->beginIF($this->view->block->module != 'my' and $this->session->program)->andWhere('t1.program')->eq((int)$this->session->program)->fi() + ->beginIF($this->view->block->module != 'my' and $this->session->PRJ)->andWhere('t1.program')->eq((int)$this->session->PRJ)->fi() ->orderBy('t1.id desc') ->beginIF($this->viewType != 'json')->limit((int)$this->params->count)->fi() ->fetchAll(); @@ -845,12 +845,12 @@ class block extends control foreach($programs as $programID => $program) { - if($program->template == 'scrum') + if($program->model == 'scrum') { $program->progress = $program->allStories == 0 ? 0 : round($program->doneStories / $program->allStories, 3) * 100; $program->projects = $this->project->getProjectStats('all', 0, 0, 1, 'id_desc', null, $programID); } - elseif($program->template == 'waterfall') + elseif($program->model == 'waterfall') { $begin = $program->begin; $weeks = $this->weekly->getWeekPairs($begin); @@ -1021,7 +1021,7 @@ class block extends control $count = isset($this->params->count) ? (int)$this->params->count : 0; /* Get projects. */ - $programID = $this->view->block->module == 'my' ? 0 : (int)$this->session->program; + $programID = $this->view->block->module == 'my' ? 0 : (int)$this->session->PRJ; $projects = $this->loadModel('project')->getOrderedProjects($status, $count, $programID); if(empty($projects)) { @@ -1141,7 +1141,7 @@ class block extends control */ public function printWaterfallReportBlock() { - $program = $this->loadModel('project')->getByID($this->session->program); + $program = $this->loadModel('project')->getByID($this->session->PRJ); $today = helper::today(); $date = date('Ymd', strtotime('this week Monday')); $begin = $program->begin; @@ -1151,14 +1151,14 @@ class block extends control $task = $this->dao->select(" sum(consumed) as totalConsumed, sum(if(status != 'cancel' and status != 'closed', `left`, 0)) as totalLeft") - ->from(TABLE_TASK)->where('program')->eq($this->session->program) + ->from(TABLE_TASK)->where('program')->eq($this->session->PRJ) ->andWhere('deleted')->eq(0) ->andWhere('parent')->lt(1) ->fetch(); - $this->view->pv = $this->weekly->getPV($this->session->program, $today); - $this->view->ev = $this->weekly->getEV($this->session->program, $today); - $this->view->ac = $this->weekly->getAC($this->session->program, $today); + $this->view->pv = $this->weekly->getPV($this->session->PRJ, $today); + $this->view->ev = $this->weekly->getEV($this->session->PRJ, $today); + $this->view->ac = $this->weekly->getAC($this->session->PRJ, $today); $this->view->sv = $this->weekly->getSV($this->view->ev, $this->view->pv); $this->view->cv = $this->weekly->getCV($this->view->ev, $this->view->ac); @@ -1174,11 +1174,11 @@ class block extends control */ public function printWaterfallGanttBlock() { - $products = $this->loadModel('product')->getPairs('', $this->session->program); + $products = $this->loadModel('product')->getPairs('', $this->session->PRJ); $productID = isset($this->session->product) ? 0 : $this->session->product; if(!$productID) $productID = key($products); - $this->view->plans = $this->loadModel('programplan')->getDataForGantt($this->session->program, $productID, 0, 'task', false); + $this->view->plans = $this->loadModel('programplan')->getDataForGantt($this->session->PRJ, $productID, 0, 'task', false); $this->view->products = $products; $this->view->productID = $productID; } @@ -1195,7 +1195,7 @@ class block extends control $this->session->set('issueList', $uri); if(preg_match('/[^a-zA-Z0-9_]/', $this->params->type)) die(); $this->view->users = $this->loadModel('user')->getPairs('noletter'); - $this->view->issues = $this->loadModel('issue')->getBlockIssues($this->session->program, $this->params->type, $this->viewType == 'json' ? 0 : (int)$this->params->count, $this->params->orderBy); + $this->view->issues = $this->loadModel('issue')->getBlockIssues($this->session->PRJ, $this->params->type, $this->viewType == 'json' ? 0 : (int)$this->params->count, $this->params->orderBy); } /** @@ -1209,7 +1209,7 @@ class block extends control $uri = $this->app->getURI(true); $this->session->set('riskList', $uri); $this->view->users = $this->loadModel('user')->getPairs('noletter'); - $this->view->risks = $this->loadModel('risk')->getBlockRisks($this->session->program, $this->params->type, $this->viewType == 'json' ? 0 : (int)$this->params->count, $this->params->orderBy); + $this->view->risks = $this->loadModel('risk')->getBlockRisks($this->session->PRJ, $this->params->type, $this->viewType == 'json' ? 0 : (int)$this->params->count, $this->params->orderBy); } /** @@ -1221,12 +1221,12 @@ class block extends control public function printWaterfallEstimateBlock() { $this->app->loadLang('durationestimation'); - $programID = $this->session->program; + $programID = $this->session->PRJ; $members = $this->loadModel('project')->getTeamMemberPairs($programID); $budget = $this->loadModel('workestimation')->getBudget($programID); if(empty($budget)) $budget = new stdclass(); - $this->view->people = $this->dao->select('sum(people) as people')->from(TABLE_DURATIONESTIMATION)->where('program')->eq($this->session->program)->fetch('people'); + $this->view->people = $this->dao->select('sum(people) as people')->from(TABLE_DURATIONESTIMATION)->where('program')->eq($this->session->PRJ)->fetch('people'); $this->view->members = count($members) ? count($members) - 1 : 0; $this->view->consumed = $this->dao->select('sum(consumed) as consumed')->from(TABLE_TASK)->where('program')->eq($programID)->andWhere('deleted')->eq(0)->andWhere('parent')->lt(1)->fetch('consumed'); $this->view->budget = $budget; @@ -1242,7 +1242,7 @@ class block extends control { $this->loadModel('milestone'); $this->loadModel('weekly'); - $programID = $this->session->program; + $programID = $this->session->PRJ; $program = $this->loadModel('project')->getByID($programID); $begin = $program->begin; @@ -1279,7 +1279,7 @@ class block extends control */ public function printScrumOverviewBlock() { - $programID = $this->session->program; + $programID = $this->session->PRJ; $totalData = $this->loadModel('program')->getProgramOverview('byId', $programID, 'id_desc', 1); $this->view->totalData = $totalData; @@ -1299,7 +1299,7 @@ class block extends control $count = isset($this->params->count) ? (int)$this->params->count : 15; $type = isset($this->params->type) ? $this->params->type : 'all'; $pager = pager::init(0, $count, 1); - $this->view->projectStats = $this->loadModel('project')->getProjectStats($type, $productID = 0, $branch = 0, $itemCounts = 30, $orderBy = 'order_desc', $this->viewType != 'json' ? $pager : '', $this->session->program); + $this->view->projectStats = $this->loadModel('project')->getProjectStats($type, $productID = 0, $branch = 0, $itemCounts = 30, $orderBy = 'order_desc', $this->viewType != 'json' ? $pager : '', $this->session->PRJ); } /** @@ -1315,7 +1315,7 @@ class block extends control $releases = array(); $count = isset($this->params->count) ? (int)$this->params->count : 15; - $products = $this->dao->select('id, name')->from(TABLE_PRODUCT)->where('program')->eq($this->session->program)->limit(15)->fetchPairs(); + $products = $this->dao->select('id, name')->from(TABLE_PRODUCT)->where('program')->eq($this->session->PRJ)->limit(15)->fetchPairs(); $productIdList = array_keys($products); if(!empty($productIdList)) { @@ -1341,7 +1341,7 @@ class block extends control { $status = $this->dao->select('status, count(*) as count')->from(TABLE_PROJECT) ->where('deleted')->eq(0) - ->andWhere('program')->eq($this->session->program) + ->andWhere('program')->eq($this->session->PRJ) ->groupBy('status') ->fetchPairs(); @@ -1366,7 +1366,7 @@ class block extends control */ public function printProgramDynamicBlock() { - $programID = $this->session->program; + $programID = $this->session->PRJ; $projects = $this->loadModel('project')->getPairs('', $programID); $products = $this->loadModel('product')->getPairs('', $programID); @@ -1398,7 +1398,7 @@ class block extends control $this->session->set('releaseList', $this->app->getURI(true)); $this->session->set('productPlanList', $this->app->getURI(true)); - $products = $this->loadModel('product')->getPairs('', $this->session->program); + $products = $this->loadModel('product')->getPairs('', $this->session->PRJ); if(!is_numeric($productID)) $productID = key($products); $this->view->roadmaps = $this->product->getRoadmap($productID, 0, 6); @@ -1435,7 +1435,7 @@ class block extends control ->leftJoin(TABLE_PROJECT)->alias('t4')->on('t1.project=t4.id') ->leftJoin(TABLE_PROJECTPRODUCT)->alias('t5')->on('t1.project=t5.project') ->where('t1.deleted')->eq('0') - ->andWhere('t1.program')->eq($this->session->program)->fi() + ->andWhere('t1.program')->eq($this->session->PRJ)->fi() ->andWhere('t1.product = t5.product') ->beginIF($status != 'all')->andWhere('t1.status')->eq($status)->fi() ->orderBy('t1.id desc') @@ -1536,7 +1536,7 @@ class block extends control $normal = 0; $closed = 0; - $products = $this->loadModel('product')->getList($this->session->program); + $products = $this->loadModel('product')->getList($this->session->PRJ); foreach($products as $product) { if(!$this->product->checkPriv($product->id)) continue; @@ -1561,7 +1561,7 @@ class block extends control */ public function printProjectOverviewBlock() { - $programID = $this->view->block->module == 'my' ? 0 : (int)$this->session->program; + $programID = $this->view->block->module == 'my' ? 0 : (int)$this->session->PRJ; $projects = $this->loadModel('project')->getList('all', 0, 0, 0, $programID); $total = 0; @@ -1594,7 +1594,7 @@ class block extends control { $casePairs = $this->dao->select('lastRunResult, COUNT(*) AS count')->from(TABLE_CASE) ->where('1=1') - ->beginIF($this->view->block->module != 'my' and $this->session->program)->andWhere('program')->eq((int)$this->session->program)->fi() + ->beginIF($this->view->block->module != 'my' and $this->session->PRJ)->andWhere('program')->eq((int)$this->session->PRJ)->fi() ->groupBy('lastRunResult') ->fetchPairs(); @@ -1631,7 +1631,7 @@ class block extends control $type = isset($this->params->type) ? $this->params->type : 'all'; $pager = pager::init(0, $count, 1); - $programID = $this->view->block->module == 'my' ? 0 : (int)$this->session->program; + $programID = $this->view->block->module == 'my' ? 0 : (int)$this->session->PRJ; $this->view->projectStats = $this->loadModel('project')->getProjectStats($type, $productID = 0, $branch = 0, $itemCounts = 30, $orderBy = 'order_desc', $this->viewType != 'json' ? $pager : '', $programID); } diff --git a/module/block/model.php b/module/block/model.php index 1a16408e9b..40b7413222 100644 --- a/module/block/model.php +++ b/module/block/model.php @@ -224,7 +224,7 @@ class blockModel extends model if($module == 'program') { $blocks = $this->lang->block->default[$type]['program']; - $programID = $this->session->program; + $programID = $this->session->PRJ; $program = $this->loadModel('project')->getByID($programID); /* Mark program block has init. */ diff --git a/module/block/view/programstatisticblock.html.php b/module/block/view/programstatisticblock.html.php index 65671e08d7..fec3835c2e 100644 --- a/module/block/view/programstatisticblock.html.php +++ b/module/block/view/programstatisticblock.html.php @@ -104,7 +104,7 @@ $(function()