Merge branch '20.x' of https://github.com/easysoft/zentaopms into 20.x
This commit is contained in:
+2
-2
@@ -131,8 +131,8 @@ $filter->product->default->cookie['preProductID'] = 'int';
|
||||
$filter->product->index->cookie['preBranch'] = 'int';
|
||||
$filter->product->export->cookie['checkedItem'] = 'reg::checked';
|
||||
|
||||
$filter->program->index->cookie['programType'] = 'code';
|
||||
$filter->program->index->cookie['mine'] = 'code';
|
||||
$filter->program->browse->cookie['programType'] = 'code';
|
||||
$filter->program->browse->cookie['mine'] = 'code';
|
||||
$filter->program->export->cookie['checkedItem'] = 'reg::checked';
|
||||
|
||||
$filter->project->default->cookie['lastProject'] = 'int';
|
||||
|
||||
+19
-24
@@ -27,47 +27,41 @@ $config->duplicateTime = 60;
|
||||
|
||||
/* Product common list. */
|
||||
$config->productCommonList['zh-cn'][0] = '产品';
|
||||
$config->productCommonList['zh-cn'][1] = '项目';
|
||||
|
||||
$config->productCommonList['zh-tw'][0] = '產品';
|
||||
$config->productCommonList['zh-tw'][1] = '項目';
|
||||
|
||||
$config->productCommonList['en'][0] = 'Product';
|
||||
$config->productCommonList['en'][1] = 'Project';
|
||||
|
||||
$config->productCommonList['de'][0] = 'Produkt';
|
||||
$config->productCommonList['de'][1] = 'Projekt';
|
||||
|
||||
$config->productCommonList['fr'][0] = 'Product';
|
||||
$config->productCommonList['fr'][1] = 'Projet';
|
||||
|
||||
$config->productCommonList['vi'][0] = 'Sản phẩm';
|
||||
$config->productCommonList['vi'][1] = 'Dự án';
|
||||
|
||||
/* Project common list. */
|
||||
$config->projectCommonList['zh-cn'][0] = '项目';
|
||||
$config->projectCommonList['zh-cn'][1] = '迭代';
|
||||
$config->projectCommonList['zh-cn'][2] = '冲刺';
|
||||
$config->projectCommonList['zh-cn'][0] = '迭代';
|
||||
$config->projectCommonList['zh-cn'][1] = '冲刺';
|
||||
$config->projectCommonList['zh-cn'][2] = '阶段';
|
||||
|
||||
$config->projectCommonList['zh-tw'][0] = '項目';
|
||||
$config->projectCommonList['zh-tw'][1] = '迭代';
|
||||
$config->projectCommonList['zh-tw'][2] = '冲刺';
|
||||
$config->projectCommonList['zh-tw'][0] = '迭代';
|
||||
$config->projectCommonList['zh-tw'][1] = '冲刺';
|
||||
$config->projectCommonList['zh-tw'][2] = '階段';
|
||||
|
||||
$config->projectCommonList['en'][0] = 'Project';
|
||||
$config->projectCommonList['en'][1] = 'Iteration';
|
||||
$config->projectCommonList['en'][2] = 'Sprint';
|
||||
$config->projectCommonList['en'][0] = 'Iteration';
|
||||
$config->projectCommonList['en'][1] = 'Sprint';
|
||||
$config->projectCommonList['en'][2] = 'Stage';
|
||||
|
||||
$config->projectCommonList['de'][0] = 'Projekt';
|
||||
$config->projectCommonList['de'][1] = 'Iteration';
|
||||
$config->projectCommonList['de'][2] = 'Sprint';
|
||||
$config->projectCommonList['de'][0] = 'Iteration';
|
||||
$config->projectCommonList['de'][1] = 'Sprint';
|
||||
$config->projectCommonList['de'][2] = 'Bühne';
|
||||
|
||||
$config->projectCommonList['fr'][0] = 'Projet';
|
||||
$config->projectCommonList['fr'][1] = 'Iteration';
|
||||
$config->projectCommonList['fr'][2] = 'Sprint';
|
||||
$config->projectCommonList['fr'][0] = 'Iteration';
|
||||
$config->projectCommonList['fr'][1] = 'Sprint';
|
||||
$config->projectCommonList['fr'][2] = 'Phase';
|
||||
|
||||
$config->projectCommonList['vi'][0] = 'Dự án';
|
||||
$config->projectCommonList['vi'][1] = 'Lặp lại';
|
||||
$config->projectCommonList['vi'][2] = 'Sprint';
|
||||
$config->projectCommonList['vi'][0] = 'Lặp lại';
|
||||
$config->projectCommonList['vi'][1] = 'Sprint';
|
||||
$config->projectCommonList['vi'][2] = 'Giai đoạn';
|
||||
|
||||
/* Story common list. */
|
||||
$config->storyCommonList['zh-cn'][0] = '需求';
|
||||
@@ -203,6 +197,7 @@ if(!defined('TABLE_PROJECTSPEC')) define('TABLE_PROJECTSPEC', '`' . $conf
|
||||
if(!defined('TABLE_WORKESTIMATION')) define('TABLE_WORKESTIMATION', '`' . $config->db->prefix . 'workestimation`');
|
||||
if(!defined('TABLE_DURATIONESTIMATION')) define('TABLE_DURATIONESTIMATION', '`' . $config->db->prefix . 'durationestimation`');
|
||||
if(!defined('TABLE_BUDGET')) define('TABLE_BUDGET', '`' . $config->db->prefix . 'budget`');
|
||||
if(!defined('TABLE_HOLIDAY')) define('TABLE_HOLIDAY', '`' . $config->db->prefix . 'holiday`');
|
||||
|
||||
$config->objectTables['product'] = TABLE_PRODUCT;
|
||||
$config->objectTables['story'] = TABLE_STORY;
|
||||
|
||||
+55
-12
@@ -97,30 +97,38 @@ CREATE TABLE `zt_designspec` (
|
||||
|
||||
-- DROP TABLE IF EXISTS `zt_issue`;
|
||||
CREATE TABLE `zt_issue` (
|
||||
`id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`id` mediumint(8) UNSIGNED NOT NULL,
|
||||
`resolvedBy` varchar(30) NOT NULL,
|
||||
`program` varchar(255) NOT NULL,
|
||||
`product` varchar(255) NOT NULL,
|
||||
`commit` varchar(30) NOT NULL,
|
||||
`project` mediumint(9) NOT NULL DEFAULT '0',
|
||||
`name` varchar(255) NOT NULL,
|
||||
`parent` mediumint(8) unsigned NOT NULL,
|
||||
`title` varchar(255) NOT NULL,
|
||||
`desc` text NOT NULL,
|
||||
`pri` char(30) NOT NULL,
|
||||
`severity` char(30) NOT NULL,
|
||||
`type` char(30) NOT NULL,
|
||||
`activity` varchar(255) NOT NULL,
|
||||
`effectedArea` varchar(255) NOT NULL,
|
||||
`deadline` date NOT NULL,
|
||||
`resolution` char(30) NOT NULL,
|
||||
`resolutionComment` text NOT NULL,
|
||||
`objectID` varchar(255) NOT NULL,
|
||||
`resolvedDate` date NOT NULL,
|
||||
`status` varchar(30) NOT NULL,
|
||||
`subStatus` varchar(30) NOT NULL,
|
||||
`owner` varchar(255) NOT NULL,
|
||||
`createdBy` varchar(30) NOT NULL,
|
||||
`createdDate` datetime NOT NULL,
|
||||
`editedBy` varchar(30) NOT NULL,
|
||||
`editedDate` datetime NOT NULL,
|
||||
`activateBy` varchar(30) NOT NULL,
|
||||
`activateDate` date NOT NULL,
|
||||
`closeBy` varchar(30) NOT NULL,
|
||||
`closedDate` date NOT NULL,
|
||||
`commitBy` varchar(30) NOT NULL,
|
||||
`commitDate` datetime NOT NULL,
|
||||
`assignedTo` varchar(30) NOT NULL,
|
||||
`assignedBy` varchar(30) NOT NULL,
|
||||
`assignedDate` datetime NOT NULL,
|
||||
`deleted` enum('0','1') NOT NULL DEFAULT '0',
|
||||
`story` char(30) NOT NULL,
|
||||
`desc` text NOT NULL,
|
||||
`version` smallint(6) NOT NULL,
|
||||
`type` char(30) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE `zt_risk` (
|
||||
@@ -226,3 +234,38 @@ CREATE TABLE `zt_workestimation` (
|
||||
`dayHour` float(5,2) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `zt_holiday` (
|
||||
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(30) NOT NULL DEFAULT '',
|
||||
`type` enum('holiday', 'working') NOT NULL DEFAULT 'holiday',
|
||||
`desc` text NOT NULL,
|
||||
`year` char(4) NOT NULL,
|
||||
`begin` date NOT NULL,
|
||||
`end` date NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `year` (`year`),
|
||||
KEY `name` (`name`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
ALTER TABLE `zt_task`
|
||||
ADD `design` mediumint(8) unsigned NOT NULL AFTER `story`,
|
||||
ADD `version` smallint(6) NOT NULL AFTER `desc`,
|
||||
ADD `activatedDate` date NOT NULL AFTER `lastEditedDate`,
|
||||
ADD `planDuration` int(11) NOT NULL AFTER `closedDate`,
|
||||
ADD `realDuration` int(11) NOT NULL AFTER `closedDate`,
|
||||
ADD `designVersion` smallint(6) unsigned NOT NULL AFTER `storyVersion`;
|
||||
|
||||
ALTER TABLE `zt_burn`
|
||||
ADD `storyPoint` float NOT NULL AFTER `consumed`,
|
||||
ADD `product` mediumint(8) unsigned NOT NULL DEFAULT '0' AFTER `project`;
|
||||
|
||||
-- DROP TABLE IF EXISTS `zt_taskspec`;
|
||||
CREATE TABLE `zt_taskspec` (
|
||||
`task` mediumint(8) NOT NULL,
|
||||
`version` smallint(6) NOT NULL,
|
||||
`name` varchar(255) NOT NULL,
|
||||
`estStarted` date NOT NULL,
|
||||
`deadline` date NOT NULL,
|
||||
UNIQUE KEY `task` (`task`,`version`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
@@ -137,6 +137,12 @@ class router extends baseRouter
|
||||
if($setting->key == 'urAndSr') $config->urAndSr = $setting->value;
|
||||
}
|
||||
|
||||
if($this->session->program)
|
||||
{
|
||||
$template = $this->dbh->query('SELECT template FROM' . TABLE_PROJECT . "WHERE id = {$this->session->program}")->fetch();
|
||||
if($template->template == 'cmmi') $projectCommon = 2;
|
||||
}
|
||||
|
||||
$config->storyCommon = $storyCommon;
|
||||
|
||||
/* Set productCommon, projectCommon, storyCommon and hourCommon. Default english lang. */
|
||||
|
||||
@@ -120,7 +120,7 @@ $lang->common->common = '公有模块';
|
||||
/* 主导航菜单。*/
|
||||
$lang->mainNav = new stdclass();
|
||||
$lang->mainNav->my = '<i class="icon icon-menu-my"></i> 地盘|my|index|';
|
||||
$lang->mainNav->program = '<i class="icon icon-menu-project"></i> 项目|program|index|';
|
||||
$lang->mainNav->program = '<i class="icon icon-menu-project"></i> 项目|program|browse|';
|
||||
//$lang->mainNav->reporting = '<i class="icon icon-menu-report"></i> 报表|report|index|';
|
||||
//$lang->mainNav->attend = '<i class="icon icon-file"></i> 办公|attend|personal|';
|
||||
$lang->mainNav->system = '<i class="icon icon-menu-users"></i> 组织|custom|estimate|';
|
||||
@@ -132,9 +132,9 @@ $lang->dividerMenu = ',admin,';
|
||||
|
||||
/* Scrum menu. */
|
||||
$lang->menu = new stdclass();
|
||||
//$lang->menu->program = '主页|program|index';
|
||||
$lang->menu->program = '仪表盘|program|index|';
|
||||
$lang->menu->product = $lang->productCommon . '|product|index|locate=no';
|
||||
$lang->menu->project = '迭代|project|index|locate=no';
|
||||
$lang->menu->project = "$lang->projectCommon|project|index|locate=no";
|
||||
$lang->menu->doc = '文档|doc|index|';
|
||||
$lang->menu->qa = '测试|qa|index';
|
||||
$lang->menu->company = new stdclass();
|
||||
@@ -146,7 +146,7 @@ $lang->system = new stdclass();
|
||||
$lang->system->menu = new stdclass();
|
||||
$lang->system->subMenu = new stdclass();
|
||||
$lang->system->subMenu->setmodel = new stdclass();
|
||||
//$lang->system->menu->setmodel = array('link' => 'cmmi|custom|setcmmi|', 'class' => 'dropdown dropdown-hover');
|
||||
$lang->system->menu->setmodel = array('link' => 'cmmi|custom|setcmmi|', 'class' => 'dropdown dropdown-hover');
|
||||
$lang->system->menu->estimate = array('link' => '估算|custom|estimate|');
|
||||
$lang->system->menu->stage = array('link' => '阶段|stage|browse|', 'subModule' => 'stage');
|
||||
$lang->system->menu->measurement = array('link' => '度量|measurement|settips|', 'subModule' => 'sqlbuilder,measurement,report');
|
||||
@@ -160,19 +160,19 @@ $lang->system->menu->custom = array('link' => '自定义|custom|plan|');
|
||||
$lang->system->subMenu->setmodel->scrum ='scrum|custom|setscrum|';
|
||||
$lang->system->dividerMenu = ',auditcl,subject,';
|
||||
|
||||
//if($this->cookie->systemModel == 'scrum')
|
||||
//{
|
||||
// $lang->system->menu = new stdclass();
|
||||
// $lang->system->subMenu->setmodel = new stdclass();
|
||||
// $lang->system->menu->setmodel = array('link' => 'scrum|custom|setscrum|', 'class' => 'dropdown dropdown-hover');
|
||||
// $lang->system->menu->subject = array('link' => '科目|subject|browse|');
|
||||
// $lang->system->menu->measurement = array('link' => '度量|measurement|settips|', 'subModule' => 'sqlbuilder,measurement');
|
||||
// $lang->system->menu->holiday = array('link' => '节假日|holiday|browse|');
|
||||
//
|
||||
// $lang->system->subMenu->setmodel->cmmi ='cmmi|custom|setcmmi|';
|
||||
// $lang->mainNav->system = '<i class="icon icon-menu-users"></i> 组织|measurement|settips|';
|
||||
// unset($lang->system->dividerMenu);
|
||||
//}
|
||||
if($this->cookie->systemModel == 'scrum')
|
||||
{
|
||||
$lang->system->menu = new stdclass();
|
||||
$lang->system->subMenu->setmodel = new stdclass();
|
||||
$lang->system->menu->setmodel = array('link' => 'scrum|custom|setscrum|', 'class' => 'dropdown dropdown-hover');
|
||||
$lang->system->menu->subject = array('link' => '科目|subject|browse|');
|
||||
$lang->system->menu->holiday = array('link' => '节假日|holiday|browse|');
|
||||
$lang->system->menu->custom = array('link' => '自定义|custom|concept|');
|
||||
|
||||
$lang->system->subMenu->setmodel->cmmi ='cmmi|custom|setcmmi|';
|
||||
$lang->mainNav->system = '<i class="icon icon-menu-users"></i> 组织|subject|browse|';
|
||||
unset($lang->system->dividerMenu);
|
||||
}
|
||||
|
||||
$lang->stage = new stdclass();
|
||||
$lang->stage->menu = new stdclass();
|
||||
@@ -1104,6 +1104,7 @@ if(isset($config->global->flow) and $config->global->flow == 'onlyTest')
|
||||
|
||||
/* Cmmi menu. */
|
||||
$lang->menu->cmmi = new stdclass();
|
||||
$lang->menu->cmmi->programindex = array('link' => '仪表盘|program|index|program={PROGRAM}');
|
||||
$lang->menu->cmmi->programplan = array('link' => '计划|programplan|browse|program={PROGRAM}', 'subModule' => 'programplan');
|
||||
$lang->menu->cmmi->project = array('link' => $lang->projectCommon . '|project|task|projectID={PROJECT}', 'subModule' => ',project,task,');
|
||||
$lang->menu->cmmi->weekly = array('link' => '报告|weekly|index|program={PROGRAM}', 'subModule' => ',milestone,');
|
||||
|
||||
@@ -532,7 +532,7 @@ class commonModel extends model
|
||||
global $app, $lang, $config;
|
||||
|
||||
/* If program, return.*/
|
||||
if($moduleName == 'program') return;
|
||||
if($moduleName == 'program' and $methodName != 'index') return;
|
||||
|
||||
/* Set the main main menu. */
|
||||
$mainMenu = $moduleName;
|
||||
|
||||
@@ -383,6 +383,85 @@ class custom extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Display plan or not.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function plan()
|
||||
{
|
||||
$this->lang->custom->menu = new stdclass();
|
||||
$this->lang->navGroup->custom = 'system';
|
||||
|
||||
if(strtolower($this->server->request_method) == "post")
|
||||
{
|
||||
$data = fixer::input('post')->get();
|
||||
$this->loadModel('setting')->setItem('system.custom.planStatus', $data->planStatus);
|
||||
|
||||
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('custom', 'plan')));
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->custom->common . $this->lang->colon . $this->lang->custom->plan;
|
||||
$this->view->position[] = $this->lang->custom->common;
|
||||
$this->view->position[] = $this->lang->custom->plan;
|
||||
$this->view->status = zget($this->config->custom, 'planStatus', 0);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* QC concept.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function concept()
|
||||
{
|
||||
$this->lang->custom->menu = new stdclass();
|
||||
$this->lang->navGroup->custom = 'system';
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
$this->custom->setConcept();
|
||||
|
||||
$this->app->loadLang('common');
|
||||
$locate = inlink('concept');
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locate));
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->custom->concept;
|
||||
$this->view->position[] = $this->lang->custom->concept;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set cmmi model.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setcmmi()
|
||||
{
|
||||
setCookie("systemModel", 'cmmi', $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
|
||||
die(js::locate($this->createLink('custom', 'estimate')));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set scrum model.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setscrum()
|
||||
{
|
||||
setCookie("systemModel", 'scrum', $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
|
||||
die(js::locate($this->createLink('custom', 'concept')));
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajax save custom fields.
|
||||
*
|
||||
|
||||
@@ -133,10 +133,7 @@ $lang->custom->productProject->relation['1_2'] = 'Project - Sprint';
|
||||
|
||||
$lang->custom->productProject->notice = 'Please select a concept according to your team.';
|
||||
|
||||
$lang->custom->workingList['full'] = 'Full Management of Dev';
|
||||
$lang->custom->workingList['onlyTest'] = 'Test Management';
|
||||
$lang->custom->workingList['onlyStory'] = 'Story Management';
|
||||
$lang->custom->workingList['onlyTask'] = 'Task Management';
|
||||
$lang->custom->workingList['full'] = 'Full Management of Dev';
|
||||
|
||||
$lang->custom->menuTip = 'Click to show/hide navigation bar. Drag to swtich display order.';
|
||||
$lang->custom->saveFail = 'Failed to save!';
|
||||
|
||||
@@ -34,6 +34,7 @@ $lang->custom->setTips = 'Set Tips';
|
||||
$lang->custom->isRange = 'Is Target Control';
|
||||
$lang->custom->plan = 'Plan';
|
||||
$lang->custom->planStatus = 'Enable Plan';
|
||||
$lang->custom->concept = 'Concept';
|
||||
|
||||
$lang->custom->object['program'] = 'Program';
|
||||
$lang->custom->program->fields['unitList'] = 'Unit List';
|
||||
@@ -167,18 +168,12 @@ $lang->custom->weekendList[2] = '2-Day Off';
|
||||
$lang->custom->weekendList[1] = '1-Day Off';
|
||||
|
||||
$lang->custom->productProject = new stdclass();
|
||||
$lang->custom->productProject->relation['0_0'] = 'Product - Project';
|
||||
$lang->custom->productProject->relation['0_1'] = 'Product - Iteration';
|
||||
$lang->custom->productProject->relation['1_1'] = 'Project - Iteration';
|
||||
$lang->custom->productProject->relation['0_2'] = 'Product - Sprint';
|
||||
$lang->custom->productProject->relation['1_2'] = 'Project - Sprint';
|
||||
$lang->custom->productProject->relation['0_0'] = 'Program - Product - Iteration';
|
||||
$lang->custom->productProject->relation['0_1'] = 'Program - Product - Sprint';
|
||||
|
||||
$lang->custom->productProject->notice = 'Select a concept that fits your team.';
|
||||
|
||||
$lang->custom->workingList['full'] = 'Application Lifecycle Management';
|
||||
$lang->custom->workingList['onlyTest'] = 'Test Management';
|
||||
$lang->custom->workingList['onlyStory'] = 'Story Management';
|
||||
$lang->custom->workingList['onlyTask'] = 'Task Management';
|
||||
$lang->custom->workingList['full'] = 'Application Lifecycle Management';
|
||||
|
||||
$lang->custom->menuTip = 'Click to show/hide the menu. Drag to switch display order.';
|
||||
$lang->custom->saveFail = 'Failed to save!';
|
||||
|
||||
@@ -133,10 +133,7 @@ $lang->custom->productProject->relation['1_2'] = 'Project - Sprint';
|
||||
|
||||
$lang->custom->productProject->notice = 'Sélectionnez le concept qui correspond à votre équipe.';
|
||||
|
||||
$lang->custom->workingList['full'] = 'Application Lifecycle Management';
|
||||
$lang->custom->workingList['onlyTest'] = 'Gestion de la Qualité';
|
||||
$lang->custom->workingList['onlyStory'] = 'Gestion des Stories';
|
||||
$lang->custom->workingList['onlyTask'] = 'Gestion des Tâches';
|
||||
$lang->custom->workingList['full'] = 'Application Lifecycle Management';
|
||||
|
||||
$lang->custom->menuTip = "Cliquez pour montrer/cacher le menu. Déplacez pour changer l'ordre d'affichage.";
|
||||
$lang->custom->saveFail = 'Echec de la sauvegarde !';
|
||||
|
||||
@@ -34,6 +34,7 @@ $lang->custom->setTips = '设置提示语';
|
||||
$lang->custom->isRange = '是否目标控制范围';
|
||||
$lang->custom->plan = '排期';
|
||||
$lang->custom->planStatus = '是否启用排期';
|
||||
$lang->custom->concept = '概念';
|
||||
|
||||
$lang->custom->object['program'] = '项目';
|
||||
$lang->custom->program->fields['unitList'] = '预算单位';
|
||||
@@ -167,18 +168,12 @@ $lang->custom->weekendList[2] = '双休';
|
||||
$lang->custom->weekendList[1] = '单休';
|
||||
|
||||
$lang->custom->productProject = new stdclass();
|
||||
$lang->custom->productProject->relation['0_0'] = '产品 - 项目';
|
||||
$lang->custom->productProject->relation['0_1'] = '产品 - 迭代';
|
||||
$lang->custom->productProject->relation['1_1'] = '项目 - 迭代';
|
||||
$lang->custom->productProject->relation['0_2'] = '产品 - 冲刺';
|
||||
$lang->custom->productProject->relation['1_2'] = '项目 - 冲刺';
|
||||
$lang->custom->productProject->relation['0_0'] = '项目 - 产品 - 迭代';
|
||||
$lang->custom->productProject->relation['0_1'] = '项目 - 产品 - 冲刺';
|
||||
|
||||
$lang->custom->productProject->notice = '请根据实际情况选择适合自己团队的概念。';
|
||||
|
||||
$lang->custom->workingList['full'] = '完整研发管理工具';
|
||||
$lang->custom->workingList['onlyTest'] = '测试管理工具';
|
||||
$lang->custom->workingList['onlyStory'] = "{$lang->storyCommon}管理工具";
|
||||
$lang->custom->workingList['onlyTask'] = '任务管理工具';
|
||||
$lang->custom->workingList['full'] = '完整研发管理工具';
|
||||
|
||||
$lang->custom->menuTip = '点击显示或隐藏导航条目,拖拽来更改显示顺序。';
|
||||
$lang->custom->saveFail = '保存失败!';
|
||||
|
||||
@@ -530,6 +530,34 @@ class customModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set qc concept.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setConcept()
|
||||
{
|
||||
$this->loadModel('setting')->setItem('system.custom.productProject', $this->post->productProject);
|
||||
|
||||
/* Change block title. */
|
||||
$oldConfig = isset($this->config->custom->productProject) ? $this->config->custom->productProject : '0_0';
|
||||
$newConfig = $this->post->productProject;
|
||||
|
||||
list($oldProductIndex, $oldProjectIndex) = explode('_', $oldConfig);
|
||||
list($newProductIndex, $newProjectIndex) = explode('_', $newConfig);
|
||||
|
||||
foreach($this->config->productCommonList as $clientLang => $productCommonList)
|
||||
{
|
||||
$this->dao->update(TABLE_BLOCK)->set("`title` = REPLACE(`title`, '{$productCommonList[$oldProductIndex]}', '{$productCommonList[$newProductIndex]}')")->where('source')->eq('product')->exec();
|
||||
}
|
||||
|
||||
foreach($this->config->projectCommonList as $clientLang => $projectCommonList)
|
||||
{
|
||||
$this->dao->update(TABLE_BLOCK)->set("`title` = REPLACE(`title`, '{$projectCommonList[$oldProjectIndex]}', '{$projectCommonList[$newProjectIndex]}')")->where('source')->eq('project')->exec();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set story or requirement.
|
||||
*
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* The html template file of deny method of user 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 ZenTaoPMS
|
||||
* @version $Id: deny.html.php 4129 2013-01-18 01:58:14Z wwccss $
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<div class="btn-toolbar pull-left">
|
||||
<?php common::printLink('custom', 'concept', '', "<span class='text'>{$lang->custom->concept}</span>", '', "class='btn btn-link btn-active-text'"); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<form id='ajaxForm' class='form-ajax' method='post'>
|
||||
<div class='modal-body'>
|
||||
<div class="form-group">
|
||||
<label><?php echo $lang->custom->conceptQuestions['overview']?></label>
|
||||
<div class="checkbox"> <?php echo html::radio('productProject', $lang->custom->productProject->relation, zget($this->config->custom, 'productProject', '0_0'))?> </div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label></label>
|
||||
<div><?php echo html::submitButton();?></div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<div class="btn-toolbar pull-left">
|
||||
<?php common::printLink('custom', 'plan', '', "<span class='text'>{$lang->custom->plan}</span>", '', "class='btn btn-link btn-active-text'"); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='mainContent' class='main-row'>
|
||||
<div class='main-col main-content'>
|
||||
<form class="load-indicator main-form form-ajax" method='post'>
|
||||
<table class='table table-form mw-900px'>
|
||||
<tr>
|
||||
<th class='w-120px'><?php echo $lang->custom->planStatus;?></th>
|
||||
<td><?php echo html::radio('planStatus', $lang->custom->planStatusList, $status);?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class='text-left'><?php echo html::submitButton();?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
if(!isset($config->holiday)) $config->holiday = new stdclass();
|
||||
$config->holiday->require = new stdclass();
|
||||
$config->holiday->require->create = 'name,begin,end,year';
|
||||
$config->holiday->require->edit = 'name,begin,end,year';
|
||||
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
/**
|
||||
* The control file of holiday of Ranzhi.
|
||||
*
|
||||
* @copyright Copyright 2009-2018 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author chujilu <chujilu@cnezsoft.com>
|
||||
* @package holiday
|
||||
* @version $Id$
|
||||
* @link http://www.ranzhi.org
|
||||
*/
|
||||
class holiday extends control
|
||||
{
|
||||
/**
|
||||
* index
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->locate(inlink('browse'));
|
||||
}
|
||||
|
||||
/**
|
||||
* browse holidays.
|
||||
*
|
||||
* @param string $year
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function browse($year = '')
|
||||
{
|
||||
if($year == '') $year = date('Y');
|
||||
$holidays = $this->holiday->getList($year);
|
||||
$yearList = $this->holiday->getYearPairs();
|
||||
|
||||
$this->view->title = $this->lang->holiday->browse;
|
||||
$this->view->holidays = $holidays;
|
||||
$this->view->yearList = $yearList;
|
||||
$this->view->currentYear = $year;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a holiday.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$holidayID = $this->holiday->create();
|
||||
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
$actionID = $this->loadModel('action')->create('holiday', $holidayID, 'created');
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->holiday->create;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit holiday.
|
||||
*
|
||||
* @param int $id
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$holiday = $this->holiday->getById($id);
|
||||
if($_POST)
|
||||
{
|
||||
$this->holiday->update($id);
|
||||
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->holiday->edit;
|
||||
$this->view->holiday = $holiday;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete holiday.
|
||||
*
|
||||
* @param int $id
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
$result = $this->holiday->delete($id);
|
||||
if(!$result) $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
$this->send(array('result' => 'success'));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
.tree .active{font-weight: bold;}
|
||||
.with-side .side {position: absolute; width: 130px;}
|
||||
.with-side .main {padding-left: 145px; float: left;}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
if(!isset($lang->holiday)) $lang->holiday = new stdclass();
|
||||
$lang->holiday->common = 'Holiday';
|
||||
$lang->holiday->browse = 'Browse';
|
||||
$lang->holiday->create = 'Create';
|
||||
$lang->holiday->edit = 'Edit';
|
||||
$lang->holiday->delete = 'Delete';
|
||||
|
||||
$lang->holiday->id = 'ID';
|
||||
$lang->holiday->name = 'Name';
|
||||
$lang->holiday->desc = 'Description';
|
||||
$lang->holiday->type = 'Type';
|
||||
$lang->holiday->begin = 'Begin';
|
||||
$lang->holiday->end = 'End';
|
||||
|
||||
$lang->holiday->holiday = 'Holiday';
|
||||
|
||||
$lang->holiday->typeList['holiday'] = 'Holiday';
|
||||
$lang->holiday->typeList['working'] = 'Working Day';
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
if(!isset($lang->holiday)) $lang->holiday = new stdclass();
|
||||
$lang->holiday->common = 'Holiday';
|
||||
$lang->holiday->browse = 'Browse';
|
||||
$lang->holiday->create = 'Create';
|
||||
$lang->holiday->edit = 'Edit';
|
||||
$lang->holiday->delete = 'Delete';
|
||||
|
||||
$lang->holiday->id = 'ID';
|
||||
$lang->holiday->name = 'Name';
|
||||
$lang->holiday->desc = 'Description';
|
||||
$lang->holiday->type = 'Type';
|
||||
$lang->holiday->begin = 'Begin';
|
||||
$lang->holiday->end = 'End';
|
||||
|
||||
$lang->holiday->holiday = 'Holiday';
|
||||
|
||||
$lang->holiday->typeList['holiday'] = 'Holiday';
|
||||
$lang->holiday->typeList['working'] = 'Working Day';
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
if(!isset($lang->holiday)) $lang->holiday = new stdclass();
|
||||
$lang->holiday->common = 'Holiday';
|
||||
$lang->holiday->browse = 'Browse';
|
||||
$lang->holiday->create = 'Create';
|
||||
$lang->holiday->edit = 'Edit';
|
||||
$lang->holiday->delete = 'Delete';
|
||||
|
||||
$lang->holiday->id = 'ID';
|
||||
$lang->holiday->name = 'Name';
|
||||
$lang->holiday->desc = 'Description';
|
||||
$lang->holiday->type = 'Type';
|
||||
$lang->holiday->begin = 'Begin';
|
||||
$lang->holiday->end = 'End';
|
||||
|
||||
$lang->holiday->holiday = 'Holiday';
|
||||
|
||||
$lang->holiday->typeList['holiday'] = 'Holiday';
|
||||
$lang->holiday->typeList['working'] = 'Working Day';
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
if(!isset($lang->holiday)) $lang->holiday = new stdclass();
|
||||
$lang->holiday->common = 'Ngày lễ';
|
||||
$lang->holiday->browse = 'Browse';
|
||||
$lang->holiday->create = 'Tạo';
|
||||
$lang->holiday->edit = 'Sửa';
|
||||
$lang->holiday->delete = 'Xóa';
|
||||
|
||||
$lang->holiday->id = 'ID';
|
||||
$lang->holiday->name = 'Tên';
|
||||
$lang->holiday->desc = 'Mô tả';
|
||||
$lang->holiday->type = 'Loại';
|
||||
$lang->holiday->begin = 'Bắt đầu';
|
||||
$lang->holiday->end = 'Kết thúc';
|
||||
|
||||
$lang->holiday->holiday = 'Ngày lễ';
|
||||
|
||||
$lang->holiday->typeList['holiday'] = 'Ngày lễ';
|
||||
$lang->holiday->typeList['working'] = 'Ngày làm việc';
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
if(!isset($lang->holiday)) $lang->holiday = new stdclass();
|
||||
$lang->holiday->common = '节假日';
|
||||
$lang->holiday->browse = '浏览';
|
||||
$lang->holiday->create = '新建';
|
||||
$lang->holiday->edit = '编辑';
|
||||
$lang->holiday->delete = '删除';
|
||||
|
||||
$lang->holiday->createAction = '创建节假日';
|
||||
$lang->holiday->editAction = '编辑节假日';
|
||||
$lang->holiday->deleteAction = '删除节假日';
|
||||
|
||||
$lang->holiday->id = '编号';
|
||||
$lang->holiday->name = '名称';
|
||||
$lang->holiday->desc = '描述';
|
||||
$lang->holiday->type = '类型';
|
||||
$lang->holiday->begin = '开始日期';
|
||||
$lang->holiday->end = '结束日期';
|
||||
$lang->holiday->all = '所有';
|
||||
|
||||
$lang->holiday->holiday = '假期';
|
||||
|
||||
$lang->holiday->typeList['holiday'] = '假期';
|
||||
$lang->holiday->typeList['working'] = '补班';
|
||||
|
||||
$lang->holiday->emptyTip = '暂时没有节假日。';
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
if(!isset($lang->holiday)) $lang->holiday = new stdclass();
|
||||
$lang->holiday->common = '節假日';
|
||||
$lang->holiday->browse = '瀏覽';
|
||||
$lang->holiday->create = '新建';
|
||||
$lang->holiday->edit = '編輯';
|
||||
$lang->holiday->delete = '刪除';
|
||||
|
||||
$lang->holiday->id = '編號';
|
||||
$lang->holiday->name = '名稱';
|
||||
$lang->holiday->desc = '描述';
|
||||
$lang->holiday->type = '類型';
|
||||
$lang->holiday->begin = '開始日期';
|
||||
$lang->holiday->end = '結束日期';
|
||||
|
||||
$lang->holiday->holiday = '假期';
|
||||
|
||||
$lang->holiday->typeList['holiday'] = '假期';
|
||||
$lang->holiday->typeList['working'] = '補班';
|
||||
@@ -0,0 +1,443 @@
|
||||
<?php
|
||||
/**
|
||||
* The model file of holiday module of ranzhi.
|
||||
*
|
||||
* @copyright Copyright 2009-2018 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author chujilu <chujilu@cnezsoft.com>
|
||||
* @package holiday
|
||||
* @version $Id$
|
||||
* @link http://www.ranzhi.org
|
||||
*/
|
||||
class holidayModel extends model
|
||||
{
|
||||
/**
|
||||
* Get holiday by id.
|
||||
*
|
||||
* @param int $id
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getById($id)
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_HOLIDAY)->where('id')->eq($id)->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get holiday list.
|
||||
*
|
||||
* @param string $year
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getList($year = '', $type = 'all')
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_HOLIDAY)
|
||||
->where('1')
|
||||
->beginIf($year != '')
|
||||
->andWhere('year', true)->eq($year)
|
||||
->orWhere('begin')->like("$year-%")
|
||||
->orWhere('end')->like("$year-%")
|
||||
->markright(1)
|
||||
->fi()
|
||||
->beginIf($type != 'all' && $type)->andWhere('type')->eq($type)->fi()
|
||||
->fetchAll('id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get year pairs.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getYearPairs()
|
||||
{
|
||||
return $this->dao->select('year,year')->from(TABLE_HOLIDAY)->groupBy('year')->orderBy('year_desc')->fetchPairs();
|
||||
}
|
||||
|
||||
/**
|
||||
* create a holiday.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$holiday = fixer::input('post')->get();
|
||||
$holiday->year = substr($holiday->begin, 0, 4);
|
||||
|
||||
$this->dao->insert(TABLE_HOLIDAY)
|
||||
->data($holiday)
|
||||
->autoCheck()
|
||||
->batchCheck($this->config->holiday->require->create, 'notempty')
|
||||
->check('end', 'ge', $holiday->begin)
|
||||
->exec();
|
||||
|
||||
if(!dao::isError())
|
||||
{
|
||||
$beginDate = $this->post->begin;
|
||||
$endDate = $this->post->end;
|
||||
|
||||
/* Update project. */
|
||||
$this->updateProjectPlanDuration($beginDate, $endDate);
|
||||
$this->updateProjectRealDuration($beginDate, $endDate);
|
||||
|
||||
/* Update task. */
|
||||
$this->updateTaskPlanDuration($beginDate, $endDate);
|
||||
$this->updateTaskRealDuration($beginDate, $endDate);
|
||||
}
|
||||
|
||||
return $this->dao->lastInsertID();
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit holiday.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function update($id)
|
||||
{
|
||||
$holiday = fixer::input('post')->get();
|
||||
$holiday->year = substr($holiday->begin, 0, 4);
|
||||
|
||||
$this->dao->update(TABLE_HOLIDAY)
|
||||
->data($holiday)
|
||||
->autoCheck()
|
||||
->batchCheck($this->config->holiday->require->edit, 'notempty')
|
||||
->check('end', 'ge', $holiday->begin)
|
||||
->where('id')->eq($id)
|
||||
->exec();
|
||||
|
||||
if(!dao::isError())
|
||||
{
|
||||
$beginDate = $this->post->begin;
|
||||
$endDate = $this->post->end;
|
||||
|
||||
/* Update project. */
|
||||
$this->updateProjectPlanDuration($beginDate, $endDate);
|
||||
$this->updateProjectRealDuration($beginDate, $endDate);
|
||||
|
||||
/* Update task. */
|
||||
$this->updateTaskPlanDuration($beginDate, $endDate);
|
||||
$this->updateTaskRealDuration($beginDate, $endDate);
|
||||
}
|
||||
return !dao::isError();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a holiday
|
||||
*
|
||||
* @param int $id
|
||||
* @param null $null
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function delete($id, $null = null)
|
||||
{
|
||||
$holidayInformation = $this->dao->select('begin, end')->from(TABLE_HOLIDAY)->where('id')->eq($id)->fetch();
|
||||
$this->dao->delete()->from(TABLE_HOLIDAY)->where('id')->eq($id)->exec();
|
||||
/* Update project. */
|
||||
$this->updateProjectPlanDuration($holidayInformation->begin, $holidayInformation->end);
|
||||
$this->updateProjectRealDuration($holidayInformation->begin, $holidayInformation->end);
|
||||
|
||||
/* Update task. */
|
||||
$this->updateTaskPlanDuration($holidayInformation->begin, $holidayInformation->end);
|
||||
$this->updateTaskRealDuration($holidayInformation->begin, $holidayInformation->end);
|
||||
|
||||
return !dao::isError();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get holidays by begin and end.
|
||||
*
|
||||
* @param varchar $begin
|
||||
* @param varchar $end
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function getHolidays($begin, $end)
|
||||
{
|
||||
$records = $this->dao->select('*')->from(TABLE_HOLIDAY)
|
||||
->where('type')->eq('holiday')
|
||||
->andWhere('begin')->le($end)
|
||||
->andWhere('end')->ge($begin)
|
||||
->fetchAll('id');
|
||||
|
||||
$naturalDays = $this->getDaysBetween($begin, $end);
|
||||
|
||||
$holidays = array();
|
||||
foreach($records as $record)
|
||||
{
|
||||
$dates = $this->getDaysBetween($record->begin, $record->end);
|
||||
$holidays = array_merge($holidays, $dates);
|
||||
}
|
||||
|
||||
return array_intersect($naturalDays, $holidays);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get working days.
|
||||
*
|
||||
* @param varchar $begin
|
||||
* @param varchar $end
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function getWorkingDays($begin = '', $end = '')
|
||||
{
|
||||
$records = $this->dao->select('*')->from(TABLE_HOLIDAY)
|
||||
->where('type')->eq('working')
|
||||
->andWhere('begin')->le($end)
|
||||
->andWhere('end')->ge($begin)
|
||||
->fetchAll('id');
|
||||
|
||||
$workingDays = array();
|
||||
foreach($records as $record)
|
||||
{
|
||||
$dates = $this->getDaysBetween($record->begin, $record->end);
|
||||
$workingDays = array_merge($workingDays, $dates);
|
||||
}
|
||||
return $workingDays;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get actual working days.
|
||||
*
|
||||
* @param varchar $begin
|
||||
* @param varchar $end
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function getActualWorkingDays($begin, $end)
|
||||
{
|
||||
if(empty($begin) or empty($end) or $begin == '0000-00-00' or $end == '0000-00-00') return array();
|
||||
|
||||
$actualDays = array();
|
||||
$currentDay = $begin;
|
||||
|
||||
$holidays = $this->getHolidays($begin, $end);
|
||||
$workingDays = $this->getWorkingDays($begin, $end);
|
||||
$weekend = isset($this->config->project->weekend) ? $this->config->project->weekend : 2;
|
||||
|
||||
/* When the start date and end date are the same. */
|
||||
if($begin == $end)
|
||||
{
|
||||
if(in_array($begin, $workingDays)) return $actualDays[] = $begin;
|
||||
if(in_array($begin, $holidays)) return $actualDays;
|
||||
|
||||
$w = date('w', strtotime($begin));
|
||||
if($weekend == 2)
|
||||
{
|
||||
if($w == 0 or $w == 6) return $actualDays;
|
||||
}
|
||||
else
|
||||
{
|
||||
if($w == 0) return $actualDays;
|
||||
}
|
||||
|
||||
$actualDays[] = $begin;
|
||||
return $actualDays;
|
||||
}
|
||||
|
||||
for($i = 0; $currentDay < $end; $i ++)
|
||||
{
|
||||
$currentDay = date('Y-m-d', strtotime("$begin + $i days"));
|
||||
$w = date('w', strtotime($currentDay));
|
||||
|
||||
if(in_array($currentDay, $workingDays))
|
||||
{
|
||||
$actualDays[] = $currentDay;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(in_array($currentDay, $holidays)) continue;
|
||||
if($weekend == 2)
|
||||
{
|
||||
if($w == 0 or $w == 6) continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if($w == 0) continue;
|
||||
}
|
||||
$actualDays[] = $currentDay;
|
||||
}
|
||||
|
||||
return $actualDays;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get diff days.
|
||||
*
|
||||
* @param varchar $begin
|
||||
* @param varchar $end
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function getDaysBetween($begin, $end)
|
||||
{
|
||||
$beginTime = strtotime($begin);
|
||||
$endTime = strtotime($end);
|
||||
$days = ($endTime - $beginTime) / 86400;
|
||||
|
||||
$dateList = array();
|
||||
for($i = 0; $i <= $days; $i ++) $dateList[] = date('Y-m-d', strtotime("+$i days", $beginTime));
|
||||
|
||||
return $dateList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Judge if is holiday.
|
||||
*
|
||||
* @param varchar $date
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function isHoliday($date)
|
||||
{
|
||||
$record = $this->dao->select('*')->from(TABLE_HOLIDAY)
|
||||
->where('type')->eq('holiday')
|
||||
->andWhere('begin')->le($date)
|
||||
->andWhere('end')->ge($date)
|
||||
->fetch();
|
||||
return !empty($record);
|
||||
}
|
||||
|
||||
/**
|
||||
* Judge if is working days.
|
||||
*
|
||||
* @param varchar $date
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function isWorkingDay($date)
|
||||
{
|
||||
$record = $this->dao->select('*')->from(TABLE_HOLIDAY)
|
||||
->where('type')->eq('working')
|
||||
->andWhere('begin')->le($date)
|
||||
->andWhere('end')->ge($date)
|
||||
->fetch();
|
||||
return !empty($record);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update project plan duration.
|
||||
*
|
||||
* @param varchar $beginDate
|
||||
* @param varchar $endDate
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function updateProjectPlanDuration($beginDate, $endDate)
|
||||
{
|
||||
$updateProjectList = $this->dao->select('id, begin, end')
|
||||
->from(TABLE_PROJECT)
|
||||
->where('begin')->between($beginDate, $endDate)
|
||||
->orWhere('end')->between($beginDate, $endDate)
|
||||
->orWhere("(begin < '$beginDate' AND end > '$endDate')")
|
||||
->andWhere('status')->ne('done')
|
||||
->fetchAll();
|
||||
|
||||
foreach($updateProjectList as $project)
|
||||
{
|
||||
$realDuration = $this->getActualWorkingDays($project->begin, $project->end);
|
||||
$realDuration = count($realDuration);
|
||||
|
||||
$this->dao->update(TABLE_PROJECT)
|
||||
->set('planDuration')->eq($realDuration)
|
||||
->where('id')->eq($project->id)
|
||||
->exec();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update project real duration.
|
||||
*
|
||||
* @param varchar $beginDate
|
||||
* @param varchar $endDate
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function updateProjectRealDuration($beginDate, $endDate)
|
||||
{
|
||||
$updateProjectList = $this->dao->select('id, realStarted, realFinished')
|
||||
->from(TABLE_PROJECT)
|
||||
->where('realStarted')->between($beginDate, $endDate)
|
||||
->orWhere('realFinished')->between($beginDate, $endDate)
|
||||
->orWhere("(realStarted < '$beginDate' AND realFinished > '$endDate')")
|
||||
->andWhere('status')->ne('done')
|
||||
->fetchAll();
|
||||
|
||||
foreach($updateProjectList as $project)
|
||||
{
|
||||
$realDuration = $this->getActualWorkingDays($project->realStarted, $project->realFinished);
|
||||
$realDuration = count($realDuration);
|
||||
|
||||
$this->dao->update(TABLE_PROJECT)
|
||||
->set('realDuration')->eq($realDuration)
|
||||
->where('id')->eq($project->id)
|
||||
->exec();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update task plan duration.
|
||||
*
|
||||
* @param varchar $beginDate
|
||||
* @param varchar $endDate
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function updateTaskPlanDuration($beginDate, $endDate)
|
||||
{
|
||||
$updateTaskList = $this->dao->select('id, estStarted, deadline')
|
||||
->from(TABLE_TASK)
|
||||
->where('estStarted')->between($beginDate, $endDate)
|
||||
->orWhere('deadline')->between($beginDate, $endDate)
|
||||
->orWhere("(estStarted < '$beginDate' AND deadline > '$endDate')")
|
||||
->andWhere('status') ->ne('done')
|
||||
->fetchAll();
|
||||
|
||||
foreach($updateTaskList as $task)
|
||||
{
|
||||
$planduration = $this->getActualWorkingDays($task->estStarted, $task->deadline);
|
||||
$planduration = count($planduration);
|
||||
|
||||
$this->dao->update(TABLE_TASK)
|
||||
->set('planduration')->eq($planduration)
|
||||
->where('id')->eq($task->id)
|
||||
->exec();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Update task real duration.
|
||||
*
|
||||
* @param varchar $beginDate
|
||||
* @param varchar $endDate
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function updateTaskRealDuration($beginDate, $endDate)
|
||||
{
|
||||
$updateTaskList = $this->dao->select('id, realStarted, finishedDate')
|
||||
->from(TABLE_TASK)
|
||||
->where('realStarted')->between($beginDate, $endDate)
|
||||
->orWhere("date_format(finishedDate,'%Y-%m-%d')")->between($beginDate, $endDate)
|
||||
->orWhere("(realStarted < '$beginDate' AND date_format(finishedDate,'%Y-%m-%d') > '$endDate')")
|
||||
->andWhere('status')->ne('done')
|
||||
->fetchAll();
|
||||
|
||||
foreach($updateTaskList as $task)
|
||||
{
|
||||
$realDuration = $this->getActualWorkingDays($task->realStarted, date('Y-m-d',strtotime($task->finishedDate)));
|
||||
$realDuration = count($realDuration);
|
||||
|
||||
$this->dao->update(TABLE_TASK)
|
||||
->set('realDuration')->eq($realDuration)
|
||||
->where('id')->eq($task->id)
|
||||
->exec();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
/**
|
||||
* The browse view file of holiday module of Ranzhi.
|
||||
*
|
||||
* @copyright Copyright 2009-2018 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author chujilu <chujilu@cnezsoft.com>
|
||||
* @package holiday
|
||||
* @version $Id$
|
||||
* @link http://www.ranzhi.org
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class='pull-left btn-toolbar'>
|
||||
<?php
|
||||
echo html::a($this->createLink('holiday', 'browse'), '<span class="text">' . $lang->holiday->all . '</span>', '', "class='btn btn-link btn-active-text'");
|
||||
?>
|
||||
</div>
|
||||
<div class='pull-right'>
|
||||
<?php common::printLink('holiday', 'create', "", "<i class='icon icon-plus'> </i>" . $lang->holiday->create, '', "class='btn btn-primary iframe'", '', true)?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='mainContent' class='main-row fade in'>
|
||||
<div class='side-col'>
|
||||
<div class='panel panel-sm'>
|
||||
<div class='panel-body'>
|
||||
<ul class='tree' data-ride='tree' data-collapsed='true'>
|
||||
<?php foreach($yearList as $year):?>
|
||||
<li class='<?php echo $year == $currentYear ? 'active' : ''?>'>
|
||||
<?php common::printLink('holiday', 'browse', "year=$year", $year);?>
|
||||
</li>
|
||||
<?php endforeach;?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='main-col main-table'>
|
||||
<?php if($holidays):?>
|
||||
<table class='table text-center'>
|
||||
<thead>
|
||||
<tr class='text-center'>
|
||||
<th class='w-150px'><?php echo $lang->holiday->name;?></th>
|
||||
<th class='w-200px'><?php echo $lang->holiday->holiday;?></th>
|
||||
<th class='w-80px'><?php echo $lang->holiday->type;?></th>
|
||||
<th><?php echo $lang->holiday->desc;?></th>
|
||||
<th class='w-100px'><?php echo $lang->actions;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php foreach($holidays as $holiday):?>
|
||||
<tr>
|
||||
<td><?php echo $holiday->name;?></td>
|
||||
<td><?php echo formatTime($holiday->begin, DT_DATE1) . ' ~ ' . formatTime($holiday->end, DT_DATE1);?></td>
|
||||
<td><?php echo zget($lang->holiday->typeList, $holiday->type);?></td>
|
||||
<td><?php echo $holiday->desc;?></td>
|
||||
<td>
|
||||
<?php common::printLink('holiday', 'edit', "id=$holiday->id", $lang->edit, '', "class='iframe'", '', true);?>
|
||||
<?php common::printLink('holiday', 'delete', "id=$holiday->id", $lang->delete);?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</table>
|
||||
<?php if(!$holidays):?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<div class="table-empty-tip">
|
||||
<p>
|
||||
<span class="text-muted"><?php echo $lang->holiday->emptyTip;?></span>
|
||||
</p>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* The create view file of holiday module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2018 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author chujilu <chujilu@cnezsoft.com>
|
||||
* @package attend
|
||||
* @version $Id$
|
||||
* @link http://www.ranzhi.org
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
<h2>
|
||||
<?php echo $lang->holiday->create;?>
|
||||
</h2>
|
||||
</div>
|
||||
<form class='form-ajax' method='post'>
|
||||
<table class='table table-form table-condensed'>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->holiday->type;?></th>
|
||||
<td><?php echo html::radio('type', $lang->holiday->typeList, 'holiday');?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->holiday->name;?></th>
|
||||
<td><?php echo html::input('name', '', "class='form-control'");?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->holiday->begin;?></th>
|
||||
<td><?php echo html::input('begin', '', "class='form-control form-date'");?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->holiday->end;?></th>
|
||||
<td><?php echo html::input('end', '', "class='form-control form-date'");?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->holiday->desc?></th>
|
||||
<td><?php echo html::textarea('desc', '', "class='form-control'")?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr><th></th><td clospan='2'><?php echo baseHTML::submitButton();?></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* The create view file of holiday module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2018 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author chujilu <chujilu@cnezsoft.com>
|
||||
* @package attend
|
||||
* @version $Id$
|
||||
* @link http://www.ranzhi.org
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
<h2>
|
||||
<?php echo $lang->holiday->edit;?>
|
||||
</h2>
|
||||
</div>
|
||||
<form class='form-ajax' method='post'>
|
||||
<table class='table table-form table-condensed'>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->holiday->type;?></th>
|
||||
<td><?php echo html::radio('type', $lang->holiday->typeList, $holiday->type);?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->holiday->name?></th>
|
||||
<td><?php echo html::input('name', $holiday->name, "class='form-control'")?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->holiday->begin?></th>
|
||||
<td><?php echo html::input('begin', $holiday->begin, "class='form-control form-date'")?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->holiday->end?></th>
|
||||
<td><?php echo html::input('end', $holiday->end, "class='form-control form-date'")?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->holiday->desc?></th>
|
||||
<td><?php echo html::textarea('desc', $holiday->desc, "class='form-control'")?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr><th></th><td clospan='2'><?php echo baseHTML::submitButton();?></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -1,6 +1,12 @@
|
||||
<?php
|
||||
$config->issue->create = new stdclass();
|
||||
$config->issue->edit = new stdclass();
|
||||
|
||||
$config->issue->create->requiredFields = 'title,type,severity';
|
||||
$config->issue->edit->requiredFields = 'title,type,severity';
|
||||
|
||||
$config->issue->editor = new stdclass();
|
||||
$config->issue->editor->create = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
$config->issue->editor->create = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
$config->issue->editor->edit = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
$config->issue->editor->cancel = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
$config->issue->editor->resolve = array('id' => 'resolutionComment', 'tools' => 'simpleTools');
|
||||
|
||||
+247
-1
@@ -24,9 +24,23 @@ class issue extends control
|
||||
*/
|
||||
public function browse($browseType = 'all', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
$browseType = strtolower($browseType);
|
||||
/* Load pager */
|
||||
$this->app->loadClass('pager', true);
|
||||
$pager = pager::init($recTotal, $recPerPage, $pageID);
|
||||
|
||||
$this->view->title = $this->lang->issue->common . $this->lang->colon . $this->lang->issue->browse;
|
||||
$this->view->position[] = $this->lang->issue->browse;
|
||||
|
||||
$this->view->pager = $pager;
|
||||
$this->view->recTotal = $recTotal;
|
||||
$this->view->recPerPage = $recPerPage;
|
||||
$this->view->pageID = $pageID;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->issueList = $this->issue->getIssueList($browseType, $orderBy, $pager);
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter|pofirst|nodeleted');
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -40,8 +54,9 @@ class issue extends control
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$result = $this->issue->create();
|
||||
$issueID = $this->issue->create();
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
$this->loadModel('action')->create('issue', $issueID, 'Opened');
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inLink('browse', 'browseType=all')));
|
||||
}
|
||||
|
||||
@@ -53,4 +68,235 @@ class issue extends control
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* batchCreate issues
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function batchCreate()
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$results = $this->issue->batchCreate();
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inLink('browse', 'browseType=all')));
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->issue->common . $this->lang->colon . $this->lang->issue->batchCreate;
|
||||
$this->view->position[] = $this->lang->issue->common;
|
||||
$this->view->position[] = $this->lang->issue->batchCreate;
|
||||
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted');
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a issue.
|
||||
*
|
||||
* @param int $issueID
|
||||
* @param string $confirm yes|no
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function delete($issueID = 0, $confirm = 'no')
|
||||
{
|
||||
if($confirm == 'no')
|
||||
{
|
||||
die(js::confirm($this->lang->issue->confirmDelete, inLink('delete', "issueID=$issueID&confirm=yes")));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->issue->delete($issueID);
|
||||
die(js::reload('parent'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit a issue.
|
||||
*
|
||||
* @param int $issueID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function edit($issueID)
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$changes = $this->issue->update($issueID);
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
$actionID = $this->loadModel('action')->create('issue', $issueID, 'Edited');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inLink('browse', 'browseType=all')));
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->issue->common . $this->lang->colon . $this->lang->issue->edit;
|
||||
$this->view->position[] = $this->lang->issue->common;
|
||||
$this->view->position[] = $this->lang->issue->edit;
|
||||
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted');
|
||||
$this->view->issue = $this->issue->getByID($issueID);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign a issue.
|
||||
*
|
||||
* @param int $issueID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function assignTo($issueID)
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$changes = $this->issue->assignTo($issueID);
|
||||
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
$actionID = $this->loadModel('action')->create('issue', $issueID, 'Edited');
|
||||
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
die(js::closeModal('parent.parent', 'this'));
|
||||
}
|
||||
|
||||
$this->view->issue = $this->issue->getByID($issueID);
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted');
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Close a issue.
|
||||
*
|
||||
* @param int $issueID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function close($issueID)
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$changes = $this->issue->close($issueID);
|
||||
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
$actionID = $this->loadModel('action')->create('issue', $issueID, 'Edited');
|
||||
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
die(js::closeModal('parent.parent', 'this'));
|
||||
}
|
||||
|
||||
$this->view->issue = $this->issue->getByID($issueID);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancel a issue.
|
||||
*
|
||||
* @param int $issueID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function cancel($issueID)
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$changes = $this->issue->cancel($issueID);
|
||||
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
$actionID = $this->loadModel('action')->create('issue', $issueID, 'Edited');
|
||||
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
die(js::closeModal('parent.parent', 'this'));
|
||||
}
|
||||
|
||||
$this->view->issue = $this->issue->getByID($issueID);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate a issue.
|
||||
*
|
||||
* @param int $issueID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function activate($issueID)
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$changes = $this->issue->activate($issueID);
|
||||
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
$actionID = $this->loadModel('action')->create('issue', $issueID, 'Edited');
|
||||
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
die(js::closeModal('parent.parent', 'this'));
|
||||
}
|
||||
|
||||
$this->view->issue = $this->issue->getByID($issueID);
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted');
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve a issue.
|
||||
*
|
||||
* @param int $issue
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function resolve($issue)
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$this->issue->resolve($issue);
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse')));
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->issue->resolved;
|
||||
$this->view->issue = $this->issue->getByID($issue);
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get question details.
|
||||
*
|
||||
* @param int $issueID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function view($issueID)
|
||||
{
|
||||
$this->commonAction($issueID, 'issue');
|
||||
$issue = $this->issue->getByID($issueID);
|
||||
$this->view->title = $this->lang->issue->common . $this->lang->colon . $issue->title;
|
||||
$this->view->position[] = $this->lang->issue->common;
|
||||
$this->view->position[] = $this->lang->issue->basicInfo;
|
||||
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted');
|
||||
$this->view->issue = $issue;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Common actions of issue module.
|
||||
*
|
||||
* @param int $issueID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function commonAction($issueID, $object)
|
||||
{
|
||||
$this->view->actions = $this->loadModel('action')->getList($object, $issueID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,11 +29,17 @@ $lang->issue->assignedBy = '由谁指派';
|
||||
$lang->issue->assignedDate = '指派时间';
|
||||
$lang->issue->resolved = '解决';
|
||||
|
||||
$lang->issue->create = '新建';
|
||||
$lang->issue->delete = '删除';
|
||||
$lang->issue->basicInfo = '基本信息';
|
||||
$lang->issue->active = '激活';
|
||||
$lang->issue->assign = '指派';
|
||||
$lang->issue->create = '新建问题';
|
||||
$lang->issue->edit = '编辑问题';
|
||||
$lang->issue->batchCreate = '批量新建';
|
||||
|
||||
$lang->issue->labelList['all'] = '全部';
|
||||
$lang->issue->labelList['open'] = '开放';
|
||||
$lang->issue->labelList['assignTo'] = '指派给我';
|
||||
$lang->issue->labelList['assignto'] = '指派给我';
|
||||
$lang->issue->labelList['closed'] = '已关闭';
|
||||
$lang->issue->labelList['suspended'] = '已挂起';
|
||||
$lang->issue->labelList['cancelled'] = '已取消';
|
||||
@@ -72,4 +78,14 @@ $lang->issue->statusList['unresolved'] = '正解决';
|
||||
$lang->issue->statusList['resolved'] = '已解决';
|
||||
$lang->issue->statusList['canceled'] = '取消';
|
||||
$lang->issue->statusList['closed'] = '已关闭';
|
||||
$lang->issue->statusList['active'] = '激活';
|
||||
$lang->issue->statusList['suspended'] = '挂起';
|
||||
|
||||
$lang->issue->resolveMethods = array();
|
||||
$lang->issue->resolveMethods['resolved'] = '已解决';
|
||||
$lang->issue->resolveMethods['totask'] = '转任务';
|
||||
$lang->issue->resolveMethods['tobug'] = '转BUG';
|
||||
$lang->issue->resolveMethods['tostory'] = '转需求';
|
||||
$lang->issue->resolveMethods['torisk'] = '转风险';
|
||||
|
||||
$lang->issue->confirmDelete = '您确认删除该问题?';
|
||||
|
||||
+216
-1
@@ -13,12 +13,20 @@
|
||||
<?php
|
||||
class issueModel extends model
|
||||
{
|
||||
/**
|
||||
* Create a question.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$now = helper::now();
|
||||
$now = helper::now();
|
||||
$data = fixer::input('post')
|
||||
->add('createdBy', $this->app->user->account)
|
||||
->add('createdDate', $now)
|
||||
->add('program', $this->session->program)
|
||||
->remove('labels,files')
|
||||
->addIF($this->post->assignedTo, 'assignedBy', $this->app->user->account)
|
||||
->addIF($this->post->assignedTo, 'assignedDate', $now)
|
||||
->stripTags($this->config->issue->editor->create['id'], $this->config->allowedTags)
|
||||
@@ -43,6 +51,213 @@ class issueModel extends model
|
||||
}
|
||||
|
||||
$this->dao->insert(TABLE_ISSUE)->data($data)->exec();
|
||||
$issueID = $this->dao->lastInsertID();
|
||||
$this->loadModel('file')->saveUpload('issue', $issueID);
|
||||
|
||||
return $issueID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get question list data.
|
||||
*
|
||||
* @param string $browseType
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getIssueList($browseType = 'all', $orderBy = 'id_desc', $pager = null)
|
||||
{
|
||||
$issueList = $this->dao->select('*')->from(TABLE_ISSUE)
|
||||
->where('program')->eq($this->session->program)
|
||||
->andWhere('deleted')->eq('0')
|
||||
->beginIF($browseType == 'open')->andWhere('status')->eq('active')->fi()
|
||||
->beginIF($browseType == 'assignto')->andWhere('assignedTo')->eq($this->app->user->account)->fi()
|
||||
->beginIF($browseType == 'closed')->andWhere('status')->eq('closed')->fi()
|
||||
->beginIF($browseType == 'suspended')->andWhere('status')->eq('suspended')->fi()
|
||||
->beginIF($browseType == 'cancelled')->andWhere('status')->eq('canceled')->fi()
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
->fetchAll();
|
||||
|
||||
return $issueList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a question.
|
||||
*
|
||||
* @param int $issueID
|
||||
* @param int $null
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function delete($issueID = 0, $null = null)
|
||||
{
|
||||
$this->dao->update(TABLE_ISSUE)->set('deleted')->eq('1')->where('id')->eq($issueID)->exec();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a issue details.
|
||||
*
|
||||
* @param int $issueID
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getByID($issueID)
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_ISSUE)->where('id')->eq($issueID)->andWhere('deleted')->eq('0')->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a question.
|
||||
*
|
||||
* @param int $issueID
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function update($issueID)
|
||||
{
|
||||
$now = helper::now();
|
||||
$data = fixer::input('post')
|
||||
->add('editedBy', $this->app->user->account)
|
||||
->add('editedDate', $now)
|
||||
->addIF($this->post->assignedTo, 'assignedBy', $this->app->user->account)
|
||||
->addIF($this->post->assignedTo, 'assignedDate', $now)
|
||||
->stripTags($this->config->issue->editor->edit['id'], $this->config->allowedTags)
|
||||
->get();
|
||||
|
||||
if(strpos($this->config->issue->edit->requiredFields, 'type') !== false and !$this->post->type)
|
||||
{
|
||||
dao::$errors[] = sprintf($this->lang->error->notempty, $this->lang->issue->type);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(strpos($this->config->issue->edit->requiredFields, 'title') !== false and !$this->post->title)
|
||||
{
|
||||
dao::$errors[] = sprintf($this->lang->error->notempty, $this->lang->issue->title);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(strpos($this->config->issue->edit->requiredFields, 'severity') !== false and !$this->post->severity)
|
||||
{
|
||||
dao::$errors[] = sprintf($this->lang->error->notempty, $this->lang->issue->severity);
|
||||
return false;
|
||||
}
|
||||
$oldIssue = $this->getByID($issueID);
|
||||
|
||||
$this->dao->update(TABLE_ISSUE)->data($data)->where('id')->eq($issueID)->exec();
|
||||
return common::createChanges($oldIssue, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update assignor.
|
||||
*
|
||||
* @param int $issueID
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function assignTo($issueID)
|
||||
{
|
||||
$data = fixer::input('post')
|
||||
->add('assignedBy', $this->app->user->account)
|
||||
->add('assignedDate', helper::now())
|
||||
->get();
|
||||
|
||||
$oldIssue = $this->getByID($issueID);
|
||||
$this->dao->update(TABLE_ISSUE)->data($data)->where('id')->eq($issueID)->exec();
|
||||
|
||||
return common::createChanges($oldIssue, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Close issue.
|
||||
*
|
||||
* @param int $issueID
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function close($issueID)
|
||||
{
|
||||
$data = fixer::input('post')
|
||||
->add('closeBy', $this->app->user->account)
|
||||
->add('status', 'closed')
|
||||
->get();
|
||||
|
||||
$oldIssue = $this->getByID($issueID);
|
||||
$this->dao->update(TABLE_ISSUE)->data($data)->where('id')->eq($issueID)->exec();
|
||||
|
||||
return common::createChanges($oldIssue, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancel issue.
|
||||
*
|
||||
* @param int $issueID
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function cancel($issueID)
|
||||
{
|
||||
$data = fixer::input('post')->get();
|
||||
$oldIssue = $this->getByID($issueID);
|
||||
$this->dao->update(TABLE_ISSUE)->data($data)->where('id')->eq($issueID)->exec();
|
||||
|
||||
return common::createChanges($oldIssue, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate issue.
|
||||
*
|
||||
* @param int $issueID
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function activate($issueID)
|
||||
{
|
||||
$data = fixer::input('post')
|
||||
->add('status', 'active')
|
||||
->get();
|
||||
$oldIssue = $this->getByID($issueID);
|
||||
$this->dao->update(TABLE_ISSUE)->data($data)->where('id')->eq($issueID)->exec();
|
||||
|
||||
return common::createChanges($oldIssue, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch create issue.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function batchCreate()
|
||||
{
|
||||
$now = helper::now();
|
||||
$data = fixer::input('post')->get();
|
||||
|
||||
$issues = array();
|
||||
foreach($data->dataList as $issue)
|
||||
{
|
||||
if(!trim($issue['title'])) continue;
|
||||
|
||||
$issue['createdBy'] = $this->app->user->account;
|
||||
$issue['createdDate'] = $now;
|
||||
$issue['program'] = $this->session->program;
|
||||
if($issue['assignedTo'])
|
||||
{
|
||||
$issue['assignedBy'] = $this->app->user->account;
|
||||
$issue['assignedDate'] = $now;
|
||||
}
|
||||
|
||||
foreach(explode(',',$this->config->issue->create->requiredFields) as $field)
|
||||
{
|
||||
$field = trim($field);
|
||||
if($field and empty($issue["$field"])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->issue->$field)));
|
||||
}
|
||||
|
||||
$issues[] = $issue;
|
||||
}
|
||||
foreach($issues as $issue) $this->dao->insert(TABLE_ISSUE)->data($issue)->exec();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* The active of issue 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 Jia Fu <fujia@cnezsoft.com>
|
||||
* @package issue
|
||||
* @version $Id: complete.html.php 935 2010-07-06 07:49:24Z jajacn@126.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
<h2>
|
||||
<span class='label label-id'><?php echo $issue->id;?></span>
|
||||
<?php echo "<span title='$issue->title'>" . $issue->title . '</span>';?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body" style="min-height: 282px; overflow: auto;">
|
||||
<form method='post' enctype='multipart/form-data' target='hiddenwin'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->activateBy;?></th>
|
||||
<td colspan='2'><?php echo html::select('activateBy', $users, '', 'class="form-control chosen"');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->activateDate;?></th>
|
||||
<td colspan='2'><?php echo html::input('activateDate', helper::now(), 'class="form-control form-datetime"');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='3' class='text-center form-actions'>
|
||||
<?php echo html::submitButton();?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* The assign of issue 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 Jia Fu <fujia@cnezsoft.com>
|
||||
* @package issue
|
||||
* @version $Id: complete.html.php 935 2010-07-06 07:49:24Z jajacn@126.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
<h2>
|
||||
<span class='label label-id'><?php echo $issue->id;?></span>
|
||||
<?php echo "<span title='$issue->title'>" . $issue->title . '</span>';?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body" style="min-height: 282px; overflow: auto;">
|
||||
<form method='post' enctype='multipart/form-data' target='hiddenwin'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->assignedTo;?></th>
|
||||
<td colspan='2'><?php echo html::select('assignedTo', $users, $issue->assignedTo, 'class="form-control chosen"');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='3' class='text-center form-actions'>
|
||||
<?php echo html::submitButton();?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/**
|
||||
* The batch create close view of issue 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 Congzhi Chen <congzhi@cnezsoft.com>
|
||||
* @package issue
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id = "mainContent" class="main-content fade in">
|
||||
<div class="main-header">
|
||||
<h2><?php echo $lang->issue->batchCreate;?></h2>
|
||||
</div>
|
||||
<form id="batchCreateForm" class="form-ajax" method="post">
|
||||
<table class="table table-form">
|
||||
<thead>
|
||||
<tr class="text-center">
|
||||
<th class="required"><?php echo $lang->issue->title;?></th>
|
||||
<th class="w-140px required"><?php echo $lang->issue->type;?></th>
|
||||
<th class="w-120px required"><?php echo $lang->issue->severity;?></th>
|
||||
<th class="w-150px"><?php echo $lang->issue->desc;?></th>
|
||||
<th class="w-100px"><?php echo $lang->issue->pri;?></th>
|
||||
<th class="w-120px"><?php echo $lang->issue->deadline;?></th>
|
||||
<th class="w-120px"><?php echo $lang->issue->assignedTo;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php for($i = 1;$i <= 10;$i++):?>
|
||||
<tr data-key="<?php echo $i;?>">
|
||||
<td>
|
||||
<?php echo html::input("dataList[$i][title]", '', 'id="dataList'.$i.'title" class="form-control" autocomplete="off"')?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo html::select("dataList[$i][type]", $lang->issue->typeList, '', 'class="form-control chosen chosen-controled" id="dataList'.$i.'type"')?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo html::select("dataList[$i][severity]", $lang->issue->serverityList, '', 'class="form-control chosen chosen-controled" id="dataList'.$i.'severity"')?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo html::textarea("dataList[$i][desc]", '', 'class="form-control" id="dataList'.$i.'desc" rows="1"');?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo html::select("dataList[$i][pri]", $lang->issue->priList, '', 'class="form-control chosen chosen-controled" id="dataList'.$i.'pri"')?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo html::input("dataList[$i][deadline]", '', 'class="form-control form-date" id="dataList'.$i.'deadline"');?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo html::select("dataList[$i][assignedTo]", $users, '', 'class="form-control chosen chosen-controled" id="dataList'.$i.'assignedTo"')?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endfor;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="form-actions text-center">
|
||||
<?php echo html::submitButton('','id="submit" class="btn btn-primary" data-loading="稍后..."')?>
|
||||
<?php echo html::a('javascript:history.go(-1);', '返回', '', 'class="btn btn-back btn-wide"')?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -1,24 +1,84 @@
|
||||
<?php
|
||||
/**
|
||||
* The batch close view of story module of ZenTaoPMS.
|
||||
* The browse view of issue 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 Congzhi Chen <congzhi@cnezsoft.com>
|
||||
* @package story
|
||||
* @package issue
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div>
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<div class="btn-toolbar pull-left">
|
||||
<?php echo html::a($this->createLink('issue', 'browse', 'browseType=all'), '<span class="text">' . $lang->issue->browse . '</span>', '', 'class="btn btn-link btn-active-text"');?>
|
||||
<?php
|
||||
foreach($lang->issue->labelList as $label => $labelName)
|
||||
{
|
||||
$active = $browseType == $label ? 'btn-active-text' : '';
|
||||
echo html::a($this->createLink('issue', 'browse', 'browseType=' . $label), '<span class="text">' . $labelName . '</span>', '', "class='btn btn-link $active'");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="btn-toolbar pull-right">
|
||||
<?php common::printLink('issue', 'create', '', "<i class='icon icon-plus'></i>" . $lang->issue->create, '', "class='btn btn-primary'");?>
|
||||
<?php common::printLink('issue', 'batchCreate', '', "<i class='icon icon-plus'></i>" . $lang->issue->batchCreate, '', "class='btn btn-primary'");?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="mainContent" class="main-row">
|
||||
<div class="main-col">
|
||||
<?php if($issueList):?>
|
||||
<form class="main-table" data-ride="table" method="post" id="issueForm">
|
||||
<table id="issueList" class="table has-sort-head" id="issueTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php $vars = "browseType=$browseType&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";?>
|
||||
<th class="c-id w-40px"><?php echo common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
|
||||
<th class="w-40px"><?php echo $lang->issue->type;?></th>
|
||||
<th class="w-100px"><?php echo $lang->issue->title;?></th>
|
||||
<th class="w-40px"><?php echo $lang->issue->severity;?></th>
|
||||
<th class="w-40px"><?php echo $lang->issue->pri;?></th>
|
||||
<th class="w-60px"><?php echo $lang->issue->assignedTo;?></th>
|
||||
<th class="w-60px"><?php echo $lang->issue->owner;?></th>
|
||||
<th class="w-60px"><?php echo $lang->issue->status;?></th>
|
||||
<th class="w-80px"><?php echo $lang->issue->createdDate;?></th>
|
||||
<th class="c-actions w-100px"><?php echo $lang->actions;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($issueList as $id => $issue):?>
|
||||
<tr>
|
||||
<td class="c-id"><?php printf('%03d', $issue->id);?></td>
|
||||
<td title="<?php echo zget($lang->issue->typeList, $issue->type);?>"><?php echo zget($lang->issue->typeList, $issue->type);?></td>
|
||||
<td title="<?php echo $issue->title;?>"><?php common::printLink('issue', 'view', "id=$issue->id", $issue->title);?></td>
|
||||
<td title="<?php echo $issue->severity;?>"><?php echo $issue->severity;?></td>
|
||||
<td title="<?php echo $issue->pri;?>"><?php echo $issue->pri;?></td>
|
||||
<td title="<?php echo zget($users, $issue->assignedTo);?>"><?php echo zget($users, $issue->assignedTo);?></td>
|
||||
<td title="<?php echo zget($users, $issue->owner);?>"><?php echo zget($users, $issue->owner);?></td>
|
||||
<td title="<?php echo zget($lang->issue->statusList, $issue->status);?>"><?php echo zget($lang->issue->statusList, $issue->status);?></td>
|
||||
<td title="<?php echo $issue->createdDate;?>"><?php echo $issue->createdDate;?></td>
|
||||
<td class="c-actions">
|
||||
<?php
|
||||
echo common::printIcon('issue', 'resolve', "issueID=$issue->id", $issue, 'list', 'checked', '', 'iframe', 'yes');
|
||||
echo common::printIcon('issue', 'assignTo', "issueID=$issue->id", $issue, 'list', 'hand-right', '', 'iframe', 'yes');
|
||||
echo common::printIcon('issue', 'close', "issueID=$issue->id", $issue, 'list', 'off', '', 'iframe', 'yes');
|
||||
echo common::printIcon('issue', 'cancel', "issueID=$issue->id", $issue, 'list', 'ban-circle', '', 'iframe', 'yes');
|
||||
echo common::printIcon('issue', 'activate', "issueID=$issue->id", $issue, 'list', 'magic', '', 'iframe', 'yes');
|
||||
echo common::printIcon('issue', 'edit', "issueID=$issue->id", $issue, 'list', 'edit');
|
||||
$deleteClass = common::hasPriv('issue', 'delete') ? 'btn' : 'btn disabled';
|
||||
echo html::a($this->createLink('issue', 'delete', "issueID=$issue->id"), '<i class="icon-trash"></i>', 'hiddenwin', "title='{$lang->issue->delete}' class='$deleteClass'");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<?php else:?>
|
||||
<div class="table-empty-tip"><?php echo $lang->noData;?></div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* The cancel of issue 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 Jia Fu <fujia@cnezsoft.com>
|
||||
* @package issue
|
||||
* @version $Id: complete.html.php 935 2010-07-06 07:49:24Z jajacn@126.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
<h2>
|
||||
<span class='label label-id'><?php echo $issue->id;?></span>
|
||||
<?php echo "<span title='$issue->title'>" . $issue->title . '</span>';?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body" style="min-height: 282px; overflow: auto;">
|
||||
<form method='post' enctype='multipart/form-data' target='hiddenwin'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->title;?></th>
|
||||
<td colspan='2'><?php echo $issue->title;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->desc;?></th>
|
||||
<td colspan='2'><?php echo html::textarea('desc', $issue->desc, 'row="6"');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->status;?></th>
|
||||
<td colspan='2'><?php echo html::select('status', $lang->issue->statusList, 'canceled', 'class="form-control chosen"');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='3' class='text-center form-actions'>
|
||||
<?php echo html::submitButton();?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* The close of issue 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 Jia Fu <fujia@cnezsoft.com>
|
||||
* @package issue
|
||||
* @version $Id: complete.html.php 935 2010-07-06 07:49:24Z jajacn@126.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
<h2>
|
||||
<span class='label label-id'><?php echo $issue->id;?></span>
|
||||
<?php echo "<span title='$issue->title'>" . $issue->title . '</span>';?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body" style="min-height: 282px; overflow: auto;">
|
||||
<form method='post' enctype='multipart/form-data' target='hiddenwin'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->closedDate;?></th>
|
||||
<td colspan='2'><?php echo html::input('closedDate', helper::now(), 'class="form-control form-datetime"');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->resolution;?></th>
|
||||
<td colspan='2'><?php echo html::select('resolution', $lang->issue->resolutionList, '', 'class="form-control chosen"');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='3' class='text-center form-actions'>
|
||||
<?php echo html::submitButton();?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* The batch close view of story module of ZenTaoPMS.
|
||||
* The create view of issue 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 Congzhi Chen <congzhi@cnezsoft.com>
|
||||
* @package story
|
||||
* @package issue
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
@@ -17,55 +17,59 @@
|
||||
<div class="main-header">
|
||||
<h2><?php echo $lang->issue->create;?></h2>
|
||||
</div>
|
||||
<form method="post" class="main-form form-ajax" enctype="multipart/form-data" id="issueForm">
|
||||
<table class="table table-form">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->type;?></th>
|
||||
<td class="required"><?php echo html::select('type', $lang->issue->typeList, '', 'class="form-control chosen"');?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->title;?></th>
|
||||
<td class="required"><?php echo html::input('title', '', 'class="form-control"');?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->severity;?></th>
|
||||
<td class="required"><?php echo html::select('severity', $lang->issue->serverityList, '', 'class="form-control chosen"');?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->pri;?></th>
|
||||
<td><?php echo html::select('pri', $lang->issue->priList, '', 'class="form-control chosen"');?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->deadline;?></th>
|
||||
<td><?php echo html::input('deadline', '', 'class="form-control form-date"');?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->assignedTo;?></th>
|
||||
<td><?php echo html::select('assignedTo', $users, '', 'class="form-control chosen"');?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->desc;?></th>
|
||||
<td colspan="3"><?php echo html::textarea('desc', '', 'row="6"');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->files;?></th>
|
||||
<td><?php echo $this->fetch('file', 'buildform');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='3' class='text-center form-actions'><?php echo html::submitButton() . html::backButton();?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<form method="post" class="main-form form-ajax" enctype="multipart/form-data" id="issueForm">
|
||||
<table class="table table-form">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->type;?></th>
|
||||
<td class="required"><?php echo html::select('type', $lang->issue->typeList, '', 'class="form-control chosen"');?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->title;?></th>
|
||||
<td class="required"><?php echo html::input('title', '', 'class="form-control"');?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->severity;?></th>
|
||||
<td class="required"><?php echo html::select('severity', $lang->issue->serverityList, '', 'class="form-control chosen"');?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->pri;?></th>
|
||||
<td><?php echo html::select('pri', $lang->issue->priList, '', 'class="form-control chosen"');?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->deadline;?></th>
|
||||
<td><?php echo html::input('deadline', '', 'class="form-control form-date"');?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->assignedTo;?></th>
|
||||
<td><?php echo html::select('assignedTo', $users, '', 'class="form-control chosen"');?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->desc;?></th>
|
||||
<td colspan="3"><?php echo html::textarea('desc', '', 'row="6"');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='3' class='text-center form-actions'><?php echo html::submitButton() . html::backButton();?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/**
|
||||
* The edit view of issue 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 Congzhi Chen <congzhi@cnezsoft.com>
|
||||
* @package issue
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<div class="main-content" id="mainCentent">
|
||||
<div class="center-block">
|
||||
<div class="main-header">
|
||||
<h2><?php echo $lang->issue->edit;?></h2>
|
||||
</div>
|
||||
<form method="post" class="main-form form-ajax" enctype="multipart/form-data" id="issueForm">
|
||||
<table class="table table-form">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->type;?></th>
|
||||
<td class="required"><?php echo html::select('type', $lang->issue->typeList, $issue->type, 'class="form-control chosen"');?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->title;?></th>
|
||||
<td class="required"><?php echo html::input('title', $issue->title, 'class="form-control"');?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->severity;?></th>
|
||||
<td class="required"><?php echo html::select('severity', $lang->issue->serverityList, $issue->severity, 'class="form-control chosen"');?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->pri;?></th>
|
||||
<td><?php echo html::select('pri', $lang->issue->priList, $issue->pri, 'class="form-control chosen"');?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->deadline;?></th>
|
||||
<td><?php echo html::input('deadline', $issue->deadline, 'class="form-control form-date"');?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->assignedTo;?></th>
|
||||
<td><?php echo html::select('assignedTo', $users, $issue->assignedTo, 'class="form-control chosen"');?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->desc;?></th>
|
||||
<td colspan="3"><?php echo html::textarea('desc', $issue->desc, 'row="6"');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='3' class='text-center form-actions'><?php echo html::submitButton() . html::backButton();?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
include '../../common/view/header.html.php';
|
||||
include '../../common/view/kindeditor.html.php';
|
||||
include '../../common/view/datepicker.html.php';
|
||||
?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
<h2>
|
||||
<span class='label label-id'><?php echo $issue->id;?></span>
|
||||
<?php echo "<span title='$issue->title'>" . $issue->title . '</span>';?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body" style="min-height: 282px; overflow: auto;">
|
||||
<form id='ajaxForm' class="form-ajax" method='post'>
|
||||
<table class="table table-form">
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->resolution;?></th>
|
||||
<td>
|
||||
<?php echo html::select('resolution', $lang->issue->resolveMethods, 'resolved', "class='form-control chosen'");?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class='resolvedTR'>
|
||||
<th><?php echo $lang->issue->resolutionComment;?></th>
|
||||
<td colspan='3'><textarea name='resolutionComment' class='form-control' rows='5' id='resolutionComment'><?php echo $issue->resolutionComment;?></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->resolvedBy;?></th>
|
||||
<td>
|
||||
<?php echo html::select('resolvedBy', $users, $this->app->user->account, "class='form-control chosen'");?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->resolvedDate;?></th>
|
||||
<td>
|
||||
<div class='input-group has-icon-right'>
|
||||
<?php echo html::input('resolvedDate', date('Y-m-d'), "class='form-control form-date'");?>
|
||||
<label for="date" class="input-control-icon-right"><i class="icon icon-delay"></i></label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<div class='form-action'><?php echo html::submitButton();?></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$().ready(function()
|
||||
{
|
||||
$('#issueresolution').change(function()
|
||||
{
|
||||
if($(this).val() == 'resolved') $('.resolvedTR').show().find('input[type=text],input[type=radio],input[type=checkbox],select,textarea').prop('disabled', false);
|
||||
if($(this).val() == 'tobug') $('.bugTR').show().find('input[type=text],input[type=radio],input[type=checkbox],select,textarea').prop('disabled', false);
|
||||
if($(this).val() == 'totask') $('.taskTR').show().find('input[type=text],input[type=radio],input[type=checkbox],select,textarea').prop('disabled', false);
|
||||
if($(this).val() == 'tostory') $('.storyTR').show().find('input[type=text],input[type=radio],input[type=checkbox],select,textarea').prop('disabled', false);
|
||||
if($(this).val() == 'torisk') $('.riskTR').show().find('input[type=text],input[type=radio],input[type=checkbox],select,textarea').prop('disabled', false);
|
||||
})
|
||||
});
|
||||
</script>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/**
|
||||
* The details view of issue module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology C
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author Congzhi Chen <congzhi@cnezsoft.com>
|
||||
* @package issue
|
||||
* @version $Id: edit.html.php 4488 2013-02-27 02:54:49Z chencongzhi520@gmail.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<?php
|
||||
$browseLink = $this->createLink('issue', 'browse');
|
||||
$createLink = $this->createLink('issue', 'create');
|
||||
?>
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<div class="btn-toolbar pull-left">
|
||||
<?php if(!isonlybody()):?>
|
||||
<?php echo html::a($browseLink, '<i class="icon icon-back icon-sm"></i>' . $lang->goback, '', 'class="btn btn-secondary"');?>
|
||||
<div class="divider"></div>
|
||||
<?php endif;?>
|
||||
<div class="page-title">
|
||||
<span class="label label-id"><?php echo $issue->id?></span>
|
||||
<span class="text" title="<?php echo $issue->title?>"><?php echo $issue->title?></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn-toolbar pull-right">
|
||||
<?php if(common::hasPriv('issue', 'create')) echo html::a($createLink, "<i class='icon icon-plus'></i> {$lang->issue->create}", '', "class='btn btn-primary'");?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main-row" id="mainContent">
|
||||
<div class="main-col col-8">
|
||||
<div class="cell">
|
||||
<div class="detail">
|
||||
<p><strong>标题</strong> - 设计出现偏差,需求重新设计</p>
|
||||
<p><strong>标题</strong> - 设计出现偏差,需求重新设计</p>
|
||||
</div>
|
||||
<div class="detail">
|
||||
<div class="detail-title"><?php echo $lang->issue->desc;?></div>
|
||||
<div class="detail-content article-content">
|
||||
<?php echo !empty($issue->desc) ? $issue->desc : '<div class="text-center text-muted">' . $lang->noData . '</div>';?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php $actionFormLink = $this->createLink('action', 'comment', "objectType=issue&objectID=$issue->id");?>
|
||||
<div class="cell"><?php include '../../common/view/action.html.php';?></div>
|
||||
</div>
|
||||
<div class="side-col col-4">
|
||||
<div class="cell">
|
||||
<div class="tabs">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active">
|
||||
<a href="#basicInfo" data-toggle="tab"><?php echo $lang->issue->basicInfo;?></a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="basicInfo">
|
||||
<table class="table table-data">
|
||||
<tbody>
|
||||
<tr valign="middle">
|
||||
<th class="thWidth w-80px"><?php echo $lang->issue->type;?></th>
|
||||
<td></td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -1,12 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* The project view file of dashboard module of ZenTaoPMS.
|
||||
* The program view file of dashboard 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 dashboard
|
||||
* @version $Id: project.html.php 5095 2013-07-11 06:03:40Z chencongzhi520@gmail.com $
|
||||
* @version $Id: program.html.php 5095 2013-07-11 06:03:40Z chencongzhi520@gmail.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
@@ -21,13 +21,13 @@
|
||||
<div class="table-empty-tip">
|
||||
<p>
|
||||
<span class="text-muted"><?php echo $lang->program->noProgram;?></span>
|
||||
<?php if(common::hasPriv('program', 'create')):?>
|
||||
<?php echo html::a($this->createLink('program', 'create'), "<i class='icon icon-plus'></i> " . $lang->my->createProgram, '', "class='btn btn-info'");?>
|
||||
<?php if(common::hasPriv('program', 'createGuide')):?>
|
||||
<?php echo html::a($this->createLink('program', 'createGuide'), "<i class='icon icon-plus'></i> " . $lang->my->createProgram, '', "class='btn btn-info' data-toggle=modal");?>
|
||||
<?php endif;?>
|
||||
</p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<table class="table has-sort-head table-fixed" id='projectList'>
|
||||
<table class="table has-sort-head table-fixed" id='programList'>
|
||||
<thead>
|
||||
<tr class='text-center'>
|
||||
<th class='w-id'><?php echo $lang->idAB;?></th>
|
||||
@@ -39,19 +39,19 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($programs as $project):?>
|
||||
<?php foreach($programs as $program):?>
|
||||
<tr class='text-center'>
|
||||
<td><?php echo $project->id;?></td>
|
||||
<td class='text-left'><?php echo $project->code;?></td>
|
||||
<td class='text-left'><?php echo html::a("javascript:void(0)", $project->name, '', "class='transfer' data-id={$project->id}");?></td>
|
||||
<td><?php echo $project->begin;?></td>
|
||||
<td><?php echo $project->end;?></td>
|
||||
<td><?php echo $program->id;?></td>
|
||||
<td class='text-left'><?php echo $program->code;?></td>
|
||||
<td class='text-left'><?php echo html::a($this->createLink('program', 'index', "programID=$program->id"), $program->name, '', "class='transfer' data-id={$program->id}");?></td>
|
||||
<td><?php echo $program->begin;?></td>
|
||||
<td><?php echo $program->end;?></td>
|
||||
<td class="c-status">
|
||||
<?php if(isset($project->delay)):?>
|
||||
<?php if(isset($program->delay)):?>
|
||||
<span class="status-project status-delayed" title='<?php echo $lang->project->delayed;?>'> <?php echo $lang->project->delayed;?></span>
|
||||
<?php else:?>
|
||||
<?php $statusName = $this->processStatus('project', $project);?>
|
||||
<span class="status-project status-<?php echo $project->status?>" title='<?php echo $statusName;?>'> <?php echo $statusName;?></span>
|
||||
<?php $statusName = $this->processStatus('program', $program);?>
|
||||
<span class="status-project status-<?php echo $program->status?>" title='<?php echo $statusName;?>'> <?php echo $statusName;?></span>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -612,26 +612,10 @@ class product extends control
|
||||
$this->view->method = $method;
|
||||
$this->view->extra = $extra;
|
||||
|
||||
$products = $this->dao->select('*')->from(TABLE_PRODUCT)->where('id')->in(array_keys($this->products))->orderBy('`order` desc')->fetchAll('id');
|
||||
$product = $this->product->getByID($productID);
|
||||
$this->view->products = $this->dao->select('*')->from(TABLE_PRODUCT)->where('id')->in(array_keys($this->products))->orderBy('`order` desc')->fetchAll('id');
|
||||
$this->view->programID = $product->program;
|
||||
|
||||
/* Sort products as lines' order first. */
|
||||
$lines = $this->loadModel('tree')->getLinePairs($useShort = true);
|
||||
$productList = array();
|
||||
foreach($lines as $id => $name)
|
||||
{
|
||||
foreach($products as $key => $product)
|
||||
{
|
||||
if($product->line == $id)
|
||||
{
|
||||
$product->name = $name . '/' . $product->name;
|
||||
$productList[] = $product;
|
||||
unset($products[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
$productList = array_merge($productList, $products);
|
||||
|
||||
$this->view->products = $productList;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -40,20 +40,6 @@ class productModel extends model
|
||||
}
|
||||
|
||||
$pageActions = '';
|
||||
if($this->app->moduleName == 'release')
|
||||
{
|
||||
$pageActions = html::a(helper::createLink('release', 'create', "productID=$productID&branch=$branch"), "<i class='icon icon-plus'></i> {$this->lang->release->create}", '', "class='btn btn-primary'");
|
||||
|
||||
foreach($this->lang->release->moduleMenus as $key => $menu)
|
||||
{
|
||||
$replace = array();
|
||||
$replace['productID'] = $productID;
|
||||
$replace['branch'] = $branch;
|
||||
|
||||
common::setMenuVars($this->lang->release->moduleMenus, $key, $replace);
|
||||
}
|
||||
$this->lang->moduleMenus['release'] = $this->lang->release->moduleMenus;
|
||||
}
|
||||
if($this->app->moduleName == 'programplan' and isset($product->program))
|
||||
{
|
||||
$pageActions .= html::a(helper::createLink('programplan', 'create', "program=$product->program&productID=$productID"), "<i class='icon icon-plus'></i> {$this->lang->programplan->create}", '', "class='btn btn-primary'");
|
||||
@@ -95,7 +81,6 @@ class productModel extends model
|
||||
}
|
||||
if($currentMethod == 'report') $currentMethod = 'browse';
|
||||
|
||||
|
||||
$selectHtml = $this->select($products, $product->id, $currentModule, $currentMethod, $extra, $branch, $module, $moduleType);
|
||||
|
||||
$pageNav = '';
|
||||
@@ -106,18 +91,16 @@ class productModel extends model
|
||||
$pageNav .= $selectHtml;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isset($project->category) and $project->category == 'multiple') $pageNav = $selectHtml;
|
||||
}
|
||||
{
|
||||
$label = $this->lang->product->index;
|
||||
$pageNav = '<div class="btn-group angle-btn' . ($currentMethod == 'index' ? ' active' : '') . '"><div class="btn-group"><button data-toggle="dropdown" type="button" class="btn">' . $label . ' <span class="caret"></span></button>';
|
||||
$pageNav .= '<ul class="dropdown-menu">';
|
||||
if($this->config->global->flow == 'full' && common::hasPriv('product', 'index')) $pageNav .= '<li>' . html::a(helper::createLink('product', 'index', 'locate=no'), '<i class="icon icon-home"></i> ' . $this->lang->product->index) . '</li>';
|
||||
if(common::hasPriv('product', 'all')) $pageNav .= '<li>' . html::a(helper::createLink('product', 'all'), '<i class="icon icon-cards-view"></i> ' . $this->lang->product->all) . '</li>';
|
||||
if(common::hasPriv('product', 'create')) $pageNav .= '<li>' . html::a(helper::createLink('product', 'create'), '<i class="icon icon-plus"></i> ' . $this->lang->product->create) . '</li>';
|
||||
|
||||
$pageActions = '';
|
||||
if($this->config->global->flow != 'full')
|
||||
{
|
||||
if($currentMethod == 'build' && common::hasPriv('build', 'create'))
|
||||
{
|
||||
$this->app->loadLang('build');
|
||||
$pageActions .= html::a(helper::createLink('build', 'create', "productID=$productID"), "<i class='icon icon-plus'></i> {$this->lang->build->create}", '', "class='btn btn-primary'");
|
||||
}
|
||||
$pageNav .= '</ul></div></div>';
|
||||
$pageNav .= $selectHtml;
|
||||
}
|
||||
|
||||
return $pageNav;
|
||||
@@ -174,22 +157,6 @@ class productModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
if($this->config->global->flow == 'onlyTest' and $moduleType)
|
||||
{
|
||||
if($module) $module = $this->loadModel('tree')->getById($module);
|
||||
$moduleName = $module ? $module->name : $this->lang->tree->all;
|
||||
if(!$isMobile)
|
||||
{
|
||||
$dropMenuLink = helper::createLink('tree', 'ajaxGetDropMenu', "objectID=$productID&module=$currentModule&method=$currentMethod&extra=$extra");
|
||||
$output .= "<div class='btn-group'><button id='currentModule' data-toggle='dropdown' type='button' class='btn btn-limit'>{$moduleName} <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
|
||||
$output .= '<div class="input-control search-box has-icon-left has-icon-right search-example"><input type="search" class="form-control search-input" /><label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label><a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a></div>';
|
||||
$output .= "</div></div>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$output .= "<a id='currentModule' href=\"javascript:showSearchMenu('tree', '$productID', '$currentModule', '$currentMethod', '$extra')\">{$moduleName} <span class='icon-caret-down'></span></a><div id='currentBranchDropMenu' class='hidden affix enter-from-bottom layer'></div>";
|
||||
}
|
||||
}
|
||||
if(!$isMobile) $output .= '</div>';
|
||||
|
||||
return $output;
|
||||
|
||||
@@ -25,22 +25,26 @@ foreach($products as $product)
|
||||
{
|
||||
if($product->type != 'platform' && $module == 'branch' && $method == 'manage')
|
||||
{
|
||||
$myProductsHtml .= html::a(sprintf($link, $productID), "<i class='icon icon-cube'></i> " . $product->name, '', "class='text-important' title='{$product->name}' data-key='" . zget($productsPinYin, $product->name, '') . "'");
|
||||
$linkHtml = $module == 'programplan' ? sprintf($link, $programID, $productID) : sprintf($link, $productID);
|
||||
$myProductsHtml .= html::a($linkHtml, "<i class='icon icon-cube'></i> " . $product->name, '', "class='text-important' title='{$product->name}' data-key='" . zget($productsPinYin, $product->name, '') . "'");
|
||||
}
|
||||
else
|
||||
{
|
||||
$myProductsHtml .= html::a(sprintf($link, $product->id), "<i class='icon icon-cube'></i> " . $product->name, '', "class='text-important' title='{$product->name}' data-key='" . zget($productsPinYin, $product->name, '') . "'");
|
||||
$linkHtml = $module == 'programplan' ? sprintf($link, $programID, $product->id) : sprintf($link, $product->id);
|
||||
$myProductsHtml .= html::a($linkHtml, "<i class='icon icon-cube'></i> " . $product->name, '', "class='text-important' title='{$product->name}' data-key='" . zget($productsPinYin, $product->name, '') . "'");
|
||||
}
|
||||
}
|
||||
else if($product->status == 'normal' and !($product->PO == $this->app->user->account))
|
||||
{
|
||||
if($product->type != 'platform' && $module == 'branch' && $method == 'manage')
|
||||
{
|
||||
$normalProductsHtml .= html::a(sprintf($link, $productID), "<i class='icon icon-cube'></i> " . $product->name, '', "title='{$product->name}' data-key='" . zget($productsPinYin, $product->name, '') . "'");
|
||||
$linkHtml = $module == 'programplan' ? sprintf($link, $programID, $productID) : sprintf($link, $productID);
|
||||
$normalProductsHtml .= html::a($linkHtml, "<i class='icon icon-cube'></i> " . $product->name, '', "title='{$product->name}' data-key='" . zget($productsPinYin, $product->name, '') . "'");
|
||||
}
|
||||
else
|
||||
{
|
||||
$normalProductsHtml .= html::a(sprintf($link, $product->id), "<i class='icon icon-cube'></i> " . $product->name, '', "title='{$product->name}' data-key='" . zget($productsPinYin, $product->name, '') . "'");
|
||||
$linkHtml = $module == 'programplan' ? sprintf($link, $programID, $product->id) : sprintf($link, $product->id);
|
||||
$normalProductsHtml .= html::a($linkHtml, "<i class='icon icon-cube'></i> " . $product->name, '', "title='{$product->name}' data-key='" . zget($productsPinYin, $product->name, '') . "'");
|
||||
}
|
||||
}
|
||||
else if($product->status == 'closed')
|
||||
@@ -48,11 +52,13 @@ foreach($products as $product)
|
||||
|
||||
if($product->type != 'platform' && $module == 'branch' && $method == 'manage')
|
||||
{
|
||||
$closedProductsHtml .= html::a(sprintf($link, $productID), "<i class='icon icon-cube'></i> " . $product->name, '', "title='{$product->name}' class='closed' data-key='" . zget($productsPinYin, $product->name, '') . "'");
|
||||
$linkHtml = $module == 'programplan' ? sprintf($link, $programID, $productID) : sprintf($link, $productID);
|
||||
$closedProductsHtml .= html::a($linkHtml, "<i class='icon icon-cube'></i> " . $product->name, '', "title='{$product->name}' class='closed' data-key='" . zget($productsPinYin, $product->name, '') . "'");
|
||||
}
|
||||
else
|
||||
{
|
||||
$closedProductsHtml .= html::a(sprintf($link, $product->id), "<i class='icon icon-cube'></i> " . $product->name, '', "title='{$product->name}' class='closed' data-key='" . zget($productsPinYin, $product->name, '') . "'");
|
||||
$linkHtml = $module == 'programplan' ? sprintf($link, $programID, $product->id) : sprintf($link, $product->id);
|
||||
$closedProductsHtml .= html::a($linkHtml, "<i class='icon icon-cube'></i> " . $product->name, '', "title='{$product->name}' class='closed' data-key='" . zget($productsPinYin, $product->name, '') . "'");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,7 +80,8 @@ foreach($products as $product)
|
||||
?>
|
||||
</div>
|
||||
<div class="col-footer">
|
||||
<?php echo html::a(helper::createLink('product', 'all'), '<i class="icon icon-cards-view muted"></i> ' . $lang->product->all, '', 'class="not-list-item"'); ?>
|
||||
<?php //echo html::a(helper::createLink('product', 'all'), '<i class="icon icon-cards-view muted"></i> ' . $lang->product->all, '', 'class="not-list-item"'); ?>
|
||||
<?php echo html::a(helper::createLink('product', 'create', "program=$programID"), '<i class="icon icon-plus"></i> ' . $lang->product->create, '', 'class="not-list-item"'); ?>
|
||||
<a class='pull-right toggle-right-col not-list-item'><?php echo $lang->product->closed?><i class='icon icon-angle-right'></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -12,12 +12,6 @@
|
||||
<?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 $line ? zget($lines, $line) : $lang->product->line;?>
|
||||
<?php if($line) echo html::a(inlink('all', "productID={$productID}&line=&status={$status}"), "<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)
|
||||
@@ -42,16 +36,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<div id="mainContent" class="main-row fade">
|
||||
<div class="side-col" id="sidebar">
|
||||
<div class="sidebar-toggle"><i class="icon icon-angle-left"></i></div>
|
||||
<div class="cell">
|
||||
<?php echo $lineTree;?>
|
||||
<div class="text-center">
|
||||
<?php common::printLink('tree', 'browse', "rootID=$productID&view=line", $lang->tree->manageLine, '', "class='btn btn-info btn-wide'");?>
|
||||
<hr class="space-sm" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main-col">
|
||||
<form class="main-table table-product" data-ride="table" method="post" id='productsForm' action='<?php echo inLink('batchEdit', "productID=$productID");?>'>
|
||||
<?php $canOrder = (common::hasPriv('product', 'updateOrder'))?>
|
||||
|
||||
@@ -29,16 +29,6 @@
|
||||
<th><?php echo $lang->product->code;?></th>
|
||||
<td><?php echo html::input('code', '', "class='form-control input-product-code' required");?></td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->product->line;?></th>
|
||||
<td>
|
||||
<div class='input-group' id='lineIdBox'>
|
||||
<?php echo html::select('line', $lines, '', "class='form-control chosen'");?>
|
||||
<span class='input-group-addon'><?php echo html::a($this->createLink('tree', 'browse', "rootID=$rootID&view=line", '', true), $lang->tree->manageLine, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='95%'");?></span>
|
||||
</div>
|
||||
<div class='hidden'><?php echo html::a("javascript:void(0)", $lang->refresh, '', "class='refresh' onclick='loadProductLines($rootID)'");?></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->product->PO;?></th>
|
||||
<td><?php echo html::select('PO', $poUsers, $this->app->user->account, "class='form-control chosen'");?></td><td></td>
|
||||
|
||||
@@ -33,11 +33,6 @@
|
||||
<th><?php echo $lang->product->code;?></th>
|
||||
<td><?php echo html::input('code', $product->code, "class='form-control' required");?></td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->product->line;?></th>
|
||||
<td><?php echo html::select('line', $lines, $product->line, "class='form-control chosen'");?></td>
|
||||
<td><?php if(!$lines) common::printLink('tree', 'browse', 'rootID=&view=line', $lang->tree->manageLine);?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->product->PO;?></th>
|
||||
<td><?php echo html::select('PO', $poUsers, $product->PO, "class='form-control chosen'");?></td><td></td>
|
||||
|
||||
+135
-32
@@ -9,7 +9,38 @@ class program extends control
|
||||
$this->programs = $this->program->getPairs();
|
||||
}
|
||||
|
||||
public function index($status = 'doing', $orderBy = 'order_desc', $recTotal = 0, $recPerPage = 10, $pageID = 1)
|
||||
/**
|
||||
* Program index view.
|
||||
*
|
||||
* @param int $programID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function index($programID = 0)
|
||||
{
|
||||
if(!$programID) $programID = $this->session->program;
|
||||
$this->session->set('program', $programID);
|
||||
$this->lang->navGroup->program = 'program';
|
||||
|
||||
|
||||
$this->view->title = $this->lang->program->common . $this->lang->colon . $this->lang->program->index;
|
||||
$this->view->position[] = $this->lang->program->index;
|
||||
$this->view->program = $this->project->getByID($programID);
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Program list.
|
||||
*
|
||||
* @param varchar $status
|
||||
* @param varchar $orderBy
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function browse($status = 'doing', $orderBy = 'order_desc', $recTotal = 0, $recPerPage = 10, $pageID = 1)
|
||||
{
|
||||
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");
|
||||
|
||||
@@ -36,17 +67,31 @@ class program extends control
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->title = $this->lang->program->index;
|
||||
$this->view->position[] = $this->lang->program->index;
|
||||
$this->view->title = $this->lang->program->browse;
|
||||
$this->view->position[] = $this->lang->program->browse;
|
||||
$this->view->programType = $programType;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Program create guide.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function createGuide()
|
||||
{
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a program.
|
||||
*
|
||||
* @param varchar $template
|
||||
* @param int $copyProgramID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function create($template = 'cmmi', $copyProgramID = '')
|
||||
{
|
||||
if($_POST)
|
||||
@@ -57,7 +102,7 @@ class program extends control
|
||||
$this->send(array('result' => 'fail', 'message' => $this->processErrors(dao::getError())));
|
||||
}
|
||||
$this->loadModel('action')->create('project', $projectID, 'opened');
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('index', array('status' => 'wait', 'orderBy' => 'order_desc'))));
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse', array('status' => 'wait', 'orderBy' => 'order_desc'))));
|
||||
}
|
||||
|
||||
$name = '';
|
||||
@@ -93,6 +138,37 @@ class program extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit a program.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function edit($projectID = 0)
|
||||
{
|
||||
$project = $this->project->getByID($projectID);
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
$changes = $this->project->update($projectID);
|
||||
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => $this->processErrors(dao::getError())));
|
||||
if($changes)
|
||||
{
|
||||
$actionID = $this->loadModel('action')->create('project', $projectID, 'edited');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse')));
|
||||
}
|
||||
|
||||
$this->view->pmUsers = $this->loadModel('user')->getPairs('noclosed|nodeleted|pmfirst', $project->PM);
|
||||
$this->view->title = $this->lang->project->edit;
|
||||
$this->view->position[] = $this->lang->project->edit;
|
||||
$this->view->project = $project;
|
||||
$this->view->groups = $this->loadModel('group')->getPairs();
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Browse groups.
|
||||
*
|
||||
@@ -316,37 +392,21 @@ class program extends control
|
||||
$this->display('group', 'manageMember');
|
||||
}
|
||||
|
||||
public function edit($projectID = 0)
|
||||
{
|
||||
$project = $this->project->getByID($projectID);
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
$changes = $this->project->update($projectID);
|
||||
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => $this->processErrors(dao::getError())));
|
||||
if($changes)
|
||||
{
|
||||
$actionID = $this->loadModel('action')->create('project', $projectID, 'edited');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('index')));
|
||||
}
|
||||
|
||||
$this->view->pmUsers = $this->loadModel('user')->getPairs('noclosed|nodeleted|pmfirst', $project->PM);
|
||||
$this->view->title = $this->lang->project->edit;
|
||||
$this->view->position[] = $this->lang->project->edit;
|
||||
$this->view->project = $project;
|
||||
$this->view->groups = $this->loadModel('group')->getPairs();
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage program members.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @param int $dept
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function manageMembers($projectID, $dept = '')
|
||||
{
|
||||
$this->session->set('program', $projectID);
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->project->manageMembers($projectID);
|
||||
die(js::locate($this->createLink('program', 'index'), 'parent'));
|
||||
die(js::locate($this->createLink('program', 'browse'), 'parent'));
|
||||
}
|
||||
|
||||
/* Load model. */
|
||||
@@ -409,6 +469,14 @@ class program extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a program.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @param varchar $confirm
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function delete($projectID, $confirm = 'no')
|
||||
{
|
||||
if($confirm == 'no')
|
||||
@@ -419,10 +487,17 @@ class program extends control
|
||||
else
|
||||
{
|
||||
$this->project->delete(TABLE_PROJECT, $projectID);
|
||||
die(js::locate(inlink('index'), 'parent'));
|
||||
die(js::locate(inlink('browse'), 'parent'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Suspend a program.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function suspend($projectID)
|
||||
{
|
||||
$project = $this->project->getByID($projectID);
|
||||
@@ -450,6 +525,13 @@ class program extends control
|
||||
$this->display('project', 'suspend');
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate a program.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function activate($projectID)
|
||||
{
|
||||
$project = $this->project->getByID($projectID);
|
||||
@@ -484,6 +566,13 @@ class program extends control
|
||||
$this->display('project', 'activate');
|
||||
}
|
||||
|
||||
/**
|
||||
* Close a program.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function close($projectID)
|
||||
{
|
||||
$project = $this->project->getByID($projectID);
|
||||
@@ -562,6 +651,13 @@ class program extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Process program errors.
|
||||
*
|
||||
* @param array $errors
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function processErrors($errors)
|
||||
{
|
||||
foreach($errors as $field => $error)
|
||||
@@ -572,10 +668,18 @@ class program extends control
|
||||
return $errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajax get program drop menu.
|
||||
*
|
||||
* @param int $programID
|
||||
* @param varchar $module
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxGetDropMenu($programID, $module, $method, $extra)
|
||||
{
|
||||
$this->loadModel('project');
|
||||
$this->view->link = "javascript:void(0)";
|
||||
$this->view->link = $this->createLink('program', 'index', "programID=$programID");
|
||||
$this->view->programID = $programID;
|
||||
$this->view->module = $module;
|
||||
$this->view->method = $method;
|
||||
@@ -596,7 +700,6 @@ class program extends control
|
||||
*/
|
||||
public function ajaxGetEnterLink($programID = 0)
|
||||
{
|
||||
$this->session->set('program', $programID);
|
||||
$program = $this->project->getByID($programID);
|
||||
$programProjects = $this->project->getPairs();
|
||||
$programProject = key($programProjects);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$lang->program->index = '项目主页';
|
||||
$lang->program->index = '仪表盘';
|
||||
$lang->program->browse = '项目列表';
|
||||
$lang->program->common = '项目';
|
||||
$lang->program->stage = '阶段';
|
||||
$lang->program->name = '项目名称';
|
||||
|
||||
@@ -50,10 +50,10 @@ class programModel extends model
|
||||
{
|
||||
echo(js::alert($this->lang->program->accessDenied));
|
||||
|
||||
if(!$this->server->http_referer) die(js::locate(helper::createLink('program', 'index')));
|
||||
if(!$this->server->http_referer) die(js::locate(helper::createLink('program', 'browse')));
|
||||
|
||||
$loginLink = $this->config->requestType == 'GET' ? "?{$this->config->moduleVar}=user&{$this->config->methodVar}=login" : "user{$this->config->requestFix}login";
|
||||
if(strpos($this->server->http_referer, $loginLink) !== false) die(js::locate(helper::createLink('program', 'index')));
|
||||
if(strpos($this->server->http_referer, $loginLink) !== false) die(js::locate(helper::createLink('program', 'browse')));
|
||||
|
||||
die(js::locate('back'));
|
||||
}
|
||||
@@ -63,6 +63,7 @@ class programModel extends model
|
||||
$this->lang->project->team = $this->lang->project->teamname;
|
||||
$project = fixer::input('post')
|
||||
->setDefault('status', 'wait')
|
||||
->add('type', 'program')
|
||||
->setIF($this->post->acl != 'custom', 'whitelist', '')
|
||||
->setDefault('openedBy', $this->app->user->account)
|
||||
->setDefault('openedDate', helper::now())
|
||||
@@ -160,7 +161,7 @@ class programModel extends model
|
||||
$currentProgram = $this->project->getById($programID);
|
||||
$currentProgramName = $currentProgram->name;
|
||||
}
|
||||
if($currentModule == 'program' && $currentMethod == 'index') $currentProgramName = $this->lang->program->all;
|
||||
if($currentModule == 'program' && $currentMethod == 'browse') $currentProgramName = $this->lang->program->all;
|
||||
|
||||
$dropMenuLink = helper::createLink('program', 'ajaxGetDropMenu', "objectID=$programID&module=$currentModule&method=$currentMethod&extra=$extra");
|
||||
$output = "<div class='btn-group' id='swapper'><button data-toggle='dropdown' type='button' class='btn btn-limit' id='currentItem' title='{$currentProgramName}'>{$currentProgramName} <i class='icon icon-swap'></i></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
|
||||
|
||||
@@ -51,7 +51,7 @@ foreach($programs as $program)
|
||||
<div class="col-footer">
|
||||
<?php echo html::a(helper::createLink('program', 'createGuide'), '<i class="icon icon-plus"></i>' . $lang->program->create, '', 'class="not-list-item text-primary" data-toggle=modal'); ?>
|
||||
<div class='pull-right'>
|
||||
<?php echo html::a(helper::createLink('program', 'index', 'status=all'), '<i class="icon icon-cards-view muted"></i> ' . $lang->project->all, '', 'class="not-list-item"'); ?>
|
||||
<?php echo html::a(helper::createLink('program', 'browse', 'status=all'), '<i class="icon icon-cards-view muted"></i> ' . $lang->project->all, '', 'class="not-list-item"'); ?>
|
||||
<span class='text-muted muted'> | </span>
|
||||
<a class='toggle-right-col not-list-item'><?php echo $lang->project->doneProjects?><i class='icon icon-angle-right'></i></a>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* The html template file of index method of index 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 ZenTaoPMS
|
||||
* @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';?>
|
||||
<?php js::set('status', $status);?>
|
||||
<?php js::set('orderBy', $orderBy);?>
|
||||
<?php if($programType == 'bygrid'):?>
|
||||
<style>
|
||||
#mainMenu{padding-left: 10px; padding-right: 10px;}
|
||||
</style>
|
||||
<?php endif;?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class="btn-toolBar pull-left">
|
||||
<?php foreach($lang->program->featureBar as $key => $label):?>
|
||||
<?php $active = $status == $key ? 'btn-active-text' : '';?>
|
||||
<?php $label = "<span class='text'>$label</span>";?>
|
||||
<?php if($status == $key) $label .= " <span class='label label-light label-badge'>{$pager->recTotal}</span>";?>
|
||||
<?php echo html::a(inlink('browse', "status=$key&orderBy=$orderBy"), $label, '', "class='btn btn-link $active'");?>
|
||||
<?php endforeach;?>
|
||||
<?php echo html::checkbox('mine', array('1' => $lang->program->mine), '', $this->cookie->mine ? 'checked=checked' : '');?>
|
||||
</div>
|
||||
<div class='pull-right'>
|
||||
<div class='btn-group'>
|
||||
<?php echo html::a('javascript:setProgramType("bygrid")', "<i class='icon icon-cards-view'></i>", '', "title={$lang->program->bygrid} class='btn btn-icon " . ($programType == 'bygrid' ? 'text-primary' : '') . "'");?>
|
||||
<?php echo html::a('javascript:setProgramType("bylist")', "<i class='icon icon-bars'></i>", '', "title={$lang->program->bylist} class='btn btn-icon " . ($programType == 'bylist' ? 'text-primary' : '') . "'");?>
|
||||
</div>
|
||||
<?php common::printLink('program', 'export', "status=$status&orderBy=$orderBy", "<i class='icon-export muted'> </i>" . $lang->export, '', "class='btn btn-link export'")?>
|
||||
<?php if(isset($lang->pageActions)) echo $lang->pageActions;?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='mainContent' class='main-row'>
|
||||
<?php if(empty($projectList)):?>
|
||||
<div class="table-empty-tip">
|
||||
<p><span class="text-muted"><?php echo $lang->program->noProgram;?></span> <?php common::printLink('program', 'createguide', '', "<i class='icon icon-plus'></i> " . $lang->program->create, '', "class='btn btn-info' data-toggle=modal");?></p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<div class='main-col'>
|
||||
<?php
|
||||
if($programType == 'bygrid')
|
||||
{
|
||||
include 'browsebygrid.html.php';
|
||||
}
|
||||
else
|
||||
{
|
||||
include 'browsebylist.html.php';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class='row cell' id='cards'>
|
||||
<?php foreach ($projectList as $projectID => $project):?>
|
||||
<div class='col' data-id='<?php echo $projectID?>'>
|
||||
<div class='panel' data-url='<?php echo $this->createLink('program', 'transfer', "projectID=$project->id");?>'>
|
||||
<div class='panel' data-url='<?php echo $this->createLink('program', 'index', "projectID=$project->id");?>'>
|
||||
<div class='panel-heading'>
|
||||
<strong class='project-name' title='<?php echo $project->name;?>'><?php echo $project->name;?></strong>
|
||||
<?php if($project->template === 'cmmi'): ?>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</td>
|
||||
<td class='text-left'><?php echo $project->code;?></td>
|
||||
<td class='text-left pgm-title' title='<?php echo $project->name?>'>
|
||||
<?php echo html::a('javascript:void(0)', $project->name, '', "data-id=$project->id class=transfer");?>
|
||||
<?php echo html::a(inlink('index', "programID=$project->id"), $project->name);?>
|
||||
</td>
|
||||
<td class='c-status'><span class="status-project status-<?php echo $project->status?>"><?php echo zget($lang->project->statusList, $project->status, '');?></span></td>
|
||||
<td class='text-center'><?php echo $project->begin;?></td>
|
||||
|
||||
@@ -1,60 +1,2 @@
|
||||
<?php
|
||||
/**
|
||||
* The html template file of index method of index 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 ZenTaoPMS
|
||||
* @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';?>
|
||||
<?php js::set('status', $status);?>
|
||||
<?php js::set('orderBy', $orderBy);?>
|
||||
<?php if($programType == 'bygrid'):?>
|
||||
<style>
|
||||
#mainMenu{padding-left: 10px; padding-right: 10px;}
|
||||
</style>
|
||||
<?php endif;?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class="btn-toolBar pull-left">
|
||||
<?php foreach($lang->program->featureBar as $key => $label):?>
|
||||
<?php $active = $status == $key ? 'btn-active-text' : '';?>
|
||||
<?php $label = "<span class='text'>$label</span>";?>
|
||||
<?php if($status == $key) $label .= " <span class='label label-light label-badge'>{$pager->recTotal}</span>";?>
|
||||
<?php echo html::a(inlink('index', "status=$key&orderBy=$orderBy"), $label, '', "class='btn btn-link $active'");?>
|
||||
<?php endforeach;?>
|
||||
<?php echo html::checkbox('mine', array('1' => $lang->program->mine), '', $this->cookie->mine ? 'checked=checked' : '');?>
|
||||
</div>
|
||||
<div class='pull-right'>
|
||||
<div class='btn-group'>
|
||||
<?php echo html::a('javascript:setProgramType("bygrid")', "<i class='icon icon-cards-view'></i>", '', "title={$lang->program->bygrid} class='btn btn-icon " . ($programType == 'bygrid' ? 'text-primary' : '') . "'");?>
|
||||
<?php echo html::a('javascript:setProgramType("bylist")', "<i class='icon icon-bars'></i>", '', "title={$lang->program->bylist} class='btn btn-icon " . ($programType == 'bylist' ? 'text-primary' : '') . "'");?>
|
||||
</div>
|
||||
<?php common::printLink('program', 'export', "status=$status&orderBy=$orderBy", "<i class='icon-export muted'> </i>" . $lang->export, '', "class='btn btn-link export'")?>
|
||||
<?php if(isset($lang->pageActions)) echo $lang->pageActions;?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='mainContent' class='main-row'>
|
||||
<?php if(empty($projectList)):?>
|
||||
<div class="table-empty-tip">
|
||||
<p><span class="text-muted"><?php echo $lang->program->noProgram;?></span> <?php common::printLink('program', 'createguide', '', "<i class='icon icon-plus'></i> " . $lang->program->create, '', "class='btn btn-info'");?></p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<div class='main-col'>
|
||||
<?php
|
||||
if($programType == 'bygrid')
|
||||
{
|
||||
include 'browsebygrid.html.php';
|
||||
}
|
||||
else
|
||||
{
|
||||
include 'browsebylist.html.php';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -16,7 +16,7 @@ function fixScroll()
|
||||
if($tfoot.size() > 0) scrollOffset += $tfoot.height();
|
||||
if($('div.datatable.head-fixed').size() == 0) scrollOffset -= '29';
|
||||
var windowH = $(window).height();
|
||||
$scrollwrapper.css({'position': 'fixed', 'bottom': 50 + 'px'});
|
||||
if(scrollOffset > windowH + $(window).scrollTop()) $scrollwrapper.css({'position': 'fixed', 'bottom': 50 + 'px'});
|
||||
$(window).scroll(function()
|
||||
{
|
||||
newBottom = $tfoot.hasClass('fixedTfootAction') ? 50 + $tfoot.height() : 50;
|
||||
|
||||
@@ -2243,16 +2243,15 @@ class project extends control
|
||||
*/
|
||||
public function ajaxGetDropMenu($projectID, $module, $method, $extra)
|
||||
{
|
||||
$project = $this->project->getByID($projectID);
|
||||
$program = $this->project->getByID($project->program);
|
||||
|
||||
$this->view->link = $this->project->getProjectLink($module, $method, $extra);
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->module = $module;
|
||||
$this->view->method = $method;
|
||||
$this->view->extra = $extra;
|
||||
|
||||
$projects = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->in(array_keys($this->projects))->orderBy('order desc')->fetchAll();
|
||||
$projectPairs = array();
|
||||
foreach($projects as $project) $projectPairs[$project->id] = $project->name;
|
||||
$this->view->projects = $projects;
|
||||
$this->view->projects = $this->project->getProjectsByProgram($program);
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
+59
-36
@@ -62,21 +62,7 @@ class projectModel extends model
|
||||
*/
|
||||
public function setMenu($projects, $projectID, $buildID = 0, $extra = '')
|
||||
{
|
||||
if(!$projectID and $this->session->project) $projectID = $this->session->project;
|
||||
|
||||
/* Get project and program */
|
||||
$project = $this->getById($projectID);
|
||||
$isProgram = false;
|
||||
$program = array();
|
||||
if(!empty($project))
|
||||
{
|
||||
$isProgram = $project->template;
|
||||
$program = $isProgram ? $project : $this->getByID($project->program);
|
||||
}
|
||||
if(empty($program)) $program = $this->getByID($this->session->program);
|
||||
|
||||
$projects = $this->getPairs();
|
||||
|
||||
$program = $this->getByID($this->session->program);
|
||||
if(empty($projects))
|
||||
{
|
||||
if($program->template == 'cmmi')
|
||||
@@ -89,6 +75,17 @@ class projectModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
if(!$projectID and $this->session->project) $projectID = $this->session->project;
|
||||
|
||||
/* Get project and program */
|
||||
$project = $this->getById($projectID);
|
||||
$isProgram = false;
|
||||
if(!empty($project))
|
||||
{
|
||||
$isProgram = $project->template;
|
||||
$program = $isProgram ? $project : $this->getByID($project->program);
|
||||
}
|
||||
|
||||
if($isProgram)
|
||||
{
|
||||
$projectID = $this->session->project;
|
||||
@@ -125,7 +122,18 @@ class projectModel extends model
|
||||
$this->cookie->projectMode = 'all';
|
||||
}
|
||||
|
||||
if(!isset($this->lang->modulePageNav)) $this->lang->modulePageNav = $this->getModuleNav($projectID, $extra);
|
||||
/* Set project module page nav. */
|
||||
$label = $this->lang->project->index;
|
||||
$projectIndex = '<div class="btn-group angle-btn' . ($methodName == 'index' ? ' active' : '') . '"><div class="btn-group"><button data-toggle="dropdown" type="button" class="btn">' . $label . ' <span class="caret"></span></button>';
|
||||
$projectIndex .= '<ul class="dropdown-menu">';
|
||||
if(common::hasPriv('project', 'index')) $projectIndex .= '<li>' . html::a(helper::createLink('project', 'index', 'locate=no'), '<i class="icon icon-home"></i> ' . $this->lang->project->index) . '</li>';
|
||||
if(common::hasPriv('project', 'all')) $projectIndex .= '<li>' . html::a(helper::createLink('project', 'all', 'status=all'), '<i class="icon icon-cards-view"></i> ' . $this->lang->project->allProjects) . '</li>';
|
||||
if(common::hasPriv('project', 'create')) $projectIndex .= '<li>' . html::a(helper::createLink('project', 'create'), '<i class="icon icon-plus"></i> ' . $this->lang->project->create) . '</li>';
|
||||
|
||||
$projectIndex .= '</ul></div></div>';
|
||||
$projectIndex .= $this->select(null, $projectID, null, $moduleName, $methodName, $extra);
|
||||
$this->lang->modulePageNav = $projectIndex;
|
||||
|
||||
foreach($this->lang->project->menu as $key => $menu)
|
||||
{
|
||||
common::setMenuVars($this->lang->project->menu, $key, $projectID);
|
||||
@@ -157,24 +165,6 @@ class projectModel extends model
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set module page nav.
|
||||
*
|
||||
* @param int $activeID
|
||||
* @param string $extra
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getModuleNav($projectID, $extra = '')
|
||||
{
|
||||
$moduleName = $this->app->getModuleName();
|
||||
$methodName = $this->app->getMethodName();
|
||||
|
||||
$selectHtml = $this->select(null, $projectID, null, $moduleName, $methodName, $extra);
|
||||
|
||||
return $selectHtml; //暂时先隐藏掉迭代主页、单个创建迭代和所有迭代列表页面,统一使用计划阶段来管理
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the select code of projects.
|
||||
*
|
||||
@@ -198,8 +188,7 @@ class projectModel extends model
|
||||
|
||||
if(isset($currentProject->type) and $currentProject->type == 'program') return;
|
||||
|
||||
if(isset($currentProject->program))
|
||||
$program = $this->getByID($currentProject->program);
|
||||
if(isset($currentProject->program)) $program = $this->getByID($currentProject->program);
|
||||
|
||||
if(isset($program->category) and $program->category == 'multiple')
|
||||
{
|
||||
@@ -850,6 +839,40 @@ class projectModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get projects by program.
|
||||
*
|
||||
* @param int $program
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getProjectsByProgram($program)
|
||||
{
|
||||
$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('')
|
||||
->andWhere('t1.deleted')->eq('0')
|
||||
->orderBy('t1.order desc')
|
||||
->fetchAll('id');
|
||||
|
||||
if($program->template == 'cmmi')
|
||||
{
|
||||
foreach($projects as $projectID => $project)
|
||||
{
|
||||
if($project->parent and isset($projects[$project->id]) and isset($projects[$project->parent])) $projects[$project->id]->name = $projects[$project->parent]->name . '/' . $project->name;
|
||||
}
|
||||
if($program->category == 'multiple')
|
||||
{
|
||||
foreach($projects as $projectID => $project) $projects[$projectID]->name = $project->productName . '/' . $project->name;
|
||||
}
|
||||
foreach($projects as $projectID => $project) unset($projects[$project->parent]);
|
||||
}
|
||||
|
||||
return $projects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get projects lists grouped by product.
|
||||
*
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
</div>
|
||||
<div class='btn-toolbar pull-right'>
|
||||
<?php common::printLink('project', 'export', "status=$status&productID=$productID&orderBy=$orderBy", "<i class='icon-export muted'> </i>" . $lang->export, '', "class='btn btn-link export'")?>
|
||||
<?php common::printLink('program', 'createguide', '', "<i class='icon-plus'></i> " . $lang->project->create, '', "class='btn btn-primary' data-toggle='modal' data-type='ajax'")?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='mainContent'>
|
||||
|
||||
@@ -586,6 +586,11 @@ class upgradeModel extends model
|
||||
$this->saveLogs('Execute 12_2');
|
||||
$this->execSQL($this->getUpgradeFile('12.2'));
|
||||
$this->appendExec('12_2');
|
||||
case '20_0':
|
||||
$this->saveLogs('Execute 20_0');
|
||||
$this->execSQL($this->getUpgradeFile('20.0'));
|
||||
$this->setWork2Full();
|
||||
$this->appendExec('20_0');
|
||||
}
|
||||
|
||||
$this->deletePatch();
|
||||
@@ -757,6 +762,7 @@ class upgradeModel extends model
|
||||
$confirmContent .= file_get_contents($xuanxuanSql);
|
||||
}
|
||||
case '12_2': $confirmContent .= file_get_contents($this->getUpgradeFile('12.2'));
|
||||
case '20_0': $confirmContent .= file_get_contents($this->getUpgradeFile('20.0'));
|
||||
}
|
||||
return str_replace('zt_', $this->config->db->prefix, $confirmContent);
|
||||
}
|
||||
@@ -3766,6 +3772,7 @@ class upgradeModel extends model
|
||||
$program->name = $data->name;
|
||||
$program->code = $data->code;
|
||||
$program->template = 'scrum';
|
||||
$program->type = 'program';
|
||||
$program->category = count($productIdList) > 1 ? 'multiple' : 'single';
|
||||
$program->status = 'wait';
|
||||
$program->begin = $data->begin;
|
||||
@@ -3988,6 +3995,18 @@ class upgradeModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set work to full.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function setWork2Full()
|
||||
{
|
||||
$this->loadModel('setting')->setItem('system.common.global.flow', 'full');
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append execute for pro and biz.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user