Merge lp:~primes2h/ubuntu-qa-website/bug_741840 into lp:~ubuntu-qa-website-devel/ubuntu-qa-website/trunk

Proposed by Sergio Zanchetta on 2011-03-24
Status: Merged
Merged at revision: 156
Proposed branch: lp:~primes2h/ubuntu-qa-website/bug_741840
Merge into: lp:~ubuntu-qa-website-devel/ubuntu-qa-website/trunk
Diff against target: 133 lines (+51/-11)
2 files modified
code/modules/qatracker/qatracker.display.php (+28/-10)
code/modules/qatracker/qatracker.function.php (+23/-1)
To merge this branch: bzr merge lp:~primes2h/ubuntu-qa-website/bug_741840
Reviewer Review Type Date Requested Status
Jean-Baptiste Lallement 2011-03-24 Pending
Review via email: mp+54729@code.launchpad.net

Description of the change

In laptop tracker:
1) Filtered milestones by title instead of id, preventing release names from being shown twice in a special circumstance. Fixed LP: #741840
2) Ordered laptop info by title in laptop reports, preventing mix-ups in certain situations.
3) Filtered releases by milestone status to avoid the need to delete the milestone itself.
4) Started test icons are shown now in laptop reports if a user forget to set test result as Passed or Failed.
5) Added new function to arrange laptop make names automatically from dmidecode output and a fix for HP model names.
6) Implemented milestone download info.

N.B.: Because of milestone download info implementation, build number (version) of milestones must be changed to release number accordingly. (e.g. 11.04, 10.04.2)

To post a comment you must log in.
157. By Sergio Zanchetta on 2011-03-25

In laptop tracker: ordered laptop info by title in laptop reports, preventing mix-ups in certain situations.

158. By Sergio Zanchetta on 2011-04-02

Filtered releases by milestone status to avoid the need to delete the milestone itself.

159. By Sergio Zanchetta on 2011-04-02

Started test icons are shown now in laptop reports if a user forget to set test result as Passed or Failed

160. By Sergio Zanchetta on 2011-04-04

New function to arrange laptop make names automatically from dmidecode output. Further makes can be added in the future. A fix for HP model names is also present.

161. By Sergio Zanchetta on 2011-04-04

