- stageBy == 'product'):?>
+ division)):?>
product->allProduct;?>
-
@@ -249,7 +257,7 @@ function drawGanttToCanvas(exportType, successCallback, errorCallback)
var $ganttDridData = $ganttView.find('.gantt_grid_data');
var ganttRowHeight = $ganttView.find('.gantt_row').first().outerHeight() || 25;
- var ganttHeight = $ganttView.find('.gantt_grid_scale').outerHeight() + * ganttRowHeight;
+ var ganttHeight = $ganttView.find('.gantt_grid_scale').outerHeight() + * ganttRowHeight;
var ganttWidth = $ganttDridData.width() - 100;
@@ -490,7 +498,7 @@ function validateResources(id)
flag = true;
/* Check status. */
- if(status !== statusLang)
+ if(status !== statusLang && type != 'point')
{
if(type == 'task')
{
@@ -508,9 +516,27 @@ function validateResources(id)
return false;
}
+ task.begin = from;
+ task.deadline = (new Date(to.valueOf() - 1));;
+
+ gantt.updateTask(task.id);
+ var itemID;
+ if(type == 'task')
+ {
+ itemID = task.id.split("-")[1];
+ }
+ else if(type == 'plan')
+ {
+ itemID = task.id;
+ }
+ else if(type == 'point')
+ {
+ itemID = task.id.split("-")[2];
+ }
+
/* Check data. */
var postData = {
- 'id' : type == 'task' ? task.id.split("-")[1] : task.id,
+ 'id' : itemID,
'startDate' : from.toLocaleDateString('en-CA'),
'endDate' : to.toLocaleDateString('en-CA'),
'type' : type
@@ -551,7 +577,7 @@ $(function()
$('#ganttView').css('height', Math.max(200, Math.floor($(window).height() - $('#footer').outerHeight() - $('#header').outerHeight() - $('#mainMenu').outerHeight() - 120)));
};
- var ganttData = $.parseJSON();
+ var ganttData = $.parseJSON();
if(!ganttData.data) ganttData.data = [];
gantt.serverList("userList", );
- gantt.config.readonly = canGanttEdit;
+ gantt.config.readonly = canGanttEdit ? false : true;
gantt.config.details_on_dblclick = false;
- gantt.config.order_branch = ganttType == 'assignedTo';
+ gantt.config.order_branch = ganttType == 'assignedTo' ? false : true;
gantt.config.drag_progress = false;
gantt.config.drag_links = false;
- gantt.config.drag_move = ganttType == 'assignedTo';
- gantt.config.drag_resize = ganttType == 'assignedTo';
+ 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;
@@ -590,10 +616,10 @@ $(function()
gantt.config.columns = [];
gantt.config.columns.push({name: 'text', width: '*', tree: true, resize: true, min_width:120, width:200});
gantt.config.columns.push({name:"custom", label:"", align: "left", width: 40, template: getSubmitBtn});
- if(showFields.indexOf('PM') != -1) gantt.config.columns.push({name: 'owner_id', align: 'center', resize: true, width: 80, template: function(task){return getByIdForGantt(gantt.serverList('userList'), task.owner_id)}})
+ if(showFields.indexOf('PM') != -1) gantt.config.columns.push({name: 'owner_id', align: 'left', resize: true, width: 80, template: function(task){return getByIdForGantt(gantt.serverList('userList'), task.owner_id)}})
if(showFields.indexOf('status') != -1) gantt.config.columns.push({name: 'status', align: 'center', resize: true, width: 80});
- gantt.config.columns.push({name: 'start_date', align: 'center', resize: true, width: 80});
- if(showFields.indexOf('deadline') != -1) gantt.config.columns.push({name: 'end_date', align: 'center', resize: true, width: 80});
+ gantt.config.columns.push({name: 'begin', align: 'center', resize: true, width: 80});
+ if(showFields.indexOf('deadline') != -1) gantt.config.columns.push({name: 'deadline', align: 'center', resize: true, width: 140, template: getDeadlineBtn});
gantt.config.columns.push({name: 'duration', align: 'center', resize: true, width: 60});
if(showFields.indexOf('estimate') != -1) gantt.config.columns.push({name: 'estimate', align: 'center', resize: true, width: 60});
if(showFields.indexOf('progress') != -1) gantt.config.columns.push({name: 'percent', align: 'center', resize: true, width:70, template: function(plan){ if(plan.percent) return Math.round(plan.percent) + '%';}});
@@ -604,6 +630,13 @@ $(function()
if(showFields.indexOf('delay') != -1) gantt.config.columns.push({name: 'delay', align: 'center', resize: true, width: 60});
if(showFields.indexOf('delayDays') != -1) gantt.config.columns.push({name: 'delayDays', align: 'center', resize: false, width: 60});
+ function getDeadlineBtn(task)
+ {
+ var date = task.deadline;
+ if(task.type == 'point' && canEditDeadline && (!task.rawStatus || task.rawStatus == 'fail' || task.rawStatus == 'draft')) return "
| " + gridDateToStr(new Date(date.valueOf())) + ' programplan->edit;?> |