This commit is contained in:
holan20180123
2020-09-16 14:40:44 +08:00
101 changed files with 893 additions and 526 deletions
+23 -23
View File
@@ -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`;
+24 -24
View File
@@ -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,
+2 -2
View File
@@ -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);
}
/**
+14 -14
View File
@@ -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;
}
+3 -3
View File
@@ -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.
}
/**
+1 -1
View File
@@ -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)
{
+37 -37
View File
@@ -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);
}
+1 -1
View File
@@ -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. */
@@ -104,7 +104,7 @@ $(function()
<div class="col col-nav">
<ul class="nav nav-stacked nav-secondary scrollbar-hover" id='<?php echo $blockNavId;?>'>
<li class='switch-icon prev'><a><i class='icon icon-arrow-left'></i></a></li>
<?php $selected = empty($_SESSION['program']) ? key($programs) : $this->session->program;?>
<?php $selected = empty($_SESSION['program']) ? key($programs) : $this->session->PRJ;?>
<?php foreach($programs as $program):?>
<li <?php if($program->id == $selected) echo "class='active' id='activeProject'";?> programID='<?php echo $program->id;?>'>
<a href="###" data-target="#tab3Content<?php echo $program->id;?>" data-toggle="tab"><?php echo $program->name;?></a>
+1 -1
View File
@@ -26,7 +26,7 @@ class branch extends control
die(js::reload('parent'));
}
$products = $this->loadModel('product')->getPairs('nocode' , $this->session->program);
$products = $this->loadModel('product')->getPairs('nocode' , $this->session->PRJ);
$this->product->setMenu($products, $productID);
$position[] = html::a($this->createLink('product', 'browse', "productID=$productID"), zget($products, $productID));
+12 -12
View File
@@ -22,7 +22,7 @@ class budget extends control
public function __construct($module = '', $method = '')
{
parent::__construct($module, $method);
$this->view->program = $this->loadModel('project')->getByID($this->session->program);
$this->view->program = $this->loadModel('project')->getByID($this->session->PRJ);
}
/**
@@ -42,11 +42,11 @@ class budget extends control
$this->view->title = $this->lang->budget->common . $this->lang->budget->list;
$this->view->position[] = $this->lang->budget->common . $this->lang->budget->list;
$this->view->budgets = $this->budget->getList($this->session->program, $orderBy, $pager);
$this->view->budgets = $this->budget->getList($this->session->PRJ, $orderBy, $pager);
$this->view->orderBy = $orderBy;
$this->view->pager = $pager;
$this->view->modules = $this->loadModel('tree')->getOptionMenu(0, $viewType = 'subject', $startModuleID = 0);
$this->view->stages = $this->loadModel('programplan')->getPlanPairsForBudget($this->session->program);
$this->view->stages = $this->loadModel('programplan')->getPlanPairsForBudget($this->session->PRJ);
$this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter');
$this->display();
}
@@ -77,10 +77,10 @@ class budget extends control
$this->view->position[] = $this->lang->budget->common . $this->lang->budget->summary;
$this->view->subjectStructure = $getSubjectStructure;
$this->view->isChildren = $isChildren;
$this->view->subjects = $this->budget->getSubjects($this->session->program);
$this->view->stages = $this->budget->getStages($this->session->program);
$this->view->stagePairs = $this->loadModel('programplan')->getPlanPairsForBudget($this->session->program);
$this->view->summary = $this->budget->getSummary($this->session->program);
$this->view->subjects = $this->budget->getSubjects($this->session->PRJ);
$this->view->stages = $this->budget->getStages($this->session->PRJ);
$this->view->stagePairs = $this->loadModel('programplan')->getPlanPairsForBudget($this->session->PRJ);
$this->view->summary = $this->budget->getSummary($this->session->PRJ);
$this->view->modules = $this->loadModel('tree')->getOptionMenu(0, $viewType = 'subject', $startModuleID = 0);
$this->display();
}
@@ -115,7 +115,7 @@ class budget extends control
$this->view->title = $this->lang->budget->create . $this->lang->budget->common;
$this->view->position[] = $this->lang->budget->create . $this->lang->budget->common;
$this->view->subjects = array(0 => '') + $this->budget->getSubjectOption();
$this->view->stages = $this->loadModel('programplan')->getPlanPairsForBudget($this->session->program);
$this->view->stages = $this->loadModel('programplan')->getPlanPairsForBudget($this->session->PRJ);
$this->display();
}
@@ -153,7 +153,7 @@ class budget extends control
$this->view->title = $this->lang->budget->edit . $this->lang->budget->common;
$this->view->position[] = $this->lang->budget->edit . $this->lang->budget->common;
$this->view->subjects = array('' => '') + $this->budget->getSubjectOption();
$this->view->stages = $this->loadModel('programplan')->getPlanPairsForBudget($this->session->program);
$this->view->stages = $this->loadModel('programplan')->getPlanPairsForBudget($this->session->PRJ);
$this->view->budget = $this->budget->getByID($budgetID);
$this->display();
}
@@ -167,9 +167,9 @@ class budget extends control
*/
public function view($budgetID)
{
$this->view->stages = $this->budget->getStages($this->session->program);
$this->view->stages = $this->budget->getStages($this->session->PRJ);
$this->view->subjects = $this->budget->getSubjectOption();
$this->view->stages = $this->loadModel('programplan')->getPlanPairsForBudget($this->session->program);
$this->view->stages = $this->loadModel('programplan')->getPlanPairsForBudget($this->session->PRJ);
$this->view->budget = $this->budget->getByID($budgetID);
$this->view->actions = $this->loadModel('action')->getList('budget', $budgetID);
$this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter');
@@ -227,7 +227,7 @@ class budget extends control
$this->view->title = $this->lang->budget->batchCreate . $this->lang->budget->common;
$this->view->position[] = $this->lang->budget->batchCreate . $this->lang->budget->common;
$this->view->subjects = array('' => '') + $this->budget->getSubjectOption();
$this->view->stages = $this->loadModel('programplan')->getPlanPairsForBudget($this->session->program);
$this->view->stages = $this->loadModel('programplan')->getPlanPairsForBudget($this->session->PRJ);
$this->display();
}
}
+3 -3
View File
@@ -107,7 +107,7 @@ class budgetModel extends model
*/
public function getSubjectStructure()
{
$subjects = $this->getSubjects($this->session->program);
$subjects = $this->getSubjects($this->session->PRJ);
$structure = array();
foreach($subjects as $subjectID)
@@ -174,7 +174,7 @@ class budgetModel extends model
$budget = fixer::input('post')
->setDefault('createdBy', $this->app->user->account)
->setDefault('createdDate', helper::today())
->setDefault('program', $this->session->program)
->setDefault('program', $this->session->PRJ)
->cleanFloat('amount')
->remove('uid')
->get();
@@ -204,7 +204,7 @@ class budgetModel extends model
if(!$name) continue;
$data = new stdclass();
$data->name = $name;
$data->program = $this->session->program;
$data->program = $this->session->PRJ;
$data->stage = $budgets->stage[$i];
$data->subject = $budgets->subject[$i];
$data->amount = (float)$budgets->amount[$i];
+5 -5
View File
@@ -31,7 +31,7 @@ class bug extends control
$this->loadModel('action');
$this->loadModel('story');
$this->loadModel('task');
$this->view->products = $this->products = $this->product->getPairs('nocode', $this->session->program);
$this->view->products = $this->products = $this->product->getPairs('nocode', $this->session->PRJ);
if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "fromModule=bug")));
}
@@ -124,7 +124,7 @@ class bug extends control
$pager = pager::init($recTotal, $recPerPage, $pageID);
/* Get projects. */
$projects = $this->loadModel('project')->getPairs('empty|withdelete', $this->session->program);
$projects = $this->loadModel('project')->getPairs('empty|withdelete', $this->session->PRJ);
/* Get bugs. */
$bugs = $this->bug->getBugs($productID, $projects, $branch, $browseType, $moduleID, $queryID, $sort, $pager);
@@ -590,7 +590,7 @@ class bug extends control
{
session_write_close();
$this->lang->set('menugroup.bug', 'repo');
$repos = $this->loadModel('repo')->getRepoPairs($this->session->program);
$repos = $this->loadModel('repo')->getRepoPairs($this->session->PRJ);
$this->repo->setMenu($repos);
$this->lang->bug->menu = $this->lang->repo->menu;
}
@@ -1516,8 +1516,8 @@ class bug extends control
/* Get users, products and projects. */
$users = $this->loadModel('user')->getPairs('noletter');
$products = $this->loadModel('product')->getPairs('nocode', $this->session->program);
$projects = $this->loadModel('project')->getPairs('all|nocode', $this->session->program);
$products = $this->loadModel('product')->getPairs('nocode', $this->session->PRJ);
$projects = $this->loadModel('project')->getPairs('all|nocode', $this->session->PRJ);
/* Get related objects id lists. */
$relatedProductIdList = array();
+10 -5
View File
@@ -96,10 +96,12 @@ function loadBranch()
/**
*Load all builds of one project or product.
*
* @param that $that
* @param bool $resolvedBuildBox
* @access public
* @return void
*/
function loadAllBuilds(that)
function loadAllBuilds(that, resolvedBuildBox)
{
if(page == 'resolve')
{
@@ -113,13 +115,15 @@ function loadAllBuilds(that)
projectID = $('#project').val();
if(page == 'edit') buildBox = $(that).closest('.input-group').attr('id');
if(resolvedBuildBox) loadAllProductBuilds(productID, 'resolvedBuildBox');
if(projectID)
{
loadAllProjectBuilds(projectID, productID);
}
else
{
loadAllProductBuilds(productID);
loadAllProductBuilds(productID, 'openedBuildBox');
}
}
}
@@ -169,10 +173,11 @@ function loadAllProjectBuilds(projectID, productID)
* Load all builds of the product.
*
* @param int $productID
* @param string $buildBox
* @access public
* @return void
*/
function loadAllProductBuilds(productID)
function loadAllProductBuilds(productID, buildBox)
{
branch = $('#branch').val();
if(typeof(branch) == 'undefined') branch = 0;
@@ -198,7 +203,7 @@ function loadAllProductBuilds(productID)
}
if(buildBox == 'resolvedBuildBox')
{
link = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild + '&branch=0&index=0&type=all');
link = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild + '&branch' + branch);
$('#resolvedBuildBox').load(link, function(){$(this).find('select').chosen()});
}
}
@@ -400,7 +405,7 @@ function loadProjectBuilds(projectID)
$('#openedBuildBox').load(link, function(){$(this).find('select').val(oldOpenedBuild).chosen()});
oldResolvedBuild = $('#resolvedBuild').val() ? $('#resolvedBuild').val() : 0;
link = createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild + '&branch=' + branch);
link = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild + '&branch=' + branch);
$('#resolvedBuildBox').load(link, function(){$(this).find('select').val(oldResolvedBuild).chosen()});
}
}
+3 -3
View File
@@ -108,7 +108,7 @@ class bugModel extends model
{
$now = helper::now();
$bug = fixer::input('post')
->setDefault('program', $this->session->program)
->setDefault('program', $this->session->PRJ)
->setDefault('openedBy', $this->app->user->account)
->setDefault('openedDate', $now)
->setDefault('project,story,task', 0)
@@ -269,7 +269,7 @@ class bugModel extends model
}
}
$bug->program = $this->session->program;
$bug->program = $this->session->PRJ;
$this->dao->insert(TABLE_BUG)->data($bug)
->autoCheck()
->batchCheck($this->config->bug->create->requiredFields, 'notempty')
@@ -1698,7 +1698,7 @@ class bugModel extends model
{
$datas = $this->dao->select('project as name, count(project) as value')->from(TABLE_BUG)->where($this->reportCondition())->groupBy('project')->orderBy('value DESC')->fetchAll('name');
if(!$datas) return array();
$projects = $this->loadModel('project')->getPairs('', $this->session->program);
$projects = $this->loadModel('project')->getPairs('', $this->session->PRJ);
$maxLength = 12;
if(common::checkNotCN()) $maxLength = 22;
+1 -1
View File
@@ -220,7 +220,7 @@ js::set('oldResolvedBuild' , $bug->resolvedBuild);
<td>
<div id='resolvedBuildBox' class='input-group'>
<?php echo html::select('resolvedBuild', $resolvedBuilds, $bug->resolvedBuild, "class='form-control chosen'");?>
<span class='input-group-btn'><?php echo html::commonButton($lang->bug->allBuilds, "class='btn' onclick='loadAllBuilds(this)'")?></span>
<span class='input-group-btn'><?php echo html::commonButton($lang->bug->allBuilds, "class='btn' onclick='loadAllBuilds(this, true)'")?></span>
</div>
</td>
</tr>
+6 -6
View File
@@ -40,7 +40,7 @@ class build extends control
$this->loadModel('user');
/* Set menu. */
$this->project->setMenu($this->project->getPairs('', $this->session->program), $projectID);
$this->project->setMenu($this->project->getPairs('', $this->session->PRJ), $projectID);
/* Get stories and bugs. */
$orderBy = 'status_asc, stage_asc, id_desc';
@@ -101,7 +101,7 @@ class build extends control
$this->loadModel('project');
/* Set menu. */
$this->project->setMenu($this->project->getPairs('', $this->session->program), $build->project);
$this->project->setMenu($this->project->getPairs('', $this->session->PRJ), $build->project);
/* Get stories and bugs. */
$orderBy = 'status_asc, stage_asc, id_desc';
@@ -192,8 +192,8 @@ class build extends control
$stages = $this->dao->select('*')->from(TABLE_STORYSTAGE)->where('story')->in($build->stories)->andWhere('branch')->eq($build->branch)->fetchPairs('story', 'stage');
foreach($stages as $storyID => $stage)$stories[$storyID]->stage = $stage;
$this->loadModel('project')->setMenu($this->project->getPairs('', $this->session->program), $build->project, $buildID);
$projects = $this->project->getPairs('empty', $this->session->program);
$this->loadModel('project')->setMenu($this->project->getPairs('', $this->session->PRJ), $build->project, $buildID);
$projects = $this->project->getPairs('empty', $this->session->PRJ);
$this->view->title = "BUILD #$build->id $build->name - " . $projects[$build->project];
$this->view->position[] = html::a($this->createLink('project', 'task', "projectID=$build->project"), $projects[$build->project]);
@@ -389,7 +389,7 @@ class build extends control
$this->session->set('storyList', inlink('view', "buildID=$buildID&type=story&link=true&param=" . helper::safe64Encode("&browseType=$browseType&queryID=$param")));
$build = $this->build->getById($buildID);
$product = $this->loadModel('product')->getById($build->product);
$this->loadModel('project')->setMenu($this->project->getPairs('', $this->session->program), $build->project);
$this->loadModel('project')->setMenu($this->project->getPairs('', $this->session->PRJ), $build->project);
$this->loadModel('story');
$this->loadModel('tree');
$this->loadModel('product');
@@ -508,7 +508,7 @@ class build extends control
/* Set menu. */
$build = $this->build->getByID($buildID);
$product = $this->loadModel('product')->getByID($build->product);
$this->loadModel('project')->setMenu($this->project->getPairs('', $this->session->program), $build->project);
$this->loadModel('project')->setMenu($this->project->getPairs('', $this->session->PRJ), $build->project);
/* Load pager. */
$this->app->loadClass('pager', $static = true);
+1 -1
View File
@@ -199,7 +199,7 @@ class buildModel extends model
$build->bugs = '';
$build = fixer::input('post')
->setDefault('program', $this->session->program)
->setDefault('program', $this->session->PRJ)
->setDefault('product', 0)
->setDefault('branch', 0)
->cleanInt('product,branch')
+1 -1
View File
@@ -217,7 +217,7 @@ class caselibModel extends model
$lib = fixer::input('post')
->stripTags($this->config->caselib->editor->create['id'], $this->config->allowedTags)
->setForce('type', 'library')
->add('program', $this->session->program)
->add('program', $this->session->PRJ)
->add('addedBy', $this->app->user->account)
->add('addedDate', helper::now())
->remove('uid')
+22 -9
View File
@@ -60,6 +60,7 @@ $lang->required = '必填';
$lang->noData = '暂无';
$lang->fullscreen = '全屏';
$lang->retrack = '收起';
$lang->recent = '近期';
$lang->actions = '操作';
$lang->restore = '恢复默认';
@@ -121,8 +122,9 @@ $lang->common->common = '公有模块';
/* 主导航菜单。*/
$lang->mainNav = new stdclass();
$lang->mainNav->my = '<i class="icon icon-menu-my"></i> 地盘|my|index|';
$lang->mainNav->programset = '<i class="icon icon-menu-project"></i> 项目集|programset|index|';
$lang->mainNav->program = '<i class="icon icon-menu-project"></i> 项目|program|browse|';
$lang->mainNav->program = '<i class="icon icon-menu-project"></i> 项目集|program|pgmindex|';
$lang->mainNav->product = '<i class="icon icon-menu-project"></i> 产品|product|productlist|';
$lang->mainNav->project = '<i class="icon icon-menu-doc"></i> 项目|program|prjbrowse|';
$lang->mainNav->system = '<i class="icon icon-menu-users"></i> 组织|custom|estimate|';
$lang->mainNav->admin = '<i class="icon icon-menu-backend"></i> 后台|admin|index|';
@@ -130,10 +132,20 @@ $lang->reporting = new stdclass();
$lang->dividerMenu = ',admin,';
/* Program set menu. */
$lang->programset = new stdclass();
$lang->programset->menu = new stdclass();
$lang->programset->menu->index = '主页|programset|index|';
$lang->programset->menu->browse = '项目集|programset|browse|';
$lang->program = new stdclass();
$lang->program->menu = new stdclass();
$lang->program->menu->index = '主页|program|pgmindex|';
$lang->program->menu->browse = '项目集|program|pgmbrowse|';
/* Product menu. */
$lang->productlist = new stdclass();
$lang->productlist->menu = new stdclass();
$lang->productlist->menu->productlist = '产品|product|productlist|';
/* Project menu. */
$lang->projectlist = new stdclass();
$lang->projectlist->menu = new stdclass();
$lang->projectlist->menu->projectlist = '项目|project|projectlist|';
/* Scrum menu. */
$lang->menu = new stdclass();
@@ -551,13 +563,14 @@ $lang->navGroup->my = 'my';
$lang->navGroup->todo = 'my';
$lang->navGroup->effort = 'my';
$lang->navGroup->product = 'program';
$lang->navGroup->product = 'product';
$lang->navGroup->project = 'project';
$lang->navGroup->story = 'program';
$lang->navGroup->branch = 'program';
$lang->navGroup->productplan = 'program';
$lang->navGroup->release = 'program';
$lang->navGroup->tree = 'program';
$lang->navGroup->project = 'program';
$lang->navGroup->task = 'program';
$lang->navGroup->qa = 'program';
$lang->navGroup->bug = 'program';
@@ -896,6 +909,6 @@ if($config->URAndSR)
}
$lang->nc->menu = $lang->auditplan->menu;
$lang->noMenuModule = array('my', 'todo', 'effort', 'program', 'programset', 'attend', 'leave', 'makeup', 'overtime', 'lieu', 'holiday', 'custom', 'auditcl', 'subject', 'admin', 'mail', 'extension', 'dev', 'backup', 'action', 'cron', 'issue', 'risk', 'pssp', 'sms', 'message', 'webhook', 'search');
$lang->noMenuModule = array('my', 'todo', 'effort', 'program', 'attend', 'leave', 'makeup', 'overtime', 'lieu', 'holiday', 'custom', 'auditcl', 'subject', 'admin', 'mail', 'extension', 'dev', 'backup', 'action', 'cron', 'issue', 'risk', 'pssp', 'sms', 'message', 'webhook', 'search');
include (dirname(__FILE__) . '/menuOrder.php');
+27 -11
View File
@@ -525,11 +525,21 @@ class commonModel extends model
{
$active = '';
list($title, $currentModule, $currentMethod, $vars) = explode('|', $nav);
if($moduleName == $group) $active = 'active';
if($moduleName != 'program' && $moduleName == $group) $active = 'active';
if(zget($lang->navGroup, $moduleName, '') == $group) $active = 'active';
if(common::hasPriv($currentModule, $currentMethod)) echo "<li class=$active>" . html::a(helper::createLink($currentModule, $currentMethod, $vars), $title) . '</li>';
if(($lastMenu != $nav) && strpos($lang->dividerMenu, ",{$group},") !== false) echo "<li class='divider'></li>";
}
echo '<li><hr></li>';
echo '<li><span><i class="icon icon-menu-doc"></i>' . $lang->recent . '</span></li>';
echo '<li>' . html::a(helper::createLink('project', 'view', 'project=1'), 'zentao001') . '</li>';
echo '<li>' . html::a(helper::createLink('project', 'view', 'project=1'), 'zentao001') . '</li>';
echo '<li>' . html::a(helper::createLink('project', 'view', 'project=1'), 'zentao001') . '</li>';
echo '<li>' . html::a(helper::createLink('project', 'view', 'project=1'), 'an') . '</li>';
echo '<li>' . html::a(helper::createLink('project', 'view', 'project=1'), 'zentao') . '</li>';
echo '<li onclick="getMorePRJ();" class="text-center"><span>' . $lang->more . '</span></li>';
echo "</ul>\n";
}
@@ -548,7 +558,7 @@ class commonModel extends model
global $app, $lang, $config;
/* If program, return.*/
if($moduleName == 'program' and $methodName != 'index') return;
if($moduleName == 'program' and strpos($methodName, 'prj') !== false) return;
/* Set the main main menu. */
$mainMenu = $moduleName;
@@ -1618,7 +1628,7 @@ EOD;
if(!defined('IN_UPGRADE') and $inProgram)
{
/* Check program priv. */
if(strpos(",{$this->app->user->view->programs},", ",{$this->session->program},") === false and !$this->app->user->admin) $this->loadModel('program')->accessDenied();
if(strpos(",{$this->app->user->view->programs},", ",{$this->session->PRJ},") === false and !$this->app->user->admin) $this->loadModel('program')->accessDenied();
$this->resetProgramPriv($module, $method);
if(!commonModel::hasPriv($module, $method)) $this->deny($module, $method, false);
}
@@ -2130,38 +2140,44 @@ EOD;
public static function setMainMenuByGroup($group, $moduleName, $methodName)
{
global $lang;
if($group == 'my')
if($group == 'my')
{
$lang->menu = $lang->my->menu;
$lang->menuOrder = $lang->my->menuOrder;
}
if($group == 'system')
if($group == 'system')
{
$lang->menu = $lang->system->menu;
$lang->menuOrder = $lang->system->menuOrder;
$lang->report->menu = $lang->measurement->menu;
}
if($group == 'doclib') return;
if($group == 'reporting')
if($group == 'reporting')
{
$lang->menu = $lang->report->menu;
$lang->menuOrder = $lang->report->menuOrder;
}
if($group == 'attend')
if($group == 'attend')
{
$lang->menu = $lang->attend->menu;
$lang->menuOrder = $lang->attend->menuOrder;
}
if($group == 'admin')
if($group == 'admin')
{
$lang->menu = $lang->admin->menu;
$lang->menuOrder = $lang->admin->menuOrder;
}
if($group == 'programset')
if($group == 'program')
{
$lang->menu = $lang->programset->menu;
if($moduleName == 'program')
{
$lang->menu = $lang->program->menu;
}
else
{
$lang->menu = self::getProgramMainMenu($moduleName);
}
}
if($group == 'program') $lang->menu = self::getProgramMainMenu($moduleName);
}
/**
+30 -1
View File
@@ -14,12 +14,36 @@ include 'chosen.html.php';
<div id='menuFooter'>
<button type='button' id='menuToggle'><i class='icon icon-sm icon-menu-collapse'></i></button>
</div>
<div class="table-col col-right" id="morePRJ">
<div class="list-group">
<a href="/product-browse-40.html" title="部门管理/916测试" class="closed" data-key="bumenguanli/916ceshi bmgl9cs"><i class="icon icon-cube"></i> 部门管理/916测试</a>
<a href="/product-browse-40.html" title="部门管理/916测试" class="closed" data-key="bumenguanli/916ceshi bmgl9cs"><i class="icon icon-cube"></i> 部门管理/916测试</a>
<a href="/product-browse-40.html" title="部门管理/916测试" class="closed" data-key="bumenguanli/916ceshi bmgl9cs"><i class="icon icon-cube"></i> 部门管理/916测试</a>
<a href="/product-browse-40.html" title="部门管理/916测试" class="closed" data-key="bumenguanli/916ceshi bmgl9cs"><i class="icon icon-cube"></i> 部门管理/916测试</a>
<a href="/product-browse-40.html" title="部门管理/916测试" class="closed" data-key="bumenguanli/916ceshi bmgl9cs"><i class="icon icon-cube"></i> 部门管理/916测试</a>
<a href="/product-browse-40.html" title="部门管理/916测试" class="closed" data-key="bumenguanli/916ceshi bmgl9cs"><i class="icon icon-cube"></i> 部门管理/916测试</a>
<a href="/product-browse-40.html" title="部门管理/916测试" class="closed" data-key="bumenguanli/916ceshi bmgl9cs"><i class="icon icon-cube"></i> 部门管理/916测试</a>
<a href="/product-browse-40.html" title="部门管理/916测试" class="closed" data-key="bumenguanli/916ceshi bmgl9cs"><i class="icon icon-cube"></i> 部门管理/916测试</a>
<a href="/product-browse-40.html" title="部门管理/916测试" class="closed" data-key="bumenguanli/916ceshi bmgl9cs"><i class="icon icon-cube"></i> 部门管理/916测试</a>
<a href="/product-browse-40.html" title="部门管理/916测试" class="closed" data-key="bumenguanli/916ceshi bmgl9cs"><i class="icon icon-cube"></i> 部门管理/916测试</a>
<a href="/product-browse-40.html" title="部门管理/916测试" class="closed" data-key="bumenguanli/916ceshi bmgl9cs"><i class="icon icon-cube"></i> 部门管理/916测试</a>
<a href="/product-browse-40.html" title="部门管理/916测试" class="closed" data-key="bumenguanli/916ceshi bmgl9cs"><i class="icon icon-cube"></i> 部门管理/916测试</a>
<a href="/product-browse-40.html" title="部门管理/916测试" class="closed" data-key="bumenguanli/916ceshi bmgl9cs"><i class="icon icon-cube"></i> 部门管理/916测试</a>
<a href="/product-browse-40.html" title="部门管理/916测试" class="closed" data-key="bumenguanli/916ceshi bmgl9cs"><i class="icon icon-cube"></i> 部门管理/916测试</a>
<a href="/product-browse-40.html" title="部门管理/916测试" class="closed" data-key="bumenguanli/916ceshi bmgl9cs"><i class="icon icon-cube"></i> 部门管理/916测试</a>
<a href="/product-browse-40.html" title="部门管理/916测试" class="closed" data-key="bumenguanli/916ceshi bmgl9cs"><i class="icon icon-cube"></i> 部门管理/916测试</a>
<a href="/product-browse-40.html" title="部门管理/916测试" class="closed" data-key="bumenguanli/916ceshi bmgl9cs"><i class="icon icon-cube"></i> 部门管理/916测试</a>
<a href="/product-browse-40.html" title="部门管理/916测试" class="closed" data-key="bumenguanli/916ceshi bmgl9cs"><i class="icon icon-cube"></i> 部门管理/916测试</a>
<a href="/product-browse-40.html" title="部门管理/916测试" class="closed" data-key="bumenguanli/916ceshi bmgl9cs"><i class="icon icon-cube"></i> 部门管理/916测试</a>
<a href="/product-browse-40.html" title="部门管理/916测试" class="closed" data-key="bumenguanli/916ceshi bmgl9cs"><i class="icon icon-cube"></i> 部门管理/916测试</a>
</div>
</div>
</div>
<header id='header'>
<div id='mainHeader'>
<div class='container'>
<div id='heading'>
<?php if($isProgram) echo $this->loadModel('program')->getSwitcher($this->program->getPairs(), $this->session->program, $app->rawModule, $app->rawMethod);?>
<?php if($isProgram) echo $this->loadModel('program')->getSwitcher($this->program->getPairs(), $this->session->PRJ, $app->rawModule, $app->rawMethod);?>
<?php if($isSystem) echo $this->loadModel('custom')->getModeSwitcher();?>
</div>
<nav id='navbar'><?php commonModel::printMainmenu($app->rawModule, $app->rawMethod);?></nav>
@@ -70,6 +94,11 @@ $("#searchInput").mouseout(function()
$("#showSearchGo").show();
}
});
function getMorePRJ()
{
console.log(123);
$("#morePRJ").toggle();
}
</script>
<main id='main' <?php if(!empty($config->sso->redirect)) echo "class='ranzhiFixedTfootAction'";?> >
<div class='container'>
+2 -2
View File
@@ -240,9 +240,9 @@ class deptModel extends model
* @access public
* @return string
*/
public function createManagePgmAdminLink($dept, $groupID)
public function createManagePRJadminLink($dept, $groupID)
{
return html::a(helper::createLink('group', 'managePgmAdmin', "groupID=$groupID&deptID={$dept->id}"), $dept->name, '_self', "id='dept{$dept->id}'");
return html::a(helper::createLink('group', 'managePRJadmin', "groupID=$groupID&deptID={$dept->id}"), $dept->name, '_self', "id='dept{$dept->id}'");
}
/**
+6 -6
View File
@@ -26,7 +26,7 @@ class design extends control
parent::__construct($moduleName, $methodName);
$products = array();
$this->loadModel('product');
$this->view->products = $this->products = $this->product->getPairs('nocode', $this->session->program);
$this->view->products = $this->products = $this->product->getPairs('nocode', $this->session->PRJ);
}
/**
@@ -57,7 +57,7 @@ class design extends control
/* Init pager and get designs. */
$this->app->loadClass('pager', $static = true);
$pager = pager::init(0, $recPerPage, $pageID);
$designs = $this->design->getList($this->session->program, $productID, $type, $queryID, $orderBy, $pager);
$designs = $this->design->getList($this->session->PRJ, $productID, $type, $queryID, $orderBy, $pager);
$this->view->title = $this->lang->design->common . $this->lang->colon . $this->lang->design->browse;
$this->view->position[] = $this->lang->design->browse;
@@ -109,7 +109,7 @@ class design extends control
$this->view->users = $this->loadModel('user')->getPairs('noclosed');
$this->view->stories = $this->loadModel('story')->getProductStoryPairs($productID);
$this->view->productID = $productID;
$this->view->program = $this->loadModel('project')->getByID($this->session->program);
$this->view->program = $this->loadModel('project')->getByID($this->session->PRJ);
$this->display();
}
@@ -213,7 +213,7 @@ class design extends control
$this->view->position[] = $this->lang->design->edit;
$this->view->design = $design;
$this->view->program = $this->loadModel('project')->getByID($this->session->program);
$this->view->program = $this->loadModel('project')->getByID($this->session->PRJ);
$this->view->stories = $this->loadModel('story')->getProductStoryPairs($design->product);
$this->display();
@@ -235,12 +235,12 @@ class design extends control
public function linkCommit($designID = 0, $repoID = 0, $begin = '', $end = '', $recTotal = 0, $recPerPage = 50, $pageID = 1)
{
/* Get program and date. */
$program = $this->loadModel('project')->getByID($this->session->program);
$program = $this->loadModel('project')->getByID($this->session->PRJ);
$begin = $begin ? date('Y-m-d', strtotime($begin)) : $program->begin;
$end = $end ? date('Y-m-d', strtotime($end)) : helper::today();
/* Get the repository information through the repoID. */
$repos = $this->loadModel('repo')->getRepoPairs($this->session->program);
$repos = $this->loadModel('repo')->getRepoPairs($this->session->PRJ);
$repoID = $repoID ? $repoID : key($repos);
if(empty($repoID)) die(js::locate(helper::createLink('repo', 'create')));
+4 -4
View File
@@ -25,7 +25,7 @@ class designModel extends model
->stripTags('desc', $this->config->allowedTags)
->add('createdBy', $this->app->user->account)
->add('createdDate', helper::now())
->add('program', $this->session->program)
->add('program', $this->session->PRJ)
->add('version', 1)
->remove('files,labels')
->get();
@@ -77,7 +77,7 @@ class designModel extends model
$design->type = $data->type[$i];
$design->name = $name;
$design->product = $productID;
$design->program = $this->session->program;
$design->program = $this->session->PRJ;
$design->createdBy = $this->app->user->account;
$design->createdDate = helper::now();
@@ -177,7 +177,7 @@ class designModel extends model
foreach($revisions as $revision)
{
$data = new stdclass();
$data->program = $this->session->program;
$data->program = $this->session->PRJ;
$data->product = $this->session->product;
$data->AType = 'design';
$data->AID = $designID;
@@ -393,7 +393,7 @@ class designModel extends model
*/
public function setProductMenu($productID = 0)
{
$programID = $this->session->program;
$programID = $this->session->PRJ;
$program = $this->loadModel('project')->getByID($programID);
$products = $this->loadModel('product')->getPairs('', $programID);
if(empty($products)) die(js::locate(helper::createLink('product', 'create')));
+10 -10
View File
@@ -111,7 +111,7 @@ class doc extends control
$this->lang->navGroup->doc = 'program';
$this->lang->doc->menu = $this->lang->product->menu;
$this->lang->doc->menuOrder = $this->lang->product->menuOrder;
$this->product->setMenu($this->product->getPairs('', $this->session->program), $lib->product);
$this->product->setMenu($this->product->getPairs('', $this->session->PRJ), $lib->product);
$this->lang->set('menugroup.doc', 'product');
}
elseif($from == 'project')
@@ -119,7 +119,7 @@ class doc extends control
$this->lang->navGroup->doc = 'program';
$this->lang->doc->menu = $this->lang->project->menu;
$this->lang->doc->menuOrder = $this->lang->project->menuOrder;
$this->project->setMenu($this->project->getPairs('nocode', $this->session->program), $lib->project);
$this->project->setMenu($this->project->getPairs('nocode', $this->session->PRJ), $lib->project);
$this->lang->set('menugroup.doc', 'project');
}
else
@@ -223,8 +223,8 @@ class doc extends control
}
}
$libTypeList = $this->lang->doc->libTypeList;
$products = $this->product->getPairs('nocode', $this->session->program);
$projects = $this->project->getPairs('nocode', $this->session->program);
$products = $this->product->getPairs('nocode', $this->session->PRJ);
$projects = $this->project->getPairs('nocode', $this->session->PRJ);
if(empty($products)) unset($libTypeList['product']);
if(empty($projects)) unset($libTypeList['project']);
@@ -341,7 +341,7 @@ class doc extends control
$this->lang->navGroup->doc = 'program';
$this->lang->doc->menu = $this->lang->product->menu;
$this->lang->doc->menuOrder = $this->lang->product->menuOrder;
$this->product->setMenu($this->product->getPairs('', $this->session->program), $lib->product);
$this->product->setMenu($this->product->getPairs('', $this->session->PRJ), $lib->product);
$this->lang->set('menugroup.doc', 'product');
$this->lang->modulePageActions = common::hasPriv('doc', 'createLib') ? html::a(helper::createLink('doc', 'createLib'), "<i class='icon icon-plus'></i> " . $this->lang->doc->createLib, '', "class='btn btn-secondary iframe' data-width='70%'") : '';
@@ -351,7 +351,7 @@ class doc extends control
$this->lang->navGroup->doc = 'program';
$this->lang->doc->menu = $this->lang->project->menu;
$this->lang->doc->menuOrder = $this->lang->project->menuOrder;
$this->project->setMenu($this->project->getPairs('nocode', $this->session->program), $lib->project);
$this->project->setMenu($this->project->getPairs('nocode', $this->session->PRJ), $lib->project);
$this->lang->set('menugroup.doc', 'project');
$this->lang->modulePageActions = common::hasPriv('doc', 'createLib') ? html::a(helper::createLink('doc', 'createLib'), "<i class='icon icon-plus'></i> " . $this->lang->doc->createLib, '', "class='btn btn-secondary iframe' data-width='70%'") : '';
@@ -762,7 +762,7 @@ class doc extends control
$this->lang->navGroup->doc = 'program';
$this->lang->doc->menu = $this->lang->product->menu;
$this->lang->doc->menuOrder = $this->lang->product->menuOrder;
$this->product->setMenu($this->product->getPairs('', $this->session->program), $objectID);
$this->product->setMenu($this->product->getPairs('', $this->session->PRJ), $objectID);
$this->lang->set('menugroup.doc', 'product');
}
elseif($this->from == 'project')
@@ -770,7 +770,7 @@ class doc extends control
$this->lang->navGroup->doc = 'program';
$this->lang->doc->menu = $this->lang->project->menu;
$this->lang->doc->menuOrder = $this->lang->project->menuOrder;
$this->project->setMenu($this->project->getPairs('nocode', $this->session->program), $objectID);
$this->project->setMenu($this->project->getPairs('nocode', $this->session->PRJ), $objectID);
$this->lang->set('menugroup.doc', 'project');
}
else
@@ -856,7 +856,7 @@ class doc extends control
$this->lang->navGroup->doc = 'program';
$this->lang->doc->menu = $this->lang->product->menu;
$this->lang->doc->menuOrder = $this->lang->product->menuOrder;
$this->product->setMenu($this->product->getPairs('', $this->session->program), $objectID);
$this->product->setMenu($this->product->getPairs('', $this->session->PRJ), $objectID);
$this->lang->set('menugroup.doc', 'product');
}
elseif($from == 'project')
@@ -864,7 +864,7 @@ class doc extends control
$this->lang->navGroup->doc = 'program';
$this->lang->doc->menu = $this->lang->project->menu;
$this->lang->doc->menuOrder = $this->lang->project->menuOrder;
$this->project->setMenu($this->project->getPairs('nocode', $this->session->program), $objectID);
$this->project->setMenu($this->project->getPairs('nocode', $this->session->PRJ), $objectID);
$this->lang->set('menugroup.doc', 'project');
}
else
+4 -4
View File
@@ -176,8 +176,8 @@ class docModel extends model
if(strpos($extra, 'withObject') !== false)
{
$products = $this->loadModel('product')->getPairs('', $this->session->program);
$projects = $this->loadModel('project')->getPairs('', $this->session->program);
$products = $this->loadModel('product')->getPairs('', $this->session->PRJ);
$projects = $this->loadModel('project')->getPairs('', $this->session->PRJ);
}
$libPairs = array();
@@ -757,8 +757,8 @@ class docModel extends model
{
$this->config->doc->search['actionURL'] = $actionURL;
$this->config->doc->search['queryID'] = $queryID;
$this->config->doc->search['params']['product']['values'] = array(''=>'') + $this->loadModel('product')->getPairs('nocode', $this->session->program) + array('all'=>$this->lang->doc->allProduct);
$this->config->doc->search['params']['project']['values'] = array(''=>'') + $this->loadModel('project')->getPairs('nocode', $this->session->program) + array('all'=>$this->lang->doc->allProject);
$this->config->doc->search['params']['product']['values'] = array(''=>'') + $this->loadModel('product')->getPairs('nocode', $this->session->PRJ) + array('all'=>$this->lang->doc->allProduct);
$this->config->doc->search['params']['project']['values'] = array(''=>'') + $this->loadModel('project')->getPairs('nocode', $this->session->PRJ) + array('all'=>$this->lang->doc->allProject);
$this->config->doc->search['params']['lib']['values'] = array(''=>'', $libID => ($libID ? $libs[$libID] : 0), 'all' => $this->lang->doclib->all);
/* Get the modules. */
+4 -4
View File
@@ -265,12 +265,12 @@ class group extends control
* @access public
* @return void
*/
public function managePgmAdmin($groupID, $deptID = 0)
public function managePRJadmin($groupID, $deptID = 0)
{
if(!empty($_POST))
{
$this->group->updatePgmAdmin($groupID);
die(js::locate(inlink('managePgmAdmin', "group=$groupID"), 'parent'));
$this->group->updatePRJadmin($groupID);
die(js::locate(inlink('managePRJadmin', "group=$groupID"), 'parent'));
}
$group = $this->group->getById($groupID);
$groupUsers = $this->group->getUserPairs($groupID);
@@ -286,7 +286,7 @@ class group extends control
$this->view->allUsers = $allUsers;
$this->view->group = $group;
$this->view->programs = $this->dao->select('id, name')->from(TABLE_PROJECT)->where('program')->eq(0)->andWhere('deleted')->eq(0)->andWhere('isCat')->eq(0)->fetchPairs();
$this->view->deptTree = $this->loadModel('dept')->getTreeMenu($rooteDeptID = 0, array('deptModel', 'createManagePgmAdminLink'), $groupID);
$this->view->deptTree = $this->loadModel('dept')->getTreeMenu($rooteDeptID = 0, array('deptModel', 'createManagePRJadminLink'), $groupID);
$this->view->groupUsers = $groupUsers;
$this->view->userPrograms = $userPrograms;
+1 -1
View File
@@ -21,7 +21,7 @@ $lang->group->managePrivByGroup = 'Rechte';
$lang->group->managePrivByModule = 'Modul Rechte';
$lang->group->byModuleTips = '<span class="tips">(SHIFT/STRG für Multi-Select)</span>';
$lang->group->manageMember = 'Mitglieder';
$lang->group->managePgmAdmin = 'Manage Program Admins';
$lang->group->managePRJadmin = 'Manage Program Admins';
$lang->group->confirmDelete = 'Möchten Sie die Gruppe löschen?';
$lang->group->successSaved = 'Gespeichert!';
$lang->group->errorNotSaved = 'Fehlgeschlagen. Bitte aktion und Gruppe wählen.';
+1 -1
View File
@@ -21,7 +21,7 @@ $lang->group->managePrivByGroup = 'Manage Privileges by Group';
$lang->group->managePrivByModule = 'Manage Privileges by Module';
$lang->group->byModuleTips = '<span class="tips">(Press Shift/Ctrl to Multi-select)</span>';
$lang->group->manageMember = 'Manage Members';
$lang->group->managePgmAdmin = 'Manage Program Admins';
$lang->group->managePRJadmin = 'Manage Program Admins';
$lang->group->confirmDelete = 'Do you want to delete this user group?';
$lang->group->successSaved = 'Saved.';
$lang->group->errorNotSaved = 'Failed. Please select actions and groups.';
+1 -1
View File
@@ -21,7 +21,7 @@ $lang->group->managePrivByGroup = 'Gérer Privilèges par Groupe';
$lang->group->managePrivByModule = 'Gérer Privilèges par Module';
$lang->group->byModuleTips = '<span class="tips">(Shift/Ctrl pour sélection multiple)</span>';
$lang->group->manageMember = 'Gérer Membres';
$lang->group->managePgmAdmin = 'Manage Program Admins';
$lang->group->managePRJadmin = 'Manage Program Admins';
$lang->group->confirmDelete = "Voulez-vous supprimer ce groupe d'utilisateurs ?";
$lang->group->successSaved = 'Sauvé.';
$lang->group->errorNotSaved = 'Echec. Veuillez sélectionner actions et groupes.';
+2 -2
View File
@@ -1126,7 +1126,7 @@ $lang->resource->group->delete = 'delete';
$lang->resource->group->manageView = 'manageView';
$lang->resource->group->managePriv = 'managePriv';
$lang->resource->group->manageMember = 'manageMember';
$lang->resource->group->managePgmAdmin = 'managePgmAdmin';
$lang->resource->group->managePRJadmin = 'managePRJadmin';
$lang->group->methodOrder[5] = 'browse';
$lang->group->methodOrder[10] = 'create';
@@ -1135,7 +1135,7 @@ $lang->group->methodOrder[20] = 'copy';
$lang->group->methodOrder[25] = 'delete';
$lang->group->methodOrder[30] = 'managePriv';
$lang->group->methodOrder[35] = 'manageMember';
$lang->group->methodOrder[40] = 'managePgmAdmin';
$lang->group->methodOrder[40] = 'managePRJadmin';
/* User. */
$lang->resource->user = new stdclass();
+1 -1
View File
@@ -21,7 +21,7 @@ $lang->group->managePrivByGroup = 'Quản lý Privileges by Group';
$lang->group->managePrivByModule = 'Quản lý Privileges by Module';
$lang->group->byModuleTips = '<span class="tips">(Press Shift/Ctrl to Multi-select)</span>';
$lang->group->manageMember = 'Quản lý Members';
$lang->group->managePgmAdmin = 'Manage Program Admins';
$lang->group->managePRJadmin = 'Manage Program Admins';
$lang->group->confirmDelete = 'Bạn có muốn xóa người dùng này group?';
$lang->group->successSaved = 'Đã lưu.';
$lang->group->errorNotSaved = 'Thất bại. Vui lòng select actions and groups.';
+1 -1
View File
@@ -21,7 +21,7 @@ $lang->group->managePrivByGroup = '权限维护';
$lang->group->managePrivByModule = '按模块分配权限';
$lang->group->byModuleTips = '<span class="tips">(可以按住Shift或者Ctrl键进行多选)</span>';
$lang->group->manageMember = '成员维护';
$lang->group->managePgmAdmin = '维护项目管理员';
$lang->group->managePRJadmin = '维护项目管理员';
$lang->group->confirmDelete = '您确定删除该用户分组吗?';
$lang->group->successSaved = '成功保存';
$lang->group->errorNotSaved = '没有保存,请确认选择了权限数据。';
+1 -1
View File
@@ -388,7 +388,7 @@ class groupModel extends model
* @access public
* @return void
*/
public function updatePgmAdmin($groupID)
public function updatePRJadmin($groupID)
{
$this->loadModel('user');
$this->dao->delete()->from(TABLE_USERGROUP)->where('`group`')->eq($groupID)->exec();
+5 -5
View File
@@ -42,14 +42,14 @@
<td title='<?php echo $group->desc?>'><?php echo $group->desc;?></td>
<td title='<?php echo $users;?>' class="text-ellipsis"><?php echo $users;?></td>
<td class='c-actions'>
<?php $isPgmAdmin = $group->role == 'pgmadmin';?>
<?php $disabled = $isPgmAdmin ? 'disabled' : '';?>
<?php $isPRJadmin = $group->role == 'PRJadmin';?>
<?php $disabled = $isPRJadmin ? 'disabled' : '';?>
<?php $lang->group->managepriv = $lang->group->managePrivByGroup;?>
<?php common::printIcon('group', 'manageView', "groupID=$group->id", $group, 'list', 'eye', '', "iframe $disabled", true);?>
<?php common::printIcon('group', 'managepriv', "type=byGroup&param=$group->id", $group, 'list', 'lock');?>
<?php $lang->group->managemember = $lang->group->manageMember;?>
<?php if($isPgmAdmin):?>
<?php common::printIcon('group', 'managePgmAdmin', "groupID=$group->id", $group, 'list', 'persons');?>
<?php if($isPRJadmin):?>
<?php common::printIcon('group', 'managePRJadmin', "groupID=$group->id", $group, 'list', 'persons');?>
<?php else:?>
<?php common::printIcon('group', 'managemember', "groupID=$group->id", $group, 'list', 'persons', '', "iframe", true, "data-width='90%'");?>
<?php endif;?>
@@ -58,7 +58,7 @@
<?php
if(common::hasPriv('group', 'delete'))
{
if($isPgmAdmin)
if($isPRJadmin)
{
echo "<button class='btn disabled'><i class='icon icon-trash disabled' title='{$lang->group->delete}'></i></button>";
}
+3 -3
View File
@@ -43,7 +43,7 @@ class issue extends control
$this->view->param = $param;
$this->view->orderBy = $orderBy;
$this->view->browseType = $browseType;
$this->view->issueList = $this->issue->getList($this->session->program, $browseType, $queryID, $orderBy, $pager);
$this->view->issueList = $this->issue->getList($this->session->PRJ, $browseType, $queryID, $orderBy, $pager);
$this->view->users = $this->loadModel('user')->getPairs('noletter|pofirst|nodeleted');
$this->display();
@@ -358,7 +358,7 @@ class issue extends control
$this->loadModel('task');
$this->loadModel('tree');
$this->loadModel('project')->getLimitedProject();
$projects = $this->project->getPairs('', $this->session->program);
$projects = $this->project->getPairs('', $this->session->PRJ);
$projectID = $this->session->project;
$projectID = isset($projects[$projectID]) ? $projectID : key($projects);
@@ -377,7 +377,7 @@ class issue extends control
if(in_array($data->mode, array('tostory', 'tobug')))
{
$products = $this->loadModel('product')->getPairs('', $this->session->program);
$products = $this->loadModel('product')->getPairs('', $this->session->PRJ);
$productID = $this->session->product;
$productID = isset($products[$productID]) ? $productID : key($products);
$branches = $this->loadModel('branch')->getPairs($productID, 'noempty');
+2 -2
View File
@@ -25,7 +25,7 @@ class issueModel extends model
$data = fixer::input('post')
->add('createdBy', $this->app->user->account)
->add('createdDate', $now)
->add('program', $this->session->program)
->add('program', $this->session->PRJ)
->remove('labels,files')
->addIF($this->post->assignedTo, 'assignedBy', $this->app->user->account)
->addIF($this->post->assignedTo, 'assignedDate', $now)
@@ -279,7 +279,7 @@ class issueModel extends model
$issue['createdBy'] = $this->app->user->account;
$issue['createdDate'] = $now;
$issue['program'] = $this->session->program;
$issue['program'] = $this->session->PRJ;
if($issue['assignedTo'])
{
+1 -1
View File
@@ -23,7 +23,7 @@
<a class="btn btn-link querybox-toggle" id='bysearchTab'><i class="icon icon-search muted"></i> <?php echo $lang->issue->search;?></a>
</div>
<div class="btn-toolbar pull-right">
<?php common::printLink('issue', 'batchCreate', '', "<i class='icon icon-plus'></i>" . $lang->issue->batchCreate, '', "class='btn btn-primary'");?>
<?php common::printLink('issue', 'batchCreate', '', "<i class='icon icon-plus'></i>" . $lang->issue->batchCreate, '', "class='btn btn-secondary'");?>
<?php common::printLink('issue', 'create', '', "<i class='icon icon-plus'></i>" . $lang->issue->create, '', "class='btn btn-primary'");?>
</div>
</div>
+1 -1
View File
@@ -63,7 +63,7 @@ echo js::set('resolveLink', $this->createLink('issue', 'ajaxGetResolveForm'));
</td>
</tr>
</table>
<?php echo html::hidden('program', $this->session->program);?>
<?php echo html::hidden('program', $this->session->PRJ);?>
</form>
</div>
</div>
+4 -4
View File
@@ -73,7 +73,7 @@ class job extends control
$this->view->position[] = html::a(inlink('browse'), $this->lang->ci->job);
$this->view->position[] = $this->lang->job->create;
$repoList = $this->loadModel('repo')->getList($this->session->program);
$repoList = $this->loadModel('repo')->getList($this->session->PRJ);
$repoPairs = array(0 => '');
$repoTypes = array();
foreach($repoList as $repo)
@@ -84,7 +84,7 @@ class job extends control
}
$this->view->repoPairs = $repoPairs;
$this->view->repoTypes = $repoTypes;
$this->view->products = array(0 => '') + $this->loadModel('product')->getPairs('', $this->session->program);
$this->view->products = array(0 => '') + $this->loadModel('product')->getPairs('', $this->session->PRJ);
$this->view->jkHostList = $this->loadModel('jenkins')->getPairs();
$this->display();
@@ -114,7 +114,7 @@ class job extends control
$repo = $this->loadModel('repo')->getRepoByID($job->repo);
$this->view->repo = $this->loadModel('repo')->getRepoByID($job->repo);
$repoList = $this->repo->getList($this->session->program);
$repoList = $this->repo->getList($this->session->PRJ);
$repoPairs = array(0 => '', $repo->id => $repo->name);
$repoTypes[$repo->id] = $repo->SCM;
foreach($repoList as $repo)
@@ -128,7 +128,7 @@ class job extends control
$this->view->repoTypes = $repoTypes;
$this->view->repoType = zget($repoTypes, $job->repo, 'Git');
$this->view->job = $job;
$this->view->products = array(0 => '') + $this->loadModel('product')->getPairs('', $this->session->program);
$this->view->products = array(0 => '') + $this->loadModel('product')->getPairs('', $this->session->PRJ);
$this->view->jkHostList = $this->loadModel('jenkins')->getPairs();
$this->view->jkJobs = $this->jenkins->getTasks($job->jkHost);
+1 -1
View File
@@ -35,7 +35,7 @@
<th class='w-150px'> <?php common::printOrderLink('sendTime', $orderBy, $vars, $lang->mail->sendTime);?></th>
<th class='w-80px'> <?php common::printOrderLink('status', $orderBy, $vars, $lang->mail->status);?></th>
<th> <?php echo $lang->mail->failReason;?></th>
<th class='c-actions-2'> <?php echo $lang->actions;?></th>
<th class='c-actions'> <?php echo $lang->actions;?></th>
</tr>
</thead>
<tbody>
+33 -3
View File
@@ -30,11 +30,41 @@ class product extends control
$this->loadModel('user');
/* Get all products, if no, goto the create page. */
$this->products = $this->product->getPairs('nocode', $this->session->program);
$this->products = $this->product->getPairs('nocode', $this->session->PRJ);
if(empty($this->products) and strpos(',create,index,showerrornone,', $this->methodName) === false and $this->app->getViewType() != 'mhtml') $this->locate($this->createLink('product', 'create'));
$this->view->products = $this->products;
}
/**
* Products under project set.
*
* @param int $programID
* @param string $browseType
* @param int $param
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @access public
* @return void
*/
public function productList($programID = 0, $browseType = 'all', $param = 0, $orderBy = 'order_desc', $recTotal = 0, $recPerPage = 15, $pageID = 1)
{
/* Load pager. */
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
$this->view->title = $this->lang->product->common;
$this->view->program = '';
$this->view->stack = '';
$this->view->browseType = $browseType;
$this->view->orderBy = $orderBy;
$this->view->programID = $programID;
$this->view->productStats = array();
$this->view->pager = $pager;
$this->display();
}
/**
* Index page, to browse.
*
@@ -207,7 +237,7 @@ class product extends control
$this->view->position[] = $this->products[$productID];
$this->view->position[] = $this->lang->product->browse;
$this->view->productID = $productID;
$this->view->program = $this->loadModel('project')->getById($this->session->program);
$this->view->program = $this->loadModel('project')->getById($this->session->PRJ);
$this->view->product = $this->product->getById($productID);
$this->view->productName = $this->products[$productID];
$this->view->moduleID = $moduleID;
@@ -834,7 +864,7 @@ class product extends control
$this->session->set('productList', $this->app->getURI(true));
/* Get all product list. Locate to the create product page if there is no product. */
$this->products = $this->product->getPairs('', $this->session->program);
$this->products = $this->product->getPairs('', $this->session->PRJ);
if(empty($this->products) and strpos('create|view', $this->methodName) === false) $this->locate($this->createLink('product', 'create'));
/* Get current product. */
+2
View File
@@ -30,6 +30,8 @@ $lang->product->orderAction = "{$lang->productCommon}排序";
$lang->product->all = "所有{$lang->productCommon}";
$lang->product->export = '导出数据';
$lang->product->exportAction = "导出{$lang->productCommon}";
$lang->product->stack = '项目集';
$lang->product->createstack = '创建项目集';
$lang->product->basicInfo = '基本信息';
$lang->product->otherInfo = '其他信息';
+3 -3
View File
@@ -366,7 +366,7 @@ class productModel extends model
*/
public function getOrderedProducts($status, $num = 0)
{
$products = $this->getList($this->session->program, $status);
$products = $this->getList($this->session->PRJ, $status);
if(empty($products)) return $products;
$lines = $this->loadModel('tree')->getLinePairs($useShort = true);
@@ -418,7 +418,7 @@ class productModel extends model
{
$product = fixer::input('post')
->setIF($this->post->acl != 'custom', 'whitelist', '')
->setDefault('program', $this->session->program)
->setDefault('program', $this->session->PRJ)
->setDefault('status', 'normal')
->setDefault('createdBy', $this->app->user->account)
->setDefault('createdDate', helper::now())
@@ -912,7 +912,7 @@ class productModel extends model
$this->loadModel('story');
$this->loadModel('bug');
$products = $this->getList($this->session->program, $status, $limit = 0, $line);
$products = $this->getList($this->session->PRJ, $status, $limit = 0, $line);
$products = $this->dao->select('*')->from(TABLE_PRODUCT)
->where('id')->in(array_keys($products))
->orderBy($orderBy)
+116
View File
@@ -0,0 +1,116 @@
<?php
/**
* The html template file of productlist method of product module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Yangyang Shi <shiyangyang@cnezsoft.com>
* @package ZenTaoPMS
* @version $Id$
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/sortable.html.php';?>
<div id="mainMenu" class="clearfix">
<div id="sidebarHeader">
<div class="title">
<?php echo empty($program) ? $lang->product->stack : $program->name;?>
<?php if($programID) echo html::a(inLink('productlist', 'programID=0'), "<i class='icon icon-sm icon-close'></i>", '', 'class="text-muted"');?>
</div>
</div>
<div class="btn-toolbar pull-left">
<?php foreach($lang->product->featureBar['all'] as $key => $label):?>
<?php echo html::a(inlink("all", "programID=$programID&browseType=$browseType&orderBy=$orderBy"), "<span class='text'>{$label}</span>", '', "class='btn btn-link' id='{$key}Tab'");?>
<?php endforeach;?>
<a id="bysearchTab" class="btn btn-link querybox-toggle"><i class="icon icon-search muted"></i> <?php echo $lang->user->search;?></a>
</div>
<div class="btn-toolbar pull-right">
<?php common::printLink('', '', "", '<i class="icon icon-plus"></i>' . $lang->product->create, '', 'class="btn btn-primary"');?>
</div>
</div>
<div id="mainContent" class="main-row fade">
<div id="sidebar" class="side-col">
<div class="sidebar-toggle"><i class="icon icon-angle-left"></i></div>
<div class="cell">
<?php echo $stack;?>
<div class="text-center">
<?php common::printLink('program', 'create', '', $lang->product->createstack, '', 'class="btn btn-info btn-wide"');?>
</div>
</div>
</div>
<div class="main-col">
<div id="queryBox" class="cell" data-module="productlist"></div>
<form class="main-table table-user" action="" id="productListForm" action='<?php echo inLink('batchEdit', "programID=$programID");?>'>
<?php $canOrder = common::hasPriv('product', 'updataOrder');?>
<?php $canBatchEdit = common::hasPriv('product', 'batchEdit');?>
<table id="productList" class="table has-sort-head table-fixed">
<?php $vars = "programID&$programID&browseType=$browseType&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
<thead>
<tr>
<th class='c-id'>
<?php if($canBatchEdit):?>
<div class="checkbox-primary check-all" title="<?php echo $lang->selectAll;?>">
<label></label>
</div>
<?php endif;?>
<?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?>
</th>
<th><?php common::printOrderLink('name', $orderBy, $vars, $lang->product->name);?></th>
<th class='w-110px text-left'><?php common::printOrderLink('line', $orderBy, $vars, $lang->product->line);?></th>
<th class='w-80px' title='<?php echo $lang->product->activeStoriesTitle;?>'><?php echo $lang->product->activeStories;?></th>
<th class='w-90px' title='<?php echo $lang->product->changedStoriesTitle;?>'><?php echo $lang->product->changedStories;?></th>
<th class='w-70px' title='<?php echo $lang->product->draftStoriesTitle;?>'><?php echo $lang->product->draftStories;?></th>
<th class='w-90px' title='<?php echo $lang->product->closedStoriesTitle;?>'><?php echo $lang->product->closedStories;?></th>
<th class='w-70px' title='<?php echo $lang->product->plans;?>'><?php echo $lang->product->plans;?></th>
<th class='w-70px' title='<?php echo $lang->product->releases;?>'><?php echo $lang->product->releases;?></th>
<th class='w-80px' title='<?php echo $lang->product->unResolvedBugsTitle;?>'><?php echo $lang->product->unResolvedBugs;?></th>
<th class='w-110px' title='<?php echo $lang->product->assignToNullBugsTitle;?>'><?php echo $lang->product->assignToNullBugs;?></th>
<?php if($canOrder):?>
<th class='w-70px sort-default'><?php common::printOrderLink('order', $orderBy, $vars, $lang->product->updateOrder);?></th>
<?php endif;?>
</tr>
</thead>
<tbody class="sortable" id="productTableList">
<?php foreach($productStats as $product):?>
<tr data-id='<?php echo $product->id ?>' data-order='<?php echo $product->code;?>'>
<td class='c-id'>
<?php if($canBatchEdit):?>
<?php echo html::checkbox('productIDList', array($product->id => sprintf('%03d', $product->id)));?>
<?php else:?>
<?php printf('%03d', $product->id);?>
<?php endif;?>
</td>
<td class="c-name" title='<?php echo $product->name?>'><?php echo html::a($this->createLink('product', 'view', 'product=' . $product->id), $product->name);?></td>
<td title='<?php echo zget($lines, $product->line, '')?>'><?php echo zget($lines, $product->line, '');?></td>
<td class='text-center'><?php echo $product->stories['active'];?></td>
<td class='text-center'><?php echo $product->stories['changed'];?></td>
<td class='text-center'><?php echo $product->stories['draft'];?></td>
<td class='text-center'><?php echo $product->stories['closed'];?></td>
<td class='text-center'><?php echo $product->plans;?></td>
<td class='text-center'><?php echo $product->releases;?></td>
<td class='text-center'><?php echo $product->unResolved;?></td>
<td class='text-center'><?php echo $product->assignToNull;?></td>
<?php if($canOrder):?>
<td class='c-actions sort-handler'><i class="icon icon-move"></i></td>
<?php endif;?>
</tr>
<?php endforeach;?>
</tbody>
</table>
<?php if($productStats):?>
<div class="table-footer">
<?php if($canBatchEdit):?>
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
<div class="table-actions btn-toolbar">
<?php echo html::submitButton($lang->edit, '', 'btn');?>
</div>
<?php endif;?>
<?php $pager->show('right', 'pagerjs');?>
</div>
<?php endif;?>
</form>
</div>
</div>
<?php js::set('orderBy', $orderBy)?>
<script>$("#<?php echo $browseType;?>Tab").addClass('btn-active-text');</script>
<?php include '../../common/view/footer.html.php';?>
+5 -5
View File
@@ -30,7 +30,7 @@ class productplan extends control
$this->view->branch = $branch;
$this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($productID);
$this->view->position[] = html::a($this->createLink('product', 'browse', "productID={$productID}&branch=$branch"), $product->name);
$this->product->setMenu($this->product->getPairs('', $this->session->program), $productID, $branch);
$this->product->setMenu($this->product->getPairs('', $this->session->PRJ), $productID, $branch);
}
/**
@@ -214,7 +214,7 @@ class productplan extends control
$this->session->set('productPlanList', $this->app->getURI(true));
$this->commonAction($productID, $branch);
$products = $this->product->getPairs('', $this->session->program);
$products = $this->product->getPairs('', $this->session->PRJ);
$this->view->title = $products[$productID] . $this->lang->colon . $this->lang->productplan->browse;
$this->view->position[] = $this->lang->productplan->browse;
$this->view->productID = $productID;
@@ -264,7 +264,7 @@ class productplan extends control
$sort = $this->loadModel('common')->appendOrder($orderBy);
$this->commonAction($plan->product, $plan->branch);
$products = $this->product->getPairs('', $this->session->program);
$products = $this->product->getPairs('', $this->session->PRJ);
$bugPager = new pager(0, $recPerPage, $type == 'bug' ? $pageID : 1);
$storyPager = new pager(0, $recPerPage, $type == 'story' ? $pageID : 1);
@@ -377,7 +377,7 @@ class productplan extends control
$this->loadModel('tree');
$plan = $this->productplan->getByID($planID);
$this->commonAction($plan->product, $plan->branch);
$products = $this->product->getPairs('', $this->session->program);
$products = $this->product->getPairs('', $this->session->PRJ);
/* Load pager. */
$this->app->loadClass('pager', $static = true);
@@ -515,7 +515,7 @@ class productplan extends control
$this->loadModel('bug');
$plan = $this->productplan->getByID($planID);
$this->commonAction($plan->product, $plan->branch);
$products = $this->product->getPairs('nocode', $this->session->program);
$products = $this->product->getPairs('nocode', $this->session->PRJ);
$productID = $plan->product;
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
+8
View File
@@ -0,0 +1,8 @@
<?php
class productset extends control
{
public function browse()
{
$this->display();
}
}
+5
View File
@@ -0,0 +1,5 @@
<?php
class productsetModel extends model
{
}
+15
View File
@@ -0,0 +1,15 @@
<?php
/**
* The browse view file of productset module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package productset
* @version $Id: browse.html.php 4707 2013-05-02 06:57:41Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/footer.html.php';?>
+48 -5
View File
@@ -9,6 +9,18 @@ class program extends control
$this->programs = $this->program->getPairs();
}
/**
* Program home page.
*
* @access public
* @return void
*/
public function PGMIndex()
{
$this->lang->navGroup->program = 'program';
$this->display();
}
/**
* Program index view.
*
@@ -19,7 +31,7 @@ class program extends control
public function index($programID = 0)
{
$this->lang->navGroup->program = 'program';
if(!$programID) $programID = $this->session->program;
if(!$programID) $programID = $this->session->PRJ;
$this->session->set('program', $programID);
$this->view->title = $this->lang->program->common . $this->lang->colon . $this->lang->program->index;
@@ -30,7 +42,7 @@ class program extends control
}
/**
* Program list.
* Project list.
*
* @param varchar $status
* @param varchar $orderBy
@@ -40,8 +52,9 @@ class program extends control
* @access public
* @return void
*/
public function browse($status = 'doing', $orderBy = 'order_desc', $recTotal = 0, $recPerPage = 50, $pageID = 1)
public function PGMBrowse($status = 'doing', $orderBy = 'order_desc', $recTotal = 0, $recPerPage = 50, $pageID = 1)
{
$this->lang->navGroup->program = 'program';
if(common::hasPriv('program', 'createGuide')) $this->lang->pageActions = html::a($this->createLink('program', 'createGuide'), "<i class='icon icon-sm icon-plus'></i> " . $this->lang->program->create, '', "class='btn btn-primary' data-toggle=modal");
$this->app->session->set('programList', $this->app->getURI(true));
@@ -171,7 +184,7 @@ class program extends control
$this->action->logHistory($actionID, $changes);
}
$url = $this->session->programList ? $this->session->programList : inlink('browse');
$url = $this->session->PRJList ? $this->session->PRJList : inlink('browse');
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $url));
}
@@ -718,8 +731,9 @@ class program extends control
*/
public function ajaxGetEnterLink($programID = 0)
{
$this->lang->navGroup->program = 'project';
$program = $this->project->getByID($programID);
$programProjects = $this->project->getPairs('', $this->session->program);
$programProjects = $this->project->getPairs('', $this->session->PRJ);
$programProject = key($programProjects);
if($program->template == 'waterfall')
@@ -733,4 +747,33 @@ class program extends control
die($link);
}
/**
* Projects list.
*
* @param int $programID
* @param string $browseType
* @param int $param
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @access public
* @return void
*/
public function PRJBrowse($programID = 0, $browseType = 'all', $param = 0, $orderBy = 'order_desc', $recTotal = 0, $recPerPage = 15, $pageID = 1)
{
$this->lang->navGroup->program = 'project';
/* Load pager and get tasks. */
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
$this->view->projectStats = array();
$this->view->pager = $pager;
$this->view->programID = $programID;
$this->view->browseType = $browseType;
$this->view->orderBy = $orderBy;
$this->view->stack = '';
$this->display();
}
}
+9 -15
View File
@@ -15,10 +15,8 @@ class programModel extends model
public function getList($status = 'all', $orderBy = 'id_desc', $pager = NULL, $includeCat = false, $mine = false)
{
return $this->dao->select('*')->from(TABLE_PROJECT)
->where('program')->eq(0)
->andWhere('template')->ne('')
->where('type')->eq('program')
->andWhere('deleted')->eq(0)
->beginIF(!$includeCat)->andWhere('iscat')->eq(0)->fi()
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->programs)->fi()
->beginIF($status != 'all')->andWhere('status')->eq($status)->fi()
->beginIF($this->cookie->mine or $mine)
@@ -40,8 +38,7 @@ class programModel extends model
public function getPairs()
{
return $this->dao->select('id, name')->from(TABLE_PROJECT)
->where('iscat')->eq(0)
->andWhere('program')->eq(0)
->where('type')->eq('program')
->andWhere('deleted')->eq(0)
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->programs)->fi()
->fetchPairs();
@@ -54,12 +51,11 @@ class programModel extends model
* @access public
* @return void
*/
public function getPairsByTemplate($template)
public function getPairsByTemplate($model)
{
return $this->dao->select('id, name')->from(TABLE_PROJECT)
->where('iscat')->eq(0)
->andWhere('template')->eq($template)
->andWhere('program')->eq(0)
->where('type')->eq('program')
->andWhere('model')->eq($model)
->andWhere('deleted')->eq(0)
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->programs)->fi()
->fetchPairs();
@@ -80,9 +76,7 @@ class programModel extends model
{
$queryType = strtolower($queryType);
$programs = $this->dao->select('*')->from(TABLE_PROJECT)
->where('iscat')->eq(0)
->andWhere('template')->ne('')
->andWhere('program')->eq(0)
->where('type')->eq('program')
->andWhere('deleted')->eq(0)
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->programs)->fi()
->beginIF($queryType == 'bystatus' and $param != 'all')->andWhere('status')->eq($param)->fi()
@@ -309,7 +303,7 @@ class programModel extends model
$groupPriv = $this->dao->select('t1.*')->from(TABLE_USERGROUP)->alias('t1')
->leftJoin(TABLE_GROUP)->alias('t2')->on('t1.group = t2.id')
->where('t1.account')->eq($this->app->user->account)
->andWhere('t2.role')->eq('pgmadmin')
->andWhere('t2.role')->eq('PRJadmin')
->fetch();
if(!empty($groupPriv))
{
@@ -318,10 +312,10 @@ class programModel extends model
}
else
{
$pgmAdminID = $this->dao->select('id')->from(TABLE_GROUP)->where('role')->eq('pgmadmin')->fetch('id');
$PRJadminID = $this->dao->select('id')->from(TABLE_GROUP)->where('role')->eq('PRJadmin')->fetch('id');
$groupPriv = new stdclass();
$groupPriv->account = $this->app->user->account;
$groupPriv->group = $pgmAdminID;
$groupPriv->group = $PRJadminID;
$groupPriv->program = $programID;
$this->dao->insert(TABLE_USERGROUP)->data($groupPriv)->exec();
}
+7 -4
View File
@@ -25,7 +25,7 @@
<?php
$trClass = '';
$trAttrs = "data-id='$program->id' data-order='$program->order' data-parent='$program->parent'";
if($program->isCat)
if($program->type == 'program')
{
$trAttrs .= " data-nested='true'";
if($program->parent == '0') $trClass .= ' is-top-level table-nest-child-hide';
@@ -34,11 +34,14 @@
if($program->parent)
{
if(!$program->isCat) $trClass .= ' is-nest-child';
if($program->type != 'program') $trClass .= ' is-nest-child';
$trClass .= ' table-nest-hide';
$trAttrs .= " data-nest-parent='$program->parent' data-nest-path='$program->path'";
}
else if(!$program->isCat) $trClass .= ' no-nest';
elseif($program->type != 'program')
{
$trClass .= ' no-nest';
}
$trAttrs .= " class='$trClass'";
?>
<tr <?php echo $trAttrs;?>>
@@ -48,7 +51,7 @@
<td class='text-left'><?php echo $program->code;?></td>
<td class='text-left pgm-title table-nest-title' title='<?php echo $program->name?>'>
<span class="table-nest-icon icon<?php if($program->isCat) echo ' table-nest-toggle' ?>"></span>
<?php echo $program->isCat ? $program->name : html::a($this->createLink('program', 'index', "programID=$program->id", '', '', $program->id), $program->name);?>
<?php echo $program->type == 'program' ? $program->name : html::a($this->createLink('program', 'index', "programID=$program->id", '', '', $program->id), $program->name);?>
</td>
<td class='c-status'><span class="status-program status-<?php echo $program->status?>"><?php echo zget($lang->project->statusList, $program->status, '');?></span></td>
<td class='text-center'><?php echo $program->begin;?></td>
+131
View File
@@ -0,0 +1,131 @@
<?php
/**
* The html template file of projectlist method of project module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Yidong Wang <yidong@cnezsoft.com>
* @package project
* @version $Id: index.html.php 5094 2013-07-10 08:46:15Z chencongzhi520@gmail.com $
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/sortable.html.php';?>
<div id="mainMenu" class="clearfix">
<div id="sidebarHeader">
<div class="title">
<?php echo empty($program) ? $lang->project->stack : $program->name;?>
<?php if($programID) echo html::a(inLink('productlist', 'programID=0'), "<i class='icon icon-sm icon-close'></i>", '', 'class="text-muted"');?>
</div>
</div>
<div class="btn-toolbar pull-left">
<?php foreach($lang->project->featureBar['all'] as $key => $label):?>
<?php echo html::a(inlink("all", "programID=$programID&browseType=$browseType&orderBy=$orderBy"), "<span class='text'>{$label}</span>", '', "class='btn btn-link' id='{$key}Tab'");?>
<?php endforeach;?>
<a id="bysearchTab" class="btn btn-link querybox-toggle"><i class="icon icon-search muted"></i> <?php echo $lang->user->search;?></a>
</div>
<div class="btn-toolbar pull-right">
<?php common::printLink('', '', "", '<i class="icon icon-plus"></i>' . $lang->project->create, '', 'class="btn btn-primary"');?>
</div>
</div>
<div id='mainContent' class="main-row fade">
<div id="sidebar" class="side-col">
<div class="sidebar-toggle"><i class="icon icon-angle-left"></i></div>
<div class="cell">
<?php echo $stack;?>
<div class="text-center">
<?php common::printLink('program', 'create', '', $lang->project->createstack, '', 'class="btn btn-info btn-wide"');?>
</div>
</div>
</div>
<div class="main-col">
<div id="queryBox" class="cell" data-module="projectlist"></div>
<?php $canOrder = (common::hasPriv('project', 'updateOrder') and strpos($orderBy, 'order') !== false)?>
<?php $canBatchEdit = common::hasPriv('project', 'batchEdit'); ?>
<form class='main-table' id='projectsForm' method='post' action='<?php echo inLink('batchEdit', "programID=$programID");?>' data-ride='table'>
<table class='table has-sort-head table-fixed' id='projectList'>
<?php $vars = "programID=$programID&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
<thead>
<tr>
<th class='c-id'>
<?php if($canBatchEdit):?>
<div class="checkbox-primary check-all" title="<?php echo $lang->selectAll?>">
<label></label>
</div>
<?php endif;?>
<?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?>
</th>
<th><?php common::printOrderLink('name', $orderBy, $vars, $lang->project->name);?></th>
<th class='w-150px'><?php common::printOrderLink('code', $orderBy, $vars, $lang->project->code);?></th>
<th class='thWidth'><?php common::printOrderLink('PM', $orderBy, $vars, $lang->project->PM);?></th>
<th class='w-90px'><?php common::printOrderLink('end', $orderBy, $vars, $lang->project->end);?></th>
<th class='w-90px'><?php common::printOrderLink('status', $orderBy, $vars, $lang->project->status);?></th>
<th class='w-70px'><?php echo $lang->project->totalEstimate;?></th>
<th class='w-70px'><?php echo $lang->project->totalConsumed;?></th>
<th class='w-70px'><?php echo $lang->project->totalLeft;?></th>
<th class='w-150px'><?php echo $lang->project->progress;?></th>
<th class='w-100px'><?php echo $lang->project->burn;?></th>
<?php if($canOrder):?>
<th class='w-60px sort-default'><?php common::printOrderLink('order', $orderBy, $vars, $lang->project->orderAB);?></th>
<?php endif;?>
</tr>
</thead>
<tbody class='sortable' id='projectTableList'>
<?php foreach($projectStats as $project):?>
<tr data-id='<?php echo $project->id ?>' data-order='<?php echo $project->order ?>'>
<td class='c-id'>
<?php if($canBatchEdit):?>
<div class="checkbox-primary">
<input type='checkbox' name='projectIDList[<?php echo $project->id;?>]' value='<?php echo $project->id;?>' />
<label></label>
</div>
<?php endif;?>
<?php printf('%03d', $project->id);?>
</td>
<td class='text-left' title='<?php echo $project->name?>'>
<?php
if(isset($project->delay)) echo "<span class='label label-danger label-badge'>{$lang->project->delayed}</span> ";
echo html::a($this->createLink('project', 'view', 'project=' . $project->id), $project->name);
?>
</td>
<td class='text-left' title="<?php echo $project->code;?>"><?php echo $project->code;?></td>
<td><?php echo zget($users, $project->PM);?></td>
<td><?php echo $project->end;?></td>
<?php $projectStatus = $this->processStatus('project', $project);?>
<td class='c-status' title='<?php echo $projectStatus;?>'>
<span class="status-project status-<?php echo $project->status?>"><?php echo $projectStatus;?></span>
</td>
<td><?php echo $project->hours->totalEstimate;?></td>
<td><?php echo $project->hours->totalConsumed;?></td>
<td><?php echo $project->hours->totalLeft;?></td>
<td class="c-progress">
<div class="progress progress-text-left">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="<?php echo $project->hours->progress;?>" aria-valuemin="0" aria-valuemax="100" style="width: <?php echo $project->hours->progress;?>%">
<span class="progress-text"><?php echo $project->hours->progress;?>%</span>
</div>
</div>
</td>
<td id='spark-<?php echo $project->id?>' class='sparkline text-left no-padding' values='<?php echo join(',', $project->burns);?>'></td>
<?php if($canOrder):?>
<td class='sort-handler'><i class="icon icon-move"></i></td>
<?php endif;?>
</tr>
<?php endforeach;?>
</tbody>
</table>
<?php if($projectStats):?>
<div class='table-footer'>
<?php if($canBatchEdit):?>
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
<div class="table-actions btn-toolbar"><?php echo html::submitButton($lang->project->batchEdit, '', 'btn');?></div>
<?php endif;?>
<?php if(!$canOrder and common::hasPriv('project', 'updateOrder')) echo html::a(inlink('all', "status=$status&projectID=$projectID&order=order_desc&productID=$productID&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}"), $lang->project->updateOrder, '', "class='btn'");?>
<?php $pager->show('right', 'pagerjs');?>
</div>
<?php endif;?>
</form>
</div>
</div>
<script>$("#<?php echo $browseType;?>Tab").addClass('btn-active-text');</script>
<?php js::set('orderBy', $orderBy)?>
<?php include '../../common/view/footer.html.php';?>
+2 -2
View File
@@ -114,7 +114,7 @@ class programplan extends control
$this->programplan->create($programID, $planID, $this->productID);
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
$locate = $this->session->programplanList ? $this->session->programplanList : $this->createLink('programplan', 'browse', "program=$programID");
$locate = $this->session->PRJplanList ? $this->session->PRJplanList : $this->createLink('programplan', 'browse', "program=$programID");
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locate));
}
@@ -167,7 +167,7 @@ class programplan extends control
$this->app->loadLang('stage');
$this->view->title = $this->lang->programplan->edit;
$this->view->position[] = $this->lang->programplan->edit;
$this->view->parentStage = $this->programplan->getParentStageList($this->session->program, $planID, $plan->product);
$this->view->parentStage = $this->programplan->getParentStageList($this->session->PRJ, $planID, $plan->product);
$this->view->plan = $plan;
$this->view->isParent = $this->programplan->isParent($planID);
$this->view->isCreateTask = $this->programplan->isCreateTask($planID);
-13
View File
@@ -1,13 +0,0 @@
<?php
class programset extends control
{
public function index()
{
$this->display();
}
public function browse()
{
$this->display();
}
}
-90
View File
@@ -1,90 +0,0 @@
<?php include '../../common/view/header.html.php';?>
<div id='mainContent' class='main-row'>
<?php if(empty($programsets)):?>
<div class="table-empty-tip">
<p><span class="text-muted"><?php echo $lang->programset->noProgramset;?></span> <?php common::printLink('programset', 'createguide', '', "<i class='icon icon-plus'></i> " . $lang->programset->create, '', "class='btn btn-info' data-toggle=modal");?></p>
</div>
<?php else:?>
<div class='main-col'>
<form class='main-table' id='programForm' method='post' data-ride='table' data-nested='true' data-expand-nest-child='false' data-checkable='false'>
<table class='table has-sort-head table-fixed table-nested' id='programList'>
<?php $vars = "status=$status&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
<thead>
<tr>
<th class='c-id w-80px'>
<?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?>
</th>
<th class='w-100px'><?php common::printOrderLink('code', $orderBy, $vars, $lang->program->code);?></th>
<th class='table-nest-title'><?php common::printOrderLink('name', $orderBy, $vars, $lang->program->name);?></th>
<th class='w-80px'><?php common::printOrderLink('status', $orderBy, $vars, $lang->program->status);?></th>
<th class='w-100px'><?php common::printOrderLink('begin', $orderBy, $vars, $lang->program->begin);?></th>
<th class='w-100px'><?php common::printOrderLink('end', $orderBy, $vars, $lang->program->end);?></th>
<th class='w-100px'><?php common::printOrderLink('budget', $orderBy, $vars, $lang->program->budget);?></th>
<th class='w-100px'><?php common::printOrderLink('PM', $orderBy, $vars, $lang->program->PM);?></th>
<th class='text-center w-240px'><?php echo $lang->actions;?></th>
</tr>
</thead>
<tbody id='programTableList'>
<?php foreach($programs as $program):?>
<?php
$trClass = '';
$trAttrs = "data-id='$program->id' data-order='$program->order' data-parent='$program->parent'";
if($program->isCat)
{
$trAttrs .= " data-nested='true'";
if($program->parent == '0') $trClass .= ' is-top-level table-nest-child-hide';
else $trClass .= ' is-top-level table-nest-hide';
}
if($program->parent)
{
if(!$program->isCat) $trClass .= ' is-nest-child';
$trClass .= ' table-nest-hide';
$trAttrs .= " data-nest-parent='$program->parent' data-nest-path='$program->path'";
}
else if(!$program->isCat) $trClass .= ' no-nest';
$trAttrs .= " class='$trClass'";
?>
<tr <?php echo $trAttrs;?>>
<td class='c-id'>
<?php printf('%03d', $program->id);?>
</td>
<td class='text-left'><?php echo $program->code;?></td>
<td class='text-left pgm-title table-nest-title' title='<?php echo $program->name?>'>
<span class="table-nest-icon icon<?php if($program->isCat) echo ' table-nest-toggle' ?>"></span>
<?php echo $program->isCat ? $program->name : html::a($this->createLink('program', 'index', "programID=$program->id", '', '', $program->id), $program->name);?>
</td>
<td class='c-status'><span class="status-program status-<?php echo $program->status?>"><?php echo zget($lang->project->statusList, $program->status, '');?></span></td>
<td class='text-center'><?php echo $program->begin;?></td>
<td class='text-center'><?php echo $program->end == '0000-00-00' ? '' : $program->end;?></td>
<td class='text-left'><?php echo $program->budget . ' ' . zget($lang->program->unitList, $program->budgetUnit);?></td>
<td><?php echo zget($users, $program->PM);?></td>
<td class='text-center c-actions'>
<?php common::printIcon('program', 'group', "programID=$program->id", $program, 'list', 'group');?>
<?php common::printIcon('program', 'manageMembers', "programID=$program->id", $program, 'list', 'persons');?>
<?php common::printIcon('program', 'start', "programID=$program->id", $program, 'list', '', '', 'iframe', true);?>
<?php common::printIcon('program', 'activate', "programID=$program->id", $program, 'list', '', '', 'iframe', true);?>
<?php common::printIcon('program', 'suspend', "programID=$program->id", $program, 'list', '', '', 'iframe', true);?>
<?php common::printIcon('program', 'close', "programID=$program->id", $program, 'list', '', '', 'iframe', true);?>
<?php if(common::hasPriv('program', 'edit')) echo html::a($this->createLink("program", "edit", "programID=$program->id"), "<i class='icon-edit'></i>", '', "class='btn' title='{$lang->edit}'");?>
<?php common::printIcon('program', 'create', "template=&programID=$program->id", '', 'list', 'treemap-alt', '', '', '', '', $this->lang->program->children);?>
<?php if(common::hasPriv('program', 'delete')) echo html::a($this->createLink("program", "delete", "programID=$program->id"), "<i class='icon-trash'></i>", 'hiddenwin', "class='btn' title='{$lang->delete}'");?>
</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<div class='table-footer'>
<?php $pager->show('right', 'pagerjs');?>
</div>
</form>
</div>
<?php endif;?>
</div>
<style>
.w-240px {width:240px;}
#programsetTableList.sortable-sorting > tr {opacity: 0.7}
#programsetTableList.sortable-sorting > tr.drag-row {opacity: 1;}
#programsetTableList > tr.drop-not-allowed {opacity: 0.1!important}
</style>
<?php include '../../common/view/footer.html.php';?>
+11 -13
View File
@@ -23,7 +23,7 @@ class project extends control
parent::__construct($moduleName, $methodName);
if($this->methodName != 'computeburn')
{
$this->projects = $this->project->getPairs('nocode', $this->session->program);
$this->projects = $this->project->getPairs('nocode', $this->session->PRJ);
if(!$this->projects and $this->methodName != 'index' and $this->methodName != 'create' and $this->app->getViewType() != 'mhtml') $this->locate($this->createLink('project', 'create'));
if(!$this->projects and $this->methodName != 'index' and $this->methodName != 'create' and $this->app->getViewType() == 'mhtml') $this->locate($this->createLink('project', 'index'));
}
@@ -506,7 +506,7 @@ class project extends control
$this->app->session->set('projectList', $uri);
$this->loadModel('bug');
$projects = $this->project->getPairs('nocode', $this->session->program);
$projects = $this->project->getPairs('nocode', $this->session->PRJ);
$this->project->setMenu($projects, $projectID);
/* Load pager. */
@@ -925,7 +925,7 @@ class project extends control
$this->view->orderBy = $orderBy;
$this->view->tasks = $productTasks;
$this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter');
$this->view->products = $this->loadModel('product')->getPairs('', $this->session->program);
$this->view->products = $this->loadModel('product')->getPairs('', $this->session->PRJ);
$this->display();
}
@@ -1149,7 +1149,7 @@ class project extends control
$this->view->position[] = $this->view->title;
$this->view->projects = array('' => '') + $this->projects;
$this->view->groups = $this->loadModel('group')->getPairs();
$this->view->allProducts = array(0 => '') + $this->loadModel('product')->getPairs('noclosed|nocode', $this->session->program);
$this->view->allProducts = array(0 => '') + $this->loadModel('product')->getPairs('noclosed|nocode', $this->session->PRJ);
$this->view->acl = $acl;
$this->view->plan = $plan;
$this->view->name = $name;
@@ -1222,7 +1222,7 @@ class project extends control
$position[] = html::a($browseProjectLink, $project->name);
$position[] = $this->lang->project->edit;
$allProducts = array(0 => '') + $this->loadModel('product')->getPairs('noclosed|nocode', $this->session->program);
$allProducts = array(0 => '') + $this->loadModel('product')->getPairs('noclosed|nocode', $this->session->PRJ);
$linkedProducts = $this->project->getProducts($project->id);
$linkedBranches = array();
foreach($linkedProducts as $product)
@@ -1881,7 +1881,7 @@ class project extends control
$position[] = html::a($browseProjectLink, $project->name);
$position[] = $this->lang->project->manageProducts;
$allProducts = $this->product->getPairs('noclosed|nocode', $this->session->program);
$allProducts = $this->product->getPairs('noclosed|nocode', $this->session->PRJ);
$linkedProducts = $this->project->getProducts($project->id);
$linkedBranches = array();
// Merge allProducts and linkedProducts for closed product.
@@ -2059,15 +2059,13 @@ class project extends control
{
$allStories = $this->story->getProductStories(array_keys($products), $branches, $moduleID = '0', $status = 'active', 'story', 'id_desc', $hasParent = false, '', $pager = null);
}
foreach($allStories as $id => $story)
{
if(isset($prjStories[$story->id])) unset($allStories[$id]);
}
$prjStories = $this->story->getProjectStoryPairs($projectID);
$prjStories = $this->story->getProjectStoryPairs($projectID);
foreach($allStories as $id => $story)
{
if(isset($prjStories[$story->id])) unset($allStories[$id]);
if($story->parent < 0) unset($allStories[$id]);
}
/* Pager. */
@@ -2387,7 +2385,7 @@ class project extends control
$this->view->title = $this->lang->project->allProject;
$this->view->position[] = $this->lang->project->allProject;
$this->view->projectStats = $this->project->getProjectStats($status == 'byproduct' ? 'all' : $status, $productID, 0, 30, $orderBy, $pager);
$this->view->products = array(0 => $this->lang->product->select) + $this->loadModel('product')->getPairs('', $this->session->program);
$this->view->products = array(0 => $this->lang->product->select) + $this->loadModel('product')->getPairs('', $this->session->PRJ);
$this->view->productID = $productID;
$this->view->projectID = $projectID;
$this->view->pager = $pager;
@@ -2586,7 +2584,7 @@ class project extends control
$this->view->cases = $cases;
$this->view->story = $story;
$this->view->users = $users;
$this->view->projects = $this->loadModel('project')->getPairs('nocode', $this->session->program);
$this->view->projects = $this->loadModel('project')->getPairs('nocode', $this->session->PRJ);
$this->view->actions = $this->loadModel('action')->getList('story', $storyID);
$this->view->modulePath = $modulePath;
$this->view->version = $version == 0 ? $story->version : $version;
+2
View File
@@ -72,6 +72,8 @@ $lang->project->effort = '日志';
$lang->project->relatedMember = '相关成员';
$lang->project->watermark = '由禅道导出';
$lang->project->viewByUser = '按用户查看';
$lang->project->stack = '项目集';
$lang->project->createstack = '创建项目集';
$lang->project->start = "开始";
$lang->project->activate = "激活";
+18 -22
View File
@@ -62,10 +62,10 @@ class projectModel extends model
*/
public function setMenu($projects, $projectID, $buildID = 0, $extra = '')
{
$program = $this->getByID($this->session->program);
$program = $this->getByID($this->session->PRJ);
if(empty($projects))
{
if($program->template == 'waterfall')
if($program->model == 'waterfall')
{
if(($this->app->moduleName == 'programplan' && $this->app->methodName != 'create') || $this->app->moduleName == 'project') die(js::locate(helper::createLink('programplan', 'create', "progarmID=$program->id")));
}
@@ -82,7 +82,7 @@ class projectModel extends model
$isProgram = false;
if(!empty($project))
{
$isProgram = $project->template;
$isProgram = $project->model;
$program = $isProgram ? $project : $this->getByID($project->program);
}
@@ -222,7 +222,7 @@ class projectModel extends model
*/
public function tree()
{
$products = $this->loadModel('product')->getPairs('nocode', $this->session->program);
$products = $this->loadModel('product')->getPairs('nocode', $this->session->PRJ);
$productGroup = $this->getProductGroupList();
$projectTree = "<ul class='tree tree-lines'>";
foreach($productGroup as $productID => $projects)
@@ -306,7 +306,7 @@ class projectModel extends model
$this->lang->project->team = $this->lang->project->teamname;
$project = fixer::input('post')
->setDefault('status', 'wait')
->setDefault('program', $this->session->program)
->setDefault('program', $this->session->PRJ)
->setIF($this->post->acl != 'custom', 'whitelist', '')
->setDefault('openedBy', $this->app->user->account)
->setDefault('openedDate', helper::now())
@@ -718,8 +718,8 @@ class projectModel extends model
$mode .= $this->cookie->projectMode;
/* Order by status's content whether or not done */
$projects = $this->dao->select('*, IF(INSTR(" done,closed", status) < 2, 0, 1) AS isDone')->from(TABLE_PROJECT)
->where('iscat')->eq(0)
->beginIF($programID)->andWhere('program')->eq($programID)->fi()
->where('deleted')->eq(0)
->beginIF($programID)->andWhere('parent')->eq($programID)->fi()
->beginIF(strpos($mode, 'withdelete') === false)->andWhere('deleted')->eq(0)->fi()
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi()
->orderBy($orderBy)
@@ -765,7 +765,7 @@ class projectModel extends model
*/
public function getList($status = 'all', $limit = 0, $productID = 0, $branch = 0, $programID = 0)
{
$programID = $programID ? $programID : $this->session->programID;
$programID = $programID ? $programID : $this->session->PRJID;
if($status == 'involved') return $this->getInvolvedList($status, $limit, $productID, $branch);
if($productID != 0)
@@ -773,10 +773,9 @@ class projectModel extends model
return $this->dao->select('t2.*')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
->where('t1.product')->eq($productID)
->andWhere('type')->in('sprint,stage')
->andWhere('t2.deleted')->eq(0)
->andWhere('t2.iscat')->eq(0)
->beginIF($programID)->andWhere('t2.program')->eq($programID)->fi()
->andWhere('t2.template')->eq('')
->beginIF($programID)->andWhere('t2.parent')->eq($programID)->fi()
->beginIF($status == 'undone')->andWhere('t2.status')->notIN('done,closed')->fi()
->beginIF($branch)->andWhere('t1.branch')->eq($branch)->fi()
->beginIF($status != 'all' and $status != 'undone')->andWhere('status')->in($status)->fi()
@@ -787,13 +786,13 @@ class projectModel extends model
}
else
{
return $this->dao->select('*, IF(INSTR(" done,closed", status) < 2, 0, 1) AS isDone')->from(TABLE_PROJECT)->where('iscat')->eq(0)
return $this->dao->select('*, IF(INSTR(" done,closed", status) < 2, 0, 1) AS isDone')->from(TABLE_PROJECT)
->where('deleted')->eq(0)
->andWhere('type')->in('sprint,stage')
->beginIF($status == 'undone')->andWhere('status')->notIN('done,closed')->fi()
->beginIF($status != 'all' and $status != 'undone')->andWhere('status')->in($status)->fi()
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi()
->andWhere('deleted')->eq(0)
->beginIF($programID)->andWhere('program')->eq($programID)->fi()
->andWhere('template')->eq('')
->beginIF($programID)->andWhere('parent')->eq($programID)->fi()
->orderBy('order_desc')
->beginIF($limit)->limit($limit)->fi()
->fetchAll('id');
@@ -819,7 +818,6 @@ class projectModel extends model
->leftJoin(TABLE_TEAM)->alias('t3')->on('t3.root=t2.id')
->where('t1.product')->eq($productID)
->andWhere('t2.deleted')->eq(0)
->andWhere('t2.iscat')->eq(0)
->beginIF($branch)->andWhere('t1.branch')->eq($branch)->fi()
->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->projects)->fi()
->andWhere('t2.openedBy', true)->eq($this->app->user->account)
@@ -834,12 +832,11 @@ class projectModel extends model
{
return $this->dao->select('t1.*, IF(INSTR(" done,closed", t1.status) < 2, 0, 1) AS isDone')->from(TABLE_PROJECT)->alias('t1')
->leftJoin(TABLE_TEAM)->alias('t2')->on('t2.root=t1.id')
->where('t1.iscat')->eq(0)
->where('t1.deleted')->eq(0)
->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->projects)->fi()
->andWhere('t1.openedBy', true)->eq($this->app->user->account)
->orWhere('t2.account')->eq($this->app->user->account)
->markRight(1)
->andWhere('t1.deleted')->eq(0)
->andWhere('t2.type')->eq('project')
->orderBy('t1.order_desc')
->beginIF($limit)->limit($limit)->fi()
@@ -859,13 +856,12 @@ class projectModel extends model
$projects = $this->dao->select('t1.*, t3.name as productName')->from(TABLE_PROJECT)->alias('t1')
->leftJoin(TABLE_PROJECTPRODUCT)->alias('t2')->on('t1.id = t2.project')
->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t2.product = t3.id')
->where('t1.program')->eq((int)$program->id)
->andWhere('t1.template')->eq('')
->where('t1.parent')->eq((int)$program->id)
->andWhere('t1.deleted')->eq('0')
->orderBy('t1.order desc')
->fetchAll('id');
if($program->template == 'waterfall')
if($program->model == 'waterfall')
{
foreach($projects as $projectID => $project)
{
@@ -1972,7 +1968,7 @@ class projectModel extends model
$changedAccounts = array_merge($changedAccounts, array_diff($oldAccounts, $accounts));
$changedAccounts = array_unique($changedAccounts);
$objectType = $project->template ? 'program' : 'project';
$objectType = $project->model ? 'program' : 'project';
$this->loadModel('user')->updateUserView($projectID, $objectType, $changedAccounts);
$products = $this->getProducts($projectID, false);
+1 -1
View File
@@ -19,7 +19,7 @@ class qa extends control
*/
public function index($locate = 'auto', $productID = 0)
{
$this->products = $this->loadModel('product')->getPairs('nocode', $this->session->program);
$this->products = $this->loadModel('product')->getPairs('nocode', $this->session->PRJ);
if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "fromModule=qa")));
if($locate == 'yes') $this->locate($this->createLink('bug', 'browse'));
+1 -1
View File
@@ -28,7 +28,7 @@ class release extends control
$this->view->branch = $branch;
$this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($product->id);
$this->view->position[] = html::a($this->createLink('product', 'browse', "productID={$this->view->product->id}&branch=$branch"), $this->view->product->name);
$this->product->setMenu($this->product->getPairs('', $this->session->program), $productID, $branch);
$this->product->setMenu($this->product->getPairs('', $this->session->PRJ), $productID, $branch);
}
/**
+2 -2
View File
@@ -120,7 +120,7 @@ class releaseModel extends model
if($this->post->date > date('Y-m-d')) return dao::$errors[] = $this->lang->release->errorDate;
$release = fixer::input('post')
->add('program', $this->session->program)
->add('program', $this->session->PRJ)
->add('product', (int)$productID)
->add('branch', (int)$branch)
->setDefault('stories', '')
@@ -147,7 +147,7 @@ class releaseModel extends model
else
{
$build = new stdclass();
$build->program = $this->session->program;
$build->program = $this->session->PRJ;
$build->product = (int)$productID;
$build->branch = (int)$branch;
$build->name = $release->name;
+2 -2
View File
@@ -28,7 +28,7 @@ class repo extends control
}
$this->scm = $this->app->loadClass('scm');
$this->repos = $this->repo->getRepoPairs($this->session->program);
$this->repos = $this->repo->getRepoPairs($this->session->PRJ);
if(empty($this->repos) and $this->methodName != 'create') die(js::locate($this->repo->createLink('create')));
/* Unlock session for wait to get data of repo. */
@@ -54,7 +54,7 @@ class repo extends control
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
$this->view->repoList = $this->repo->getList($this->session->program, $orderBy, $pager);
$this->view->repoList = $this->repo->getList($this->session->PRJ, $orderBy, $pager);
$this->view->title = $this->lang->repo->common . $this->lang->colon . $this->lang->repo->browse;
$this->view->position[] = $this->lang->repo->common;
+1 -1
View File
@@ -26,7 +26,7 @@
<table class='table table-form'>
<tr>
<th><?php echo $lang->repo->program; ?></th>
<td class='required'><?php echo html::select('program[]', $programs, $this->session->program, "class='form-control chosen' multiple"); ?></td>
<td class='required'><?php echo html::select('program[]', $programs, $this->session->PRJ, "class='form-control chosen' multiple"); ?></td>
</tr>
<tr>
<th class='thWidth'><?php echo $lang->repo->type; ?></th>
+2 -2
View File
@@ -83,8 +83,8 @@ class report extends control
$this->view->end = $end;
$this->view->bugs = $this->report->getBugs($begin, $end, $product, $project);
$this->view->users = $this->loadModel('user')->getPairs('noletter|noclosed|nodeleted');
$this->view->projects = array('' => '') + $this->loadModel('project')->getPairs('', $this->session->program);
$this->view->products = array('' => '') + $this->loadModel('product')->getPairs('', $this->session->program);
$this->view->projects = array('' => '') + $this->loadModel('project')->getPairs('', $this->session->PRJ);
$this->view->products = array('' => '') + $this->loadModel('product')->getPairs('', $this->session->PRJ);
$this->view->project = $project;
$this->view->product = $product;
$this->view->submenu = 'test';
+1 -1
View File
@@ -40,7 +40,7 @@ class risk extends control
$this->view->title = $this->lang->risk->common . $this->lang->colon . $this->lang->risk->browse;
$this->view->position[] = $this->lang->risk->browse;
$this->view->risks = $this->risk->getList($this->session->program, $browseType, $param, $orderBy, $pager);
$this->view->risks = $this->risk->getList($this->session->PRJ, $browseType, $param, $orderBy, $pager);
$this->view->browseType = $browseType;
$this->view->param = $param;
$this->view->orderBy = $orderBy;
+2 -2
View File
@@ -22,7 +22,7 @@ class riskModel extends model
public function create()
{
$risk = fixer::input('post')
->add('program', $this->session->program)
->add('program', $this->session->PRJ)
->add('createdBy', $this->app->user->account)
->add('createdDate', helper::today())
->stripTags($this->config->risk->editor->create['id'], $this->config->allowedTags)
@@ -56,7 +56,7 @@ class riskModel extends model
$risk->source = $data->source[$i];
$risk->category = $data->category[$i];
$risk->strategy = $data->strategy[$i];
$risk->program = $this->session->program;
$risk->program = $this->session->PRJ;
$risk->createdBy = $this->app->user->account;
$risk->createdDate = helper::today();
+2 -2
View File
@@ -265,8 +265,8 @@ class searchModel extends model
$users = $this->loadModel('user')->getPairs('realname|noclosed', $appendUsers, $this->config->maxCount);
$users['$@me'] = $this->lang->search->me;
}
if($hasProduct) $products = array('' => '') + $this->loadModel('product')->getPairs('', $this->session->program);
if($hasProject) $projects = array('' => '') + $this->loadModel('project')->getPairs('', $this->session->program);
if($hasProduct) $products = array('' => '') + $this->loadModel('product')->getPairs('', $this->session->PRJ);
if($hasProject) $projects = array('' => '') + $this->loadModel('project')->getPairs('', $this->session->PRJ);
foreach($fields as $fieldName)
{
+16 -16
View File
@@ -341,7 +341,7 @@ class story extends control
/* Set products and module. */
$product = $this->product->getById($productID);
$products = $this->product->getPairs('', $this->session->program);
$products = $this->product->getPairs('', $this->session->PRJ);
$moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'story', 0, $branch);
/* Set menu. */
@@ -429,7 +429,7 @@ class story extends control
/* Get datas. */
$story = $this->story->getById($storyID);
$product = $this->product->getById($story->product);
$products = $this->product->getPairs('', $this->session->program);
$products = $this->product->getPairs('', $this->session->PRJ);
$moduleOptionMenu = $this->tree->getOptionMenu($product->id, $viewType = 'story', 0, $story->branch);
/* Set menu. */
@@ -593,7 +593,7 @@ class story extends control
/* The stories of a product. */
if($productID)
{
$this->product->setMenu($this->product->getPairs('nodeleted', $this->session->program), $productID, $branch);
$this->product->setMenu($this->product->getPairs('nodeleted', $this->session->PRJ), $productID, $branch);
$product = $this->product->getByID($productID);
$branchProduct = $product->type == 'normal' ? false : true;
@@ -615,7 +615,7 @@ class story extends control
elseif($projectID)
{
$this->lang->story->menu = $this->lang->project->menu;
$this->project->setMenu($this->project->getPairs('nodeleted', $this->session->program), $projectID);
$this->project->setMenu($this->project->getPairs('nodeleted', $this->session->PRJ), $projectID);
$this->lang->set('menugroup.story', 'project');
$this->lang->story->menuOrder = $this->lang->project->menuOrder;
@@ -797,7 +797,7 @@ class story extends control
$users = $this->user->getPairs('noletter');
/* Set the menu. */
$this->product->setMenu($this->product->getPairs('', $this->session->program), $product->id, $story->branch);
$this->product->setMenu($this->product->getPairs('', $this->session->PRJ), $product->id, $story->branch);
if($from == 'project')
{
@@ -824,7 +824,7 @@ class story extends control
$this->view->track = $this->story->getTrackByID($story->id);
$this->view->users = $users;
$this->view->relations = $this->story->getStoryRelation($story->id, $story->type);
$this->view->projects = $this->loadModel('project')->getPairs('nocode', $this->session->program);
$this->view->projects = $this->loadModel('project')->getPairs('nocode', $this->session->PRJ);
$this->view->program = $this->project->getByID($story->program);
$this->view->actions = $this->action->getList('story', $storyID);
$this->view->storyModule = $storyModule;
@@ -903,7 +903,7 @@ class story extends control
$this->replaceURLang($story->type);
/* Set menu. */
$this->product->setMenu($this->product->getPairs('', $this->session->program), $product->id, $story->branch);
$this->product->setMenu($this->product->getPairs('', $this->session->PRJ), $product->id, $story->branch);
/* Set the review result options. */
if($story->status == 'draft' and $story->version == 1) unset($this->lang->story->reviewResultList['revert']);
@@ -988,7 +988,7 @@ class story extends control
$this->replaceURLang($story->type);
/* Set menu. */
$this->product->setMenu($this->product->getPairs('', $this->session->program), $product->id, $story->branch);
$this->product->setMenu($this->product->getPairs('', $this->session->PRJ), $product->id, $story->branch);
/* Set the closed reason options. */
if($story->status == 'draft') unset($this->lang->story->reasonList['cancel']);
@@ -1060,7 +1060,7 @@ class story extends control
/* The stories of a product. */
if($productID)
{
$this->product->setMenu($this->product->getPairs('nodeleted', $this->session->program), $productID);
$this->product->setMenu($this->product->getPairs('nodeleted', $this->session->PRJ), $productID);
$product = $this->product->getByID($productID);
$this->view->position[] = html::a($this->createLink('product', 'browse', "product=$product->id"), $product->name);
$this->view->title = $product->name . $this->lang->colon . $this->lang->story->batchClose;
@@ -1070,7 +1070,7 @@ class story extends control
{
$this->lang->story->menu = $this->lang->project->menu;
$this->lang->story->menuOrder = $this->lang->project->menuOrder;
$this->project->setMenu($this->project->getPairs('nodeleted', $this->session->program), $projectID);
$this->project->setMenu($this->project->getPairs('nodeleted', $this->session->PRJ), $projectID);
$this->lang->set('menugroup.story', 'project');
$project = $this->project->getByID($projectID);
$this->view->position[] = html::a($this->createLink('project', 'story', "project=$project->id"), $project->name);
@@ -1222,7 +1222,7 @@ class story extends control
/* Get story and product. */
$story = $this->story->getById($storyID);
$products = $this->product->getPairs('', $this->session->program);
$products = $this->product->getPairs('', $this->session->PRJ);
/* Set menu. */
$this->product->setMenu($products, $story->product, $story->branch);
@@ -1266,7 +1266,7 @@ class story extends control
*/
public function track($productID)
{
$products = $this->loadModel('product')->getPairs('', $this->session->program);
$products = $this->loadModel('product')->getPairs('', $this->session->PRJ);
$productID = $this->product->saveState($productID, $products);
$this->product->setMenu($products, $productID, 0, 0, '');
$tracks = $this->story->getTracks($productID);
@@ -1337,7 +1337,7 @@ class story extends control
public function zeroCase($productID, $orderBy = 'id_desc')
{
$this->session->set('productList', $this->app->getURI(true));
$products = $this->loadModel('product')->getPairs('', $this->session->program);
$products = $this->loadModel('product')->getPairs('', $this->session->PRJ);
$this->lang->set('menugroup.story', 'qa');
$this->lang->story->menu = $this->lang->testcase->menu;
@@ -1391,7 +1391,7 @@ class story extends control
/* Get story, product, products, and queryID. */
$story = $this->story->getById($storyID);
$products = $this->product->getPairs('', $this->session->program);
$products = $this->product->getPairs('', $this->session->PRJ);
$queryID = 0;
/* Build search form. */
@@ -1618,7 +1618,7 @@ class story extends control
$this->view->datas[$chart] = $this->report->computePercent($chartData);
}
}
$this->products = $this->product->getPairs('', $this->session->program);
$this->products = $this->product->getPairs('', $this->session->PRJ);
$this->product->setMenu($this->products, $productID, $branchID);
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->story->reportChart;
@@ -1707,7 +1707,7 @@ class story extends control
/* Get users, products and projects. */
$users = $this->loadModel('user')->getPairs('noletter');
$products = $this->loadModel('product')->getPairs('nocode', $this->session->program);
$products = $this->loadModel('product')->getPairs('nocode', $this->session->PRJ);
/* Get related objects id lists. */
$relatedProductIdList = array();
+5 -5
View File
@@ -172,7 +172,7 @@ class storyModel extends model
->add('assignedDate', 0)
->add('version', 1)
->add('status', 'draft')
->setDefault('program', $this->session->program)
->setDefault('program', $this->session->PRJ)
->setDefault('plan,verify', '')
->setDefault('openedBy', $this->app->user->account)
->setDefault('openedDate', $now)
@@ -334,7 +334,7 @@ class storyModel extends model
$story->keywords = $stories->keywords[$i];
$story->sourceNote = $stories->sourceNote[$i];
$story->product = $productID;
$story->program = $this->session->program;
$story->program = $this->session->PRJ;
$story->openedBy = $this->app->user->account;
$story->openedDate = $now;
$story->version = 1;
@@ -1984,7 +1984,7 @@ class storyModel extends model
}
else
{
$products = $this->loadModel('product')->getPairs('', $this->session->program);
$products = $this->loadModel('product')->getPairs('', $this->session->PRJ);
}
$query = $queryID ? $this->loadModel('search')->getQuery($queryID) : '';
@@ -2577,7 +2577,7 @@ class storyModel extends model
->where($this->reportCondition())
->groupBy('product')->orderBy('value DESC')->fetchAll('name');
if(!$datas) return array();
$products = $this->loadModel('product')->getPairs('', $this->session->program);
$products = $this->loadModel('product')->getPairs('', $this->session->PRJ);
foreach($datas as $productID => $data) $data->name = isset($products[$productID]) ? $products[$productID] : $this->lang->report->undefined;
return $datas;
}
@@ -3476,7 +3476,7 @@ class storyModel extends model
{
$requirement = $this->getByID($id);
$data = new stdclass();
$data->program = $this->session->program;
$data->program = $this->session->PRJ;
$data->product = $this->session->product;
$data->AType = 'requirement';
$data->BType = 'story';
+11 -11
View File
@@ -46,7 +46,7 @@ class task extends control
die(js::locate($this->createLink('project', 'task', "projectID=$projectID")));
}
$program = $this->loadModel('project')->getByID($this->session->program);
$program = $this->loadModel('project')->getByID($this->session->PRJ);
if($program->template == 'waterfall') $this->config->task->create->requiredFields .= ',estStarted,deadline';
$task = new stdClass();
@@ -82,7 +82,7 @@ class task extends control
$storyLink = $this->session->storyList ? $this->session->storyList : $this->createLink('project', 'story', "projectID=$projectID");
/* Set menu. */
$this->project->setMenu($this->project->getPairs('', $this->session->program), $project->id);
$this->project->setMenu($this->project->getPairs('', $this->session->PRJ), $project->id);
if(!empty($_POST))
{
@@ -201,7 +201,7 @@ class task extends control
$this->view->title = $title;
$this->view->position = $position;
$this->view->project = $project;
$this->view->projects = $this->loadModel('project')->getPairs('', $this->session->program);
$this->view->projects = $this->loadModel('project')->getPairs('', $this->session->PRJ);
$this->view->task = $task;
$this->view->users = $users;
$this->view->stories = $stories;
@@ -232,7 +232,7 @@ class task extends control
die(js::locate($this->createLink('project', 'task', "projectID=$projectID")));
}
$program = $this->loadModel('project')->getByID($this->session->program);
$program = $this->loadModel('project')->getByID($this->session->PRJ);
if($program->template == 'waterfall') $this->config->task->create->requiredFields .= ',estStarted,deadline';
$project = $this->project->getById($projectID);
@@ -240,7 +240,7 @@ class task extends control
$storyLink = $this->session->storyList ? $this->session->storyList : $this->createLink('project', 'story', "projectID=$projectID");
/* Set menu. */
$this->project->setMenu($this->project->getPairs('', $this->session->program), $project->id);
$this->project->setMenu($this->project->getPairs('', $this->session->PRJ), $project->id);
if(!empty($_POST))
{
@@ -300,7 +300,7 @@ class task extends control
$this->view->actions = $this->loadModel('action')->getList('task', $taskID);
/* Set menu. */
$this->project->setMenu($this->project->getPairs('', $this->session->program), $this->view->project->id);
$this->project->setMenu($this->project->getPairs('', $this->session->PRJ), $this->view->project->id);
$this->view->position[] = html::a($this->createLink('project', 'browse', "project={$this->view->task->project}"), $this->view->project->name);
}
@@ -360,7 +360,7 @@ class task extends control
}
}
$noclosedProjects = $this->project->getPairs('noclosed,nocode', $this->session->program);
$noclosedProjects = $this->project->getPairs('noclosed,nocode', $this->session->PRJ);
unset($noclosedProjects[$this->view->project->id]);
$this->view->projects = array($this->view->project->id => $this->view->project->name) + $noclosedProjects;
$tasks = $this->task->getParentTaskPairs($this->view->project->id, $this->view->task->parent);
@@ -429,7 +429,7 @@ class task extends control
if($projectID)
{
$project = $this->project->getById($projectID);
$this->project->setMenu($this->project->getPairs('', $this->session->program), $project->id);
$this->project->setMenu($this->project->getPairs('', $this->session->PRJ), $project->id);
/* Set modules and members. */
$showAllModule = isset($this->config->project->task->allModule) ? $this->config->project->task->allModule : '';
@@ -635,7 +635,7 @@ class task extends control
/* Set menu. */
$project = $this->project->getById($task->project);
$this->project->setMenu($this->project->getPairs('', $this->session->program), $project->id);
$this->project->setMenu($this->project->getPairs('', $this->session->PRJ), $project->id);
$this->executeHooks($taskID);
@@ -1291,7 +1291,7 @@ class task extends control
}
}
$projects = $this->project->getPairs('', $this->session->program);
$projects = $this->project->getPairs('', $this->session->PRJ);
$this->project->setMenu($projects, $projectID);
$this->projects = $projects;
@@ -1369,7 +1369,7 @@ class task extends control
/* Get users and projects. */
$users = $this->loadModel('user')->getPairs('noletter');
$projects = $this->loadModel('project')->getPairs('all|nocode', $this->session->program);
$projects = $this->loadModel('project')->getPairs('all|nocode', $this->session->PRJ);
/* Get related objects id lists. */
$relatedStoryIdList = array();
+3 -3
View File
@@ -36,7 +36,7 @@ class taskModel extends model
->setDefault('project', $projectID)
->setDefault('estimate,left,story', 0)
->setDefault('status', 'wait')
->setDefault('program', $this->session->program)
->setDefault('program', $this->session->PRJ)
->setIF($this->post->estimate != false, 'left', $this->post->estimate)
->setIF($this->post->story != false, 'storyVersion', $this->loadModel('story')->getVersion($this->post->story))
->setDefault('estStarted', '0000-00-00')
@@ -300,7 +300,7 @@ class taskModel extends model
$data[$i]->pri = $tasks->pri[$i];
$data[$i]->estimate = $tasks->estimate[$i];
$data[$i]->left = $tasks->estimate[$i];
$data[$i]->program = $this->session->program;
$data[$i]->program = $this->session->PRJ;
$data[$i]->project = $projectID;
$data[$i]->estStarted = empty($tasks->estStarted[$i]) ? '0000-00-00' : $tasks->estStarted[$i];
$data[$i]->deadline = empty($tasks->deadline[$i]) ? '0000-00-00' : $tasks->deadline[$i];
@@ -2473,7 +2473,7 @@ class taskModel extends model
$children = $this->dao->select('id,parent,project')->from(TABLE_TASK)->where('parent')->in(array_keys($tasks))->fetchAll('id');
$datas = $this->processData4Report($tasks, $children, 'project');
$projects = $this->loadModel('project')->getPairs('all', $this->session->program);
$projects = $this->loadModel('project')->getPairs('all', $this->session->PRJ);
foreach($datas as $projectID => $data)
{
$data->name = isset($projects[$projectID]) ? $projects[$projectID] : $this->lang->report->undefined;
+2 -2
View File
@@ -25,7 +25,7 @@ class testcase extends control
$this->loadModel('product');
$this->loadModel('tree');
$this->loadModel('user');
$this->view->products = $this->products = $this->product->getPairs('nocode', $this->session->program);
$this->view->products = $this->products = $this->product->getPairs('nocode', $this->session->PRJ);
if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "fromModule=testcase")));
}
@@ -1173,7 +1173,7 @@ class testcase extends control
/* Get users, products and projects. */
$users = $this->loadModel('user')->getPairs('noletter');
$products = $this->loadModel('product')->getPairs('nocode', $this->session->program);
$products = $this->loadModel('product')->getPairs('nocode', $this->session->PRJ);
$branches = $this->loadModel('branch')->getPairs($productID);
/* Get related objects id lists. */
+2 -2
View File
@@ -133,7 +133,7 @@ class testcaseModel extends model
->add('status', $status)
->add('version', 1)
->add('fromBug', $bugID)
->add('program', $this->session->program)
->add('program', $this->session->PRJ)
->setDefault('openedBy', $this->app->user->account)
->setDefault('openedDate', $now)
->setIF($this->post->story != false, 'storyVersion', $this->loadModel('story')->getVersion((int)$this->post->story))
@@ -226,7 +226,7 @@ class testcaseModel extends model
$data[$i] = new stdclass();
$data[$i]->product = $productID;
$data[$i]->program = $this->session->program;
$data[$i]->program = $this->session->PRJ;
$data[$i]->branch = $cases->branch[$i];
$data[$i]->module = $cases->module[$i];
$data[$i]->type = $cases->type[$i];
+2 -2
View File
@@ -519,14 +519,14 @@ class testreport extends control
{
if($objectType == 'product')
{
$this->products = $this->product->getPairs('nocode', $this->session->program);
$this->products = $this->product->getPairs('nocode', $this->session->PRJ);
$productID = $this->product->saveState($objectID, $this->products);
$this->testreport->setMenu($this->products, $productID);
return $productID;
}
elseif($objectType == 'project')
{
$this->projects = $this->project->getPairs('nocode', $this->session->program);
$this->projects = $this->project->getPairs('nocode', $this->session->PRJ);
$projectID = $this->project->saveState($objectID, $this->projects);
$this->project->setMenu($this->projects, $projectID);
$this->lang->testreport->menu = $this->lang->project->menu;
+1 -1
View File
@@ -65,7 +65,7 @@ class testreportModel extends model
{
$data = fixer::input('post')
->stripTags($this->config->testreport->editor->create['id'], $this->config->allowedTags)
->add('program', $this->session->program)
->add('program', $this->session->PRJ)
->add('createdBy', $this->app->user->account)
->add('createdDate', helper::now())
->join('stories', ',')
+5 -5
View File
@@ -41,7 +41,7 @@ class testsuite extends control
$this->session->set('testsuiteList', $this->app->getURI(true));
/* Set menu. */
$this->view->products = $this->products = $this->loadModel('product')->getPairs('nocode', $this->session->program);
$this->view->products = $this->products = $this->loadModel('product')->getPairs('nocode', $this->session->PRJ);
$productID = $this->product->saveState($productID, $this->products);
$this->testsuite->setMenu($this->products, $productID);
@@ -96,7 +96,7 @@ class testsuite extends control
}
/* Set menu. */
$this->view->products = $this->products = $this->loadModel('product')->getPairs('nocode', $this->session->program);
$this->view->products = $this->products = $this->loadModel('product')->getPairs('nocode', $this->session->PRJ);
$productID = $this->product->saveState($productID, $this->products);
$this->testsuite->setMenu($this->products, $productID);
@@ -129,7 +129,7 @@ class testsuite extends control
if($suite->type == 'private' and $suite->addedBy != $this->app->user->account and !$this->app->user->admin) die(js::error($this->lang->error->accessDenied) . js::locate('back'));
$productID = $suite->product;
$this->view->products = $this->products = $this->loadModel('product')->getPairs('nocode', $this->session->program);
$this->view->products = $this->products = $this->loadModel('product')->getPairs('nocode', $this->session->PRJ);
$this->testsuite->setMenu($this->products, $productID);
/* Save session. */
@@ -198,7 +198,7 @@ class testsuite extends control
if($suite->type == 'private' and $suite->addedBy != $this->app->user->account and !$this->app->user->admin) die(js::error($this->lang->error->accessDenied) . js::locate('back'));
/* Get suite info. */
$this->view->products = $this->products = $this->loadModel('product')->getPairs('nocode', $this->session->program);
$this->view->products = $this->products = $this->loadModel('product')->getPairs('nocode', $this->session->PRJ);
$productID = $this->product->saveState($suite->product, $this->products);
/* Set menu. */
@@ -278,7 +278,7 @@ class testsuite extends control
$this->session->set('caseList', $this->app->getURI(true));
/* Get suite and product id. */
$this->view->products = $this->products = $this->loadModel('product')->getPairs('nocode', $this->session->program);
$this->view->products = $this->products = $this->loadModel('product')->getPairs('nocode', $this->session->PRJ);
$suite = $this->testsuite->getById($suiteID);
$productID = $this->product->saveState($suite->product, $this->products);
+1 -1
View File
@@ -111,7 +111,7 @@ class testsuiteModel extends model
{
$suite = fixer::input('post')
->stripTags($this->config->testsuite->editor->create['id'], $this->config->allowedTags)
->add('program', $this->session->program)
->add('program', $this->session->PRJ)
->add('product', (int)$productID)
->add('addedBy', $this->app->user->account)
->add('addedDate', helper::now())
+1 -1
View File
@@ -23,7 +23,7 @@ class testtask extends control
{
parent::__construct($moduleName, $methodName);
$this->loadModel('product');
$this->view->products = $this->products = $this->product->getPairs('nocode', $this->session->program);
$this->view->products = $this->products = $this->product->getPairs('nocode', $this->session->PRJ);
if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "fromModule=testtask")));
}
+1 -1
View File
@@ -159,7 +159,7 @@ class testtaskModel extends model
{
$task = fixer::input('post')
->setDefault('build', '')
->setDefault('program', $this->session->program)
->setDefault('program', $this->session->PRJ)
->stripTags($this->config->testtask->editor->create['id'], $this->config->allowedTags)
->join('mailto', ',')
->remove('uid,contactListMenu')
+2 -2
View File
@@ -376,8 +376,8 @@ class todo extends control
$this->view->users = $this->user->getPairs('noletter');
$this->view->actions = $this->loadModel('action')->getList('todo', $todoID);
$this->view->from = $from;
$this->view->projects = $this->loadModel('project')->getPairs('', $this->session->program);
$this->view->products = $this->loadModel('product')->getPairs('', $this->session->program);
$this->view->projects = $this->loadModel('project')->getPairs('', $this->session->PRJ);
$this->view->products = $this->loadModel('product')->getPairs('', $this->session->PRJ);
$this->display();
}
+6 -6
View File
@@ -61,7 +61,7 @@ class tree extends control
if($viewType == 'story')
{
$products = $this->product->getPairs('', $this->session->program);
$products = $this->product->getPairs('', $this->session->PRJ);
$this->lang->set('menugroup.tree', 'product');
$this->product->setMenu($products, $rootID, $branch, 'story', '', 'story');
@@ -81,7 +81,7 @@ class tree extends control
}
elseif($viewType == 'bug')
{
$this->loadModel('bug')->setMenu($this->product->getPairs('', $this->session->program), $rootID);
$this->loadModel('bug')->setMenu($this->product->getPairs('', $this->session->PRJ), $rootID);
$this->lang->tree->menu = $this->lang->bug->menu;
$this->lang->tree->menuOrder = $this->lang->bug->menuOrder;
$this->lang->set('menugroup.tree', 'qa');
@@ -104,7 +104,7 @@ class tree extends control
}
elseif($viewType == 'case')
{
$this->loadModel('testcase')->setMenu($this->product->getPairs('', $this->session->program), $rootID);
$this->loadModel('testcase')->setMenu($this->product->getPairs('', $this->session->PRJ), $rootID);
$this->lang->tree->menu = $this->lang->testcase->menu;
$this->lang->tree->menuOrder = $this->lang->testcase->menuOrder;
$this->lang->set('menugroup.tree', 'qa');
@@ -138,7 +138,7 @@ class tree extends control
}
elseif($viewType == 'line')
{
$products = $this->product->getPairs('', $this->session->program);
$products = $this->product->getPairs('', $this->session->PRJ);
$this->lang->set('menugroup.tree', 'product');
$this->product->setMenu($products, $rootID, $branch, 'line', '', 'line');
@@ -212,7 +212,7 @@ class tree extends control
$products = $this->project->getProducts($rootID);
$this->view->products = $products;
$projects = $this->project->getPairs('', $this->session->program);
$projects = $this->project->getPairs('', $this->session->PRJ);
$this->lang->set('menugroup.tree', 'project');
$this->project->setMenu($projects, $rootID);
$this->lang->tree->menu = $this->lang->project->menu;
@@ -288,7 +288,7 @@ class tree extends control
$product = $this->loadModel('product')->getById($module->root);
if($product->type != 'normal') $this->view->branches = $this->loadModel('branch')->getPairs($module->root);
$this->view->product = $product;
$this->view->products = $this->product->getPairs('', $this->session->program);
$this->view->products = $this->product->getPairs('', $this->session->PRJ);
}
/* Remove self and childs from the $optionMenu. Because it's parent can't be self or childs. */
+6 -6
View File
@@ -192,10 +192,10 @@ class upgrade extends control
if(isset($_POST['newProgram']) or !isset($_POST['programs']))
{
if(empty($_POST['pgmAdmins'])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->pgmAdmin)));
if(empty($_POST['PRJadmins'])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->PRJadmin)));
/* Create Program. */
$programID = $this->upgrade->createProgram($linkedProducts, $linkedProjects, $this->post->pgmAdmins);
$programID = $this->upgrade->createProgram($linkedProducts, $linkedProjects, $this->post->PRJadmins);
if(dao::isError()) die(js::error(dao::getError()));
}
else
@@ -237,10 +237,10 @@ class upgrade extends control
if(isset($_POST['newProgram']) or !isset($_POST['programs']))
{
if(empty($_POST['pgmAdmins'])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->pgmAdmin)));
if(empty($_POST['PRJadmins'])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->PRJadmin)));
/* Create Program. */
$programID = $this->upgrade->createProgram($linkedProducts, $linkedProjects, $this->post->pgmAdmins);
$programID = $this->upgrade->createProgram($linkedProducts, $linkedProjects, $this->post->PRJadmins);
if(dao::isError()) die(js::error(dao::getError()));
}
else
@@ -264,10 +264,10 @@ class upgrade extends control
$linkedProjects = $this->post->projects;
if(isset($_POST['newProgram']) or !isset($_POST['programs']))
{
if(empty($_POST['pgmAdmins'])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->pgmAdmin)));
if(empty($_POST['PRJadmins'])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->PRJadmin)));
/* Create Program. */
$programID = $this->upgrade->createProgram(array(), $linkedProjects, $this->post->pgmAdmins);
$programID = $this->upgrade->createProgram(array(), $linkedProjects, $this->post->PRJadmins);
if(dao::isError()) die(js::error(dao::getError()));
}
else
+1 -1
View File
@@ -77,7 +77,7 @@ EOD;
$lang->upgrade->line = '产品线';
$lang->upgrade->program = '归并项目';
$lang->upgrade->existPGM = '已有项目';
$lang->upgrade->pgmAdmin = '项目管理员';
$lang->upgrade->PRJadmin = '项目管理员';
$lang->upgrade->product = $lang->productCommon;
$lang->upgrade->project = $lang->projectCommon;
+9 -9
View File
@@ -3851,7 +3851,7 @@ class upgradeModel extends model
* @access public
* @return int
*/
public function createProgram($productIdList = array(), $projectIdList = array(), $pgmAdmins = '')
public function createProgram($productIdList = array(), $projectIdList = array(), $PRJadmins = '')
{
$data = fixer::input('post')->get();
$program = new stdclass();
@@ -3892,18 +3892,18 @@ class upgradeModel extends model
$programID = $this->dao->lastInsertId();
$this->dao->update(TABLE_PROJECT)->set('grade')->eq(1)->set('path')->eq(",{$programID},")->where('id')->eq($programID)->exec();
if($pgmAdmins)
if($PRJadmins)
{
$groupID = $this->dao->select('id')->from(TABLE_GROUP)->where('role')->eq('pgmadmin')->fetch('id');
$groupID = $this->dao->select('id')->from(TABLE_GROUP)->where('role')->eq('PRJadmin')->fetch('id');
if($groupID)
{
foreach($pgmAdmins as $pgmAdmin)
foreach($PRJadmins as $PRJadmin)
{
$userGroup = $this->dao->select('*')->from(TABLE_USERGROUP)->where('account')->eq($pgmAdmin)->andWhere('`group`')->eq($groupID)->fetch();
$userGroup = $this->dao->select('*')->from(TABLE_USERGROUP)->where('account')->eq($PRJadmin)->andWhere('`group`')->eq($groupID)->fetch();
if(empty($userGroup))
{
$userGroup = new stdclass();
$userGroup->account = $pgmAdmin;
$userGroup->account = $PRJadmin;
$userGroup->group = $groupID;
$userGroup->program = '';
}
@@ -4058,7 +4058,7 @@ class upgradeModel extends model
*/
public function setDefaultPriv()
{
$groups = $this->dao->select('id')->from(TABLE_GROUP)->where('role')->ne('limited')->andWhere('role')->ne('pgmadmin')->fetchPairs();
$groups = $this->dao->select('id')->from(TABLE_GROUP)->where('role')->ne('limited')->andWhere('role')->ne('PRJadmin')->fetchPairs();
foreach($groups as $groupID)
{
$data = new stdclass();
@@ -4071,11 +4071,11 @@ class upgradeModel extends model
$this->dao->replace(TABLE_GROUPPRIV)->data($data)->exec();
}
$pgmAdminGroupID = $this->dao->select('id')->from(TABLE_GROUP)->where('role')->eq('pgmadmin')->fetch('id');
$PRJadminGroupID = $this->dao->select('id')->from(TABLE_GROUP)->where('role')->eq('PRJadmin')->fetch('id');
foreach($this->lang->resource->program as $method => $methodLang)
{
$data = new stdclass();
$data->group = $pgmAdminGroupID;
$data->group = $PRJadminGroupID;
$data->module = 'program';
$data->method = $method;
$this->dao->replace(TABLE_GROUPPRIV)->data($data)->exec();
+2 -2
View File
@@ -25,8 +25,8 @@
<td class='required'><?php echo html::input("code", '', "class='form-control'");?></td>
</tr>
<tr class='pgmParams'>
<th><?php echo $lang->upgrade->pgmAdmin;?></th>
<td class='required'><?php echo html::select('pgmAdmins[]', $users, '', "class='form-control chosen' multiple");?></td>
<th><?php echo $lang->upgrade->PRJadmin;?></th>
<td class='required'><?php echo html::select('PRJadmins[]', $users, '', "class='form-control chosen' multiple");?></td>
</tr>
<tr class='pgmParams'>
<th><?php echo $lang->program->PM;?></th>
+8 -14
View File
@@ -823,7 +823,7 @@ class userModel extends model
$groups = $this->dao->select('t1.acl, t1.program')->from(TABLE_GROUP)->alias('t1')
->leftJoin(TABLE_USERGROUP)->alias('t2')->on('t1.id=t2.group')
->where('t2.account')->eq($account)
->andWhere('t1.role')->ne('pgmadmin')
->andWhere('t1.role')->ne('PRJadmin')
->andWhere('t1.role')->ne('limited')
->fetchAll();
$acls = array();
@@ -901,8 +901,8 @@ class userModel extends model
}
/* Get can manage programs by user. */
$pgmAdminGroupID = $this->dao->select('id')->from(TABLE_GROUP)->where('role')->eq('pgmadmin')->fetch('id');
$canManagePrograms = $this->dao->select('program')->from(TABLE_USERGROUP)->where('`group`')->eq($pgmAdminGroupID)->andWhere('account')->eq($account)->fetch('program');
$PRJadminGroupID = $this->dao->select('id')->from(TABLE_GROUP)->where('role')->eq('PRJadmin')->fetch('id');
$canManagePrograms = $this->dao->select('program')->from(TABLE_USERGROUP)->where('`group`')->eq($PRJadminGroupID)->andWhere('account')->eq($account)->fetch('program');
return array('rights' => $rights, 'acls' => $acls, 'programs' => $canManagePrograms);
}
@@ -955,10 +955,9 @@ class userModel extends model
{
$projects = $this->dao->select('t1.*,t2.*')->from(TABLE_TEAM)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.root = t2.id')
->where('t1.type')->eq('project')
->where('t1.type')->in('sprint,stage,kanban')
->andWhere('t1.account')->eq($account)
->andWhere('t2.deleted')->eq(0)
->andWhere('t2.program')->ne(0)
->orderBy('t2.id_desc')
->fetchAll();
@@ -1371,7 +1370,7 @@ class userModel extends model
$groups = ',' . join(',', $groups) . ',';
static $allProducts, $allPrograms, $allProjects, $projectProducts, $teams;
if($allPrograms === null) $allPrograms = $this->dao->select('id,PO,PM,QD,RD,acl,whitelist')->from(TABLE_PROJECT)->where('template')->ne('')->andWhere('program')->eq(0)->fetchAll('id');
if($allPrograms === null) $allPrograms = $this->dao->select('id,PO,PM,QD,RD,acl,whitelist')->from(TABLE_PROJECT)->where('type')->eq('project')->fetchAll('id');
if($teams === null)
{
$stmt = $this->dao->select('root,account')->from(TABLE_TEAM)->where('type')->eq('project')->query();
@@ -1397,7 +1396,7 @@ class userModel extends model
}
$allProducts = $this->dao->select('id,PO,QD,RD,createdBy,acl,whitelist')->from(TABLE_PRODUCT)->where('program')->in($programs)->fetchAll('id');
$allProjects = $this->dao->select('id,PO,PM,QD,RD,acl,whitelist')->from(TABLE_PROJECT)->where('program')->in($programs)->fetchAll('id');
$allProjects = $this->dao->select('id,PO,PM,QD,RD,acl,whitelist')->from(TABLE_PROJECT)->where('parent')->in($programs)->fetchAll('id');
if($projectProducts === null)
{
$stmt = $this->dao->select('project,product')->from(TABLE_PROJECTPRODUCT)->query();
@@ -1457,8 +1456,7 @@ class userModel extends model
$openedPrograms = $this->dao->select('id')->from(TABLE_PROJECT)
->where('acl')->eq('open')
->andWhere('program')->eq(0)
->andWhere('template')->ne('')
->andWhere('type')->eq('project')
->fetchAll('id');
$openedPrograms = join(',', array_keys($openedPrograms));
@@ -1480,11 +1478,7 @@ class userModel extends model
$programIds = explode(',', $userView->programs);
$openedProducts = $this->dao->select('id')->from(TABLE_PRODUCT)->where('acl')->eq('open')->andWhere('program')->in($programIds)->fetchAll('id');
$openedProjects = $this->dao->select('id')->from(TABLE_PROJECT)
->where('acl')->eq('open')
->andWhere('program')->in($programIds)
->andWhere('template')->eq('')
->fetchAll('id');
$openedProjects = $this->dao->select('id')->from(TABLE_PROJECT)->where('acl')->eq('open')->andWhere('parent')->in($programIds)->fetchAll('id');
$openedProducts = join(',', array_keys($openedProducts));
$openedProjects = join(',', array_keys($openedProjects));
+1 -1
View File
@@ -34,7 +34,7 @@ class weekly extends control
*/
public function index($program = 0, $date = '')
{
$program = $program ? $program : $this->session->program;
$program = $program ? $program : $this->session->PRJ;
if(!$date) $date = helper::today();
$date = date('Y-m-d', strtotime($date));
+1 -1
View File
@@ -20,7 +20,7 @@ class workestimation extends control
*/
public function index($program = 0)
{
$program = $program ? $program : $this->session->program;
$program = $program ? $program : $this->session->PRJ;
if($_POST)
{
$result = $this->workestimation->save($program);
+3
View File
@@ -46,3 +46,6 @@ a.showMoreImage:hover {opacity: 1;}
.margin-l-50px{margin-left:50px;}
#menu{width: 96px}
#menuNav>.nav>li>span{padding: 8px; line-height: 20px; cursor: pointer; color: #fff;}
#morePRJ{display:none; max-height: 420px; position: fixed; bottom: 0; left: 100px; z-index: 999; background: white; padding: 20px 10px; height: 420px; margin-bottom: 35px;}
#morePRJ .list-group{height: 400px; min-width: 150px; max-width:200px;}
+2 -2
View File
@@ -1,9 +1,9 @@
title: date
title: moreDate
desc: 系统可用日期类型
author: ly
version: 1.0
field: date
field: moreDate
instances:
- instance: dateA
fields:
+74
View File
@@ -0,0 +1,74 @@
<?php
$dbms = 'mysql'; // 数据库类型。
$host = 'localhost'; // 数据库主机名。
$port = '3306'; // 数据库主机端口。
$dbName = 'zdata'; // 使用的数据库。
$user = 'root'; // 数据库连接用户名。
$password = 'root'; // 对应的密码。
$dsn = "$dbms:host=$host:$port;dbname=$dbName";
$dirPath = 'demo/story'; // 要生成SQL数据的zdata文件路径。
/* 定义每个yaml文件生成SQL数量。 */
$zdataCount = array();
$zdataCount['zt_product'] = 100;
$zdataCount['zt_productplan'] = 500;
$zdataCount['zt_project'] = 100;
$zdataCount['zt_module'] = 1000;
$zdataCount['zt_story'] = 10000;
$zdataCount['zt_storyspec'] = 10000;
$zdataCount['zt_action'] = 10000;
$zdataExec = "zd -c $dirPath/%s -d %s -n %s -o $dirPath/sql/%s.sql -table %s";
set_time_limit(0);
try
{
$dbh = new PDO($dsn, $user, $password); // 初始化一个PDO对象。
echo $dbms . '连接成功' . PHP_EOL;
$yamlFilePath = scandir($dirPath);
foreach($yamlFilePath as $file)
{
if(strpos($file, '.yaml'))
{
$fileName = basename($file, '.yaml');
$count = isset($zdataCount[$fileName]) ? $zdataCount[$fileName] : 10;
$execYaml = sprintf($zdataExec, $file, $file, $count, $fileName, $fileName);
exec($execYaml); // 执行zdata命令调用yaml文件生成SQL数据。
echo '执行命令:' . $execYaml . PHP_EOL;
}
}
/* 读取生成的SQL文件,导入数据到数据库。*/
$sqlDir = $dirPath . '/sql/';
$sqlFilePath = scandir($sqlDir);
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // 设置报错处理方式。
$dbh->exec("SET GLOBAL sql_mode = '';");
$dbh->beginTransaction();
foreach($sqlFilePath as $file)
{
if(strpos($file, '.sql'))
{
$tableName = basename($file, '.sql');
$truncate = 'truncate table ' . $tableName;
$dbh->exec($truncate);
$sql = file_get_contents($sqlDir . $file);
$count = $dbh->exec($sql);
echo $tableName . '表影响行数:' . $count . PHP_EOL;
}
}
$dbh->commit();
$dbh = null; // 关闭连接。
}
catch (PDOException $e)
{
die('Error!: ' . $e->getMessage() . PHP_EOL);
}
+4 -4
View File
@@ -1,14 +1,14 @@
title: date
title: moreDate
desc: 系统可用日期类型
author: ly
version: 1.0
field: date
field: moreDate
instances:
- instance: dateA
fields:
- field: year
range: 2019-2020
range: 2019-2022
postfix: "-"
- field: month
range: 1-12
@@ -33,7 +33,7 @@ instances:
- instance: dateB
fields:
- field: year
range: 2019-2020
range: 2019-2022
postfix: "-"
- field: month
range: 1-12
+4 -11
View File
@@ -20,15 +20,15 @@ fields:
- field: product
note: "产品"
range: 1-100
prefix: ""
postfix: ""
prefix: ","
postfix: ","
loop: 0
format: ""
- field: project
note: "项目"
range: 1-100
prefix: ","
postfix: ","
prefix: ""
postfix: ""
loop: 0
format: ""
- field: actor
@@ -44,13 +44,6 @@ fields:
postfix: ""
loop: 0
format: ""
- field: date
note: "日期"
range: 10-22
prefix: "2020-09-09 "
postfix: ":11:24"
loop: 0
format: ""
- field: comment
note: "备注"
range: "1-10000"
View File

Some files were not shown because too many files have changed in this diff Show More