This commit is contained in:
tianshujie98
2021-02-25 13:47:09 +08:00
47 changed files with 168 additions and 3973 deletions
-2
View File
@@ -189,7 +189,6 @@ if(!defined('TABLE_LANG')) define('TABLE_LANG', '`' . $config->db-
if(!defined('TABLE_DESIGN')) define('TABLE_DESIGN', '`' . $config->db->prefix . 'design`');
if(!defined('TABLE_DESIGNSPEC')) define('TABLE_DESIGNSPEC', '`' . $config->db->prefix . 'designspec`');
if(!defined('TABLE_PROJECTSPEC')) define('TABLE_PROJECTSPEC', '`' . $config->db->prefix . 'projectspec`');
if(!defined('TABLE_BUDGET')) define('TABLE_BUDGET', '`' . $config->db->prefix . 'budget`');
if(!defined('TABLE_SEARCHINDEX')) define('TABLE_SEARCHINDEX', $config->db->prefix . 'searchindex');
if(!defined('TABLE_SEARCHDICT')) define('TABLE_SEARCHDICT', $config->db->prefix . 'searchdict');
@@ -221,7 +220,6 @@ $config->objectTables['entry'] = TABLE_ENTRY;
$config->objectTables['webhook'] = TABLE_WEBHOOK;
$config->objectTables['design'] = TABLE_DESIGN;
$config->objectTables['stakeholder'] = TABLE_STAKEHOLDER;
$config->objectTables['budget'] = TABLE_BUDGET;
$config->objectTables['job'] = TABLE_JOB;
/* Program privs.*/
-17
View File
@@ -129,23 +129,6 @@ CREATE TABLE IF NOT EXISTS `zt_projectspec` (
UNIQUE KEY `project` (`project`,`version`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_budget`;
CREATE TABLE IF NOT EXISTS `zt_budget` (
`id` int(8) NOT NULL AUTO_INCREMENT,
`PRJ` mediumint(8) NOT NULL,
`stage` char(30) NOT NULL,
`subject` mediumint(8) NOT NULL,
`amount` char(30) NOT NULL,
`name` varchar(255) NOT NULL,
`desc` text NOT NULL,
`createdBy` char(30) NOT NULL,
`createdDate` date NOT NULL,
`lastEditedBy` char(30) NOT NULL,
`lastEditedDate` date NOT NULL,
`deleted` enum('0','1') NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
ALTER TABLE `zt_task` ADD `design` mediumint(8) unsigned NOT NULL AFTER `module`;
ALTER TABLE `zt_task` ADD `version` smallint(6) NOT NULL AFTER `desc`;
ALTER TABLE `zt_task` ADD `activatedDate` date NOT NULL AFTER `lastEditedDate`;
-16
View File
@@ -148,22 +148,6 @@ CREATE TABLE IF NOT EXISTS `zt_bug` (
KEY `result` (`result`),
KEY `assignedTo` (`assignedTo`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_budget`;
CREATE TABLE IF NOT EXISTS `zt_budget` (
`id` int(8) NOT NULL AUTO_INCREMENT,
`PRJ` mediumint(8) NOT NULL,
`stage` char(30) NOT NULL,
`subject` mediumint(8) NOT NULL,
`amount` char(30) NOT NULL,
`name` varchar(255) NOT NULL,
`desc` text NOT NULL,
`createdBy` char(30) NOT NULL,
`createdDate` date NOT NULL,
`lastEditedBy` char(30) NOT NULL,
`lastEditedDate` date NOT NULL,
`deleted` enum('0','1') NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_build`;
CREATE TABLE IF NOT EXISTS `zt_build` (
`id` mediumint(8) unsigned NOT NULL auto_increment,
-9
View File
@@ -1,9 +0,0 @@
<?php
$config->budget = new stdclass();
$config->budget->editor = new stdclass();
$config->budget->create = new stdclass();
$config->budget->editor->create = array('id' => 'desc', 'tools' => 'simpleTools');
$config->budget->editor->edit = array('id' => 'desc', 'tools' => 'simpleTools');
$config->budget->create->requiredFields = 'stage,subject,name';
-221
View File
@@ -1,221 +0,0 @@
<?php
/**
* The control file of budget currentModule 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 budget
* @version $Id: control.php 5107 2013-07-12 01:46:12Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
class budget extends control
{
/**
* __construct
*
* @param string $module
* @param string $method
* @access public
* @return void
*/
public function __construct($module = '', $method = '')
{
parent::__construct($module, $method);
$this->view->project = $this->loadModel('program')->getPRJByID($this->session->PRJ);
}
/**
* The budget browse page.
*
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @access public
* @return void
*/
public function browse($orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
$this->app->loadClass('pager', $static = true);
$pager = pager::init($recTotal, $recPerPage, $pageID);
$this->view->title = $this->lang->budget->list . $this->lang->colon . $this->lang->budget->common;
$this->view->position[] = $this->lang->budget->common;
$this->view->position[] = $this->lang->budget->list;
$this->view->budgets = $this->budget->getList($this->session->PRJ, $orderBy, $pager);
$this->view->orderBy = $orderBy;
$this->view->pager = $pager;
$this->view->modules = $this->loadModel('tree')->getOptionMenu(0, 'subject');
$this->view->stages = $this->loadModel('project')->getExecutionsByProject($this->session->PRJ, 'all', 0, true);
$this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter');
$this->display();
}
/**
* The budget summary page.
*
* @access public
* @return void
*/
public function summary()
{
$subjects = $this->budget->getSubjectStructure();
$this->view->title = $this->lang->budget->summary . $this->lang->colon . $this->lang->budget->common;
$this->view->position[] = $this->lang->budget->common;
$this->view->position[] = $this->lang->budget->summary;
$this->view->subjects = $subjects;
$this->view->hasSubSubject = $this->budget->checkSubSubject($subjects);
$this->view->plans = $this->loadModel('project')->getExecutionsByProject($this->session->PRJ, 'all', 0, true);
$this->view->summary = $this->budget->getSummary($this->session->PRJ, $subjects);
$this->view->modules = $this->loadModel('tree')->getOptionMenu(0, $viewType = 'subject', $startModuleID = 0);
$this->display();
}
/**
* Create a budget.
*
* @access public
* @return void
*/
public function create()
{
if($_POST)
{
$budgetID = $this->budget->create();
if(dao::isError())
{
$response = array('result' => 'fail', 'message' => dao::getError());
$this->send($response);
}
$this->loadModel('action')->create('budget', $budgetID, 'created');
$response = array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse'));
$this->send($response);
}
$this->view->title = $this->lang->budget->create . $this->lang->colon . $this->lang->budget->common;
$this->view->position[] = $this->lang->budget->common;
$this->view->position[] = $this->lang->budget->create;
$this->view->subjects = array(0 => '') + $this->budget->getSubjectOption();
$this->view->plans = $this->loadModel('project')->getExecutionsByProject($this->session->PRJ, 'all', 0, true);
$this->display();
}
/**
* Edit a budget.
*
* @param int $budgetID
* @access public
* @return void
*/
public function edit($budgetID)
{
if($_POST)
{
$changes = $this->budget->update($budgetID);
if(dao::isError())
{
$response = array('result' => 'fail', 'message' => dao::getError());
$this->send($response);
}
if($changes)
{
$actionID = $this->loadModel('action')->create('budget', $budgetID, 'edited');
$this->action->logHistory($actionID, $changes);
}
$response = array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse'));
$this->send($response);
}
$this->view->title = $this->lang->budget->edit . $this->lang->colon . $this->lang->budget->common;
$this->view->position[] = $this->lang->budget->common;
$this->view->position[] = $this->lang->budget->edit;
$this->view->subjects = array('' => '') + $this->budget->getSubjectOption();
$this->view->plans = $this->loadModel('project')->getExecutionsByProject($this->session->PRJ, 'all', 0, true);
$this->view->budget = $this->budget->getByID($budgetID);
$this->display();
}
/**
* Budget details.
*
* @param int $budgetID
* @access public
* @return void
*/
public function view($budgetID)
{
$this->view->title = $this->lang->budget->common . $this->lang->colon . $this->lang->budget->view;
$this->view->position[] = $this->lang->budget->common;
$this->view->position[] = $this->lang->budget->view;
$this->view->subjects = $this->budget->getSubjectOption();
$this->view->plans = $this->loadModel('project')->getExecutionsByProject($this->session->PRJ, 'all', 0, true);
$this->view->budget = $this->budget->getByID($budgetID);
$this->view->actions = $this->loadModel('action')->getList('budget', $budgetID);
$this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter');
$this->display();
}
/**
* Delete a budget.
*
* @param int $budgetID
* @param varchar $confirm
* @access public
* @return void
*/
public function delete($budgetID = 0, $confirm = 'no')
{
if($confirm == 'no')
{
echo js::confirm($this->lang->budget->confirmDelete, inLink('delete', "budgetID=$budgetID&confirm=yes"));
die();
}
else
{
$this->budget->delete(TABLE_BUDGET, $budgetID);
die(js::locate(inlink('browse'), 'parent'));
}
}
/**
* Batch create budgets.
*
* @access public
* @return void
*/
public function batchCreate()
{
if($_POST)
{
$this->budget->batchCreate();
if(dao::isError())
{
$response = array('result' => 'fail', 'message' => dao::getError());
$this->send($response);
}
$response = array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse'));
$this->send($response);
}
$this->view->title = $this->lang->budget->batchCreate . $this->lang->colon . $this->lang->budget->common;
$this->view->position[] = $this->lang->budget->common;
$this->view->position[] = $this->lang->budget->batchCreate;
$this->view->subjects = array('' => '') + $this->budget->getSubjectOption();
$this->view->plans = $this->loadModel('project')->getExecutionsByProject($this->session->PRJ, 'all', 0, true);
$this->display();
}
}
-1
View File
@@ -1 +0,0 @@
#pageNav{display: none}
-42
View File
@@ -1,42 +0,0 @@
<?php
$lang->budget->create = 'Create Budget';
$lang->budget->edit = 'Edit';
$lang->budget->total = 'Total Budget';
$lang->budget->summary = 'Summary';
$lang->budget->browse = 'Budget';
$lang->budget->list = 'Budget List';
$lang->budget->view = 'Budget Detail';
$lang->budget->delete = 'Delete';
$lang->budget->batchCreate = 'Batch Create';
$lang->budget->common = 'Estimate Cost';
$lang->budget->id = 'ID';
$lang->budget->stage = 'Stage';
$lang->budget->subject = 'Category';
$lang->budget->name = 'Item';
$lang->budget->amount = 'Estimated';
$lang->budget->desc = 'Description';
$lang->budget->CNY = 'RMB';
$lang->budget->USD = 'USD';
$lang->budget->HKD = 'HKD';
$lang->budget->NTD = 'New Taiwan';
$lang->budget->EUR = 'Euro';
$lang->budget->DEM = 'Deutsche Mark';
$lang->budget->CHF = 'Swiss Franc';
$lang->budget->FRF = 'French Franc';
$lang->budget->GBP = 'Pound';
$lang->budget->NLG = 'Florin';
$lang->budget->CAD = 'Canadian';
$lang->budget->RUR = 'Russian Ruble';
$lang->budget->INR = 'Indian';
$lang->budget->AUD = 'Australian';
$lang->budget->NZD = 'New Zealand';
$lang->budget->THB = 'Thai Baht';
$lang->budget->SGD = 'Singapore';
$lang->budget->createdBy = 'CreatedBy';
$lang->budget->createdDate = 'CreatedDate';
$lang->budget->lastEditedBy = 'LastEditBy';
$lang->budget->lastEditedDate = 'LastEditedDate';
$lang->budget->basicInfo = 'Basic Info.';
$lang->budget->summaryReport = 'Summary';
$lang->budget->confirmDelete = 'Do you want to delete it?';
-42
View File
@@ -1,42 +0,0 @@
<?php
$lang->budget->create = 'Create Budget';
$lang->budget->edit = 'Edit';
$lang->budget->total = 'Total Budget';
$lang->budget->summary = 'Summary';
$lang->budget->browse = 'Budget';
$lang->budget->list = 'Budget List';
$lang->budget->view = 'Budget Detail';
$lang->budget->delete = 'Delete';
$lang->budget->batchCreate = 'Batch Create';
$lang->budget->common = 'Estimate Cost';
$lang->budget->id = 'ID';
$lang->budget->stage = 'Stage';
$lang->budget->subject = 'Category';
$lang->budget->name = 'Item';
$lang->budget->amount = 'Estimated';
$lang->budget->desc = 'Description';
$lang->budget->CNY = 'RMB';
$lang->budget->USD = 'USD';
$lang->budget->HKD = 'HKD';
$lang->budget->NTD = 'New Taiwan';
$lang->budget->EUR = 'Euro';
$lang->budget->DEM = 'Deutsche Mark';
$lang->budget->CHF = 'Swiss Franc';
$lang->budget->FRF = 'French Franc';
$lang->budget->GBP = 'Pound';
$lang->budget->NLG = 'Florin';
$lang->budget->CAD = 'Canadian';
$lang->budget->RUR = 'Russian Ruble';
$lang->budget->INR = 'Indian';
$lang->budget->AUD = 'Australian';
$lang->budget->NZD = 'New Zealand';
$lang->budget->THB = 'Thai Baht';
$lang->budget->SGD = 'Singapore';
$lang->budget->createdBy = 'CreatedBy';
$lang->budget->createdDate = 'CreatedDate';
$lang->budget->lastEditedBy = 'LastEditBy';
$lang->budget->lastEditedDate = 'LastEditedDate';
$lang->budget->basicInfo = 'Basic Info.';
$lang->budget->summaryReport = 'Summary';
$lang->budget->confirmDelete = 'Do you want to delete it?';
-42
View File
@@ -1,42 +0,0 @@
<?php
$lang->budget->create = 'Create Budget';
$lang->budget->edit = 'Edit';
$lang->budget->total = 'Total Budget';
$lang->budget->summary = 'Summary';
$lang->budget->browse = 'Budget';
$lang->budget->list = 'Budget List';
$lang->budget->view = 'Budget Detail';
$lang->budget->delete = 'Delete';
$lang->budget->batchCreate = 'Batch Create';
$lang->budget->common = 'Estimate Cost';
$lang->budget->id = 'ID';
$lang->budget->stage = 'Stage';
$lang->budget->subject = 'Category';
$lang->budget->name = 'Item';
$lang->budget->amount = 'Estimated';
$lang->budget->desc = 'Description';
$lang->budget->CNY = 'RMB';
$lang->budget->USD = 'USD';
$lang->budget->HKD = 'HKD';
$lang->budget->NTD = 'New Taiwan';
$lang->budget->EUR = 'Euro';
$lang->budget->DEM = 'Deutsche Mark';
$lang->budget->CHF = 'Swiss Franc';
$lang->budget->FRF = 'French Franc';
$lang->budget->GBP = 'Pound';
$lang->budget->NLG = 'Florin';
$lang->budget->CAD = 'Canadian';
$lang->budget->RUR = 'Russian Ruble';
$lang->budget->INR = 'Indian';
$lang->budget->AUD = 'Australian';
$lang->budget->NZD = 'New Zealand';
$lang->budget->THB = 'Thai Baht';
$lang->budget->SGD = 'Singapore';
$lang->budget->createdBy = 'CreatedBy';
$lang->budget->createdDate = 'CreatedDate';
$lang->budget->lastEditedBy = 'LastEditBy';
$lang->budget->lastEditedDate = 'LastEditedDate';
$lang->budget->basicInfo = 'Basic Info.';
$lang->budget->summaryReport = 'Summary';
$lang->budget->confirmDelete = 'Do you want to delete it?';
-42
View File
@@ -1,42 +0,0 @@
<?php
$lang->budget->create = 'Create Budget';
$lang->budget->edit = 'Edit';
$lang->budget->total = 'Total Budget';
$lang->budget->summary = 'Summary';
$lang->budget->browse = 'Budget';
$lang->budget->list = 'Budget List';
$lang->budget->view = 'Budget Detail';
$lang->budget->delete = 'Delete';
$lang->budget->batchCreate = 'Batch Create';
$lang->budget->common = 'Estimate Cost';
$lang->budget->id = 'ID';
$lang->budget->stage = 'Stage';
$lang->budget->subject = 'Category';
$lang->budget->name = 'Item';
$lang->budget->amount = 'Estimated';
$lang->budget->desc = 'Description';
$lang->budget->CNY = 'RMB';
$lang->budget->USD = 'USD';
$lang->budget->HKD = 'HKD';
$lang->budget->NTD = 'New Taiwan';
$lang->budget->EUR = 'Euro';
$lang->budget->DEM = 'Deutsche Mark';
$lang->budget->CHF = 'Swiss Franc';
$lang->budget->FRF = 'French Franc';
$lang->budget->GBP = 'Pound';
$lang->budget->NLG = 'Florin';
$lang->budget->CAD = 'Canadian';
$lang->budget->RUR = 'Russian Ruble';
$lang->budget->INR = 'Indian';
$lang->budget->AUD = 'Australian';
$lang->budget->NZD = 'New Zealand';
$lang->budget->THB = 'Thai Baht';
$lang->budget->SGD = 'Singapore';
$lang->budget->createdBy = 'CreatedBy';
$lang->budget->createdDate = 'CreatedDate';
$lang->budget->lastEditedBy = 'LastEditBy';
$lang->budget->lastEditedDate = 'LastEditedDate';
$lang->budget->basicInfo = 'Basic Info.';
$lang->budget->summaryReport = 'Summary';
$lang->budget->confirmDelete = 'Do you want to delete it?';
-42
View File
@@ -1,42 +0,0 @@
<?php
$lang->budget->create = '新建';
$lang->budget->edit = '编辑';
$lang->budget->total = '总预算';
$lang->budget->summary = '汇总';
$lang->budget->browse = '列表';
$lang->budget->list = '列表';
$lang->budget->view = '详情';
$lang->budget->delete = '删除';
$lang->budget->batchCreate = '批量新建';
$lang->budget->common = '费用估算';
$lang->budget->id = '编号';
$lang->budget->stage = '阶段';
$lang->budget->subject = '科目';
$lang->budget->name = '费用名称';
$lang->budget->amount = '预计金额';
$lang->budget->desc = '说明';
$lang->budget->CNY = '人民币';
$lang->budget->USD = '美元';
$lang->budget->HKD = '港元';
$lang->budget->NTD = '台元';
$lang->budget->EUR = '欧元';
$lang->budget->DEM = '马克';
$lang->budget->CHF = '瑞士法郎';
$lang->budget->FRF = '法国法郎';
$lang->budget->GBP = '英镑';
$lang->budget->NLG = '荷兰盾';
$lang->budget->CAD = '加拿大元';
$lang->budget->RUR = '卢布';
$lang->budget->INR = '卢比';
$lang->budget->AUD = '澳大利亚元';
$lang->budget->NZD = '新西兰元';
$lang->budget->THB = '泰国铢';
$lang->budget->SGD = '新加坡元';
$lang->budget->createdBy = '由谁创建';
$lang->budget->createdDate = '创建时间';
$lang->budget->lastEditedBy = '由谁编辑';
$lang->budget->lastEditedDate = '编辑时间';
$lang->budget->basicInfo = '基本信息';
$lang->budget->summaryReport = '汇总表';
$lang->budget->confirmDelete = '您确定要删除吗?';
-42
View File
@@ -1,42 +0,0 @@
<?php
$lang->budget->create = '新建';
$lang->budget->edit = '編輯';
$lang->budget->total = '總預算';
$lang->budget->summary = '彙總';
$lang->budget->browse = '列表';
$lang->budget->list = '列表';
$lang->budget->view = '詳情';
$lang->budget->delete = '刪除';
$lang->budget->batchCreate = '批量新建';
$lang->budget->common = '費用估算';
$lang->budget->id = '編號';
$lang->budget->stage = '階段';
$lang->budget->subject = '科目';
$lang->budget->name = '費用名稱';
$lang->budget->amount = '預計金額';
$lang->budget->desc = '說明';
$lang->budget->CNY = '人民幣';
$lang->budget->USD = '美元';
$lang->budget->HKD = '港元';
$lang->budget->NTD = '台元';
$lang->budget->EUR = '歐元';
$lang->budget->DEM = '馬克';
$lang->budget->CHF = '瑞士法郎';
$lang->budget->FRF = '法國法郎';
$lang->budget->GBP = '英鎊';
$lang->budget->NLG = '荷蘭盾';
$lang->budget->CAD = '加拿大元';
$lang->budget->RUR = '盧布';
$lang->budget->INR = '盧比';
$lang->budget->AUD = '澳大利亞元';
$lang->budget->NZD = '新西蘭元';
$lang->budget->THB = '泰國銖';
$lang->budget->SGD = '新加坡元';
$lang->budget->createdBy = '由誰創建';
$lang->budget->createdDate = '創建時間';
$lang->budget->lastEditedBy = '由誰編輯';
$lang->budget->lastEditedDate = '編輯時間';
$lang->budget->basicInfo = '基本信息';
$lang->budget->summaryReport = '彙總表';
$lang->budget->confirmDelete = '您確定要刪除嗎?';
-268
View File
@@ -1,268 +0,0 @@
<?php
/**
* The model file of budget 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 budget
* @version $Id: model.php 5079 2013-07-10 00:44:34Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
?>
<?php
class budgetModel extends model
{
/**
* Get subject option.
*
* @access public
* @return object
*/
public function getSubjectOption()
{
$subjects = $this->loadModel('tree')->getOptionMenu(0, $viewType = 'subject', $startModuleID = 0);
$subjectList = $this->dao->select('*')->from(TABLE_MODULE)->where('id')->in(array_keys($subjects))->fetchAll();
foreach($subjectList as $subject)
{
if(isset($subjects[$subject->parent])) unset($subjects[$subject->parent]);
if($subject->grade > 2) unset($subjects[$subject->id]);
}
return $subjects;
}
/**
* Get budget by id.
*
* @param int $budgetID
* @access public
* @return array
*/
public function getByID($budgetID)
{
$budget = $this->dao->select('*')->from(TABLE_BUDGET)->where('id')->eq($budgetID)->fetch();
$budget = $this->loadModel('file')->replaceImgURL($budget, 'desc');
return $budget;
}
/**
* Get budget list.
*
* @param int $projectID
* @param string $orderBy
* @param object $pager
* @access public
* @return object
*/
public function getList($projectID, $orderBy = 'id_desc', $pager = null)
{
return $this->dao->select('*')->from(TABLE_BUDGET)->where('PRJ')->eq($projectID)->andWhere('deleted')->eq(0)->orderBy($orderBy)->page($pager)->fetchAll();
}
/**
* Get stages.
*
* @param int $projectID
* @access public
* @return array
*/
public function getStages($projectID)
{
return $this->dao->select('stage')->from(TABLE_BUDGET)->where('PRJ')->eq($projectID)->andWhere('deleted')->eq(0)->orderBy('stage_asc')->fetchPairs();
}
/**
* Get subjects.
*
* @param int $projectID
* @access public
* @return array
*/
public function getSubjectPairs($projectID)
{
return $this->dao->select('subject')->from(TABLE_BUDGET)->where('PRJ')->eq($projectID)->andWhere('deleted')->eq(0)->orderBy('subject_asc')->fetchPairs();
}
/**
* Get subject structure.
*
* @access public
* @return array
*/
public function getSubjectStructure()
{
$this->loadModel('tree');
$structure = array();
$subjectPairs = $this->getSubjectPairs($this->session->PRJ);
$subjects = $this->dao->select('*')->from(TABLE_MODULE)->where('id')->in($subjectPairs)->fetchAll('id');
foreach($subjects as $subject)
{
if($subject->grade == 1)
{
$structure[$subject->id][] = $subject->id;
continue;
}
$structure[$subject->parent][] = $subject->id;
}
return $structure;
}
/**
* Check if has sub-subjects.
*
* @param array $subjects
* @access public
* @return bool
*/
public function checkSubSubject($subjects)
{
foreach($subjects as $id => $subject)
{
if(count($subject) > 1 || $id != $subject[0]) return true;
}
return false;
}
/**
* Get summary.
*
* @param int $projectID
* @param array $subjects
* @access public
* @return array
*/
public function getSummary($projectID, $subjects)
{
$budgets = $this->dao->select('*')->from(TABLE_BUDGET)->where('PRJ')->eq($projectID)->andWhere('deleted')->eq(0)->fetchAll();
$stages = $this->getStages($this->session->PRJ);
/* Assign each subject to a stage. */
$summary['stages'] = array();
$summary['subjects'] = array();
foreach($stages as $stageID)
{
foreach($subjects as $subject)
{
foreach($subject as $children)
{
$summary['stages'][$stageID][$children] = 0;
$summary['subjects'][$children] = 0;
}
}
}
/* Count the costs incurred by a stage corresponding to a subject. */
foreach($budgets as $budget)
{
$summary['stages'][$budget->stage][$budget->subject] += $budget->amount;
$summary['subjects'][$budget->subject] += $budget->amount;
}
return $summary;
}
/**
* Create a budget.
*
* @access public
* @return int
*/
public function create()
{
$budget = fixer::input('post')
->setDefault('createdBy', $this->app->user->account)
->setDefault('createdDate', helper::today())
->setDefault('PRJ', $this->session->PRJ)
->cleanFloat('amount')
->stripTags($this->config->budget->editor->create['id'], $this->config->allowedTags)
->remove('uid')
->get();
$this->dao->insert(TABLE_BUDGET)->data($budget)
->autoCheck()
->batchCheck($this->config->budget->create->requiredFields, 'notempty')
->exec();
$budgetID = $this->dao->lastInsertID();
return $budgetID;
}
/**
* Batch create budgets.
*
* @access public
* @return bool
*/
public function batchCreate()
{
$today = helper::today();
$budgets = fixer::input('post')->get();
foreach($budgets->name as $i => $name)
{
if(!$name) continue;
$data = new stdclass();
$data->name = $name;
$data->PRJ = $this->session->PRJ;
$data->stage = $budgets->stage[$i];
$data->subject = $budgets->subject[$i];
$data->amount = (float)$budgets->amount[$i];
$data->desc = nl2br($budgets->desc[$i]);
$data->createdBy = $this->app->user->account;
$data->createdDate = $today;
foreach(explode(',', $this->config->budget->create->requiredFields) as $field)
{
$field = trim($field);
if($field and empty($data->$field))
{
dao::$errors['message'][] = sprintf($this->lang->error->notempty, $this->lang->budget->$field);
return false;
}
}
$this->dao->insert(TABLE_BUDGET)->data($data)->autoCheck()->exec();
$budgetID = $this->dao->lastInsertID();
$this->loadModel('action')->create('budget', $budgetID, 'Opened');
}
return !dao::isError();
}
/**
* Update a budget.
*
* @param int $budgetID
* @access public
* @return array
*/
public function update($budgetID)
{
$oldBudget = $this->getByID($budgetID);
$budget = fixer::input('post')
->setDefault('lastEditedBy', $this->app->user->account)
->setDefault('lastEditedDate', helper::today())
->cleanFloat('amount')
->stripTags($this->config->budget->editor->edit['id'], $this->config->allowedTags)
->remove('uid')
->get();
$this->dao->update(TABLE_BUDGET)->data($budget)
->where('id')->eq($budgetID)
->autoCheck()
->batchCheck($this->config->budget->create->requiredFields, 'notempty')
->exec();
if(!dao::isError()) return common::createChanges($oldBudget, $budget);
}
}
-56
View File
@@ -1,56 +0,0 @@
<?php
/**
* The batchCreate view of budget 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 budget
* @version $Id: batchCreate.html.php 4903 2013-06-26 05:32:59Z wyd621@gmail.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 fade">
<div class="center-block">
<div class="main-header">
<h2><?php echo $lang->budget->batchCreate;?></h2>
</div>
<form class="main-form form-ajax" method='post' enctype='multipart/form-data'>
<table class="table table-form">
<thead>
<tr>
<th class='w-40px'><?php echo $lang->idAB;?></th>
<th class='w-200px required'><?php echo $lang->budget->stage;?> </th>
<th class='w-200px required'><?php echo $lang->budget->subject;?> </th>
<th class='required'><?php echo $lang->budget->name;?> </th>
<th class='w-150px'><?php echo $lang->budget->amount;?> </th>
<th class='w-180px'><?php echo $lang->budget->desc;?> </th>
</tr>
</thead>
<tbody>
<?php for($i = 1; $i <= 10; $i++):?>
<tr>
<td><?php echo $i;?></td>
<td><?php echo html::select("stage[$i]", $plans, '', 'class="form-control chosen"');?></td>
<td><?php echo html::select("subject[$i]", $subjects, '', 'class="form-control chosen"');?></td>
<td><?php echo html::input("name[$i]", '', 'class="form-control"');?></td>
<td>
<div class='input-group'>
<?php echo html::input("amount[$i]", '', 'class="form-control"');?>
<span class='input-group-addon'><?php echo $lang->budget->{$project->budgetUnit};?></span>
</div>
</td>
<td><?php echo html::textarea("desc[$i]", '', 'class="form-control" rows=1');?></td>
</tr>
<?php endfor;?>
<tr>
<td colspan='5' 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';?>
-77
View File
@@ -1,77 +0,0 @@
<?php
/**
* The browse view of budget 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 budget
* @version $Id: browse.html.php 4903 2013-06-26 05:32:59Z wyd621@gmail.com $
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<style>
.browse-active{color: #0c64eb;font-weight: 700;}
</style>
<div id="mainMenu" class="clearfix">
<div class="pull-left">
<?php common::printLink('budget', 'summary', '', "<i class='icon-common-report icon-bar-chart muted'></i> " . $lang->budget->summary, '', "class='btn btn-link'");?>
<?php common::printLink('budget', 'browse', '', "<i class='icon icon-list-alt muted'></i> " . $lang->budget->list, '', "class='btn btn-link browse-active'");?>
</div>
<div class="btn-toolbar pull-right">
<?php common::printLink('budget', 'batchcreate', '', "<i class='icon icon-plus'></i>" . $lang->budget->batchCreate, '', "class='btn btn-secondary'");?>
<?php common::printLink('budget', 'create', '', "<i class='icon icon-plus'></i>" . $lang->budget->create, '', "class='btn btn-primary'");?>
</div>
</div>
<div id="mainContent" class="main-row fade">
<div class="main-col">
<?php if(empty($budgets)):?>
<div class="table-empty-tip">
<p>
<span class="text-muted"><?php echo $lang->noData;?></span>
<?php if(common::hasPriv('budget', 'create')):?>
<?php echo html::a($this->createLink('budget', 'create', ''), "<i class='icon icon-plus'></i> " . $lang->budget->create, '', "class='btn btn-info'");?>
<?php endif;?>
</p>
</div>
<?php else:?>
<form class='main-table' method='post' id='dataForm'>
<table class='table has-sort-head' id='dataList'>
<?php $vars = "orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
<thead>
<tr>
<th><?php echo common::printOrderLink('id', $orderBy, $vars, $lang->budget->id);?></th>
<th><?php echo common::printOrderLink('name', $orderBy, $vars, $lang->budget->name);?></th>
<th><?php echo common::printOrderLink('stage', $orderBy, $vars, $lang->budget->stage);?></th>
<th><?php echo common::printOrderLink('subject', $orderBy, $vars, $lang->budget->subject);?></th>
<th><?php echo common::printOrderLink('amount', $orderBy, $vars, $lang->budget->amount);?></th>
<th><?php echo common::printOrderLink('createdBy', $orderBy, $vars, $lang->budget->createdBy);?></th>
<th><?php echo common::printOrderLink('createdDate', $orderBy, $vars, $lang->budget->createdDate);?></th>
<th><?php echo $lang->actions;?></th>
</tr>
</thead>
<tbody>
<?php foreach($budgets as $budget):?>
<tr>
<td class='c-id'><?php printf('%03d', $budget->id);?></td>
<td><?php echo html::a($this->createLink('budget', 'view', "id=$budget->id"), $budget->name);?></td>
<td><?php echo zget($stages, $budget->stage);?></td>
<td><?php echo zget($modules, $budget->subject);?></td>
<td><?php echo $budget->amount;?></td>
<td><?php echo zget($users, $budget->createdBy);?></td>
<td><?php echo $budget->createdDate;?></td>
<td class='c-actions'>
<?php common::printIcon('budget', 'edit', "id=$budget->id", $budget, 'list');?>
<?php common::printIcon('budget', 'delete', "id=$budget->id", $budget, 'list', '', 'hiddenwin');?>
</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<div class="table-footer"><?php $pager->show('right', 'pagerjs');?></div>
</form>
<?php endif;?>
</div>
</div>
<?php include '../../common/view/footer.html.php';?>
-58
View File
@@ -1,58 +0,0 @@
<?php
/**
* The create view of budget 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 budget
* @version $Id: create.html.php 4903 2013-06-26 05:32:59Z wyd621@gmail.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 fade">
<div class="center-block">
<div class="main-header">
<h2><?php echo $lang->budget->create . $lang->budget->common;?></h2>
</div>
<form class="main-form form-ajax" method='post' enctype='multipart/form-data'>
<table class="table table-form">
<tbody>
<tr>
<th class='w-120px'><?php echo $lang->budget->stage;?> </th>
<td><?php echo html::select('stage', $plans, '', 'class="form-control chosen"');?></td>
<td></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->budget->subject;?> </th>
<td><?php echo html::select('subject', $subjects, '', 'class="form-control chosen"');?></td>
</tr>
<tr>
<th><?php echo $lang->budget->amount;?> </th>
<td>
<div class='input-group'>
<?php echo html::input('amount', '', 'class="form-control"');?>
<span class='input-group-addon'><?php echo $lang->budget->{$project->budgetUnit};?></span>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->budget->name;?> </th>
<td colspan='2'><?php echo html::input('name', '', 'class="form-control"');?></td>
</tr>
<tr>
<th><?php echo $lang->budget->desc;?> </th>
<td colspan='2'><?php echo html::textarea('desc', '', 'class="form-control"');?></td>
</tr>
<tr>
<td colspan='4' 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';?>
-58
View File
@@ -1,58 +0,0 @@
<?php
/**
* The edit view of budget 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 budget
* @version $Id: edit.html.php 4903 2013-06-26 05:32:59Z wyd621@gmail.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 fade">
<div class="center-block">
<div class="main-header">
<h2><?php echo $lang->budget->edit . $lang->budget->common;?></h2>
</div>
<form class="main-form form-ajax" method='post' enctype='multipart/form-data'>
<table class="table table-form">
<tbody>
<tr>
<th class='w-120px'><?php echo $lang->budget->stage;?> </th>
<td><?php echo html::select('stage', $plans, $budget->stage, 'class="form-control chosen"');?></td>
<td></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->budget->subject;?> </th>
<td><?php echo html::select('subject', $subjects, $budget->subject, 'class="form-control chosen"');?></td>
</tr>
<tr>
<th><?php echo $lang->budget->amount;?> </th>
<td>
<div class='input-group'>
<?php echo html::input('amount', $budget->amount, 'class="form-control"');?>
<span class='input-group-addon'><?php echo $lang->budget->{$project->budgetUnit};?></span>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->budget->name;?> </th>
<td colspan='2'><?php echo html::input('name', $budget->name, 'class="form-control"');?></td>
</tr>
<tr>
<th><?php echo $lang->budget->desc;?> </th>
<td colspan='2'><?php echo html::textarea('desc', $budget->desc, 'class="form-control"');?></td>
</tr>
<tr>
<td colspan='4' 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';?>
-76
View File
@@ -1,76 +0,0 @@
<?php
/**
* The summary view of budget 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 budget
* @version $Id: summary.html.php 4903 2013-06-26 05:32:59Z wyd621@gmail.com $
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<style>
.summary-active{color: #0c64eb;font-weight: 700;}
.summary td{font-weight: 700;}
.table-title{background: #efefef}
.text-center th{vertical-align: middle;}
</style>
<div id="mainMenu" class="clearfix">
<div class="pull-left">
<?php common::printLink('budget', 'summary', '', "<i class='icon-common-report icon-bar-chart muted'></i> " . $lang->budget->summary, '', "class='btn btn-link summary-active'");?>
<?php common::printLink('budget', 'browse', '', "<i class='icon icon-list-alt muted'></i> " . $lang->budget->list, '', "class='btn btn-link'");?>
</div>
<div class="btn-toolbar pull-right">
<?php common::printLink('budget', 'batchcreate', '', "<i class='icon icon-plus'></i>" . $lang->budget->batchCreate, '', "class='btn btn-secondary'");?>
<?php common::printLink('budget', 'create', '', "<i class='icon icon-plus'></i>" . $lang->budget->create, '', "class='btn btn-primary'");?>
</div>
</div>
<div id='mainContent' class='main-content'>
<div class="center-block">
<?php if(!empty($subjects)):?>
<table class='table table-bordered'>
<tr class='text-center table-title'>
<th rowspan="<?php echo $hasSubSubject ? 2 : 1;?>"><?php echo $lang->budget->subject . '/' . $lang->budget->stage;?></th>
<?php foreach($subjects as $id => $subject):?>
<th colspan="<?php echo count($subject);?>"><?php echo zget($modules, $id);?></th>
<?php endforeach;?>
<th rowspan="<?php echo $hasSubSubject ? 2 : 1;?>"><?php echo $lang->budget->summary;?></th>
</tr>
<tr class='text-center table-title'>
<?php foreach($subjects as $id => $subject):?>
<?php if($id == $subject[0] && !$hasSubSubject) continue;?>
<?php foreach($subject as $subjectID):?>
<th><?php echo zget($modules, $subjectID);?></th>
<?php endforeach;?>
<?php endforeach;?>
</tr>
<?php foreach($summary['stages'] as $stageID => $subject):?>
<tr>
<td><?php echo zget($plans, $stageID, $stageID);?></td>
<?php foreach($subject as $cost):?>
<td><?php echo $cost;?></td>
<?php endforeach;?>
<td><?php echo array_sum($subject);?></td>
</tr>
<?php endforeach;?>
<tr class='summary'>
<td><?php echo $lang->budget->summary;?></td>
<?php foreach($summary['subjects'] as $cost):?>
<td><?php echo $cost;?></td>
<?php endforeach;?>
<td><?php echo array_sum($summary['subjects']);?></td>
</tr>
</table>
<div class='alert alert-info mg-0'><?php echo $lang->budget->total . '' . array_sum($summary['subjects']) . $lang->budget->{$project->budgetUnit};?></div>
<?php else:?>
<div class="table-empty-tip">
<p>
<span class="text-muted"><?php echo $lang->noData;?></span>
</p>
</div>
<?php endif;?>
</div>
</div>
<?php include '../../common/view/footer.html.php';?>
-78
View File
@@ -1,78 +0,0 @@
<?php
/**
* The view file of budget 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 budget
* @version $Id: view.html.php 4728 2013-05-03 06:14:34Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<?php $browseLink = inlink('browse');?>
<div id="mainMenu" class="clearfix">
<div class="btn-toolbar pull-left">
<?php common::printBack($browseLink, 'btn btn-secondary');?>
<div class='divider'></div>
<div class="page-title">
<span class="label label-id"><?php echo $budget->id?></span>
<span class="text" title="<?php echo $budget->name;?>"><?php echo $budget->name;?></span>
</div>
</div>
</div>
<div id="mainContent" class="main-row">
<div class="col-8 main-col">
<div class="cell">
<div class="detail">
<div class="detail-title"><?php echo $lang->budget->desc;?></div>
<div class="detail-content article-content">
<?php echo $budget->desc;?>
</div>
</div>
</div>
<div class='cell'><?php include '../../common/view/action.html.php';?></div>
</div>
<div class="side-col col-4">
<div class="cell">
<div class='detail'>
<div class='detail-title'><?php echo $lang->budget->basicInfo;?></div>
<table class="table table-data">
<tbody>
<tr>
<th><?php echo $lang->budget->stage;?></th>
<td><?php echo zget($plans, $budget->stage);?></td>
</tr>
<tr>
<th><?php echo $lang->budget->subject;?></th>
<td><?php echo zget($subjects, $budget->subject);?></td>
</tr>
<tr>
<th><?php echo $lang->budget->amount;?></th>
<td><?php echo $budget->amount;?></td>
</tr>
<tr>
<th><?php echo $lang->budget->createdBy;?></th>
<td><?php echo zget($users, $budget->createdBy);?></td>
</tr>
<tr>
<th><?php echo $lang->budget->createdDate;?></th>
<td><?php echo $budget->createdDate;?></td>
</tr>
<tr>
<th><?php echo $lang->budget->lastEditedBy;?></th>
<td><?php echo zget($users, $budget->lastEditedBy);?></td>
</tr>
<tr>
<th><?php echo $lang->budget->lastEditedDate;?></th>
<td><?php echo $budget->lastEditedDate;?></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php include '../../common/view/footer.html.php';?>
-17
View File
@@ -663,9 +663,6 @@ $lang->navGroup->deploy = 'project';
$lang->navGroup->stakeholder = 'project';
$lang->navGroup->projectstory = 'project';
$lang->navGroup->programplan = 'project';
$lang->navGroup->workestimation = 'project';
$lang->navGroup->budget = 'project';
$lang->navGroup->review = 'project';
$lang->navGroup->reviewissue = 'project';
$lang->navGroup->milestone = 'project';
@@ -934,9 +931,6 @@ $lang->scrum->setMenu->members = array('link' => 'Member|program|PRJManageMemb
$lang->scrum->setMenu->whitelist = array('link' => 'White List|program|PRJWhitelist|project={PROJECT}', 'subModule' => 'personnel');
$lang->waterfallproduct = new stdclass();
$lang->workestimation = new stdclass();
$lang->budget = new stdclass();
$lang->programplan = new stdclass();
$lang->review = new stdclass();
$lang->milestone = new stdclass();
$lang->design = new stdclass();
@@ -947,9 +941,6 @@ $lang->pssp = new stdclass();
$lang->stakeholder = new stdclass();
$lang->projectstory = new stdclass();
$lang->workestimation->menu = new stdclass();
$lang->budget->menu = new stdclass();
$lang->programplan->menu = new stdclass();
$lang->review->menu = new stdclass();
$lang->milestone->menu = new stdclass();
$lang->design->menu = new stdclass();
@@ -960,17 +951,9 @@ $lang->stakeholder->menu = new stdclass();
$lang->waterfallproduct->menu = new stdclass();
$lang->projectstory->menu = new stdclass();
$lang->workestimation->menu->workestimation = 'Work Estimation|workestimation|index|project={PROJECT}';
$lang->workestimation->menu->budget = array('link' => 'Budget|budget|summary|', 'subModule' => 'budget');
$lang->budget->menu = $lang->workestimation->menu;
$lang->stakeholder->menu->list = array('link' => 'Stakeholder List|stakeholder|browse|', 'alias' => 'create,edit,view,batchcreate');
$lang->stakeholder->menu->issue = array('link' => 'Issue|stakeholder|issue|');
$lang->programplan->menu->gantt = array('link' => 'Gantt|programplan|browse|programID={PROJECT}&productID={PRODUCT}&type=gantt');
$lang->programplan->menu->lists = array('link' => 'Stage|programplan|browse|programID={PROJECT}&productID={PRODUCT}&type=lists', 'alias' => 'create');
$lang->design->menu->all = array('link' => 'All|design|browse|productID={PRODUCT}&browseType=all');
$lang->design->menu->hlds = array('link' => 'HLDS|design|browse|productID={PRODUCT}&browseType=HLDS');
$lang->design->menu->dds = array('link' => 'DDS|design|browse|productID={PRODUCT}&browseType=DDS');
-17
View File
@@ -663,9 +663,6 @@ $lang->navGroup->deploy = 'project';
$lang->navGroup->stakeholder = 'project';
$lang->navGroup->projectstory = 'project';
$lang->navGroup->programplan = 'project';
$lang->navGroup->workestimation = 'project';
$lang->navGroup->budget = 'project';
$lang->navGroup->review = 'project';
$lang->navGroup->reviewissue = 'project';
$lang->navGroup->milestone = 'project';
@@ -934,9 +931,6 @@ $lang->scrum->setMenu->members = array('link' => 'Member|program|PRJManageMemb
$lang->scrum->setMenu->whitelist = array('link' => 'White List|program|PRJWhitelist|project={PROJECT}', 'subModule' => 'personnel');
$lang->waterfallproduct = new stdclass();
$lang->workestimation = new stdclass();
$lang->budget = new stdclass();
$lang->programplan = new stdclass();
$lang->review = new stdclass();
$lang->milestone = new stdclass();
$lang->design = new stdclass();
@@ -947,9 +941,6 @@ $lang->pssp = new stdclass();
$lang->stakeholder = new stdclass();
$lang->projectstory = new stdclass();
$lang->workestimation->menu = new stdclass();
$lang->budget->menu = new stdclass();
$lang->programplan->menu = new stdclass();
$lang->review->menu = new stdclass();
$lang->milestone->menu = new stdclass();
$lang->design->menu = new stdclass();
@@ -960,17 +951,9 @@ $lang->stakeholder->menu = new stdclass();
$lang->waterfallproduct->menu = new stdclass();
$lang->projectstory->menu = new stdclass();
$lang->workestimation->menu->workestimation = 'Work Estimation|workestimation|index|project={PROJECT}';
$lang->workestimation->menu->budget = array('link' => 'Budget|budget|summary|', 'subModule' => 'budget');
$lang->budget->menu = $lang->workestimation->menu;
$lang->stakeholder->menu->list = array('link' => 'Stakeholder List|stakeholder|browse|', 'alias' => 'create,edit,view,batchcreate');
$lang->stakeholder->menu->issue = array('link' => 'Issue|stakeholder|issue|');
$lang->programplan->menu->gantt = array('link' => 'Gantt|programplan|browse|programID={PROJECT}&productID={PRODUCT}&type=gantt');
$lang->programplan->menu->lists = array('link' => 'Stage|programplan|browse|programID={PROJECT}&productID={PRODUCT}&type=lists', 'alias' => 'create');
$lang->design->menu->all = array('link' => 'All|design|browse|productID={PRODUCT}&browseType=all');
$lang->design->menu->hlds = array('link' => 'HLDS|design|browse|productID={PRODUCT}&browseType=HLDS');
$lang->design->menu->dds = array('link' => 'DDS|design|browse|productID={PRODUCT}&browseType=DDS');
-17
View File
@@ -663,9 +663,6 @@ $lang->navGroup->deploy = 'project';
$lang->navGroup->stakeholder = 'project';
$lang->navGroup->projectstory = 'project';
$lang->navGroup->programplan = 'project';
$lang->navGroup->workestimation = 'project';
$lang->navGroup->budget = 'project';
$lang->navGroup->review = 'project';
$lang->navGroup->reviewissue = 'project';
$lang->navGroup->milestone = 'project';
@@ -934,9 +931,6 @@ $lang->scrum->setMenu->members = array('link' => 'Member|program|PRJManageMemb
$lang->scrum->setMenu->whitelist = array('link' => 'White List|program|PRJWhitelist|project={PROJECT}', 'subModule' => 'personnel');
$lang->waterfallproduct = new stdclass();
$lang->workestimation = new stdclass();
$lang->budget = new stdclass();
$lang->programplan = new stdclass();
$lang->review = new stdclass();
$lang->milestone = new stdclass();
$lang->design = new stdclass();
@@ -947,9 +941,6 @@ $lang->pssp = new stdclass();
$lang->stakeholder = new stdclass();
$lang->projectstory = new stdclass();
$lang->workestimation->menu = new stdclass();
$lang->budget->menu = new stdclass();
$lang->programplan->menu = new stdclass();
$lang->review->menu = new stdclass();
$lang->milestone->menu = new stdclass();
$lang->design->menu = new stdclass();
@@ -960,17 +951,9 @@ $lang->stakeholder->menu = new stdclass();
$lang->waterfallproduct->menu = new stdclass();
$lang->projectstory->menu = new stdclass();
$lang->workestimation->menu->workestimation = 'Work Estimation|workestimation|index|project={PROJECT}';
$lang->workestimation->menu->budget = array('link' => 'Budget|budget|summary|', 'subModule' => 'budget');
$lang->budget->menu = $lang->workestimation->menu;
$lang->stakeholder->menu->list = array('link' => 'Stakeholder List|stakeholder|browse|', 'alias' => 'create,edit,view,batchcreate');
$lang->stakeholder->menu->issue = array('link' => 'Issue|stakeholder|issue|');
$lang->programplan->menu->gantt = array('link' => 'Gantt|programplan|browse|programID={PROJECT}&productID={PRODUCT}&type=gantt');
$lang->programplan->menu->lists = array('link' => 'Stage|programplan|browse|programID={PROJECT}&productID={PRODUCT}&type=lists', 'alias' => 'create');
$lang->design->menu->all = array('link' => 'All|design|browse|productID={PRODUCT}&browseType=all');
$lang->design->menu->hlds = array('link' => 'HLDS|design|browse|productID={PRODUCT}&browseType=HLDS');
$lang->design->menu->dds = array('link' => 'DDS|design|browse|productID={PRODUCT}&browseType=DDS');
-14
View File
@@ -11,20 +11,6 @@ $lang->mainNav->menuOrder[70] = 'admin';
if($config->systemMode == 'new') $lang->mainNav->menuOrder[10] = 'program';
/* Sort of main menu. */
$lang->waterfall->menuOrder[5] = 'programindex';
$lang->waterfall->menuOrder[10] = 'programplan';
$lang->waterfall->menuOrder[15] = 'project';
$lang->waterfall->menuOrder[20] = 'projectstory';
$lang->waterfall->menuOrder[25] = 'design';
$lang->waterfall->menuOrder[30] = 'ci';
$lang->waterfall->menuOrder[35] = 'track';
$lang->waterfall->menuOrder[40] = 'qa';
$lang->waterfall->menuOrder[45] = 'doc';
$lang->waterfall->menuOrder[50] = 'projectbuild';
$lang->waterfall->menuOrder[55] = 'projectrelease';
$lang->waterfall->menuOrder[65] = 'other';
$lang->waterfall->menuOrder[70] = 'projectsetting';
$lang->scrum->menuOrder[5] = 'programindex';
$lang->scrum->menuOrder[10] = 'project';
$lang->scrum->menuOrder[15] = 'projectstory';
-17
View File
@@ -663,9 +663,6 @@ $lang->navGroup->deploy = 'project';
$lang->navGroup->stakeholder = 'project';
$lang->navGroup->projectstory = 'project';
$lang->navGroup->programplan = 'project';
$lang->navGroup->workestimation = 'project';
$lang->navGroup->budget = 'project';
$lang->navGroup->review = 'project';
$lang->navGroup->reviewissue = 'project';
$lang->navGroup->milestone = 'project';
@@ -933,9 +930,6 @@ $lang->scrum->setMenu->members = array('link' => 'Member|program|PRJManageMemb
$lang->scrum->setMenu->whitelist = array('link' => 'White List|program|PRJWhitelist|project={PROJECT}', 'subModule' => 'personnel');
$lang->waterfallproduct = new stdclass();
$lang->workestimation = new stdclass();
$lang->budget = new stdclass();
$lang->programplan = new stdclass();
$lang->review = new stdclass();
$lang->milestone = new stdclass();
$lang->design = new stdclass();
@@ -946,9 +940,6 @@ $lang->pssp = new stdclass();
$lang->stakeholder = new stdclass();
$lang->projectstory = new stdclass();
$lang->workestimation->menu = new stdclass();
$lang->budget->menu = new stdclass();
$lang->programplan->menu = new stdclass();
$lang->review->menu = new stdclass();
$lang->milestone->menu = new stdclass();
$lang->design->menu = new stdclass();
@@ -959,17 +950,9 @@ $lang->stakeholder->menu = new stdclass();
$lang->waterfallproduct->menu = new stdclass();
$lang->projectstory->menu = new stdclass();
$lang->workestimation->menu->workestimation = 'Work Estimation|workestimation|index|project={PROJECT}';
$lang->workestimation->menu->budget = array('link' => 'Budget|budget|summary|', 'subModule' => 'budget');
$lang->budget->menu = $lang->workestimation->menu;
$lang->stakeholder->menu->list = array('link' => 'Stakeholder List|stakeholder|browse|', 'alias' => 'create,edit,view,batchcreate');
$lang->stakeholder->menu->issue = array('link' => 'Issue|stakeholder|issue|');
$lang->programplan->menu->gantt = array('link' => 'Gantt|programplan|browse|programID={PROJECT}&productID={PRODUCT}&type=gantt');
$lang->programplan->menu->lists = array('link' => 'Stage|programplan|browse|programID={PROJECT}&productID={PRODUCT}&type=lists', 'alias' => 'create');
$lang->design->menu->all = array('link' => 'All|design|browse|productID={PRODUCT}&browseType=all');
$lang->design->menu->hlds = array('link' => 'HLDS|design|browse|productID={PRODUCT}&browseType=HLDS');
$lang->design->menu->dds = array('link' => 'DDS|design|browse|productID={PRODUCT}&browseType=DDS');
-17
View File
@@ -661,9 +661,6 @@ $lang->navGroup->deploy = 'project';
$lang->navGroup->stakeholder = 'project';
$lang->navGroup->projectstory = 'project';
$lang->navGroup->programplan = 'project';
$lang->navGroup->workestimation = 'project';
$lang->navGroup->budget = 'project';
$lang->navGroup->review = 'project';
$lang->navGroup->reviewissue = 'project';
$lang->navGroup->milestone = 'project';
@@ -932,9 +929,6 @@ $lang->scrum->setMenu->members = array('link' => '团队|program|PRJManag
$lang->scrum->setMenu->whitelist = array('link' => '白名单|program|PRJWhitelist|project={PROJECT}', 'subModule' => 'personnel');
$lang->waterfallproduct = new stdclass();
$lang->workestimation = new stdclass();
$lang->budget = new stdclass();
$lang->programplan = new stdclass();
$lang->review = new stdclass();
$lang->milestone = new stdclass();
$lang->design = new stdclass();
@@ -945,9 +939,6 @@ $lang->pssp = new stdclass();
$lang->stakeholder = new stdclass();
$lang->projectstory = new stdclass();
$lang->workestimation->menu = new stdclass();
$lang->budget->menu = new stdclass();
$lang->programplan->menu = new stdclass();
$lang->review->menu = new stdclass();
$lang->milestone->menu = new stdclass();
$lang->design->menu = new stdclass();
@@ -958,17 +949,9 @@ $lang->stakeholder->menu = new stdclass();
$lang->waterfallproduct->menu = new stdclass();
$lang->projectstory->menu = new stdclass();
$lang->workestimation->menu->workestimation = '工作量估算|workestimation|index|project={PROJECT}';
$lang->workestimation->menu->budget = array('link' => '费用估算|budget|summary|', 'subModule' => 'budget');
$lang->budget->menu = $lang->workestimation->menu;
$lang->stakeholder->menu->list = array('link' => '干系人列表|stakeholder|browse|', 'alias' => 'create,edit,view,batchcreate');
$lang->stakeholder->menu->issue = array('link' => '问题管理|stakeholder|issue|');
$lang->programplan->menu->gantt = array('link' => '甘特图|programplan|browse|programID={PROJECT}&productID={PRODUCT}&type=gantt');
$lang->programplan->menu->lists = array('link' => '阶段列表|programplan|browse|programID={PROJECT}&productID={PRODUCT}&type=lists', 'alias' => 'create');
$lang->design->menu->all = array('link' => '所有|design|browse|productID={PRODUCT}&browseType=all');
$lang->design->menu->hlds = array('link' => '概要设计|design|browse|productID={PRODUCT}&browseType=HLDS');
$lang->design->menu->dds = array('link' => '详细设计|design|browse|productID={PRODUCT}&browseType=DDS');
+1 -1
View File
@@ -40,7 +40,7 @@ $lang->custom->setStoryConcept = "设置需求概念";
$lang->custom->setDefaultConcept = "设置默认概念";
$lang->custom->browseStoryConcept = "需求概念列表";
$lang->custom->deleteStoryConcept = "删除需求概念";
$lang->custom->configureScrum = "敏捷模型自定义";
$lang->custom->configureScrum = "项目概念";
$lang->custom->URConcept = "用需概念";
$lang->custom->SRConcept = "软需概念";
$lang->custom->oneUnit = "一个{$lang->hourCommon}";
+149 -203
View File
@@ -61,8 +61,6 @@ $lang->moduleOrder[195] = 'cron';
$lang->moduleOrder[200] = 'dev';
$lang->moduleOrder[205] = 'message';
$lang->moduleOrder[210] = 'design';
$lang->moduleOrder[215] = 'programplan';
$lang->moduleOrder[235] = 'budget';
$lang->resource = new stdclass();
@@ -157,136 +155,160 @@ $lang->todo->methodOrder[70] = 'activate';
$lang->todo->methodOrder[75] = 'close';
$lang->todo->methodOrder[80] = 'batchClose';
/* Program. */
$lang->resource->program = new stdclass();
$lang->resource->program->createGuide = 'createGuide';
//$lang->resource->program->PGMIndex = 'PGMIndex';
$lang->resource->program->PGMBrowse = 'PGMBrowse';
$lang->resource->program->PGMProduct = 'PGMProduct';
$lang->resource->program->PGMCreate = 'PGMCreate';
$lang->resource->program->PGMEdit = 'PGMEdit';
$lang->resource->program->PGMStart = 'PGMStart';
$lang->resource->program->PGMSuspend = 'PGMSuspend';
$lang->resource->program->PGMActivate = 'PGMActivate';
$lang->resource->program->PGMClose = 'PGMClose';
$lang->resource->program->PGMDelete = 'PGMDelete';
$lang->resource->program->PGMProject = 'PGMProject';
$lang->resource->program->PGMStakeholder = 'PGMStakeholder';
$lang->resource->program->createStakeholder = 'createStakeholder';
$lang->resource->program->unlinkStakeholder = 'unlinkStakeholder';
$lang->resource->program->batchUnlinkStakeholders = 'batchUnlinkStakeholders';
$lang->resource->program->export = 'export';
$lang->resource->program->index = 'PRJIndex';
$lang->resource->program->PRJBrowse = 'PRJBrowse';
$lang->resource->program->PRJProgramTitle = 'PRJModuleOpen';
$lang->resource->program->PRJCreate = 'PRJCreate';
$lang->resource->program->PRJEdit = 'PRJEdit';
$lang->resource->program->PRJBatchEdit = 'PRJBatchEdit';
$lang->resource->program->PRJGroup = 'PRJGroup';
$lang->resource->program->PRJCreateGroup = 'PRJCreateGroup';
$lang->resource->program->PRJManageView = 'PRJManageView';
$lang->resource->program->PRJManagePriv = 'PRJManagePriv';
$lang->resource->program->PRJManageMembers = 'PRJManageMembers';
$lang->resource->program->PRJManageGroupMember = 'PRJManageGroupMember';
$lang->resource->program->PRJCopyGroup = 'PRJCopyGroup';
$lang->resource->program->PRJEditGroup = 'PRJEditGroup';
$lang->resource->program->PRJStart = 'PRJStart';
$lang->resource->program->PRJSuspend = 'PRJSuspend';
$lang->resource->program->PRJClose = 'PRJClose';
$lang->resource->program->PRJActivate = 'PRJActivate';
$lang->resource->program->PRJDelete = 'PRJDelete';
$lang->resource->program->PRJView = 'PRJView';
$lang->resource->program->PRJWhitelist = 'PRJWhitelist';
$lang->resource->program->PRJAddWhitelist = 'PRJAddWhitelist';
$lang->resource->program->unbindWhielist = 'unbindWhielist';
$lang->resource->program->PRJManageProducts = 'PRJManageProducts';
$lang->resource->program->view = 'view';
global $config;
if($config->systemMode == 'new')
{
/* Program. */
$lang->resource->program = new stdclass();
$lang->resource->program->createGuide = 'createGuide';
//$lang->resource->program->PGMIndex = 'PGMIndex';
$lang->resource->program->PGMBrowse = 'PGMBrowse';
$lang->resource->program->PGMProduct = 'PGMProduct';
$lang->resource->program->PGMCreate = 'PGMCreate';
$lang->resource->program->PGMEdit = 'PGMEdit';
$lang->resource->program->PGMStart = 'PGMStart';
$lang->resource->program->PGMSuspend = 'PGMSuspend';
$lang->resource->program->PGMActivate = 'PGMActivate';
$lang->resource->program->PGMClose = 'PGMClose';
$lang->resource->program->PGMDelete = 'PGMDelete';
$lang->resource->program->PGMProject = 'PGMProject';
$lang->resource->program->PGMStakeholder = 'PGMStakeholder';
$lang->resource->program->createStakeholder = 'createStakeholder';
$lang->resource->program->unlinkStakeholder = 'unlinkStakeholder';
$lang->resource->program->batchUnlinkStakeholders = 'batchUnlinkStakeholders';
$lang->resource->program->export = 'export';
$lang->resource->program->index = 'PRJIndex';
$lang->resource->program->PRJBrowse = 'PRJBrowse';
$lang->resource->program->PRJProgramTitle = 'PRJModuleOpen';
$lang->resource->program->PRJCreate = 'PRJCreate';
$lang->resource->program->PRJEdit = 'PRJEdit';
$lang->resource->program->PRJBatchEdit = 'PRJBatchEdit';
$lang->resource->program->PRJGroup = 'PRJGroup';
$lang->resource->program->PRJCreateGroup = 'PRJCreateGroup';
$lang->resource->program->PRJManageView = 'PRJManageView';
$lang->resource->program->PRJManagePriv = 'PRJManagePriv';
$lang->resource->program->PRJManageMembers = 'PRJManageMembers';
$lang->resource->program->PRJManageGroupMember = 'PRJManageGroupMember';
$lang->resource->program->PRJCopyGroup = 'PRJCopyGroup';
$lang->resource->program->PRJEditGroup = 'PRJEditGroup';
$lang->resource->program->PRJStart = 'PRJStart';
$lang->resource->program->PRJSuspend = 'PRJSuspend';
$lang->resource->program->PRJClose = 'PRJClose';
$lang->resource->program->PRJActivate = 'PRJActivate';
$lang->resource->program->PRJDelete = 'PRJDelete';
$lang->resource->program->PRJView = 'PRJView';
$lang->resource->program->PRJWhitelist = 'PRJWhitelist';
$lang->resource->program->PRJAddWhitelist = 'PRJAddWhitelist';
$lang->resource->program->unbindWhielist = 'unbindWhielist';
$lang->resource->program->PRJManageProducts = 'PRJManageProducts';
$lang->resource->program->view = 'view';
$lang->program->methodOrder[0] = 'createGuide';
//$lang->program->methodOrder[5] = 'PGMIndex';
$lang->program->methodOrder[10] = 'PGMBrowse';
$lang->program->methodOrder[15] = 'PGMProduct';
$lang->program->methodOrder[20] = 'PGMCreate';
$lang->program->methodOrder[25] = 'PGMEdit';
$lang->program->methodOrder[30] = 'PGMStart';
$lang->program->methodOrder[35] = 'PGMSuspend';
$lang->program->methodOrder[40] = 'PGMClose';
$lang->program->methodOrder[45] = 'PGMActivate';
$lang->program->methodOrder[55] = 'PGMDelete';
$lang->program->methodOrder[60] = 'PGMProject';
$lang->program->methodOrder[65] = 'PGMStakeholder';
$lang->program->methodOrder[67] = 'createStakeholder';
$lang->program->methodOrder[70] = 'unlinkStakeholder';
$lang->program->methodOrder[75] = 'batchUnlinkStakeholders';
$lang->program->methodOrder[80] = 'export';
$lang->program->methodOrder[85] = 'PRJIndex';
$lang->program->methodOrder[90] = 'PRJBrowse';
$lang->program->methodOrder[95] = 'PRJProgramTitle';
$lang->program->methodOrder[100] = 'PRJCreate';
$lang->program->methodOrder[105] = 'PRJEdit';
$lang->program->methodOrder[106] = 'PRJBatchEdit';
$lang->program->methodOrder[110] = 'PRJGroup';
$lang->program->methodOrder[115] = 'PRJCreateGroup';
$lang->program->methodOrder[120] = 'PRJManageView';
$lang->program->methodOrder[125] = 'PRJManagePriv';
$lang->program->methodOrder[130] = 'PRJManageMembers';
$lang->program->methodOrder[135] = 'PRJManageGroupMember';
$lang->program->methodOrder[140] = 'PRJCopyGroup';
$lang->program->methodOrder[145] = 'PRJEditGroup';
$lang->program->methodOrder[150] = 'PRJStart';
$lang->program->methodOrder[155] = 'PRJSuspend';
$lang->program->methodOrder[160] = 'PRJClose';
$lang->program->methodOrder[165] = 'PRJActivate';
$lang->program->methodOrder[170] = 'PRJUpdateOrder';
$lang->program->methodOrder[175] = 'PRJDelete';
$lang->program->methodOrder[180] = 'PRJView';
$lang->program->methodOrder[185] = 'PRJWhitelist';
$lang->program->methodOrder[190] = 'PRJAddWhitelist';
$lang->program->methodOrder[195] = 'unbindWhielist';
$lang->program->methodOrder[200] = 'PRJManageProducts';
$lang->program->methodOrder[205] = 'view';
$lang->program->methodOrder[0] = 'createGuide';
//$lang->program->methodOrder[5] = 'PGMIndex';
$lang->program->methodOrder[10] = 'PGMBrowse';
$lang->program->methodOrder[15] = 'PGMProduct';
$lang->program->methodOrder[20] = 'PGMCreate';
$lang->program->methodOrder[25] = 'PGMEdit';
$lang->program->methodOrder[30] = 'PGMStart';
$lang->program->methodOrder[35] = 'PGMSuspend';
$lang->program->methodOrder[40] = 'PGMClose';
$lang->program->methodOrder[45] = 'PGMActivate';
$lang->program->methodOrder[55] = 'PGMDelete';
$lang->program->methodOrder[60] = 'PGMProject';
$lang->program->methodOrder[65] = 'PGMStakeholder';
$lang->program->methodOrder[67] = 'createStakeholder';
$lang->program->methodOrder[70] = 'unlinkStakeholder';
$lang->program->methodOrder[75] = 'batchUnlinkStakeholders';
$lang->program->methodOrder[80] = 'export';
$lang->program->methodOrder[85] = 'PRJIndex';
$lang->program->methodOrder[90] = 'PRJBrowse';
$lang->program->methodOrder[95] = 'PRJProgramTitle';
$lang->program->methodOrder[100] = 'PRJCreate';
$lang->program->methodOrder[105] = 'PRJEdit';
$lang->program->methodOrder[106] = 'PRJBatchEdit';
$lang->program->methodOrder[110] = 'PRJGroup';
$lang->program->methodOrder[115] = 'PRJCreateGroup';
$lang->program->methodOrder[120] = 'PRJManageView';
$lang->program->methodOrder[125] = 'PRJManagePriv';
$lang->program->methodOrder[130] = 'PRJManageMembers';
$lang->program->methodOrder[135] = 'PRJManageGroupMember';
$lang->program->methodOrder[140] = 'PRJCopyGroup';
$lang->program->methodOrder[145] = 'PRJEditGroup';
$lang->program->methodOrder[150] = 'PRJStart';
$lang->program->methodOrder[155] = 'PRJSuspend';
$lang->program->methodOrder[160] = 'PRJClose';
$lang->program->methodOrder[165] = 'PRJActivate';
$lang->program->methodOrder[170] = 'PRJUpdateOrder';
$lang->program->methodOrder[175] = 'PRJDelete';
$lang->program->methodOrder[180] = 'PRJView';
$lang->program->methodOrder[185] = 'PRJWhitelist';
$lang->program->methodOrder[190] = 'PRJAddWhitelist';
$lang->program->methodOrder[195] = 'unbindWhielist';
$lang->program->methodOrder[200] = 'PRJManageProducts';
$lang->program->methodOrder[205] = 'view';
/* Personnel . */
$lang->resource->personnel = new stdclass();
$lang->resource->personnel->accessible = 'accessible';
$lang->resource->personnel->putInto = 'putInto';
$lang->resource->personnel->whitelist = 'whitelist';
$lang->resource->personnel->addWhitelist = 'addWhitelist';
$lang->resource->personnel->unbindWhielist = 'unbindWhielist';
/* Personnel . */
$lang->resource->personnel = new stdclass();
$lang->resource->personnel->accessible = 'accessible';
$lang->resource->personnel->putInto = 'putInto';
$lang->resource->personnel->whitelist = 'whitelist';
$lang->resource->personnel->addWhitelist = 'addWhitelist';
$lang->resource->personnel->unbindWhielist = 'unbindWhielist';
$lang->personnel->methodOrder[5] = 'accessible';
$lang->personnel->methodOrder[10] = 'putInto';
$lang->personnel->methodOrder[15] = 'whitelist';
$lang->personnel->methodOrder[20] = 'addWhitelist';
$lang->personnel->methodOrder[25] = 'unbindWhielist';
$lang->personnel->methodOrder[5] = 'accessible';
$lang->personnel->methodOrder[10] = 'putInto';
$lang->personnel->methodOrder[15] = 'whitelist';
$lang->personnel->methodOrder[20] = 'addWhitelist';
$lang->personnel->methodOrder[25] = 'unbindWhielist';
/* Issue . */
$lang->resource->issue = new stdclass();
$lang->resource->issue->browse = 'browse';
$lang->resource->issue->create = 'create';
$lang->resource->issue->batchCreate = 'batchCreate';
$lang->resource->issue->delete = 'delete';
$lang->resource->issue->edit = 'edit';
$lang->resource->issue->confirm = 'confirm';
$lang->resource->issue->assignTo = 'assignTo';
$lang->resource->issue->close = 'close';
$lang->resource->issue->cancel = 'cancel';
$lang->resource->issue->activate = 'activate';
$lang->resource->issue->resolve = 'resolve';
$lang->resource->issue->view = 'view';
/* Project Story. */
$lang->resource->projectstory = new stdclass();
$lang->resource->projectstory->story = 'story';
$lang->resource->projectstory->track = 'track';
$lang->resource->projectstory->view = 'view';
$lang->resource->projectstory->linkStory = 'linkStory';
$lang->resource->projectstory->unlinkStory = 'unlinkStory';
$lang->issue->methodOrder[5] = 'browse';
$lang->issue->methodOrder[10] = 'create';
$lang->issue->methodOrder[15] = 'batchCreate';
$lang->issue->methodOrder[20] = 'delete';
$lang->issue->methodOrder[25] = 'edit';
$lang->issue->methodOrder[30] = 'confirm';
$lang->issue->methodOrder[35] = 'assignTo';
$lang->issue->methodOrder[40] = 'close';
$lang->issue->methodOrder[45] = 'cancel';
$lang->issue->methodOrder[50] = 'activate';
$lang->issue->methodOrder[55] = 'resolve';
$lang->issue->methodOrder[60] = 'view';
$lang->projectstory->methodOrder[5] = 'story';
$lang->projectstory->methodOrder[10] = 'track';
$lang->projectstory->methodOrder[15] = 'view';
$lang->projectstory->methodOrder[20] = 'linkStory';
$lang->projectstory->methodOrder[25] = 'unlinkStory';
/* Release. */
$lang->resource->projectbuild = new stdclass();
$lang->resource->projectbuild->browse = 'browse';
/* Release. */
$lang->resource->projectrelease = new stdclass();
$lang->resource->projectrelease->browse = 'browse';
$lang->resource->projectrelease->create = 'create';
$lang->resource->projectrelease->edit = 'edit';
$lang->resource->projectrelease->delete = 'delete';
$lang->resource->projectrelease->view = 'view';
$lang->resource->projectrelease->export = 'export';
$lang->resource->projectrelease->linkStory = 'linkStory';
$lang->resource->projectrelease->unlinkStory = 'unlinkStory';
$lang->resource->projectrelease->batchUnlinkStory = 'batchUnlinkStory';
$lang->resource->projectrelease->linkBug = 'linkBug';
$lang->resource->projectrelease->unlinkBug = 'unlinkBug';
$lang->resource->projectrelease->batchUnlinkBug = 'batchUnlinkBug';
$lang->resource->projectrelease->changeStatus = 'changeStatus';
$lang->projectrelease->methodOrder[5] = 'browse';
$lang->projectrelease->methodOrder[10] = 'create';
$lang->projectrelease->methodOrder[15] = 'edit';
$lang->projectrelease->methodOrder[20] = 'delete';
$lang->projectrelease->methodOrder[25] = 'view';
$lang->projectrelease->methodOrder[35] = 'export';
$lang->projectrelease->methodOrder[40] = 'linkStory';
$lang->projectrelease->methodOrder[45] = 'unlinkStory';
$lang->projectrelease->methodOrder[50] = 'batchUnlinkStory';
$lang->projectrelease->methodOrder[55] = 'linkBug';
$lang->projectrelease->methodOrder[60] = 'unlinkBug';
$lang->projectrelease->methodOrder[65] = 'batchUnlinkBug';
$lang->projectrelease->methodOrder[70] = 'changeStatus';
}
/* Product. */
$lang->resource->product = new stdclass();
@@ -467,20 +489,6 @@ $lang->productplan->methodOrder[50] = 'unlinkBug';
$lang->productplan->methodOrder[55] = 'batchUnlinkBug';
$lang->productplan->methodOrder[60] = 'batchEdit';
/* Project Story. */
$lang->resource->projectstory = new stdclass();
$lang->resource->projectstory->story = 'story';
$lang->resource->projectstory->track = 'track';
$lang->resource->projectstory->view = 'view';
$lang->resource->projectstory->linkStory = 'linkStory';
$lang->resource->projectstory->unlinkStory = 'unlinkStory';
$lang->projectstory->methodOrder[5] = 'story';
$lang->projectstory->methodOrder[10] = 'track';
$lang->projectstory->methodOrder[15] = 'view';
$lang->projectstory->methodOrder[20] = 'linkStory';
$lang->projectstory->methodOrder[25] = 'unlinkStory';
/* Release. */
$lang->resource->release = new stdclass();
$lang->resource->release->browse = 'browse';
@@ -511,40 +519,6 @@ $lang->release->methodOrder[60] = 'unlinkBug';
$lang->release->methodOrder[65] = 'batchUnlinkBug';
$lang->release->methodOrder[70] = 'changeStatus';
/* Release. */
$lang->resource->projectbuild = new stdclass();
$lang->resource->projectbuild->browse = 'browse';
/* Release. */
$lang->resource->projectrelease = new stdclass();
$lang->resource->projectrelease->browse = 'browse';
$lang->resource->projectrelease->create = 'create';
$lang->resource->projectrelease->edit = 'edit';
$lang->resource->projectrelease->delete = 'delete';
$lang->resource->projectrelease->view = 'view';
$lang->resource->projectrelease->export = 'export';
$lang->resource->projectrelease->linkStory = 'linkStory';
$lang->resource->projectrelease->unlinkStory = 'unlinkStory';
$lang->resource->projectrelease->batchUnlinkStory = 'batchUnlinkStory';
$lang->resource->projectrelease->linkBug = 'linkBug';
$lang->resource->projectrelease->unlinkBug = 'unlinkBug';
$lang->resource->projectrelease->batchUnlinkBug = 'batchUnlinkBug';
$lang->resource->projectrelease->changeStatus = 'changeStatus';
$lang->projectrelease->methodOrder[5] = 'browse';
$lang->projectrelease->methodOrder[10] = 'create';
$lang->projectrelease->methodOrder[15] = 'edit';
$lang->projectrelease->methodOrder[20] = 'delete';
$lang->projectrelease->methodOrder[25] = 'view';
$lang->projectrelease->methodOrder[35] = 'export';
$lang->projectrelease->methodOrder[40] = 'linkStory';
$lang->projectrelease->methodOrder[45] = 'unlinkStory';
$lang->projectrelease->methodOrder[50] = 'batchUnlinkStory';
$lang->projectrelease->methodOrder[55] = 'linkBug';
$lang->projectrelease->methodOrder[60] = 'unlinkBug';
$lang->projectrelease->methodOrder[65] = 'batchUnlinkBug';
$lang->projectrelease->methodOrder[70] = 'changeStatus';
/* Project. */
$lang->resource->project = new stdclass();
$lang->resource->project->index = 'index';
@@ -674,16 +648,6 @@ $lang->design->methodOrder[45] = 'viewCommit';
$lang->design->methodOrder[50] = 'unlinkCommit';
$lang->design->methodOrder[55] = 'revision';
/* Program plan. */
$lang->resource->programplan = new stdclass();
$lang->resource->programplan->browse = 'browse';
$lang->resource->programplan->create = 'create';
$lang->resource->programplan->edit = 'edit';
$lang->programplan->methodOrder[5] = 'browse';
$lang->programplan->methodOrder[10] = 'create';
$lang->programplan->methodOrder[15] = 'edit';
/* Task. */
$lang->resource->task = new stdclass();
$lang->resource->task->create = 'create';
@@ -1188,24 +1152,6 @@ $lang->company->methodOrder[5] = 'browse';
$lang->company->methodOrder[15] = 'edit';
$lang->company->methodOrder[25] = 'dynamic';
/* Budget. */
$lang->resource->budget = new stdclass();
$lang->resource->budget->browse = 'browse';
$lang->resource->budget->summary = 'summary';
$lang->resource->budget->create = 'create';
$lang->resource->budget->batchCreate = 'batchCreate';
$lang->resource->budget->edit = 'edit';
$lang->resource->budget->view = 'view';
$lang->resource->budget->delete = 'delete';
$lang->budget->methodOrder[5] = 'browse';
$lang->budget->methodOrder[10] = 'summary';
$lang->budget->methodOrder[15] = 'create';
$lang->budget->methodOrder[20] = 'batchCreate';
$lang->budget->methodOrder[25] = 'edit';
$lang->budget->methodOrder[30] = 'view';
$lang->budget->methodOrder[35] = 'delete';
/* Department. */
$lang->resource->dept = new stdclass();
$lang->resource->dept->browse = 'browse';
+1 -1
View File
@@ -963,7 +963,7 @@ class productModel extends model
*/
public function getExecutionPairsByProduct($productID, $branch = 0, $orderBy = 'id_asc', $projectID = 0)
{
if($productID) return array();
if(empty($productID)) return array();
if(empty($projectID)) return $this->getAllExecutionPairsByProduct($productID, $branch);
$project = $this->loadModel('program')->getPRJByID($projectID);
-54
View File
@@ -1,54 +0,0 @@
<?php
$config->programplan->create = new stdclass();
$config->programplan->edit = new stdclass();
$config->programplan->create->requiredFields = 'name,begin,end';
$config->programplan->edit->requiredFields = 'name,begin,end';
$config->programplan->datatable = new stdclass();
$config->programplan->datatable->defaultField = array('id', 'name', 'percent', 'attribute', 'begin', 'end', 'realBegan', 'realEnd', 'actions');
$config->programplan->datatable->fieldList['id']['title'] = 'idAB';
$config->programplan->datatable->fieldList['id']['fixed'] = 'left';
$config->programplan->datatable->fieldList['id']['width'] = '70';
$config->programplan->datatable->fieldList['id']['required'] = 'yes';
$config->programplan->datatable->fieldList['name']['title'] = 'name';
$config->programplan->datatable->fieldList['name']['fixed'] = 'left';
$config->programplan->datatable->fieldList['name']['width'] = 'auto';
$config->programplan->datatable->fieldList['name']['required'] = 'yes';
$config->programplan->datatable->fieldList['percent']['title'] = 'percent';
$config->programplan->datatable->fieldList['percent']['fixed'] = 'no';
$config->programplan->datatable->fieldList['percent']['width'] = '100';
$config->programplan->datatable->fieldList['percent']['required'] = 'no';
$config->programplan->datatable->fieldList['attribute']['title'] = 'attribute';
$config->programplan->datatable->fieldList['attribute']['fixed'] = 'no';
$config->programplan->datatable->fieldList['attribute']['width'] = '90';
$config->programplan->datatable->fieldList['attribute']['required'] = 'no';
$config->programplan->datatable->fieldList['begin']['title'] = 'begin';
$config->programplan->datatable->fieldList['begin']['fixed'] = 'no';
$config->programplan->datatable->fieldList['begin']['width'] = '90';
$config->programplan->datatable->fieldList['begin']['required'] = 'no';
$config->programplan->datatable->fieldList['end']['title'] = 'end';
$config->programplan->datatable->fieldList['end']['fixed'] = 'no';
$config->programplan->datatable->fieldList['end']['width'] = '90';
$config->programplan->datatable->fieldList['end']['required'] = 'no';
$config->programplan->datatable->fieldList['realBegan']['title'] = 'realBegan';
$config->programplan->datatable->fieldList['realBegan']['fixed'] = 'no';
$config->programplan->datatable->fieldList['realBegan']['width'] = '90';
$config->programplan->datatable->fieldList['realBegan']['required'] = 'no';
$config->programplan->datatable->fieldList['realEnd']['title'] = 'realEnd';
$config->programplan->datatable->fieldList['realEnd']['fixed'] = 'no';
$config->programplan->datatable->fieldList['realEnd']['width'] = '90';
$config->programplan->datatable->fieldList['realEnd']['required'] = 'no';
$config->programplan->datatable->fieldList['actions']['title'] = 'actions';
$config->programplan->datatable->fieldList['actions']['fixed'] = 'right';
$config->programplan->datatable->fieldList['actions']['width'] = '150';
$config->programplan->datatable->fieldList['actions']['required'] = 'yes';
$config->programplan->datatable->fieldList['actions']['sort'] = 'no';
-196
View File
@@ -1,196 +0,0 @@
<?php
/**
* The control file of programplan currentModule 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 programplan
* @version $Id: control.php 5107 2013-07-12 01:46:12Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
class programplan extends control
{
/**
* __construct
*
* @param string $moduleName
* @param string $methodName
* @access public
* @return void
*/
public function __construct($moduleName = '', $methodName = '')
{
parent::__construct($moduleName, $methodName);
}
/**
* Common action.
*
* @param int $projectID
* @param int $productID
* @param string $extra
* @access public
* @return void
*/
public function commonAction($projectID, $productID = 0, $extra = '')
{
$products = $this->loadModel('product')->getProductPairsByProject($projectID);
$productID = $this->product->saveState($productID, $products);
$this->productID = $productID;
$this->product->setMenu($products, $productID, 0, 0, '', $extra);
$this->programplan->setMenu($projectID, $productID);
}
/**
* Browse program plans.
*
* @param int $projectID
* @param int $productID
* @param string $type
* @param string $orderBy
* @param int $baselineID
* @access public
* @return void
*/
public function browse($projectID = 0, $productID = 0, $type = 'gantt', $orderBy = 'id_asc', $baselineID = 0)
{
$this->app->loadLang('stage');
$this->commonAction($projectID, $productID, $type);
$this->session->set('projectPlanList', $this->app->getURI(true));
if(common::hasPriv('programplan', 'create')) $this->lang->TRActions = html::a($this->createLink('programplan', 'create', "projectID=$projectID"), "<i class='icon icon-sm icon-plus'></i> " . $this->lang->programplan->create, '', "class='btn btn-primary'");
$selectCustom = 0; // Display date and task settings.
$dateDetails = 1; // Gantt chart detail date display.
if($type == 'gantt')
{
$owner = $this->app->user->account;
$module = 'programplan';
$section = 'browse';
$object = 'stageCustom';
$selectCustom = $this->loadModel('setting')->getItem("owner={$owner}&module={$module}&section={$section}&key={$object}");
if(strpos($selectCustom, 'date') !== false) $dateDetails = 0;
$plans = $this->programplan->getDataForGantt($projectID, $this->productID, $baselineID);
}
if($type == 'lists')
{
$sort = $this->loadModel('common')->appendOrder($orderBy);
$this->loadModel('datatable');
$plans = $this->programplan->getPlans($projectID, $this->productID, $sort);
}
$this->view->title = $this->lang->programplan->browse;
$this->view->position[] = $this->lang->programplan->browse;
$this->view->projectID = $projectID;
$this->view->productID = $this->productID;
$this->view->type = $type;
$this->view->plans = $plans;
$this->view->orderBy = $orderBy;
$this->view->selectCustom = $selectCustom;
$this->view->dateDetails = $dateDetails;
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->display();
}
/**
* Create a project plan.
*
* @param int $projectID
* @param int $productID
* @param int $planID
* @access public
* @return void
*/
public function create($projectID = 0, $productID = 0, $planID = 0)
{
$this->commonAction($projectID, $productID);
$this->app->loadLang('project');
if($_POST)
{
$this->programplan->create($projectID, $this->productID, $planID);
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
$locate = $this->session->projectPlanList ? $this->session->projectPlanList : $this->createLink('programplan', 'browse', "projectID=$projectID");
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locate));
}
$this->app->loadLang('stage');
$project = $this->loadModel('project')->getById($projectID);
$this->view->title = $this->lang->programplan->create . $this->lang->colon . $project->name;
$this->view->position[] = html::a($this->createLink('programplan', 'browse', "projectID=$projectID"), $project->name);
$this->view->position[] = $this->lang->programplan->create;
$this->view->project = $project;
$this->view->stages = empty($planID) ? $this->loadModel('stage')->getStages('id_asc') : array();
$this->view->programPlan = $this->project->getById($planID);
$this->view->plans = $this->programplan->getStage($planID ? $planID : $projectID, $this->productID, 'parent');
$this->view->planID = $planID;
$this->view->type = 'lists';
$this->display();
}
/**
* Edit a project plan.
*
* @param int $planID
* @param int $projectID
* @access public
* @return void
*/
public function edit($planID = 0, $projectID = 0)
{
$this->app->loadLang('project');
$plan = $this->programplan->getByID($planID);
if($_POST)
{
$changes = $this->programplan->update($planID, $projectID);
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
if($changes)
{
$actionID = $this->loadModel('action')->create('execution', $planID, 'edited');
$this->action->logHistory($actionID, $changes);
}
$locate = isonlybody() ? 'parent' : inlink('browse', "program=$plan->program&type=lists");
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locate));
}
$this->app->loadLang('stage');
$this->view->title = $this->lang->programplan->edit;
$this->view->position[] = $this->lang->programplan->edit;
$this->view->parentStage = $this->programplan->getParentStageList($this->session->PRJ, $planID, $plan->product);
$this->view->isCreateTask = $this->programplan->isCreateTask($planID);
$this->view->plan = $plan;
$this->display();
}
/**
* Save custom settings via ajax.
*
* @access public
* @return void
*/
public function ajaxCustom()
{
$data = fixer::input('post')->get();
$owner = $this->app->user->account;
$module = 'programplan';
$section = 'browse';
$object = 'stageCustom';
$setting = $this->loadModel('setting');
$custom = empty($data->stageCustom) ? '' : implode(',', $data->stageCustom);
$setting->setItem("$owner.$module.$section.$object", $custom);
$response = array();
$response['result'] = 'success';
$response['message'] = '';
$this->send($response);
}
}
-34
View File
@@ -1,34 +0,0 @@
$(function()
{
setTimeout(function()
{
fixScroll();
}, 500);
})
function fixScroll()
{
var $scrollwrapper = $('div.datatable').first().find('.scroll-wrapper:first');
if($scrollwrapper.size() == 0)return;
var $tfoot = $('div.datatable').first().find('table tfoot:last');
var scrollOffset = $scrollwrapper.offset().top + $scrollwrapper.find('.scroll-slide').height();
if($tfoot.size() > 0) scrollOffset += $tfoot.height();
if($('div.datatable.head-fixed').size() == 0) scrollOffset -= '29';
var windowH = $(window).height();
if(scrollOffset > windowH + $(window).scrollTop()) $scrollwrapper.css({'position': 'fixed', 'bottom': 50 + 'px'});
$(window).scroll(function()
{
newBottom = $tfoot.hasClass('fixedTfootAction') ? 50 + $tfoot.height() : 50;
if(typeof(ssoRedirect) != "undefined") newBottom = 50;
if(scrollOffset <= windowH + $(window).scrollTop())
{
$scrollwrapper.css({'position':'relative', 'bottom': '0px'});
}
else if($scrollwrapper.css('position') != 'fixed')
{
$scrollwrapper.css({'position': 'fixed', 'bottom': newBottom + 'px'});
bottom = newBottom;
}
});
}
-16
View File
@@ -1,16 +0,0 @@
function addItem(obj)
{
var item = $('#addItem').html().replace(/%i%/g, i);
$(obj).closest('tr').after('<tr class="addedItem">' + item + '</tr>');
var newItem = $('#names' + i).closest('tr');
newItem.find('.form-date').datepicker();
$("#output" + i).chosen();
$("#output_i__chosen").remove();
i ++;
}
function deleteItem(obj)
{
if($('#planForm .table tbody').children().length < 2) return false;
$(obj).closest('tr').remove();
}
-70
View File
@@ -1,70 +0,0 @@
<?php
/**
* The programplan module English file 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 programplan
* @version $Id: en.php 4729 2013-05-03 07:53:55Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
$lang->programplan->common = 'Program Plan';
$lang->programplan->browse = 'Program Plan';
$lang->programplan->gantt = 'Gantt Chart';
$lang->programplan->list = 'Stage List';
$lang->programplan->create = 'Create';
$lang->programplan->edit = 'Edit';
$lang->programplan->delete = 'Delete';
$lang->programplan->createSubPlan = 'Create Sub Plan';
$lang->programplan->parent = 'Parent Stage';
$lang->programplan->emptyParent = 'N/A';
$lang->programplan->name = 'Stage Name';
$lang->programplan->subStageName = 'Sub Stage Name';
$lang->programplan->percent = 'Workload Ratio';
$lang->programplan->percentAB = 'Workload Ratio';
$lang->programplan->planPercent = 'Workload';
$lang->programplan->attribute = 'Stage Type';
$lang->programplan->milestone = 'Milestone';
$lang->programplan->taskProgress = 'Task Progress';
$lang->programplan->task = 'Task';
$lang->programplan->begin = 'Begin';
$lang->programplan->end = 'End';
$lang->programplan->realBegan = 'Actual Started';
$lang->programplan->realEnd = 'Actual End';
$lang->programplan->planDateRange = 'Planned Start';
$lang->programplan->realDateRange = 'Actual Start';
$lang->programplan->output = 'Output';
$lang->programplan->openedBy = 'Created By';
$lang->programplan->openedDate = 'Created Date';
$lang->programplan->editedBy = 'Edited By';
$lang->programplan->editedDate = 'Edited Date';
$lang->programplan->duration = 'Duration';
$lang->programplan->version = 'Version';
$lang->programplan->full = 'Full Screen';
$lang->programplan->today = 'Today';
$lang->programplan->exporting = 'Exporting';
$lang->programplan->exportFail = 'Export failed';
$lang->programplan->hideCriticalPath = 'Hide Critical Path';
$lang->programplan->showCriticalPath = 'Show Critical Path';
$lang->programplan->milestoneList[1] = 'Yes';
$lang->programplan->milestoneList[0] = 'No';
$lang->programplan->noData = 'No Data';
$lang->programplan->children = 'Sub Plan';
$lang->programplan->childrenAB = 'Child';
$lang->programplan->confirmDelete = 'Do you want to delete the current plan?';
$lang->programplan->workloadTips = 'The proportion of the sub stage workload is divided by 100%.';
$lang->programplan->stageCustom = new stdClass();
$lang->programplan->stageCustom->date = 'Show Date';
$lang->programplan->stageCustom->task = 'Show Task';
$lang->programplan->error = new stdclass();
$lang->programplan->error->percentNumber = '"Workload %" must be digits.';
$lang->programplan->error->planFinishSmall = 'The "End" date must be > the "Begin" date.';
$lang->programplan->error->percentOver = 'The sum of "Workload %" cannot exceed 100%.';
$lang->programplan->error->createdTask = 'The task has been decomposed. Sub phases cannot be added.';
$lang->programplan->error->parentWorkload = 'The sum of the workload of the child phase cannot be greater than that of the parent phase: %s.';
-70
View File
@@ -1,70 +0,0 @@
<?php
/**
* The programplan module English file 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 programplan
* @version $Id: en.php 4729 2013-05-03 07:53:55Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
$lang->programplan->common = 'Program Plan';
$lang->programplan->browse = 'Program Plan';
$lang->programplan->gantt = 'Gantt Chart';
$lang->programplan->list = 'Stage List';
$lang->programplan->create = 'Create';
$lang->programplan->edit = 'Edit';
$lang->programplan->delete = 'Delete';
$lang->programplan->createSubPlan = 'Create Sub Plan';
$lang->programplan->parent = 'Parent Stage';
$lang->programplan->emptyParent = 'N/A';
$lang->programplan->name = 'Stage Name';
$lang->programplan->subStageName = 'Sub Stage Name';
$lang->programplan->percent = 'Workload Ratio';
$lang->programplan->percentAB = 'Workload Ratio';
$lang->programplan->planPercent = 'Workload';
$lang->programplan->attribute = 'Stage Type';
$lang->programplan->milestone = 'Milestone';
$lang->programplan->taskProgress = 'Task Progress';
$lang->programplan->task = 'Task';
$lang->programplan->begin = 'Begin';
$lang->programplan->end = 'End';
$lang->programplan->realBegan = 'Actual Started';
$lang->programplan->realEnd = 'Actual End';
$lang->programplan->planDateRange = 'Planned Start';
$lang->programplan->realDateRange = 'Actual Start';
$lang->programplan->output = 'Output';
$lang->programplan->openedBy = 'Created By';
$lang->programplan->openedDate = 'Created Date';
$lang->programplan->editedBy = 'Edited By';
$lang->programplan->editedDate = 'Edited Date';
$lang->programplan->duration = 'Duration';
$lang->programplan->version = 'Version';
$lang->programplan->full = 'Full Screen';
$lang->programplan->today = 'Today';
$lang->programplan->exporting = 'Exporting';
$lang->programplan->exportFail = 'Export failed';
$lang->programplan->hideCriticalPath = 'Hide Critical Path';
$lang->programplan->showCriticalPath = 'Show Critical Path';
$lang->programplan->milestoneList[1] = 'Yes';
$lang->programplan->milestoneList[0] = 'No';
$lang->programplan->noData = 'No Data';
$lang->programplan->children = 'Sub Plan';
$lang->programplan->childrenAB = 'Child';
$lang->programplan->confirmDelete = 'Do you want to delete the current plan?';
$lang->programplan->workloadTips = 'The proportion of the sub stage workload is divided by 100%.';
$lang->programplan->stageCustom = new stdClass();
$lang->programplan->stageCustom->date = 'Show Date';
$lang->programplan->stageCustom->task = 'Show Task';
$lang->programplan->error = new stdclass();
$lang->programplan->error->percentNumber = '"Workload %" must be digits.';
$lang->programplan->error->planFinishSmall = 'The "End" date must be > the "Begin" date.';
$lang->programplan->error->percentOver = 'The sum of "Workload %" cannot exceed 100%.';
$lang->programplan->error->createdTask = 'The task has been decomposed. Sub phases cannot be added.';
$lang->programplan->error->parentWorkload = 'The sum of the workload of the child phase cannot be greater than that of the parent phase: %s.';
-70
View File
@@ -1,70 +0,0 @@
<?php
/**
* The programplan module English file 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 programplan
* @version $Id: en.php 4729 2013-05-03 07:53:55Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
$lang->programplan->common = 'Program Plan';
$lang->programplan->browse = 'Program Plan';
$lang->programplan->gantt = 'Gantt Chart';
$lang->programplan->list = 'Stage List';
$lang->programplan->create = 'Create';
$lang->programplan->edit = 'Edit';
$lang->programplan->delete = 'Delete';
$lang->programplan->createSubPlan = 'Create Sub Plan';
$lang->programplan->parent = 'Parent Stage';
$lang->programplan->emptyParent = 'N/A';
$lang->programplan->name = 'Stage Name';
$lang->programplan->subStageName = 'Sub Stage Name';
$lang->programplan->percent = 'Workload Ratio';
$lang->programplan->percentAB = 'Workload Ratio';
$lang->programplan->planPercent = 'Workload';
$lang->programplan->attribute = 'Stage Type';
$lang->programplan->milestone = 'Milestone';
$lang->programplan->taskProgress = 'Task Progress';
$lang->programplan->task = 'Task';
$lang->programplan->begin = 'Begin';
$lang->programplan->end = 'End';
$lang->programplan->realBegan = 'Actual Started';
$lang->programplan->realEnd = 'Actual End';
$lang->programplan->planDateRange = 'Planned Start';
$lang->programplan->realDateRange = 'Actual Start';
$lang->programplan->output = 'Output';
$lang->programplan->openedBy = 'Created By';
$lang->programplan->openedDate = 'Created Date';
$lang->programplan->editedBy = 'Edited By';
$lang->programplan->editedDate = 'Edited Date';
$lang->programplan->duration = 'Duration';
$lang->programplan->version = 'Version';
$lang->programplan->full = 'Full Screen';
$lang->programplan->today = 'Today';
$lang->programplan->exporting = 'Exporting';
$lang->programplan->exportFail = 'Export failed';
$lang->programplan->hideCriticalPath = 'Hide Critical Path';
$lang->programplan->showCriticalPath = 'Show Critical Path';
$lang->programplan->milestoneList[1] = 'Yes';
$lang->programplan->milestoneList[0] = 'No';
$lang->programplan->noData = 'No Data';
$lang->programplan->children = 'Sub Plan';
$lang->programplan->childrenAB = 'Child';
$lang->programplan->confirmDelete = 'Do you want to delete the current plan?';
$lang->programplan->workloadTips = 'The proportion of the sub stage workload is divided by 100%.';
$lang->programplan->stageCustom = new stdClass();
$lang->programplan->stageCustom->date = 'Show Date';
$lang->programplan->stageCustom->task = 'Show Task';
$lang->programplan->error = new stdclass();
$lang->programplan->error->percentNumber = '"Workload %" must be digits.';
$lang->programplan->error->planFinishSmall = 'The "End" date must be > the "Begin" date.';
$lang->programplan->error->percentOver = 'The sum of "Workload %" cannot exceed 100%.';
$lang->programplan->error->createdTask = 'The task has been decomposed. Sub phases cannot be added.';
$lang->programplan->error->parentWorkload = 'The sum of the workload of the child phase cannot be greater than that of the parent phase: %s.';
-70
View File
@@ -1,70 +0,0 @@
<?php
/**
* The programplan module English file 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 programplan
* @version $Id: en.php 4729 2013-05-03 07:53:55Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
$lang->programplan->common = 'Program Plan';
$lang->programplan->browse = 'Program Plan';
$lang->programplan->gantt = 'Gantt Chart';
$lang->programplan->list = 'Stage List';
$lang->programplan->create = 'Create';
$lang->programplan->edit = 'Edit';
$lang->programplan->delete = 'Delete';
$lang->programplan->createSubPlan = 'Create Sub Plan';
$lang->programplan->parent = 'Parent Stage';
$lang->programplan->emptyParent = 'N/A';
$lang->programplan->name = 'Stage Name';
$lang->programplan->subStageName = 'Sub Stage Name';
$lang->programplan->percent = 'Workload Ratio';
$lang->programplan->percentAB = 'Workload Ratio';
$lang->programplan->planPercent = 'Workload';
$lang->programplan->attribute = 'Stage Type';
$lang->programplan->milestone = 'Milestone';
$lang->programplan->taskProgress = 'Task Progress';
$lang->programplan->task = 'Task';
$lang->programplan->begin = 'Begin';
$lang->programplan->end = 'End';
$lang->programplan->realBegan = 'Actual Started';
$lang->programplan->realEnd = 'Actual End';
$lang->programplan->planDateRange = 'Planned Start';
$lang->programplan->realDateRange = 'Actual Start';
$lang->programplan->output = 'Output';
$lang->programplan->openedBy = 'Created By';
$lang->programplan->openedDate = 'Created Date';
$lang->programplan->editedBy = 'Edited By';
$lang->programplan->editedDate = 'Edited Date';
$lang->programplan->duration = 'Duration';
$lang->programplan->version = 'Version';
$lang->programplan->full = 'Full Screen';
$lang->programplan->today = 'Today';
$lang->programplan->exporting = 'Exporting';
$lang->programplan->exportFail = 'Export failed';
$lang->programplan->hideCriticalPath = 'Hide Critical Path';
$lang->programplan->showCriticalPath = 'Show Critical Path';
$lang->programplan->milestoneList[1] = 'Yes';
$lang->programplan->milestoneList[0] = 'No';
$lang->programplan->noData = 'No Data';
$lang->programplan->children = 'Sub Plan';
$lang->programplan->childrenAB = 'Child';
$lang->programplan->confirmDelete = 'Do you want to delete the current plan?';
$lang->programplan->workloadTips = 'The proportion of the sub stage workload is divided by 100%.';
$lang->programplan->stageCustom = new stdClass();
$lang->programplan->stageCustom->date = 'Show Date';
$lang->programplan->stageCustom->task = 'Show Task';
$lang->programplan->error = new stdclass();
$lang->programplan->error->percentNumber = '"Workload %" must be digits.';
$lang->programplan->error->planFinishSmall = 'The "End" date must be > the "Begin" date.';
$lang->programplan->error->percentOver = 'The sum of "Workload %" cannot exceed 100%.';
$lang->programplan->error->createdTask = 'The task has been decomposed. Sub phases cannot be added.';
$lang->programplan->error->parentWorkload = 'The sum of the workload of the child phase cannot be greater than that of the parent phase: %s.';
-70
View File
@@ -1,70 +0,0 @@
<?php
/**
* The programplan module zh-cn file 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 programplan
* @version $Id: zh-cn.php 4729 2013-05-03 07:53:55Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
$lang->programplan->common = '项目计划';
$lang->programplan->browse = '浏览阶段计划';
$lang->programplan->gantt = '甘特图';
$lang->programplan->list = '阶段列表';
$lang->programplan->create = '设置阶段';
$lang->programplan->edit = '编辑';
$lang->programplan->delete = '删除';
$lang->programplan->createSubPlan = '创建二级阶段';
$lang->programplan->parent = '父阶段';
$lang->programplan->emptyParent = '无';
$lang->programplan->name = '阶段名称';
$lang->programplan->subStageName = '子阶段名称';
$lang->programplan->percent = '工作量占比';
$lang->programplan->percentAB = '工作量占比';
$lang->programplan->planPercent = '工作量';
$lang->programplan->attribute = '阶段类型';
$lang->programplan->milestone = '里程碑';
$lang->programplan->taskProgress = '任务进度';
$lang->programplan->task = '任务';
$lang->programplan->begin = '计划开始';
$lang->programplan->end = '计划完成';
$lang->programplan->realBegan = '实际开始';
$lang->programplan->realEnd = '实际完成';
$lang->programplan->planDateRange = '计划起始日期';
$lang->programplan->realDateRange = '实际起始日期';
$lang->programplan->output = '输出';
$lang->programplan->openedBy = '由谁创建';
$lang->programplan->openedDate = '创建日期';
$lang->programplan->editedBy = '由谁编辑';
$lang->programplan->editedDate = '编辑日期';
$lang->programplan->duration = '计划工期';
$lang->programplan->version = '版本号';
$lang->programplan->full = '全屏';
$lang->programplan->today = '今天';
$lang->programplan->exporting = '导出';
$lang->programplan->exportFail = '导出失败';
$lang->programplan->hideCriticalPath = '隐藏关键路径';
$lang->programplan->showCriticalPath = '显示关键路径';
$lang->programplan->milestoneList[1] = '是';
$lang->programplan->milestoneList[0] = '否';
$lang->programplan->noData = '暂无数据。';
$lang->programplan->children = '二级计划';
$lang->programplan->childrenAB = '子';
$lang->programplan->confirmDelete = '确定要删除当前计划吗?';
$lang->programplan->workloadTips = '子阶段工作量占比按百分百的比例进行拆分';
$lang->programplan->stageCustom = new stdClass();
$lang->programplan->stageCustom->date = '显示日期';
$lang->programplan->stageCustom->task = '显示任务';
$lang->programplan->error = new stdclass();
$lang->programplan->error->percentNumber = '"工作量比例"必须为数字';
$lang->programplan->error->planFinishSmall = '"计划完成时间"必须大于"计划开始时间"';
$lang->programplan->error->percentOver = '工作量占比累计不应当超过100%';
$lang->programplan->error->createdTask = '已分解任务,不可添加子阶段';
$lang->programplan->error->parentWorkload = '子阶段的工作量之和不能大于父阶段的工作量:%s';
-70
View File
@@ -1,70 +0,0 @@
<?php
/**
* The programplan module zh-tw file 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 programplan
* @version $Id: zh-tw.php 4729 2013-05-03 07:53:55Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
$lang->programplan->common = '項目計劃';
$lang->programplan->browse = '瀏覽階段計劃';
$lang->programplan->gantt = '甘特圖';
$lang->programplan->list = '階段列表';
$lang->programplan->create = '設置階段';
$lang->programplan->edit = '編輯';
$lang->programplan->delete = '刪除';
$lang->programplan->createSubPlan = '創建二級階段';
$lang->programplan->parent = '父階段';
$lang->programplan->emptyParent = '無';
$lang->programplan->name = '階段名稱';
$lang->programplan->subStageName = '子階段名稱';
$lang->programplan->percent = '工作量占比';
$lang->programplan->percentAB = '工作量占比';
$lang->programplan->planPercent = '工作量';
$lang->programplan->attribute = '階段類型';
$lang->programplan->milestone = '里程碑';
$lang->programplan->taskProgress = '任務進度';
$lang->programplan->task = '任務';
$lang->programplan->begin = '計劃開始';
$lang->programplan->end = '計劃完成';
$lang->programplan->realBegan = '實際開始';
$lang->programplan->realEnd = '實際完成';
$lang->programplan->planDateRange = '計划起始日期';
$lang->programplan->realDateRange = '實際起始日期';
$lang->programplan->output = '輸出';
$lang->programplan->openedBy = '由誰創建';
$lang->programplan->openedDate = '創建日期';
$lang->programplan->editedBy = '由誰編輯';
$lang->programplan->editedDate = '編輯日期';
$lang->programplan->duration = '計劃工期';
$lang->programplan->version = '版本號';
$lang->programplan->full = '全屏';
$lang->programplan->today = '今天';
$lang->programplan->exporting = '導出';
$lang->programplan->exportFail = '導出失敗';
$lang->programplan->hideCriticalPath = '隱藏關鍵路徑';
$lang->programplan->showCriticalPath = '顯示關鍵路徑';
$lang->programplan->milestoneList[1] = '是';
$lang->programplan->milestoneList[0] = '否';
$lang->programplan->noData = '暫無數據。';
$lang->programplan->children = '二級計劃';
$lang->programplan->childrenAB = '子';
$lang->programplan->confirmDelete = '確定要刪除當前計劃嗎?';
$lang->programplan->workloadTips = '子階段工作量占比按百分百的比例進行拆分';
$lang->programplan->stageCustom = new stdClass();
$lang->programplan->stageCustom->date = '顯示日期';
$lang->programplan->stageCustom->task = '顯示任務';
$lang->programplan->error = new stdclass();
$lang->programplan->error->percentNumber = '"工作量比例"必須為數字';
$lang->programplan->error->planFinishSmall = '"計劃完成時間"必須大於"計劃開始時間"';
$lang->programplan->error->percentOver = '工作量占比累計不應當超過100%';
$lang->programplan->error->createdTask = '已分解任務,不可添加子階段';
$lang->programplan->error->parentWorkload = '子階段的工作量之和不能大於父階段的工作量:%s';
-910
View File
@@ -1,910 +0,0 @@
<?php
/**
* The model file of programplan 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 programplan
* @version $Id: model.php 5079 2013-07-10 00:44:34Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
?>
<?php
class programplanModel extends model
{
/**
* Set menu.
*
* @param int $projectID
* @param int $productID
* @access public
* @return bool
*/
public function setMenu($projectID, $productID)
{
return true;
}
/**
* Get plan by id.
*
* @param int $planID
* @access public
* @return object
*/
public function getByID($planID)
{
$plan = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($planID)->fetch();
return $this->processPlan($plan);
}
/**
* Get plans list.
*
* @param int $projectID
* @param int $productID
* @param string $browseType all|parent
* @param string $orderBy
* @access public
* @return array
*/
public function getStage($projectID = 0, $productID = 0, $browseType = 'all', $orderBy = 'id_asc')
{
if(empty($projectID) || empty($productID)) return array();
$plans = $this->dao->select('t2.*')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
->where('t1.product')->eq($productID)
->andWhere('t2.type')->eq('stage')
->beginIF($browseType == 'all')->andWhere('t2.project')->eq($projectID)->fi()
->beginIF($browseType == 'parent')->andWhere('t2.parent')->eq($projectID)->fi()
->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->sprints)->fi()
->andWhere('t2.deleted')->eq('0')
->orderBy($orderBy)
->fetchAll('id');
return $this->processPlans($plans);
}
/**
* Get plans by idList.
*
* @param array $idList
* @access public
* @return array
*/
public function getByList($idList = array())
{
$plans = $this->dao->select('*')->from(TABLE_PROJECT)
->where('id')->in($idList)
->andWhere('type')->eq('project')
->fetchAll('id');
return $this->processPlans($plans);
}
/**
* Get plans.
*
* @param int $projectID
* @param int $productID
* @param string $orderBy
* @access public
* @return array
*/
public function getPlans($projectID = 0, $productID = 0, $orderBy = 'id_asc')
{
$plans = $this->getStage($projectID, $productID, 'all', $orderBy);
$parents = array();
$children = array();
foreach($plans as $planID => $plan)
{
$plan->grade == 1 ? $parents[$planID] = $plan : $children[$plan->parent][] = $plan;
}
foreach($parents as $planID => $plan) $parents[$planID]->children = isset($children[$planID]) ? $children[$planID] : array();
return $parents;
}
/**
* Get pairs.
*
* @param int $projectID
* @param int $productID
* @param string $type
* @access public
* @return array
*/
public function getPairs($projectID, $productID = 0, $type = 'all')
{
$plans = $this->getPlans($projectID, $productID);
$pairs = array(0 => '');
foreach($plans as $plan)
{
$pairs[$plan->id] = $plan->name;
if(!empty($plan->children))
{
foreach($plan->children as $child) $pairs[$child->id] = $plan->name . '/' . $child->name;
}
}
return $pairs;
}
/**
* Get gantt data.
*
* @param int $projectID
* @param int $productID
* @param int $baselineID
* @param string $selectCustom
* @param bool $returnJson
* @access public
* @return string
*/
public function getDataForGantt($projectID, $productID, $baselineID = 0, $selectCustom = '', $returnJson = true)
{
$this->loadModel('stage');
$plans = $this->getStage($projectID, $productID);
if($baselineID)
{
$baseline = $this->loadModel('cm')->getByID($baselineID);
$oldData = json_decode($baseline->data);
$oldPlans = $oldData->stage;
foreach($oldPlans as $id => $oldPlan)
{
if(!isset($plans[$id])) continue;
$plans[$id]->version = $oldPlan->version;
$plans[$id]->name = $oldPlan->name;
$plans[$id]->milestone = $oldPlan->milestone;
$plans[$id]->begin = $oldPlan->begin;
$plans[$id]->end = $oldPlan->end;
}
}
$datas = array();
$planIDList = array();
$isMilestone = "<icon class='icon icon-flag icon-sm red'></icon> ";
$stageIndex = array();
foreach($plans as $plan)
{
$planIDList[$plan->id] = $plan->id;
$start = $plan->begin == '0000-00-00' ? '' : date('d-m-Y', strtotime($plan->begin));
$end = $plan->end == '0000-00-00' ? '' : $plan->end;
$data = new stdclass();
$data->id = $plan->id;
$data->type = 'plan';
$data->text = empty($plan->milestone) ? $plan->name : $plan->name . $isMilestone ;
$data->percent = $plan->percent;
$data->attribute = zget($this->lang->stage->typeList, $plan->attribute);
$data->milestone = zget($this->lang->programplan->milestoneList, $plan->milestone);
$data->start_date = $start;
$data->deadline = $end;
$data->realBegan = $plan->realBegan == '0000-00-00' ? '' : $plan->realBegan;
$data->realEnd = $plan->realEnd == '0000-00-00' ? '' : $plan->realEnd;
$data->duration = helper::diffDate($plan->end, $plan->begin) + 1;;
$data->parent = $plan->grade == 1 ? 0 :$plan->parent;
$data->open = true;
if($data->start_date == '' or $data->deadline == '') $data->duration = 0;
$datas['data'][] = $data;
$stageIndex[] = array('planID' => $plan->id, 'progress' => array('totalConsumed' => 0, 'totalReal' => 0));
}
$taskSign = "<span>[ T ] </span>";
$taskPri = "<span class='label-pri label-pri-%s' title='%s'>%s</span> ";
/* Judge whether to display tasks under the stage. */
$owner = $this->app->user->account;
$module = 'programplan';
$section = 'browse';
$object = 'stageCustom';
if(empty($selectCustom)) $selectCustom = $this->loadModel('setting')->getItem("owner={$owner}&module={$module}&section={$section}&key={$object}");
$tasks = array();
if(strpos($selectCustom, 'task') !== false)
{
$tasks = $this->dao->select('*')->from(TABLE_TASK)->where('deleted')->eq(0)->andWhere('project')->in($planIDList)->fetchAll('id');
}
if($baselineID)
{
$oldTasks = $oldData->task;
foreach($oldTasks as $id => $oldTask)
{
if(!isset($tasks->$id)) continue;
$tasks->$id->version = $oldTask->version;
$tasks->$id->name = $oldTask->name;
$tasks->$id->estStarted = $oldTask->estStarted;
$tasks->$id->deadline = $oldTask->deadline;
}
}
foreach($tasks as $task)
{
$start = $task->estStarted == '0000-00-00' ? '' : date('d-m-Y', strtotime($task->estStarted));
$end = $task->deadline == '0000-00-00' ? '' : $task->deadline;
$realBegan = $task->realStarted == '0000-00-00' ? '' : $task->realStarted;
$realEnd = $task->finishedDate == '0000-00-00 00:00:00' ? '' : substr($task->finishedDate, 5, 11);
$priIcon = sprintf($taskPri, $task->pri, $task->pri, $task->pri);
$data = new stdclass();
$data->id = $task->project . '-' . $task->id;
$data->type = 'task';
$data->text = $taskSign . $priIcon . $task->name;
$data->percent = '';
$data->attribute = '';
$data->milestone = '';
$data->start_date = $start;
$data->deadline = $end;
$data->realBegan = $realBegan;
$data->realEnd = $realEnd;
$data->duration = helper::diffDate($task->deadline, $task->estStarted) + 1;
$data->parent = $task->parent > 0 ? $task->project . '-' . $task->parent : $task->project;
$data->open = true;
$progress = $task->consumed ? round($task->consumed / ($task->left + $task->consumed), 3) * 100 : 0;
$data->taskProgress = $progress . '%';
if($data->start_date == '' or $data->deadline == '') $data->duration = 0;
$datas['data'][] = $data;
foreach($stageIndex as $index => $stage)
{
if($stage['planID'] == $task->project)
{
$stageIndex[$index]['progress']['totalConsumed'] += $task->consumed;
$stageIndex[$index]['progress']['totalReal'] += ($task->left + $task->consumed);
}
}
}
/* Calculate the progress of the phase. */
foreach($stageIndex as $index => $stage)
{
$progress = empty($stage['progress']['totalConsumed']) ? 0 : round($stage['progress']['totalConsumed'] / $stage['progress']['totalReal'], 3) * 100;
$progress .= '%';
$datas['data'][$index]->taskProgress = $progress;
}
return $returnJson ? json_encode($datas) : $datas;
}
/**
* Get total percent.
*
* @param object $stage
* @param object $parent
* @access public
* @return int
*/
public function getTotalPercent($stage, $parent = false)
{
/* When parent is equal to true, query the total workload of the subphase. */
$projectID = $parent ? $stage->id : $stage->project;
$plans = $this->getStage($projectID, $stage->product, 'parent');
$totalPercent = 0;
$stageID = $stage->id;
foreach($plans as $id => $stage)
{
if($id == $stageID) continue;
$totalPercent += $stage->percent;
}
return $totalPercent;
}
/**
* Process plans.
*
* @param int $plans
* @access public
* @return object
*/
public function processPlans($plans)
{
foreach($plans as $planID => $plan) $plans[$planID] = $this->processPlan($plan);
return $plans;
}
/**
* Process plan.
*
* @param int $plan
* @access public
* @return object
*/
public function processPlan($plan)
{
$plan->setMilestone = true;
if($plan->parent)
{
$attribute = $this->dao->select('attribute')->from(TABLE_PROJECT)->where('id')->eq($plan->parent)->fetch('attribute');
$plan->attribute = $attribute == 'develop' ? $attribute : $plan->attribute;
}
else
{
$milestones = $this->dao->select('count(*) AS count')->from(TABLE_PROJECT)
->where('parent')->eq($plan->id)
->andWhere('milestone')->eq(1)
->andWhere('deleted')->eq(0)
->fetch('count');
if($milestones > 0)
{
$plan->milestone = 0;
$plan->setMilestone = false;
}
}
$plan->begin = $plan->begin == '0000-00-00' ? '' : $plan->begin;
$plan->end = $plan->end == '0000-00-00' ? '' : $plan->end;
$plan->realBegan = $plan->realBegan == '0000-00-00' ? '' : $plan->realBegan;
$plan->realEnd = $plan->realEnd == '0000-00-00' ? '' : $plan->realEnd;
$plan->product = $this->loadModel('product')->getProductIDByProject($plan->id);
$plan->productName = $this->dao->findByID($plan->product)->from(TABLE_PRODUCT)->fetch('name');
return $plan;
}
/**
* Get duration.
*
* @param int $begin
* @param int $end
* @access public
* @return int
*/
public function getDuration($begin, $end)
{
$duration = $this->loadModel('holiday')->getActualWorkingDays($begin, $end);
return count($duration);
}
/**
* Create a plan.
*
* @param int $projectID
* @param int $productID
* @param int $parentID
* @access public
* @return bool
*/
public function create($projectID = 0, $productID = 0, $parentID = 0)
{
$data = (array)fixer::input('post')->get();
extract($data);
/* Determine if a task has been created under the parent phase. */
if(!$this->isCreateTask($parentID)) return dao::$errors['message'][] = $this->lang->programplan->error->createdTask;
/* The child phase type setting is the same as the parent phase. */
$parentAttribute = '';
$parentPercent = 0;
if($parentID)
{
$parentStage = $this->getByID($parentID);
$parentAttribute = $parentStage->attribute;
$parentPercent = $parentStage->percent;
$parentACL = $parentStage->acl;
}
$attributes = array_values($attributes);
$milestone = array_values($milestone);
$datas = array();
foreach($names as $key => $name)
{
if(empty($name)) continue;
$plan = new stdclass();
$plan->id = isset($planIDList[$key]) ? $planIDList[$key] : '';
$plan->type = 'stage';
$plan->project = $projectID;
$plan->parent = $parentID ? $parentID : $projectID;
$plan->name = $names[$key];
$plan->percent = $percents[$key];
$plan->attribute = empty($parentID) ? $attributes[$key] : $parentAttribute;
$plan->milestone = $milestone[$key];
$plan->begin = empty($begin[$key]) ? '0000-00-00' : $begin[$key];
$plan->end = empty($end[$key]) ? '0000-00-00' : $end[$key];
$plan->realBegan = empty($realBegan[$key]) ? '0000-00-00' : $realBegan[$key];
$plan->realEnd = empty($realEnd[$key]) ? '0000-00-00' : $realEnd[$key];
$plan->output = empty($output[$key]) ? '' : implode(',', $output[$key]);
$plan->acl = empty($parentID) ? $acl[$key] : $parentACL;
$datas[] = $plan;
}
$totalPercent = 0;
$totalDevType = 0;
$milestone = 0;
foreach($datas as $plan)
{
if($plan->percent and !preg_match("/^[0-9]+(.[0-9]{1,3})?$/", $plan->percent))
{
dao::$errors['message'][] = $this->lang->programplan->error->percentNumber;
return false;
}
if($plan->end != '0000-00-00' and $plan->end < $plan->begin)
{
dao::$errors['message'][] = $this->lang->programplan->error->planFinishSmall;
return false;
}
if($plan->begin == '0000-00-00') $plan->begin = '';
if($plan->end == '0000-00-00') $plan->end = '';
foreach(explode(',', $this->config->programplan->create->requiredFields) as $field)
{
$field = trim($field);
if($field and empty($plan->$field))
{
dao::$errors['message'][] = sprintf($this->lang->error->notempty, $this->lang->programplan->$field);
return false;
}
}
$plan->percent = (float)$plan->percent;
$totalPercent += $plan->percent;
if($plan->milestone) $milestone = 1;
}
if($totalPercent > 100) return dao::$errors['message'][] = $this->lang->programplan->error->percentOver;
$this->loadModel('action');
$this->loadModel('user');
$this->loadModel('project');
$this->app->loadLang('doc');
$account = $this->app->user->account;
$now = helper::now();
foreach($datas as $data)
{
/* Set planDuration and realDuration. */
$data->planDuration = $this->getDuration($data->begin, $data->end);
$data->realDuration = $this->getDuration($data->realBegan, $data->realEnd);
$projectChanged = false;
$data->days = helper::diffDate($data->end, $data->begin) + 1;
if($data->id)
{
$stageID = $data->id;
unset($data->id);
$oldStage = $this->getByID($stageID);
$planChanged = ($oldStage->name != $data->name || $oldStage->milestone != $data->milestone || $oldStage->begin != $data->begin || $oldStage->end != $data->end);
if($planChanged) $data->version = $oldStage->version + 1;
$this->dao->update(TABLE_PROJECT)->data($data)
->autoCheck()
->batchCheck($this->config->programplan->edit->requiredFields, 'notempty')
->checkIF($plan->percent != '', 'percent', 'float')
->where('id')->eq($stageID)
->exec();
if($data->acl != 'open') $this->user->updateUserView($stageID, 'sprint');
/* Record version change information. */
if($planChanged)
{
$spec = new stdclass();
$spec->project = $stageID;
$spec->version = $data->version;
$spec->name = $data->name;
$spec->milestone = $data->milestone;
$spec->begin = $data->begin;
$spec->end = $data->end;
$this->dao->insert(TABLE_PROJECTSPEC)->data($spec)->exec();
}
$changes = common::createChanges($oldStage, $data);
$actionID = $this->action->create('execution', $stageID, 'edited');
$this->action->logHistory($actionID, $changes);
}
else
{
unset($data->id);
$data->status = 'wait';
$data->version = 1;
$data->parentVersion = $data->parent == 0 ? 0 : $this->dao->findByID($data->parent)->from(TABLE_PROJECT)->fetch('version');
$data->team = substr($data->name,0, 30);
$data->openedBy = $account;
$data->openedDate = $now;
$data->openedVersion = $this->config->version;
if(!isset($data->acl)) $data->acl = $this->dao->findByID($data->parent)->from(TABLE_PROJECT)->fetch('acl');
$this->dao->insert(TABLE_PROJECT)->data($data)
->autoCheck()
->batchCheck($this->config->programplan->create->requiredFields, 'notempty')
->checkIF($plan->percent != '', 'percent', 'float')
->exec();
if(!dao::isError())
{
$stageID = $this->dao->lastInsertID();
if($data->acl != 'open') $this->user->updateUserView($stageID, 'sprint');
$this->dao->update(TABLE_PROJECT)->set('`order`')->eq($stageID * 5)->where('id')->eq($stageID)->exec();
/* Create doc lib. */
$lib = new stdclass();
$lib->project = $stageID;
$lib->name = $this->lang->doclib->main['project'];
$lib->type = 'project';
$lib->main = '1';
$lib->acl = 'default';
$this->dao->insert(TABLE_DOCLIB)->data($lib)->exec();
/* Add creators to stage teams and project teams. */
$member = new stdclass();
$member->root = $stageID;
$member->account = $account;
$member->role = $this->lang->user->roleList[$this->app->user->role];
$member->join = $now;
$member->type = $data->type;
$member->days = $data->days;
$member->hours = $this->config->project->defaultWorkhours;
$this->dao->insert(TABLE_TEAM)->data($member)->exec();
$this->project->addProjectMembers($data->project, array($member));
$this->setTreePath($stageID);
if($data->acl != 'open') $this->user->updateUserView($stageID, 'sprint');
$this->post->set('products', array(0 => $productID));
$this->project->updateProducts($stageID);
/* Record version change information. */
$spec = new stdclass();
$spec->project = $stageID;
$spec->version = $data->version;
$spec->name = $data->name;
$spec->milestone = $data->milestone;
$spec->begin = $data->begin;
$spec->end = $data->end;
$this->dao->insert(TABLE_PROJECTSPEC)->data($spec)->exec();
$this->action->create('execution', $stageID, 'opened', '', join(',', $_POST['products']));
}
}
/* If child plans has milestone, update parent plan set milestone eq 0 . */
if($parentID and $milestone) $this->dao->update(TABLE_PROJECT)->set('milestone')->eq(0)->where('id')->eq($parentID)->exec();
if(dao::isError()) die(js::error(dao::getError()));
}
}
/**
* Set stage tree path.
*
* @param int $planID
* @access public
* @return bool
*/
public function setTreePath($planID)
{
$stage = $this->dao->select('id,type,parent,path,grade')->from(TABLE_PROJECT)->where('id')->eq($planID)->fetch();
$parent = $this->dao->select('id,type,parent,path,grade')->from(TABLE_PROJECT)->where('id')->eq($stage->parent)->fetch();
if($parent->type == 'project')
{
$path['path'] = ",{$parent->id},{$stage->id},";
$path['grade'] = 1;
}
elseif($parent->type == 'stage')
{
$path['path'] = $parent->path . "{$stage->id},";
$path['grade'] = $parent->grade + 1;
}
$this->dao->update(TABLE_PROJECT)->set('path')->eq($path['path'])->set('grade')->eq($path['grade'])->where('id')->eq($stage->id)->exec();
}
/**
* Update a plan.
*
* @param int $planID
* @param int $projectID
* @access public
* @return bool|array
*/
public function update($planID = 0, $projectID = 0)
{
/* Get oldPlan and the data from the post. */
$oldPlan = $this->getByID($planID);
$plan = fixer::input('post')
->setDefault('begin', '0000-00-00')
->setDefault('end', '0000-00-00')
->setDefault('realBegan', '0000-00-00')
->setDefault('realEnd', '0000-00-00')
->join('output', ',')
->get();
/* Judgment of required items. */
if($plan->begin == '0000-00-00') dao::$errors['begin'][] = sprintf($this->lang->error->notempty, $this->lang->programplan->begin);
if($plan->end == '0000-00-00') dao::$errors['end'][] = sprintf($this->lang->error->notempty, $this->lang->programplan->end);
$planChanged = ($oldPlan->name != $plan->name || $oldPlan->milestone != $plan->milestone || $oldPlan->begin != $plan->begin || $oldPlan->end != $plan->end);
if($plan->parent > 0)
{
$parentStage = $this->getByID($plan->parent);
$plan->attribute = $parentStage->attribute;
$plan->acl = $parentStage->acl;
$parentPercent = $parentStage->percent;
$childrenTotalPercent = $this->getTotalPercent($parentStage, true);
$childrenTotalPercent = $plan->parent == $oldPlan->parent ? ($childrenTotalPercent - $oldPlan->percent + $plan->percent) : ($childrenTotalPercent + $plan->percent);
if($childrenTotalPercent > 100) return dao::$errors['percent'][] = $this->lang->programplan->error->percentOver;
/* If child plan has milestone, update parent plan set milestone eq 0 . */
if($plan->milestone and $parentStage->milestone) $this->dao->update(TABLE_PROJECT)->set('milestone')->eq(0)->where('id')->eq($oldPlan->parent)->exec();
}
else
{
/* Synchronously update sub-phase permissions. */
$childrenIDList = $this->dao->select('*')->from(TABLE_PROJECT)->where('parent')->eq($oldPlan->id)->fetch('id');
if(!empty($childrenIDList)) $this->dao->update(TABLE_PROJECT)->set('acl')->eq($plan->acl)->where('id')->in($childrenIDList)->exec();
/* The workload of the parent plan cannot exceed 100%. */
$oldPlan->parent = $plan->parent;
$totalPercent = $this->getTotalPercent($oldPlan);
$totalPercent = $totalPercent + $plan->percent;
if($totalPercent > 100) return dao::$errors['percent'][] = $this->lang->programplan->error->percentOver;
}
/* Set planDuration and realDuration. */
$plan->planDuration = $this->getDuration($plan->begin, $plan->end);
$plan->realDuration = $this->getDuration($plan->realBegan, $plan->realEnd);
if($planChanged) $plan->version = $oldPlan->version + 1;
if(empty($plan->parent)) $plan->parent = $projectID;
$this->dao->update(TABLE_PROJECT)->data($plan)
->autoCheck()
->batchCheck($this->config->programplan->edit->requiredFields, 'notempty')
->checkIF($plan->end != '0000-00-00', 'end', 'ge', $plan->begin)
->checkIF($plan->percent != false, 'percent', 'float')
->where('id')->eq($planID)
->exec();
if(dao::isError()) return false;
$this->setTreePath($planID);
if($plan->acl != 'open') $this->loadModel('user')->updateUserView($planID, 'sprint');
if($planChanged)
{
$spec = new stdclass();
$spec->project = $planID;
$spec->version = $plan->version;
$spec->name = $plan->name;
$spec->milestone = $plan->milestone;
$spec->begin = $plan->begin;
$spec->end = $plan->end;
$this->dao->insert(TABLE_PROJECTSPEC)->data($spec)->exec();
}
return common::createChanges($oldPlan, $plan);
}
/**
* Print cell.
*
* @param int $col
* @param int $plan
* @param int $users
* @param int $projectID
* @access public
* @return string
*/
public function printCell($col, $plan, $users, $projectID)
{
$id = $col->id;
if($col->show)
{
$class = 'c-' . $id;
$title = '';
$idList = array('id','name','output','percent','attribute','version','begin','end','realBegan','realEnd', 'openedBy', 'openedDate');
if(in_array($id,$idList))
{
$class .= ' text-left';
$title = "title='{$plan->$id}'";
if($id == 'output') $class .= ' text-ellipsis';
if(!empty($plan->children)) $class .= ' has-child';
}
else
{
$class .= ' text-center';
}
if($id == 'actions') $class .= ' c-actions';
echo "<td class='{$class}' {$title}>";
if(isset($this->config->bizVersion)) $this->loadModel('flow')->printFlowCell('programplan', $plan, $id);
switch($id)
{
case 'id':
echo sprintf('%03d', $plan->id);
break;
case 'name':
$milestoneFlag = $plan->milestone ? " <i class='icon icon-flag red' title={$this->lang->programplan->milestone}'></i>" : '';
if($plan->grade > 1) echo '<span class="label label-badge label-light" title="' . $this->lang->programplan->children . '">' . $this->lang->programplan->childrenAB . '</span> ';
echo $plan->name . $milestoneFlag;
if(!empty($plan->children)) echo '<a class="plan-toggle" data-id="' . $plan->id . '"><i class="icon icon-angle-double-right"></i></a>';
break;
case 'percent':
echo $plan->percent . '%';
break;
case 'attribute':
echo zget($this->lang->stage->typeList, $plan->attribute, '');
break;
case 'begin':
echo $plan->begin;
break;
case 'end':
echo $plan->end;
break;
case 'realBegan':
echo $plan->realBegan;
break;
case 'realEnd':
echo $plan->realEnd;
break;
case 'output':
echo $plan->output;
break;
case 'version':
echo $plan->version;
break;
case 'editedBy':
echo zget($users, $plan->editedBy);
break;
case 'editedDate':
echo substr($plan->editedDate, 5, 11);
break;
case 'openedBy':
echo zget($users, $plan->openedBy);
break;
case 'openedDate':
echo substr($plan->openedDate, 5, 11);
break;
case 'actions':
common::printIcon('project', 'start', "projectID={$plan->id}", $plan, 'list', '', '', 'iframe', true);
$class = !empty($plan->children) ? 'disabled' : '';
common::printIcon('task', 'create', "projectID={$plan->id}", $plan, 'list', '', '', $class);
if($plan->grade == 1 && $this->isCreateTask($plan->id))
{
common::printIcon('programplan', 'create', "program={$plan->parent}&productID=$plan->product&planID=$plan->id", $plan, 'list', 'split', '', '', '', '', $this->lang->programplan->createSubPlan);
}
else
{
$disabled = ($plan->grade == 2) ? ' disabled' : '';
echo html::a('javascript:alert("' . $this->lang->programplan->error->createdTask . '");', '<i class="icon-programplan-create icon-split"></i>', '', 'class="btn ' . $disabled . '"');
}
common::printIcon('programplan', 'edit', "planID=$plan->id&projectID=$projectID", $plan, 'list', '', '', 'iframe', true);
$disabled = !empty($plan->children) ? ' disabled' : '';
if(common::hasPriv('project', 'delete', $plan))
{
common::printIcon('project', 'delete', "planID=$plan->id&confirm=no", $plan, 'list', 'trash', 'hiddenwin' , $disabled);
}
break;
}
echo '</td>';
}
}
/**
* Is create task.
*
* @param int $planID
* @access public
* @return bool
*/
public function isCreateTask($planID)
{
$task = $this->dao->select('*')->from(TABLE_TASK)->where('project')->eq($planID)->limit(1)->fetch();
return empty($task) ? true : false;
}
/**
* Is clickable.
*
* @param int $plan
* @param int $action
* @static
* @access public
* @return bool
*/
public static function isClickable($plan, $action)
{
$action = strtolower($action);
if($action == 'create' and $plan->grade > 1) return false;
return true;
}
/**
* Get the stage set to milestone.
*
* @param int $projectID
* @access public
* @return object
*/
public function getMilestones($projectID = 0)
{
return $this->dao->select('id, name')->from(TABLE_PROJECT)
->where('project')->eq($projectID)
->andWhere('type')->eq('stage')
->andWhere('milestone')->eq(1)
->andWhere('deleted')->eq(0)
->orderBy('id_desc')
->fetchPairs();
}
/**
* Get milestone by product.
*
* @param int $productID
* @access public
* @return object
*/
public function getMilestoneByProduct($productID)
{
return $this->dao->select('t1.id, t1.name')->from(TABLE_PROJECT)->alias('t1')
->leftJoin(TABLE_PROJECTPRODUCT)->alias('t2')->on('t1.id=t2.project')
->where('t2.product')->eq($productID)
->andWhere('t1.type')->eq('stage')
->andWhere('t1.milestone')->eq(1)
->andWhere('t1.deleted')->eq(0)
->orderBy('t1.begin asc')
->fetchPairs();
}
/**
* Get parent stage list.
*
* @param int $projectID
* @param int $planID
* @param int $productID
* @access public
* @return array
*/
public function getParentStageList($projectID, $planID, $productID)
{
$parentStage = $this->dao->select('t2.id, t2.name')->from(TABLE_PROJECTPRODUCT)
->alias('t1')->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
->where('t1.product')->eq($productID)
->andWhere('t2.project')->eq($projectID)
->andWhere('t2.grade')->eq(1)
->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->sprints)->fi()
->orderBy('t2.id desc')
->fetchPairs();
/* Remove the currently edited stage. */
if(isset($parentStage[$planID])) unset($parentStage[$planID]);
$plan = $this->getByID($planID);
foreach($parentStage as $key => $stage)
{
$isCreate = $this->isCreateTask($key);
if($isCreate === false and $key != $plan->parent) unset($parentStage[$key]);
}
$parentStage[0] = $this->lang->programplan->emptyParent;
ksort($parentStage);
return $parentStage;
}
}
-38
View File
@@ -1,38 +0,0 @@
<?php
/**
* The browse of programplan 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 programplan
* @version $Id: browse.html.php 4903 2013-06-26 05:32:59Z wyd621@gmail.com $
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<style>#dropMenu{z-index:99999;}</style>
<?php js::set('browseType', $type);?>
<div id='mainContent' class='main-table'>
<?php if(empty($plans)):?>
<div class="table-empty-tip">
<p>
<span class="text-muted"><?php echo $lang->programplan->noData;?></span>
<?php if(common::hasPriv('programplan', 'create')):?>
<?php echo html::a($this->createLink('programplan', 'create', "projectID=$projectID&productID=$productID"), "<i class='icon icon-plus'></i> " . $lang->programplan->create, '', "class='btn btn-info'");?>
<?php endif;?>
</p>
</div>
<?php else:?>
<?php if($type == 'gantt') include './gantt.html.php';?>
<?php if($type == 'lists') include './list.html.php';?>
<?php endif;?>
</div>
<script>
$('#subNavbar').find('ul li').each(function()
{
var that = $(this);
if(that.attr('data-id') != browseType) that.removeClass('active');
});
</script>
<?php include '../../common/view/footer.html.php';?>
-183
View File
@@ -1,183 +0,0 @@
<?php
/**
* The create of programplan 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 programplan
* @version $Id: create.html.php 4903 2013-06-26 05:32:59Z wyd621@gmail.com $
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php js::set('browseType', $type);?>
<style>.icon-help{margin-left: 3px;}</style>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left'>
<span class='btn btn-link btn-active-text'>
<?php
$title = $lang->programplan->create;
if($planID) $title = $programPlan->name . $lang->project->statge . '' . $programPlan->begin . $lang->project->to . $programPlan->end . '';
echo "<span class='text'>{$title}</span>";
?>
</span>
</div>
</div>
<?php $hideAttribute = $planID == 0 ? '' : ' hidden'?>
<?php $class = $planID == 0 ? '' : "disabled='disabled'"?>
<?php $name = $planID == 0 ? $lang->programplan->name : $lang->programplan->subStageName;?>
<div id='mainContent' class='main-content'>
<form class='main-form form-ajax' method='post' id='planForm' enctype='multipart/form-data'>
<table class='table table-form'>
<thead>
<tr class='text-center'>
<th class='required'><?php echo $name;?></th>
<th class='w-110px'>
<?php echo $lang->programplan->percent;?>
<?php if($planID):?>
<i class='icon-help' data-toggle='popover' data-trigger='focus hover' data-placement='right' data-tip-class='text-muted popover-sm' data-container="body" data-content="<?php echo $lang->programplan->workloadTips;?>"></i>
<?php endif;?>
</th>
<th class='w-110px <?php echo $hideAttribute?>'><?php echo $lang->programplan->attribute;?></th>
<th class='w-110px'><?php echo $lang->project->acl;?></th>
<th class='w-110px'><?php echo $lang->programplan->milestone;?></th>
<th class='w-110px required'><?php echo $lang->programplan->begin;?></th>
<th class='w-110px required'><?php echo $lang->programplan->end;?></th>
<th class='w-110px'><?php echo $lang->programplan->realBegan;?></th>
<th class='w-110px'><?php echo $lang->programplan->realEnd;?></th>
<?php if(isset($this->config->qcVersion)):?>
<th class='w-110px'><?php echo $lang->programplan->output;?></th>
<?php endif;?>
<th class="w-70px text-center"> <?php echo $lang->actions;?></th>
</tr>
</thead>
<tbody>
<?php $i = 0;?>
<?php if(empty($plans) and $planID == 0):?>
<?php foreach($stages as $stage):?>
<tr>
<td><input type='text' name='names[]' id='names<?php echo $i;?>' value='<?php echo $stage->name;?>' class='form-control' /></td>
<td>
<div class='input-group'>
<input type='text' name='percents[]' id='percent<?php echo $i;?>' value='<?php echo $stage->percent;?>' class='form-control'/>
<span class='input-group-addon'>%</span>
</div>
</td>
<td class='<?php echo $hideAttribute?>'><?php echo html::select("attributes[$i]", $lang->stage->typeList, $stage->type, "class='form-control'");?></td>
<td><?php echo html::select("acl[]", $lang->project->aclList, 'open', "class='form-control' $class");?></td>
<td><?php echo html::radio("milestone[$i]", $lang->programplan->milestoneList, 0);?></td>
<td><input type='text' name='begin[]' id='begin<?php echo $i;?>' value='' class='form-control form-date' /></td>
<td><input type='text' name='end[]' id='end<?php echo $i;?>' value='' class='form-control form-date' /></td>
<td><input type='text' name='realBegan[]' id='realBegan<?php echo $i;?>' value='' class='form-control form-date' /></td>
<td><input type='text' name='realEnd[]' id='realEnd<?php echo $i;?>' value='' class='form-control form-date' /></td>
<?php if(isset($this->config->qcVersion)):?>
<td><?php echo html::select("output[$i][]", $documentList, '', "class='form-control chosen' multiple");?></td>
<?php endif;?>
<td class='c-actions text-left'>
<a href='javascript:;' onclick='addItem(this)' class='btn btn-link'><i class='icon-plus'></i></a>
<a href='javascript:;' onclick='deleteItem(this)' class='btn btn-link'><i class='icon icon-close'></i></a>
</td>
</tr>
<?php $i ++;?>
<?php endforeach;?>
<?php endif;?>
<?php if(!empty($plans)):?>
<?php foreach($plans as $plan):?>
<?php $disabled = $plan->setMilestone ? '' : "disabled='disabled'"?>
<?php echo html::hidden('planIDList[]', $plan->id);?>
<tr>
<td><input type='text' name='names[]' id='names<?php echo $i;?>' value='<?php echo $plan->name;?>' class='form-control' /></td>
<td>
<div class='input-group'>
<input type='text' name='percents[]' id='percent<?php echo $i;?>' value='<?php echo $plan->percent;?>' class='form-control' />
<span class='input-group-addon'>%</span>
</div>
</td>
<td class='<?php echo $hideAttribute?>'><?php echo html::select("attributes[$i]", $lang->stage->typeList, $plan->attribute, "class='form-control'");?></td>
<td><?php echo html::select("acl[]", $lang->project->aclList, $plan->acl, "class='form-control' $class");?></td>
<td><?php echo html::radio("milestone[$i]", $lang->programplan->milestoneList, $plan->milestone, $disabled);?></td>
<td><input type='text' name='begin[] ' id='begin<?php echo $i;?>' value='<?php echo $plan->begin;?>' class='form-control form-date' /></td>
<td><input type='text' name='end[]' id='end<?php echo $i;?>' value='<?php echo $plan->end;?>' class='form-control form-date' /></td>
<td><input type='text' name='realBegan[] ' id='realBegan<?php echo $i;?>' value='<?php echo $plan->realBegan;?>' class='form-control form-date' /></td>
<td><input type='text' name='realEnd[]' id='realEnd<?php echo $i;?>' value='<?php echo $plan->realEnd;?>' class='form-control form-date' /></td>
<?php if(isset($this->config->qcVersion)):?>
<?php $option = empty($plan->output) ? 0 : explode(',', $plan->output);?>
<td><?php echo html::select("output[$i][]", $documentList, $option, "class='form-control chosen' multiple");?></td>
<?php endif;?>
<td class='c-actions text-left'>
<a href='javascript:;' onclick='addItem(this)' class='btn btn-link'><i class='icon-plus'></i></a>
</td>
</tr>
<?php $i ++;?>
<?php endforeach;?>
<?php endif;?>
<?php for($j = 0; $j < 5; $j ++):?>
<tr class='addedItem'>
<td><input type='text' name='names[]' id='names<?php echo $i;?>' value='' class='form-control' /></td>
<td>
<div class='input-group'>
<input type='text' name='percents[]' id='percent<?php echo $i;?>' value='' class='form-control' />
<span class='input-group-addon'>%</span>
</div>
</td>
<td class='<?php echo $hideAttribute?>'><?php echo html::select("attributes[$i]", $lang->stage->typeList, '', "class='form-control'");?></td>
<td><?php echo html::select("acl[]", $lang->project->aclList, 'open', "class='form-control' $class");?></td>
<td><?php echo html::radio("milestone[$i]", $lang->programplan->milestoneList, 0);?></td>
<td><input type='text' name='begin[] ' id='begin<?php echo $i;?>' value='' class='form-control form-date' /></td>
<td><input type='text' name='end[]' id='end<?php echo $i;?>' value='' class='form-control form-date' /></td>
<td><input type='text' name='realBegan[] ' id='realBegan<?php echo $i;?>' value='' class='form-control form-date' /></td>
<td><input type='text' name='realEnd[]' id='realEnd<?php echo $i;?>' value='' class='form-control form-date' /></td>
<?php if(isset($this->config->qcVersion)):?>
<td><?php echo html::select("output[$i][]", $documentList, '', "class='form-control chosen' multiple");?></td>
<?php endif;?>
<td class='c-actions text-left'>
<a href='javascript:;' onclick='addItem(this)' class='btn btn-link'><i class='icon-plus'></i></a>
<a href='javascript:;' onclick='deleteItem(this)' class='btn btn-link'><i class='icon icon-close'></i></a>
</td>
</tr>
<?php $i ++;?>
<?php endfor;?>
</tbody>
<tfoot>
<tr>
<?php $colspan = $planID == 0 ? 9 : 8;?>
<td colspan='<?php echo $colspan?>' class='text-center form-actions'><?php echo html::submitButton() . ' ' . html::backButton(); ?></td>
</tr>
</tfoot>
</table>
<?php js::set('i', $i);?>
</form>
</div>
<div>
<?php $i = '%i%';?>
<table class='hidden'>
<tr id='addItem' class='hidden'>
<td><input type='text' name='names[]' id='names<?php echo $i;?>' class='form-control' /></td>
<td>
<div class='input-group'>
<input type='text' name='percents[]' id='percent<?php echo $i;?>' class='form-control' />
<span class='input-group-addon'>%</span>
</div>
</td>
<td class='<?php echo $hideAttribute?>'><?php echo html::select("attributes[$i]", $lang->stage->typeList, '', "class='form-control'");?></td>
<td><?php echo html::select("acl[]", $lang->project->aclList, 'open', "class='form-control' $class");?></td>
<td><?php echo html::radio("milestone[$i]", $lang->programplan->milestoneList, 0);?></td>
<td><input type='text' name='begin[] ' id='begin<?php echo $i;?>' class='form-control form-date' /></td>
<td><input type='text' name='end[]' id='end<?php echo $i;?>' class='form-control form-date' /></td>
<td><input type='text' name='realBegan[] ' id='realBegan<?php echo $i;?>' class='form-control form-date' /></td>
<td><input type='text' name='realEnd[]' id='realEnd<?php echo $i;?>' class='form-control form-date' /></td>
<?php if(isset($this->config->qcVersion)):?>
<td><?php echo html::select("output[$i][]", $documentList, '', "class='form-control chosen ' multiple");?></td>
<?php endif;?>
<td class='c-actions text-center'>
<a href='javascript:;' onclick='addItem(this)' class='btn btn-link'><i class='icon-plus'></i></a>
<a href='javascript:;' onclick='deleteItem(this)' class='btn btn-link'><i class='icon icon-close'></i></a>
</td>
</tr>
</table>
</div>
<script>$('[data-toggle="popover"]').popover();</script>
<?php include '../../common/view/footer.html.php';?>
-107
View File
@@ -1,107 +0,0 @@
<?php
/**
* The edit of programplan 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 programplan
* @version $Id: edit.html.php 4903 2013-06-26 05:32:59Z wyd621@gmail.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 fade">
<div class="center-block">
<div class="main-header">
<h2><?php echo $lang->programplan->edit;?></h2>
</div>
<form class="load-indicator main-form form-ajax" method='post' enctype='multipart/form-data' id='dataform'>
<table class="table table-form">
<tbody>
<tr>
<th class="w-100px"><?php echo $lang->programplan->parent;?></th>
<td colspan='2'><?php echo html::select('parent', $parentStage, $plan->parent, "class='form-control chosen '");?></td>
</tr>
<tr>
<th class='w-100px'><?php echo $lang->programplan->name;?> </th>
<td colspan='2'><?php echo html::input('name', $plan->name, "class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->programplan->percent;?> </th>
<td colspan='2'>
<div class='input-group'>
<?php echo html::input('percent', $plan->percent, "class='form-control'");?>
<div class='input-group-addon'>%</span>
</div>
</td>
</tr>
<tr class="<?php if($plan->grade == 2) echo "hidden";?>" id="attributeType">
<th><?php echo $lang->programplan->attribute;?> </th>
<td colspan='2'><?php echo html::select('attribute', $lang->stage->typeList, $plan->attribute, "class='form-control'");?></td>
</tr>
<?php if($plan->setMilestone):?>
<tr>
<th><?php echo $lang->programplan->milestone;?> </th>
<td colspan='2'><?php echo html::radio('milestone', $lang->programplan->milestoneList, $plan->milestone);?></td>
</tr>
<?php else:?>
<?php echo html::hidden('milestone', $plan->milestone);?>
<?php endif;?>
<tr>
<th><?php echo $lang->project->acl;?> </th>
<?php $class = $plan->grade == 2 ? "disabled='disabled'" : '';?>
<td colspan='2'><?php echo html::select('acl', $lang->project->aclList, $plan->acl, "class='form-control' $class");?></td>
</tr>
<tr>
<th><?php echo $lang->programplan->planDateRange;?> </th>
<td colspan='2'>
<div class="input-group title-group">
<?php echo html::input('begin', $plan->begin, "class='form-control form-date'");?>
<span class="input-group-addon fix-border br-0"><?php echo $lang->project->to;?></span>
<?php echo html::input('end', $plan->end, "class='form-control form-date'");?>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->programplan->realDateRange;?> </th>
<td colspan='2'>
<div class="input-group title-group">
<?php echo html::input('realBegan', $plan->realBegan, "class='form-control form-date'");?>
<span class="input-group-addon fix-border br-0"><?php echo $lang->project->to;?></span>
<?php echo html::input('realEnd', $plan->realEnd, "class='form-control form-date'");?>
</div>
</td>
</tr>
<?php if(isset($this->config->qcVersion)):?>
<tr>
<th><?php echo $lang->programplan->output;?> </th>
<td colspan='4'><?php echo html::select('output[]', $documentList, $plan->output, "class='form-control chosen ' multiple");?></td>
</tr>
<?php endif;?>
<tr>
<td colspan='4' class='form-actions text-center'><?php echo html::submitButton() . html::backButton()?></td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
<script>
$("#parent").change(function()
{
var parent = $(this).children("option:selected").val();
if(parent == 0)
{
$("#attributeType").removeClass('hidden');
$("#acl").attr('disabled', false);
}
else
{
$("#attributeType").addClass('hidden');
$("#acl").attr('disabled', true);
}
});
</script>
<?php include '../../common/view/footer.html.php';?>
-422
View File
@@ -1,422 +0,0 @@
<?php
/**
* The gantt of programplan 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 programplan
* @version $Id: gantt.html.php 4903 2013-06-26 05:32:59Z wyd621@gmail.com $
* @link http://www.zentao.net
*/
?>
<?php include '../../common/ext/view/gantt.html.php';?>
<style>
#ganttView {height: 600px;}
#mainContent:before {background: #fff;}
.gantt-fullscreen #header,
.gantt-fullscreen #mainMenu,
.gantt-fullscreen #footer {display: none!important;}
.gantt-fullscreen #mainContent {position: fixed; top: 0; right: 0; bottom: 0; left: 0}
.gantt_task_content{display: none;}
.checkbox-primary {margin-top: 0px; margin-left: 10px;}
form {display: block; margin-top: 0em; margin-block-end: 1em;}
</style>
<?php js::set('customUrl', $this->createLink('programplan', 'ajaxCustom'));?>
<?php js::set('dateDetails', $dateDetails);?>
<div id='mainContent' class='main-content load-indicator' data-loading='<?php echo $lang->programplan->exporting;?>'>
<form class="main-form form-ajax">
<div class="example">
<?php echo html::commonButton($lang->programplan->full, 'id="fullScreenBtn"', 'btn btn-primary btn-sm')?>
<?php echo html::checkbox('stageCustom', $lang->programplan->stageCustom, $selectCustom);?>
</div>
</form>
<div id='ganttContainer'>
<div class='gantt' id='ganttView'></div>
</div>
</div>
<script>
var scriptLoadedMap = {};
var loadingPrefixText = '<?php echo $lang->programplan->exporting;?>';
function getRemoteScript(url, successCallback, errorCallback)
{
if(scriptLoadedMap[url]) return successCallback && successCallback();
$.getScript(url, function()
{
scriptLoadedMap[url] = true;
if(successCallback) successCallback();
}).fail(function()
{
if(errorCallback) errorCallback('Cannot load "' + url + '".');
});
}
function updateProgress(progress)
{
var progressText = loadingPrefixText;
if(progress < 1) progressText += Math.floor(progress * 100) + '%';
$('#mainContent').attr('data-loading', progressText);
}
function drawGanttToCanvas(exportType, successCallback, errorCallback)
{
updateProgress(0);
exportType = exportType || 'image';
var $ganttView = $('#ganttView');
var oldHeight = $ganttView.css('height');
var $ganttContainer = $('#ganttContainer');
var $ganttDataArea = $ganttView.find('.gantt_data_area');
var $ganttDridData = $ganttView.find('.gantt_grid_data');
var ganttHeight = $ganttView.find('.gantt_task_bg').outerHeight() + $ganttView.find('.gantt_grid_scale').outerHeight() + 1;
var ganttWidth = $ganttDataArea.outerWidth() + $ganttDridData.outerWidth();
$ganttContainer.css(
{
height: ganttHeight + $('#ganttHeader').outerHeight() + 80,
width: ganttWidth + 93
});
$ganttView.css('height', ganttHeight);
gantt.render();
updateProgress(0.1);
getRemoteScript('<?php echo $jsRoot . 'html2canvas/min.js';?>', function()
{
updateProgress(0.2);
var afterFinish = function(canvas)
{
$ganttContainer.css(
{
width: '',
height: ''
});
$ganttView.css('height', oldHeight);
if(canvas) canvas.remove();
};
var delayTime = Math.max(1000, Math.floor(10 * (ganttHeight * ganttWidth) / 100000));
var progressTimer;
if(delayTime > 1500)
{
var startProgress = 0.2;
var deltaProgress = 0.5 / Math.floor(delayTime/1000);
progressTimer = setInterval(function()
{
startProgress += deltaProgress;
updateProgress(Math.min(0.7, startProgress));
}, 1000);
}
setTimeout(function()
{
if(progressTimer) clearInterval(progressTimer);
updateProgress(0.7);
html2canvas($ganttContainer[0], {logging: false}).then(function(canvas)
{
var isExportPDF = exportType === 'pdf';
updateProgress(isExportPDF ? 0.8 : 0.9);
canvas.onerror = function()
{
afterFinish(canvas);
if(errorCallback) errorCallback('Cannot convert image to blob.');
};
if(isExportPDF)
{
var width = canvas.width;
var height = canvas.height;
getRemoteScript('<?php echo $jsRoot . 'pdfjs/min.js';?>', function()
{
updateProgress(0.8);
var pdf = new jsPDF(
{
format: [width, height],
unit: 'px',
orientation: width > height ? 'l' : 'p'
});
pdf.addImage(canvas, 0, 0, pdf.internal.pageSize.getWidth(), pdf.internal.pageSize.getHeight());
pdf.save('gantt-export-<?php echo $projectID;?>.pdf');
if(successCallback) successCallback(pdf);
afterFinish();
}, function(error)
{
afterFinish(canvas);
if(errorCallback) errorCallback(error);
});
}
else
{
canvas.toBlob(function(blob)
{
updateProgress(0.95);
var imageUrl = URL.createObjectURL(blob);
$('#ganttDownload').attr({href: imageUrl})[0].click();
if(successCallback) successCallback(imageUrl);
afterFinish(canvas);
});
}
}).catch(function(error)
{
afterFinish();
if(errorCallback) errorCallback('Cannot draw graphic to canvas.');
});
}, delayTime);
}, errorCallback);
}
function exportGantt(exportType)
{
var $mainContent = $('#mainContent');
$mainContent.addClass('loading').css('height', Math.max(200, Math.floor($(window).height() - $('#footer').outerHeight() - $('#header').outerHeight() - $('#mainMenu').outerHeight() - 38)));
$('#ganttExportDate').text(new Date().format('yyyy-MM-dd hh:mm:ss'));
var afterFinish = function(url)
{
setTimeout(function()
{
$mainContent.css('height', '').removeClass('loading');
}, 300);
updateProgress(1);
};
drawGanttToCanvas(exportType, afterFinish, function(errorText)
{
afterFinish();
$.zui.messager.danger('<?php echo $lang->programplan->exportFail;?>' + (errorText || ''));
});
}
function getByIdForGantt(list, id)
{
for (var i = 0; i < list.length; i++)
{
if (list[i].key == id) return list[i].label || "";
}
return "";
}
function zoomTasks(node)
{
switch(node.value)
{
case "day":
gantt.config.min_column_width = 70;
gantt.config.scales = [{unit: 'day', step: 1, format: '%m-%d'}];
gantt.config.scale_height = 35;
break;
case "week":
gantt.config.min_column_width = 70;
gantt.config.scales = [{unit: 'week', step: 1, format: "<?php echo $lang->project->gantt->zooming['week'];?> #%W"}, {unit:"day", step:1, date:"%D"}]
gantt.config.scale_height = 60;
break;
case "month":
gantt.config.min_column_width = 70;
gantt.config.scale_height = 60;
gantt.config.scales = [{unit: 'month', step: 1, format: '%M'}, {unit:"week", step:1, date:"<?php echo $lang->project->gantt->zooming['week'];?> #%W"}];
break;
}
gantt.render();
}
function updateCriticalPath()
{
gantt.config.highlight_critical_path = !gantt.config.highlight_critical_path;
if(gantt.config.highlight_critical_path)
{
$('#criticalPath').html(<?php echo json_encode($lang->programplan->hideCriticalPath);?>);
gantt.config.highlight_critical_path = true;
}
else
{
$('#criticalPath').html(<?php echo json_encode($lang->programplan->showCriticalPath);?>);
gantt.config.highlight_critical_path = false;
}
gantt.render();
}
$("#fullScreenBtn").on("click", function()
{
$("#mainContent").css("z-index", "9999");
$("#ganttView").css("z-index", "9999");
});
$(function()
{
// Set gantt view height
var resizeGanttView = function()
{
if(gantt.getState().fullscreen) return false;
$('#ganttView').css('height', Math.max(200, Math.floor($(window).height() - $('#footer').outerHeight() - $('#header').outerHeight() - $('#mainMenu').outerHeight() - 80)));
};
var ganttData = $.parseJSON(<?php echo json_encode($plans);?>);
if(!ganttData.data) ganttData.data = [];
gantt.config.readonly = true;
gantt.config.row_height = 25;
gantt.config.min_column_width = 40;
gantt.config.details_on_create = false;
gantt.config.scales = [{unit: 'day', step: 1, format: '%m-%d'}];
gantt.config.duration_unit = "day";
gantt.config.columns = [
{name: 'text', width: '*', tree: true, resize: true, width:200},
{name: 'start_date', align: 'center', resize: true, width: 80},
{name: 'deadline', align: 'center', resize: true, width: 80},
{name: 'duration', align: 'center', resize: true, width: 60},
{name: 'percent', align: 'center', resize: true, width:70, template: function(plan)
{
if(plan.percent) return Math.round(plan.percent) + '%';
}
},
{name: 'taskProgress', align: 'center', resize: true, width: 60},
{name: 'realBegan', align: 'center', resize: true, width: 80},
{name: 'realEnd', align: 'center', width: 80}
];
gantt.locale.labels.column_text = "<?php echo $lang->programplan->name;?>";
gantt.locale.labels.column_percent = "<?php echo $lang->programplan->percentAB;?>";
gantt.locale.labels.column_taskProgress = "<?php echo $lang->programplan->taskProgress;?>";
gantt.locale.labels.column_start_date = "<?php echo $lang->programplan->begin;?>";
gantt.locale.labels.column_deadline = "<?php echo $lang->programplan->end;?>";
gantt.locale.labels.column_realBegan = "<?php echo $lang->programplan->realBegan;?>";
gantt.locale.labels.column_realEnd = "<?php echo $lang->programplan->realEnd;?>";
gantt.locale.labels.column_duration = "<?php echo $lang->programplan->duration;?>";
if(dateDetails)
{
gantt.config.layout = {
rows: [
{
cols: [
{
view: 'grid',
scrollX: 'scrollHor',
scrollY: 'scrollVer'
}
]
},
{
view: 'scrollbar',
id: 'scrollHor',
height: 20
}
]
}
}
var date2Str = gantt.date.date_to_str(gantt.config.task_date);
var today = new Date();
var todayTips = "<?php echo $lang->programplan->today;?>";
gantt.addMarker({
start_date: today,
css: "today",
text: todayTips,
title: todayTips + ": " + date2Str(today)
});
gantt.templates.scale_cell_class = function(date)
{
if(date.getDay() == 0 || date.getDay() == 6) return 'weekend';
};
gantt.templates.timeline_cell_class = function(item, date)
{
if(date.getDay() == 0 || date.getDay() == 6) return 'weekend';
};
gantt.attachEvent('onTemplatesReady', function()
{
$('#fullScreenBtn').click(function()
{
gantt.expand();
});
});
var isGanttExpand = false;
var delayTimer = null;
var handleFullscreen = function()
{
if(isGanttExpand)
{
$('body').addClass('gantt-fullscreen');
$('#ganttView').css('height', $(window).height() - 40);
isGanttExpand = false;
}
else
{
$('body').removeClass('gantt-fullscreen');
resizeGanttView();
}
delayTimer = null;
};
var delayHandleFullscreen = function()
{
if(delayTimer) clearTimeout(delayTimer);
delayTimer = setTimeout(handleFullscreen, 50);
};
gantt.attachEvent('onBeforeExpand', function()
{
$('body').addClass('gantt-fullscreen');
isGanttExpand = true;
return true;
});
if(document.addEventListener)
{
document.addEventListener('webkitfullscreenchange', delayHandleFullscreen, false);
document.addEventListener('mozfullscreenchange', delayHandleFullscreen, false);
document.addEventListener('fullscreenchange', delayHandleFullscreen, false);
document.addEventListener('MSFullscreenChange', delayHandleFullscreen, false);
}
resizeGanttView();
$(window).resize(resizeGanttView);
gantt.templates.grid_folder = function(item) {
return "";
};
gantt.templates.grid_file = function(item) {
return "";
};
gantt.init('ganttView');
gantt.parse(ganttData);
gantt.showDate(new Date());
// Show task in modal on click task
var taskModalTrigger = new $.zui.ModalTrigger({type: 'iframe', width: '80%'});
gantt.attachEvent('onTaskClick', function(id, e)
{
if($(e.srcElement).hasClass('gantt_close') || $(e.srcElement).hasClass('gantt_open')) return false;
if(typeof id === 'string') id = parseInt(id);
if(!isNaN(id) && id > 0)
{
//taskModalTrigger.show({url: createLink('task', 'view', 'taskID=' + id, 'html', true)});
}
});
// Make folder can open or close by click
$('#ganttView').on('click', '.gantt_close,.gantt_open', function()
{
var $task = $(this).closest('.gantt_row_task');
var task = gantt.getTask($task.attr('task_id'));
if(task) gantt[task.$open ? 'close' : 'open'](task.id);
});
$(".checkbox-primary").on('click', function()
{
var stageCustom = [];
$("input[name='stageCustom[]']:checked").each(function()
{
var custom = $(this).val();
stageCustom.push(custom);
});
if(stageCustom.length == 0) stageCustom = 0;
$.ajax({
url: customUrl,
dataType: "json",
data: {stageCustom: stageCustom},
type: "post",
success: function(result)
{
window.location.reload();
}
});
});
});
</script>
-89
View File
@@ -1,89 +0,0 @@
<?php
/**
* The list of programplan 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 programplan
* @version $Id: list.html.php 4903 2013-06-26 05:32:59Z wyd621@gmail.com $
* @link http://www.zentao.net
*/
?>
<?php
include '../../common/view/datatable.fix.html.php';
js::set('confirmDelete', $lang->programplan->confirmDelete);
?>
<style>
#tableCustomBtn{display: none;}
.table-children {border-left: 2px solid #cbd0db; border-right: 2px solid #cbd0db;}
.table tbody > tr.table-children.table-child-top {border-top: 2px solid #cbd0db;}
.table tbody > tr.table-children.table-child-bottom {border-bottom: 2px solid #cbd0db;}
.table td.has-child > a:not(.plan-toggle) {max-width: 90%; max-width: calc(100% - 30px); display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
.table td.has-child > .plan-toggle {color: #838a9d; position: relative; top: 1px;}
.table td.has-child > .plan-toggle:hover {color: #006af1; cursor: pointer;}
.table td.has-child > .plan-toggle > .icon {font-size: 16px; display: inline-block; transition: transform .2s; -ms-transform:rotate(-90deg); -moz-transform:rotate(-90deg); -o-transform:rotate(-90deg); -webkit-transform:rotate(-90deg); transform: rotate(-90deg);}
.table td.has-child > .plan-toggle > .icon:before {text-align: left;}
.table td.has-child > .plan-toggle.collapsed > .icon {-ms-transform:rotate(90deg); -moz-transform:rotate(90deg); -o-transform:rotate(90deg); -webkit-transform:rotate(90deg); transform: rotate(90deg);}
.main-table tbody > tr.table-children > td:first-child::before {width: 3px;}
@-moz-document url-prefix() {.main-table tbody > tr.table-children > td:first-child::before {width: 4px;}}
</style>
<form class='main-table table-programplan' id='programplanForm' method='post'>
<div class="table-header fixed-right">
<nav class="btn-toolbar pull-right"></nav>
</div>
<?php
$vars = "projectID=$projectID&productID=$productID&type=lists&orderBy=%s";
$setting = $this->datatable->getSetting('programplan');
$widths = $this->datatable->setFixedFieldWidth($setting);
$widths['leftWidth'] = 300;
$columns = 0;
?>
<table class='table has-sort-head' id='programplanList' data-fixed-left-width='<?php echo $widths['leftWidth']?>' data-fixed-right-width='<?php echo $widths['rightWidth']?>' data-checkbox-name='programplanList[]'>
<thead>
<tr>
<th class='w-50px'><?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
<th> <?php common::printOrderLink('name', $orderBy, $vars, $lang->programplan->name);?></th>
<th class='w-90px'><?php common::printOrderLink('percent', $orderBy, $vars, $lang->programplan->percent);?></th>
<th class='w-80px'><?php common::printOrderLink('attribute', $orderBy, $vars, $lang->programplan->attribute);?></th>
<th class='w-90px'><?php common::printOrderLink('begin', $orderBy, $vars, $lang->programplan->begin);?></th>
<th class='w-90px'><?php common::printOrderLink('end', $orderBy, $vars, $lang->programplan->end);?></th>
<th class='w-90px'><?php common::printOrderLink('realBegan', $orderBy, $vars, $lang->programplan->realBegan);?></th>
<th class='w-90px'><?php common::printOrderLink('realEnd', $orderBy, $vars, $lang->programplan->realEnd);?></th>
<th class='w-150px text-center'><?php echo $lang->actions;?></th>
</tr>
</thead>
<tbody>
<?php foreach($plans as $plan):?>
<tr data-id='<?php echo $plan->id?>'>
<?php foreach($setting as $key => $value) $this->programplan->printCell($value, $plan, $users, $projectID);?>
</tr>
<?php if(!empty($plan->children)):?>
<?php $i = 0;?>
<?php foreach($plan->children as $key => $child):?>
<?php $class = $i == 0 ? ' table-child-top' : '';?>
<?php $class .= ($i + 1 == count($plan->children)) ? ' table-child-bottom' : '';?>
<tr class='table-children<?php echo $class;?> parent-<?php echo $plan->id;?>' data-id='<?php echo $child->id?>'>
<?php foreach($setting as $key => $value) $this->programplan->printCell($value, $child, $users, $projectID);?>
</tr>
<?php $i ++;?>
<?php endforeach;?>
<?php endif;?>
<?php endforeach;?>
</tbody>
</table>
</form>
<script>
$(function(){$('#programplanForm').table();})
$(document).on('click', '.plan-toggle', function(e)
{
var $toggle = $(this);
var id = $(this).data('id');
var isCollapsed = $toggle.toggleClass('collapsed').hasClass('collapsed');
$toggle.closest('[data-ride="table"]').find('tr.parent-' + id).toggle(!isCollapsed);
e.stopPropagation();
e.preventDefault();
});
</script>
+11 -5
View File
@@ -355,8 +355,11 @@ class projectModel extends model
if(!empty($sprint->percent)) $this->checkWorkload('create', $sprint->percent);
/* Set planDuration and realDuration. */
$sprint->planDuration = $this->loadModel('programplan')->getDuration($sprint->begin, $sprint->end);
if(!empty($sprint->realBegan) and !empty($sprint->realEnd)) $sprint->realDuration = $this->loadModel('programplan')->getDuration($sprint->realBegan, $sprint->realEnd);
if($this->config->maxVersion)
{
$sprint->planDuration = $this->loadModel('programplan')->getDuration($sprint->begin, $sprint->end);
if(!empty($sprint->realBegan) and !empty($sprint->realEnd)) $sprint->realDuration = $this->loadModel('programplan')->getDuration($sprint->realBegan, $sprint->realEnd);
}
$sprint = $this->loadModel('file')->processImgURL($sprint, $this->config->project->editor->create['id'], $this->post->uid);
$this->dao->insert(TABLE_PROJECT)->data($sprint)
@@ -380,7 +383,7 @@ class projectModel extends model
$this->file->updateObjectID($this->post->uid, $projectID, 'project');
/* Update the path. */
$this->loadModel('programplan')->setTreePath($projectID);
if($this->config->maxVersion) $this->loadModel('programplan')->setTreePath($projectID);
/* Copy team of project. */
if($copyProjectID != '')
@@ -485,8 +488,11 @@ class projectModel extends model
if(!empty($project->percent)) $this->checkWorkload('update', $project->percent, $oldProject);
/* Set planDuration and realDuration. */
$project->planDuration = $this->loadModel('programplan')->getDuration($project->begin, $project->end);
if(!empty($project->realBegan) and !empty($project->realEnd)) $project->realDuration = $this->loadModel('programplan')->getDuration($project->realBegan, $project->realEnd);
if($this->config->maxVersion)
{
$project->planDuration = $this->loadModel('programplan')->getDuration($project->begin, $project->end);
if(!empty($project->realBegan) and !empty($project->realEnd)) $project->realDuration = $this->loadModel('programplan')->getDuration($project->realBegan, $project->realEnd);
}
/* Update data. */
$this->dao->update(TABLE_PROJECT)->data($project)
+1 -1
View File
@@ -286,7 +286,7 @@ class testsuiteModel extends model
$linkedCases = $this->getLinkedCases($suite->id, 'id_desc', null, $append = false);
$cases = $this->dao->select('*')->from(TABLE_CASE)->where($query)
->andWhere('id')->notIN(array_keys($linkedCases))
->andWhere('PRJ')->eq($this->session->PRJ)
->beginIF($this->lang->navGroup->testsuite != 'qa')->andWhere('PRJ')->eq($this->session->PRJ)->fi()
->andWhere('deleted')->eq(0)
->orderBy('id desc')
->page($pager)
+5 -5
View File
@@ -455,7 +455,7 @@ class testtaskModel extends model
{
return $this->dao->select('*')->from(TABLE_CASE)->where($query)
->andWhere('id')->notIN($linkedCases)
->andWhere('PRJ')->eq($this->session->PRJ)
->beginIF($this->lang->navGroup->testtask != 'qa')->andWhere('PRJ')->eq($this->session->PRJ)->fi()
->andWhere('status')->ne('wait')
->andWhere('type')->ne('unit')
->beginIF($task->branch)->andWhere('branch')->in("0,$task->branch")->fi()
@@ -484,7 +484,7 @@ class testtaskModel extends model
{
$cases = $this->dao->select('*')->from(TABLE_CASE)
->where($query)
->andWhere('PRJ')->eq($this->session->PRJ)
->beginIF($this->lang->navGroup->testtask != 'qa')->andWhere('PRJ')->eq($this->session->PRJ)->fi()
->andWhere('product')->eq($productID)
->andWhere('status')->ne('wait')
->beginIF($linkedCases)->andWhere('id')->notIN($linkedCases)->fi()
@@ -517,7 +517,7 @@ class testtaskModel extends model
if($bugs)
{
$cases = $this->dao->select('*')->from(TABLE_CASE)->where($query)
->andWhere('PRJ')->eq($this->session->PRJ)
->beginIF($this->lang->navGroup->testtask != 'qa')->andWhere('PRJ')->eq($this->session->PRJ)->fi()
->andWhere('product')->eq($productID)
->andWhere('status')->ne('wait')
->beginIF($linkedCases)->andWhere('id')->notIN($linkedCases)->fi()
@@ -550,7 +550,7 @@ class testtaskModel extends model
return $this->dao->select('t1.*,t2.version as version')->from(TABLE_CASE)->alias('t1')
->leftJoin(TABLE_SUITECASE)->alias('t2')->on('t1.id=t2.case')
->where($query)
->andWhere('t1.PRJ')->eq($this->session->PRJ)
->beginIF($this->lang->navGroup->testtask != 'qa')->andWhere('t1.PRJ')->eq($this->session->PRJ)->fi()
->andWhere('t2.suite')->eq((int)$suite)
->andWhere('t1.product')->eq($productID)
->andWhere('status')->ne('wait')
@@ -585,7 +585,7 @@ class testtaskModel extends model
->where($query)
->andWhere('t1.id')->notin($linkedCases)
->andWhere('t2.task')->eq($testTask)
->andWhere('t1.PRJ')->eq($this->session->PRJ)
->beginIF($this->lang->navGroup->testtask != 'qa')->andWhere('t1.PRJ')->eq($this->session->PRJ)->fi()
->andWhere('t1.status')->ne('wait')
->page($pager)
->fetchAll();