Merge branch 'sprint/gantt_upgrade' into 'master'
Sprint/gantt upgrade See merge request easycorp/zentaopms!4807
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
ALTER TABLE `zt_task` ADD `order` mediumint(8) NOT NULL DEFAULT 0 AFTER `activatedDate`;
|
||||
ALTER TABLE `zt_task` ADD INDEX `order` (`order`);
|
||||
ALTER TABLE `zt_story` ADD COLUMN `linkRequirements` varchar(255) NOT NULL AFTER `linkStories`;
|
||||
|
||||
ALTER TABLE `zt_searchindex` ADD FULLTEXT `title_content` (`title`, `content`);
|
||||
|
||||
@@ -1529,6 +1529,7 @@ CREATE TABLE IF NOT EXISTS `zt_task` (
|
||||
`lastEditedBy` varchar(30) NOT NULL,
|
||||
`lastEditedDate` datetime NOT NULL,
|
||||
`activatedDate` datetime NOT NULL,
|
||||
`order` mediumint(8) unsigned NOT NULL,
|
||||
`repo` mediumint(8) unsigned NOT NULL,
|
||||
`mr` mediumint(8) unsigned NOT NULL,
|
||||
`entry` varchar(255) NOT NULL,
|
||||
@@ -1542,6 +1543,7 @@ CREATE TABLE IF NOT EXISTS `zt_task` (
|
||||
KEY `story` (`story`),
|
||||
KEY `parent` (`parent`),
|
||||
KEY `assignedTo` (`assignedTo`)
|
||||
KEY `order` (`order`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_taskestimate`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_taskestimate` (
|
||||
|
||||
@@ -11,14 +11,18 @@
|
||||
*/
|
||||
css::import($jsRoot . 'dhtmlxgantt/min.css');
|
||||
js::import($jsRoot . 'dhtmlxgantt/min.js');
|
||||
js::import($jsRoot . 'dhtmlxgantt/ext/dhtmlxgantt_critical_path.js');
|
||||
js::import($jsRoot . 'dhtmlxgantt/ext/dhtmlxgantt_fullscreen.js');
|
||||
js::import($jsRoot . 'dhtmlxgantt/ext/dhtmlxgantt_smart_rendering.js');
|
||||
js::import($jsRoot . 'dhtmlxgantt/ext/dhtmlxgantt_marker.js');
|
||||
js::import($jsRoot . 'dhtmlxgantt/ext/dhtmlxgantt_tooltip.js');
|
||||
$currentLang = $app->getClientLang();
|
||||
if($currentLang != 'en') js::import($jsRoot . 'dhtmlxgantt/lang/' . $currentLang . '.js');
|
||||
?>
|
||||
<style>
|
||||
.gantt_message_area{display:none;}
|
||||
</style>
|
||||
<script>
|
||||
gantt.plugins({
|
||||
marker: true,
|
||||
critical_path: true,
|
||||
fullscreen: true,
|
||||
tooltip: true,
|
||||
click_drag: true
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -86,6 +86,18 @@ class programplan extends control
|
||||
$plans = $this->programplan->getDataForGantt($projectID, $this->productID, $baselineID, $selectCustom, false);
|
||||
}
|
||||
|
||||
if($type == 'assignedTo')
|
||||
{
|
||||
$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->getDataForGanttGroupByAssignedTo($projectID, $this->productID, $baselineID, $selectCustom, false);
|
||||
}
|
||||
|
||||
if($type == 'lists')
|
||||
{
|
||||
$sort = common::appendOrder($orderBy);
|
||||
@@ -103,6 +115,7 @@ class programplan extends control
|
||||
$this->view->selectCustom = $selectCustom;
|
||||
$this->view->dateDetails = $dateDetails;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->ganttType = $type;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
@@ -237,4 +250,42 @@ class programplan extends control
|
||||
$response['message'] = '';
|
||||
return $this->send($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save task drag position.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxSaveTaskDrag()
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
if(!isset($_POST['id']) or empty($_POST['id'])) return $this->send(array('result' => 'fail', 'message' => ''));
|
||||
$objectID = $_POST['id'];
|
||||
|
||||
$this->loadModel('task')->saveTaskDrag($objectID, $_POST['type']);
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
return $this->send(array('result' => 'success'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Save task drag action.
|
||||
*
|
||||
* @param int $productID
|
||||
*
|
||||
* @access public
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxSaveGanttMove($productID = 0)
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->loadModel('task')->saveTaskMove($productID);
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
return $this->send(array('result' => 'success'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
$lang->programplan->common = 'Program Plan';
|
||||
$lang->programplan->browse = 'Program Plan';
|
||||
$lang->programplan->gantt = 'Gantt Chart';
|
||||
$lang->programplan->ganttEdit = 'Gantt Edit';
|
||||
$lang->programplan->list = 'Stage List';
|
||||
$lang->programplan->create = 'Create';
|
||||
$lang->programplan->edit = 'Edit';
|
||||
@@ -84,3 +85,4 @@ $lang->programplan->error->createdTask = 'The task has been decomposed. Sub
|
||||
$lang->programplan->error->parentWorkload = 'The sum of the workload of the child phase cannot be greater than that of the parent phase: %s.';
|
||||
$lang->programplan->error->parentDuration = 'The planned start and planned completion of the child phase cannot exceed the parent phase.';
|
||||
$lang->programplan->error->sameName = 'Stage name cannot be the same!';
|
||||
$lang->programplan->error->taskDrag = 'The %s task cannot be dragged';
|
||||
@@ -12,6 +12,7 @@
|
||||
$lang->programplan->common = 'Program Plan';
|
||||
$lang->programplan->browse = 'Gantt Chart';
|
||||
$lang->programplan->gantt = 'Gantt Chart';
|
||||
$lang->programplan->ganttEdit = 'Gantt Edit';
|
||||
$lang->programplan->list = 'Stage List';
|
||||
$lang->programplan->create = 'Create';
|
||||
$lang->programplan->edit = 'Edit';
|
||||
@@ -84,3 +85,4 @@ $lang->programplan->error->createdTask = 'The task is decomposed. Sub stages
|
||||
$lang->programplan->error->parentWorkload = 'The sum of the workload in the sub stage cannot be > that in the parent stage: %s.';
|
||||
$lang->programplan->error->parentDuration = 'The planned start and planned completion of the child phase cannot exceed the parent phase.';
|
||||
$lang->programplan->error->sameName = 'Stage name cannot be the same!';
|
||||
$lang->programplan->error->taskDrag = 'The %s task cannot be dragged';
|
||||
@@ -12,6 +12,7 @@
|
||||
$lang->programplan->common = 'Program Plan';
|
||||
$lang->programplan->browse = 'Program Plan';
|
||||
$lang->programplan->gantt = 'Gantt Chart';
|
||||
$lang->programplan->ganttEdit = 'Gantt Edit';
|
||||
$lang->programplan->list = 'Stage List';
|
||||
$lang->programplan->create = 'Create';
|
||||
$lang->programplan->edit = 'Edit';
|
||||
@@ -84,3 +85,4 @@ $lang->programplan->error->createdTask = 'The task has been decomposed. Sub
|
||||
$lang->programplan->error->parentWorkload = 'The sum of the workload of the child phase cannot be greater than that of the parent phase: %s.';
|
||||
$lang->programplan->error->parentDuration = 'The planned start and planned completion of the child phase cannot exceed the parent phase.';
|
||||
$lang->programplan->error->sameName = 'Stage name cannot be the same!';
|
||||
$lang->programplan->error->taskDrag = 'The %s task cannot be dragged';
|
||||
@@ -12,6 +12,7 @@
|
||||
$lang->programplan->common = '项目阶段';
|
||||
$lang->programplan->browse = '浏览甘特图';
|
||||
$lang->programplan->gantt = '甘特图';
|
||||
$lang->programplan->ganttEdit = '甘特图编辑';
|
||||
$lang->programplan->list = '阶段列表';
|
||||
$lang->programplan->create = '设置阶段';
|
||||
$lang->programplan->edit = '编辑';
|
||||
@@ -84,3 +85,9 @@ $lang->programplan->error->createdTask = '已分解任务,不可添加子
|
||||
$lang->programplan->error->parentWorkload = '子阶段的工作量之和不能大于父阶段的工作量:%s';
|
||||
$lang->programplan->error->parentDuration = '子阶段计划开始、计划完成不能超过父阶段';
|
||||
$lang->programplan->error->sameName = '阶段名称不能相同!';
|
||||
$lang->programplan->error->taskDrag = '%s的任务不可以拖动';
|
||||
$lang->programplan->error->planDrag = '%s的阶段不可以拖动';
|
||||
|
||||
|
||||
$lang->programplan->ganttBrowseType['gantt'] = '按阶段分组';
|
||||
$lang->programplan->ganttBrowseType['assignedTo'] = '按指派给分组';
|
||||
|
||||
@@ -191,17 +191,17 @@ class programplanModel extends model
|
||||
$data->status = $this->processStatus('execution', $plan);
|
||||
$data->begin = $start;
|
||||
$data->deadline = $end;
|
||||
$data->realBegan = helper::isZeroDate($plan->realBegan) ? '' : substr($plan->realBegan, 0, 10);
|
||||
$data->realEnd = helper::isZeroDate($plan->realEnd) ? '' : substr($plan->realEnd, 0, 10);
|
||||
$data->realBegan = helper::isZeroDate($plan->realBegan) ? '' : $plan->realBegan;
|
||||
$data->realEnd = helper::isZeroDate($plan->realEnd) ? '' : $plan->realEnd;
|
||||
$data->parent = $plan->grade == 1 ? 0 :$plan->parent;
|
||||
$data->open = true;
|
||||
$data->start_date = $data->realBegan ? $data->realBegan : $data->begin;
|
||||
$data->endDate = $data->realEnd ? $data->realEnd : $data->deadline;
|
||||
$data->duration = 0;
|
||||
$data->duration = 1;
|
||||
|
||||
if($data->endDate > $data->start_date) $data->duration = helper::diffDate($data->endDate, $data->start_date) + 1;
|
||||
if($data->start_date) $data->start_date = date('d-m-Y', strtotime($data->start_date));
|
||||
if($data->start_date == '' or $data->endDate == '') $data->duration = 0;
|
||||
if($data->start_date == '' or $data->endDate == '') $data->duration = 1;
|
||||
|
||||
$datas['data'][$plan->id] = $data;
|
||||
$stageIndex[$plan->id] = array('planID' => $plan->id, 'parent' => $plan->parent, 'progress' => array('totalConsumed' => 0, 'totalReal' => 0));
|
||||
@@ -218,7 +218,7 @@ class programplanModel extends model
|
||||
|
||||
if(empty($selectCustom)) $selectCustom = $this->loadModel('setting')->getItem("owner={$owner}&module={$module}§ion={$section}&key={$object}");
|
||||
|
||||
$tasks = $this->dao->select('*')->from(TABLE_TASK)->where('deleted')->eq(0)->andWhere('execution')->in($planIdList)->fetchAll('id');
|
||||
$tasks = $this->dao->select('*')->from(TABLE_TASK)->where('deleted')->eq(0)->andWhere('execution')->in($planIdList)->orderBy('execution_asc, order_asc, id_desc')->fetchAll('id');
|
||||
$taskTeams = $this->dao->select('root,account')->from(TABLE_TEAM)->where('type')->eq('task')->andWhere('root')->in(array_keys($tasks))->fetchGroup('root', 'account');
|
||||
$users = $this->loadModel('user')->getPairs('noletter');
|
||||
|
||||
@@ -242,8 +242,8 @@ class programplanModel extends model
|
||||
|
||||
$estStart = helper::isZeroDate($task->estStarted) ? '' : $task->estStarted;
|
||||
$estEnd = helper::isZeroDate($task->deadline) ? '' : $task->deadline;
|
||||
$realBegan = helper::isZeroDate($task->realStarted) ? '' : substr($task->realStarted, 0, 10);
|
||||
$realEnd = (in_array($task->status, array('done', 'closed')) and !helper::isZeroDate($task->finishedDate)) ? substr($task->finishedDate, 0, 10) : '';
|
||||
$realBegan = helper::isZeroDate($task->realStarted) ? '' : $task->realStarted;
|
||||
$realEnd = (in_array($task->status, array('done', 'closed')) and !helper::isZeroDate($task->finishedDate)) ? $task->finishedDate : '';
|
||||
|
||||
$start = $realBegan ? $realBegan : $estStart;
|
||||
$end = $realEnd ? $realEnd : $estEnd;
|
||||
@@ -272,7 +272,7 @@ class programplanModel extends model
|
||||
$data->taskProgress = ($progress * 100) . '%';
|
||||
$data->start_date = $start;
|
||||
$data->endDate = $end;
|
||||
$data->duration = 0;
|
||||
$data->duration = 1;
|
||||
|
||||
/* If multi task then show the teams. */
|
||||
if($task->mode == 'multi' and !empty($taskTeams[$task->id]))
|
||||
@@ -285,7 +285,7 @@ class programplanModel extends model
|
||||
|
||||
if($data->endDate > $data->start_date) $data->duration = helper::diffDate($data->endDate, $data->start_date) + 1;
|
||||
if($data->start_date) $data->start_date = date('d-m-Y', strtotime($data->start_date));
|
||||
if($data->start_date == '' or $data->endDate == '') $data->duration = 0;
|
||||
if($data->start_date == '' or $data->endDate == '') $data->duration = 1;
|
||||
|
||||
if(strpos($selectCustom, 'task') !== false) $datas['data'][$data->id] = $data;
|
||||
foreach($stageIndex as $index => $stage)
|
||||
@@ -333,6 +333,193 @@ class programplanModel extends model
|
||||
return $returnJson ? json_encode($datas) : $datas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get gantt data group by assigned.
|
||||
*
|
||||
* @param int $executionID
|
||||
* @param int $productID
|
||||
* @param int $baselineID
|
||||
* @param string $selectCustom
|
||||
* @param bool $returnJson
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getDataForGanttGroupByAssignedTo($executionID, $productID, $baselineID = 0, $selectCustom = '', $returnJson = true)
|
||||
{
|
||||
$plans = $this->getStage($executionID, $productID);
|
||||
|
||||
$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;
|
||||
|
||||
$taskSign = "<span class='task-label'>[ 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}");
|
||||
|
||||
$tasksGroup = $this->dao->select('*')->from(TABLE_TASK)->where('deleted')->eq(0)->andWhere('execution')->in($planIdList)->fetchGroup('assignedTo','id');
|
||||
$users = $this->loadModel('user')->getPairs('noletter');
|
||||
|
||||
$tasksMap = array();
|
||||
foreach($tasksGroup as $group => $tasks)
|
||||
{
|
||||
foreach($tasks as $id => $task)
|
||||
{
|
||||
if($task->mode == 'multi')
|
||||
{
|
||||
$team = $this->dao->select('t1.*,t2.realname')->from(TABLE_TEAM)->alias('t1')
|
||||
->leftJoin(TABLE_USER)->alias('t2')->on('t1.account = t2.account')
|
||||
->where('t1.root')->eq($id)->andWhere('t1.type')->eq('task')->orderBy('t1.order')->fetchAll('account');
|
||||
foreach($team as $account => $member)
|
||||
{
|
||||
if($account == $group) continue;
|
||||
if(!isset($taskGroups[$account])) $taskGroups[$account] = array();
|
||||
|
||||
$taskGroups[$account][$id] = clone $task;
|
||||
$taskGroups[$account][$id]->id = $id . '_' . $account;
|
||||
$taskGroups[$account][$id]->realID = $id;
|
||||
$taskGroups[$account][$id]->assignedTo = $account;
|
||||
$taskGroups[$account][$id]->realname = $member->realname;
|
||||
}
|
||||
}
|
||||
|
||||
$tasksMap[$task->id] = $task;
|
||||
}
|
||||
}
|
||||
|
||||
$groupID = 0;
|
||||
foreach($tasksGroup as $group => $tasks)
|
||||
{
|
||||
$groupID --;
|
||||
$groupName = $group;
|
||||
$groupName = zget($users, $group);
|
||||
$dataGroup = new stdclass();
|
||||
$dataGroup->id = $groupID;
|
||||
$dataGroup->type = 'group';
|
||||
$dataGroup->text = $groupName;
|
||||
$dataGroup->percent = '';
|
||||
$dataGroup->attribute = '';
|
||||
$dataGroup->milestone = '';
|
||||
$dataGroup->owner_id = $group;
|
||||
$dataGroup->status = '';
|
||||
$dataGroup->begin = '';
|
||||
$dataGroup->deadline = '';
|
||||
$dataGroup->realBegan = '';
|
||||
$dataGroup->realEnd = '';
|
||||
$dataGroup->parent = 0;
|
||||
$dataGroup->open = true;
|
||||
$dataGroup->progress = '';
|
||||
$dataGroup->taskProgress = '';
|
||||
|
||||
$groupKey = $groupID . $group;
|
||||
$datas['data'][$groupKey] = $dataGroup;
|
||||
|
||||
$realStartDate = array();
|
||||
$realEndDate = array();
|
||||
$totalTask = count($tasks);
|
||||
foreach($tasks as $taskID => $task)
|
||||
{
|
||||
$execution = zget($plans, $task->execution, array());
|
||||
|
||||
$priIcon = sprintf($taskPri, $task->pri, $task->pri, $task->pri);
|
||||
|
||||
$estStart = helper::isZeroDate($task->estStarted) ? '' : $task->estStarted;
|
||||
$estEnd = helper::isZeroDate($task->deadline) ? '' : $task->deadline;
|
||||
$realBegan = helper::isZeroDate($task->realStarted) ? '' : $task->realStarted;
|
||||
$realEnd = (in_array($task->status, array('done', 'closed')) and !helper::isZeroDate($task->finishedDate)) ? $task->finishedDate : '';
|
||||
|
||||
$start = $realBegan ? $realBegan : $estStart;
|
||||
$end = $realEnd ? $realEnd : $estEnd;
|
||||
if(empty($start) and $execution) $start = $execution->begin;
|
||||
if(empty($end) and $execution) $end = $execution->end;
|
||||
if($start > $end) $end = $start;
|
||||
|
||||
$data = new stdclass();
|
||||
$data->id = $task->id;
|
||||
$data->type = 'task';
|
||||
$data->text = $taskSign . $priIcon . $task->name;
|
||||
$data->percent = '';
|
||||
$data->status = $this->processStatus('task', $task);
|
||||
$data->owner_id = $task->assignedTo;
|
||||
$data->attribute = '';
|
||||
$data->milestone = '';
|
||||
$data->begin = $start;
|
||||
$data->deadline = $end;
|
||||
$data->realBegan = $realBegan;
|
||||
$data->realEnd = $realEnd;
|
||||
$data->pri = $task->pri;
|
||||
$data->parent = ($task->parent > 0 and $task->assignedTo != '' and !empty($tasksMap[$task->parent]->assignedTo)) ? $task->parent : $groupID;
|
||||
$data->open = true;
|
||||
$progress = $task->consumed ? round($task->consumed / ($task->left + $task->consumed), 3) : 0;
|
||||
$data->progress = $progress;
|
||||
$data->taskProgress = ($progress * 100) . '%';
|
||||
$data->start_date = $start;
|
||||
$data->endDate = $end;
|
||||
$data->duration = 1;
|
||||
|
||||
if($data->endDate > $data->start_date) $data->duration = helper::diffDate($data->endDate, $data->start_date) + 1;
|
||||
|
||||
if($data->start_date) $data->start_date = date('d-m-Y', strtotime($data->start_date));
|
||||
if($data->start_date == '' or $data->endDate == '') $data->duration = 1;
|
||||
|
||||
if(strpos($selectCustom, 'task') !== false) $datas['data'][$data->id] = $data;
|
||||
|
||||
if(!empty($start)) $realStartDate[] = strtotime($start);
|
||||
if(!empty($end)) $realEndDate[] = strtotime($end);
|
||||
|
||||
if(isset($stageIndex[$groupKey]['totalConsumed']))
|
||||
{
|
||||
$stageIndex[$groupKey]['totalConsumed'] += $task->consumed;
|
||||
$stageIndex[$groupKey]['totalReal'] += $task->left + $task->consumed;
|
||||
}
|
||||
else
|
||||
{
|
||||
$stageIndex[$groupKey]['totalConsumed'] = $task->consumed;
|
||||
$stageIndex[$groupKey]['totalReal'] = $task->left + $task->consumed;
|
||||
}
|
||||
}
|
||||
|
||||
/* Calculate group realBegan and realEnd. */
|
||||
if(!empty($realStartDate)) $datas['data'][$groupKey]->realBegan = date('Y-m-d H:i:s', min($realStartDate));
|
||||
if(!empty($realEndDate) and (count($realEndDate) == $totalTask)) $datas['data'][$groupKey]->realEnd = date('Y-m-d H:i:s', max($realEndDate));
|
||||
}
|
||||
|
||||
/* Calculate the progress of the phase. */
|
||||
foreach($stageIndex as $index => $stage)
|
||||
{
|
||||
$progress = empty($stage['totalReal']) ? 0 : round($stage['totalConsumed'] / $stage['totalReal'], 3);
|
||||
$datas['data'][$index]->progress = $progress;
|
||||
|
||||
$progress = ($progress * 100) . '%';
|
||||
$datas['data'][$index]->taskProgress = $progress;
|
||||
}
|
||||
|
||||
$datas['links'] = array();
|
||||
if($this->config->edition != 'open')
|
||||
{
|
||||
$relations = $this->dao->select('*')->from(TABLE_RELATIONOFTASKS)->where('execution')->in($planIdList)->orderBy('task,pretask')->fetchAll();
|
||||
foreach($relations as $relation)
|
||||
{
|
||||
$link['source'] = $relation->execution . '-' . $relation->pretask;
|
||||
$link['target'] = $relation->execution . '-' . $relation->task;
|
||||
$link['type'] = $this->config->execution->gantt->linkType[$relation->condition][$relation->action];
|
||||
$datas['links'][] = $link;
|
||||
}
|
||||
}
|
||||
|
||||
$datas['data'] = isset($datas['data']) ? array_values($datas['data']) : array();
|
||||
|
||||
return $returnJson ? json_encode($datas) : $datas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get total percent.
|
||||
*
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
</p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<?php if($type == 'gantt') include './gantt.html.php';?>
|
||||
<?php if($type == 'gantt' or $type == 'assignedTo') include './gantt.html.php';?>
|
||||
<?php if($type == 'lists') include './list.html.php';?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
|
||||
@@ -60,16 +60,19 @@ form {display: block; margin-top: 0em; margin-block-end: 1em;}
|
||||
#mainContent.loading #ganttContainer {padding: 40px;}
|
||||
#mainContent.loading .scrollVer_cell,
|
||||
#mainContent.loading .scrollVer_cell {display: none;}
|
||||
#
|
||||
.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_grid_head_cell.gantt_grid_head_text{overflow:visible;}
|
||||
|
||||
</style>
|
||||
<?php js::set('customUrl', $this->createLink('programplan', 'ajaxCustom'));?>
|
||||
<?php js::set('dateDetails', $dateDetails);?>
|
||||
<?php js::set('module', $app->rawModule);?>
|
||||
<?php js::set('method', $app->rawMethod);?>
|
||||
<?php js::set('ganttType', $ganttType);?>
|
||||
<?php js::set('canGanttEdit', common::hasPriv('programplan', 'ganttEdit'));?>
|
||||
<div id='mainContent' class='main-content load-indicator' data-loading='<?php echo $lang->programplan->exporting;?>'>
|
||||
<form class="main-form form-ajax not-watch">
|
||||
<div class="example">
|
||||
@@ -93,6 +96,16 @@ form {display: block; margin-top: 0em; margin-block-end: 1em;}
|
||||
</div>
|
||||
<?php $fileName = "gantt-export-{$projectID}";?>
|
||||
<a id='ganttDownload' target='hiddenwin' download='<?php echo "{$fileName}.png";?>'></a>
|
||||
<?php
|
||||
$typeHtml = '<div class="btn-group">';
|
||||
$typeHtml .= '<button class="btn btn-link" data-toggle="dropdown"><span class="text">' . $lang->programplan->ganttBrowseType[$ganttType] . '</span> <span class="caret"></span></button>';
|
||||
$typeHtml .= '<ul class="dropdown-menu">';
|
||||
foreach($lang->programplan->ganttBrowseType as $browseType => $typeName)
|
||||
{
|
||||
$typeHtml .= '<li ' . ($ganttType == $browseType ? "class='active'" : '') . '>' . html::a($this->createLink('programplan', 'browse', "projectID=$projectID&productID=$productID&type=$browseType"), $typeName) . '</li>';
|
||||
}
|
||||
$typeHtml .= '</ul></div>';
|
||||
?>
|
||||
</div>
|
||||
<script>
|
||||
var scriptLoadedMap = {};
|
||||
@@ -381,6 +394,67 @@ function exitHandler()
|
||||
}
|
||||
}
|
||||
|
||||
/* Validate task drag. */
|
||||
function validateResources(id)
|
||||
{
|
||||
var task = gantt.getTask(id);
|
||||
var from = new Date(task.start_date),
|
||||
to = new Date(task.end_date);
|
||||
var status = task.status;
|
||||
var type = task.type;
|
||||
var statusLang = "<?php echo $lang->task->statusList['wait'];?>";
|
||||
flag = true;
|
||||
|
||||
/* Check status. */
|
||||
if(status !== statusLang)
|
||||
{
|
||||
if(type == 'task')
|
||||
{
|
||||
tipMsg = "<?php echo $lang->programplan->error->taskDrag;?>";
|
||||
}
|
||||
else
|
||||
{
|
||||
tipMsg = "<?php echo $lang->programplan->error->planDrag;?>";
|
||||
}
|
||||
new $.zui.Messager(tipMsg.replace('%s', status), {
|
||||
type: 'danger',
|
||||
icon: 'exclamation-sign'
|
||||
}).show();
|
||||
gantt.refreshData();
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Check data. */
|
||||
var postData = {
|
||||
'id' : type == 'task' ? task.id.split("-")[1] : task.id,
|
||||
'start_date': from.toLocaleDateString('en-CA'),
|
||||
'end_date' : to.toLocaleDateString('en-CA'),
|
||||
'type' : type
|
||||
};
|
||||
var link = createLink('programplan', 'ajaxSaveTaskDrag');
|
||||
/* Sync Close. */
|
||||
$.ajax({
|
||||
url: link,
|
||||
dataType: "json",
|
||||
async: false,
|
||||
data: postData,
|
||||
type: "post",
|
||||
success: function(response)
|
||||
{
|
||||
if(response.result == 'fail' && response.message)
|
||||
{
|
||||
new $.zui.Messager(response.message, {
|
||||
type: 'danger',
|
||||
icon: 'exclamation-sign'
|
||||
}).show();
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
$(function()
|
||||
{
|
||||
document.addEventListener('fullscreenchange', exitHandler);
|
||||
@@ -409,40 +483,46 @@ $(function()
|
||||
?>
|
||||
gantt.serverList("userList", <?php echo json_encode($userList);?>);
|
||||
|
||||
gantt.config.readonly = true;
|
||||
gantt.config.smart_rendering = true;
|
||||
gantt.config.smart_scales = true;
|
||||
gantt.config.static_background = true;
|
||||
gantt.config.show_task_cells = false;
|
||||
gantt.config.row_height = 25;
|
||||
gantt.config.min_column_width = 40;
|
||||
gantt.config.details_on_create = false;
|
||||
gantt.config.scales = [{unit: "year", step: 1, format: "%Y"}, {unit: 'day', step: 1, format: '%m-%d'}];
|
||||
gantt.config.scale_height = 22 * gantt.config.scales.length;
|
||||
gantt.config.duration_unit = "day";
|
||||
gantt.config.readonly = canGanttEdit ? false : true;
|
||||
gantt.config.details_on_dblclick = false;
|
||||
gantt.config.order_branch = ganttType == 'assignedTo' ? false : 'marker';
|
||||
gantt.config.drag_progress = false;
|
||||
gantt.config.drag_links = false;
|
||||
gantt.config.drag_move = ganttType == 'assignedTo' ? false : true;
|
||||
gantt.config.drag_resize = ganttType == 'assignedTo' ? false : true;
|
||||
gantt.config.smart_rendering = true;
|
||||
gantt.config.smart_scales = true;
|
||||
gantt.config.static_background = true;
|
||||
gantt.config.show_task_cells = false;
|
||||
gantt.config.row_height = 25;
|
||||
gantt.config.min_column_width = 40;
|
||||
gantt.config.details_on_create = false;
|
||||
gantt.config.scales = [{unit: "year", step: 1, format: "%Y"}, {unit: 'day', step: 1, format: '%m-%d'}];
|
||||
gantt.config.scale_height = 22 * gantt.config.scales.length;
|
||||
gantt.config.duration_unit = "day";
|
||||
|
||||
gantt.config.columns = [
|
||||
{name: 'text', width: '*', tree: true, resize: true, width:200},
|
||||
{name: 'status', align: 'center', resize: true, width: 80},
|
||||
{name: 'begin', 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)
|
||||
{name: 'text', width: '*', tree: true, resize: true, width:200},
|
||||
{name: 'status', align: 'center', resize: true, width: 80},
|
||||
{name: 'start_date', align: 'center', resize: true, width: 80},
|
||||
{name: 'end_date', 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}
|
||||
{name: 'realBegan', align: 'center', resize: true, width: 150},
|
||||
{name: 'realEnd', align: 'center', width: 150}
|
||||
];
|
||||
|
||||
gantt.locale.labels.column_text = "<?php echo $lang->programplan->name;?>";
|
||||
gantt.locale.labels.column_text = <?php echo json_encode($typeHtml);?>;
|
||||
gantt.locale.labels.column_status = "<?php echo $lang->statusAB;?>";
|
||||
gantt.locale.labels.column_percent = "<?php echo $lang->programplan->percentAB;?>";
|
||||
gantt.locale.labels.column_taskProgress = "<?php echo $lang->programplan->taskProgress;?>";
|
||||
gantt.locale.labels.column_begin = "<?php echo $lang->programplan->begin;?>";
|
||||
gantt.locale.labels.column_deadline = "<?php echo $lang->programplan->end;?>";
|
||||
gantt.locale.labels.column_start_date = "<?php echo $lang->programplan->begin;?>";
|
||||
gantt.locale.labels.column_end_date = "<?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;?>";
|
||||
@@ -488,7 +568,7 @@ $(function()
|
||||
{
|
||||
if(module == 'review' && method == 'assess')
|
||||
{
|
||||
gantt.config.layout = layout;
|
||||
gantt.config.layout = layout;
|
||||
gantt.init('ganttView');
|
||||
}
|
||||
gantt.expand();
|
||||
@@ -552,16 +632,45 @@ $(function()
|
||||
gantt.attachEvent('onTaskClick', function(id, e)
|
||||
{
|
||||
if($(e.srcElement).hasClass('gantt_close') || $(e.srcElement).hasClass('gantt_open')) return false;
|
||||
|
||||
/* The id of task item is like executionID-taskID. e.g. 1507-37829, 37829 is task id. */
|
||||
var position = id.indexOf('-');
|
||||
if(position < 0) return;
|
||||
|
||||
var taskID = parseInt(id.substring(position + 1));
|
||||
if(ganttType == 'assignedTo')
|
||||
{
|
||||
taskID = id;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* The id of task item is like executionID-taskID. e.g. 1507-37829, 37829 is task id. */
|
||||
var position = id.indexOf('-');
|
||||
if(position < 0) return;
|
||||
var taskID = parseInt(id.substring(position + 1));
|
||||
}
|
||||
|
||||
if(!isNaN(taskID) && taskID > 0) taskModalTrigger.show({url: createLink('task', 'view', 'taskID=' + taskID, 'html', true)});
|
||||
});
|
||||
|
||||
gantt.attachEvent("onBeforeRowDragEnd", function(id, parent, tindex)
|
||||
{
|
||||
var task = gantt.getTask(id);
|
||||
var link = createLink('programplan', 'ajaxSaveGanttMove');
|
||||
|
||||
//prevent moving to another position.
|
||||
if(task.parent != parent || id.indexOf('-') == -1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$.ajax({
|
||||
url: link,
|
||||
dataType: "json",
|
||||
data: {id: id, type: task.type, index: tindex},
|
||||
type: "post",
|
||||
success: function(result){}
|
||||
});
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
// Make folder can open or close by click
|
||||
$('#ganttView').on('click', '.gantt_close,.gantt_open', function()
|
||||
{
|
||||
@@ -596,5 +705,11 @@ $(function()
|
||||
{
|
||||
setTimeout(function(){$('.gantt_tooltip').remove()}, 100);
|
||||
});
|
||||
|
||||
/* Link attachEvent onAfterTaskDrag */
|
||||
gantt.attachEvent("onBeforeTaskChanged", function(id, mode, task)
|
||||
{
|
||||
return validateResources(id);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -352,3 +352,5 @@ $lang->task->report->finishedTasksPerDay->graph->xAxisName = 'Datum';
|
||||
|
||||
$lang->taskestimate = new stdclass();
|
||||
$lang->taskestimate->consumed = 'Schätzung';
|
||||
|
||||
$lang->task->overTime = 'The %s scheduled time has been exceeded, please modify the %s time first';
|
||||
@@ -352,3 +352,5 @@ $lang->task->report->finishedTasksPerDay->graph->xAxisName = 'Date';
|
||||
|
||||
$lang->taskestimate = new stdclass();
|
||||
$lang->taskestimate->consumed = 'Estimates';
|
||||
|
||||
$lang->task->overTime = 'The %s scheduled time has been exceeded, please modify the %s time first';
|
||||
@@ -352,3 +352,5 @@ $lang->task->report->finishedTasksPerDay->graph->xAxisName = 'Date';
|
||||
|
||||
$lang->taskestimate = new stdclass();
|
||||
$lang->taskestimate->consumed = 'Estimés';
|
||||
|
||||
$lang->task->overTime = 'The %s scheduled time has been exceeded, please modify the %s time first';
|
||||
@@ -352,3 +352,5 @@ $lang->task->report->finishedTasksPerDay->graph->xAxisName = '日期';
|
||||
|
||||
$lang->taskestimate = new stdclass();
|
||||
$lang->taskestimate->consumed = '工时';
|
||||
|
||||
$lang->task->overTime = '已超出%s计划时间,请先修改%s时间';
|
||||
@@ -3912,4 +3912,162 @@ class taskModel extends model
|
||||
|
||||
return $menu;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save Task Drag.
|
||||
*
|
||||
* @param int $objectID
|
||||
* @param string $objectType
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function saveTaskDrag($objectID, $objectType)
|
||||
{
|
||||
$post = fixer::input('post')->get();
|
||||
$post->end_date = date('Y-m-d', strtotime('-1 day', strtotime($post->end_date)));
|
||||
if($objectType == 'task')
|
||||
{
|
||||
$objectData = $this->dao->select('*')->from(TABLE_TASK)->where('id')->eq($objectID)->fetch();
|
||||
$parent = $objectData->parent;
|
||||
$project = $objectData->project;
|
||||
$execution = $objectData->execution;
|
||||
$stage = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($execution)->andWhere('project')->eq($project)->fetch();
|
||||
|
||||
if($parent <= 0)
|
||||
{
|
||||
$parentData = $stage;
|
||||
|
||||
$start = $parentData->begin;
|
||||
$end = $parentData->end;
|
||||
}
|
||||
else
|
||||
{
|
||||
$parentData = $this->dao->select('*')->from(TABLE_TASK)->where('id')->eq($parent)->fetch();
|
||||
|
||||
$start = helper::isZeroDate($parentData->estStarted) ? '' : $parentData->estStarted;
|
||||
$end = helper::isZeroDate($parentData->deadline) ? '' : $parentData->deadline;
|
||||
}
|
||||
|
||||
if(helper::diffDate($start, $post->start_date) > 0)
|
||||
{
|
||||
$arg = !empty($parent) ? $this->lang->task->parent : $this->lang->project->stage;
|
||||
return dao::$errors = sprintf($this->lang->task->overTime, $arg, $arg);
|
||||
}
|
||||
|
||||
$this->dao->update(TABLE_TASK)
|
||||
->set('estStarted')->eq($post->start_date)
|
||||
->set('deadline')->eq($post->end_date)
|
||||
->set('lastEditedBy')->eq($this->app->user->account)
|
||||
->where('id')->eq($objectID)
|
||||
->exec();
|
||||
}
|
||||
elseif($objectType == 'plan')
|
||||
{
|
||||
$objectData = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($objectID)->fetch();
|
||||
$parent = $objectData->parent;
|
||||
$project = $objectData->project;
|
||||
|
||||
if(empty($parent))
|
||||
{
|
||||
$parentData = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($project)->fetch();
|
||||
}
|
||||
else
|
||||
{
|
||||
$parentData = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($parent)->fetch();
|
||||
}
|
||||
|
||||
$start = helper::isZeroDate($parentData->begin) ? '' : $parentData->begin;
|
||||
$end = helper::isZeroDate($parentData->end) ? '' : $parentData->end;
|
||||
|
||||
if(helper::diffDate($start, $post->start_date) > 0)
|
||||
{
|
||||
$arg = !empty($parent) ? $this->lang->programplan->parent : $this->lang->project->common;
|
||||
return dao::$errors = sprintf($this->lang->task->overTime, $arg, $arg);
|
||||
}
|
||||
|
||||
$this->dao->update(TABLE_PROJECT)
|
||||
->set('begin')->eq($post->start_date)
|
||||
->set('end')->eq($post->end_date)
|
||||
->set('lastEditedBy')->eq($this->app->user->account)
|
||||
->where('id')->eq($objectID)
|
||||
->exec();
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save task order.
|
||||
*
|
||||
* @param int $productID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function saveTaskMove($productID = 0)
|
||||
{
|
||||
$data = fixer::input('post')->get();
|
||||
$IdList = explode('-', $data->id);
|
||||
$executionID = $IdList[0];
|
||||
$taskID = $IdList[1];
|
||||
$oldTask = $this->loadModel('task')->getByID($taskID);
|
||||
$index = (int)$data->index;
|
||||
|
||||
$hasZeroOrder = $this->dao->select('id')->from(TABLE_TASK)
|
||||
->where('deleted')->eq(0)
|
||||
->andWhere('execution')->eq($executionID)
|
||||
->andWhere('`order`')->eq(0)
|
||||
->beginIF($oldTask->parent <= 0)->andWhere('parent')->le(0)->fi()
|
||||
->beginIF($oldTask->parent > 0)->andWhere('parent')->eq($oldTask->parent)->fi()
|
||||
->limit(1)
|
||||
->fetch('id');
|
||||
|
||||
if($hasZeroOrder)
|
||||
{
|
||||
$tasks = $this->dao->select('id')->from(TABLE_TASK)
|
||||
->where('execution')->eq($executionID)
|
||||
->andWhere('deleted')->eq(0)
|
||||
->beginIF($oldTask->parent <= 0)->andWhere('parent')->le(0)->fi()
|
||||
->beginIF($oldTask->parent > 0)->andWhere('parent')->eq($oldTask->parent)->fi()
|
||||
->orderBy('order_asc, id_desc')
|
||||
->fetchPairs('id');
|
||||
|
||||
$order = 1;
|
||||
foreach($tasks as $task)
|
||||
{
|
||||
$this->dao->update(TABLE_TASK)->set('`order`')->eq($order)->where('id')->eq($task)->exec();
|
||||
$order ++;
|
||||
}
|
||||
|
||||
$oldTask = $this->loadModel('task')->getByID($taskID);
|
||||
}
|
||||
|
||||
$order = ++ $index;
|
||||
$oldOrder = (int)$oldTask->order;
|
||||
if($order > $oldOrder)
|
||||
{
|
||||
$this->dao->update(TABLE_TASK)->set('`order`=`order`-1')
|
||||
->where('execution')->eq($executionID)
|
||||
->andWhere('`order`')->le($order)
|
||||
->andWhere('`order`')->gt($oldOrder)
|
||||
->beginIF($oldTask->parent <= 0)->andWhere('parent')->le(0)->fi()
|
||||
->beginIF($oldTask->parent > 0)->andWhere('parent')->eq($oldTask->parent)->fi()
|
||||
->exec();
|
||||
}
|
||||
else if($order < $oldOrder)
|
||||
{
|
||||
$this->dao->update(TABLE_TASK)->set('`order`=`order`+1')
|
||||
->where('execution')->eq($executionID)
|
||||
->andWhere('`order`')->lt($oldOrder)
|
||||
->andWhere('`order`')->ge($order)
|
||||
->beginIF($oldTask->parent <= 0)->andWhere('parent')->le(0)->fi()
|
||||
->beginIF($oldTask->parent > 0)->andWhere('parent')->eq($oldTask->parent)->fi()
|
||||
->exec();
|
||||
}
|
||||
|
||||
$this->dao->update(TABLE_TASK)->set('`order`')->eq($order)->where('id')->eq($taskID)->exec();
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,12 +0,0 @@
|
||||
/*
|
||||
@license
|
||||
|
||||
dhtmlxGantt v.6.2.4 Professional
|
||||
|
||||
This software is covered by DHTMLX Commercial License. Usage without proper license is prohibited.
|
||||
|
||||
(c) XB Software Ltd.
|
||||
|
||||
*/
|
||||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(window,function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var l=t[o]={i:o,l:!1,exports:{}};return e[o].call(l.exports,l,l.exports,n),l.l=!0,l.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var l in e)n.d(o,l,function(t){return e[t]}.bind(null,l));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/codebase/",n(n.s=245)}({245:function(e,t){!function(){var e=gantt.getState;function t(){var e=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement;return e&&e===document.body}gantt.getState=function(){var n=e.apply(this,arguments);return n.fullscreen=t(),n};var n=!1,o={width:null,height:null,top:null,position:null,modified:!1};function l(e){e?(!function(){var e=gantt.$root;o.width=e.style.width,o.height=e.style.height,o.top=e.style.top,o.position=e.style.position,e.style.width="100vw",e.style.height="100vh",e.style.top="0",e.style.position="absolute",o.modified=!0}(),setTimeout(function(){gantt.render()})):(!function(){var e=gantt.$root;o.modified&&(e.style.width=o.width,e.style.height=o.height,e.style.top=o.top,e.style.position=o.position,o.modified=!1)}(),gantt.render())}function u(){if(gantt.$container){var e=t();l(e),e?(n=!0,setTimeout(function(){gantt.callEvent("onExpand")})):n&&(n=!1,setTimeout(function(){gantt.callEvent("onCollapse")}))}}function r(){return!gantt.$container||!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)&&((console.warning||console.log)("The `fullscreen` feature not being allowed, or full-screen mode not being supported"),!0)}gantt.attachEvent("onGanttReady",function(){gantt.event(document,"webkitfullscreenchange",u),gantt.event(document,"mozfullscreenchange",u),gantt.event(document,"MSFullscreenChange",u),gantt.event(document,"fullscreenChange",u),gantt.event(document,"fullscreenchange",u)}),gantt.expand=function(){if(!r()&&gantt.callEvent("onBeforeExpand",[])){var e=document.body;e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}},gantt.collapse=function(){r()||t()&&gantt.callEvent("onBeforeCollapse",[])&&(document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen())}}()}})});
|
||||
//# sourceMappingURL=dhtmlxgantt_fullscreen.js.map
|
||||
@@ -1,11 +0,0 @@
|
||||
/*
|
||||
@license
|
||||
|
||||
dhtmlxGantt v.6.1.1 Professional
|
||||
This software is covered by DHTMLX Commercial License. Usage without proper license is prohibited.
|
||||
|
||||
(c) Dinamenta, UAB.
|
||||
|
||||
*/
|
||||
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var a in r)("object"==typeof exports?exports:t)[a]=r[a]}}(window,function(){return function(t){var e={};function r(a){if(e[a])return e[a].exports;var n=e[a]={i:a,l:!1,exports:{}};return t[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,a){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(a,n,function(e){return t[e]}.bind(null,n));return a},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="/codebase/",r(r.s=216)}({216:function(t,e){!function(){function t(t){if(!gantt.config.show_markers)return!1;if(!t.start_date)return!1;var e=gantt.getState();if(!(+t.start_date>+e.max_date||+t.end_date&&+t.end_date<+e.min_date||+t.start_date<+e.min_date)){var r=document.createElement("div");r.setAttribute("data-marker-id",t.id);var a="gantt_marker";gantt.templates.marker_class&&(a+=" "+gantt.templates.marker_class(t)),t.css&&(a+=" "+t.css),t.title&&(r.title=t.title),r.className=a;var n=gantt.posFromDate(t.start_date);if(r.style.left=n+"px",r.style.height=Math.max(gantt.getRowTop(gantt.getVisibleTaskCount()),0)+"px",t.end_date){var i=gantt.posFromDate(t.end_date);r.style.width=Math.max(i-n,0)+"px"}return t.text&&(r.innerHTML="<div class='gantt_marker_content' >"+t.text+"</div>"),r}}function e(){if(gantt.$task_data){var t=document.createElement("div");t.className="gantt_marker_area",gantt.$task_data.appendChild(t),gantt.$marker_area=t}}gantt._markers||(gantt._markers=gantt.createDatastore({name:"marker",initItem:function(t){return t.id=t.id||gantt.uid(),t}})),gantt.config.show_markers=!0,gantt.attachEvent("onBeforeGanttRender",function(){gantt.$marker_area||e()}),gantt.attachEvent("onGanttReady",function(){e(),gantt.$services.getService("layers").createDataRender({name:"marker",defaultContainer:function(){return gantt.$marker_area}}).addLayer(t)}),gantt.getMarker=function(t){return this._markers?this._markers.getItem(t):null},gantt.addMarker=function(t){return this._markers.addItem(t)},gantt.deleteMarker=function(t){return!!this._markers.exists(t)&&(this._markers.removeItem(t),!0)},gantt.updateMarker=function(t){this._markers.refresh(t)},gantt._getMarkers=function(){return this._markers.getItems()},gantt.renderMarkers=function(){this._markers.refresh()}}()}})});
|
||||
//# sourceMappingURL=dhtmlxgantt_marker.js.map
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user