From: Emmanuel Lacour Date: Fri, 20 Nov 2009 23:58:24 +0000 (+0100) Subject: Add a callback to check subject in QuickCreate (need RT >= 3.8.7) X-Git-Tag: 0.04~5 X-Git-Url: http://git.home-dn.net/?p=manu%2FRT-Extension-MandatorySubject.git;a=commitdiff_plain;h=ce04ecd7a76dfc9e02d015de2ce8dfb0ffadd142 Add a callback to check subject in QuickCreate (need RT >= 3.8.7) --- diff --git a/html/Callbacks/MandatorySubject/index.html/Initial b/html/Callbacks/MandatorySubject/index.html/Initial new file mode 100644 index 0000000..0bd50e2 --- /dev/null +++ b/html/Callbacks/MandatorySubject/index.html/Initial @@ -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'); + } +} + +<%ARGS> +$skip_create => undef +$results => undef +