Closed Bug 505039 Opened 15 years ago Closed 15 years ago

Use $user->is_timetracker instead of $user->in_group(Bugzilla->params->{'timetrackinggroup'})

Categories

(Bugzilla :: Bugzilla-General, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
Bugzilla 3.6

People

(Reporter: LpSolit, Assigned: xquezme)

Details

Attachments

(1 file)

+++ This bug was initially created as a clone of Bug #505038 +++

Bugzilla->params->{'timetrackinggroup'}
  && $user->in_group(Bugzilla->params->{'timetrackinggroup'})

should be replaced by $user->is_timetracker. That's shorter, cleaner, and less prone to errors. We should fix all places in the Bugzilla code which still doesn't use it yet.
Whiteboard: [Good Intro Bug]
Priority: -- → P1
Attachment #410611 - Flags: review?(LpSolit)
Attachment #410611 - Flags: review?(LpSolit) → review+
Comment on attachment 410611 [details] [diff] [review]
is_timetracker replacement patch for HEAD

>Index: process_bug.cgi

>             $vars->{'message'} = "remaining_time_zeroed"
>+              if Bugzilla->user->is_timetracker);

) must go away.



>Index: Bugzilla/Bug.pm

>     if ( $self->{'error'} || 
>+         !Bugzilla->user->is_timetracker ) {

Nit: it could be on its own line.


>             $activity_visible = 
>+                Bugzilla->user->is_timetracker ? 1 : 0;

is_timetracker() already returns 0/1, so |? 1 : 0| is useless here.


>         my $tt_group = Bugzilla->params->{timetrackinggroup};
>+        if (!$tt_group || !$user->is_timetracker) {

$tt_group should go away.


Otherwise looks good. These comments can be fixed on checkin. r=LpSolit
Assignee: general → xquezme
Status: NEW → ASSIGNED
Flags: approval+
Whiteboard: [Good Intro Bug]
Target Milestone: --- → Bugzilla 3.6
Checking in buglist.cgi;                                                                  
/cvsroot/mozilla/webtools/bugzilla/buglist.cgi,v  <--  buglist.cgi                        
new revision: 1.408; previous revision: 1.407                                             
done                                                                                      
Checking in colchange.cgi;                                                                
/cvsroot/mozilla/webtools/bugzilla/colchange.cgi,v  <--  colchange.cgi                    
new revision: 1.70; previous revision: 1.69                                               
done                                                                                      
Checking in config.cgi;                                                                   
/cvsroot/mozilla/webtools/bugzilla/config.cgi,v  <--  config.cgi                          
new revision: 1.33; previous revision: 1.32                                               
done                                                                                      
Checking in importxml.pl;                                                                 
/cvsroot/mozilla/webtools/bugzilla/importxml.pl,v  <--  importxml.pl                      
new revision: 1.93; previous revision: 1.92                                               
done                                                                                      
Checking in process_bug.cgi;                                                              
/cvsroot/mozilla/webtools/bugzilla/process_bug.cgi,v  <--  process_bug.cgi                
new revision: 1.425; previous revision: 1.424                                             
done                                                                                      
Checking in query.cgi;                                                                    
/cvsroot/mozilla/webtools/bugzilla/query.cgi,v  <--  query.cgi                            
new revision: 1.189; previous revision: 1.188                                             
done                                                                                      
Checking in show_bug.cgi;                                                                 
/cvsroot/mozilla/webtools/bugzilla/show_bug.cgi,v  <--  show_bug.cgi                      
new revision: 1.62; previous revision: 1.61                                               
done                                                                                      
Checking in summarize_time.cgi;                                                           
/cvsroot/mozilla/webtools/bugzilla/summarize_time.cgi,v  <--  summarize_time.cgi          
new revision: 1.26; previous revision: 1.25                                               
done                                                                                      
Checking in Bugzilla/Bug.pm;                                                              
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Bug.pm,v  <--  Bug.pm                         
new revision: 1.297; previous revision: 1.296                                             
done                                                                                      
Checking in template/en/default/bug/comments.html.tmpl;                                   
/cvsroot/mozilla/webtools/bugzilla/template/en/default/bug/comments.html.tmpl,v  <--  comments.html.tmpl                                                                            
new revision: 1.45; previous revision: 1.44                                               
done
Checking in template/en/default/bug/edit.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/bug/edit.html.tmpl,v  <--  edit.html.tmpl
new revision: 1.170; previous revision: 1.169
done
Checking in template/en/default/bug/show-multiple.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/bug/show-multiple.html.tmpl,v  <--  show-multiple.html.tmpl
new revision: 1.47; previous revision: 1.46
done
Checking in template/en/default/bug/show.xml.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/bug/show.xml.tmpl,v  <--  show.xml.tmpl
new revision: 1.36; previous revision: 1.35
done
Checking in template/en/default/bug/create/create.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/bug/create/create.html.tmpl,v  <--  create.html.tmpl
new revision: 1.98; previous revision: 1.97
done
Checking in template/en/default/list/edit-multiple.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/list/edit-multiple.html.tmpl,v  <--  edit-multiple.html.tmpl
new revision: 1.59; previous revision: 1.58
done
Checking in template/en/default/list/list.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/list/list.html.tmpl,v  <--  list.html.tmpl
new revision: 1.70; previous revision: 1.69
done
Checking in template/en/default/search/form.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/search/form.html.tmpl,v  <--  form.html.tmpl
new revision: 1.62; previous revision: 1.61
done
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: