Index: lams_admin/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -r5f626596bbeb5bbbbd800be3ddf6ff7f1bdaeaa6 -r385b5d293d69ff33476eb85ef52350179d5a4488 --- lams_admin/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 5f626596bbeb5bbbbd800be3ddf6ff7f1bdaeaa6) +++ lams_admin/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 385b5d293d69ff33476eb85ef52350179d5a4488) @@ -524,4 +524,6 @@ label.delete.all.lesson.count =Number of remaining / total lessons: label.delete.all.lesson.progress =Deleting... sysadmin.lesson.delete.title =Delete all lessons from course +msg.delete.organisation.confirm =You are about to permanently remove a course. Are you sure want to do this? +msg.delete.organisation.delete.lessons.confirm =The course or one of its subcourses still contains lessons. They need to be permanently deleted first. You will be redirected to a page where you can do it. #======= End labels: Exported 511 labels for en AU ===== Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/action/OrganisationAction.java =================================================================== diff -u -r5f626596bbeb5bbbbd800be3ddf6ff7f1bdaeaa6 -r385b5d293d69ff33476eb85ef52350179d5a4488 --- lams_admin/src/java/org/lamsfoundation/lams/admin/web/action/OrganisationAction.java (.../OrganisationAction.java) (revision 5f626596bbeb5bbbbd800be3ddf6ff7f1bdaeaa6) +++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/action/OrganisationAction.java (.../OrganisationAction.java) (revision 385b5d293d69ff33476eb85ef52350179d5a4488) @@ -55,12 +55,6 @@ /** * @author Fei Yang - * - * - * - * - * - * */ public class OrganisationAction extends LamsDispatchAction { @@ -69,6 +63,7 @@ private static List locales; private static List status; + @SuppressWarnings("unchecked") public ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { OrganisationAction.service = AdminServiceProxy.getService(getServlet().getServletContext()); @@ -94,6 +89,18 @@ orgForm.set("stateId", org.getOrganisationState().getOrganisationStateId()); SupportedLocale locale = org.getLocale(); orgForm.set("localeId", locale != null ? locale.getLocaleId() : null); + + // find a course or subcourse with any lessons, so we warn user when he tries to delete the course + Integer courseToDeleteLessons = org.getLessons().size() > 0 ? orgId : null; + if (courseToDeleteLessons == null) { + for (Organisation subcourse : (Set) org.getChildOrganisations()) { + if (subcourse.getLessons().size() > 0) { + courseToDeleteLessons = subcourse.getOrganisationId(); + break; + } + } + } + request.setAttribute("courseToDeleteLessons", courseToDeleteLessons); } request.getSession().setAttribute("locales", OrganisationAction.locales); request.getSession().setAttribute("status", OrganisationAction.status); Index: lams_admin/web/organisation/createOrEdit.jsp =================================================================== diff -u -ree2713a23c1a795eec5f782795da09918cbdf006 -r385b5d293d69ff33476eb85ef52350179d5a4488 --- lams_admin/web/organisation/createOrEdit.jsp (.../createOrEdit.jsp) (revision ee2713a23c1a795eec5f782795da09918cbdf006) +++ lams_admin/web/organisation/createOrEdit.jsp (.../createOrEdit.jsp) (revision 385b5d293d69ff33476eb85ef52350179d5a4488) @@ -1,6 +1,29 @@ <%@ include file="/taglibs.jsp"%> - + + + @@ -31,6 +54,12 @@
+ + +
*