提交 1f56fad2 编写于 作者: U unknown

会议增加取消邀请人功能

上级 5f565993
......@@ -201,6 +201,9 @@ o2.LP.desktop = {
"meetingRejectMessage": "Meeting invitation has been rejected",
"meetingReject": "<font style='color: #ea621f'>{person}</font> has declined your meeting invitation。Time: <font style='color: #ea621f'>{date}</font>; Subject: \"{subject}\"",
"meetingDeleteInviteMessage": "Meeting invitation has been cancelled",
"meetingDeleteInvite": "<font style='color: #ea621f'>{person}</font> cancelled your meeting invitation, meeting information: time <font style='color: #ea621f'>{date}</font>, title \"{subject}\", location <font style='color: #ea621f'>{addr}</font>",
"attendanceAppealInviteMessage": "There is an attendance claim that needs your approval",
"attendanceAppealInvite": "{subject}",
"attendanceAppealAcceptMessage": "Attendance application passed",
......
......@@ -202,6 +202,9 @@ o2.LP.desktop = {
"meetingRejectMessage": "会议邀请已被拒绝",
"meetingReject": "<font style='color: #ea621f'>{person}</font> 已拒绝您的会议邀请。会议时间:<font style='color: #ea621f'>{date}</font>;会议标题: “{subject}”",
"meetingDeleteInviteMessage": "会议邀请已取消",
"meetingDeleteInvite": "<font style='color: #ea621f'>{person}</font> 取消了您的会议邀请,会议信息:时间<font style='color: #ea621f'>{date}</font>,标题“{subject}”,地点<font style='color: #ea621f'>{addr}</font>",
"attendanceAppealInviteMessage": "有考勤申述需要您审批",
"attendanceAppealInvite": "{subject}",
"attendanceAppealAcceptMessage": "考勤申述通过",
......
......@@ -88,6 +88,7 @@ MWF.xDesktop.WebSocket = new Class({
return true;
}
var data = JSON.decode(e.data);
debugger;
switch (data.category){
case "dialog":
switch (data.type){
......@@ -128,6 +129,10 @@ MWF.xDesktop.WebSocket = new Class({
case "meeting_invite":
this.receiveMeetingInviteMessage(data);
break;
case "meetingDelete":
case "meeting_delete":
this.receiveMeetingDeleteInviteMessage(data);
break;
case "meetingCancel":
case "meeting_cancel":
this.receiveMeetingCancelMessage(data);
......@@ -526,6 +531,34 @@ MWF.xDesktop.WebSocket = new Class({
});
}.bind(this));
},
receiveMeetingDeleteInviteMessage: function(data){
this.getMeeting(data, function(meeting){
var content = MWF.LP.desktop.messsage.meetingDeleteInvite;
content = content.replace(/{person}/g, MWF.name.cn(meeting.applicant));
var date = Date.parse(meeting.startTime).format("%Y-%m-%d- %H:%M");
content = content.replace(/{date}/g, date);
content = content.replace(/{subject}/g, meeting.subject);
content = content.replace(/{addr}/g, meeting.roomName+"("+meeting.buildingName+")");
var msg = {
"subject": MWF.LP.desktop.messsage.meetingDeleteInviteMessage,
"content": content
};
var messageItem = layout.desktop.message.addMessage(msg, ((data.body) ? data.body.startTime : ""));
var tooltipItem = layout.desktop.message.addTooltip(msg, ((data.body) ? data.body.startTime : ""));
tooltipItem.contentNode.addEvent("click", function(e){
layout.desktop.message.hide();
layout.desktop.openApplication(e, "Meeting", null);
});
messageItem.contentNode.addEvent("click", function(e){
layout.desktop.message.addUnread(-1);
layout.desktop.message.hide();
layout.desktop.openApplication(e, "Meeting", null);
});
}.bind(this));
},
receiveMeetingCancelMessage: function(data){
this.getMeeting(data, function(meeting){
......
......@@ -649,13 +649,14 @@ MWF.xApplication.Meeting.MeetingForm = new Class({
this.fireEvent("postEdit");
},
_createTableContent: function () {
var _self = this;
this.userName = layout.desktop.session.user.distinguishedName;
this.userId = layout.desktop.session.user.id;
if( this.isNew ){
this.formTopTextNode.set( "text", this.lp.addMeeting );
}else if( this.isEdited ){
this.formTopTextNode.set( "text", this.lp.editMeeting );
this.options.height = "630";
this.options.height = this.isShowInviteDelPersonList() ? "660" : "630";
}else{
this.formTopTextNode.set( "text", this.lp.metting );
this.options.height = "540";
......@@ -711,33 +712,49 @@ MWF.xApplication.Meeting.MeetingForm = new Class({
finishImmediatelyEnable = true;
}
var html = "<div item='qrCode' style='position: absolute;right:0px;top:-20px;width:150px;height:180px;'></div>" +
(( this.isShowCurrentUserDelPersonInfor() ) ?
"<div style='position: absolute;left:0px;top:-25px;height:20px;min-width:200px;color: rgb(246, 166, 35);'>"+this.lp.userDeleteInvitePerson+"</div>" : ""
) +
var html = "<div item='qrCode' style='position: absolute;right:0px;top:-20px;width:150px;height:180px;'></div><table width='100%' bordr='0' cellpadding='7' cellspacing='0' styles='formTable'>" +
"<table width='100%' bordr='0' cellpadding='7' cellspacing='0' styles='formTable'>" +
//"<tr><td colspan='2' styles='formTableHead'>申诉处理单</td></tr>" +
"<tr>"+
" <td styles='formTableTitle' width='70'>"+this.lp.applyPerson+":</td>" +
" <td styles='formTableValue' item='applicant'></td>" +
"</tr>"+
"<tr><td styles='formTableTitle' width='100'>"+this.lp.beginDate+":</td>" +
" <td styles='formTableValue' item='dateInput'></td>" +
"</tr>" +
"<tr><td styles='formTableTitle'>"+ this.lp.time +":</td>" +
" <td styles='formTableValue'>" +
" <div item='beginTimeInput' style='float:left'></div>"+
" <div style='float:left; "+ ( isEditing ? "margin:5px;" : "margin:0px 5px;") + "'>"+ this.lp.to+ "</div>"+
" <div item='endTimeInput' style='float:left'></div>"+
" </td></tr>" +
"<tr><td styles='formTableTitle'>"+ this.lp.selectRoom +":</td>" +
" <td styles='formTableValue' item='meetingRoom'></td></tr>" +
"<tr><td styles='formTableTitle'>"+this.lp.invitePerson2+":</td>" +
" <td styles='formTableValue'>" +
" <td styles='formTableValue' style='overflow: hidden;'>" +
" <div item='invitePersonList'></div>" +
" <div style='display:"+ ( this.isEdited ? "" : "none") +";' item='selectinvitePerson'></div>" +
(( !this.isNew && this.data.myWaitAccept ) ?
" <tr><td></td><td styles='formTableValue'><div item='acceptAction'></div><div item='rejectAction'></div></td></tr>" : ""
) +
" <div style='display:"+ ( this.isEdited ? "" : "none") +";float:left; margin-left:20px;' item='selectinvitePerson'></div>" +
" <div style='display:"+ ( this.isShowDisInviateButton() ? "" : "none") +";float:left; margin-left:20px;' item='selectDisinvitePerson'></div>" +
" </td>" +
"</tr>" +
(( !this.isNew && this.data.myWaitAccept ) ?
"<tr><td></td><td styles='formTableValue'><div item='acceptAction'></div><div item='rejectAction'></div></td></tr>" : ""
) +
"<tr style='display:"+(this.isShowInviteDelPersonList()?'':'none')+"' class='inviteDelPersonListTr'>" +
" <td styles='formTableTitle'>"+this.lp.deleteInvitePerson2+":</td>" +
" <td styles='formTableValue'><div item='inviteDelPersonList'></div></td></tr>"+
"<tr style='display:"+ ( this.isNew ? "none" : "") +" ;' item='checkPersonTr'><td styles='formTableTitle'>"+this.lp.needSignInPerson+":</td>" +
" <td styles='formTableValue' item='checkinPersonList'></td></tr>" +
"<tr><td styles='formTableTitle'>"+this.lp.meetingSubject+":</td>" +
......@@ -811,32 +828,37 @@ MWF.xApplication.Meeting.MeetingForm = new Class({
this.loadAcceptAndReject( item );
}.bind(this)
}},
inviteDelPersonList: { type: "org", isEdited : false, orgType: ["identity","person"], count : 0},
checkinPersonList : { type: "org", isEdited : false, orgType: ["identity","person"], count : 0},
selectinvitePerson : { type : "button", value : this.lp.addInvitePerson1, style : {"margin-left": "20px"}, event : {
selectinvitePerson : { type : "button", value : this.lp.addInvitePerson1, style : {"float": "left"}, event : {
click : function( it ){
var options = {
"type" : "",
"types": ["identity","person"],
"type" : "identity",
"resultType": "person",
"exclude" : this.getInvitePersonExclude(),
"values": [],
"count": 0,
"onComplete": function(items){
MWF.require("MWF.widget.O2Identity", function(){
var invitePersonList = [];
items.each(function(item){
var _self = this;
if( item.data.distinguishedName.split("@").getLast().toLowerCase() == "i" ){
var person = new MWF.widget.O2Identity(item.data, it.form.getItem("invitePersonList").container, {"style": "room"});
invitePersonList.push( item.data.distinguishedName );
}else{
var person = new MWF.widget.O2Person(item.data, it.form.getItem("invitePersonList").container, {"style": "room"});
invitePersonList.push(item.data.distinguishedName);
}
var invitePersonList = items.map(function(item){
return item.data.distinguishedName;
}.bind(this));
// items.each(function(item){
// var _self = this;
// if( item.data.distinguishedName.split("@").getLast().toLowerCase() == "i" ){
// var person = new MWF.widget.O2Identity(item.data, it.form.getItem("invitePersonList").container, {"style": "room"});
// invitePersonList.push( item.data.distinguishedName );
// }else{
// var person = new MWF.widget.O2Person(item.data, it.form.getItem("invitePersonList").container, {"style": "room"});
// invitePersonList.push(item.data.distinguishedName);
// }
// }.bind(this));
this.app.actions.addMeetingInvite(this.data.id, {"invitePersonList": invitePersonList, "id": this.data.id}, function(json){
this.app.actions.getMeeting(json.data.id, function(meeting){
this.invitePersonList = meeting.data.invitePersonList;
this.data.invitePersonList = meeting.data.invitePersonList;
this.reloadInvitePerson();
this.checkShowDisInviateButton();
this.app.notice(this.app.lp.addedInvitePerson1, "success", this.node );
}.bind(this));
}.bind(this));
......@@ -847,6 +869,38 @@ MWF.xApplication.Meeting.MeetingForm = new Class({
var selector = new MWF.O2Selector(this.app.content, options);
}.bind(this)
} },
selectDisinvitePerson : { type : "button", value : this.lp.deleteInvitePerson1, className : "inputButtonGrey", event : {
click : function( it ){
var options = {
"title": this.lp.deleteInvitePerson1,
"type": "identity",
"include" : this.data.invitePersonList,
"noUnit": true,
"onlyMajorIdentity": true,
"onComplete": function(items){
MWF.require("MWF.widget.O2Identity", function(){
var removeList = items.map(function(item){
return item.data.distinguishedName;
}.bind(this));
o2.Actions.load("x_meeting_assemble_control").MeetingAction.deleteInvite(this.data.id, {"InvitePersonList": removeList}, function(json){
this.app.actions.getMeeting(json.data.id, function(meeting){
this.data.invitePersonList = meeting.data.invitePersonList;
this.data.inviteDelPersonList = meeting.data.inviteDelPersonList;
this.reloadInvitePerson();
this.reloadinviteDelPerson();
this.checkShowInviteDelPersonList();
this.checkShowDisInviateButton();
this.app.notice(this.app.lp.deleteInvitePerson, "success", this.node );
}.bind(this));
}.bind(this));
}.bind(this));
}.bind(this)
};
var selector = new MWF.O2Selector(this.app.content, options);
}.bind(this)
} },
subject: {},
summary: {type: "textarea"},
acceptAction : { type : "button", value : this.lp.accept, className : "inputAcceptButton",
......@@ -891,6 +945,51 @@ MWF.xApplication.Meeting.MeetingForm = new Class({
}
}.bind(this), true);
},
reloadInvitePerson: function(){
if(!this.form)return;
this.form.getItem("invitePersonList").setValue(this.data.invitePersonList);
// var container = this.form.getItem("invitePersonList").container;
// container.empty();
// this.data.invitePersonList.each(function(item){
// var _self = this;
// if( item.split("@").getLast().toLowerCase() === "i" ){
// new MWF.widget.O2Identity(item, container, {"style": "room"});
// }else{
// new MWF.widget.O2Person(item, container, {"style": "room"});
// }
// }.bind(this));
},
isShowDisInviateButton : function (){
return this.isEdited && this.data.invitePersonList && this.data.invitePersonList.length > 0;
},
checkShowDisInviateButton: function(){
var node = this.formTableArea.getElement("[item='selectDisinvitePerson']");
node.setStyle( "display", this.isShowDisInviateButton() ? "" : "none" );
},
isShowInviteDelPersonList : function () {
return this.isEdited && this.data.inviteDelPersonList && this.data.inviteDelPersonList.length > 0;
},
checkShowInviteDelPersonList: function(){
var node = this.formTableArea.getElement('.inviteDelPersonListTr');
node.setStyle( "display", this.isShowInviteDelPersonList() ? "" : "none" );
},
isShowCurrentUserDelPersonInfor : function () {
return (!this.isEdited) && (this.data.inviteDelPersonList||[]).contains(this.userName) && !(this.data.invitePersonList||[]).contains(this.userName);
},
reloadinviteDelPerson: function(){
if(!this.form)return;
this.form.getItem("inviteDelPersonList").setValue(this.data.inviteDelPersonList);
// var container = this.form.getItem("inviteDelPersonList").container;
// container.empty();
// this.data.inviteDelPersonList.each(function(item){
// var _self = this;
// if( item.split("@").getLast().toLowerCase() === "i" ){
// new MWF.widget.O2Identity(item, container, {"style": "room"});
// }else{
// new MWF.widget.O2Person(item, container, {"style": "room"});
// }
// }.bind(this));
},
startImmediately : function(){
o2.Actions.load("x_meeting_assemble_control").MeetingAction.editStartTime( this.data.id, {
room : this.roomId || this.data.room,
......@@ -1481,7 +1580,14 @@ MWF.xApplication.Meeting.MeetingTooltip = new Class({
var endTime = this.getString( endDate.getHours() ) + ":" + this.getString( endDate.getMinutes() );
var meetingTime = dateStr + " " + beginTime + "-" + endTime;
var description = (data.description || "")+(data.summary || "");
var html =
debugger;
var deletedInfor = "";
this.userName = layout.desktop.session.user.distinguishedName;
if((this.data.inviteDelPersonList||[]).contains(this.userName) && !(this.data.invitePersonList||[]).contains(this.userName)){
deletedInfor = "<div style='position: absolute;left:20px;top:5px;height:20px;min-width:200px;color: rgb(246, 166, 35);'>"+this.lp.userDeleteInvitePerson+"</div>";
}
var html = deletedInfor +
"<div style='overflow: hidden;padding:15px 20px 20px 10px;height:16px;line-height:16px;'>" +
" <div style='font-size: 12px;color:#666; float: right'>"+ this.lp.applyPerson +":" + data.applicant.split("@")[0] +"</div>" +
" <div style='font-size: 16px;color:#333;float: left'>"+ this.lp.meetingDetail +"</div>"+
......@@ -1529,7 +1635,7 @@ MWF.xApplication.Meeting.MeetingTooltip = new Class({
MWF.require("MWF.widget.O2Identity", function(){
area.empty();
this.data.invitePersonList.each(function( person ){
var O2person = new MWF.widget.O2Person({name : person}, area, {"style": "room", "onLoadedInfor": function(item){
var O2person = new MWF.widget.O2Person({name : person, displayName:person.split("@")[0]}, area, {"style": "room", "onLoadedInfor": function(item){
this.loadAcceptAndReject( item );
}.bind(this) });
this.O2PersonList.push( O2person );
......
......@@ -38,6 +38,12 @@ MWF.xApplication.Meeting.LP = {
"invitePerson2": "Participants",
"addInvitePerson1": "Add Invite Person",
"addedInvitePerson1": "Invite person has been added",
"deleteInvitePerson": "Invite person has been cancelled",
"deleteInvitePerson1": "Cancel the inviter",
"deleteInvitePerson2": "Cancelled",
"userDeleteInvitePerson": "Your meeting invitation has been cancelled.",
"waitAccept": "Invite you to participate",
"waitConfirm": "Need your approval",
"isAccept": "Please attend the meeting on time",
......
......@@ -38,6 +38,12 @@ MWF.xApplication.Meeting.LP = {
"invitePerson2": "参会人员",
"addInvitePerson1": "增加邀请人",
"addedInvitePerson1": "已增加邀请人",
"deleteInvitePerson": "已取消邀请人",
"deleteInvitePerson1": "取消邀请人",
"deleteInvitePerson2": "已取消",
"userDeleteInvitePerson": "您的会议邀请已被取消",
"waitAccept": "邀请您参加",
"waitConfirm": "需要您审批",
"isAccept": "请您准时出席会议",
......
......@@ -1673,10 +1673,17 @@ MWF.xApplication.Selector.Identity.Include = new Class({
checkCallback();
}.bind(this), checkCallback, d);
}else{
this.orgAction.listIdentityByPerson(function(json){
this.loadIdentityItem(json, container , null, null, true);
checkCallback();
}.bind(this), checkCallback, d);
if( this.selector.options.onlyMajorIdentity ){
o2.Actions.load("x_organization_assemble_express").IdentityAction.listMajorWithPersonObject({"personList":[d]}, function (json) {
this.loadIdentityItem(json, container , null, null, true);
checkCallback();
}.bind(this), checkCallback)
}else{
this.orgAction.listIdentityByPerson(function(json){
this.loadIdentityItem(json, container , null, null, true);
checkCallback();
}.bind(this), checkCallback, d);
}
}
}else{
if( this.options.resultType === "person" ){
......
......@@ -76,6 +76,17 @@
"cursor" : "pointer",
"font-size" : "14px"
},
"inputButtonGrey" : {
"background": "#f0f0f0",
"border-radius": "4px",
"padding" : "0px 10px",
"line-height" : "30px",
"height" : "30px",
"border" : "0px",
"color" : "#666",
"cursor" : "pointer",
"font-size" : "14px"
},
"inputAcceptButton" : {
"background-color": "#3C76B7",
"border-radius": "4px",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册