summaryrefslogtreecommitdiff
path: root/FS/FS/part_event/Condition/once.pm
diff options
context:
space:
mode:
authorcvs2git <cvs2git>2008-03-16 19:58:34 +0000
committercvs2git <cvs2git>2008-03-16 19:58:34 +0000
commiteb061f5119325e666f0dff40d4089e5c1df58e17 (patch)
treed55e8fef5aca62eb13bbc8ad20dbdf941c3bd266 /FS/FS/part_event/Condition/once.pm
parent3a17b276638200475d54201fa62566b7440e819a (diff)
This commit was manufactured by cvs2svn to create tag 'TRIXBOX_2_6'.TRIXBOX_2_6
Diffstat (limited to 'FS/FS/part_event/Condition/once.pm')
-rw-r--r--FS/FS/part_event/Condition/once.pm55
1 files changed, 0 insertions, 55 deletions
diff --git a/FS/FS/part_event/Condition/once.pm b/FS/FS/part_event/Condition/once.pm
deleted file mode 100644
index 5a9161f..0000000
--- a/FS/FS/part_event/Condition/once.pm
+++ /dev/null
@@ -1,55 +0,0 @@
-package FS::part_event::Condition::once;
-
-use strict;
-use FS::Record qw( qsearch );
-use FS::part_event;
-use FS::cust_event;
-
-use base qw( FS::part_event::Condition );
-
-sub description { "Don't run this event again after it has completed sucessfully"; }
-
-sub implicit_flag { 10; }
-
-sub remove_warning {
- 'Are you sure you want to remove this condition? Doing so will allow this event to run every time the other conditions are satisfied, even if it has already run sucessfully.'; #better error msg?
-}
-
-sub condition {
- my($self, $object, %opt) = @_;
-
- my $obj_pkey = $object->primary_key;
- my $tablenum = $object->$obj_pkey();
-
- my @existing = qsearch( {
- 'table' => 'cust_event',
- 'hashref' => {
- 'eventpart' => $self->eventpart,
- 'tablenum' => $tablenum,
- 'status' => { op=>'!=', value=>'failed' },
- },
- 'extra_sql' => ( $opt{'cust_event'}->eventnum =~ /^(\d+)$/
- ? " AND eventnum != $1 "
- : ''
- ),
- } );
-
- ! scalar(@existing);
-
-}
-
-sub condition_sql {
- my( $self, $table ) = @_;
-
- my %tablenum = %{ FS::part_event->eventtable_pkey_sql };
-
- "0 = ( SELECT COUNT(*) FROM cust_event
- WHERE cust_event.eventpart = part_event.eventpart
- AND cust_event.tablenum = $tablenum{$table}
- AND status != 'failed'
- )
- ";
-
-}
-
-1;