event refactor, landing on HEAD!
[freeside.git] / FS / FS / part_event / Condition / pkg_status.pm
diff --git a/FS/FS/part_event/Condition/pkg_status.pm b/FS/FS/part_event/Condition/pkg_status.pm
new file mode 100644 (file)
index 0000000..6c1c9cc
--- /dev/null
@@ -0,0 +1,37 @@
+package FS::part_event::Condition::pkg_status;
+
+use strict;
+
+use base qw( FS::part_event::Condition );
+use FS::Record qw( qsearch );
+
+sub description {
+  'Package Status';
+}
+
+sub eventtable_hashref {
+    { 'cust_main' => 0,
+      'cust_bill' => 0,
+      'cust_pkg'  => 1,
+    };
+}
+
+#something like this
+sub option_fields {
+  (
+    'status'  => { 'label'    => 'Package Status',
+                   'type'     => 'select-cust_pkg-status',
+                   'multiple' => 1,
+                 },
+  );
+}
+
+sub condition {
+  my( $self, $cust_pkg ) = @_;
+
+  #XXX test
+  my $hashref = $self->option('status') || {};
+  $hashref->{ $cust_pkg->status };
+}
+
+1;