提交 23d659d2 编写于 作者: U unknown

流程应用根据是否有管理员权限进行界面区分

上级 9e6f1009
......@@ -56,6 +56,19 @@ MWF.xApplication.process.Application.Main = new Class({
this.node = new Element("div", {
"styles": {"width": "100%", "height": "100%", "overflow": "hidden", "background-color": "#ffffff"}
}).inject(this.content);
},
isManager: function(){
if( o2.typeOf(this.managerFlag) === "boolean" )return this.managerFlag;
if( o2.AC.isProcessManager() ){
this.managerFlag = true;
return true;
}
if( (this.options.application.controllerList || [] ).contains( layout.desktop.session.user.distinguishedName ) ){
this.managerFlag = true;
return true;
}
this.managerFlag = false;
return false;
},
loadApplication: function(callback){
this.getApplication(function(){
......@@ -359,6 +372,7 @@ MWF.xApplication.process.Application.Menu = new Class({
MWF.getJSON(menuUrl, function(json){
json.each(function(navi){
if( navi.permission === "manager" && !this.app.isManager() )return;
var naviNode = new Element("div", {
"styles": this.app.css.startMenuNaviNode
});
......
......@@ -60,6 +60,7 @@ MWF.xApplication.process.Application.MyWorkExplorer = new Class({
return new MWF.xApplication.process.Application.WorkExplorer.Work(data, this);
},
removeWork: function(work, all){
if( this.app.isManager() ){
this.actions.removeWork(work.data.id, this.app.options.id, all, function(json){
json.data.each(function(item){
this.items.erase(this.works[item.id]);
......@@ -68,5 +69,15 @@ MWF.xApplication.process.Application.MyWorkExplorer = new Class({
delete this.works[item.id];
}.bind(this));
}.bind(this));
}else{
var workId = work.data.id;
o2.Actions.load("x_processplatform_assemble_surface").WorkAction.delete(workId, function () {
this.items.erase(this.works[workId]);
if (this.works[workId]) this.works[workId].destroy();
MWF.release(this.works[workId]);
delete this.works[workId];
}.bind(this))
}
}
});
......@@ -841,14 +841,24 @@ MWF.xApplication.process.Application.WorkExplorer.Work = new Class({
}.bind(this)
});
}
if (this.data.control.allowVisit) {
if (this.data.control.allowVisit ) {
this.workAreaNode.addEvents({
"mouseover": function(){if (!this.readyRemove && !this.readyFlow) this.workAreaNode.setStyles(this.css.workItemWorkNode_over);}.bind(this),
"mouseout": function(){if (!this.readyRemove && !this.readyFlow) this.workAreaNode.setStyles(this.css.workItemWorkNode);}.bind(this)
"mouseover": function(){if (!this.readyRemove && !this.readyFlow) {
this.workAreaNode.setStyles(this.css.workItemWorkNode_over);
if(!this.explorer.app.isManager())this.workAreaNode.setStyle("cursor","default");
}}.bind(this),
"mouseout": function(){if (!this.readyRemove && !this.readyFlow){
this.workAreaNode.setStyles(this.css.workItemWorkNode);
if(!this.explorer.app.isManager())this.workAreaNode.setStyle("cursor","default");
}}.bind(this)
});
if(this.explorer.app.isManager()){
this.titleAreaNode.addEvent("click", function(){
this.loadChild();
}.bind(this));
}else{
this.workAreaNode.setStyle("cursor","default");
}
}
},
processWork: function(e){
......@@ -1111,30 +1121,34 @@ MWF.xApplication.process.Application.WorkExplorer.Work = new Class({
this.readyRemove = true;
this.explorer.app.confirm("warn", e, lp.deleteWorkTitle, text, 350, 120, function(){
this.close();
_self.explorer.app.confirm("warn", e, lp.deleteWorkTitle, {"html": lp.deleteAllWork}, 400, 220, function(){
if( _self.explorer.app.isManager() ) {
_self.explorer.app.confirm("warn", e, lp.deleteWorkTitle, {"html": lp.deleteAllWork}, 400, 220, function () {
var inputs = this.content.getElements("input");
var flag = "";
for (var i=0; i<inputs.length; i++){
if (inputs[i].checked){
for (var i = 0; i < inputs.length; i++) {
if (inputs[i].checked) {
flag = inputs[i].get("value");
break;
}
}
if (flag){
if (flag=="all"){
if (flag) {
if (flag == "all") {
_self.explorer.removeWork(_self, true);
}else{
} else {
_self.explorer.removeWork(_self, false);
}
this.close();
}else{
} else {
this.content.getElement("#deleteWork_checkInfor").set("text", lp.deleteAllWorkCheck).setStyle("color", "red");
}
}, function(){
}, function () {
//_self.explorer.removeWork(_self, false);
_self.workAreaNode.setStyles(_self.css.workItemWorkNode);
this.close();
});
}else{
_self.explorer.removeWork(_self, true);
}
}, function(){
_self.workAreaNode.setStyles(_self.css.workItemWorkNode);
_self.readyRemove = false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册