[Rt-commit] r3467 - rt/branches/CHALDEA-EXPERIMENTAL/html/Ticket

autrijus at bestpractical.com autrijus at bestpractical.com
Tue Jul 12 23:34:47 EDT 2005


Author: autrijus
Date: Tue Jul 12 23:34:47 2005
New Revision: 3467

Modified:
   rt/branches/CHALDEA-EXPERIMENTAL/html/Ticket/Create.html
Log:
* invalid CFs in ticket creation times now warns.

Modified: rt/branches/CHALDEA-EXPERIMENTAL/html/Ticket/Create.html
==============================================================================
--- rt/branches/CHALDEA-EXPERIMENTAL/html/Ticket/Create.html	(original)
+++ rt/branches/CHALDEA-EXPERIMENTAL/html/Ticket/Create.html	Tue Jul 12 23:34:47 2005
@@ -47,6 +47,7 @@
 <& /Elements/Tabs, 
     current_toptab => "Ticket/Create.html", 
     Title => loc("Create a new ticket") &>
+<& /Elements/ListActions, actions => \@results &>
 <FORM ACTION="<%$RT::WebPath%>/Ticket/Create.html" METHOD="POST" ENCTYPE="multipart/form-data" NAME="TicketCreate">
 <INPUT TYPE=HIDDEN Name="id" VALUE="new">
 <A NAME="top">
@@ -248,7 +249,7 @@
 <%INIT>
 
 
-
+my @results;
 my $QueueObj = new RT::Queue($session{'CurrentUser'});
 $QueueObj->Load($Queue) || Abort(loc("Queue could not be loaded."));
 my $CFs = $QueueObj->TicketCustomFields();
@@ -305,10 +306,19 @@
 
 # }}}
 
-if ((!exists $ARGS{'AddMoreAttach'}) and ($ARGS{'id'} eq 'new') and $ValidCFs) { # new ticket?
-    $m->comp('Display.html', %ARGS);
-    $RT::Logger->crit("After display call; error is $@");
-    $m->abort();
+if ((!exists $ARGS{'AddMoreAttach'}) and ($ARGS{'id'} eq 'new')) { # new ticket?
+    if ($ValidCFs) {
+        $m->comp('Display.html', %ARGS);
+        $RT::Logger->crit("After display call; error is $@");
+        $m->abort();
+    }
+    else {
+        # Invalid CFs
+        while (my $CF = $CFs->Next) {
+            my $msg = $m->notes('InvalidField-' . $CF->Id) or next;
+            push @results, $CF->Name . ': ' . $msg;
+        }
+    }
 }
 </%INIT>
 


More information about the Rt-commit mailing list