Closed Bug 277618 Opened 20 years ago Closed 20 years ago

Move FormatTimeUnit() out of globals.pl in Bugzilla/Util.pm

Categories

(Bugzilla :: Bugzilla-General, enhancement)

2.19.1
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.20

People

(Reporter: mkanat, Assigned: mkanat)

References

Details

Attachments

(1 file, 1 obsolete file)

This should be a pretty simple move -- FormatTimeUnit() is basically just a
utility function, and can just be moved directly to Bugzilla::Util.
Attached patch Tested Patch for Tip (obsolete) — Splinter Review
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?
Attachment #170717 - Flags: review?
Attached patch Version 1.1Splinter Review
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.)
Attachment #170717 - Attachment is obsolete: true
Attachment #170718 - Flags: review?
Attachment #170717 - Flags: review?
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+
Flags: approval?
Targeting bug to 2.20 since the 2.20 feature freeze was canceled.
Target Milestone: --- → Bugzilla 2.20
Flags: approval? → approval+
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
Closed: 20 years ago
Resolution: --- → FIXED
Summary: Move FormatTimeUnit() out of globals.pl → Move FormatTimeUnit() out of globals.pl in Bugzilla/Util.pm
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: