+ {
+ 'key' => 'selfservice-agent_signup',
+ 'section' => 'self-service',
+ 'description' => 'Allow agent signup via self-service.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'selfservice-agent_signup-agent_type',
+ 'section' => 'self-service',
+ 'description' => 'Agent type when allowing agent signup via self-service.',
+ 'type' => 'select-sub',
+ 'options_sub' => sub { require FS::Record;
+ require FS::agent_type;
+ map { $_->typenum => $_->atype }
+ FS::Record::qsearch('agent_type', {} ); # disabled=>'' } );
+ },
+ 'option_sub' => sub { require FS::Record;
+ require FS::agent_type;
+ my $agent = FS::Record::qsearchs(
+ 'agent_type', { 'typenum'=>shift }
+ );
+ $agent_type ? $agent_type->atype : '';
+ },
+ },
+
+ {
+ 'key' => 'selfservice-agent_login',
+ 'section' => 'self-service',
+ 'description' => 'Allow agent login via self-service.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'selfservice-self_suspend_reason',
+ 'section' => 'self-service',
+ 'description' => 'Suspend reason when customers suspend their own packages. Set to nothing to disallow self-suspension.',
+ 'type' => 'select-sub',
+ 'options_sub' => sub { require FS::Record;
+ require FS::reason;
+ my $type = qsearchs('reason_type',
+ { class => 'S' })
+ or return ();
+ map { $_->reasonnum => $_->reason }
+ FS::Record::qsearch('reason',
+ { reason_type => $type->typenum }
+ );
+ },
+ 'option_sub' => sub { require FS::Record;
+ require FS::reason;
+ my $reason = FS::Record::qsearchs(
+ 'reason', { 'reasonnum' => shift }
+ );
+ $reason ? $reason->reason : '';
+ },
+
+ 'per_agent' => 1,
+ },
+