Index: lams_monitoring/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -r7142f05a947475f4535082cdc3456383497e1790 -r21012de4a17935353bd0a69d6c5752bc01a6dabb --- lams_monitoring/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 7142f05a947475f4535082cdc3456383497e1790) +++ lams_monitoring/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 21012de4a17935353bd0a69d6c5752bc01a6dabb) @@ -472,12 +472,13 @@ button.task.gate.open.now.tooltip = Opens gate immediately button.task.gate.open = Open selectively... button.task.gate.open.tooltip = Choose which learners can go through the gate -label.task.gate.opened = Opened +button.task.gate.opened = Opened +button.task.gate.opened.tooltip = See gate status # Button for closing an opened permission gate. button.task.gate.close = Close # Tooltip of a button for closing an opened permission gate button.task.gate.close.tooltip = Immediately closes the gate again label.password.gate.title = Password gate label.gate.password = Change the gate password button.gate.password = Change -lesson.task.gate.password = Password gate +lesson.task.gate.password = Password gate \ No newline at end of file Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/quartz/job/OpenScheduleGateJob.java =================================================================== diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -r21012de4a17935353bd0a69d6c5752bc01a6dabb --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/quartz/job/OpenScheduleGateJob.java (.../OpenScheduleGateJob.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/quartz/job/OpenScheduleGateJob.java (.../OpenScheduleGateJob.java) (revision 21012de4a17935353bd0a69d6c5752bc01a6dabb) @@ -26,6 +26,7 @@ import java.util.Map; import org.apache.log4j.Logger; +import org.lamsfoundation.lams.learningdesign.GateActivity; import org.lamsfoundation.lams.monitoring.service.IMonitoringFullService; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; @@ -44,29 +45,26 @@ //--------------------------------------------------------------------- private static Logger log = Logger.getLogger(OpenScheduleGateJob.class); - /** - * @throws JobExecutionException - * @see org.springframework.scheduling.quartz.QuartzJobBean#executeInternal(org.quartz.JobExecutionContext) - */ @Override protected void executeInternal(JobExecutionContext context) throws JobExecutionException { IMonitoringFullService monitoringService = getMonitoringService(context); //getting gate id set from scheduler Map properties = context.getJobDetail().getJobDataMap(); Long gateId = (Long) properties.get("gateId"); - Integer openerId = (Integer) properties.get("userId"); - if (log.isDebugEnabled()) { - log.debug("Openning gate......[" + gateId.longValue() + "]"); - } + GateActivity gateActivity = (GateActivity) monitoringService.getActivityById(gateId); + if (!gateActivity.getGateOpen()) { + if (log.isDebugEnabled()) { + log.debug("Openning gate......[" + gateId.longValue() + "]"); + } - monitoringService.openGate(gateId, openerId); + Integer openerId = (Integer) properties.get("userId"); + monitoringService.openGate(gateId, openerId); - if (log.isDebugEnabled()) { - log.debug("Gate......[" + gateId.longValue() + "] opened"); + if (log.isDebugEnabled()) { + log.debug("Gate......[" + gateId.longValue() + "] opened"); + } } - } - } Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java =================================================================== diff -u -rf18741b5a62481b01d469935b3c32ad4cb62fe54 -r21012de4a17935353bd0a69d6c5752bc01a6dabb --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java (.../MonitoringService.java) (revision f18741b5a62481b01d469935b3c32ad4cb62fe54) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java (.../MonitoringService.java) (revision 21012de4a17935353bd0a69d6c5752bc01a6dabb) @@ -1256,25 +1256,12 @@ public GateActivity openGate(Long gateId, Integer openerId) { GateActivity gate = (GateActivity) activityDAO.getActivityByActivityId(gateId); if (gate != null) { - gate.setGateOpen(new Boolean(true)); + gate.setGateOpen(true); gate.setGateOpenTime(new Date()); if (openerId != null) { gate.setGateOpenUser(baseDAO.find(User.class, openerId)); } - // we un-schedule the gate from the scheduler if it's of a scheduled - // gate (LDEV-1271) - if (gate.isScheduleGate()) { - try { - scheduler.unscheduleJob(TriggerKey.triggerKey("openGateTrigger:" + gate.getActivityId())); - } catch (SchedulerException e) { - MonitoringService.log - .error("Error unscheduling trigger for gate activity id:" + gate.getActivityId(), e); - throw new MonitoringServiceException( - "Error unscheduling trigger for gate activity id:" + gate.getActivityId(), e); - } - } - activityDAO.update(gate); } return gate; Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GateController.java =================================================================== diff -u -rf18741b5a62481b01d469935b3c32ad4cb62fe54 -r21012de4a17935353bd0a69d6c5752bc01a6dabb --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GateController.java (.../GateController.java) (revision f18741b5a62481b01d469935b3c32ad4cb62fe54) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GateController.java (.../GateController.java) (revision 21012de4a17935353bd0a69d6c5752bc01a6dabb) @@ -61,8 +61,6 @@ import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; /** *

@@ -137,17 +135,16 @@ public String openGate(@ModelAttribute GateForm gateForm, HttpServletRequest request, HttpServletResponse response) { GateActivity gate = monitoringService.openGate(gateForm.getActivityId(), getUserId()); - return findViewByGateType(gateForm, gate); } /** * Close the gate again. */ @RequestMapping(path = "/closeGate", method = RequestMethod.POST) - @ResponseBody - public void closeGate(@RequestParam long activityId) { - monitoringService.closeGate(activityId); + public String closeGate(@ModelAttribute GateForm gateForm) { + GateActivity gate = monitoringService.closeGate(gateForm.getActivityId()); + return findViewByGateType(gateForm, gate); } /** Index: lams_monitoring/web/gate/gateStatus.jsp =================================================================== diff -u -r05c00f92856ef13cd90d6fce06acb069418c2512 -r21012de4a17935353bd0a69d6c5752bc01a6dabb --- lams_monitoring/web/gate/gateStatus.jsp (.../gateStatus.jsp) (revision 05c00f92856ef13cd90d6fce06acb069418c2512) +++ lams_monitoring/web/gate/gateStatus.jsp (.../gateStatus.jsp) (revision 21012de4a17935353bd0a69d6c5752bc01a6dabb) @@ -38,4 +38,15 @@ + + + + + +

+ " + value="" /> +

+ Index: lams_monitoring/web/gate/permissionGateContent.jsp =================================================================== diff -u -r54007f98ca71e0073f19c5db78536437123287c6 -r21012de4a17935353bd0a69d6c5752bc01a6dabb --- lams_monitoring/web/gate/permissionGateContent.jsp (.../permissionGateContent.jsp) (revision 54007f98ca71e0073f19c5db78536437123287c6) +++ lams_monitoring/web/gate/permissionGateContent.jsp (.../permissionGateContent.jsp) (revision 21012de4a17935353bd0a69d6c5752bc01a6dabb) @@ -55,7 +55,6 @@ <%@ include file="openGateSingleUser.jsp" %> -