[Bps-public-commit] r19071 - in RT-FormTools: .

sartak at bestpractical.com sartak at bestpractical.com
Tue Apr 7 00:37:23 EDT 2009


Author: sartak
Date: Tue Apr  7 00:37:21 2009
New Revision: 19071

Modified:
   RT-FormTools/   (props changed)
   RT-FormTools/html/FormTools/Field

Log:
 r81782 at onn:  sartak | 2009-04-07 00:37:15 -0400
 Basic support for accepting a ticket and its values instead of a queue


Modified: RT-FormTools/html/FormTools/Field
==============================================================================
--- RT-FormTools/html/FormTools/Field	(original)
+++ RT-FormTools/html/FormTools/Field	Tue Apr  7 00:37:21 2009
@@ -12,15 +12,20 @@
 use RT::Extension::FormTools;
 my $NamePrefix = "Object-RT::Ticket--CustomField-";
 my $queue      = $m->notes('queue');
+my $ticket     = $m->notes('ticket');
 my $field_type = 'custom';
 my $field_label ||= $label;
 my $cf;
 
+$queue = $ticket->QueueObj
+    if !$queue && $ticket;
+
 if ( RT::Extension::FormTools::is_core_field($name) ) {
     $field_type = 'core';
     my $res = $m->notes(
         core_fields_on_page => [ @{$m->notes('core_fields_on_page')||[]}, $name ] );
     $field_label ||= $name;
+    $default ||= $ticket->$name if $ticket;
 } else {
 
     $cf = RT::CustomField->new( $session{'CurrentUser'} );
@@ -32,6 +37,7 @@
 
     $m->notes( cfs_on_page => [ @{$m->notes('cfs_on_page')||[]}, $cf->id ] );
     $field_label ||= $cf->Name;
+    $default ||= $ticket->FirstCustomFieldValue($name) if $ticket;
 }
 
 



More information about the Bps-public-commit mailing list