[freeside-commits] freeside/fs_selfservice/FS-SelfService/cgi selfservice.cgi, 1.57, 1.58 ticket_summary.html, NONE, 1.1 tktview.html, 1.1, 1.2
Mark Wells
mark at wavetail.420.am
Mon Jun 27 00:11:03 PDT 2011
Update of /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi
In directory wavetail.420.am:/tmp/cvs-serv29076/fs_selfservice/FS-SelfService/cgi
Modified Files:
selfservice.cgi tktview.html
Added Files:
ticket_summary.html
Log Message:
self-service ticket priority and edit subject, #13199
--- NEW FILE: ticket_summary.html ---
<SCRIPT TYPE="text/javascript" SRC="overlibmws.js"></SCRIPT>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2 BGCOLOR="#eeeeee">
<TR><TH BGCOLOR="#ff6666" COLSPAN=8>Open Tickets</TH></TR>
<TR>
<%=
my $col1 = "ffffff";
my $col2 = "dddddd";
my $col = $col1;
my $can_set_priority =
grep { exists($_->{'_selfservice_priority'}) } @tickets;
if ( $can_set_priority ) {
$OUT .= qq!<FORM ACTION="$selfurl" METHOD="POST">! .
qq!<INPUT TYPE="hidden" NAME="session" VALUE="$session_id">! .
qq!<INPUT TYPE="hidden" NAME="action" VALUE="ticket_priority">!;
}
$date_format ||= '%Y-%m-%d';
my $date_formatter = sub {
my $time = Date::Parse::str2time($_[0], 'GMT'); # RT internal dates are GMT
# exclude times within 24 hours of zero
($time > 86400) ? Date::Format::time2str($date_format, $time) : ''
};
my @titles = ('#', qw(Subject Queue Status Created Due));
push @titles, 'Estimated<BR>Minutes';
push @titles, 'Priority';
$OUT .= join("\n", map { "<TH VALIGN=\"top\">$_</TH>" } @titles) . '</TR>';
foreach my $ticket ( @tickets ) {
my $id = $ticket->{'id'};
my $td = qq!<TD BGCOLOR="#$col">!;
my $link = qq!<A HREF="${url}tktview;ticket_id=$id">!;
$OUT .= '<TR>' . $td . $link . $id . '</A></TD>'.
$td. $link . $ticket->{'subject'} . '</A></TD>'.
$td. $ticket->{'queue'} . '</TD>'.
$td. $ticket->{'status'} . '</TD>'.
$td. $date_formatter->($ticket->{'created'}) . '</TD>'.
$td. $date_formatter->($ticket->{'due'}) . '</TD>'.
qq!<TD BGCOLOR="#$col" ALIGN="right">!. ($ticket->{'timeestimated'} || '')
. '</TD>'.
qq!<TD BGCOLOR="#$col" ALIGN="right">!;
if ( $can_set_priority ) {
$OUT .= '<INPUT TYPE="hidden" NAME="ticket'.$id.'" VALUE="1">' .
'<INPUT TYPE="text" SIZE=4 NAME="priority'.$id.'"' .
'VALUE="'.$ticket->{'_selfservice_priority'}.'"></TD>';
if ( exists($ticket_error{$id}) ) {
# display error message compactly
$OUT .= '<TD><FONT COLOR="#ff0000" onmouseover="'.
"return overlib('".$ticket_error{$id}."', AUTOSTATUS, WRAP);" .
'" onmouseout="nd();">*</FONT></TD>';
}
}
else {
$OUT .= ($ticket->{'content'} || $ticket->{'priority'}) . '</TD>';
}
$OUT .= '</TR>';
$col = $col eq $col1 ? $col2 : $col1;
} #foreach my $ticket
if ( $can_set_priority ) {
$OUT .= '<TR><TD COLSPAN=8 ALIGN="right">
<INPUT TYPE="submit" VALUE="Save changes"></TD></TR></FORM>';
}
%>
</TABLE>
Index: tktview.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/tktview.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -d -r1.1 -r1.2
--- tktview.html 17 Dec 2010 01:15:59 -0000 1.1
+++ tktview.html 27 Jun 2011 07:11:01 -0000 1.2
@@ -22,9 +22,16 @@
<FORM ACTION="<%=$selfurl%>" METHOD=POST>
<input type="hidden" name="session" value="<%=$session_id%>">
<input type="hidden" name="ticket_id" value="<%=$ticket_id%>">
+<%= if ( $edit_ticket_subject ) { $OUT .= '
+ Subject:<BR><input type="text" name="subject" value="' .
+ $ticket_fields{'subject'} . '" style="width:440px">
+ <BR><BR>';
+}
+%>
<input type="hidden" name="action" value="tktview">
Add reply to ticket:
- <BR><textarea name="reply" cols="60" rows="10"></textarea>
+ <BR>
+ <textarea name="reply" cols="60" rows="10" style="width:440px"></textarea>
<BR><input type="submit" value="Reply">
</form>
Index: selfservice.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/selfservice.cgi,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -w -d -r1.57 -r1.58
--- selfservice.cgi 4 Feb 2011 08:23:46 -0000 1.57
+++ selfservice.cgi 27 Jun 2011 07:11:01 -0000 1.58
@@ -18,6 +18,7 @@
unprovision_svc change_pkg suspend_pkg domainselector
list_svcs list_svc_usage list_cdr_usage list_support_usage
myaccount_passwd list_invoices create_ticket get_ticket did_report
+ adjust_ticket_priority
mason_comp port_graph
);
@@ -77,6 +78,7 @@
myaccount
tktcreate
tktview
+ ticket_priority
didreport
invoices
view_invoice
@@ -276,11 +278,28 @@
sub tktview {
get_ticket( 'session_id' => $session_id,
- 'ticket_id' => $cgi->param('ticket_id'),
- 'reply' => $cgi->param('reply'),
+ 'ticket_id' => ($cgi->param('ticket_id') || ''),
+ 'subject' => ($cgi->param('subject') || ''),
+ 'reply' => ($cgi->param('reply') || ''),
);
}
+sub ticket_priority {
+ my %values;
+ foreach ( $cgi->param ) {
+ if ( /^ticket(\d+)$/ ) {
+ # a 'ticket1001' param implies the existence of a 'priority1001' param
+ # but if that's empty, we need to send it as empty rather than forget
+ # it.
+ $values{$1} = $cgi->param("priority$1") || '';
+ }
+ }
+ $action = 'myaccount';
+ # this returns an updated customer_info for myaccount
+ adjust_ticket_priority( 'session_id' => $session_id,
+ 'values' => \%values );
+}
+
sub customer_order_pkg {
my $init_data = signup_info( 'customer_session_id' => $session_id );
return $init_data if ( $init_data->{'error'} );
More information about the freeside-commits
mailing list