freeside/FS/FS/TicketSystem RT_External.pm,1.12,1.13 RT_Internal.pm,1.5,1.6
Kristian Hoffmann
khoff at pouncequick.420.am
Mon Mar 28 17:40:54 PST 2005
Update of /home/cvs/cvsroot/freeside/FS/FS/TicketSystem
In directory pouncequick:/tmp/cvs-serv6056/TicketSystem
Modified Files:
RT_External.pm RT_Internal.pm
Log Message:
A few RT_External fixes.
Index: RT_Internal.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/TicketSystem/RT_Internal.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- RT_Internal.pm 9 Dec 2004 09:21:42 -0000 1.5
+++ RT_Internal.pm 29 Mar 2005 01:40:52 -0000 1.6
@@ -29,19 +29,25 @@
sub href_customer_tickets {
my $self = shift;
# well, 2 is wrong here but will have to do for now
- popurl(2).'rt/'. $self->SUPER::href_customer_tickets(@_);
+ baseurl().'rt/'. $self->_href_customer_tickets(@_);
}
sub href_new_ticket {
my $self = shift;
# well, 2 is wrong here but will have to do for now
- popurl(2).'rt/'. $self->SUPER::href_new_ticket(@_);
+ baseurl().'rt/'. $self->_href_new_ticket(@_);
}
sub href_ticket {
my $self = shift;
# well, 2 is wrong here but will have to do for now
- popurl(2).'rt/'. $self->SUPER::href_ticket(@_);
+ baseurl().'rt/'. $self->_href_ticket(@_);
+}
+
+sub baseurl {
+
+ return popurl(2);
+
}
1;
Index: RT_External.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/TicketSystem/RT_External.pm,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- RT_External.pm 9 Dec 2004 22:23:32 -0000 1.12
+++ RT_External.pm 29 Mar 2005 01:40:52 -0000 1.13
@@ -2,7 +2,8 @@
use strict;
use vars qw( $conf $default_queueid
- $priority_field $priority_field_queue $field );
+ $priority_field $priority_field_queue $field
+ $external_dbh $external_url );
use URI::Escape;
use FS::UID;
@@ -21,12 +22,22 @@
$priority_field_queue = '';
$field = '';
}
+
+ $external_url = '';
+ if ($conf->config('ticket_system') eq 'RT_External') {
+ my ($datasrc, $user, $pass) = $conf->config('ticket_system-rt_external_datasrc');
+ $external_dbh = DBI->connect($datasrc, $user, $pass, { 'ChopBlanks' => 1 })
+ or die "RT_External DBI->connect error: $DBI::errstr\n";
+
+ $external_url = $conf->config('ticket_system-rt_external_url');
+ }
+
};
sub num_customer_tickets {
my( $self, $custnum, $priority, $dbh ) = @_;
- #$dbh ||= create one from some config options
+ $dbh ||= $external_dbh;
my( $from_sql, @param) = $self->_from_customer( $custnum, $priority );
@@ -42,7 +53,7 @@
my( $self, $custnum, $limit, $priority, $dbh ) = @_;
$limit ||= 0;
- #$dbh ||= create one from some config options
+ $dbh ||= $external_dbh;
my( $from_sql, @param) = $self->_from_customer( $custnum, $priority );
my $sql = "select tickets.*, queues.name".
@@ -120,7 +131,7 @@
}
-sub href_customer_tickets {
+sub _href_customer_tickets {
my( $self, $custnum, $priority ) = @_;
#i snarfed this from an RT bookmarked search, it could be unescaped in the
@@ -145,7 +156,11 @@
$href .= '&Rows=100'.
'&OrderBy=id&Page=1'.
- '&Format=%27%20%20%20%3Cb%3E%3Ca%20href%3D%22%2Ffreeside%2Frt%2FTicket%2FDisplay.html%3Fid%3D__id__%22%3E__id__%3C%2Fa%3E%3C%2Fb%3E%2FTITLE%3A%23%27%2C%20%0A%27%3Cb%3E%3Ca%20href%3D%22%2Ffreeside%2Frt%2FTicket%2FDisplay.html%3Fid%3D__id__%22%3E__Subject__%3C%2Fa%3E%3C%2Fb%3E%2FTITLE%3ASubject%27%2C%20%0A%27__Status__%27%2C%20';
+ '&Format=%27%20%20%20%3Cb%3E%3Ca%20href%3D%22'.
+ $self->baseurl.
+ 'Ticket%2FDisplay.html%3Fid%3D__id__%22%3E__id__%3C%2Fa%3E%3C%2Fb%3E%2FTITLE%3A%23%27%2C%20%0A%27%3Cb%3E%3Ca%20href%3D%22'.
+ $self->baseurl.
+ 'Ticket%2FDisplay.html%3Fid%3D__id__%22%3E__Subject__%3C%2Fa%3E%3C%2Fb%3E%2FTITLE%3ASubject%27%2C%20%0A%27__Status__%27%2C%20';
if ( defined($priority) && $field ) {
$href .= '%0A%27__CustomField.'. $field. '__%2FTITLE%3ASeverity%27%2C%20';
@@ -160,11 +175,20 @@
$href .= '%20%0A%27%3Csmall%3E__ToldRelative__%3C%2Fsmall%3E%27%2C%20%0A%27%3Csmall%3E__LastUpdatedRelative__%3C%2Fsmall%3E%27%2C%20%0A%27%3Csmall%3E__TimeLeft__%3C%2Fsmall%3E%27';
$href;
+
}
+sub href_customer_tickets {
-sub href_new_ticket {
+ my $self = shift;
+ return $external_url . $self->_href_customer_tickets(@_);
+
+}
+
+
+sub _href_new_ticket {
my( $self, $custnum, $requestors ) = @_;
+
'Ticket/Create.html?'.
"Queue=$default_queueid".
"&new-MemberOf=freeside://freeside/cust_main/$custnum".
@@ -172,9 +196,29 @@
;
}
-sub href_ticket {
+sub href_new_ticket {
+
+ my $self = shift;
+ return return $external_url . $self->_href_new_ticket(@_);
+
+}
+
+sub _href_ticket {
my($self, $ticketnum) = @_;
'Ticket/Display.html?id='.$ticketnum;
+}
+
+sub href_ticket {
+
+ my $self = shift;
+ return $external_url . $self->_href_ticket(@_);
+
+}
+
+sub baseurl {
+
+ return $external_url;
+
}
1;
More information about the freeside-commits
mailing list