use strict;
use base 'Exporter';
use vars qw( @EXPORT_OK %handler $domain $DEBUG $me );
+use FS::UID qw( dbh );
@EXPORT_OK = qw( load_clientapi_modules );
my ( $self, $name ) = ( shift, shift );
$name =~ s(/)(::)g;
my $sub = "FS::ClientAPI::$name";
+
+ dbh->{'private_profile'} = {};
+
warn "$me dispatch: calling $sub with args @_\n" if $DEBUG;
no strict 'refs';
- &{$sub}(@_);
+ my $rv = &{$sub}(@_);
+
+ warn dbh->sprintProfile if dbh->can('sprintProfile');
+ dbh->{'private_profile'} = {};
+
+ $rv;
}
1;
my $class = shift;
my $table = $class->table or die "upgrade_set_cardtype needs a table";
- if ( ! FS::upgrade_journal->is_done("${table}__set_cardtype") ) {
+ if ( ! FS::upgrade_journal->is_done("${table}__set_cardtype2") ) {
my $job = FS::queue->new({ job => 'FS::payinfo_Mixin::process_set_cardtype' });
my $error = $job->insert($table);
die $error if $error;
- FS::upgrade_journal->set_done("${table}__set_cardtype");
+ FS::upgrade_journal->set_done("${table}__set_cardtype2");
}
}
local $ignore_masked_payinfo = 1;
my $search = FS::Cursor->new({
table => $table,
- extra_sql => q[ WHERE payby IN('CARD','DCRD') AND paycardtype IS NULL ],
+ extra_sql => q[ WHERE payby IN('CARD','DCRD') AND ( paycardtype IS NULL or paycardtype = 'Not a credit card' ) ],
});
while (my $record = $search->fetch) {
my $error = $record->replace;
package FS::pkg_referral;
+use base qw( FS::Record );
use strict;
-use vars qw( @ISA );
use FS::Record qw( dbh );
-@ISA = qw(FS::Record);
-
=head1 NAME
FS::pkg_referral - Object methods for pkg_referral records
die "not running; selfservice-xmlrpc conf option is off\n"
unless $conf->exists('selfservice-xmlrpc');
+if ( $conf->exists('selfservice-db_profile') ) {
+ eval "use DBIx::Profile";
+ warn $@ if $@;
+}
+
daemon_run( 'port' => 8080, 'handle_request' =>
sub {
my $request = shift;
+++ /dev/null
-BEGIN { $| = 1; print "1..1\n" }
-END {print "not ok 1\n" unless $loaded;}
-use FS::InitHandler;
-$loaded=1;
-print "ok 1\n";
+++ /dev/null
-BEGIN { $| = 1; print "1..1\n" }
-END {print "not ok 1\n" unless $loaded;}
-use FS::part_pkg::flat_comission;
-$loaded=1;
-print "ok 1\n";
+++ /dev/null
-BEGIN { $| = 1; print "1..1\n" }
-END {print "not ok 1\n" unless $loaded;}
-use FS::part_pkg::flat_comission_cust;
-$loaded=1;
-print "ok 1\n";
+++ /dev/null
-BEGIN { $| = 1; print "1..1\n" }
-END {print "not ok 1\n" unless $loaded;}
-use FS::part_pkg::flat_comission_pkg;
-$loaded=1;
-print "ok 1\n";
+++ /dev/null
-BEGIN { $| = 1; print "1..1\n" }
-END {print "not ok 1\n" unless $loaded;}
-use FS::part_pkg::sesmon_hour;
-$loaded=1;
-print "ok 1\n";
+++ /dev/null
-BEGIN { $| = 1; print "1..1\n" }
-END {print "not ok 1\n" unless $loaded;}
-use FS::part_pkg::sesmon_minute;
-$loaded=1;
-print "ok 1\n";
SELFSERVICE_USER = fs_selfservice
#never run on the same machine in production!!!
-SELFSERVICE_MACHINES =
+SELFSERVICE_MACHINES = localhost
# SELFSERVICE_MACHINES = www.example.com
# SELFSERVICE_MACHINES = web1.example.com web2.example.com
-<& /elements/header-popup.html, '' &>
+<& /elements/header-popup.html &>
<% mt('The CVV2 number (also called CVC2 or CID) is a three- or four-digit security code used to reduce credit card fraud') |h %>
<BR><BR>
if $sched_item[0] && ! $sched_item[0]->disabled;
}
+sub error_callback {
+ my ($cgi, $access_user) = @_;
+warn $access_user->sched_item_enabled;
+warn $cgi->param('sched_item_enabled');
+ $access_user->sched_item_enabled('Y')
+ if $cgi->param('sched_item_enabled');
+}
+
sub field_callback {
my ($c, $o, $f) = @_;
if($f->{'type'} eq 'password' and $o->is_system_user) {
my %search_hash = ();
-#some false laziness w/misc/bulk_change_pkg.cgi
+#some false laziness w/misc/bulk_change_pkg.cgi and bulk_pkg_increment_bill.cgi
+# and misc/process/
+# with shitty results (bulk doing things to wrong packages) if you don't update
+# those too :/
$search_hash{'query'} = $cgi->keywords;
-<% $cgi->redirect($path) %>
+<& /elements/header-cust_main.html,
+ view => 'packages',
+ custnum => $cust_pkg->custnum,
+&>
+
+<& /elements/footer-cust_main.html &>
<%init>
-# since cust_pkgs can't be viewed directly, just throw a redirect
+
my ($pkgnum) = $cgi->keywords;
$pkgnum =~ /^\d+$/ or die "invalid pkgnum '$pkgnum'";
-my $show = $FS::CurrentUser::CurrentUser->default_customer_view =~ /^(jumbo|packages)$/ ? '' : ';show=packages';
-my $self = FS::cust_pkg->by_key($pkgnum) or die "pkgnum $pkgnum not found";
-my $frag = 'cust_pkg'. $self->pkgnum;
-my $path = $p.'view/cust_main.cgi?custnum='.$self->custnum.";$show#$frag";
+my $cust_pkg = FS::cust_pkg->by_key($pkgnum) or die "pkgnum $pkgnum not found";
+
</%init>