|
@@ -119,6 +119,14 @@ MWF.xApplication.TeamWork.Task = new Class({
|
|
|
//data { taskId:xxx }
|
|
//data { taskId:xxx }
|
|
|
var _self = this;
|
|
var _self = this;
|
|
|
this.getTaskData(function(){
|
|
this.getTaskData(function(){
|
|
|
|
|
+ this.control = {};
|
|
|
|
|
+ this.control.isEdit = this.taskData.control.edit;
|
|
|
|
|
+ this.control.isDelete = this.taskData.control.delete;
|
|
|
|
|
+ this.control.isFounder = this.taskData.control.founder;
|
|
|
|
|
+ this.control.isCreate = true;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
if(this.openType == "window"){
|
|
if(this.openType == "window"){
|
|
|
this.app.setTitle(this.taskData.name);
|
|
this.app.setTitle(this.taskData.name);
|
|
|
}
|
|
}
|
|
@@ -345,29 +353,32 @@ MWF.xApplication.TeamWork.Task = new Class({
|
|
|
this.taskParticipateContainer.empty();
|
|
this.taskParticipateContainer.empty();
|
|
|
this.participateTitle = new Element("div.participateTitle",{styles:this.css.participateTitle}).inject(this.taskParticipateContainer);
|
|
this.participateTitle = new Element("div.participateTitle",{styles:this.css.participateTitle}).inject(this.taskParticipateContainer);
|
|
|
this.participateTitleText = new Element("div.participateTitleText",{styles:this.css.participateTitleText}).inject(this.participateTitle);
|
|
this.participateTitleText = new Element("div.participateTitleText",{styles:this.css.participateTitleText}).inject(this.participateTitle);
|
|
|
- this.participateTitleIcon = new Element("div.participateTitleIcon",{styles:this.css.participateTitleIcon,title:this.lp.taskReaderAdd}).inject(this.participateTitle);
|
|
|
|
|
- this.participateTitleIcon.addEvents({
|
|
|
|
|
- click:function(){
|
|
|
|
|
- this.selectPerson(this.participateTitleIcon,null,["identity","unit"],0,
|
|
|
|
|
- function(json){
|
|
|
|
|
- if(json.length>0){
|
|
|
|
|
- this.taskData.participantList = this.taskData.participantList.concat(json);
|
|
|
|
|
- //this.actions.updateParticipantList(this.taskData.id,{participantList:this.taskData.participantList},function(json){
|
|
|
|
|
- this.actions.updateParticipant(this.taskData.id,{participantList:this.taskData.participantList},function(json){
|
|
|
|
|
- if(json.data.dynamics){
|
|
|
|
|
- json.data.dynamics.each(function(dd){
|
|
|
|
|
- this.loadDynamicItem(dd,"bottom")
|
|
|
|
|
- }.bind(this))
|
|
|
|
|
- }
|
|
|
|
|
- this.dynamicContent.scrollTo(0,this.dynamicContent.getScrollSize().y);
|
|
|
|
|
|
|
+ if(this.control.isEdit){
|
|
|
|
|
+ this.participateTitleIcon = new Element("div.participateTitleIcon",{styles:this.css.participateTitleIcon,title:this.lp.taskReaderAdd}).inject(this.participateTitle);
|
|
|
|
|
+ this.participateTitleIcon.addEvents({
|
|
|
|
|
+ click:function(){
|
|
|
|
|
+ this.selectPerson(this.participateTitleIcon,null,["identity","unit"],0,
|
|
|
|
|
+ function(json){
|
|
|
|
|
+ if(json.length>0){
|
|
|
|
|
+ this.taskData.participantList = this.taskData.participantList.concat(json);
|
|
|
|
|
+ //this.actions.updateParticipantList(this.taskData.id,{participantList:this.taskData.participantList},function(json){
|
|
|
|
|
+ this.actions.updateParticipant(this.taskData.id,{participantList:this.taskData.participantList},function(json){
|
|
|
|
|
+ if(json.data.dynamics){
|
|
|
|
|
+ json.data.dynamics.each(function(dd){
|
|
|
|
|
+ this.loadDynamicItem(dd,"bottom")
|
|
|
|
|
+ }.bind(this))
|
|
|
|
|
+ }
|
|
|
|
|
+ this.dynamicContent.scrollTo(0,this.dynamicContent.getScrollSize().y);
|
|
|
|
|
+
|
|
|
|
|
+ this.createParticipateContainer();
|
|
|
|
|
+ }.bind(this))
|
|
|
|
|
+ }
|
|
|
|
|
+ }.bind(this)
|
|
|
|
|
+ );
|
|
|
|
|
+ }.bind(this)
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- this.createParticipateContainer();
|
|
|
|
|
- }.bind(this))
|
|
|
|
|
- }
|
|
|
|
|
- }.bind(this)
|
|
|
|
|
- );
|
|
|
|
|
- }.bind(this)
|
|
|
|
|
- });
|
|
|
|
|
|
|
|
|
|
this.participateValue = new Element("div.participateValue",{styles:this.css.participateValue}).inject(this.taskParticipateContainer);
|
|
this.participateValue = new Element("div.participateValue",{styles:this.css.participateValue}).inject(this.taskParticipateContainer);
|
|
|
this.setScrollBar(this.participateValue);
|
|
this.setScrollBar(this.participateValue);
|
|
@@ -745,7 +756,7 @@ MWF.xApplication.TeamWork.Task = new Class({
|
|
|
loadNameValue:function(){ //名称
|
|
loadNameValue:function(){ //名称
|
|
|
var _self = this;
|
|
var _self = this;
|
|
|
this.taskNameContainer.set("text",this.taskData.name);
|
|
this.taskNameContainer.set("text",this.taskData.name);
|
|
|
- if(true){ //权限修改
|
|
|
|
|
|
|
+ if(this.control.isEdit){ //权限修改
|
|
|
var node = this.taskNameContainer;
|
|
var node = this.taskNameContainer;
|
|
|
var nameEdit = false;
|
|
var nameEdit = false;
|
|
|
var overStatus = null;
|
|
var overStatus = null;
|
|
@@ -835,7 +846,7 @@ MWF.xApplication.TeamWork.Task = new Class({
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- if(true){ //权限
|
|
|
|
|
|
|
+ if(this.control.isEdit){ //权限
|
|
|
this.taskStatusValueContainer.addEvents({
|
|
this.taskStatusValueContainer.addEvents({
|
|
|
click:function(){
|
|
click:function(){
|
|
|
var sc = new MWF.xApplication.TeamWork.Task.StatusCheck(this.container, this.taskStatusValueContainer, this.app, {data:this.taskData}, {
|
|
var sc = new MWF.xApplication.TeamWork.Task.StatusCheck(this.container, this.taskStatusValueContainer, this.app, {data:this.taskData}, {
|
|
@@ -894,7 +905,8 @@ MWF.xApplication.TeamWork.Task = new Class({
|
|
|
var _self = this;
|
|
var _self = this;
|
|
|
if(this.taskDutyValue) this.taskDutyValue.empty();
|
|
if(this.taskDutyValue) this.taskDutyValue.empty();
|
|
|
this.taskDutyValueContainer = new Element("div.taskDutyValueContainer",{styles:this.css.taskDutyValueContainer}).inject(this.taskDutyValue);
|
|
this.taskDutyValueContainer = new Element("div.taskDutyValueContainer",{styles:this.css.taskDutyValueContainer}).inject(this.taskDutyValue);
|
|
|
- if(true){//权限
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if(this.control.isEdit){//权限
|
|
|
if(this.taskData.executor==""){
|
|
if(this.taskData.executor==""){
|
|
|
this.taskDutyAddIcon = new Element("div.taskDutyAddIcon",{styles:this.css.taskDutyAddIcon}).inject(this.taskDutyValueContainer);
|
|
this.taskDutyAddIcon = new Element("div.taskDutyAddIcon",{styles:this.css.taskDutyAddIcon}).inject(this.taskDutyValueContainer);
|
|
|
this.taskDutyAddText = new Element("div.taskDutyAddText",{styles:this.css.taskDutyAddText,text:this.lp.addDuty}).inject(this.taskDutyValueContainer);
|
|
this.taskDutyAddText = new Element("div.taskDutyAddText",{styles:this.css.taskDutyAddText,text:this.lp.addDuty}).inject(this.taskDutyValueContainer);
|
|
@@ -912,7 +924,7 @@ MWF.xApplication.TeamWork.Task = new Class({
|
|
|
}.bind(this)
|
|
}.bind(this)
|
|
|
})
|
|
})
|
|
|
}else{
|
|
}else{
|
|
|
- this.loadTaskPerson(this.taskDutyValueContainer,this.taskData.executor,true);
|
|
|
|
|
|
|
+ this.loadTaskPerson(this.taskDutyValueContainer,this.taskData.executor,this.taskData.control.founder);
|
|
|
}
|
|
}
|
|
|
}else{
|
|
}else{
|
|
|
if(this.taskData.executor!=""){
|
|
if(this.taskData.executor!=""){
|
|
@@ -939,7 +951,7 @@ MWF.xApplication.TeamWork.Task = new Class({
|
|
|
}else{
|
|
}else{
|
|
|
this.taskEndTime.set("text",this.lp.taskTimeEnd);
|
|
this.taskEndTime.set("text",this.lp.taskTimeEnd);
|
|
|
}
|
|
}
|
|
|
- if(true){ //权限
|
|
|
|
|
|
|
+ if(this.control.isEdit){ //权限
|
|
|
this.taskStartTime.setStyles({"background-color":"#f5f5f5","cursor":"pointer"});
|
|
this.taskStartTime.setStyles({"background-color":"#f5f5f5","cursor":"pointer"});
|
|
|
this.taskEndTime.setStyles({"background-color":"#f5f5f5","cursor":"pointer"});
|
|
this.taskEndTime.setStyles({"background-color":"#f5f5f5","cursor":"pointer"});
|
|
|
this.taskStartTime.addEvents({
|
|
this.taskStartTime.addEvents({
|
|
@@ -998,7 +1010,7 @@ MWF.xApplication.TeamWork.Task = new Class({
|
|
|
this.taskRemarkValue.getFirst("p").setStyles({"margin-top":"0px"})
|
|
this.taskRemarkValue.getFirst("p").setStyles({"margin-top":"0px"})
|
|
|
}
|
|
}
|
|
|
if(this.editor) delete this.editor;
|
|
if(this.editor) delete this.editor;
|
|
|
- if(true){ //权限
|
|
|
|
|
|
|
+ if(this.control.isEdit){ //权限
|
|
|
if(value == ""){
|
|
if(value == ""){
|
|
|
this.taskRemarkValue.set("text",this.lp.editTip);
|
|
this.taskRemarkValue.set("text",this.lp.editTip);
|
|
|
}
|
|
}
|
|
@@ -1024,66 +1036,73 @@ MWF.xApplication.TeamWork.Task = new Class({
|
|
|
loadPriorityValue:function(){
|
|
loadPriorityValue:function(){
|
|
|
if(this.taskPriorityValue)this.taskPriorityValue.empty();
|
|
if(this.taskPriorityValue)this.taskPriorityValue.empty();
|
|
|
var node = new Element("div.taskPriorityValueText",{styles:this.css.taskPriorityValueText}).inject(this.taskPriorityValue);
|
|
var node = new Element("div.taskPriorityValueText",{styles:this.css.taskPriorityValueText}).inject(this.taskPriorityValue);
|
|
|
- var curColor = "#999999";
|
|
|
|
|
|
|
+ var dColor = "#999999";
|
|
|
if(this.taskData.priority){
|
|
if(this.taskData.priority){
|
|
|
- node.set("text",this.taskData.priority);
|
|
|
|
|
- if(this.taskData.priority == this.lp.priority.urgency) curColor = "#ffaf38";
|
|
|
|
|
- else if(this.taskData.priority == this.lp.priority.emergency) curColor = "#ff4f3e";
|
|
|
|
|
|
|
+ var arr = this.taskData.priority.split("||");
|
|
|
|
|
+ var name = arr[0]?arr[0]:this.lp.priority.normal;
|
|
|
|
|
+ var color = arr[1]?arr[1]:dColor;
|
|
|
|
|
+
|
|
|
|
|
+ node.set("text",name);
|
|
|
|
|
+ // if(this.taskData.priority == this.lp.priority.urgency) curColor = "#ffaf38";
|
|
|
|
|
+ // else if(this.taskData.priority == this.lp.priority.emergency) curColor = "#ff4f3e";
|
|
|
|
|
+
|
|
|
|
|
+ node.setStyles({"color":color,"border":"1px solid "+color+""});
|
|
|
|
|
|
|
|
- node.setStyles({"color":curColor,"border":"1px solid "+curColor+""})
|
|
|
|
|
}else{
|
|
}else{
|
|
|
node.set("text",this.lp.priority.normal)
|
|
node.set("text",this.lp.priority.normal)
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- node.addEvents({
|
|
|
|
|
- click:function(){
|
|
|
|
|
- var pc = new MWF.xApplication.TeamWork.Task.PriorityCheck(this.container, node, this.app, {data:this.taskData}, {
|
|
|
|
|
- css:this.css, lp:this.lp, axis : "y",
|
|
|
|
|
- position : { //node 固定的位置
|
|
|
|
|
- x : "right",
|
|
|
|
|
- y : "middle"
|
|
|
|
|
- },
|
|
|
|
|
- nodeStyles : {
|
|
|
|
|
- "min-width":"200px",
|
|
|
|
|
- "padding":"2px",
|
|
|
|
|
- "border-radius":"5px",
|
|
|
|
|
- "box-shadow":"0px 0px 4px 0px #999999",
|
|
|
|
|
- "z-index" : "201"
|
|
|
|
|
- },
|
|
|
|
|
- onPostLoad:function(){
|
|
|
|
|
- pc.node.setStyles({"opacity":"0","top":(pc.node.getStyle("top").toInt()+4)+"px"});
|
|
|
|
|
- var fx = new Fx.Tween(pc.node,{duration:400});
|
|
|
|
|
- fx.start(["opacity"] ,"0", "1");
|
|
|
|
|
- },
|
|
|
|
|
- onClose:function(rd){
|
|
|
|
|
- if(!rd) return;
|
|
|
|
|
- if(rd.value){
|
|
|
|
|
- if(rd.value != this.taskData.priority){
|
|
|
|
|
- var sd = {
|
|
|
|
|
- taskId:this.taskData.id,
|
|
|
|
|
- property:"priority",
|
|
|
|
|
- mainValue:rd.value,
|
|
|
|
|
- secondaryValue:""
|
|
|
|
|
- };
|
|
|
|
|
- this.updateSingleProperty(sd,function(){
|
|
|
|
|
- this.taskData.priority = rd.value;
|
|
|
|
|
- this.loadPriorityValue();
|
|
|
|
|
- }.bind(this))
|
|
|
|
|
|
|
+ if(this.control.isEdit){
|
|
|
|
|
+ node.addEvents({
|
|
|
|
|
+ click:function(){
|
|
|
|
|
+ var pc = new MWF.xApplication.TeamWork.Task.PriorityCheck(this.container, node, this.app, {data:this.taskData}, {
|
|
|
|
|
+ css:this.css, lp:this.lp, axis : "y",
|
|
|
|
|
+ position : { //node 固定的位置
|
|
|
|
|
+ x : "right",
|
|
|
|
|
+ y : "middle"
|
|
|
|
|
+ },
|
|
|
|
|
+ nodeStyles : {
|
|
|
|
|
+ "min-width":"200px",
|
|
|
|
|
+ "padding":"2px",
|
|
|
|
|
+ "border-radius":"5px",
|
|
|
|
|
+ "box-shadow":"0px 0px 4px 0px #999999",
|
|
|
|
|
+ "z-index" : "201"
|
|
|
|
|
+ },
|
|
|
|
|
+ onPostLoad:function(){
|
|
|
|
|
+ pc.node.setStyles({"opacity":"0","top":(pc.node.getStyle("top").toInt()+4)+"px"});
|
|
|
|
|
+ var fx = new Fx.Tween(pc.node,{duration:400});
|
|
|
|
|
+ fx.start(["opacity"] ,"0", "1");
|
|
|
|
|
+ },
|
|
|
|
|
+ onClose:function(rd){
|
|
|
|
|
+ if(!rd) return;
|
|
|
|
|
+ if(rd.value){
|
|
|
|
|
+ if(rd.value != this.taskData.priority){
|
|
|
|
|
+ var sd = {
|
|
|
|
|
+ taskId:this.taskData.id,
|
|
|
|
|
+ property:"priority",
|
|
|
|
|
+ mainValue:rd.value,
|
|
|
|
|
+ secondaryValue:""
|
|
|
|
|
+ };
|
|
|
|
|
+ this.updateSingleProperty(sd,function(){
|
|
|
|
|
+ this.taskData.priority = rd.value;
|
|
|
|
|
+ this.loadPriorityValue();
|
|
|
|
|
+ }.bind(this))
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- this.loadPriorityValue();
|
|
|
|
|
- }.bind(this)
|
|
|
|
|
- });
|
|
|
|
|
- pc.load();
|
|
|
|
|
- }.bind(this),
|
|
|
|
|
- mouseover:function(){
|
|
|
|
|
- this.setStyles({"border":"1px solid #4A90E2","color":"#4A90E2"})
|
|
|
|
|
- },
|
|
|
|
|
- mouseout:function(){
|
|
|
|
|
- this.setStyles({"border":"1px solid "+curColor+"","color":curColor})
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ this.loadPriorityValue();
|
|
|
|
|
+ }.bind(this)
|
|
|
|
|
+ });
|
|
|
|
|
+ pc.load();
|
|
|
|
|
+ }.bind(this),
|
|
|
|
|
+ mouseover:function(){
|
|
|
|
|
+ this.setStyles({"border":"1px solid #4A90E2","color":"#4A90E2"})
|
|
|
|
|
+ },
|
|
|
|
|
+ mouseout:function(){
|
|
|
|
|
+ this.setStyles({"border":"1px solid "+color+"","color":color})
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
loadTagValue:function(){
|
|
loadTagValue:function(){
|
|
|
if(this.taskTagValue)this.taskTagValue.empty();
|
|
if(this.taskTagValue)this.taskTagValue.empty();
|
|
@@ -1323,79 +1342,82 @@ MWF.xApplication.TeamWork.Task = new Class({
|
|
|
this.loadSubTask();
|
|
this.loadSubTask();
|
|
|
|
|
|
|
|
//添加子任务
|
|
//添加子任务
|
|
|
- this.subTaskNewContent = new Element("div.subTaskNewContent",{styles:this.css.subTaskNewContent}).inject(this.subTaskAddContainer);
|
|
|
|
|
- this.subTaskNewIcon = new Element("div.subTaskNewIcon",{styles:this.css.subTaskNewIcon}).inject(this.subTaskNewContent);
|
|
|
|
|
- this.subTaskNewText = new Element("div.subTaskNewText",{styles:this.css.subTaskNewText,text:this.lp.taskSubText}).inject(this.subTaskNewContent);
|
|
|
|
|
- this.subTaskNewContent.addEvents({
|
|
|
|
|
- click:function(){
|
|
|
|
|
- this.subTaskNewContent.hide();
|
|
|
|
|
- if(this.subTaskNewContainer)this.subTaskNewContainer.destroy();
|
|
|
|
|
- this.subTaskNewContainer = new Element("div.subTaskNewContainer",{styles:this.css.subTaskNewContainer}).inject(this.subTaskAddContainer);
|
|
|
|
|
|
|
+ if(this.control.isEdit){ //权限
|
|
|
|
|
+ this.subTaskNewContent = new Element("div.subTaskNewContent",{styles:this.css.subTaskNewContent}).inject(this.subTaskAddContainer);
|
|
|
|
|
+ this.subTaskNewIcon = new Element("div.subTaskNewIcon",{styles:this.css.subTaskNewIcon}).inject(this.subTaskNewContent);
|
|
|
|
|
+ this.subTaskNewText = new Element("div.subTaskNewText",{styles:this.css.subTaskNewText,text:this.lp.taskSubText}).inject(this.subTaskNewContent);
|
|
|
|
|
+ this.subTaskNewContent.addEvents({
|
|
|
|
|
+ click:function(){
|
|
|
|
|
+ this.subTaskNewContent.hide();
|
|
|
|
|
+ if(this.subTaskNewContainer)this.subTaskNewContainer.destroy();
|
|
|
|
|
+ this.subTaskNewContainer = new Element("div.subTaskNewContainer",{styles:this.css.subTaskNewContainer}).inject(this.subTaskAddContainer);
|
|
|
|
|
|
|
|
- this.subTaskNewValue = new Element("div.subTaskNewValue",{styles:this.css.subTaskNewValue}).inject(this.subTaskNewContainer);
|
|
|
|
|
- this.subTaskNewInput = new Element("input.subTaskNewInput",{styles:this.css.subTaskNewInput,placeholder:this.lp.taskSubNamePlaceholder}).inject(this.subTaskNewValue);
|
|
|
|
|
- this.subTaskNewPerson = new Element("div.subTaskNewPerson",{styles:this.css.subTaskNewPerson}).inject(this.subTaskNewValue);
|
|
|
|
|
|
|
+ this.subTaskNewValue = new Element("div.subTaskNewValue",{styles:this.css.subTaskNewValue}).inject(this.subTaskNewContainer);
|
|
|
|
|
+ this.subTaskNewInput = new Element("input.subTaskNewInput",{styles:this.css.subTaskNewInput,placeholder:this.lp.taskSubNamePlaceholder}).inject(this.subTaskNewValue);
|
|
|
|
|
+ this.subTaskNewPerson = new Element("div.subTaskNewPerson",{styles:this.css.subTaskNewPerson}).inject(this.subTaskNewValue);
|
|
|
|
|
|
|
|
- this.subTaskNewPerson.addEvent("click",function(){
|
|
|
|
|
- this.selectPerson(this.subTaskNewPerson,"identity",null,1,
|
|
|
|
|
- function(json){
|
|
|
|
|
- if(json.length>0){
|
|
|
|
|
- this.taskSubNewPerson = json[0];
|
|
|
|
|
- this.loadSubTaskPerson(this.subTaskNewPerson,json[0],true)
|
|
|
|
|
- }
|
|
|
|
|
- }.bind(this)
|
|
|
|
|
- );
|
|
|
|
|
- }.bind(this));
|
|
|
|
|
- this.subTaskNewAction = new Element("div.subTaskNewAction",{styles:this.css.subTaskNewAction}).inject(this.subTaskNewContainer);
|
|
|
|
|
- this.subTaskNewCancel = new Element("div.subTaskNewCancel",{styles:this.css.subTaskNewCancel,text:this.lp.cancel}).inject(this.subTaskNewAction);
|
|
|
|
|
- this.subTaskNewCancel.addEvents({
|
|
|
|
|
- click:function(){
|
|
|
|
|
- this.subTaskNewContent.show();
|
|
|
|
|
- this.subTaskNewContainer.destroy()
|
|
|
|
|
- }.bind(this),
|
|
|
|
|
- mouseover:function(){
|
|
|
|
|
- this.setStyles({"color":"#4A90E2"})
|
|
|
|
|
- },
|
|
|
|
|
- mouseout:function(){
|
|
|
|
|
- this.setStyles({"color":"#666666"})
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- this.subTaskNewOK = new Element("div.subTaskNewOK",{styles:this.css.subTaskNewOK,text:this.lp.save}).inject(this.subTaskNewAction);
|
|
|
|
|
- this.subTaskNewOK.addEvents({
|
|
|
|
|
- click:function(){
|
|
|
|
|
- if(this.subTaskNewInput.get("value").trim()=="") return;
|
|
|
|
|
- var data = {
|
|
|
|
|
- name:this.subTaskNewInput.get("value").trim(),
|
|
|
|
|
- project:this.taskData.project,
|
|
|
|
|
- parent:this.taskData.id,
|
|
|
|
|
- taskGroupId:this.taskData.taskGroupId,
|
|
|
|
|
- executor:this.taskSubNewPerson || ""
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- this.actions.save(data,function(json){
|
|
|
|
|
- this.taskSubNewPerson = "";
|
|
|
|
|
- if(json.data.id){
|
|
|
|
|
- //this.actions.taskGet(json.data.id,function(d){
|
|
|
|
|
- this.actions.get(json.data.id,function(d){
|
|
|
|
|
- this.loadSubTaskItem(this.subTaskListContent,d.data);
|
|
|
|
|
- }.bind(this))
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.subTaskNewPerson.addEvent("click",function(){
|
|
|
|
|
+ this.selectPerson(this.subTaskNewPerson,"identity",null,1,
|
|
|
|
|
+ function(json){
|
|
|
|
|
+ if(json.length>0){
|
|
|
|
|
+ this.taskSubNewPerson = json[0];
|
|
|
|
|
+ this.loadSubTaskPerson(this.subTaskNewPerson,json[0],true)
|
|
|
|
|
+ }
|
|
|
|
|
+ }.bind(this)
|
|
|
|
|
+ );
|
|
|
|
|
+ }.bind(this));
|
|
|
|
|
+ this.subTaskNewAction = new Element("div.subTaskNewAction",{styles:this.css.subTaskNewAction}).inject(this.subTaskNewContainer);
|
|
|
|
|
+ this.subTaskNewCancel = new Element("div.subTaskNewCancel",{styles:this.css.subTaskNewCancel,text:this.lp.cancel}).inject(this.subTaskNewAction);
|
|
|
|
|
+ this.subTaskNewCancel.addEvents({
|
|
|
|
|
+ click:function(){
|
|
|
this.subTaskNewContent.show();
|
|
this.subTaskNewContent.show();
|
|
|
- this.subTaskNewContainer.destroy();
|
|
|
|
|
|
|
+ this.subTaskNewContainer.destroy()
|
|
|
|
|
+ }.bind(this),
|
|
|
|
|
+ mouseover:function(){
|
|
|
|
|
+ this.setStyles({"color":"#4A90E2"})
|
|
|
|
|
+ },
|
|
|
|
|
+ mouseout:function(){
|
|
|
|
|
+ this.setStyles({"color":"#666666"})
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ this.subTaskNewOK = new Element("div.subTaskNewOK",{styles:this.css.subTaskNewOK,text:this.lp.save}).inject(this.subTaskNewAction);
|
|
|
|
|
+ this.subTaskNewOK.addEvents({
|
|
|
|
|
+ click:function(){
|
|
|
|
|
+ if(this.subTaskNewInput.get("value").trim()=="") return;
|
|
|
|
|
+ var data = {
|
|
|
|
|
+ name:this.subTaskNewInput.get("value").trim(),
|
|
|
|
|
+ project:this.taskData.project,
|
|
|
|
|
+ parent:this.taskData.id,
|
|
|
|
|
+ taskGroupId:this.taskData.taskGroupId,
|
|
|
|
|
+ executor:this.taskSubNewPerson || ""
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ this.actions.save(data,function(json){
|
|
|
|
|
+ this.taskSubNewPerson = "";
|
|
|
|
|
+ if(json.data.id){
|
|
|
|
|
+ //this.actions.taskGet(json.data.id,function(d){
|
|
|
|
|
+ this.actions.get(json.data.id,function(d){
|
|
|
|
|
+ this.loadSubTaskItem(this.subTaskListContent,d.data);
|
|
|
|
|
+ }.bind(this))
|
|
|
|
|
+ }
|
|
|
|
|
+ this.subTaskNewContent.show();
|
|
|
|
|
+ this.subTaskNewContainer.destroy();
|
|
|
|
|
|
|
|
- if(json.data.dynamics){
|
|
|
|
|
- json.data.dynamics.each(function(dd){
|
|
|
|
|
- this.loadDynamicItem(dd,"bottom")
|
|
|
|
|
- }.bind(this));
|
|
|
|
|
- }
|
|
|
|
|
- this.dynamicContent.scrollTo(0,this.dynamicContent.getScrollSize().y);
|
|
|
|
|
|
|
+ if(json.data.dynamics){
|
|
|
|
|
+ json.data.dynamics.each(function(dd){
|
|
|
|
|
+ this.loadDynamicItem(dd,"bottom")
|
|
|
|
|
+ }.bind(this));
|
|
|
|
|
+ }
|
|
|
|
|
+ this.dynamicContent.scrollTo(0,this.dynamicContent.getScrollSize().y);
|
|
|
|
|
|
|
|
- }.bind(this))
|
|
|
|
|
- }.bind(this)
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ }.bind(this))
|
|
|
|
|
+ }.bind(this)
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ }.bind(this)
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- }.bind(this)
|
|
|
|
|
- });
|
|
|
|
|
},
|
|
},
|
|
|
loadSubTask:function(){
|
|
loadSubTask:function(){
|
|
|
var node = this.subTaskListContent;
|
|
var node = this.subTaskListContent;
|
|
@@ -1718,6 +1740,7 @@ MWF.xApplication.TeamWork.Task.TaskMore = new Class({
|
|
|
var _self = this;
|
|
var _self = this;
|
|
|
this.css = this.options.css;
|
|
this.css = this.options.css;
|
|
|
this.lp = this.options.lp;
|
|
this.lp = this.options.lp;
|
|
|
|
|
+ //alert(JSON.stringify(this.data))
|
|
|
//this.data
|
|
//this.data
|
|
|
//this.contentNode
|
|
//this.contentNode
|
|
|
//debugger;
|
|
//debugger;
|
|
@@ -1809,26 +1832,27 @@ MWF.xApplication.TeamWork.Task.TaskMore = new Class({
|
|
|
subTaskIcon.setStyles({"background":"url(../x_component_TeamWork/$Task/default/icon/tasksub.png) no-repeat center"});
|
|
subTaskIcon.setStyles({"background":"url(../x_component_TeamWork/$Task/default/icon/tasksub.png) no-repeat center"});
|
|
|
var subTaskText = new Element("div.subTaskText",{styles:this.css.topMoreItemText,text:this.lp.taskSub}).inject(subTask);
|
|
var subTaskText = new Element("div.subTaskText",{styles:this.css.topMoreItemText,text:this.lp.taskSub}).inject(subTask);
|
|
|
|
|
|
|
|
- var removeTask = new Element("div.removeTask",{styles:this.css.topMoreItem}).inject(this.contentNode);
|
|
|
|
|
- removeTask.addEvents({
|
|
|
|
|
- click:function(e){
|
|
|
|
|
- _self.app.confirm("warn",e,_self.app.lp.common.confirm.removeTitle,_self.app.lp.common.confirm.removeContent,300,120,function(){
|
|
|
|
|
- _self.rootActions.TaskAction.delete(_self.data.data.id,function(){
|
|
|
|
|
- var rd = {"act":"remove"};
|
|
|
|
|
- _self.close(rd);
|
|
|
|
|
- this.close()
|
|
|
|
|
- }.bind(this))
|
|
|
|
|
- },function(){
|
|
|
|
|
- this.close();
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- mouseenter:function(){this.setStyles({"background-color":"#F7F7F7"})},
|
|
|
|
|
- mouseleave:function(){this.setStyles({"background-color":""})}
|
|
|
|
|
- });
|
|
|
|
|
- var removeTaskIcon = new Element("div.removeTaskIcon",{styles:this.css.topMoreItemIcon}).inject(removeTask);
|
|
|
|
|
- removeTaskIcon.setStyles({"background":"url(../x_component_TeamWork/$Task/default/icon/taskremove.png) no-repeat center"});
|
|
|
|
|
- var removeTaskText = new Element("div.removeTaskText",{styles:this.css.topMoreItemText,text:this.lp.taskRemove}).inject(removeTask);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ if(this.data.data.control && this.data.data.control.delete){
|
|
|
|
|
+ var removeTask = new Element("div.removeTask",{styles:this.css.topMoreItem}).inject(this.contentNode);
|
|
|
|
|
+ removeTask.addEvents({
|
|
|
|
|
+ click:function(e){
|
|
|
|
|
+ _self.app.confirm("warn",e,_self.app.lp.common.confirm.removeTitle,_self.app.lp.common.confirm.removeContent,300,120,function(){
|
|
|
|
|
+ _self.rootActions.TaskAction.delete(_self.data.data.id,function(){
|
|
|
|
|
+ var rd = {"act":"remove"};
|
|
|
|
|
+ _self.close(rd);
|
|
|
|
|
+ this.close()
|
|
|
|
|
+ }.bind(this))
|
|
|
|
|
+ },function(){
|
|
|
|
|
+ this.close();
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ mouseenter:function(){this.setStyles({"background-color":"#F7F7F7"})},
|
|
|
|
|
+ mouseleave:function(){this.setStyles({"background-color":""})}
|
|
|
|
|
+ });
|
|
|
|
|
+ var removeTaskIcon = new Element("div.removeTaskIcon",{styles:this.css.topMoreItemIcon}).inject(removeTask);
|
|
|
|
|
+ removeTaskIcon.setStyles({"background":"url(../x_component_TeamWork/$Task/default/icon/taskremove.png) no-repeat center"});
|
|
|
|
|
+ var removeTaskText = new Element("div.removeTaskText",{styles:this.css.topMoreItemText,text:this.lp.taskRemove}).inject(removeTask);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
if(callback)callback();
|
|
if(callback)callback();
|
|
|
}
|
|
}
|
|
@@ -1911,6 +1935,7 @@ MWF.xApplication.TeamWork.Task.PriorityCheck = new Class({
|
|
|
var _self = this;
|
|
var _self = this;
|
|
|
this.css = this.options.css;
|
|
this.css = this.options.css;
|
|
|
this.lp = this.options.lp;
|
|
this.lp = this.options.lp;
|
|
|
|
|
+ this.rootActions = this.app.rootActions;
|
|
|
//this.data
|
|
//this.data
|
|
|
//this.contentNode
|
|
//this.contentNode
|
|
|
|
|
|
|
@@ -1920,9 +1945,9 @@ MWF.xApplication.TeamWork.Task.PriorityCheck = new Class({
|
|
|
"width":"100%"
|
|
"width":"100%"
|
|
|
};
|
|
};
|
|
|
var text={
|
|
var text={
|
|
|
- "height":"25px","line-height":"25px","float":"left","width":"50px","text-align":"center",
|
|
|
|
|
|
|
+ "height":"25px","line-height":"25px","float":"left","text-align":"center",
|
|
|
"margin-left":"6px","margin-top":"8px",
|
|
"margin-left":"6px","margin-top":"8px",
|
|
|
- "font-size":"13px","color":"#666666","border-radius":"2px"
|
|
|
|
|
|
|
+ "font-size":"13px","color":"#666666","border-radius":"2px","padding-left":"10px","padding-right":"10px"
|
|
|
};
|
|
};
|
|
|
var icon = {
|
|
var icon = {
|
|
|
"float":"right","width":"24px","height":"24px",
|
|
"float":"right","width":"24px","height":"24px",
|
|
@@ -1930,52 +1955,83 @@ MWF.xApplication.TeamWork.Task.PriorityCheck = new Class({
|
|
|
"background":"url(../x_component_TeamWork/$Task/default/icon/icon_dagou.png) no-repeat center"
|
|
"background":"url(../x_component_TeamWork/$Task/default/icon/icon_dagou.png) no-repeat center"
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- var normalContainer = new Element("div",{styles:container}).inject(this.contentNode);
|
|
|
|
|
- var normalText = new Element("div",{styles:text,text:this.lp.priority.normal}).inject(normalContainer);
|
|
|
|
|
- normalText.setStyles({"color":"#999999","border":"1px solid #999999"});
|
|
|
|
|
- if(this.data.data.priority == this.lp.priority.normal){
|
|
|
|
|
- new Element("div",{styles:icon}).inject(normalContainer);
|
|
|
|
|
- }
|
|
|
|
|
- normalContainer.addEvents({
|
|
|
|
|
- click:function(){
|
|
|
|
|
- var data = {"value":this.lp.priority.normal};
|
|
|
|
|
- this.close(data)
|
|
|
|
|
- }.bind(this),
|
|
|
|
|
- mouseover:function(){this.setStyles({"background-color":"#f2f5f7"})},
|
|
|
|
|
- mouseout:function(){this.setStyles({"background-color":""})}
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ var arr = this.data.data.priority.split("||");
|
|
|
|
|
+ var priorityName = arr[0];
|
|
|
|
|
+ var priorityColor = arr[1];
|
|
|
|
|
|
|
|
- var urgencyContainer = new Element("div",{styles:container}).inject(this.contentNode);
|
|
|
|
|
- var urgencyText = new Element("div",{styles:text,text:this.lp.priority.urgency}).inject(urgencyContainer);
|
|
|
|
|
- urgencyText.setStyles({"color":"#ffaf38","border":"1px solid #ffaf38"});
|
|
|
|
|
- if(this.data.data.priority == this.lp.priority.urgency){
|
|
|
|
|
- new Element("div",{styles:icon}).inject(urgencyContainer);
|
|
|
|
|
- }
|
|
|
|
|
- urgencyContainer.addEvents({
|
|
|
|
|
- click:function(){
|
|
|
|
|
- var data = {"value":this.lp.priority.urgency};
|
|
|
|
|
- this.close(data)
|
|
|
|
|
- }.bind(this),
|
|
|
|
|
- mouseover:function(){this.setStyles({"background-color":"#f2f5f7"})},
|
|
|
|
|
- mouseout:function(){this.setStyles({"background-color":""})}
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- var emergencyContainer = new Element("div",{styles:container}).inject(this.contentNode);
|
|
|
|
|
- var emergencyText = new Element("div",{styles:text,text:this.lp.priority.emergency}).inject(emergencyContainer);
|
|
|
|
|
- emergencyText.setStyles({"color":"#ff4f3e","border":"1px solid #ff4f3e"});
|
|
|
|
|
- if(this.data.data.priority == this.lp.priority.emergency){
|
|
|
|
|
- new Element("div",{styles:icon}).inject(emergencyContainer);
|
|
|
|
|
- }
|
|
|
|
|
- emergencyContainer.addEvents({
|
|
|
|
|
- click:function(){
|
|
|
|
|
- var data = {"value":this.lp.priority.emergency};
|
|
|
|
|
- this.close(data)
|
|
|
|
|
- }.bind(this),
|
|
|
|
|
- mouseover:function(){this.setStyles({"background-color":"#f2f5f7"})},
|
|
|
|
|
- mouseout:function(){this.setStyles({"background-color":""})}
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ this.rootActions.GlobalAction.priorityList(function(json){
|
|
|
|
|
+ json.data.each(function(data){
|
|
|
|
|
+ var vContainer = new Element("div",{styles:container}).inject(this.contentNode);
|
|
|
|
|
+ var value = new Element("div",{styles:text,text:data.priority}).inject(vContainer);
|
|
|
|
|
+ value.setStyles({"color":data.priorityColor,"border":"1px solid "+ data.priorityColor});
|
|
|
|
|
+ if(priorityName == data.priority && priorityColor.toUpperCase() == data.priorityColor.toUpperCase()){
|
|
|
|
|
+ new Element("div",{styles:icon}).inject(vContainer);
|
|
|
|
|
+ }
|
|
|
|
|
+ vContainer.addEvents({
|
|
|
|
|
+ click:function(){
|
|
|
|
|
+ var d = {"value":data.priority+"||"+data.priorityColor};
|
|
|
|
|
+ this.close(d)
|
|
|
|
|
+ }.bind(this),
|
|
|
|
|
+ mouseover:function(){this.setStyles({"background-color":"#f2f5f7"})},
|
|
|
|
|
+ mouseout:function(){this.setStyles({"background-color":""})}
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
|
|
+ }.bind(this))
|
|
|
|
|
+ }.bind(this));
|
|
|
if(callback)callback();
|
|
if(callback)callback();
|
|
|
|
|
+ return;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // var normalContainer = new Element("div",{styles:container}).inject(this.contentNode);
|
|
|
|
|
+ // var normalText = new Element("div",{styles:text,text:this.lp.priority.normal}).inject(normalContainer);
|
|
|
|
|
+ // normalText.setStyles({"color":"#999999","border":"1px solid #999999"});
|
|
|
|
|
+ // if(this.data.data.priority == this.lp.priority.normal){
|
|
|
|
|
+ // new Element("div",{styles:icon}).inject(normalContainer);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // normalContainer.addEvents({
|
|
|
|
|
+ // click:function(){
|
|
|
|
|
+ // var data = {"value":this.lp.priority.normal};
|
|
|
|
|
+ // this.close(data)
|
|
|
|
|
+ // }.bind(this),
|
|
|
|
|
+ // mouseover:function(){this.setStyles({"background-color":"#f2f5f7"})},
|
|
|
|
|
+ // mouseout:function(){this.setStyles({"background-color":""})}
|
|
|
|
|
+ // });
|
|
|
|
|
+ //
|
|
|
|
|
+ // var urgencyContainer = new Element("div",{styles:container}).inject(this.contentNode);
|
|
|
|
|
+ // var urgencyText = new Element("div",{styles:text,text:this.lp.priority.urgency}).inject(urgencyContainer);
|
|
|
|
|
+ // urgencyText.setStyles({"color":"#ffaf38","border":"1px solid #ffaf38"});
|
|
|
|
|
+ // if(this.data.data.priority == this.lp.priority.urgency){
|
|
|
|
|
+ // new Element("div",{styles:icon}).inject(urgencyContainer);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // urgencyContainer.addEvents({
|
|
|
|
|
+ // click:function(){
|
|
|
|
|
+ // var data = {"value":this.lp.priority.urgency};
|
|
|
|
|
+ // this.close(data)
|
|
|
|
|
+ // }.bind(this),
|
|
|
|
|
+ // mouseover:function(){this.setStyles({"background-color":"#f2f5f7"})},
|
|
|
|
|
+ // mouseout:function(){this.setStyles({"background-color":""})}
|
|
|
|
|
+ // });
|
|
|
|
|
+ //
|
|
|
|
|
+ // var emergencyContainer = new Element("div",{styles:container}).inject(this.contentNode);
|
|
|
|
|
+ // var emergencyText = new Element("div",{styles:text,text:this.lp.priority.emergency}).inject(emergencyContainer);
|
|
|
|
|
+ // emergencyText.setStyles({"color":"#ff4f3e","border":"1px solid #ff4f3e"});
|
|
|
|
|
+ // if(this.data.data.priority == this.lp.priority.emergency){
|
|
|
|
|
+ // new Element("div",{styles:icon}).inject(emergencyContainer);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // emergencyContainer.addEvents({
|
|
|
|
|
+ // click:function(){
|
|
|
|
|
+ // var data = {"value":this.lp.priority.emergency};
|
|
|
|
|
+ // this.close(data)
|
|
|
|
|
+ // }.bind(this),
|
|
|
|
|
+ // mouseover:function(){this.setStyles({"background-color":"#f2f5f7"})},
|
|
|
|
|
+ // mouseout:function(){this.setStyles({"background-color":""})}
|
|
|
|
|
+ // });
|
|
|
|
|
+ //
|
|
|
|
|
+ // if(callback)callback();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
});
|
|
});
|