Implemented milestone download info for laptop tracker.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'code/modules/qatracker/qatracker.display.php'
2--- code/modules/qatracker/qatracker.display.php 2011-03-15 14:30:22 +0000
3+++ code/modules/qatracker/qatracker.display.php 2011-04-04 13:05:55 +0000
4@@ -869,7 +869,7 @@
5 qawebsite_user_setting_info.value
6 FROM qawebsite_user_setting
7 LEFT JOIN qawebsite_user_setting_info ON qawebsite_user_setting.id=qawebsite_user_setting_info.settingid
8- WHERE userid='".$reporterID."' AND siteid='".$site->id."'");
9+ WHERE userid='".$reporterID."' AND siteid='".$site->id."' ORDER BY title");
10
11 $lpusername = db_result(db_query("SELECT value from qawebsite_user_setting_info WHERE userid='".$reporterID."' AND settingid='1'"));
12 $reporter = db_result(db_query("SELECT name from users WHERE uid='".$reporterID."'"));
13@@ -991,6 +991,10 @@
14 $content.=" <a rel=\"external\" href=\"$base_url/qatracker/result/".$build."/".$testcase->id."\">
15 <img style=\"margin-bottom:0px;\" src=\"$base_url/modules/qatracker/images/pass.png\" alt=\"spacer\" /></a></div>";
16 break;
17+ case "2":
18+ $content.=" <a rel=\"external\" href=\"$base_url/qatracker/result/".$build."/".$testcase->id."\">
19+ <img style=\"margin-bottom:0px;\" src=\"$base_url/modules/qatracker/images/started.png\" alt=\"spacer\" /></a></div>";
20+ break;
21 }
22 $content.="&nbsp;".qatracker_getbugslist($build, $testcase->id, 0)."<br \></td>";
23 }
24@@ -1030,11 +1034,13 @@
25 array_push_associative($lpusername,array($item->name => $item->value));
26 break;
27 case "8":
28- if ($item->value!='')
29- array_push($laptopnameitem,$item->value);
30+ if ($item->value!='')
31+ array_push($laptopnameitem,qatracker_getlaptopmake($item->value));
32 break;
33 case "9":
34 if ($item->value!='') {
35+ if (substr($item->value,0,2)=='HP')
36+ $item->value=substr($item->value,2);
37 array_push($laptopnameitem,$item->value);
38 array_push_associative($laptop,array($item->name => implode(" ", $laptopnameitem)));
39 $laptopnameitem=array();
40@@ -1044,7 +1050,7 @@
41 }
42 asort($laptop);
43
44- $milestones=db_query("SELECT title FROM qatracker_milestone WHERE siteid='".$site->id."' ORDER BY id");
45+ $milestones=db_query("SELECT title FROM qatracker_milestone WHERE siteid='".$site->id."' AND status < '2' ORDER BY title");
46
47 $release=array();
48 $lastreleasename='';
49@@ -1424,17 +1430,23 @@
50 //Don't wait 30s to timeout
51 ini_set("default_socket_timeout", 1);
52
53- if ($site->id != "1")
54+ if ($site->id != "1" && $site->id != "12")
55 return "<br />Function not implemented yet.";
56 $info=db_fetch_object(db_query("SELECT qatracker_build.version as version, qatracker_product.title as product, qatracker_milestone.status as server, qatracker_milestone.title as release FROM qatracker_build LEFT JOIN qatracker_milestone ON qatracker_milestone.id=qatracker_build.milestoneid LEFT JOIN qatracker_product ON qatracker_product.id=qatracker_build.productid WHERE qatracker_build.id='".$buildID."'"));
57 $url=array();
58 $url['release']=split(" ",$info->release);
59+
60+ if ($url['release'][1] == "Final")
61+ $url['milestone']="";
62+ else
63+ $url['milestone']=strtolower("-".$url['release'][1]."".$url['release'][2]."");
64+
65 $url['release']=strtolower($url['release'][0]);
66
67- if ($info->server == "0")
68+ if ($site->id == "12" || $info->server == "1")
69+ $url['server']="releases.ubuntu.com";
70+ elseif ($info->server == "0")
71 $url['server']="cdimage.ubuntu.com";
72- elseif ($info->server == "1")
73- $url['server']="releases.ubuntu.com";
74 else
75 return "<br />Download information not available.<br />Archived build";
76
77@@ -1451,8 +1463,14 @@
78 if (ereg("Upgrade",$info->product))
79 return "<br />For upgrades, please use update-manager.";
80 elseif (ereg("Desktop",$info->product)) {
81- $url['type']="/daily-live/";
82- $url['file']=$url['release']."-desktop-".$url['arch'].".iso";
83+ if ($site->id == "12") {
84+ $url['type']="/";
85+ $url['file']="ubuntu-".$url['version']."".$url['milestone']."-desktop-".$url['arch'].".iso";
86+ }
87+ else {
88+ $url['type']="/daily-live/";
89+ $url['file']=$url['release']."-desktop-".$url['arch'].".iso";
90+ }
91 }
92 elseif (ereg("ARM Preinstalled omap3",$info->product)) {
93 $url['type']="/ubuntu-netbook/ports/daily-preinstalled/";
94
95=== modified file 'code/modules/qatracker/qatracker.function.php'
96--- code/modules/qatracker/qatracker.function.php 2011-02-17 16:09:49 +0000
97+++ code/modules/qatracker/qatracker.function.php 2011-04-04 13:05:55 +0000
98@@ -236,7 +236,6 @@
99 return "$done/$total $fail $started";
100 }
101
102-
103 function qatracker_getbuildreportstat($productid, $isoid=0) {
104 if ($isoid != 0)
105 $where="AND qatracker_result.buildid='$isoid'";
106@@ -300,4 +299,27 @@
107 }
108 }
109
110+function qatracker_getlaptopmake($make) {
111+ switch($make) {
112+ case "ASUSTeK Computer Inc." :
113+ return "Asus";
114+ break;
115+ case "Dell Inc." :
116+ return "Dell";
117+ break;
118+ case "Hewlett-Packard" :
119+ return "HP";
120+ break;
121+ case "Matsushita Electric Industrial Co.,Ltd." :
122+ return "Panasonic";
123+ break;
124+ case "SAMSUNG ELECTRONICS CO., LTD." :
125+ return "Samsung";
126+ break;
127+ case "TOSHIBA" :
128+ return "Toshiba";
129+ break;
130+ }
131+ return $make;
132+}
133 ?>

Subscribers

People subscribed via source and target branches

to status/vote changes: