[freeside-commits] freeside/FS/FS/TicketSystem RT_External.pm, 1.27, 1.28
Jeff Finucane,420,,
jeff at wavetail.420.am
Mon Sep 24 08:47:53 PDT 2007
Update of /home/cvs/cvsroot/freeside/FS/FS/TicketSystem
In directory wavetail:/tmp/cvs-serv21882/FS/FS/TicketSystem
Modified Files:
RT_External.pm
Log Message:
self-service support usage improvements (1733)
Index: RT_External.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/TicketSystem/RT_External.pm,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- RT_External.pm 12 Sep 2007 20:40:15 -0000 1.27
+++ RT_External.pm 24 Sep 2007 15:47:50 -0000 1.28
@@ -280,5 +280,53 @@
$external_url;
}
+sub _retrieve_single_value {
+ my( $self, $sql ) = @_;
+
+ warn "$me $sql" if $DEBUG;
+ my $sth = $dbh->prepare($sql) or die $dbh->errstr. "preparing $sql";
+ $sth->execute or die $sth->errstr. "executing $sql";
+
+ my $arrayref = $sth->fetchrow_arrayref;
+ $arrayref ? $arrayref->[0] : $arrayref;
+}
+
+sub transaction_creator {
+ my( $self, $transaction_id ) = @_;
+
+ my $sql = "SELECT name from transactions JOIN users ON ".
+ "transactions.creator=users.id WHERE transactions.id = ".
+ $transaction_id;
+
+ $self->_retrieve_single_value($sql);
+}
+
+sub transaction_ticketid {
+ my( $self, $transaction_id ) = @_;
+
+ my $sql = "SELECT objectid from transactions WHERE transactions.id = ".
+ $transaction_id;
+
+ $self->_retrieve_single_value($sql);
+}
+
+sub transaction_subject {
+ my( $self, $transaction_id ) = @_;
+
+ my $sql = "SELECT subject from transactions JOIN tickets ON objectid=".
+ "tickets.id WHERE transactions.id = ". $transaction_id;
+
+ $self->_retrieve_single_value($sql);
+}
+
+sub transaction_status {
+ my( $self, $transaction_id ) = @_;
+
+ my $sql = "SELECT status from transactions JOIN tickets ON objectid=".
+ "tickets.id WHERE transactions.id = ". $transaction_id;
+
+ $self->_retrieve_single_value($sql);
+}
+
1;
More information about the freeside-commits
mailing list