* Merge code.
This commit is contained in:
@@ -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';
|
||||
@@ -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}§ion={$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);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
@@ -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.';
|
||||
@@ -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.';
|
||||
@@ -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.';
|
||||
@@ -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.';
|
||||
@@ -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';
|
||||
@@ -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';
|
||||
@@ -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}§ion={$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;
|
||||
}
|
||||
}
|
||||
@@ -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';?>
|
||||
@@ -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';?>
|
||||
@@ -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';?>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user