[Bps-public-commit] r16154 - in sd/trunk: . lib/App/SD/CLI/Model
spang at bestpractical.com
spang at bestpractical.com
Mon Sep 29 18:16:32 EDT 2008
Author: spang
Date: Mon Sep 29 18:16:32 2008
New Revision: 16154
Modified:
sd/trunk/ (props changed)
sd/trunk/lib/App/SD/CLI/Model/Ticket.pm
sd/trunk/lib/App/SD/Model/Ticket.pm
Log:
r50156 at loki: spang | 2008-09-28 21:03:58 -0400
make reported_by default to the reporter_email config var or ENV{EMAIL}, and
don't display id/created date in sd ticket create because they can't be
created until the record is actually created
Modified: sd/trunk/lib/App/SD/CLI/Model/Ticket.pm
==============================================================================
--- sd/trunk/lib/App/SD/CLI/Model/Ticket.pm (original)
+++ sd/trunk/lib/App/SD/CLI/Model/Ticket.pm Mon Sep 29 18:16:32 2008
@@ -120,8 +120,15 @@
# that shouldn't be changed, such as uuid
foreach my $prop ($record->props_to_show) {
if ($prop =~ $props_not_to_edit) {
- push @metadata_order, $prop;
- $metadata_props{$prop} = undef;
+ unless ($prop eq 'id' or $prop eq 'created') {
+ push @metadata_order, $prop;
+ # which came first, the chicken or the egg?
+ #
+ # we don't want to display id/created because they can't by
+ # their nature be specified until the ticket is actually
+ # created
+ $metadata_props{$prop} = undef;
+ }
} else {
push @editable_order, $prop;
$editable_props{$prop} = undef;
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 Mon Sep 29 18:16:32 2008
@@ -10,12 +10,24 @@
=head2 default_prop_status
-Returns a string of the default value of the status prop.
+Returns a string of the default value of the C<status> prop.
=cut
sub default_prop_status { 'new' }
+=head2 default_prop_reported_by
+
+Returns a string of the default value of the C<reported_by> prop.
+(Currently, this is the config variable C<reporter_email> or
+the environmental variable C<EMAIL>.)
+
+=cut
+
+sub default_prop_reported_by {
+ shift->app_handle->config->{reporter_email} or $ENV{EMAIL}
+}
+
=head2 _default_summary_format
The default ticket summary format (used for displaying tickets in a
More information about the Bps-public-commit
mailing list