Merge lp:~openerp-dev/openerp-web/7.0-opw-575725-port-vme into lp:openerp-web/7.0

Proposed by Vidhin Mehta (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openerp-web/7.0-opw-575725-port-vme
Merge into: lp:openerp-web/7.0
Diff against target: 79 lines (+20/-7)
2 files modified
addons/web_gantt/static/lib/dhtmlxGantt/sources/dhtmlxgantt.js (+8/-7)
addons/web_gantt/static/src/js/gantt.js (+12/-0)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/7.0-opw-575725-port-vme
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+144860@code.launchpad.net

Description of the change

Gantt View tooltip transltion done with some library changes.

To post a comment you must log in.

Unmerged revisions

3724. By Vidhin Mehta (OpenERP)

[IMP]translation of ganth view tooltips.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/web_gantt/static/lib/dhtmlxGantt/sources/dhtmlxgantt.js'
2--- addons/web_gantt/static/lib/dhtmlxGantt/sources/dhtmlxgantt.js 2012-01-27 13:35:08 +0000
3+++ addons/web_gantt/static/lib/dhtmlxGantt/sources/dhtmlxgantt.js 2013-01-25 06:55:24 +0000
4@@ -414,6 +414,7 @@
5
6 this.shortMonthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
7 this.monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
8+ this.tooltip_label = {"start_date": "Start Date", "duration":"Duration","percent_complete": "Percent Complete","est": "EST", "predecessor_task": "Predecessor Task", "child_tasks": "Child Tasks", "parent_task": "Parent Task"};
9 this._useShortMonthNames = true;
10
11 dhtmlxEventable(this);
12@@ -3139,20 +3140,20 @@
13 //data of task
14 var tblInfo = this.Chart.divInfo.lastChild;
15 tblInfo.rows[0].cells[0].innerHTML = "<div style='font-family: Arial, Helvetica, Sans-serif; font-size: 12px; font-weight: bold; color: #688060; margin: 0 0 4px 0;'>" + this.TaskInfo.Name + "</div>";
16- tblInfo.rows[0].cells[0].innerHTML += "<span class='st'>EST:&nbsp;</span><span class='ut'>" + this.TaskInfo.EST.getDate() + "." + (this.TaskInfo.EST.getMonth() + 1) + "." + this.TaskInfo.EST.getFullYear() + "</span><br/>";
17- tblInfo.rows[0].cells[0].innerHTML += "<span class='st'>Duration:&nbsp;</span><span class='ut'>" + this.TaskInfo.Duration + " hours </span><br/>";
18+ tblInfo.rows[0].cells[0].innerHTML += "<span class='st'>"+this.Chart.tooltip_label['est']+":&nbsp;</span><span class='ut'>" + this.TaskInfo.EST.getDate() + "." + (this.TaskInfo.EST.getMonth() + 1) + "." + this.TaskInfo.EST.getFullYear() + "</span><br/>";
19+ tblInfo.rows[0].cells[0].innerHTML += "<span class='st'>"+this.Chart.tooltip_label['duration']+":&nbsp;</span><span class='ut'>" + this.TaskInfo.Duration + " hours </span><br/>";
20 // tblInfo.rows[0].cells[0].innerHTML += "<span class='st'>Percent Complete:&nbsp;</span><span class='ut'>" + this.TaskInfo.PercentCompleted + "% </span><br/>";
21
22 //show predecessor task
23 if (this.predTask)
24 {
25- tblInfo.rows[0].cells[0].innerHTML += "<span class='st'>Predecessor Task:&nbsp;</span>";
26+ tblInfo.rows[0].cells[0].innerHTML += "<span class='st'>"+this.Chart.tooltip_label['predecessor_task']+":&nbsp;</span>";
27 tblInfo.rows[0].cells[0].innerHTML += "<span class='lt'>*" + this.TaskInfo.PredecessorTask.Name + "</span>";
28 }
29
30 //show child tasks
31 if (this.TaskInfo.ChildTasks.length != 0) {
32- tblInfo.rows[0].cells[0].innerHTML += "<span class='st'>Child Tasks:&nbsp;</span>";
33+ tblInfo.rows[0].cells[0].innerHTML += "<span class='st'>"+this.Chart.tooltip_label['child_tasks']+":&nbsp;</span>";
34 for (var i = 0; i < this.TaskInfo.ChildTasks.length; i++)
35 {
36 tblInfo.rows[0].cells[0].innerHTML += (i == this.TaskInfo.ChildTasks.length - 1) ? ("<span class='lt'>*" + this.TaskInfo.ChildTasks[i].Name + "</span>") : ("<span class='lt'>*" + this.TaskInfo.ChildTasks[i].Name + "</span>");
37@@ -3161,7 +3162,7 @@
38
39 //show parent task
40 if (this.TaskInfo.ParentTask) {
41- tblInfo.rows[0].cells[0].innerHTML += "<span class='st'>Parent Task:&nbsp;</span>";
42+ tblInfo.rows[0].cells[0].innerHTML += "<span class='st'>"+this.Chart.tooltip_label['parent_task']+":&nbsp;</span>";
43 tblInfo.rows[0].cells[0].innerHTML += "<span class='lt'>*" + this.TaskInfo.ParentTask.Name + "</span>";
44 }
45
46@@ -3803,8 +3804,8 @@
47
48 var tblInfo = this.Chart.divInfo.lastChild;
49 tblInfo.rows[0].cells[0].innerHTML = "<div style='font-family: Arial, Helvetica, Sans-serif; font-size: 12px; font-weight: bold; color: #688060; margin:0 0 4px 0;'>" + this.Project.Name + "</div>";
50- tblInfo.rows[0].cells[0].innerHTML += "<span class='st'>Start Date:&nbsp;</span><span class='ut'>" + this.Project.StartDate.getDate() + "." + (this.Project.StartDate.getMonth() + 1) + "." + this.Project.StartDate.getFullYear() + "</span><br/>";
51- tblInfo.rows[0].cells[0].innerHTML += "<span class='st'>Duration:&nbsp;</span><span class='ut'>" + this.Duration + " hours</span><br/>";
52+ tblInfo.rows[0].cells[0].innerHTML += "<span class='st'>"+this.Chart.tooltip_label['start_date']+":&nbsp;</span><span class='ut'>" + this.Project.StartDate.getDate() + "." + (this.Project.StartDate.getMonth() + 1) + "." + this.Project.StartDate.getFullYear() + "</span><br/>";
53+ tblInfo.rows[0].cells[0].innerHTML += "<span class='st'>"+this.Chart.tooltip_label['duration']+":&nbsp;</span><span class='ut'>" + this.Duration + " hours</span><br/>";
54 // tblInfo.rows[0].cells[0].innerHTML += "<span class='st'>Percent Complete:&nbsp;</span><span class='ut'>" + this.percentCompleted + "%</span><br/>";
55
56 this.Chart.divInfo.style.cssText = "z-index:2;position: absolute;display: inline;";
57
58=== modified file 'addons/web_gantt/static/src/js/gantt.js'
59--- addons/web_gantt/static/src/js/gantt.js 2012-12-28 10:31:54 +0000
60+++ addons/web_gantt/static/src/js/gantt.js 2013-01-25 06:55:24 +0000
61@@ -168,6 +168,18 @@
62 }
63 }
64 var gantt = new GanttChart();
65+ gantt.shortMonthNames = Date.CultureInfo.abbreviatedMonthNames;
66+ gantt.monthNames = Date.CultureInfo.monthNames;
67+ gantt.tooltip_label = {
68+ "start_date": _t("Start Date"),
69+ "duration": _t("Duration"),
70+ "percent_complete": _t("Percent Complete"),
71+ "est": _t("EST"),
72+ "predecessor_task": _t("Predecessor Task"),
73+ "child_tasks": _t("Child Tasks"),
74+ "parent_task": _t("Parent Task")
75+ };
76+
77 _.each(_.compact(_.map(groups, function(e) {return generate_task_info(e, 0);})), function(project) {
78 gantt.addProject(project);
79 });