Index: lams_central/web/lams_authoring.swf =================================================================== diff -u -r4f9d3e56df9fa27f55730634a626ea0b0668f1d6 -r6b18fa07b091772b673f0030a9155b528a096e3b Binary files differ Index: lams_central/web/lams_authoring_library.swf =================================================================== diff -u -r4f9d3e56df9fa27f55730634a626ea0b0668f1d6 -r6b18fa07b091772b673f0030a9155b528a096e3b Binary files differ Index: lams_flash/src/central/flash/lams_authoring.fla =================================================================== diff -u -rd81882d79c6925fa850e2e261478fef54d1afb23 -r6b18fa07b091772b673f0030a9155b528a096e3b Binary files differ Index: lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/ToolOutputDefinition.as =================================================================== diff -u -r5cd45833dbbf97b54931280286b815a87b26b1c4 -r6b18fa07b091772b673f0030a9155b528a096e3b --- lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/ToolOutputDefinition.as (.../ToolOutputDefinition.as) (revision 5cd45833dbbf97b54931280286b815a87b26b1c4) +++ lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/ToolOutputDefinition.as (.../ToolOutputDefinition.as) (revision 6b18fa07b091772b673f0030a9155b528a096e3b) @@ -32,6 +32,7 @@ public static var LONG:String = "OUTPUT_LONG"; public static var BOOL:String = "OUTPUT_BOOLEAN"; + public static var USER_DEFINED:String = "OUTPUT_USER_DEFINED"; private var _name:String; private var _description:String; Index: lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/br/ToolOutputConditionsDialog.as =================================================================== diff -u -r5cd45833dbbf97b54931280286b815a87b26b1c4 -r6b18fa07b091772b673f0030a9155b528a096e3b --- lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/br/ToolOutputConditionsDialog.as (.../ToolOutputConditionsDialog.as) (revision 5cd45833dbbf97b54931280286b815a87b26b1c4) +++ lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/br/ToolOutputConditionsDialog.as (.../ToolOutputConditionsDialog.as) (revision 6b18fa07b091772b673f0030a9155b528a096e3b) @@ -83,7 +83,8 @@ private var cancel_btn:Button; private var remove_item_btn:Button; private var clear_all_btn:Button; - private var help_btn:Button; + private var help_btn:Button; + private var refresh_btn:Button; private var _condition_from_lbl:Label; private var _condition_to_lbl:Label; @@ -144,6 +145,7 @@ help_btn.addEventListener('click',Delegate.create(this, helpButton_onPress)); remove_item_btn.addEventListener('click', Delegate.create(this, removeItemButton_onPress)); clear_all_btn.addEventListener('click', Delegate.create(this, clearAllButton_onPress)); + refresh_btn.addEventListener('click', Delegate.create(this, refreshButton_onPress)); _toolOutputDefin_cmb.addEventListener('change', Delegate.create(this, itemChanged)); _toolOutputLongOptions_cmb.addEventListener('change', Delegate.create(this, optionChanged)); @@ -190,6 +192,7 @@ help_btn.label = HELP_BTN_LBL; clear_all_btn.label = Dictionary.getValue("to_conditions_dlg_clear_all_btn_lbl"); remove_item_btn.label = Dictionary.getValue("to_conditions_dlg_remove_item_btn_lbl"); + refresh_btn.label = "Refresh"; ///Dictionary.getValue("to_conditions_dlg_remove_item_btn_lbl"); //Set the text for buttons close_btn.label = Dictionary.getValue('al_done'); @@ -212,7 +215,8 @@ add_btn.setStyle('styleName', styleObj); help_btn.setStyle('styleName', styleObj); remove_item_btn.setStyle('styleName', styleObj); - clear_all_btn.setStyle('styleName', styleObj); + clear_all_btn.setStyle('styleName', styleObj); + refresh_btn.setStyle('styleName', styleObj); styleObj = themeManager.getStyleObject('CanvasPanel'); _bgpanel.setStyle('styleName', styleObj); @@ -242,6 +246,7 @@ add_btn.visible = b; remove_item_btn.visible = b; clear_all_btn.visible = b; + refresh_btn.visible = b; _condition_from_lbl.visible = b; _condition_to_lbl.visible = b; @@ -313,6 +318,7 @@ for(var i=0; i < items.length; i++) if(items[i].name == name) _toolOutputDefin_cmb.selectedIndex = i; + } private function addButton_onPress():Void { @@ -358,13 +364,25 @@ if(!app.getCanvas().ddm.hasBranchMappingsForCondition(_selectedItem.conditionUIID) || c) { removeCondition(_selectedItem.conditionUIID, _condition_item_dgd.selectedIndex); } else { - LFMessage.showMessageConfirm(Dictionary.getValue("branch_mapping_dlg_condition_linked_msg", [Dictionary.getValue("branch_mapping_dlg_condition_linked_single")]), Proxy.create(this, removeItemButton_onPress, evt, true), null, "continue", null, ""); + LFMessage.showMessageConfirm(Dictionary.getValue("branch_mapping_dlg_condition_linked_msg", [Dictionary.getValue("branch_mapping_dlg_condition_linked_single")]), Proxy.create(this, removeItemButton_onPress, evt, true), null, Dictionary.getValue("al_continue"), null, ""); } if(c) app.getCanvas().ddm.removeBranchMappingsByCondition(_selectedItem.conditionUIID); } + + private function refreshButton_onPress(evt:Object):Void { + if(_selectedDefinition != null) { + if(_selectedDefinition.defaultConditions.length > 0) { + LFMessage.showMessageConfirm(Dictionary.getValue("to_conditions_dlg_condition_items_update_defaultConditions"), Proxy.create(this, updateWithDefaultConditions), null, Dictionary.getValue("al_continue"), null, ""); + } else if(_selectedDefinition.type == ToolOutputDefinition.USER_DEFINED) { + // TODO: 2.1.x + // show alert message - 0 default conditions all mappings will be removed + //LFMessage.showMessageConfirm(Dictionary.getValue("branch_mapping_dlg_defaultConditions_zero"), Proxy.create(this, removeAllItems), null, "continue", null, ""); + } + } + } /** * Called by ADD button @@ -398,6 +416,13 @@ } + private function updateWithDefaultConditions():Void { + if(_selectedDefinition != null) { + removeAllItems(false); + addDefaultConditions(_selectedDefinition.defaultConditions); + } + } + private function removeCondition(conditionUIID:Number, index:Number):Void { app.getCanvas().ddm.removeOutputCondition(conditionUIID); _condition_item_dgd.removeItemAt(index); @@ -552,15 +577,25 @@ switch(_selectedDefinition.type) { case ToolOutputDefinition.LONG: _condition_item_dgd.visible = true; - + if(_selectedDefinition.defaultConditions.length > 0) { add_btn.visible = false; + remove_item_btn.visible = false; + clear_all_btn.visible = false; + + refresh_btn.visible = true; + _toolOutputLongOptions_cmb.visible = false; showSteppers(false, false); addDefaultConditions(_selectedDefinition.defaultConditions); } else { add_btn.visible = true; + remove_item_btn.visible = true; + clear_all_btn.visible = true; + + refresh_btn.visible = false; + _toolOutputLongOptions_cmb.visible = true; optionChanged(); @@ -574,21 +609,26 @@ _end_value_stp.value = (_selectedDefinition.endValue != null) ? Number(_selectedDefinition.endValue) : STP_MIN; } - clear_all_btn.visible = true; - remove_item_btn.visible = true; - break; case ToolOutputDefinition.BOOL: _condition_item_dgd.visible = true; _toolOutputLongOptions_cmb.visible = false; add_btn.visible = false; + remove_item_btn.visible = false; + clear_all_btn.visible = false; + + refresh_btn.visible = false; + showSteppers(false, false); addDefaultConditions(_selectedDefinition.defaultConditions); break; + case ToolOutputDefinition.USER_DEFINED: + // TODO: 2.1.x + break; default: showElements(false); _toolOutputLongOptions_cmb.selectedIndex = 0; @@ -722,6 +762,7 @@ add_btn._x = _toolOutputLongOptions_cmb._x + _toolOutputLongOptions_cmb._width - add_btn.width; remove_item_btn.move(_condition_item_dgd._x + _condition_item_dgd._width - remove_item_btn.width, _condition_item_dgd._y + _condition_item_dgd._height + 5); clear_all_btn.move(remove_item_btn._x - clear_all_btn.width - 5, remove_item_btn._y); + refresh_btn.move(_condition_item_dgd._x + _condition_item_dgd._width - refresh_btn.width, _condition_item_dgd._y + _condition_item_dgd._height + 5); help_btn._x = w - _toolOutputDefin_cmb._x - help_btn.width;