[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Ruqueue-devel] Adding a $name column to functions/functions_index.p
From: |
Montana Quiring |
Subject: |
RE: [Ruqueue-devel] Adding a $name column to functions/functions_index.php |
Date: |
Thu, 23 Aug 2007 15:51:08 -0500 |
Thanks for the info. I'll give it a try.
-Montana Quiring
-----Original Message-----
From: Sean Timothy Noonan [mailto:address@hidden
Sent: Thursday, August 23, 2007 12:18 PM
To: Montana Quiring
Cc: 'John Fulton'; address@hidden
Subject: Re: [Ruqueue-devel] Adding a $name column to
functions/functions_index.php
Montana:
Let me preface this - I have not touched ruQueue for two years and I
don't have an installation to test with. However, this should
(hopefullty) put you on the right track.
I'm assuming you're taking about the tables that display on the index page
after a user logs in (Highest Priority Tickets, etc). The function that
generates those tables is GetTicketTable in functions-index.php. In turn,
this function calls GetHighestPriorityTicketsFor and
GetHighestPriorityTicketsWatcher in functions-getters.php. This is where
the queries you should edit are contained.
function GetHighestPriorityTicketsFor($fieldname, $fieldvalue) {
global $db;
$query = "SELECT owner, ticket.id, first_comment.subject, ";
$query .= "user.name as name, "
$query .= "ticket.current_status, queue ";
$query .= "from ticket, user, "
$query .= "comment as first_comment, ";
$query .= "comment as last_comment, queue ";
$query .= "where first_comment.id = ticket.first_comment_id ";
$query .= "and last_comment.id = ticket.last_comment_id and ";
$query .= "ticket.queue = queue.q_name and ";
$query .= "$fieldname=\"$fieldvalue\" and ";
$query .= "ticket.current_status not like \"%resolved%\" ";
$query .= "and ticket.user_id=user.id "
$query .= "order by last_comment.priority desc, ticket.id desc";
$result = mysql_query($query, $db);
return $result;
}
You'll need to make a similiar change for the
GetHighestPriorityTicketsWatcher function.
Once you've done that, you can add another row in the GetTicketTable
function that displays $tablerow->name.
You may experience an additional slowdown, since you're joining on an
additional table now. You may also want to consider adding a limit on the
queries that is passed to the function, as that may speed things up a bit.
Sean Timothy Noonan
address@hidden
On Thu, 23 Aug 2007, Montana Quiring wrote:
> Hello,
>
> I would like the $name field to be list in a column on the
> functions_index.php page so that when a user click the home link they can
> see at a glance who a ticket is about. The reasoning is that we get a lot
of
> repetitive tickets that are from many different people.
> I've tried adding the column but it doesn't show any data. I'm guessing I
> have to do a mySQL query above it in order for the data to populate? If
so,
> would you be able to help me with this?
>
> -Montana Quiring
> HSL IT Admin
> University of Manitoba
> 204.474.8694
>
> "Mass grave of Microsoft 'partners': Lotus, WordPerfect, Corel, DBase,
> Netscape...." --Roy Schestowitz
>
>
>
> _______________________________________________
> Ruqueue-devel mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/ruqueue-devel
>