QuickCreateDisplay RT pref and config option to redirect to ticket display on quick...
authorivan <ivan>
Wed, 10 Nov 2010 23:12:41 +0000 (23:12 +0000)
committerivan <ivan>
Wed, 10 Nov 2010 23:12:41 +0000 (23:12 +0000)
rt/FREESIDE_MODIFIED
rt/etc/RT_SiteConfig.pm
rt/lib/RT/Config.pm
rt/share/html/index.html

index 45a6106..2200dcf 100644 (file)
@@ -25,6 +25,7 @@ lib/RT/URI/freeside/Internal.pm
 lib/RT/URI/freeside/XMLRPC.pm
 
  share/html/autohandler #Footer getting appended where unwelcome
+ share/html/index.html #option to redirect to ticket display on quick create
  share/html/Admin/CustomFields/Modify.html #CheckMandatoryFields
  share/html/Admin/Users/Modify.html
  share/html/Elements/CollectionList
index eb2d09a..f833f0d 100644 (file)
@@ -49,5 +49,8 @@ Set($UsernameFormat, 'verbose'); #back to concise to hide email addresses
 Set($MessageBoxWidth, 80);
 Set($MessageBoxRichTextHeight, 368);
 
+#redirects to ticket display on quick create
+#Set($QuickCreateRedirect, 1);
+
 #Set(@Plugins,(qw(Extension::QuickDelete RT::FM)));
 1;
index ce66bb6..3634557 100644 (file)
@@ -313,6 +313,16 @@ our %META = (
             Hints => 'Use css rules to display text monospaced and with formatting preserved, but wrap as needed.  This does not work well with IE6 and you should use the previous option', #loc
         },
     },
+    QuickCreateDisplay => {
+        Section         => 'Ticket display',
+        Overridable     => 1,
+        SortOrder       => 6,
+        Widget          => '/Widgets/Form/Boolean',
+        WidgetArguments => {
+            Description => 'On Quick Create, redirect to ticket display', #loc
+            #Hints => '', #loc
+        },
+    },
 
     # User overridable locale options
     DateTimeFormat => {
index ad9964c..2d70358 100755 (executable)
@@ -115,7 +115,11 @@ if ( $ARGS{'QuickCreate'} ) {
                         From => $session{'CurrentUser'}->EmailAddress,
                         Content => $ARGS{'Content'},
                         Subject => $ARGS{'Subject'});
-        push @results, $msg;
+        if ( $t && $t->Id && RT->Config->Get('QuickCreateDisplay', $session{'CurrentUser'}) ) {
+          RT::Interface::Web::Redirect(RT->Config->Get('WebURL')."Ticket/Display.html?id=". $t->Id);
+        } else {
+          push @results, $msg;
+        }
     }
     elsif ( !$ValidCFs ) {
         push @results, "can't quickly create ticket in queue " .