Description: Red Hat Bugzilla has additional columns that are allowed to be displayed in a search results page that are not available in the standard Bugzilla source. These fields include bug groups, bug dependencies, issuetracker id's, IT Max Score, set flags, etc. Requires the addition of stored functions in the MySQL database which are already have installed in the live database. Function Requirements: colchange.cgi template/en/default/list/change-columns.html.tmpl template/en/default/list/table.html.tmpl Bugzilla/Search.pm buglist.cgi
LOC Estimation: Schema.pm: 62 buglist.cgi: 6 Bugzilla/DBcompat.pm: 103 colchange.cgi: 5 template/en/default/list/table.html.tmpl: 5 selenium tests to verify proper display of dependencies, issuetrackers, and flags: 6 hours Add 30% for conversion to 3.0 API LOC Total: 181 + (181 * .30) = 236
Created attachment 294729 [details] Patch to add methods to db modules to access stored db functions (v1) Tony, here is a patch for Bugzilla/DB/{Mysql,Pg}.pm to add methods to access the stored procedures (for Mysql). You can now use these in buglist.cgi to get the SQL necessary to display the column. For example in buglist.cgi to access the 'flags' columns you would add the line: DefineColumn("flags", $dbh->sql_flag_list(values(%{Bugzilla->user->groups})) . " AS flags", "Flags"); So we would need to do similar for IssueTrackerList, BlockedByList and DependsOnList. Dave
Dave, I have updated colchange.cgi and buglist.cig files and added modification into your patch. Tony
Created attachment 294756 [details] Update colchange.cgi and buglist.cgi to show additional columns
Comment on attachment 294756 [details] Update colchange.cgi and buglist.cgi to show additional columns >+if (Bugzilla->params->{"useissuetracker"} && Bugzilla->user->in_group('issuetracker')) { >+ push(@masterlist, "cust_facing"); >+ push(@masterlist, "issuetrackers"); >+ push(@masterlist, "itmaxscore"); >+} Only include issuetrackers and itmaxscore in this conditional. Remove cust_facing since it is already present before the conditional. Dave
Created attachment 294892 [details] Patch to add additional columns in query resultsgroups Tony, I was able to get your patch to work fine after a couple of small changes. I am attaching the patch I created here for your review. Things I did: 1. Created Bugzilla::DB::{Mysql,Pg}::sql_it_max_score() to return the SQL for showing IT Max Score in query columns. You had the column there in buglist.cgi but I felt it cleaner to have a function for it similar to the others. 2. Added the new column descriptions to template/en/default/global/field-descs.none.tmpl that were missing. 3. Only sql_flag_list() needed the values(%{Bugzilla->user->groups}) passed in as an argument. The others can be blank. Dave
I spoke too soon. There is a problem when adding the flags query column. It is not showing the proper amount of flags. Even though they are set when you view thew same bug using show_bug.cgi. Will need to investigate. Dave
Ok figured out the flag issue. There is a bug in the FlagList stored procedure that was messing up the group id list temporary table so that some flags would be missing. I assume this has been this way for a while on the live db and noone was complaining as it is random and easy to miss. The REPLACE() string function in MySQL acts globally so it will replace *all* occurrences of a search string instead of just the first one it finds. So I have replaced the REPLACE() with TRIM() and it works much better now. Index: redhat/bugs-functions.mysql =================================================================== RCS file: /cvs/qa/rh_bugzilla_2_18/redhat/bugs-functions.mysql,v retrieving revision 1.6 diff -u -r1.6 bugs-functions.mysql --- redhat/bugs-functions.mysql 27 Aug 2007 16:44:52 -0000 1.6 +++ redhat/bugs-functions.mysql 14 Feb 2008 17:38:10 -0000 @@ -69,7 +69,7 @@ SET foundPos = INSTR(group_id_list,delim); WHILE foundPos <> 0 DO SET element = SUBSTRING(group_id_list, 1, foundPos-1); - SET group_id_list = REPLACE(group_id_list, CONCAT(element,delim), ''); + SET group_id_list = TRIM(LEADING CONCAT(element,delim) FROM group_id_list); INSERT INTO tmpGroupIds (value) VALUES (element); I have applied this fix to the live db as well as the test bugs db on bz-db1-test.devel.redhat.com. After that I was able to view the proper flags consistently on the test system. Tony, if you feel that this patch is ready to go then please go ahead and check in to CVS. review+ Dave
I have checked all updates into cvs respository. Close this ticket.