ItEr33S08ValidacionEProbasFuncionaisItEr32S09: [Bug #79] Moving tasks disability is enforced
This commit is contained in:
parent
2daff803bb
commit
dda0a6c6fc
4 changed files with 29 additions and 13 deletions
|
|
@ -224,17 +224,20 @@ public class TaskComponent extends Div implements AfterCompose {
|
|||
}
|
||||
|
||||
public Command getCommand(String cmdId) {
|
||||
Command result = null;
|
||||
if ("updatePosition".equals(cmdId)
|
||||
&& isMovingTasksEnabled()) {
|
||||
result = _updatecmd;
|
||||
} else if ("updateSize".equals(cmdId)) {
|
||||
result = _updatewidthcmd;
|
||||
} else if ("addDependency".equals(cmdId)) {
|
||||
result = _adddependencycmd;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Command c = null;
|
||||
|
||||
if ("updatePosition".equals(cmdId))
|
||||
c = _updatecmd;
|
||||
else if ("updateSize".equals(cmdId))
|
||||
c = _updatewidthcmd;
|
||||
else if ("addDependency".equals(cmdId))
|
||||
c = _adddependencycmd;
|
||||
|
||||
return c;
|
||||
public boolean isMovingTasksEnabled() {
|
||||
return disabilityConfiguration.isMovingTasksEnabled();
|
||||
}
|
||||
|
||||
// Command action to do
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
<div id="row${self.uuid}" class="row" z.valor="boxid="${self.uuid}">
|
||||
<div id="${self.uuid}" z.type="ganttz.task.Task" idTask="${self.id}"
|
||||
z.autoz="true"${self.outerAttrs}" class="box"
|
||||
movingTasksEnabled="${self.movingTasksEnabled}"
|
||||
onMouseover="zkTasklist.showTooltip('tasktooltip${self.uuid}');"
|
||||
onMouseOut="zkTasklist.hideTooltip('tasktooltip${self.uuid}');">
|
||||
<div class="completion"></div>
|
||||
|
|
|
|||
|
|
@ -304,11 +304,16 @@ zkTask.init = function(cmp) {
|
|||
}, zkTask, true);
|
||||
}
|
||||
|
||||
function movingTasksEnabled() {
|
||||
return cmp.getAttribute('movingTasksEnabled') === 'true';
|
||||
}
|
||||
|
||||
// Instead of executing the code directly, a callback is created
|
||||
// that will be executed when the user passes the mouse over the task
|
||||
var callback = function() {
|
||||
addDragSupport();
|
||||
addResizeSupport();
|
||||
if (movingTasksEnabled()) {
|
||||
addDragSupport();
|
||||
}
|
||||
// it removes itself, so it's not executed again:
|
||||
YAHOO.util.Event.removeListener(cmp, "mouseover", callback);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ public abstract class CompanyPlanningModel implements ICompanyPlanningModel {
|
|||
configuration.setChartComponent(chartComponent);
|
||||
addAdditionalCommands(additional, configuration);
|
||||
|
||||
configuration.setAddingDependenciesEnabled(false);
|
||||
disableSomeFeatures(configuration);
|
||||
|
||||
configuration.setChartLegend(getChartLegend());
|
||||
|
||||
|
|
@ -131,6 +131,13 @@ public abstract class CompanyPlanningModel implements ICompanyPlanningModel {
|
|||
setupChart(chartComponent, planner.getTimeTracker());
|
||||
}
|
||||
|
||||
private void disableSomeFeatures(
|
||||
PlannerConfiguration<TaskElement> configuration) {
|
||||
configuration.setAddingDependenciesEnabled(false);
|
||||
configuration.setMovingTasksEnabled(false);
|
||||
configuration.setResizingTasksEnabled(false);
|
||||
}
|
||||
|
||||
private void addAdditionalCommands(
|
||||
Collection<ICommandOnTask<TaskElement>> additional,
|
||||
PlannerConfiguration<TaskElement> configuration) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue