[Bps-public-commit] r14793 - in sd: trunk/lib/App/SD/Model
spang at bestpractical.com
spang at bestpractical.com
Tue Aug 5 14:07:53 EDT 2008
Author: spang
Date: Tue Aug 5 14:07:53 2008
New Revision: 14793
Modified:
sd/ (props changed)
sd/trunk/lib/App/SD/Model/Ticket.pm
Log:
r47740 at loki: spang | 2008-08-05 18:54:37 +0100
complete pod for Model/Ticket.pm
Modified: sd/trunk/lib/App/SD/Model/Ticket.pm
==============================================================================
--- sd/trunk/lib/App/SD/Model/Ticket.pm (original)
+++ sd/trunk/lib/App/SD/Model/Ticket.pm Tue Aug 5 14:07:53 2008
@@ -10,14 +10,30 @@
=head2 default_prop_status
-The default value of the status prop. Returns a string.
+Returns a string of the default value of the status prop.
=cut
sub default_prop_status { 'new' }
+=head2 _default_summary_format
+
+The default ticket summary format (used for displaying tickets in a
+list, generally).
+
+=cut
+
sub _default_summary_format { '%s,$luid | %s,summary | %s,status' }
+=head2 validate_prop_status { props = $hashref, errors = $hashref }
+
+Determines whether the status prop value given in C<$args{props}{status}>
+is valid.
+
+Returns true if the status is valid. If the status is invalid, sets
+C<$args{errors}{status}> to an error message and returns false.
+
+=cut
sub validate_prop_status {
my ($self, %args) = @_;
@@ -32,6 +48,13 @@
}
+=head2 color_prop_status $value
+
+Returns the stats prop value C<$value> wrapped in colorization escape
+codes (from L<Term::ANSIColor>).
+
+=cut
+
sub color_prop_status {
my ($self, $value) = @_;
@@ -45,6 +68,13 @@
return colored($value, $color);
}
+=head2 color_prop_due $due
+
+Returns the due prop value C<$due> wrapped in colorization escape
+codes if it is overdue.
+
+=cut
+
sub color_prop_due {
my ($self, $due) = @_;
@@ -63,6 +93,15 @@
('id', 'summary', 'status', 'owner', 'created', 'due', 'creator', 'reported_by', 'CF-Broken in', 'CF-Severity')
}
+=head2 is_overdue [$date]
+
+Takes an ISO date (or uses the C<date> prop value if no date is given).
+
+Returns false if the date is not a valid ISO date or its due date is
+in the future. Returns true if the due date has passed.
+
+=cut
+
# this expects ISO dates. we should improve it in the future to require
sub is_overdue {
my $self = shift;
More information about the Bps-public-commit
mailing list