[Rt-commit] r7320 - in rt/branches/3.7-EXPERIMENTAL: .

ruz at bestpractical.com ruz at bestpractical.com
Thu Mar 22 21:37:36 EDT 2007


Author: ruz
Date: Thu Mar 22 21:37:36 2007
New Revision: 7320

Modified:
   rt/branches/3.7-EXPERIMENTAL/   (props changed)
   rt/branches/3.7-EXPERIMENTAL/lib/RT/Attachments_Overlay.pm

Log:
 r4772 at cubic-pc:  cubic | 2007-03-21 16:07:46 +0300
 * add Attachments::LimitNotEmpty


Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Attachments_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Attachments_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Attachments_Overlay.pm	Thu Mar 22 21:37:36 2007
@@ -131,7 +131,30 @@
         VALUE => $attachment
     );
 }
-# }}}
+
+=head2 LimitNotEmpty
+
+Limit result set to attachments with not empty content.
+
+=cut
+
+sub LimitNotEmpty {
+    my $self = shift;
+    $self->Limit(
+        ENTRYAGGREGATOR => 'AND',
+        FIELD           => 'Content',
+        OPERATOR        => 'IS NOT',
+        VALUE           => 'NULL',
+        QUOTEVALUE      => 0,
+    );
+    $self->Limit(
+        ENTRYAGGREGATOR => 'AND',
+        FIELD           => 'Content',
+        OPERATOR        => '!=',
+        VALUE           => '',
+    );
+    return;
+}
 
 # {{{ sub NewItem 
 sub NewItem  {


More information about the Rt-commit mailing list