[freeside-commits] freeside/httemplate/edit agent.cgi,1.10,1.11
Ivan,,,
ivan at wavetail.420.am
Sat Oct 15 04:29:55 PDT 2005
Update of /home/cvs/cvsroot/freeside/httemplate/edit
In directory wavetail:/tmp/cvs-serv8761/httemplate/edit
Modified Files:
agent.cgi
Log Message:
agent option to select RT queue
Index: agent.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/agent.cgi,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- agent.cgi 29 Sep 2003 05:51:50 -0000 1.10
+++ agent.cgi 15 Oct 2005 11:29:53 -0000 1.11
@@ -1,4 +1,3 @@
-<!-- mason kludge -->
<%
my $agent;
@@ -16,6 +15,8 @@
my $action = $agent->agentnum ? 'Edit' : 'Add';
my $hashref = $agent->hashref;
+my $conf = new FS::Conf;
+
%>
<%= header("$action Agent", menubar(
@@ -32,45 +33,74 @@
Agent #<%= $hashref->{agentnum} ? $hashref->{agentnum} : "(NEW)" %>
<%= &ntable("#cccccc", 2, '') %>
+
<TR>
<TH ALIGN="right">Agent</TH>
<TD><INPUT TYPE="text" NAME="agent" SIZE=32 VALUE="<%= $hashref->{agent} %>"></TD>
</TR>
-<TR>
- <TH ALIGN="right">Agent type</TH>
- <TD><SELECT NAME="typenum" SIZE=1>
-
-<% foreach my $agent_type (qsearch('agent_type',{})) { %>
- <OPTION VALUE="<%= $agent_type->typenum %>"<%= ( $hashref->{typenum} && ( $hashref->{typenum} == $agent_type->typenum ) ) ? ' SELECTED' : '' %>>
- <%= $agent_type->getfield('typenum') %>: <%= $agent_type->getfield('atype') %>
-<% } %>
-</SELECT></TD>
-</TR>
-<% if ( dbdef->table('agent')->column('disabled') ) { %>
+ <TR>
+ <TH ALIGN="right">Agent type</TH>
+ <TD><SELECT NAME="typenum" SIZE=1>
+
+ <% foreach my $agent_type (qsearch('agent_type',{})) { %>
+ <OPTION VALUE="<%= $agent_type->typenum %>"<%= ( $hashref->{typenum} && ( $hashref->{typenum} == $agent_type->typenum ) ) ? ' SELECTED' : '' %>>
+ <%= $agent_type->getfield('typenum') %>: <%= $agent_type->getfield('atype') %>
+ <% } %>
+
+ </SELECT></TD>
+ </TR>
+
<TR>
<TD ALIGN="right">Disable</TD>
<TD><INPUT TYPE="checkbox" NAME="disabled" VALUE="Y"<%= $hashref->{disabled} eq 'Y' ? ' CHECKED' : '' %>></TD>
</TR>
-<% } %>
-<TR>
- <TD ALIGN="right"><!--Frequency--></TD>
- <TD><INPUT TYPE="hidden" NAME="freq" VALUE="<%= $hashref->{freq} %>"></TD>
-</TR>
-<TR>
- <TD ALIGN="right"><!--Program--></TD>
- <TD><INPUT TYPE="hidden" NAME="prog" VALUE="<%= $hashref->{prog} %>"></TD>
-</TR>
-<% if ( dbdef->table('agent')->column('username') ) { %>
+
+ <TR>
+ <TD ALIGN="right"><!--Frequency--></TD>
+ <TD><INPUT TYPE="hidden" NAME="freq" VALUE="<%= $hashref->{freq} %>"></TD>
+ </TR>
+
+ <TR>
+ <TD ALIGN="right"><!--Program--></TD>
+ <TD><INPUT TYPE="hidden" NAME="prog" VALUE="<%= $hashref->{prog} %>"></TD>
+ </TR>
+
+ <% 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;
+ %>
+ <TR>
+ <TD ALIGN="right">Ticketing</TD>
+ <TD>
+ <SELECT NAME="ticketing_queueid">
+ <OPTION VALUE=""><%= $default_queue %>
+ <% foreach my $queueid ( @queueids ) { %>
+ <OPTION VALUE="<%= $queueid %>" <%= $agent->ticketing_queueid == $queueid ? ' SELECTED' : '' %>><%= $queueid %>: <%= $queues{$queueid} %>
+ <% } %>
+ </SELECT>
+ </TD>
+ </TR>
+ <% } %>
+
<TR>
<TD ALIGN="right">Agent interface username</TD>
- <TD><INPUT TYPE="text" NAME="username" VALUE="<%= $hashref->{username} %>"></TD>
+ <TD>
+ <INPUT TYPE="text" NAME="username" VALUE="<%= $hashref->{username} %>">
+ </TD>
</TR>
+
<TR>
<TD ALIGN="right">Agent interface password</TD>
- <TD><INPUT TYPE="text" NAME="_password" VALUE="<%= $hashref->{_password} %>"></TD>
+ <TD>
+ <INPUT TYPE="text" NAME="_password" VALUE="<%= $hashref->{_password} %>">
+ </TD>
</TR>
-<% } %>
+
</TABLE>
<BR><INPUT TYPE="submit" VALUE="<%= $hashref->{agentnum} ? "Apply changes" : "Add agent" %>">
More information about the freeside-commits
mailing list