summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2007-10-05 00:39:58 +0000
committerivan <ivan>2007-10-05 00:39:58 +0000
commit7349e2c4d087cee96f677dc05e316885386428a7 (patch)
treed330a3ab7544d02c964a0bd728be6b10937435c6 /FS
parent15802280e2c56575afc85efd476a0d1aeea9e0a4 (diff)
add disable ability to conditions & disable cust_bill_has_service, so the condition edit page renders again
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/part_event/Condition.pm11
-rw-r--r--FS/FS/part_event/Condition/cust_bill_has_service.pm3
-rw-r--r--FS/FS/part_event_condition.pm4
3 files changed, 18 insertions, 0 deletions
diff --git a/FS/FS/part_event/Condition.pm b/FS/FS/part_event/Condition.pm
index 0b9d57912..3c0904c6c 100644
--- a/FS/FS/part_event/Condition.pm
+++ b/FS/FS/part_event/Condition.pm
@@ -152,6 +152,17 @@ sub condition_sql {
'true';
}
+=item disabled
+
+Condition classes may optionally define a disabled method. Returning a true
+value disbles the condition entirely.
+
+=cut
+
+sub disabled {
+ 0;
+}
+
=item implicit_flag
This is used internally by the I<once> and I<balance> conditions. You probably
diff --git a/FS/FS/part_event/Condition/cust_bill_has_service.pm b/FS/FS/part_event/Condition/cust_bill_has_service.pm
index c28047cdd..ff02035d3 100644
--- a/FS/FS/part_event/Condition/cust_bill_has_service.pm
+++ b/FS/FS/part_event/Condition/cust_bill_has_service.pm
@@ -16,6 +16,9 @@ sub eventtable_hashref {
};
}
+# could not find component for path '/elements/tr-select-part_svc.html'
+sub disabled { 1; }
+
sub option_fields {
(
'has_service' => { 'label' => 'Has service',
diff --git a/FS/FS/part_event_condition.pm b/FS/FS/part_event_condition.pm
index 200d4fcd6..d13e84927 100644
--- a/FS/FS/part_event_condition.pm
+++ b/FS/FS/part_event_condition.pm
@@ -191,6 +191,10 @@ foreach my $INC ( @INC ) {
#warn "error using $fullmod (skipping): $@\n" if $@;
#next;
}
+ if ( $fullmod->disabled ) {
+ warn "$fullmod is disabled; skipping\n";
+ next;
+ }
#my $full_condition_sql = $fullmod. '::condition_sql';
my $condition_sql_coderef = sub { $fullmod->condition_sql(@_) };
my $order_sql_coderef = $fullmod->can('order_sql')