summaryrefslogtreecommitdiff
path: root/addons/web_process/static/src
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web_process/static/src')
-rw-r--r--addons/web_process/static/src/css/process.css73
-rw-r--r--addons/web_process/static/src/img/ToolOval.jpgbin650 -> 0 bytes
-rw-r--r--addons/web_process/static/src/img/ToolShowGrid.jpgbin635 -> 0 bytes
-rw-r--r--addons/web_process/static/src/img/ToolShowGrid.pngbin810 -> 0 bytes
-rw-r--r--addons/web_process/static/src/img/button-a-a.pngbin6595 -> 0 bytes
-rw-r--r--addons/web_process/static/src/img/cta-a.gifbin108 -> 0 bytes
-rw-r--r--addons/web_process/static/src/img/grid_10.jpgbin4530 -> 0 bytes
-rw-r--r--addons/web_process/static/src/img/iconset-a-help.gifbin379 -> 0 bytes
-rw-r--r--addons/web_process/static/src/img/node-current.pngbin3143 -> 0 bytes
-rw-r--r--addons/web_process/static/src/img/node-gray.pngbin3128 -> 0 bytes
-rw-r--r--addons/web_process/static/src/img/node-subflow-gray.pngbin6837 -> 0 bytes
-rw-r--r--addons/web_process/static/src/img/node-subflow.pngbin6851 -> 0 bytes
-rw-r--r--addons/web_process/static/src/img/node.pngbin3205 -> 0 bytes
-rw-r--r--addons/web_process/static/src/img/port.gifbin166 -> 0 bytes
-rw-r--r--addons/web_process/static/src/img/sep-a.gifbin43 -> 0 bytes
-rw-r--r--addons/web_process/static/src/img/window_bg.pngbin128 -> 0 bytes
-rw-r--r--addons/web_process/static/src/img/window_toolbar.pngbin200 -> 0 bytes
-rw-r--r--addons/web_process/static/src/js/process.js291
-rw-r--r--addons/web_process/static/src/xml/web_process.xml114
19 files changed, 0 insertions, 478 deletions
diff --git a/addons/web_process/static/src/css/process.css b/addons/web_process/static/src/css/process.css
deleted file mode 100644
index dde01f26ea5..00000000000
--- a/addons/web_process/static/src/css/process.css
+++ /dev/null
@@ -1,73 +0,0 @@
-
-a.cta-a {
- float: left;
- padding: 5px 10px;
- border: 1px solid #ccc;
- border-radius: 5px;
- -moz-border-radius: 5px;
- -webkit-border-radius: 5px;
- background: #eeeded url(/web_process/static/src/img/cta-a.gif) repeat-x;
- box-shadow: 0 1px 0 #fff;
- -moz-box-shadow: 0 1px 0 #fff;
- -webkit-box-shadow: 0 1px 0 #fff;
- color: #8c8c8c;
- font-size: 0.9em;
- text-transform: uppercase;
- font-weight: bold;
- text-shadow: #fff 0 1px 0;
- margin: 2px;
-}
-
-a.cta-a span {
- float: left;
- padding: 7px 0 5px 5px;
- background-position: 0 50%;
- background-repeat: no-repeat;
- cursor: pointer;
-}
-
-a.cta-a strong {
- display: block;
- color: #393939;
-}
-
-.process_h1 {
- background:url("/web_process/static/src/img/sep-a.gif") repeat-x scroll 0 90% transparent;
- font-size:2em;
- font-weight:normal;
- padding:0 0 5px 5px;
- line-height: 1.2;
-}
-
-.process-links {
- padding: 5px 10px;
- text-align: center;
- display: table;
- margin: auto;
-}
-
-.process-links a.cta-a {
- display: table-cell;
-}
-
-.oe_process {
- height: 20px;
- margin-top:8px;
- padding: 0;
- width: 24px;
- cursor: pointer;
- display: block;
- background: url(/web/static/src/img/iconset-a-help.png) no-repeat center center;
- float: left;
-}
-
-.process-help-text {
- float: left;
- padding:5px 10px;
- min-height:56px;
- font-size: 120%;
-}
-
-td.process_fields,button.toggle_fields span:last-child {
- display: none;
-}
diff --git a/addons/web_process/static/src/img/ToolOval.jpg b/addons/web_process/static/src/img/ToolOval.jpg
deleted file mode 100644
index c30f15a07d2..00000000000
--- a/addons/web_process/static/src/img/ToolOval.jpg
+++ /dev/null
Binary files differ
diff --git a/addons/web_process/static/src/img/ToolShowGrid.jpg b/addons/web_process/static/src/img/ToolShowGrid.jpg
deleted file mode 100644
index 8285acc8aac..00000000000
--- a/addons/web_process/static/src/img/ToolShowGrid.jpg
+++ /dev/null
Binary files differ
diff --git a/addons/web_process/static/src/img/ToolShowGrid.png b/addons/web_process/static/src/img/ToolShowGrid.png
deleted file mode 100644
index ea530671b97..00000000000
--- a/addons/web_process/static/src/img/ToolShowGrid.png
+++ /dev/null
Binary files differ
diff --git a/addons/web_process/static/src/img/button-a-a.png b/addons/web_process/static/src/img/button-a-a.png
deleted file mode 100644
index bd046bbbef7..00000000000
--- a/addons/web_process/static/src/img/button-a-a.png
+++ /dev/null
Binary files differ
diff --git a/addons/web_process/static/src/img/cta-a.gif b/addons/web_process/static/src/img/cta-a.gif
deleted file mode 100644
index daa561e29f5..00000000000
--- a/addons/web_process/static/src/img/cta-a.gif
+++ /dev/null
Binary files differ
diff --git a/addons/web_process/static/src/img/grid_10.jpg b/addons/web_process/static/src/img/grid_10.jpg
deleted file mode 100644
index 5254207b964..00000000000
--- a/addons/web_process/static/src/img/grid_10.jpg
+++ /dev/null
Binary files differ
diff --git a/addons/web_process/static/src/img/iconset-a-help.gif b/addons/web_process/static/src/img/iconset-a-help.gif
deleted file mode 100644
index 5400acec57b..00000000000
--- a/addons/web_process/static/src/img/iconset-a-help.gif
+++ /dev/null
Binary files differ
diff --git a/addons/web_process/static/src/img/node-current.png b/addons/web_process/static/src/img/node-current.png
deleted file mode 100644
index 51f86b04c78..00000000000
--- a/addons/web_process/static/src/img/node-current.png
+++ /dev/null
Binary files differ
diff --git a/addons/web_process/static/src/img/node-gray.png b/addons/web_process/static/src/img/node-gray.png
deleted file mode 100644
index 972013540cf..00000000000
--- a/addons/web_process/static/src/img/node-gray.png
+++ /dev/null
Binary files differ
diff --git a/addons/web_process/static/src/img/node-subflow-gray.png b/addons/web_process/static/src/img/node-subflow-gray.png
deleted file mode 100644
index ffafe1bd681..00000000000
--- a/addons/web_process/static/src/img/node-subflow-gray.png
+++ /dev/null
Binary files differ
diff --git a/addons/web_process/static/src/img/node-subflow.png b/addons/web_process/static/src/img/node-subflow.png
deleted file mode 100644
index fd2a480204d..00000000000
--- a/addons/web_process/static/src/img/node-subflow.png
+++ /dev/null
Binary files differ
diff --git a/addons/web_process/static/src/img/node.png b/addons/web_process/static/src/img/node.png
deleted file mode 100644
index 853ac85cd56..00000000000
--- a/addons/web_process/static/src/img/node.png
+++ /dev/null
Binary files differ
diff --git a/addons/web_process/static/src/img/port.gif b/addons/web_process/static/src/img/port.gif
deleted file mode 100644
index 1a3f97815e7..00000000000
--- a/addons/web_process/static/src/img/port.gif
+++ /dev/null
Binary files differ
diff --git a/addons/web_process/static/src/img/sep-a.gif b/addons/web_process/static/src/img/sep-a.gif
deleted file mode 100644
index 5a064f21e89..00000000000
--- a/addons/web_process/static/src/img/sep-a.gif
+++ /dev/null
Binary files differ
diff --git a/addons/web_process/static/src/img/window_bg.png b/addons/web_process/static/src/img/window_bg.png
deleted file mode 100644
index 864aed8a40b..00000000000
--- a/addons/web_process/static/src/img/window_bg.png
+++ /dev/null
Binary files differ
diff --git a/addons/web_process/static/src/img/window_toolbar.png b/addons/web_process/static/src/img/window_toolbar.png
deleted file mode 100644
index 77c30b79d82..00000000000
--- a/addons/web_process/static/src/img/window_toolbar.png
+++ /dev/null
Binary files differ
diff --git a/addons/web_process/static/src/js/process.js b/addons/web_process/static/src/js/process.js
deleted file mode 100644
index 60259f26b64..00000000000
--- a/addons/web_process/static/src/js/process.js
+++ /dev/null
@@ -1,291 +0,0 @@
-openerp.web_process = function (instance) {
- var QWeb = instance.web.qweb,
- _t = instance.web._t;
- instance.web.ViewManager.include({
- start: function() {
- var _super = this._super();
- this.process_check();
- this.process_help = this.action ? this.action.help : 'Help: Not Defined';
- this.model = this.dataset.model;
- if(this.action) this.process_model = this.action.res_model;
- else this.process_model = this.model;
- return _super;
- },
- process_check: function() {
- var self = this,
- grandparent = this.getParent() && this.getParent().getParent(),
- view = this.views[this.views_src[0].view_type],
- $process_view = this.$element.find('.oe_process');
- if (!(grandparent instanceof instance.web.WebClient) ||
- !(view.view_type === this.views_src[0].view_type
- && view.view_id === this.views_src[0].view_id)) {
- $process_view.hide();
- return;
- }
- $process_view.click(function() {
- self.initialize_process_view();
- });
- },
- initialize_process_view: function() {
- var self = this;
- this.record_id = false;
- if(this.active_view == 'form') {
- this.record_id = this.views[this.active_view].controller.datarecord.id;
- }
-
- $.when(this.help(), this.get_process_object()).pipe(function(help, process) {
- self.process_help = help;
- if(process && process.length) {
- if(process.length > 1) {
- self.process_selection = process;
- } else {
- self.process_id = process[0][0],
- self.process_title = process[0][1];
- }
- }
- return $.Deferred().resolve();
- }).pipe(function() {
- var def = $.Deferred();
- if(self.process_id) {
- self.graph_get().done(function(res) {
- self.process_notes = res.notes;
- self.process_title = res.name;
- self.process_subflows = _(res.nodes).chain()
- .filter(function (node) { return node['subflow'] !== false; })
- .uniq(false, function (node) { return node['subflow'][0]; }).value();
- self.process_related = res.related;
- def.resolve(res);
- });
- } else def.resolve();
- return def.promise();
- }).done(function(res) {
- $.when(self.render_process_view()).done(function() {
- if(res) self.draw_process_graph(res);
- });
- });
- },
- graph_get: function() {
- var self = this;
- var def = $.Deferred();
- this.process_id = parseInt(this.process_id, 10);
-
- this.process_dataset
- .call("graph_get",[this.process_id, this.model || this.dataset.model, this.record_id, [80,80,150,100]])
- .done(function(res) {
- self.process_dataset
- .call("search_by_model",[self.model || self.dataset.model,self.session.context])
- .done(
- function(r) {
- res['related'] = r;
- def.resolve(res);
- });
- });
- return def.promise();
- },
- help : function() {
- var def = $.Deferred();
- if(!this.subflow_model) {
- def.resolve(this.action ? (this.action.help!=false ? this.action.help : 'Help: Not Defined') : 'Help: Not Defined');
- } else {
- var dataset = new instance.web.DataSetSearch(this, "ir.actions.act_window", this.session.context, []);
- dataset
- .read_slice(['help'],
- {
- domain: [
- ['res_model', '=', this.subflow_model],
- ['name', 'ilike', this.subflow_name]
- ]
- }
- ).done(function(res) {
- def.resolve(res.help || 'Help: Not Defined');
- });
- }
- return def.promise();
- },
- get_process_object : function() {
- var self = this,
- def = $.Deferred();
- if(this.process_id)
- return def.resolve().promise();
-
- this.process_dataset = new instance.web.DataSet(this, "process.process", this.session.context);
- this.process_dataset
- .call("search_by_model", [self.process_model,self.session.context])
- .done(function(res) {
- if (!res.length) {
- self.process_model = false;
- self.get_process_object().done(def.resolve);
- }
- else {
- def.resolve(res);
- }
- })
- .fail(def.reject);
- return def.promise();
- },
- render_process_view : function() {
- this.$element.html(QWeb.render("ProcessView", this));
- var self = this;
- this.$element.find('#edit_process').click(function() {
- self.edit_process_view();
- });
- var $parent = this.getParent().$element;
- $parent.find('#change_process').click(function() {
- self.process_selection = false,
- self.process_id = $parent.find('#select_process').val(),
- self.process_title = $.trim($parent.find('#select_process option:selected').text());
- self.initialize_process_view();
- });
-
- this.$element.find(".process_subflow").click(function() {
- self.process_id = this.id;
- self.initialize_process_view();
- });
- },
- draw_process_graph : function(res) {
- var self = this,
- process_graph = new Graph();
- var process_renderer = function(r, n) {
- var clip_rect = "".concat(n.node.x,",",n.node.y,",150,100");
-
- //Image part
- var bg = n.node.kind == "subflow" ? "node-subflow" : "node";
- bg = n.node.gray ? bg + "-gray" : bg;
- bg = n.node.active ? 'node-current': bg;
-
- var img_src = '/web_process/static/src/img/'+ bg + '.png';
-
- r['image'](img_src, n.node.x, n.node.y,150, 100)
- .attr({"clip-rect": clip_rect})
- .mousedown(function() {
- return false;
- });
- //Node
- var process_node = r['rect'](n.node.x, n.node.y, 150, 100).attr({stroke: "none"});
- // Node text
- var process_node_text = r.text(n.node.x, n.node.y, (n.node.name))
- .attr({"fill": "#fff", "font-weight": "bold", "cursor": "pointer"});
- process_node_text.translate((process_node.getBBox().width / 2) + 5, 10);
- if(n.node.subflow) {
- process_node_text.click(function() {
- self.process_id = n.node.subflow[0];
- self.subflow_model = n.node.model;
- self.subflow_name = n.node.name;
- self.initialize_process_view();
- });
- }
- //Node Description
- var new_notes = n.node.notes;
- if(n.node.notes.length > 25) {
- var to;
- var temp_str = new_notes = '';
- var from = to = 0;
- while (1) {
- from = 25;
- temp_str = n.node.notes.substr(to ,25);
- if (temp_str.lastIndexOf(" ") < 25 && temp_str.length >= 25) {
- from = temp_str.lastIndexOf(" ");
- }
- new_notes += "\n" + n.node.notes.substr(to , from);
- if(new_notes.length > n.node.notes.length) break;
- to += from;
- }
- }
-
- if(n.node.res)
- new_notes = n.node.res.name + '\n' + new_notes;
-
- r.text(n.node.x+85, n.node.y+50, (new_notes));
- r['image']('/web/static/src/img/icons/gtk-info.png', n.node.x+20, n.node.y+70, 16, 16)
- .attr({"cursor": "pointer", "title": "Help"})
- .click(function() {
- window.open(n.node.url || "http://doc.openerp.com/v6.0/index.php?model=" + n.node.model);
- });
-
- if(n.node.menu) {
- r['image']('/web/static/src/img/icons/gtk-jump-to.png', n.node.x+115, n.node.y+70, 16, 16)
- .attr({"cursor": "pointer", "title": n.node.menu.name})
- .click(function() {
- self.jump_to_view(n.node.res_model, n.node.menu.id);
- });
- }
-
- var process_set = r.set().push(process_node);
- process_set.mousedown(function() {
- return false;
- });
- return process_set;
- };
-
- _.each(res['nodes'],function(node, node_id) {
- node['res_model'] = self.model,
- node['res_id'] = false,
- node['id'] = node_id;
- process_graph.addNode(node.id, {node: node,render: process_renderer});
- });
-
- _.each(res['transitions'], function(transitions) {
- var src = res['nodes'][transitions['source']];
- var dst = res['nodes'][transitions['target']];
- // make active
- transitions['active'] = src.active && !dst.gray;
- process_graph.addEdge(src.id, dst.id, {directed : true});
- });
- var width = $(document).width();
- var height = $(document).height();
- var layouter = new Graph.Layout.Ordered(process_graph);
- var render_process_graph = new Graph.Renderer.Raphael('process_canvas', process_graph, width, height);
- },
- jump_to_view: function(model, id) {
- var self = this;
- var dataset = new instance.web.DataSet(this, 'ir.values', this.session.context);
- dataset.call('get',
- ['action', 'tree_but_open',[['ir.ui.menu', id]], dataset.context],
- function(res) {
- var action = res[0][res[0].length - 1];
- self.rpc("/web/action/load", {
- action_id: action.id,
- context: dataset.context
- }, function(result) {
- var action_manager = new instance.web.ActionManager(self);
- action_manager.replace(self.$element);
- action_manager.do_action(result.result);
- });
- });
- },
- edit_process_view: function() {
- var self = this;
- var action_manager = new instance.web.ActionManager(this);
- var dialog = new instance.web.Dialog(this, {
- width: 800,
- buttons : [
- {text: _t("Cancel"), click: function() { $(this).dialog('destroy'); }},
- {text: _t("Save"), click: function() {
- var form_view = action_manager.inner_widget.views.form.controller;
-
- form_view.do_save(function() {
- self.initialize_process_view();
- });
- $(this).dialog('destroy');
- }}
- ]
- }).open();
-
- action_manager.appendTo(dialog.$element);
- action_manager.do_action({
- res_model : 'process.process',
- res_id: self.process_id,
- views : [[false, 'form']],
- type : 'ir.actions.act_window',
- flags : {
- search_view: false,
- sidebar : false,
- views_switcher : false,
- action_buttons : false,
- pager: false
- }
- });
- }
- });
-};
-// vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax:
diff --git a/addons/web_process/static/src/xml/web_process.xml b/addons/web_process/static/src/xml/web_process.xml
deleted file mode 100644
index 7bf2ba1d93b..00000000000
--- a/addons/web_process/static/src/xml/web_process.xml
+++ /dev/null
@@ -1,114 +0,0 @@
-<template>
-<!-- vim:fdl=1:
--->
- <t t-extend="ViewManager" t-name="ViewManagerAction">
- <t t-jquery=".oe-view-manager-header" t-operation="append">
- <a t-if="self.flags.display_title !== false" class="oe_process" title="Process View" href="javascript: void(0)"></a>
- </t>
- </t>
- <t t-name="ProcessView">
- <table class="view" border="0" width="100%" height="100%" cellpadding="0" cellspacing="0">
- <tr>
- <td width="75%" valign="top" class="fields collapsed" style="padding-top:10px;">
- <h1 class="process_h1">
- <t t-esc="action.name"/> (<t t-esc="model"/>)
- </h1>
- <p class="process-links">
- <a class="cta-a" target="_blank" href="http://doc.openerp.com/">
- <span>
- <strong>Documentation</strong>
- Read Documentation Online
- </span>
- </a>
- <a class="cta-a" target="_blank" href="http://www.openerp.com/forum/">
- <span>
- <strong>Forum</strong>
- Community Discussion
- </span>
- </a>
- <a class="cta-a" target="_blank" href="http://www.openerp.com/catalog/150">
- <span>
- <strong>Books</strong>
- Get the books
- </span>
- </a>
- <a class="cta-a" target="_blank" href="http://www.openerp.com/catalog">
- <span>
- <strong>OpenERP Enterprise</strong>
- Purchase OpenERP Enterprise
- </span>
- </a>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p><t t-esc="process_help"/></p>
- </td>
- </tr>
- <tr>
- <td>
- <h2>
- <t t-esc="process_title"/> Process
- </h2>
- <t t-if="process_notes">
- <p>
- <strong>Notes:</strong> <t t-esc="process_notes"/>
- </p>
- <p>
- <strong>Last modified by:</strong> N/A
- </p>
- <t t-if="process_subflows.length">
- <strong>Subflows:</strong>
-
- <t t-foreach="process_subflows" t-as="subflow">
- <t t-if="subflow.subflow[0] != process_id">
- <p>
- <a class="process_subflow" t-att-id="subflow.subflow[0]" href="javascript: void(0)">
- <t t-esc="subflow.subflow[1]"/>
- </a>
- </p>
- </t>
- </t>
- </t>
- <t t-if="process_related.length and process_related[0][0] != process_id">
- <strong>Related:</strong>
- <p>
- <a class="process_subflow" t-att-id="process_related[0][0]" href="javascript: void(0)">
- <t t-esc="process_related[0][1]"/>
- </a>
- </p>
- </t>
- </t>
- </td>
- </tr>
- <tr t-if="process_selection">
- <td>
- <fieldset>
- <legend>
- Select Process
- </legend>
- <select id="select_process">
- <t t-foreach="process_selection" t-as="prc">
- <option t-att-value="prc[0]">
- <t t-esc="prc[1]"/>
- </option>
- </t>
- </select>
- <button class="oe_button" id="change_process">Select</button>
- </fieldset>
- </td>
- </tr>
- <tr t-if="process_id">
- <td>
- <div id="process_canvas" style="overflow: auto;"></div>
- </td>
- </tr>
- <tr t-if="process_id">
- <td>
- <button class="oe_button" id="edit_process">Edit Process</button>
- </td>
- </tr>
- </table>
- </t>
-</template>