Commit 29396a2a authored by ecrombag's avatar ecrombag

Removed property handlers and replaced them with calls to the tasks-service

git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/trunk@1130 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent 3259028b
......@@ -200,7 +200,7 @@ itasks.WorkPanel = Ext.extend(itasks.RemoteDataPanel, {
var doCancel = function(btn){
if(btn == "yes"){
var url = itasks.config.servicesUrl + "/json/tasks/" + me.taskId + "/cancel";
var url = itasks.config.serviceUrl + "/json/tasks/" + me.taskId + "/cancel";
var params = {};
var cb = function(data){
if(data.success)
......
......@@ -11,7 +11,7 @@ itasks.ttc.GroupContainer = Ext.extend(Ext.Panel,{
, fixedCont: new Ext.util.MixedCollection() // collection of all fixed containers
, floatingCont: new Ext.util.MixedCollection() // collection of all floating containers
, taskUpdates : {}
, url: itasks.config.servicesUrl + "/json/tasks/" + this.taskId + "/tui"
, url: itasks.config.serviceUrl + "/json/tasks/" + this.taskId + "/tui"
});
itasks.ttc.GroupContainer.superclass.initComponent.apply(this,arguments);
......
......@@ -203,7 +203,7 @@ itasks.ttc.parallel.AssignWindow = Ext.extend(Ext.Window,{
});
c.request({
url: itasks.config.servicesUrl+'/json/tasks/'+win.taskId+ '/managerProperties/worker',
url: itasks.config.serviceUrl+'/json/tasks/'+win.taskId+ '/managerProperties/worker',
params: { session: itasks.app.session, update: upd},
callback: function(){
win.close();
......
......@@ -31,18 +31,53 @@ itasks.ttc.ProcessControlContainer = Ext.extend(Ext.Panel,{
defaultType: "staticfield",
unstyled: true,
items: [{
xtype: "itasks.userfield",
xtype: "itasks.tui.Username",
preventMark: true,
fieldLabel: "Assigned to",
value: this.properties.managerProperties.worker,
listeners: {
"change" : { fn: function(ov,nv) {this.findParentByType(itasks.WorkPanel).sendPropertyEvent(this.properties.systemProperties.taskId,"user",nv);}, scope: this }
"change" : { fn:
function(fld,nv,ov) {
var ct = this.findParentByType(itasks.WorkPanel);
var url = itasks.config.serviceUrl+'/json/tasks/'+this.properties.systemProperties.taskId+ '/managerProperties/worker';
var upd = (nv != "")?'["NamedUser",'+Ext.encode(nv)+']':nv;
var cb = function(response){
if(!response.success) {
Ext.Msg.alert("Error","An error has occurred: "+response.error);
}else{
ct.fireEvent("propertyChanged");
}
}
ct.remoteCall(url,{update: upd},cb);
},
scope: this
}
}
},{
xtype: "itasks.priority",
fieldLabel: "Priority",
value: this.properties.managerProperties.priority,
listeners: {
"change" : { fn: function(ov,nv) {this.findParentByType(itasks.WorkPanel).sendPropertyEvent(this.properties.systemProperties.taskId,"priority",nv);}, scope: this }
"change" : { fn:
function(fld,nv,ov) {
var ct = this.findParentByType(itasks.WorkPanel);
var url = itasks.config.serviceUrl+'/json/tasks/'+this.properties.systemProperties.taskId+ '/managerProperties/priority';
var upd = Ext.encode(nv);
var cb = function(response){
if(!response.success) {
Ext.Msg.alert("Error","An error has occurred: "+response.error);
}else{
ct.fireEvent("propertyChanged");
}
}
ct.remoteCall(url,{update: upd},cb);
},
scope: this
}
}
},{
fieldLabel: "Progress",
......@@ -81,19 +116,6 @@ itasks.ttc.ProcessControlContainer = Ext.extend(Ext.Panel,{
Ext.ns('itasks.ttc.process');
/*
itasks.form.PriorityField = Ext.extend(itasks.form.InlineField, {
format: itasks.util.formatPriority,
field: {
xtype: "combo",
value: this.value,
store: [["HighPriority","High"],["NormalPriority","Normal"],["LowPriority","Low"]],
editable: false,
triggerAction: "all",
forceSelection: true
}
});*/
itasks.form.PriorityField = Ext.extend(Ext.form.ComboBox,{
store: [["HighPriority","High"],["NormalPriority","Normal"],["LowPriority","Low"]],
triggerAction: 'all',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment