Do the check also for SelfService (require RT 3.8.3 at least)
authorEmmanuel Lacour <elacour@easter-eggs.com>
Fri, 3 Jul 2009 09:55:47 +0000 (11:55 +0200)
committerEmmanuel Lacour <elacour@easter-eggs.com>
Fri, 3 Jul 2009 09:55:47 +0000 (11:55 +0200)
html/Callbacks/MandatorySubject/SelfService/Create.html/BeforeCreate [new file with mode: 0644]

diff --git a/html/Callbacks/MandatorySubject/SelfService/Create.html/BeforeCreate b/html/Callbacks/MandatorySubject/SelfService/Create.html/BeforeCreate
new file mode 100644 (file)
index 0000000..57111e2
--- /dev/null
@@ -0,0 +1,13 @@
+<%INIT>
+my $ARGSRef = $ARGS{'ARGSRef'};
+if ( (defined($$ARGSRef{'id'}) and $$ARGSRef{'id'} eq 'new') ) {
+    if ( (!$$ARGSRef{'Subject'}) || ($$ARGSRef{'Subject'} =~ /^[ \t]*$/) ) {
+        $$skip_create = 1;
+        push @{$results}, loc('Error: empty subject');
+    }
+}
+</%INIT>
+<%ARGS>
+$skip_create => undef
+$results => undef
+</%ARGS>