Index: lams_central/web/includes/javascript/pedagogicalPlanner.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/includes/javascript/pedagogicalPlanner.js,v diff -u -r1.15 -r1.16 --- lams_central/web/includes/javascript/pedagogicalPlanner.js 12 Mar 2010 17:31:51 -0000 1.15 +++ lams_central/web/includes/javascript/pedagogicalPlanner.js 6 Aug 2010 12:49:37 -0000 1.16 @@ -138,12 +138,15 @@ $('#pedagogicalPlannerBusy').hide(); if (sequenceDetailsValid && activitiesValid==activitiesResponded){ $('#pedagogicalPlannerInfoArea').show(); + if (actionAfterCompleted==ACTION_SAVE_AS_SEQUENCE){ $.ajax({ url: saveDetailsUrl, cache: false, data: "method=copyLearningDesign&ldId="+learningDesignId - }); + }); + + if (requestSrc != "") $("#saveSequenceDialog").dialog('open'); } else if (actionAfterCompleted==ACTION_PREVIEW){ startPreview(startPreviewUrl); @@ -154,8 +157,12 @@ url: saveDetailsUrl, cache: false, data: "method=copyLearningDesign&ldId="+learningDesignId - }); - document.location.href="home.do?method=author&learningDesignID="+learningDesignId; + }); + + var openAuthorURL = "home.do?method=author&learningDesignID=" + learningDesignId; + if (requestSrc != "") openAuthorURL += "&requestSrc=" + requestSrc; + if (notifyCloseURL != "") openAuthorURL += "¬ifyCloseURL=" + notifyCloseURL; + document.location.href = openAuthorURL; } else if (actionAfterCompleted==ACTION_EXPORT){ document.getElementById("downloadFileDummyIframe").src="pedagogicalPlanner.do?method=exportTemplate&ldId="+learningDesignId; @@ -176,6 +183,12 @@ function closePlanner(text){ if (text==null || confirm(text)){ + + // refresh the parent window + if (notifyCloseURL != "") { + window.parent.opener.location.href = notifyCloseURL; + } + window.close(); } }