This should be a pretty simple move -- FormatTimeUnit() is basically just a utility function, and can just be moved directly to Bugzilla::Util.
Created attachment 170717 [details] [diff] [review] Tested Patch for Tip OK, here's a patch that I just made -- it was pretty easy, only BugMail.pm uses the function at all. There's also a duplicate function implemented in the templates at default/bug/time.html.tmpl, in the "formattimeunit" block. It would be nice if I could just make that code call this code. Is there a way to sensibly do that?
Created attachment 170718 [details] [diff] [review] Version 1.1 Oh, this one has the right function name in the pod docs. (I changed the function name, by the way -- FormatTimeUnit didn't seem very intuitive to me. Neither does this one, but I think it's a bit better.)
Comment on attachment 170718 [details] [diff] [review] Version 1.1 At first, I disliked the renaming because of having to change BugMail.pm without need. But renaming keeps Util.pm consistent in this regard, so I'd say it's worth it.
Attachment #170718 - Flags: review? → review+
Targeting bug to 2.20 since the 2.20 feature freeze was canceled.
Target Milestone: --- → Bugzilla 2.20
Checking in globals.pl; /cvsroot/mozilla/webtools/bugzilla/globals.pl,v <-- globals.pl new revision: 1.282; previous revision: 1.281 done Checking in Bugzilla/BugMail.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/BugMail.pm,v <-- BugMail.pm new revision: 1.20; previous revision: 1.19 done Checking in Bugzilla/Util.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Util.pm,v <-- Util.pm new revision: 1.16; previous revision: 1.15 done
Status: NEW → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED
Summary: Move FormatTimeUnit() out of globals.pl → Move FormatTimeUnit() out of globals.pl in Bugzilla/Util.pm
You need to log in before you can comment on or make changes to this bug.