* Add programplan comment.
This commit is contained in:
@@ -1,12 +1,39 @@
|
||||
<?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);
|
||||
$this->app->loadLang('review');
|
||||
}
|
||||
|
||||
/**
|
||||
* Common action
|
||||
*
|
||||
* @param int $programID
|
||||
* @param int $productID
|
||||
* @param string $extra
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function commonAction($programID, $productID = 0, $extra = '')
|
||||
{
|
||||
$products = $this->loadModel('product')->getPairs($programID);
|
||||
@@ -16,6 +43,17 @@ class programplan extends control
|
||||
$this->programplan->setMenu($programID, $productID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Browse programplans
|
||||
*
|
||||
* @param int $programID
|
||||
* @param int $productID
|
||||
* @param string $type
|
||||
* @param string $orderBy
|
||||
* @param int $baselineID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function browse($programID = 0, $productID = 0, $type = 'gantt', $orderBy = 'id_asc', $baselineID = 0)
|
||||
{
|
||||
$this->app->loadLang('stage');
|
||||
@@ -59,6 +97,15 @@ class programplan extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a programplan
|
||||
*
|
||||
* @param int $programID
|
||||
* @param int $productID
|
||||
* @param int $planID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function create($programID = 0, $productID = 0, $planID = 0)
|
||||
{
|
||||
$this->commonAction($programID, $productID);
|
||||
@@ -92,6 +139,13 @@ class programplan extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit a programplan
|
||||
*
|
||||
* @param int $planID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function edit($planID = 0)
|
||||
{
|
||||
$plan = $this->programplan->getByID($planID);
|
||||
@@ -121,6 +175,14 @@ class programplan extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a programplan
|
||||
*
|
||||
* @param int $planID
|
||||
* @param string $confirm
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function delete($planID, $confirm = 'no')
|
||||
{
|
||||
if($confirm == 'no')
|
||||
@@ -141,6 +203,12 @@ class programplan extends control
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajax custom
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxCustom()
|
||||
{
|
||||
$data = fixer::input('post')->get();
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
<?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 = 'Browse Program Plan';
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
<?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 = '浏览阶段计划';
|
||||
|
||||
@@ -1,11 +1,38 @@
|
||||
<?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 $programID
|
||||
* @param int $productID
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function setMenu($programID, $productID)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get 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();
|
||||
@@ -13,6 +40,13 @@ class programplanModel extends model
|
||||
return $this->processPlan($plan);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get projects by product
|
||||
*
|
||||
* @param int $productID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getProjectsByProduct($productID)
|
||||
{
|
||||
$projects = $this->dao->select('project')->from(TABLE_PROJECTPRODUCT)->where('product')->eq($productID)->fetchPairs();
|
||||
@@ -20,6 +54,17 @@ class programplanModel extends model
|
||||
return $projects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list
|
||||
*
|
||||
* @param int $programID
|
||||
* @param int $productID
|
||||
* @param int $planID
|
||||
* @param string $type
|
||||
* @param string $orderBy
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getList($programID = 0, $productID = 0, $planID = 0, $type = '', $orderBy = 'id_asc')
|
||||
{
|
||||
$projects = $this->getProjectsByProduct($productID);
|
||||
@@ -36,6 +81,13 @@ class programplanModel extends model
|
||||
return $this->processPlans($plans);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get by list
|
||||
*
|
||||
* @param array $idList
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getByList($idList = array())
|
||||
{
|
||||
$plans = $this->dao->select('*')->from(TABLE_PROJECT)
|
||||
@@ -46,6 +98,13 @@ class programplanModel extends model
|
||||
return $this->processPlans($plans);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get plan pairs for budget
|
||||
*
|
||||
* @param int $programID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getPlanPairsForBudget($programID = 0)
|
||||
{
|
||||
$pairs = array();
|
||||
@@ -67,6 +126,15 @@ class programplanModel extends model
|
||||
return $pairs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get plans
|
||||
*
|
||||
* @param int $programID
|
||||
* @param int $productID
|
||||
* @param string $orderBy
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getPlans($programID = 0, $productID = 0, $orderBy = 'id_asc')
|
||||
{
|
||||
$plans = $this->getList($programID, $productID, 0, 'all', $orderBy);
|
||||
@@ -82,6 +150,15 @@ class programplanModel extends model
|
||||
return $parents;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get pairs
|
||||
*
|
||||
* @param int $programID
|
||||
* @param int $productID
|
||||
* @param string $type
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getPairs($programID, $productID = 0, $type = 'all')
|
||||
{
|
||||
$plans = $this->getPlans($programID, $productID);
|
||||
@@ -244,6 +321,13 @@ class programplanModel extends model
|
||||
return $returnJson ? json_encode($datas) : $datas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get total percent
|
||||
*
|
||||
* @param int $plan
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
public function getTotalPercent($plan)
|
||||
{
|
||||
$plans = $this->getList($plan->program, $plan->product, $plan->parent);
|
||||
@@ -258,6 +342,13 @@ class programplanModel extends model
|
||||
return $totalPercent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process plans
|
||||
*
|
||||
* @param int $plans
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function processPlans($plans)
|
||||
{
|
||||
foreach($plans as $planID => $plan)
|
||||
@@ -268,6 +359,13 @@ class programplanModel extends model
|
||||
return $plans;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process plan
|
||||
*
|
||||
* @param int $plan
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function processPlan($plan)
|
||||
{
|
||||
$plan->setMilestone = true;
|
||||
@@ -302,12 +400,29 @@ class programplanModel extends model
|
||||
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 $programID
|
||||
* @param int $parentID
|
||||
* @param int $productID
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function create($programID = 0, $parentID = 0, $productID = 0)
|
||||
{
|
||||
$data = (array)fixer::input('post')->get();
|
||||
@@ -482,6 +597,13 @@ class programplanModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a plan
|
||||
*
|
||||
* @param int $planID
|
||||
* @access public
|
||||
* @return bool|array
|
||||
*/
|
||||
public function update($planID = 0)
|
||||
{
|
||||
$oldPlan = $this->getByID($planID);
|
||||
@@ -563,6 +685,15 @@ class programplanModel extends model
|
||||
return common::createChanges($oldPlan, $plan);
|
||||
}
|
||||
|
||||
/**
|
||||
* Print cell
|
||||
*
|
||||
* @param int $col
|
||||
* @param int $plan
|
||||
* @param int $users
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function printCell($col, $plan, $users)
|
||||
{
|
||||
$id = $col->id;
|
||||
@@ -661,12 +792,28 @@ class programplanModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
@@ -676,6 +823,13 @@ class programplanModel extends model
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get milestones
|
||||
*
|
||||
* @param int $programID
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getMilestones($programID = 0)
|
||||
{
|
||||
return $this->dao->select('id, name')->from(TABLE_PROJECT)
|
||||
@@ -687,6 +841,13 @@ class programplanModel extends model
|
||||
->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')
|
||||
@@ -699,12 +860,27 @@ class programplanModel extends model
|
||||
->fetchPairs();
|
||||
}
|
||||
|
||||
/**
|
||||
* Is parent
|
||||
*
|
||||
* @param int $planID
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function isParent($planID)
|
||||
{
|
||||
$children = $this->dao->select('id')->from(TABLE_PROJECT)->where('parent')->eq($planID)->andWhere('deleted')->eq('0')->fetch();
|
||||
return empty($children) ? false : true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get parent stage list
|
||||
*
|
||||
* @param int $planID
|
||||
* @param int $productID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getParentStageList($planID, $productID)
|
||||
{
|
||||
$projects = $this->getProjectsByProduct($productID);
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
<?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);?>
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
<?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);?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
<?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';?>
|
||||
<?php
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
<?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;}
|
||||
|
||||
@@ -1,4 +1,16 @@
|
||||
<?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';
|
||||
include '../../common/view/datatable.html.php';
|
||||
js::set('confirmDelete', $lang->programplan->confirmDelete);
|
||||
|
||||
Reference in New Issue
Block a user