~fabien-morin/unifield-web/fm-us-1026

« back to all changes in this revision

Viewing changes to openobject/addons/base/static/workflow/javascript/connector.js

  • Committer: ame (Tiny)
  • Date: 2010-01-04 10:41:58 UTC
  • Revision ID: ame@tinyerp.com-20100104104158-92jypyicgh56twq8
[REF] openerp-web => openobject-web (project name changed)
[REF] openerp => openobject (namespace changed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
//
28
28
////////////////////////////////////////////////////////////////////////////////
29
29
 
30
 
if (typeof(openerp) == "undefined") {
31
 
    openerp = new Object;
32
 
}
33
 
 
34
 
if (typeof(openerp.workflow) == "undefined") {
35
 
    openerp.workflow = new Object;
36
 
}
37
 
 
38
 
 
39
 
openerp.workflow.Connector=function(id, signal, condition, from, to) {
 
30
if (typeof(openobject) == "undefined") {
 
31
    openobject = new Object;
 
32
}
 
33
 
 
34
if (typeof(openobject.workflow) == "undefined") {
 
35
    openobject.workflow = new Object;
 
36
}
 
37
 
 
38
 
 
39
openobject.workflow.Connector=function(id, signal, condition, from, to) {
40
40
        
41
41
        draw2d.Connection.call(this);
42
42
        this.setLineWidth(2);
43
43
        this.setColor(new draw2d.Color(180, 180, 180));
44
 
        this.setTargetDecorator(new openerp.workflow.ConnectionDecorator());
 
44
        this.setTargetDecorator(new openobject.workflow.ConnectionDecorator());
45
45
    
46
 
        this.setSourceAnchor(new openerp.workflow.ConnectionAnchor());
47
 
    this.setTargetAnchor(new openerp.workflow.ConnectionAnchor());
 
46
        this.setSourceAnchor(new openobject.workflow.ConnectionAnchor());
 
47
    this.setTargetAnchor(new openobject.workflow.ConnectionAnchor());
48
48
    this.setRouter(new draw2d.NullConnectionRouter());
49
49
          
50
50
        var html = this.getHTMLElement();
75
75
        }
76
76
}
77
77
 
78
 
openerp.workflow.Connector.prototype = new draw2d.Connection();
 
78
openobject.workflow.Connector.prototype = new draw2d.Connection();
79
79
 
80
 
openerp.workflow.Connector.prototype.ondblClick = function(event) {     
 
80
openobject.workflow.Connector.prototype.ondblClick = function(event) {  
81
81
                new InfoBox(this).show(event);
82
82
}
83
83
 
84
 
openerp.workflow.Connector.prototype.onClick = function(event) {
 
84
openobject.workflow.Connector.prototype.onClick = function(event) {
85
85
    
86
86
    if (WORKFLOW.selected==this)
87
87
        new InfoBox(this).show(event);
88
88
}
89
89
 
90
90
 
91
 
openerp.workflow.Connector.prototype.onmouseOver = function(event) {
 
91
openobject.workflow.Connector.prototype.onmouseOver = function(event) {
92
92
    openobject.dom.get('status').innerHTML = "Condition: " + this.condition + " | Signal: "+ this.signal;
93
93
}
94
94
 
95
95
 
96
 
openerp.workflow.Connector.prototype.onmouseOut = function(event){
 
96
openobject.workflow.Connector.prototype.onmouseOut = function(event){
97
97
    openobject.dom.get('status').innerHTML = '';
98
98
}
99
99
 
100
 
openerp.workflow.Connector.prototype.edit = function() {
 
100
openobject.workflow.Connector.prototype.edit = function() {
101
101
        
102
102
        params = {
103
103
        '_terp_model' : 'workflow.transition',
112
112
        openobject.tools.openWindow(act);
113
113
}
114
114
 
115
 
openerp.workflow.Connector.prototype.get_tr_id = function() {
 
115
openobject.workflow.Connector.prototype.get_tr_id = function() {
116
116
        return this.tr_id;
117
117
}
118
118
 
119
 
openerp.workflow.Connector.prototype.__delete__ = function() {
 
119
openobject.workflow.Connector.prototype.__delete__ = function() {
120
120
                MochiKit.Signal.disconnectAll(this.getHTMLElement(), 'ondblclick', 'onmouseover', 'onmouseout', 'onclick');
121
121
}
122
122
 
123
 
openerp.workflow.Connector.prototype.setSource = function(port) {
 
123
openobject.workflow.Connector.prototype.setSource = function(port) {
124
124
        
125
125
        draw2d.Connection.prototype.setSource.call(this,port);
126
126
        
132
132
        }
133
133
}
134
134
 
135
 
openerp.workflow.Connector.prototype.setTarget = function(port) {
 
135
openobject.workflow.Connector.prototype.setTarget = function(port) {
136
136
        draw2d.Connection.prototype.setTarget.call(this,port);
137
137
        
138
138
        if(this.destId==null)