Index: lams_central/src/flash/org/lamsfoundation/lams/monitoring/mv/tabviews/LessonTabView.as =================================================================== diff -u -rf1865be54adc3406a8602c5c53f7e3eb06a1e15f -ra7df099b7426a23e539d795e57e0750b20c3ab30 --- lams_central/src/flash/org/lamsfoundation/lams/monitoring/mv/tabviews/LessonTabView.as (.../LessonTabView.as) (revision f1865be54adc3406a8602c5c53f7e3eb06a1e15f) +++ lams_central/src/flash/org/lamsfoundation/lams/monitoring/mv/tabviews/LessonTabView.as (.../LessonTabView.as) (revision a7df099b7426a23e539d795e57e0750b20c3ab30) @@ -53,6 +53,7 @@ public static var ARCHIVE_CBI:Number = 3; public static var UNARCHIVE_CBI:Number = 4; + public static var NOT_STARTED_STATUS:Number = 2; public static var STARTED_STATUS:Number = 3; public static var SUSPENDED_STATUS:Number = 4; public static var ARCHIVED_STATUS:Number = 6; @@ -82,6 +83,8 @@ private var manageStatus_lbl:Label; private var manageStart_lbl:Label; private var manageDate_lbl:Label; + private var start_date_lbl:Label; + private var schedule_date_lbl:Label; private var btnLabel:String; //Text Items @@ -163,7 +166,7 @@ if (infoObj.tabID == _tabID){ trace("TabID for Selected tab is (LessonTab TABCHANGE): "+infoObj.tabID) this._visible = true; - hideMainExp(mm); + hideMainExp(mm); //mm.setDirty(); //MovieClipUtils.doLater(Proxy.create(this,draw)); if(mm.getIsProgressChanged()){ @@ -177,7 +180,7 @@ case 'SEQUENCE' : if (infoObj.tabID == _tabID){ trace("TabID for Selected tab is (LessonTab): "+infoObj.tabID) - this._visible = true; + this._visible = true; hideMainExp(mm); MovieClipUtils.doLater(Proxy.create(this,draw)); @@ -231,12 +234,13 @@ this.addEventListener("apply", Delegate.create(_monitorController, _monitorController.changeStatus)); } - - private function hideMainExp(mm:MonitorModel):Void{ - //var mcontroller = getController(); - mm.broadcastViewUpdate("EXPORTSHOWHIDE", false) - } - + + private function hideMainExp(mm:MonitorModel):Void{ + //var mcontroller = getController(); + mm.broadcastViewUpdate("EXPORTSHOWHIDE", false) + } + + /** * Reloads the learner Progress and * @Param isChanged Boolean Value to pass it to setIsProgressChanged in monitor model so that it sets it to true if refresh button is clicked and sets it to fasle as soon as latest data is loaded and design is redrawn. @@ -347,28 +351,44 @@ } } + private function enableEditClass(stateID:Number):Void{ switch(stateID){ case Sequence.ACTIVE_STATE_ID : - showStartFields(true); + showStartFields(true, true); editClass_btn.enabled = true; break; case Sequence.NOTSTARTED_STATE_ID : - showStartFields(true); + showStartFields(true, false); editClass_btn.enabled = true; break; default : - showStartFields(false); + showStartFields(false, false); editClass_btn.enabled = false; } } - private function showStartFields(b:Boolean){ + private function showStartFields(a:Boolean, b:Boolean){ + var s:Object = mm.getSequence(); + + // is started? + if(a){ + start_date_lbl.text = s.getStartDateTime(); + } + + start_btn.visible = a; + start_date_lbl.visible = a; + + // is scheduled to start? + if(b){ + schedule_date_lbl.text = s.getScheduleDateTime(); + } + + schedule_date_lbl.visible = b; scheduleTime._visible = b; scheduleDate_dt.visible = b; - start_btn.visible = b; schedule_btn.visible = b; manageDate_lbl.visible = b; @@ -385,6 +405,7 @@ private function showStatus(seqStatus:Number):String{ var seqStat:String; + var s:Object = mm.getSequence(); switch(seqStatus){ case LessonTabView.ARCHIVED_STATUS : @@ -396,6 +417,12 @@ case LessonTabView.SUSPENDED_STATUS : seqStat = Dictionary.getValue('ls_status_disabled_lbl'); break; + case LessonTabView.NOT_STARTED_STATUS: + if(s.isScheduled){ seqStat = Dictionary.getValue('ls_status_scheduled_lbl', [s.getScheduleDateTime()]); } + else { + seqStat = Dictionary.getValue('ls_status_active_lbl'); + } + break; default: seqStat = Dictionary.getValue('ls_status_active_lbl'); } Index: lams_common/src/flash/org/lamsfoundation/lams/common/Sequence.as =================================================================== diff -u -r2f22f4a3155431e112a37cb1f710215abb2cdb81 -ra7df099b7426a23e539d795e57e0750b20c3ab30 --- lams_common/src/flash/org/lamsfoundation/lams/common/Sequence.as (.../Sequence.as) (revision 2f22f4a3155431e112a37cb1f710215abb2cdb81) +++ lams_common/src/flash/org/lamsfoundation/lams/common/Sequence.as (.../Sequence.as) (revision a7df099b7426a23e539d795e57e0750b20c3ab30) @@ -55,6 +55,7 @@ // sequence dates private var _seqCreatedDate:Date; private var _seqStartDate:Date; + private var _seqScheduleStartDate:Date; // organisation data private var _organisationID:Number; @@ -115,6 +116,7 @@ _seqCreatedDate = dto.createDateTime; _seqStartDate = dto.startDateTime; + _seqScheduleStartDate = dto.scheduleStartDate; _organisationID = dto.organisationID; _organisationName = dto.organisationName; @@ -278,12 +280,12 @@ public function getStartDateTime():String{ var dateFormated:String if (_seqStartDate.getDate() == undefined || _seqStartDate.getDate() == null){ - dateFormated = "Not Started" + //dateFormated = "Not Started" + return null; }else{ var dateFormated:String = (_seqStartDate.getDate()+" "+(StringUtils.getMonthAsString(_seqStartDate.getMonth()+1))+" "+_seqStartDate.getFullYear());; } return dateFormated; - //return _seqStartDate; } public function get startdate():Date{ @@ -298,6 +300,44 @@ return true; } + public function setScheduleDateTime(seqScheduleDate:Date){ + _seqScheduleStartDate = seqScheduleDate; + } + + public function getScheduleDateTime():String{ + var dateFormated:String; + var timeFormated:String; + if (_seqScheduleStartDate.getDate() == undefined || _seqScheduleStartDate.getDate() == null){ + //dateFormated = "Not Scheduled" + return null; + }else{ + var hours = _seqScheduleStartDate.getHours(); + var mins = _seqScheduleStartDate.getMinutes(); + var mins_str; + if(mins < 10){ + mins_str = '0' + mins.toString(); + } else { + mins_str = mins.toString(); + } + + timeFormated = hours + ":" + mins_str; + dateFormated = (_seqScheduleStartDate.getDate()+" "+(StringUtils.getMonthAsString(_seqScheduleStartDate.getMonth()+1))+" "+_seqScheduleStartDate.getFullYear());; + } + return timeFormated + " " + dateFormated; + } + + public function get scheduledate():Date{ + return _seqScheduleStartDate; + } + + public function get isScheduled():Boolean{ + if (_seqScheduleStartDate.getDate() == undefined || _seqScheduleStartDate.getDate() == null){ + return false; + } + + return true; + } + /**public function setFinishDateTime(seqFinishDate:Date){ _seqFinishDate = seqFinishDate; }