~openerp/openobject-client-web/trunk

« back to all changes in this revision

Viewing changes to openobject/addons/base/static/workflow/javascript/process.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 = {};
32
 
}
33
 
 
34
 
if (typeof(openerp.process) == 'undefined') {
35
 
    openerp.process = {};
36
 
}
37
 
 
38
 
openerp.process.NAME = "openerp.process";
39
 
openerp.process.__repr__ = openerp.process.toString = function () {
 
30
if (typeof(openobject) == "undefined") {
 
31
    openobject = {};
 
32
}
 
33
 
 
34
if (typeof(openobject.process) == 'undefined') {
 
35
    openobject.process = {};
 
36
}
 
37
 
 
38
openobject.process.NAME = "openobject.process";
 
39
openobject.process.__repr__ = openobject.process.toString = function () {
40
40
    return "[" + this.NAME + "]";
41
41
};
42
42
 
43
43
/**
44
 
 * openerp.process.Workflow
 
44
 * openobject.process.Workflow
45
45
 */
46
 
openerp.process.Workflow = function(canvas) {
 
46
openobject.process.Workflow = function(canvas) {
47
47
    this.__init__(canvas);
48
48
}
49
49
 
50
 
openerp.process.Workflow.prototype = new draw2d.Workflow();
51
 
MochiKit.Base.update(openerp.process.Workflow.prototype, {
 
50
openobject.process.Workflow.prototype = new draw2d.Workflow();
 
51
MochiKit.Base.update(openobject.process.Workflow.prototype, {
52
52
 
53
53
    __super__: draw2d.Workflow,
54
54
 
97
97
            data['res_model'] = this.res_model;
98
98
            data['res_id'] = this.res_id;
99
99
 
100
 
                var n = new openerp.process.Node(data);
 
100
                var n = new openobject.process.Node(data);
101
101
                this.addFigure(n, data.x, data.y);
102
102
                
103
103
                this.nodes[id] = n; // keep reference
125
125
            // make active
126
126
            data.active = src.data.active && !dst.data.gray;
127
127
 
128
 
            var t = new openerp.process.Transition(data);
 
128
            var t = new openobject.process.Transition(data);
129
129
                
130
130
                t.setSource(src.outPort);
131
131
                t.setTarget(dst.inPort);
212
212
});
213
213
 
214
214
/**
215
 
 * openerp.process.Node
 
215
 * openobject.process.Node
216
216
 */
217
 
openerp.process.Node = function(data) {
 
217
openobject.process.Node = function(data) {
218
218
    this.__init__(data);
219
219
}
220
220
 
221
 
openerp.process.Node.prototype = new draw2d.Node();
222
 
MochiKit.Base.update(openerp.process.Node.prototype, {
 
221
openobject.process.Node.prototype = new draw2d.Node();
 
222
MochiKit.Base.update(openobject.process.Node.prototype, {
223
223
 
224
224
    __super__: draw2d.Node,
225
225
 
364
364
});
365
365
 
366
366
/**
367
 
 * openerp.process.Transition
 
367
 * openobject.process.Transition
368
368
 */
369
 
openerp.process.Transition = function(data) {
 
369
openobject.process.Transition = function(data) {
370
370
    this.__init__(data);
371
371
}
372
372
 
373
 
openerp.process.Transition.prototype = new draw2d.Connection();
374
 
MochiKit.Base.update(openerp.process.Transition.prototype, {
 
373
openobject.process.Transition.prototype = new draw2d.Connection();
 
374
MochiKit.Base.update(openobject.process.Transition.prototype, {
375
375
 
376
376
    __super__: draw2d.Connection,
377
377
 
385
385
 
386
386
        var color = data.active && data.buttons && data.buttons.length ? new draw2d.Color(128, 0, 0) : new draw2d.Color(179, 179, 179);
387
387
 
388
 
        this.setTargetDecorator(new openerp.process.TargetDecorator(color));
 
388
        this.setTargetDecorator(new openobject.process.TargetDecorator(color));
389
389
        this.setColor(color);
390
390
        this.setLineWidth(2);
391
391
        this.setSelectable(false);
487
487
});
488
488
 
489
489
/**
490
 
 * openerp.process.TargetDecorator
 
490
 * openobject.process.TargetDecorator
491
491
 */
492
 
openerp.process.TargetDecorator = function(color) {
 
492
openobject.process.TargetDecorator = function(color) {
493
493
    this.__init__(color);
494
494
}
495
495
 
496
 
openerp.process.TargetDecorator.prototype = new draw2d.ArrowConnectionDecorator();
497
 
MochiKit.Base.update(openerp.process.TargetDecorator.prototype, {
 
496
openobject.process.TargetDecorator.prototype = new draw2d.ArrowConnectionDecorator();
 
497
MochiKit.Base.update(openobject.process.TargetDecorator.prototype, {
498
498
 
499
499
    __super__: draw2d.ArrowConnectionDecorator,
500
500