diff --git a/o2web/source/x_component_TeamWork/$NewProject/default/css.wcss b/o2web/source/x_component_TeamWork/$NewProject/default/css.wcss
index b7be62fcba7a417f219ba367916228072efbc202..bcfbe1a9b2359f600c8d835dc5fca4ce7b0b3ef9 100644
--- a/o2web/source/x_component_TeamWork/$NewProject/default/css.wcss
+++ b/o2web/source/x_component_TeamWork/$NewProject/default/css.wcss
@@ -43,18 +43,17 @@
"margin-top":"10px",
"width":"80%",
"margin":"20px auto",
- "height":"36px",
+ "height":"80px",
"border-radius": "10px",
- "border":"1px solid #DEDEDE",
- "padding-top":"5px"
+ "border":"1px solid #DEDEDE"
},
newProjectDesIn:{
"overflow":"auto",
"border":"0px",
- "height":"32px",
- "line-height":"32px",
+ "height":"75px",
+ "line-height":"16px",
"width":"92%",
- "margin-left":"10px",
+ "margin-left":"5px",
"font-size":"12px",
"color":"#666666",
"outline":"none",
@@ -137,17 +136,18 @@
"topTemplateTitle":{
"width":"100%",
"height":"30px",
+ "font-size":"14px",
+ "padding-left":"4px",
"line-height":"30px",
"border-bottom":"1px solid #cccccc"
},
"tempateContainer":{
"width":"100%",
- "height":"400px",
"overflow-y":"auto"
},
"templateItemContainer":{
"width":"100%",
- "height":"30px",
+ "height":"40px",
"background-color":"#ffffff",
"border-bottom":"1px dashed #cccccc",
"cursor":"pointer"
@@ -155,16 +155,16 @@
"templateItemIcon":{
"float":"left",
"width":"20px",
- "height":"30px",
+ "height":"40px",
"background-repeat":"no-repeat",
"background-position":"center"
},
"templateItemTitle":{
"float":"left",
"width":"200px",
- "height":"30px",
- "line-height":"30px",
+ "height":"40px",
+ "line-height":"40px",
"color":"rgb(102, 102, 102)",
- "font-size":"12px"
+ "font-size":"14px"
}
}
\ No newline at end of file
diff --git a/o2web/source/x_component_TeamWork/Bam.js b/o2web/source/x_component_TeamWork/Bam.js
index b16cf9108e7aa67b0cc070705ce441736fd0da62..b7f474434ef76cc1aaad2d87f5cb236d413f891d 100644
--- a/o2web/source/x_component_TeamWork/Bam.js
+++ b/o2web/source/x_component_TeamWork/Bam.js
@@ -105,6 +105,7 @@ MWF.xApplication.TeamWork.Bam = new Class({
new Element("div.priorityIcon",{ styles: this.css.priorityIcon }).inject(this.priorityDiv);
new Element("div.priorityText",{styles: this.css.priorityText, text: this.lp.navi.priority}).inject(this.priorityDiv);
+ /*
//自定义字段
this.fieldDiv = new Element("div.fieldDiv",{styles:this.css.naviItem}).inject(this.naviLayout);
this.fieldDiv.addEvents({
@@ -146,7 +147,7 @@ MWF.xApplication.TeamWork.Bam = new Class({
});
new Element("div.accessIcon",{ styles: this.css.accessIcon }).inject(this.accessDiv);
new Element("div.accessText",{styles: this.css.accessText, text: this.lp.navi.access}).inject(this.accessDiv);
-
+ */
},
createContentLayout:function(){
this.contentLayout = new Element("div.contentLayout",{styles:this.css.contentLayout}).inject(this.containerLayout);
diff --git a/o2web/source/x_component_TeamWork/NewProject.js b/o2web/source/x_component_TeamWork/NewProject.js
index ee76d47d0b299cc281541ad81596ce22fcc69939..35d6c5681982c2260779468f5d3c4135693ff6ae 100644
--- a/o2web/source/x_component_TeamWork/NewProject.js
+++ b/o2web/source/x_component_TeamWork/NewProject.js
@@ -64,43 +64,44 @@ MWF.xApplication.TeamWork.NewProject = new Class({
this.newProjectDesIn = new Element("textarea.newProjectDesIn",{styles:this.css.newProjectDesIn,placeholder:this.lp.description}).inject(this.newProjectDesContainer);
this.newProjectDesIn.addEvents({
focus:function(){ //32px
- var v = this.newProjectDesIn.get("value");
- if(v.trim()==""){
- this.newProjectDesIn.setStyle("line-height","");
- var _h = 36;
- this.newProjectDesContainer.setStyles({"height":(this.newProjectDesContainer.getHeight()+_h)+"px"});
- this.newProjectDesIn.setStyles({"height":(this.newProjectDesIn.getHeight()+_h-2)+"px"});
- this.formAreaNode.setStyles({"height":(this.formAreaNode.getHeight()+_h)+"px"});
- this.formNode.setStyles({"height":(this.formNode.getHeight()+_h)+"px"});
- this.formTableContainer.setStyles({"height":(this.formTableContainer.getHeight()+_h)+"px"});
- this.formTableArea.setStyles({"height":(this.formTableArea.getHeight()+_h)+"px"});
- this.formContentNode.setStyles({"height":(this.formContentNode.getHeight()+_h)+"px"});
-
- var pre = this.formTableContainer.getPrevious();
- if(pre){
- pre.destroy();
- }
- }
+ // var v = this.newProjectDesIn.get("value");
+ // if(v.trim()==""){ return;
+ // //this.newProjectDesIn.setStyle("line-height","");
+ // var _h = 36;
+ // //alert(this.newProjectDesContainer.getHeight()+_h)
+ // this.newProjectDesContainer.setStyles({"height":(this.newProjectDesContainer.getHeight()+_h)+"px"});
+ // this.newProjectDesIn.setStyles({"height":(this.newProjectDesIn.getHeight()+_h)+"px"});
+ // this.formAreaNode.setStyles({"height":(this.formAreaNode.getHeight()+_h)+"px"});
+ // this.formNode.setStyles({"height":(this.formNode.getHeight()+_h)+"px"});
+ // this.formTableContainer.setStyles({"height":(this.formTableContainer.getHeight()+_h)+"px"});
+ // this.formTableArea.setStyles({"height":(this.formTableArea.getHeight()+_h)+"px"});
+ // this.formContentNode.setStyles({"height":(this.formContentNode.getHeight()+_h)+"px"});
+ //
+ // var pre = this.formTableContainer.getPrevious();
+ // if(pre){
+ // pre.destroy();
+ // }
+ // }
this.newProjectDesContainer.setStyles({"border":"1px solid #4A90E2"});
}.bind(this),
blur:function(){
- var v = this.newProjectDesIn.get("value");
- if(v.trim()==""){
- this.newProjectDesIn.setStyle("line-height","32px");
- var _h = 36;
- this.newProjectDesContainer.setStyles({"height":(this.newProjectDesContainer.getHeight()-_h)+"px"});
- this.newProjectDesIn.setStyles({"height":(this.newProjectDesIn.getHeight()-_h-2)+"px"});
- this.formAreaNode.setStyles({"height":(this.formAreaNode.getHeight()-_h)+"px"});
- this.formNode.setStyles({"height":(this.formNode.getHeight()-_h)+"px"});
- this.formTableContainer.setStyles({"height":(this.formTableContainer.getHeight()-_h)+"px"});
- this.formTableArea.setStyles({"height":(this.formTableArea.getHeight()-_h)+"px"});
- this.formContentNode.setStyles({"height":(this.formContentNode.getHeight()-_h)+"px"});
-
- var pre = this.formTableContainer.getPrevious();
- if(pre){
- pre.destroy();
- }
- }
+ // var v = this.newProjectDesIn.get("value");
+ // if(v.trim()==""){ return;
+ // //this.newProjectDesIn.setStyle("line-height","32px");
+ // var _h = 36;
+ // this.newProjectDesContainer.setStyles({"height":(this.newProjectDesContainer.getHeight()-_h-2)+"px"});
+ // this.newProjectDesIn.setStyles({"height":(this.newProjectDesIn.getHeight()-_h-2)+"px"});
+ // this.formAreaNode.setStyles({"height":(this.formAreaNode.getHeight()-_h)+"px"});
+ // this.formNode.setStyles({"height":(this.formNode.getHeight()-_h)+"px"});
+ // this.formTableContainer.setStyles({"height":(this.formTableContainer.getHeight()-_h)+"px"});
+ // this.formTableArea.setStyles({"height":(this.formTableArea.getHeight()-_h)+"px"});
+ // this.formContentNode.setStyles({"height":(this.formContentNode.getHeight()-_h)+"px"});
+ //
+ // var pre = this.formTableContainer.getPrevious();
+ // if(pre){
+ // pre.destroy();
+ // }
+ // }
this.newProjectDesContainer.setStyles({"border":"1px solid #A6A6A6"});
}.bind(this)
});
@@ -166,7 +167,8 @@ MWF.xApplication.TeamWork.NewProject = new Class({
"padding":"2px",
"border-radius":"5px",
"box-shadow":"0px 0px 4px 0px #999999",
- "z-index" : "201"
+ "z-index" : "201",
+ "min-height":"250px"
},
onPostLoad:function(){
tm.node.setStyles({"opacity":"0","top":(tm.node.getStyle("top").toInt()+4)+"px"});
@@ -238,7 +240,6 @@ MWF.xApplication.TeamWork.NewProject = new Class({
}.bind(this))
}
-
});
diff --git a/o2web/source/x_component_TeamWork/Project.js b/o2web/source/x_component_TeamWork/Project.js
index 2f57c94098383d8fb83d5e765ac96fd79802ab22..4cd6cf19f02c72a0900e947f2583677322390f8c 100644
--- a/o2web/source/x_component_TeamWork/Project.js
+++ b/o2web/source/x_component_TeamWork/Project.js
@@ -30,15 +30,19 @@ MWF.xApplication.TeamWork.Project = new Class({
this.data = data;
},
load: function () {
- this.actions.get(this.data.id,function(json){ debugger ;})
-
this.container.setStyles({display:"flex"});
this.container.empty();
this.createTopBarLayout();
this.createContentLayout();
- this.topBarTabItemTask.click();
+
+ this.actions.get(this.data.id,function(json){
+ //debugger;
+ this.data = json.data;
+ this.topBarTabItemTask.click();
+ }.bind(this))
+ // this.topBarTabItemTask.click();
},
createTopBarLayout:function(){
var _self = this;
@@ -258,6 +262,7 @@ MWF.xApplication.TeamWork.Project = new Class({
this.naviTopTaskContainer = new Element("div.naviTopTaskContainer",{styles:this.css.naviTopTaskContainer}).inject(this.naviTop);
this.naviTopTaskText = new Element("div.naviTopTaskText",{styles:this.css.naviTopTaskText,text:this.lp.task}).inject(this.naviTopTaskContainer);
+
this.naviTopTaskAdd = new Element("div.naviTopTaskAdd",{styles:this.css.naviTopTaskAdd}).inject(this.naviTopTaskContainer);
this.naviTopTaskAdd.addEvents({
click:function(){
@@ -290,6 +295,11 @@ MWF.xApplication.TeamWork.Project = new Class({
}.bind(this)
});
+ if(this.data.control && this.data.control.taskCreate == false){
+ this.naviTopTaskAdd.destroy();
+ delete this.naviTopTaskAdd;
+ }
+
this.naviTopMyTaskLayout = new Element("div.naviTopMyTaskLayout",{styles:this.css.naviTopMyTaskLayout}).inject(this.naviTop);
this.naviTopMyTaskLayout.addEvents({
click:function(){
@@ -541,33 +551,38 @@ MWF.xApplication.TeamWork.Project = new Class({
this.createTaskGroupItemLayout(taskGroupLayout,data);
}.bind(this));
//新建任务列表按钮
- this.newTaskGroupContainer = new Element("div.newTaskGroupContainer",{styles:this.css.newTaskGroupContainer}).inject(this.taskContentLayout);
- this.newTaskGroupContainer.addEvents({
- click:function(){
- var data = {
- isNew:true,
- taskGroupId:this.currentProjectGroupData.id,
- projectId:this.data.id
- };
- var opt = {
- onCreateTask:function(){
- this.createTaskGroup();
- }.bind(this)
- };
- var newTaskGroup = new MWF.xApplication.TeamWork.Project.NewTaskGroup(this,data,opt,{});
- newTaskGroup.open();
- }.bind(this),
- mouseover:function(){
- this.newTaskGroupIcon.setStyles({"background-image":"url(../x_component_TeamWork/$Project/default/icon/icon_jia_20_click.png)"});
- this.newTaskGroupText.setStyles({"color":"#4A90E2","font-size":"16px"});
- }.bind(this),
- mouseout:function(){
- this.newTaskGroupIcon.setStyles({"background-image":"url(../x_component_TeamWork/$Project/default/icon/icon_jia.png)"});
- this.newTaskGroupText.setStyles({"color":"#999999","font-size":"12px"});
- }.bind(this)
- });
- this.newTaskGroupIcon = new Element("div.newTaskGroupIcon",{styles:this.css.newTaskGroupIcon}).inject(this.newTaskGroupContainer);
- this.newTaskGroupText = new Element("div.newTaskGroupText",{styles:this.css.newTaskGroupText,text:this.lp.taskGroupAdd}).inject(this.newTaskGroupContainer);
+
+ if(!this.data.deleted && !this.data.completed){
+ //权限 已完成已删除不能新建
+ this.newTaskGroupContainer = new Element("div.newTaskGroupContainer",{styles:this.css.newTaskGroupContainer}).inject(this.taskContentLayout);
+ this.newTaskGroupContainer.addEvents({
+ click:function(){
+ var data = {
+ isNew:true,
+ taskGroupId:this.currentProjectGroupData.id,
+ projectId:this.data.id
+ };
+ var opt = {
+ onCreateTask:function(){
+ this.createTaskGroup();
+ }.bind(this)
+ };
+ var newTaskGroup = new MWF.xApplication.TeamWork.Project.NewTaskGroup(this,data,opt,{});
+ newTaskGroup.open();
+ }.bind(this),
+ mouseover:function(){
+ this.newTaskGroupIcon.setStyles({"background-image":"url(../x_component_TeamWork/$Project/default/icon/icon_jia_20_click.png)"});
+ this.newTaskGroupText.setStyles({"color":"#4A90E2","font-size":"16px"});
+ }.bind(this),
+ mouseout:function(){
+ this.newTaskGroupIcon.setStyles({"background-image":"url(../x_component_TeamWork/$Project/default/icon/icon_jia.png)"});
+ this.newTaskGroupText.setStyles({"color":"#999999","font-size":"12px"});
+ }.bind(this)
+ });
+ this.newTaskGroupIcon = new Element("div.newTaskGroupIcon",{styles:this.css.newTaskGroupIcon}).inject(this.newTaskGroupContainer);
+ this.newTaskGroupText = new Element("div.newTaskGroupText",{styles:this.css.newTaskGroupText,text:this.lp.taskGroupAdd}).inject(this.newTaskGroupContainer);
+ }
+
}.bind(this))
}
},
@@ -632,6 +647,10 @@ MWF.xApplication.TeamWork.Project = new Class({
mouseover:function(){this.setStyles({"background-image":"url(../x_component_TeamWork/$Project/default/icon/icon_zengjia_blue2_click.png)"})},
mouseout:function(){this.setStyles({"background-image":"url(../x_component_TeamWork/$Project/default/icon/icon_jia.png)"})}
});
+ if(this.data.control && this.data.control.taskCreate == false){
+ taskGroupItemTitleAdd.destroy();
+ delete taskGroupItemTitleAdd
+ }
var taskGroupItemTitleReload = new Element("div.taskGroupItemTitleReload",{styles:this.css.taskGroupItemTitleReload, title:this.lp.reload}).inject(taskGroupItemTitleContainer);
//if(!data.control.sortable) taskGroupItemTitleAdd.setStyle("margin-right","20px");
@@ -824,7 +843,7 @@ MWF.xApplication.TeamWork.Project = new Class({
//alert("taskid="+taskId+",taskInId="+taskInId+",taskgroupFromid="+taskGroupFromId+",taskGroupInId="+taskGroupInId);
if(taskGroupInSortable == "false"){
//未分类视图不允许移入,还原并删除el对象
- _self.app.notice("未分类列表不允许移入","error");
+ //_self.app.notice("未分类列表不允许移入","error");
taskItemContainer.setStyles({"border":"1px solid #e6e6e6","opacity":"1"});
if(pre && pre.get("class")=="taskItemInsertLine"){
pre.destroy();
@@ -915,10 +934,12 @@ MWF.xApplication.TeamWork.Project = new Class({
loadTaskNode:function(taskItemContainer,d){
taskItemContainer.empty();
-
+ var color = d.priority ? d.priority.split("||")[1] || "#DEDEDE" : "#DEDEDE";
+ //var color = d.priority.split("||")[1] || "#DEDEDE";
var taskItemHover = new Element("div.taskItemHover",{styles:this.css.taskItemHover}).inject(taskItemContainer);
- if(d.priority == this.lp.urgency)taskItemHover.setStyle("background-color","#ffaf38");
- else if(d.priority == this.lp.emergency)taskItemHover.setStyle("background-color","#ff0000");
+ taskItemHover.setStyles({"background-color":color});
+ // if(d.priority == this.lp.urgency)taskItemHover.setStyle("background-color","#ffaf38");
+ // else if(d.priority == this.lp.emergency)taskItemHover.setStyle("background-color","#ff0000");
var taskItemContent = new Element("div.taskItemContent",{styles:this.css.taskItemContent}).inject(taskItemContainer);
var taskItemTitle = new Element("div.taskItemTitle",{styles:this.css.taskItemTitle}).inject(taskItemContent);
var taskItemName = new Element("div.taskItemName",{styles:this.css.taskItemName,text:d.name}).inject(taskItemTitle);
@@ -1196,7 +1217,7 @@ MWF.xApplication.TeamWork.Project = new Class({
}
var viewName = new Element("div.viewName",{styles:this.css.viewName,text:data.name}).inject(viewItem);
- var viewStatus = new Element("div.viewStatus",{styles:this.css.viewStatus,text:data.priority}).inject(viewItem);
+ var viewStatus = new Element("div.viewStatus",{styles:this.css.viewStatus,text:data.priority?data.priority.split("||")[0]:""}).inject(viewItem);
var viewDuty = new Element("div.viewDuty",{styles:this.css.viewDuty}).inject(viewItem);
var viewDutyIcon = new Element("div.viewDutyIcon",{styles:this.css.viewDutyIcon}).inject(viewDuty);
if(data.executor && data.executor!=""){
diff --git a/o2web/source/x_component_TeamWork/ProjectList.js b/o2web/source/x_component_TeamWork/ProjectList.js
index 7edd2cacfa6bc3cf39cb6b8bdb0982bf0292a3ba..c68de72206aa64f9347df9df6a28acd285fa9cea 100644
--- a/o2web/source/x_component_TeamWork/ProjectList.js
+++ b/o2web/source/x_component_TeamWork/ProjectList.js
@@ -393,7 +393,7 @@ MWF.xApplication.TeamWork.ProjectList = new Class({
addNewProject:function(){
MWF.xDesktop.requireApp("TeamWork", "NewProject", function(){
this.np = new MWF.xApplication.TeamWork.NewProject(this,{},
- {"width": 350,"height": 430,
+ {"width": 350,"height": 470,
onPostOpen:function(){
this.np.formAreaNode.setStyles({"top":"10px"});
var fx = new Fx.Tween(this.np.formAreaNode,{duration:200});
diff --git a/o2web/source/x_component_TeamWork/ProjectSetting.js b/o2web/source/x_component_TeamWork/ProjectSetting.js
index 622ee230aacc0c37e97785663701c5b8f456cee4..791fcbf9d84b3797894e07d651c1176851f4671f 100644
--- a/o2web/source/x_component_TeamWork/ProjectSetting.js
+++ b/o2web/source/x_component_TeamWork/ProjectSetting.js
@@ -555,6 +555,9 @@ MWF.xApplication.TeamWork.ProjectSetting = new Class({
var authTaskTitle = new Element("div.authTaskTitle",{styles:this.css.authTitle,text:this.lp.auth.task}).inject(this.projectSettingLayout);
authTaskTitle.setStyle("margin-top","20px");
var authTaskContainer = new Element("div.authTaskContainer",{styles:this.css.authContainer}).inject(this.projectSettingLayout);
+ //var authCommentTitle = new Element("div.authCommentTitle",{styles:this.css.authTitle,text:this.lp.auth.comment}).inject(this.projectSettingLayout);
+ //authCommentTitle.setStyle("margin-top","20px");
+ //var authCommentContainer = new Element("div.authCommentContainer",{styles:this.css.authContainer}).inject(this.projectSettingLayout);
this.getProjectAuth(this.projectData.id,function(){
@@ -605,6 +608,51 @@ MWF.xApplication.TeamWork.ProjectSetting = new Class({
}.bind(this)
});
+ /*
+ //允许评论
+ commentFlag=this.projectAuthData.hasOwnProperty("comment") ? this.projectAuthData.comment:true;
+
+ var newTaskContainer = new Element("div.authItemContainer",{styles:this.css.authItemContainer}).inject(authTaskContainer);
+ var newTaskIcon = new Element("div.authItemIcon",{styles:this.css.authItemIcon}).inject(newTaskContainer);
+ var newTaskTitle = new Element("div.authItemTitle",{styles:this.css.authItemTitle,text:this.lp.auth.taskCreate}).inject(newTaskContainer);
+
+ if(!taskCreateFlag) newTaskIcon.setStyles({"background-image":"url(/x_component_TeamWork/$ProjectSetting/default/icon/icon_unselected.png)"});
+ else newTaskIcon.setStyles({"background-image":"url(/x_component_TeamWork/$ProjectSetting/default/icon/icon_selected.png)"});
+
+ var isChanged = false;
+ newTaskContainer.addEvents({
+ mouseenter:function(){
+ if(isChanged) return;
+ if(taskCreateFlag){
+ newTaskIcon.setStyles({"background-image":"url(/x_component_TeamWork/$ProjectSetting/default/icon/icon_selected_click.png)"});
+ }else{
+ newTaskIcon.setStyles({"background-image":"url(/x_component_TeamWork/$ProjectSetting/default/icon/icon_unselected_click.png)"});
+ }
+ },
+ mouseleave:function(){
+ if(isChanged) { isChanged = false ; return;}
+ if(taskCreateFlag){
+ newTaskIcon.setStyles({"background-image":"url(/x_component_TeamWork/$ProjectSetting/default/icon/icon_selected.png)"});
+ }else{
+ newTaskIcon.setStyles({"background-image":"url(/x_component_TeamWork/$ProjectSetting/default/icon/icon_unselected.png)"});
+ }
+ },
+ click:function(){
+ if(taskCreateFlag){
+ this.projectAuthData.taskCreate = false;
+ taskCreateFlag = false;
+ newTaskIcon.setStyles({"background-image":"url(/x_component_TeamWork/$ProjectSetting/default/icon/icon_unselected.png)"});
+ }else{
+ this.projectAuthData.taskCreate = true;
+ taskCreateFlag = true;
+ newTaskIcon.setStyles({"background-image":"url(/x_component_TeamWork/$ProjectSetting/default/icon/icon_selected.png)"});
+ }
+
+ this.saveProjectAuth();
+ isChanged = true;
+ }.bind(this)
+ });
+ */
}.bind(this));
},
@@ -614,6 +662,7 @@ MWF.xApplication.TeamWork.ProjectSetting = new Class({
this.projectAuthData = {};
}else{
this.projectAuthData = json.data||{};
+ //alert(JSON.stringify(json.data))
}
if(callback)callback(json)
}.bind(this),function(json){
diff --git a/o2web/source/x_component_TeamWork/Task.js b/o2web/source/x_component_TeamWork/Task.js
index 450345657a0646e431ffcd8e1cc5f7aeb9b4dfba..5e72d6dab2716b1585ac33289c8fac45fee756fe 100644
--- a/o2web/source/x_component_TeamWork/Task.js
+++ b/o2web/source/x_component_TeamWork/Task.js
@@ -124,7 +124,8 @@ MWF.xApplication.TeamWork.Task = new Class({
this.control.isDelete = this.taskData.control.delete;
this.control.isFounder = this.taskData.control.founder;
this.control.isCreate = true;
-
+ //this.control.comment = this.projectData.comment; 目前没启用
+ this.control.comment = true;
if(this.openType == "window"){
@@ -146,46 +147,50 @@ MWF.xApplication.TeamWork.Task = new Class({
this.topIconContainer = new Element("div.topIconContainer",{styles:this.css.topIconContainer}).inject(this.topLayout);
//更多
- this.topIconMore = new Element("div.topIconMore",{styles:this.css.topIconMore,title:this.lp.more}).inject(this.topIconContainer);
- this.topIconMore.addEvents({
- click:function(){
- var tm = new MWF.xApplication.TeamWork.Task.TaskMore(this.container, this.topIconMore, this.app, {data:this.taskData}, {
- css:this.css, lp:this.lp, axis : "y",
- position : { //node 固定的位置
- x : "auto",
- y : "middle"
- },
- nodeStyles : {
- "min-width":"200px",
- "padding":"2px",
- "border-radius":"5px",
- "box-shadow":"0px 0px 4px 0px #999999",
- "z-index" : "201"
- },
- onPostLoad:function(){
- tm.node.setStyles({"opacity":"0","top":(tm.node.getStyle("top").toInt()+4)+"px"});
- var fx = new Fx.Tween(tm.node,{duration:400});
- fx.start(["opacity"] ,"0", "1");
- },
- onClose:function(rd){
- if(!rd) return;
- if(rd.act == "remove"){
- this.close(rd);
- if(this.data.projectObj){ //reload project
- this.data.projectObj.createTaskGroup()
+ //权限
+ if(!this.projectData.deleted && !this.projectData.completed){
+ this.topIconMore = new Element("div.topIconMore",{styles:this.css.topIconMore,title:this.lp.more}).inject(this.topIconContainer);
+ this.topIconMore.addEvents({
+ click:function(){
+ var tm = new MWF.xApplication.TeamWork.Task.TaskMore(this.container, this.topIconMore, this.app, {data:this.taskData}, {
+ css:this.css, lp:this.lp, axis : "y",
+ position : { //node 固定的位置
+ x : "auto",
+ y : "middle"
+ },
+ nodeStyles : {
+ "min-width":"200px",
+ "padding":"2px",
+ "border-radius":"5px",
+ "box-shadow":"0px 0px 4px 0px #999999",
+ "z-index" : "201"
+ },
+ onPostLoad:function(){
+ tm.node.setStyles({"opacity":"0","top":(tm.node.getStyle("top").toInt()+4)+"px"});
+ var fx = new Fx.Tween(tm.node,{duration:400});
+ fx.start(["opacity"] ,"0", "1");
+ },
+ onClose:function(rd){
+ if(!rd) return;
+ if(rd.act == "remove"){
+ this.close(rd);
+ if(this.data.projectObj){ //reload project
+ this.data.projectObj.createTaskGroup()
+ }
}
- }
- }.bind(this)
- },null,this);
- tm.load();
- }.bind(this),
- mouseover:function(){
- this.setStyles({"background-image":"url(../x_component_TeamWork/$Task/default/icon/icon_more_click.png)"});
- },
- mouseout:function(){
- this.setStyles(_self.css.topIconMore)
- }
- });
+ }.bind(this)
+ },null,this);
+ tm.load();
+ }.bind(this),
+ mouseover:function(){
+ this.setStyles({"background-image":"url(../x_component_TeamWork/$Task/default/icon/icon_more_click.png)"});
+ },
+ mouseout:function(){
+ this.setStyles(_self.css.topIconMore)
+ }
+ });
+ }
+
//关闭
this.topIconClose = new Element("div.topIconClose",{styles:this.css.topIconClose,title:this.lp.close}).inject(this.topIconContainer);
this.topIconClose.addEvents({
@@ -574,14 +579,19 @@ MWF.xApplication.TeamWork.Task = new Class({
var node = this.taskChatContainer;
this.chatContent = new Element("div.chatContent",{styles:this.css.chatContent}).inject(node);
this.chatTextarea = new Element("textarea.chatTextarea",{styles:this.css.chatTextarea,placeholder:this.lp.chatPlaceholder}).inject(this.chatContent);
- this.chatTextarea.addEvents({
- keypress:function(e){
- var keycode = (e.event.keyCode ? e.event.keyCode : e.event.which);
- if (e.event.ctrlKey && (keycode == 13 || keycode == 10)) {
- this.chatBarSend.click();
- }
- }.bind(this)
- });
+ if(this.control.comment){
+ this.chatTextarea.addEvents({
+ keypress:function(e){
+ var keycode = (e.event.keyCode ? e.event.keyCode : e.event.which);
+ if (e.event.ctrlKey && (keycode == 13 || keycode == 10)) {
+ this.chatBarSend.click();
+ }
+ }.bind(this)
+ });
+ }else{
+ this.chatTextarea.erase("placeholder");
+ }
+
this.chatBarContent = new Element("div.chatBarContent",{styles:this.css.chatBarContent}).inject(node);
this.chatBarTool = new Element("div.chatBarTool",{styles:this.css.chatBarTool}).inject(this.chatBarContent);
@@ -624,46 +634,52 @@ MWF.xApplication.TeamWork.Task = new Class({
}.bind(this)
});
this.chatBarSend = new Element("div.chatBarSend",{styles:this.css.chatBarSend,text:this.lp.chatSend}).inject(this.chatBarContent);
- this.chatBarSend.addEvents({
- click:function(){
- if(this.chatTextarea.get("value").trim()=="") return;
- var data = {
- taskId : this.taskData.id,
- content : this.chatTextarea.get("value").trim()
- };
-
- //this.actions.chatCreate(data,function(json){
- this.rootActions.ChatAction.create(data,function(json){
- if(json.data.id){
- this.rootActions.ChatAction.get(json.data.id,function(json){
- var person = json.data.sender;
- var content = json.data.content;
-
- var dynamicItem = new Element("div.dynamicItem",{styles:this.css.dynamicItem}).inject(this.dynamicContent);
- var dynamicItemIcon = new Element("div.dynamicItemIcon",{styles:this.css.dynamicItemIcon}).inject(dynamicItem);
- dynamicItemIcon.setStyle("background-image","url(../x_component_TeamWork/$Task/default/icon/icon_chat.png)")
- var dynamicItemText = new Element("div.dynamicItemText",{styles:this.css.dynamicItemText}).inject(dynamicItem);
- new Element("div.dynamicItemUser",{styles:this.css.dynamicItemUser,text:person.split("@")[0]}).inject(dynamicItemText);
-
- var chattext = content.split("\n").join("
");
- for(var item in this.app.lp.emoji){
- var val = this.app.lp.emoji[item];
- chattext = chattext.split("["+val+"]").join('
');
- }
+ if(this.control.comment) {
+ this.chatBarSend.addEvents({
+ click:function(){
+ if(this.chatTextarea.get("value").trim()=="") return;
+ var data = {
+ taskId : this.taskData.id,
+ content : this.chatTextarea.get("value").trim()
+ };
- new Element("div.dynamicItemUserChat",{styles:{"margin-top":"5px"},html:chattext}).inject(dynamicItemText);
+ //this.actions.chatCreate(data,function(json){
+ this.rootActions.ChatAction.create(data,function(json){
+ if(json.data.id){
+ this.rootActions.ChatAction.get(json.data.id,function(json){
+ var person = json.data.sender;
+ var content = json.data.content;
+
+ var dynamicItem = new Element("div.dynamicItem",{styles:this.css.dynamicItem}).inject(this.dynamicContent);
+ var dynamicItemIcon = new Element("div.dynamicItemIcon",{styles:this.css.dynamicItemIcon}).inject(dynamicItem);
+ dynamicItemIcon.setStyle("background-image","url(../x_component_TeamWork/$Task/default/icon/icon_chat.png)")
+ var dynamicItemText = new Element("div.dynamicItemText",{styles:this.css.dynamicItemText}).inject(dynamicItem);
+ new Element("div.dynamicItemUser",{styles:this.css.dynamicItemUser,text:person.split("@")[0]}).inject(dynamicItemText);
+
+ var chattext = content.split("\n").join("
");
+ for(var item in this.app.lp.emoji){
+ var val = this.app.lp.emoji[item];
+ chattext = chattext.split("["+val+"]").join('
');
+ }
- var dynamicItemTime = new Element("div.dynamicItemTime",{styles:this.css.dynamicItemTime}).inject(dynamicItem);
- dynamicItemTime.set("text","刚刚");
- new Element("div.dynamicItemTime",{styles:{"clear":"both"}}).inject(dynamicItem);
+ new Element("div.dynamicItemUserChat",{styles:{"margin-top":"5px"},html:chattext}).inject(dynamicItemText);
+
+ var dynamicItemTime = new Element("div.dynamicItemTime",{styles:this.css.dynamicItemTime}).inject(dynamicItem);
+ dynamicItemTime.set("text","刚刚");
+ new Element("div.dynamicItemTime",{styles:{"clear":"both"}}).inject(dynamicItem);
+
+ this.dynamicContent.scrollTo(0,this.dynamicContent.getScrollSize().y);
+ }.bind(this))
+ }
+ this.createChatContainer()
+ }.bind(this))
+ }.bind(this)
+ })
+ }else{
+
+ this.chatBarSend.setStyles({"cursor":"not-allowed"});
+ }
- this.dynamicContent.scrollTo(0,this.dynamicContent.getScrollSize().y);
- }.bind(this))
- }
- this.createChatContainer()
- }.bind(this))
- }.bind(this)
- })
},
addDynamicItem:function(){
@@ -674,7 +690,9 @@ MWF.xApplication.TeamWork.Task = new Class({
this.actions.get(this.data.taskId,function(json){
if(json.data) {
this.taskData = json.data;
- if(callback)callback()
+ this.getProject(this.taskData.project,function(){
+ if(callback)callback()
+ }.bind(this))
}
}.bind(this))
}
@@ -1724,7 +1742,12 @@ MWF.xApplication.TeamWork.Task = new Class({
return result;
},
-
+ getProject:function(id,callback){
+ this.rootActions.ProjectAction.get(id,function(json){
+ this.projectData = json.data;
+ if(callback)callback(json);
+ }.bind(this))
+ }
});
@@ -1954,7 +1977,7 @@ MWF.xApplication.TeamWork.Task.PriorityCheck = new Class({
"margin-top":"6px","margin-right":"8px",
"background":"url(../x_component_TeamWork/$Task/default/icon/icon_dagou.png) no-repeat center"
};
-
+ if(!this.data.data.priority) return;
var arr = this.data.data.priority.split("||");
var priorityName = arr[0];
var priorityColor = arr[1];
diff --git a/o2web/source/x_component_TeamWork_Task/Main.js b/o2web/source/x_component_TeamWork_Task/Main.js
index 76f7abc03bc28168fc3eec3be7b15483393dd9b0..39afb29b07464a7e7f09f282406a72098c158416 100644
--- a/o2web/source/x_component_TeamWork_Task/Main.js
+++ b/o2web/source/x_component_TeamWork_Task/Main.js
@@ -23,19 +23,19 @@ MWF.xApplication.TeamWork.Task.Main = new Class({
//this.lp = MWF.xApplication.TeamWork.LP; debugger;
this.cssPath = "../x_component_TeamWork/$Task/"+this.options.style+"/css.wcss";
-
if (!this.status) {
} else {
- this.options.workId = this.status.workId;
- this.options.workCompletedId = this.status.workCompletedId;
- this.options.jobId = this.status.jobId;
- this.options.priorityWork = this.status.priorityWork;
- this.options.readonly = (this.status.readonly === "true");
+ // this.options.workId = this.status.workId;
+ // this.options.workCompletedId = this.status.workCompletedId;
+ // this.options.jobId = this.status.jobId;
+ // this.options.priorityWork = this.status.priorityWork;
+ // this.options.readonly = (this.status.readonly === "true");
+ this.options.taskId = this.status.taskId;
+ this.options.project = this.status.project;
}
-
this.taskId = this.options.taskId || "";
- this.projectId = this.options.project ||"";
+ this.projectId = this.options.project || "";
MWF.xDesktop.requireApp("TeamWork", "lp.zh-cn", {
"onRequestFailure": function(){
@@ -48,13 +48,10 @@ MWF.xApplication.TeamWork.Task.Main = new Class({
},
loadApplication: function(callback) {
-
this.rootActions = MWF.Actions.load("x_teamwork_assemble_control");
this.orgActions = MWF.Actions.load("x_organization_assemble_express");
//this.actions = this.rootActions.TaskAction;
-
- //http://dev.o2oa.net../x_desktop/app.html?app=TeamWork.Task&status={"taskId":"abb0621d-c35c-4010-9cd3-49a439b36a09"}
this.node = new Element("div").inject(this.content);
//alert(this.taskId)
@@ -67,6 +64,7 @@ MWF.xApplication.TeamWork.Task.Main = new Class({
var opt={
"type":"window"
};
+
var task = new MWF.xApplication.TeamWork.Task(this,data,opt);
task.open();
}.bind(this));
@@ -171,5 +169,9 @@ MWF.xApplication.TeamWork.Task.Main = new Class({
}.bind(this));
},
+ recordStatus: function(){
+ debugger;
+ return {"taskId": this.options.taskId, "project": this.options.project};
+ }
});