X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fagent.cgi;h=ce514a680acc2cee3e0b843a6eee9558251e8c95;hb=dea2573bee84deb5e22196dda7580edaf0c27a42;hp=ea68b4768a36b743151a977e8a3452ff43a8661e;hpb=91387f8f489e561deaf1de052d80ef800a4970a3;p=freeside.git diff --git a/httemplate/edit/agent.cgi b/httemplate/edit/agent.cgi index ea68b4768..ce514a680 100755 --- a/httemplate/edit/agent.cgi +++ b/httemplate/edit/agent.cgi @@ -1,89 +1,115 @@ -<% -# - -use strict; -use vars qw ( $cgi $agent $action $hashref $p $agent_type ); -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::CGI qw(header menubar popurl ntable); -use FS::Record qw(qsearch qsearchs fields); -use FS::agent; -use FS::agent_type; - -$cgi = new CGI; - -&cgisuidsetup($cgi); - -if ( $cgi->param('error') ) { - $agent = new FS::agent ( { - map { $_, scalar($cgi->param($_)) } fields('agent') - } ); -} elsif ( $cgi->keywords ) { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $agent = qsearchs( 'agent', { 'agentnum' => $1 } ); -} else { #adding - $agent = new FS::agent {}; -} -$action = $agent->agentnum ? 'Edit' : 'Add'; -$hashref = $agent->hashref; - -$p = popurl(2); - -print $cgi->header( @FS::CGI::header ), header("$action Agent", menubar( +% +% +%my $agent; +%if ( $cgi->param('error') ) { +% $agent = new FS::agent ( { +% map { $_, scalar($cgi->param($_)) } fields('agent') +% } ); +%} elsif ( $cgi->keywords ) { +% my($query) = $cgi->keywords; +% $query =~ /^(\d+)$/; +% $agent = qsearchs( 'agent', { 'agentnum' => $1 } ); +%} else { #adding +% $agent = new FS::agent {}; +%} +%my $action = $agent->agentnum ? 'Edit' : 'Add'; +%my $hashref = $agent->hashref; +% +%my $conf = new FS::Conf; +% +% + + +<% include("/elements/header.html","$action Agent", menubar( 'Main Menu' => $p, 'View all agents' => $p. 'browse/agent.cgi', -)); +)) %> +% if ( $cgi->param('error') ) { + +Error: <% $cgi->param('error') %> +% } -print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); -print '
', - qq!!, - "Agent #", $hashref->{agentnum} ? $hashref->{agentnum} : "(NEW)"; + + +Agent #<% $hashref->{agentnum} ? $hashref->{agentnum} : "(NEW)" %> + +<% &ntable("#cccccc", 2, '') %> -print &ntable("#cccccc", 2, ''), < Agent - - - - Agent type - - - - Program (unimplemented) - + - -END -print qq!
!; + + Agent type + + + + + Disable + {disabled} eq 'Y' ? ' CHECKED' : '' %>> + + + + + + + + + + + +% 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; +% + + + Ticketing queue + + + + + + + Agent interface password + + + + + + + +
"> -END - -%>