[Rt-commit] r17730 - in rt/3.999/trunk: .
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Tue Jan 13 06:30:28 EST 2009
Author: sunnavy
Date: Tue Jan 13 06:30:28 2009
New Revision: 17730
Modified:
rt/3.999/trunk/ (props changed)
rt/3.999/trunk/lib/RT/Model/Attachment.pm
rt/3.999/trunk/lib/RT/Model/Attribute.pm
rt/3.999/trunk/lib/RT/Model/CustomField.pm
rt/3.999/trunk/lib/RT/Model/CustomFieldValue.pm
rt/3.999/trunk/lib/RT/Model/Link.pm
rt/3.999/trunk/lib/RT/Model/ObjectCustomField.pm
rt/3.999/trunk/lib/RT/Model/ObjectCustomFieldValue.pm
rt/3.999/trunk/lib/RT/Model/Queue.pm
rt/3.999/trunk/lib/RT/Model/Scrip.pm
rt/3.999/trunk/lib/RT/Model/ScripAction.pm
rt/3.999/trunk/lib/RT/Model/ScripCondition.pm
rt/3.999/trunk/lib/RT/Model/Template.pm
rt/3.999/trunk/lib/RT/Model/Ticket.pm
rt/3.999/trunk/lib/RT/Model/Transaction.pm
rt/3.999/trunk/lib/RT/Model/User.pm
Log:
r18753 at sunnavys-mb: sunnavy | 2009-01-13 15:57:26 +0800
use ActorMetadata totally except User, which is a todo
Modified: rt/3.999/trunk/lib/RT/Model/Attachment.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Model/Attachment.pm (original)
+++ rt/3.999/trunk/lib/RT/Model/Attachment.pm Tue Jan 13 06:30:28 2009
@@ -92,10 +92,14 @@
column content => type is 'blob', default is '';
column content_encoding => type is 'blob', default is '';
column headers => type is 'blob', default is '';
- column creator => references RT::Model::Principal;
- column created => type is 'timestamp';
};
+use Jifty::Plugin::ActorMetadata::Mixin::Model::ActorMetadata
+ user_class => 'RT::Model::Principal',
+ map => {
+ created_by => 'creator',
+ created_on => 'created',
+ };
=head2 create
Modified: rt/3.999/trunk/lib/RT/Model/Attribute.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Model/Attribute.pm (original)
+++ rt/3.999/trunk/lib/RT/Model/Attribute.pm Tue Jan 13 06:30:28 2009
@@ -73,8 +73,12 @@
column content => type is 'blob', default is '';
};
-
-use Jifty::Plugin::ActorMetadata::Mixin::Model::ActorMetadata; # created_by, created_on, updated_by and updated_on
+use Jifty::Plugin::ActorMetadata::Mixin::Model::ActorMetadata map => {
+ created_by => 'creator',
+ created_on => 'created',
+ updated_by => 'last_updated_by',
+ updated_on => 'last_updated'
+};
=head1 name
Modified: rt/3.999/trunk/lib/RT/Model/CustomField.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Model/CustomField.pm (original)
+++ rt/3.999/trunk/lib/RT/Model/CustomField.pm Tue Jan 13 06:30:28 2009
@@ -73,13 +73,19 @@
column
lookup_type => max_length is 255,
type is 'varchar(255)', default is '';
- column creator => references RT::Model::Principal;
- column created => type is 'timestamp';
- column last_updated_by => references RT::Model::Principal;
- column last_updated => type is 'timestamp';
column disabled => max_length is 6, type is 'smallint', default is '0';
};
+use Jifty::Plugin::ActorMetadata::Mixin::Model::ActorMetadata
+ user_class => 'RT::Model::Principal',
+ map => {
+ created_by => 'creator',
+ created_on => 'created',
+ updated_by => 'last_updated_by',
+ updated_on => 'last_updated'
+ };
+
+
our %FieldTypes = (
Select => [
'Select multiple values', # loc
Modified: rt/3.999/trunk/lib/RT/Model/CustomFieldValue.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Model/CustomFieldValue.pm (original)
+++ rt/3.999/trunk/lib/RT/Model/CustomFieldValue.pm Tue Jan 13 06:30:28 2009
@@ -53,18 +53,21 @@
sub table {'CustomFieldValues'}
use Jifty::DBI::Schema;
use Jifty::DBI::Record schema {
- column creator => references RT::Model::User;
- column last_updated_by => references RT::Model::User;
column sort_order => type is 'int', max_length is 11, default is '0';
column custom_field => type is 'int', max_length is 11, default is '0';
- column created => type is 'timestamp';
- column last_updated => type is 'timestamp';
column name => type is 'varchar(200)', max_length is 200, default is '';
column
description => type is 'varchar(255)',
max_length is 255, default is '';
};
+use Jifty::Plugin::ActorMetadata::Mixin::Model::ActorMetadata map => {
+ created_by => 'creator',
+ created_on => 'created',
+ updated_by => 'last_updated_by',
+ updated_on => 'last_updated'
+};
+
=head2 validatename
Modified: rt/3.999/trunk/lib/RT/Model/Link.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Model/Link.pm (original)
+++ rt/3.999/trunk/lib/RT/Model/Link.pm Tue Jan 13 06:30:28 2009
@@ -80,13 +80,16 @@
column base => type is 'varchar(240)', max_length is 240, default is '';
column local_base => type is 'int'; #references RT::Model::Ticket;
column local_target => type is 'int'; #references RT::Model::Ticket;
- column creator => references RT::Model::User;
column type => type is 'varchar(20)', max_length is 20, default is '';
- column last_updated_by => references RT::Model::User;
- column created => type is 'timestamp';
- column last_updated => type is 'timestamp';
};
+use Jifty::Plugin::ActorMetadata::Mixin::Model::ActorMetadata
+map => {
+ created_by => 'creator',
+ created_on => 'created',
+ updated_by => 'last_updated_by',
+ updated_on => 'last_updated'
+};
use Carp;
use RT::URI;
Modified: rt/3.999/trunk/lib/RT/Model/ObjectCustomField.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Model/ObjectCustomField.pm (original)
+++ rt/3.999/trunk/lib/RT/Model/ObjectCustomField.pm Tue Jan 13 06:30:28 2009
@@ -58,13 +58,16 @@
column custom_field => references RT::Model::CustomField;
column object_id => type is 'int', max_length is 11, default is '0';
column sort_order => type is 'int', max_length is 11, default is '0';
- column creator => references RT::Model::User;
- column created => type is 'timestamp';
- column last_updated_by => references RT::Model::User;
- column last_updated => type is 'timestamp';
+};
+use Jifty::Plugin::ActorMetadata::Mixin::Model::ActorMetadata map => {
+ created_by => 'creator',
+ created_on => 'created',
+ updated_by => 'last_updated_by',
+ updated_on => 'last_updated'
};
+
sub create {
my $self = shift;
my %args = (
Modified: rt/3.999/trunk/lib/RT/Model/ObjectCustomFieldValue.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Model/ObjectCustomFieldValue.pm (original)
+++ rt/3.999/trunk/lib/RT/Model/ObjectCustomFieldValue.pm Tue Jan 13 06:30:28 2009
@@ -61,24 +61,28 @@
content_type => type is 'varchar(80)',
max_length is 80, default is '';
column large_content => type is 'blob', default is '';
- column creator => references RT::Model::User;
column object_id => type is 'int', max_length is 11, default is '0';
- column last_updated_by => references RT::Model::User;
column disabled => type is 'smallint', max_length is 6, default is '0';
column sort_order => type is 'int', max_length is 11, default is '0';
- column created => type is 'timestamp';
column custom_field => references RT::Model::CustomField;
column content => type is 'varchar(255)', max_length is 255, default is '';
column
content_encoding => type is 'varchar(80)',
max_length is 80, default is '';
- column last_updated => type is 'timestamp';
column
object_type => type is 'varchar(255)',
max_length is 255, default is '';
};
+use Jifty::Plugin::ActorMetadata::Mixin::Model::ActorMetadata map => {
+ created_by => 'creator',
+ created_on => 'created',
+ updated_by => 'last_updated_by',
+ updated_on => 'last_updated'
+};
+
+
sub create {
my $self = shift;
my %args = (
Modified: rt/3.999/trunk/lib/RT/Model/Queue.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Model/Queue.pm (original)
+++ rt/3.999/trunk/lib/RT/Model/Queue.pm Tue Jan 13 06:30:28 2009
@@ -89,12 +89,17 @@
column initial_priority => max_length is 11, type is 'int', default is '0';
column final_priority => max_length is 11, type is 'int', default is '0';
column default_due_in => max_length is 11, type is 'int', default is '0';
- column creator => references RT::Model::User;
- column created => type is 'timestamp';
- column last_updated_by => references RT::Model::User;
- column last_updated => type is 'timestamp';
column disabled => max_length is 6, type is 'smallint', is mandatory, default is '0';
};
+use Jifty::Plugin::ActorMetadata::Mixin::Model::ActorMetadata
+no_user_refs => 1,
+map => {
+ created_by => 'creator',
+ created_on => 'created',
+ updated_by => 'last_updated_by',
+ updated_on => 'last_updated'
+};
+
our @DEFAULT_ACTIVE_STATUS = qw(new open stalled);
our @DEFAULT_INACTIVE_STATUS = qw(resolved rejected deleted);
Modified: rt/3.999/trunk/lib/RT/Model/Scrip.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Model/Scrip.pm (original)
+++ rt/3.999/trunk/lib/RT/Model/Scrip.pm Tue Jan 13 06:30:28 2009
@@ -75,7 +75,12 @@
column custom_commit_code => type is 'text';
column custom_is_applicable_code => type is 'text';
};
-use Jifty::Plugin::ActorMetadata::Mixin::Model::ActorMetadata; # created_by, created_on, updated_by and updated_on
+use Jifty::Plugin::ActorMetadata::Mixin::Model::ActorMetadata map => {
+ created_by => 'creator',
+ created_on => 'created',
+ updated_by => 'last_updated_by',
+ updated_on => 'last_updated'
+};
=head2 create
Modified: rt/3.999/trunk/lib/RT/Model/ScripAction.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Model/ScripAction.pm (original)
+++ rt/3.999/trunk/lib/RT/Model/ScripAction.pm Tue Jan 13 06:30:28 2009
@@ -80,12 +80,14 @@
column description => type is 'text';
column exec_module => type is 'text';
column argument => type is 'text';
- column creator => references RT::Model::User;
- column created => type is 'timestamp';
- column last_updated_by => references RT::Model::User;
- column last_updated => type is 'timestamp';
-
};
+use Jifty::Plugin::ActorMetadata::Mixin::Model::ActorMetadata map => {
+ created_by => 'creator',
+ created_on => 'created',
+ updated_by => 'last_updated_by',
+ updated_on => 'last_updated'
+};
+
=head2 create
Modified: rt/3.999/trunk/lib/RT/Model/ScripCondition.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Model/ScripCondition.pm (original)
+++ rt/3.999/trunk/lib/RT/Model/ScripCondition.pm Tue Jan 13 06:30:28 2009
@@ -80,12 +80,15 @@
column exec_module => type is 'text';
column argument => type is 'text';
column applicable_trans_types => type is 'text';
- column creator => references RT::Model::User;
- column created => type is 'timestamp';
- column last_updated_by => references RT::Model::User;
- column last_updated => type is 'timestamp';
};
+use Jifty::Plugin::ActorMetadata::Mixin::Model::ActorMetadata map => {
+ created_by => 'creator',
+ created_on => 'created',
+ updated_by => 'last_updated_by',
+ updated_on => 'last_updated'
+};
+
=head2 delete
Modified: rt/3.999/trunk/lib/RT/Model/Template.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Model/Template.pm (original)
+++ rt/3.999/trunk/lib/RT/Model/Template.pm Tue Jan 13 06:30:28 2009
@@ -85,12 +85,16 @@
type is 'varchar(255)', default is '';
column type => max_length is 16, type is 'varchar(16)', default is '';
column content => type is 'text', default is '', filters are 'Jifty::DBI::Filter::utf8';
- column last_updated => type is 'timestamp';
- column last_updated_by => references RT::Model::User;
- column created => type is 'timestamp';
- column creator => references RT::Model::User;
};
+use Jifty::Plugin::ActorMetadata::Mixin::Model::ActorMetadata map => {
+ created_by => 'creator',
+ created_on => 'created',
+ updated_by => 'last_updated_by',
+ updated_on => 'last_updated'
+};
+
+
=head2 load <identifer>
Load a template, either by number (id) or by name.
Modified: rt/3.999/trunk/lib/RT/Model/Ticket.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Model/Ticket.pm (original)
+++ rt/3.999/trunk/lib/RT/Model/Ticket.pm Tue Jan 13 06:30:28 2009
@@ -120,12 +120,15 @@
render_as 'DateTime',
label is _('Due');
column resolved => type is 'timestamp';
- column last_updated_by => references RT::Model::User;
- column last_updated => type is 'timestamp';
- column creator => references RT::Model::User;
- column created => type is 'timestamp';
column disabled => max_length is 6, type is 'smallint', default is '0';
};
+use Jifty::Plugin::ActorMetadata::Mixin::Model::ActorMetadata map => {
+ created_by => 'creator',
+ created_on => 'created',
+ updated_by => 'last_updated_by',
+ updated_on => 'last_updated'
+};
+
# A helper table for links mapping to make it easier
# to build and parse links between tickets
Modified: rt/3.999/trunk/lib/RT/Model/Transaction.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Model/Transaction.pm (original)
+++ rt/3.999/trunk/lib/RT/Model/Transaction.pm Tue Jan 13 06:30:28 2009
@@ -88,9 +88,10 @@
column old_reference => max_length is 11, type is 'int';
column new_reference => max_length is 11, type is 'int';
column data => max_length is 255, type is 'varchar(255)', default is '';
- column creator => references RT::Model::User;
- column created => type is 'timestamp';
-
+};
+use Jifty::Plugin::ActorMetadata::Mixin::Model::ActorMetadata map => {
+ created_by => 'creator',
+ created_on => 'created',
};
=head2 object_type
Modified: rt/3.999/trunk/lib/RT/Model/User.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Model/User.pm (original)
+++ rt/3.999/trunk/lib/RT/Model/User.pm Tue Jan 13 06:30:28 2009
@@ -125,11 +125,16 @@
column timezone => max_length is 50, type is 'varchar(50)', default is '';
column pgp_key => type is 'text';
+# column creator => references RT::Model::User, render_as 'hidden';
+# column last_updated_by => references RT::Model::User, render_as 'hidden';
+# column created => type is 'timestamp', render_as 'hidden';
+# column last_updated => type is 'timestamp', render_as 'hidden';
};
use Jifty::Plugin::User::Mixin::Model::User; # name, email, email_confirmed
use Jifty::Plugin::Authentication::Password::Mixin::Model::User;
-#use Jifty::Plugin::ActorMetadata::Mixin::Model::ActorMetadata; # created_by, created_on, updated_by and updated_on
+# TODO ActorMetadata can't work in User
+# use Jifty::Plugin::ActorMetadata::Mixin::Model::ActorMetadata; # created_by, created_on, updated_by and updated_on
# XXX TODO, merging params should 'just work' but does not
__PACKAGE__->column('email')->writable(1);
More information about the Rt-commit
mailing list