Add a callback to check subject in QuickCreate (need RT >= 3.8.7)
authorEmmanuel Lacour <elacour@home-dn.net>
Fri, 20 Nov 2009 23:58:24 +0000 (00:58 +0100)
committerEmmanuel Lacour <elacour@home-dn.net>
Fri, 20 Nov 2009 23:58:24 +0000 (00:58 +0100)
html/Callbacks/MandatorySubject/index.html/Initial [new file with mode: 0644]

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