Przeglądaj źródła

Merge branch 'fix/Calendar.delete_error' into 'develop'

Merge of fix/[日常管理]修复某些情况下删除日程报错的问题,修复日常提醒不正确的问题 to develop

See merge request o2oa/o2oa!412
蔡祥熠 5 lat temu
rodzic
commit
05bc673825

+ 12 - 1
o2web/source/o2_core/o2/lp/en.js

@@ -174,7 +174,18 @@ MWF.LP.desktop = {
 		"attendanceAppealAcceptMessage": "考勤申述通过",
 		"attendanceAppealAccept": "{subject}",
 		"attendanceAppealRejectMessage": "考勤申述未通过",
-		"attendanceAppealReject": "{subject}"
+		"attendanceAppealReject": "{subject}",
+
+		"canlendarAlarmMessage" : "日程提醒",
+		"canlendarAlarm" : "{title}",
+
+		"teamwork":{
+			"executor":"责任人",
+			"creatorPerson":"创建者"
+		},
+
+		"customMessageTitle": "消息提醒:",
+		"customMessage": "您收到一条消息:"
 
 	},
 	"styleMenu": {

+ 3 - 0
o2web/source/o2_core/o2/lp/zh-cn.js

@@ -189,6 +189,9 @@ o2.LP.desktop = {
         "attendanceAppealRejectMessage": "考勤申述未通过",
         "attendanceAppealReject": "{subject}",
 
+        "canlendarAlarmMessage" : "日程提醒",
+        "canlendarAlarm" : "{title}",
+
         "teamwork":{
             "executor":"责任人",
             "creatorPerson":"创建者"

+ 47 - 1
o2web/source/o2_core/o2/xDesktop/WebSocket.js

@@ -149,7 +149,7 @@ MWF.xDesktop.WebSocket = new Class({
                                 this.receiveAttendanceAppealRejectMessage(data);
                                 break;
                             case "calendar_alarm":
-                                this.receiveAttendanceAppealRejectMessage(data);
+                                this.receiveCalendarAlarmMessage(data);
                                 break;
                             case "teamwork_taskCreate":
                             case "teamwork_taskUpdate":
@@ -595,6 +595,52 @@ MWF.xDesktop.WebSocket = new Class({
             layout.desktop.openApplication(e, "Attendance", {"curNaviId":"12"});
         });
     },
+    receiveCalendarAlarmMessage: function(data){
+        debugger;
+        var content = MWF.LP.desktop.messsage.canlendarAlarm;
+        content = content.replace(/{title}/g, data.title);
+
+        var msg = {
+            "subject": MWF.LP.desktop.messsage.canlendarAlarmMessage,
+            "content": content
+        };
+        var messageItem = layout.desktop.message.addMessage(msg);
+        var tooltipItem = layout.desktop.message.addTooltip(msg);
+        tooltipItem.contentNode.addEvent("click", function(e){
+            layout.desktop.message.hide();
+            if ( layout.desktop.apps && layout.desktop.apps["Calendar"] ) {
+                if( layout.desktop.apps["Calendar"].openEvent ){
+                    layout.desktop.apps["Calendar"].setCurrent();
+                    layout.desktop.apps["Calendar"].openEvent( data.body.id );
+                }else if(layout.desktop.apps["Calendar"].options){
+                    layout.desktop.apps["Calendar"].options.eventId = data.body.id;
+                    layout.desktop.apps["Calendar"].setCurrent();
+                }else{
+                    layout.desktop.openApplication(e, "Calendar", {"eventId": data.body.id });
+                }
+            }else{
+                layout.desktop.openApplication(e, "Calendar", {"eventId": data.body.id });
+            }
+        });
+
+        messageItem.contentNode.addEvent("click", function(e){
+            layout.desktop.message.addUnread(-1);
+            layout.desktop.message.hide();
+            if ( layout.desktop.apps && layout.desktop.apps["Calendar"] ) {
+                if( layout.desktop.apps["Calendar"].openEvent ){
+                    layout.desktop.apps["Calendar"].setCurrent();
+                    layout.desktop.apps["Calendar"].openEvent( data.body.id );
+                }else if(layout.desktop.apps["Calendar"].options){
+                    layout.desktop.apps["Calendar"].options.eventId = data.body.id;
+                    layout.desktop.apps["Calendar"].setCurrent();
+                }else{
+                    layout.desktop.openApplication(e, "Calendar", {"eventId": data.body.id });
+                }
+            }else{
+                layout.desktop.openApplication(e, "Calendar", {"eventId": data.body.id });
+            }
+        });
+    },
     receiveTeamWorkMessage: function(data){
         debugger;
         var task = data.body;

+ 25 - 20
o2web/source/x_component_Calendar/Common.js

@@ -145,22 +145,26 @@ MWFCalendar.EventForm = new Class({
 
         var remind;
         if( data.valarmTime_config ){ //天、时、分、秒
-            var valarmTime_configList = data.valarmTime_config.split(",");
-            valarmTime_configList.each( function( v, i ){
-                var unit;
-                if( i == 0 ){
-                    unit = "天"
-                }else if( i == 1 ){
-                    unit = "小时";
-                }else if( i==2 ){
-                    unit = "分钟"
-                }else{
-                    unit = "秒"
-                }
-                if( v && v!="0" ){
-                    remind = "提前"+ Math.abs(v)+unit+"提醒";
-                }
-            }.bind(this))
+            if( data.valarmTime_config === "0,0,0,-5" ){
+                remind = "开始时提醒";
+            }else{
+                var valarmTime_configList = data.valarmTime_config.split(",");
+                valarmTime_configList.each( function( v, i ){
+                    var unit;
+                    if( i == 0 ){
+                        unit = "天"
+                    }else if( i == 1 ){
+                        unit = "小时";
+                    }else if( i==2 ){
+                        unit = "分钟"
+                    }else{
+                        unit = "秒"
+                    }
+                    if( v && v!="0" ){
+                        remind = "提前"+ Math.abs(v)+unit+"提醒";
+                    }
+                }.bind(this))
+            }
         }
 
         var calendarName =  this.calendarNames[ this.calendarIds.indexOf( data.calendarId ) ];
@@ -866,7 +870,7 @@ MWFCalendar.EventForm = new Class({
         var _self = this;
         var data = this.data;
         var postDelete = function(){
-            this.view.reload();
+            if(this.view)this.view.reload();
             this.close();
         }.bind(this);
         if( this.oldRecurrenceRule ) { //如果是原来是重复的
@@ -893,7 +897,7 @@ MWFCalendar.EventForm = new Class({
     _cancelEvent: function(){
         var view = this.view;
         this.app.actions.deleteSingleEvent(this.data.id, function(){
-            view.reload();
+            if(view)view.reload();
             this.close();
         }.bind(this))
     },
@@ -1031,7 +1035,7 @@ MWFCalendar.EventForm = new Class({
         if( this.formMaskNode )this.formMaskNode.destroy();
         this.formAreaNode.destroy();
         this.fireEvent("postClose");
-        if( this.waitReload )this.view.reload();
+        if( this.waitReload && this.view)this.view.reload();
         delete this;
     }
 });
@@ -1292,7 +1296,7 @@ MWFCalendar.CalendarForm = new Class({
         if( this.formMaskNode )this.formMaskNode.destroy();
         this.formAreaNode.destroy();
         this.fireEvent("postClose");
-        if( this.waitReload )this.view.reload();
+        if( this.waitReload && this.view)this.view.reload();
         delete this;
     }
 });
@@ -1476,6 +1480,7 @@ MWFCalendar.EventTooltip = new Class({
                 "color" : "#fff"
             },
             events : { click : function() {
+                debugger;
                 var form = new MWFCalendar.EventForm(this, this.data, {
                     isFull : true
                 }, {app:this.app});

+ 2 - 1
o2web/source/x_component_Calendar/DayView.js

@@ -890,6 +890,7 @@ MWFCalendarDayView.Calendar.wholeDayDocument = new Class({
         this.tooltip = new MWF.xApplication.Calendar.EventTooltip(this.app.content, this.node, this.app, this.data, {
             axis : "y", "delay" : 350
         });
+        this.tooltip.view = this.view;
     },
     getCoordinate : function(){
         var data = this.data;
@@ -1092,7 +1093,7 @@ MWFCalendarDayView.Calendar.Document = new Class({
         this.tooltip = new MWF.xApplication.Calendar.EventTooltip(this.app.content, this.node, this.app, this.data, {
             axis : "x", "delay" : 350
         });
-
+        this.tooltip.view = this.view;
     },
     resize : function(){
         this.node.setStyles(this.getCoordinate());

+ 28 - 0
o2web/source/x_component_Calendar/Main.js

@@ -18,6 +18,7 @@ MWF.xApplication.Calendar.Main = new Class({
         "height": "600",
         "isResize": true,
         "isMax": true,
+        "eventId" : "",
         "title": MWF.xApplication.Calendar.LP.title
     },
     onQueryLoad: function(){
@@ -320,6 +321,10 @@ MWF.xApplication.Calendar.Main = new Class({
         this.getListView(function(){
             this.listView.show();
             this.currentView = this.listView;
+            if( this.options.eventId ){
+                this.openEvent( this.options.eventId );
+                this.options.eventId = "";
+            }
         }.bind(this));
     },
     getListView: function(callback){
@@ -350,6 +355,11 @@ MWF.xApplication.Calendar.Main = new Class({
         this.getMonthView(function(){
             this.monthView.show();
             this.currentView = this.monthView;
+            debugger;
+            if( this.options.eventId ){
+                this.openEvent( this.options.eventId );
+                this.options.eventId = "";
+            }
         }.bind(this));
     },
     getMonthView: function(callback){
@@ -380,6 +390,10 @@ MWF.xApplication.Calendar.Main = new Class({
         this.getWeekView(function(){
             this.weekView.show();
             this.currentView = this.weekView;
+            if( this.options.eventId ){
+                this.openEvent( this.options.eventId );
+                this.options.eventId = "";
+            }
         }.bind(this));
     },
     getWeekView: function(callback){
@@ -410,6 +424,10 @@ MWF.xApplication.Calendar.Main = new Class({
         this.getDayView(function(){
             this.dayView.show();
             this.currentView = this.dayView;
+            if( this.options.eventId ){
+                this.openEvent( this.options.eventId );
+                this.options.eventId = "";
+            }
         }.bind(this), d);
     },
     getDayView: function(callback, d){
@@ -597,6 +615,16 @@ MWF.xApplication.Calendar.Main = new Class({
             this.currentView.resetNodeSize();
         }
         if( this.leftNavi )this.leftNavi.resizeNode();
+    },
+    openEvent : function (id) {
+        debugger;
+        this.actions.getEvent( id, function (json) {
+            var form = new MWF.xApplication.Calendar.EventForm(this, json.data, {
+                isFull : true
+            }, {app:this});
+            form.view = this.currentView;
+            form.open();
+        }.bind(this))
     }
 });
 

+ 4 - 0
o2web/source/x_component_Calendar/MonthView.js

@@ -1014,6 +1014,7 @@ MWFCalendarMonthView.Calendar.WholeDayWeek = new Class({
         this.tooltip = new MWF.xApplication.Calendar.EventTooltip(this.app.content, this.node, this.app, this.data, {
             axis : "y", "delay" : 350
         });
+        this.tooltip.view = this.view;
     },
     getContainer : function(){
         return this.calendar.dataTdList[ this.weekInfor.index ]
@@ -1142,6 +1143,7 @@ MWFCalendarMonthView.Calendar.InOnDayDocument = new Class({
         this.tooltip = new MWF.xApplication.Calendar.EventTooltip(this.app.content, this.node, this.app, this.data, {
             axis : "y", "delay" : 350
         });
+        this.tooltip.view = this.view;
     },
     getContainer : function(){
         return this.calendar.dataTdList[ this.index.weekIndex ]
@@ -1233,6 +1235,7 @@ MWFCalendarMonthView.Document = new Class({
                 this.day.collapse();
             }.bind(this)
         });
+        this.tooltip.view = this.view;
     },
     showTooltip: function(  ){
         //if( this.index > 3 && this.day.isCollapse ){
@@ -1252,6 +1255,7 @@ MWFCalendarMonthView.Document = new Class({
                     //    this.day.collapseDisable = false;
                     //}.bind(this)
                 });
+                this.tooltip.view = this.view;
                 this.tooltip.load();
             }
         //}

+ 2 - 1
o2web/source/x_component_Calendar/WeekView.js

@@ -1255,6 +1255,7 @@ MWFCalendarWeekView.Calendar.WholeDayDocument = new Class({
         this.tooltip = new MWF.xApplication.Calendar.EventTooltip(this.app.content, this.node, this.app, this.data, {
             axis : "y", "delay" : 350
         });
+        this.tooltip.view = this.view;
     },
     getCoordinate : function(){
         var data = this.data;
@@ -1454,7 +1455,7 @@ MWFCalendarWeekView.Calendar.Document = new Class({
         this.tooltip = new MWF.xApplication.Calendar.EventTooltip(this.app.content, this.node, this.app, this.data, {
             axis : "x", "delay" : 350
         });
-
+        this.tooltip.view = this.view;
     },
     resize : function(){
         this.node.setStyles(this.getCoordinate());

+ 1 - 1
o2web/source/x_component_Selector/$Selector/blue_flat_mobile/css.wcss

@@ -209,7 +209,7 @@
 	  "margin-left" : "10px"
 	},
 	"searchInputDiv": {
-	  	"padding" : "0px 35px",
+	  	"padding" : "0px 30px",
 		"height": "100px",
 		"color": "#999",
         "background": "#fff",