Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

How To call Function getLastRespondent() into local

I want to name of staff the respondent current ticket by row in home page 

function getLastRespondent() {

        $sql ='SELECT  resp.staff_id '
             .' FROM '.TICKET_THREAD_TABLE.' resp '
             .' LEFT JOIN '.STAFF_TABLE. ' USING(staff_id) '
             .' WHERE  resp.ticket_id='.db_input($this->getId()).' AND resp.staff_id>0 '
             .'   AND  resp.thread_type IN ("R","N")'
             .' ORDER BY resp.created DESC LIMIT 1';

        if(!($res=db_query($sql)) || !db_num_rows($res))
            return null;


        return Staff::lookup($id);

[Loop While display Row Ticket on home page]

<td nowrap >
<?php echo $ticket->getLastRespondent(); ?></td>   <<<< not work 

echo sprintf('<td>%s</td>',$ticket->getLastRespondent());  <<<< not work 

Example call function it WORK 




echo sprintf('
            <th width="100">'.__('Ticket State').':</th>
<th width="100">'.__('Last Response').':</th>
<td>%s by %s</td>

Thank you Every Body Answer 


  • Last column name "Last Respondent"
  • Sorry... but I have no idea what you are asking.
    What page are you referring to as the "home page"?

  • Oh..Sorry .. I meaning Back-end/Staff-side 
    URL referen : osticket/scp/tickets.php 
  • So you want to add a column to the open ticket queue.

    This thread ought to point you in the right direction:
  • [Resolve] [Solution for Osticket Offline... It's Work for me]

    Add line 457-465
    // query thread
    $sql ='SELECT resp.staff_id'
    .' FROM '.TICKET_THREAD_TABLE.' resp '
    .' LEFT JOIN '.STAFF_TABLE. ' USING(staff_id) '
    .' WHERE resp.ticket_id = '.$row['ticket_id'].' AND resp.staff_id>0 '
    .' AND resp.thread_type IN ("R","N")'
    .' ORDER BY resp.created DESC LIMIT 1 ';

    Add line 608-615
    <!--Last Responded->
    return null;
    <td align="center" nowrap><?php echo Staff::lookup($id) ; ?></td>
Sign In or Register to comment.