diff options
author | Jesse Vincent <jesse@bestpractical.com> | 2004-04-20 06:26:50 +0400 |
---|---|---|
committer | Jesse Vincent <jesse@bestpractical.com> | 2004-04-20 06:26:50 +0400 |
commit | 6ac0813ab2b318e317a93eea63e93999e214204e (patch) | |
tree | 9bb723e3c5560e9d73b7d5f0921363e97bafeb67 | |
parent | 3665ee0e9048a53d115fad10f054d2a43921fe5d (diff) |
"Another pass at trying to fix the schema"rt-3.3.2
git-svn-id: svn+ssh://svn.bestpractical.com/svn/bps-public/rt/branches/rt-3.3@703 e417ac7c-1bcc-0310-8ffa-8f5827389a85
-rwxr-xr-x | etc/schema.Pg | 1 | ||||
-rw-r--r-- | html/Ticket/Elements/FindAttachments | 13 | ||||
-rw-r--r-- | html/Ticket/Elements/LoadTextAttachments | 8 | ||||
-rwxr-xr-x | lib/RT/Transaction_Overlay.pm | 2 |
4 files changed, 17 insertions, 7 deletions
diff --git a/etc/schema.Pg b/etc/schema.Pg index d8c9fc998e..c54da02b4f 100755 --- a/etc/schema.Pg +++ b/etc/schema.Pg @@ -490,6 +490,7 @@ CREATE TABLE ObjectCustomFieldValues ( id INTEGER DEFAULT nextval('objectcustomfieldvalues_id_s'), CustomField int NOT NULL , ObjectType varchar(255) NULL , + ObjectId int NOT NULL , Current int DEFAULT 1, Content varchar(255) NULL , LargeContent text NULL, diff --git a/html/Ticket/Elements/FindAttachments b/html/Ticket/Elements/FindAttachments index f4bbc42149..57ad59eba0 100644 --- a/html/Ticket/Elements/FindAttachments +++ b/html/Ticket/Elements/FindAttachments @@ -18,11 +18,14 @@ $attachments->Join( ALIAS1 => 'main', my $tickets = $attachments->NewAlias('Tickets'); -$attachments->Join( ALIAS1 => $transactions, - FIELD1 => 'Ticket', - ALIAS2 => $tickets, - FIELD2 => 'id' ); - + $attachments->Join( ALIAS1 => $transactions, + FIELD1 => 'ObjectId', + ALIAS2 => $tickets, + FIELD2 => 'id' ); + + $attachments->Limit( ALIAS => $transactions, + FIELD => 'ObjectType', + VALUE => 'RT::Ticket'); if ($Tickets) { while ($Ticket = $Tickets->Next) { $attachments->Limit( ALIAS => $tickets, diff --git a/html/Ticket/Elements/LoadTextAttachments b/html/Ticket/Elements/LoadTextAttachments index 084502e4cb..dadce48676 100644 --- a/html/Ticket/Elements/LoadTextAttachments +++ b/html/Ticket/Elements/LoadTextAttachments @@ -13,11 +13,17 @@ if ( $Ticket->CurrentUserHasRight('ShowTicket') ) { my $tickets = $attachments->NewAlias('Tickets'); + $attachments->Join( ALIAS1 => $transactions, - FIELD1 => 'Ticket', + FIELD1 => 'ObjectId', ALIAS2 => $tickets, FIELD2 => 'id' ); + $attachments->Limit( ALIAS => $transactions, + FIELD => 'ObjectType', + VALUE => 'RT::Ticket'); + + $attachments->Limit( ALIAS => $tickets, FIELD => 'EffectiveId', VALUE => $Ticket->id() ); diff --git a/lib/RT/Transaction_Overlay.pm b/lib/RT/Transaction_Overlay.pm index db13eebeac..f8e4f80a66 100755 --- a/lib/RT/Transaction_Overlay.pm +++ b/lib/RT/Transaction_Overlay.pm @@ -872,7 +872,7 @@ sub NewValue { sub Object { my $self = shift; my $Object = $self->__Value('ObjectType')->new($self->CurrentUser); - $Object->Load($self->__Value('Ticket')); + $Object->Load($self->__Value('ObjectId')); return($Object); } |