X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Flog_context.pm;h=6b69a805882dc4c41843e0905baa943fce26fcff;hp=ff3471760d5e8d34d1641544e4c0de868a9eea2a;hb=8d0e8149e7b19ad8543ac6c8c663be63dbc34762;hpb=b8fc5d2178e7358661e37ef97b7619f7a9080f3a diff --git a/FS/FS/log_context.pm b/FS/FS/log_context.pm index ff3471760..6b69a8058 100644 --- a/FS/FS/log_context.pm +++ b/FS/FS/log_context.pm @@ -4,12 +4,22 @@ use strict; use base qw( FS::Record ); use FS::Record qw( qsearch qsearchs ); -my @contexts = ( qw( - test +# Items in @default_contexts will always be included in the +# output of contexts() method +my @default_contexts = ( qw( bill_and_collect FS::cust_main::Billing::bill_and_collect FS::cust_main::Billing::bill + FS::cust_main::Billing_Realtime::realtime_bop + FS::cust_main::Billing_Realtime::realtime_tokenize + FS::cust_main::Billing_Realtime::realtime_verify_bop + FS::cust_main::Billing_Realtime::token_check FS::pay_batch::import_from_gateway + FS::part_pkg + FS::Misc::Geo::standardize_uscensus + FS::saved_search::send + FS::saved_search::render + FS::cust_location::process_district_update Cron::bill Cron::backup Cron::upload @@ -18,8 +28,14 @@ my @contexts = ( qw( queue upgrade upgrade_taxable_billpkgnum + freeside-ipifony-download freeside-paymentech-upload freeside-paymentech-download + test + FS::TaxEngine::billsoft + wa_sales + wa_tax_rate_update + tax_rate_update ) ); =head1 NAME @@ -116,11 +132,25 @@ sub check { =item contexts -Returns a list of all valid contexts. +Returns a list of all log contexts, by combining @default_contexts +with all context values seen in the log_context table =cut -sub contexts { @contexts } +sub contexts { + my $self = shift; + + my %contexts = map { $_ => 1 } @default_contexts; + + $contexts{ $_->context } = 1 + for qsearch({ + select => 'DISTINCT context AS context', + table => 'log_context', + hashref => {}, + }); + + sort { lc $a cmp lc $b } keys %contexts; +} =back