Index: lams_central/conf/language/lams/ApplicationResources.properties
===================================================================
RCS file: /usr/local/cvsroot/lams_central/conf/language/lams/ApplicationResources.properties,v
diff -u -r1.143 -r1.144
--- lams_central/conf/language/lams/ApplicationResources.properties 22 Oct 2014 10:23:28 -0000 1.143
+++ lams_central/conf/language/lams/ApplicationResources.properties 22 Oct 2014 10:53:36 -0000 1.144
@@ -459,6 +459,7 @@
authoring.fla.branching.create.confirm =Transition from this activity already exists.\\nDo you want to create branching here?
authoring.fla.transition.to.exists.error =Transition to this activity already exists.
authoring.fla.circular.sequence.error =You are not allowed to have a circular sequence.
+authoring.fla.activity.in.container.error =You can not add this type of activity to an optional/support activity.
authoring.fla.default.annotation.label.title =Label
authoring.fla.region.fit.button.tooltip =Fit
authoring.fla.new.folder.button =New
Index: lams_central/conf/language/lams/ApplicationResources_en_AU.properties
===================================================================
RCS file: /usr/local/cvsroot/lams_central/conf/language/lams/ApplicationResources_en_AU.properties,v
diff -u -r1.115 -r1.116
--- lams_central/conf/language/lams/ApplicationResources_en_AU.properties 22 Oct 2014 10:23:28 -0000 1.115
+++ lams_central/conf/language/lams/ApplicationResources_en_AU.properties 22 Oct 2014 10:53:36 -0000 1.116
@@ -459,6 +459,7 @@
authoring.fla.branching.create.confirm =Transition from this activity already exists.\\nDo you want to create branching here?
authoring.fla.transition.to.exists.error =Transition to this activity already exists.
authoring.fla.circular.sequence.error =You are not allowed to have a circular sequence.
+authoring.fla.activity.in.container.error =You can not add this type of activity to an optional/support activity.
authoring.fla.default.annotation.label.title =Label
authoring.fla.region.fit.button.tooltip =Fit
authoring.fla.new.folder.button =New
Index: lams_central/web/authoring/authoring.jsp
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/authoring/authoring.jsp,v
diff -u -r1.9 -r1.10
--- lams_central/web/authoring/authoring.jsp 22 Oct 2014 10:23:28 -0000 1.9
+++ lams_central/web/authoring/authoring.jsp 22 Oct 2014 10:53:36 -0000 1.10
@@ -53,6 +53,7 @@
BRANCHING_CREATE_CONFIRM : '',
TRANSITION_TO_EXISTS_ERROR : '',
CIRCULAR_SEQUENCE_ERROR : '',
+ ACTIVITY_IN_CONTAINER_ERROR : '',
// DecorationLib
DEFAULT_ANNOTATION_LABEL_TITLE : '',
Index: lams_central/web/includes/javascript/authoring/authoringActivity.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/includes/javascript/authoring/authoringActivity.js,v
diff -u -r1.40 -r1.41
--- lams_central/web/includes/javascript/authoring/authoringActivity.js 22 Oct 2014 10:23:28 -0000 1.40
+++ lams_central/web/includes/javascript/authoring/authoringActivity.js 22 Oct 2014 10:53:36 -0000 1.41
@@ -987,6 +987,14 @@
});
}
if (container) {
+ // system activities can not be added to optional and support activities
+ if (activity instanceof ActivityDefs.GateActivity
+ || activity instanceof ActivityDefs.GroupingActivity
+ || activity instanceof ActivityDefs.BranchingEdgeActivity){
+ alert(LABELS.ACTIVITY_IN_CONTAINER_ERROR);
+ return false;
+ }
+
if ($.inArray(activity, container.childActivities) == -1) {
$.each(activity.transitions.from, function(){
ActivityLib.removeTransition(this);
@@ -1013,6 +1021,7 @@
});
GeneralLib.setModified(true);
+ return true;
},
Index: lams_central/web/includes/javascript/authoring/authoringHandler.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/includes/javascript/authoring/authoringHandler.js,v
diff -u -r1.16 -r1.17
--- lams_central/web/includes/javascript/authoring/authoringHandler.js 1 Jul 2014 14:12:20 -0000 1.16
+++ lams_central/web/includes/javascript/authoring/authoringHandler.js 22 Oct 2014 10:53:36 -0000 1.17
@@ -127,18 +127,22 @@
// finally transform the dragged elements
var transformation = object.items.shape.attr('transform');
object.items.transform('');
- if (transformation.length > 0) {
- // find new X and Y and redraw the object
- var box = object.items.shape.getBBox(),
- x = box.x,
+
+ var box = object.items.shape.getBBox(),
+ originalCoordinates = {
+ x : box.x,
// adjust this coordinate for annotation labels
- y = box.y + (object instanceof DecorationDefs.Label ? 6 : 0);
- object.draw(x + transformation[0][1],
- y + transformation[0][2]);
+ y : box.y + (object instanceof DecorationDefs.Label ? 6 : 0)
+ };
+
+ if (transformation.length > 0) {
+ object.draw(originalCoordinates.x + transformation[0][1],
+ originalCoordinates.y + transformation[0][2]);
}
// add space if dropped object is next to border
GeneralLib.resizePaper();
+ return originalCoordinates;
},
@@ -244,12 +248,18 @@
ActivityLib.removeActivity(activity);
} else {
// finalise movement - rewrite coordinates, see if the activity was not added to a container
- HandlerLib.dropObject(activity);
+
- var translatedEvent = GeneralLib.translateEventOnCanvas(event),
+ var originalCoordinates = HandlerLib.dropObject(activity),
+ translatedEvent = GeneralLib.translateEventOnCanvas(event),
endX = translatedEvent[0],
- endY = translatedEvent[1];
- ActivityLib.dropActivity(activity, endX, endY);
+ endY = translatedEvent[1],
+ dropAllowed = ActivityLib.dropActivity(activity, endX, endY);
+
+ if (!dropAllowed) {
+ // dropping the activity in this place is forbidden, revert the changes
+ activity.draw(originalCoordinates.x, originalCoordinates.y);
+ }
}
}
// start dragging the activity