X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fagent.cgi;h=b043d1efe750518036d3fe03c94e5ea96c5a32d8;hb=b7ce9a95a6fa002d0d537c950f11f8a23d3dfc25;hp=449456cdd7efc1e7d5fc6a79d5b7815b79c0e4e0;hpb=0ebeec96313dd7edfca340f01f8fbbbac1f4aa1d;p=freeside.git diff --git a/httemplate/edit/agent.cgi b/httemplate/edit/agent.cgi index 449456cdd..b043d1efe 100755 --- a/httemplate/edit/agent.cgi +++ b/httemplate/edit/agent.cgi @@ -1,5 +1,188 @@ - -<% +<% include("/elements/header.html","$action Agent", menubar( + 'View all agents' => $p. 'browse/agent.cgi', +)) %> + +<% include('/elements/error.html') %> + +
+ + + + + + + Agent #<% $agent->agentnum ? $agent->agentnum : "(NEW)" %> + + + + + + + + + + + + + + + + + + + +% if ( $conf->exists('selfservice-agent_login') ) { + + + + + + + + + + + +% } else { + + + + +% } + + + + + + +% if ( $conf->exists('agent-invoice_template') ) { + + <% include('/elements/tr-select-invoice_template.html', + 'label' => 'Invoice template', + 'field' => 'invoice_template', + 'curr_value' => $agent->invoice_template, + ) + %> + +% } else { + + + +% } + +% if ( $conf->config('ticket_system') ) { +% my $default_queueid = $conf->config('ticket_system-default_queueid'); +% my $default_queue = FS::TicketSystem->queue($default_queueid); +% $default_queue = "(default) $default_queueid: $default_queue" +% if $default_queueid; +% my %queues = FS::TicketSystem->queues(); +% my @queueids = sort { $a <=> $b } keys %queues; +% + + + + + +% } + +
Agent
Agent type + +
Master customer + <% include('/elements/search-cust_main.html', + 'field_name' => 'agent_custnum', + 'curr_value' => $agent->agent_custnum, + 'find_button' => 1, + ) + %> +
Username
Password
Disabledisabled eq 'Y' ? ' CHECKED' : '' %>>
Ticketing queue + +
+
+ +<% mt('Access Groups') |h %> + + + + + + +
<% include('/elements/checkboxes-table.html', + 'source_obj' => $agent, + 'link_table' => 'access_groupagent', + 'target_table' => 'access_group', + 'name_col' => 'groupname', + 'target_link' => $p. 'edit/access_group.html?', + ) + %> +
+
+ +<% mt('Commissions') |h %> + + +% #surprising amount of false laziness w/ edit/process/agent.cgi +% my @pkg_class = qsearch('pkg_class', { 'disabled'=>'' }); +% foreach my $pkg_class ( '', @pkg_class ) { +% my %agent_pkg_class = ( 'agentnum' => $agent->agentnum, +% 'classnum' => $pkg_class ? $pkg_class->classnum : '' +% ); +% my $agent_pkg_class = +% qsearchs( 'agent_pkg_class', \%agent_pkg_class ) +% || new FS::agent_pkg_class \%agent_pkg_class; +% my $param = 'classnum'. $agent_pkg_class{classnum}; + + + + + + +% } + +
% + <% $pkg_class ? $pkg_class->classname : mt('(no package class)') |h %> +
+ + +
+"> + +
+ +<% include('/elements/footer.html') %> + +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); my $agent; if ( $cgi->param('error') ) { @@ -14,61 +197,7 @@ if ( $cgi->param('error') ) { $agent = new FS::agent {}; } my $action = $agent->agentnum ? 'Edit' : 'Add'; -my $hashref = $agent->hashref; - -print header("$action Agent", menubar( - 'Main Menu' => $p, - 'View all agents' => $p. 'browse/agent.cgi', -)); - -print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); - -print '
', - qq!!, - "Agent #", $hashref->{agentnum} ? $hashref->{agentnum} : "(NEW)"; - -print &ntable("#cccccc", 2, ''), < - Agent - - - - Agent type - - - - - - - -END - -print qq!
!; -print < - - -END +my $conf = new FS::Conf; -%> +