Hi everyone,
Since I read this topic http://www.osticket.com/forums/showthread.php?t=1537(http://www.osticket.com/forums/showthread.php?t=1537) about Reporting Panel, I had just realised that staff_id never inserted to ticket table while staff creating new ticket from staff panel, whereas this field exist in the table. This value of "staff_id" field always zero (0).
As a matter of fact, the INSERT INTO sql in Ticket class never include the "staff_id", that is why this "staff_id" value never inserted to ticket table. LoL.
So here is the modification I made in order this "staff_id" inserted into ticket table.
Open \include\class.ticket.php, FIND:
function create($var,&$errors,$origin,$autorespond=true,$alertstaff=true) {
REPLACE WITH:
function create($var,&$errors,$origin,$autorespond=true,$alertstaff=true) {
global $thisuser; // MOD Insert Staff ID Into Ticket Table by Masino Sinaga, May 2, 2009
FIND:
$id=0;
REPLACE WITH:
$id=0;
$staffid=0; // MOD Insert Staff ID Into Ticket Table by Masino Sinaga, May 2, 2009
FIND:
}elseif(strcasecmp($origin,'staff')==0){ //tickets created by staff...e.g on callins.
REPLACE WITH:
}elseif(strcasecmp($origin,'staff')==0){ //tickets created by staff...e.g on callins.
// MOD Insert Staff ID Into Ticket Table by Masino Sinaga, May 2, 2009
$staffid = $thisuser->getId();
FIND:
',priority_id='.db_input($priorityId).
',email='.db_input($var).
REPLACE WITH:
',priority_id='.db_input($priorityId).
',staff_id='.db_input($staffid). // MOD Insert Staff ID Into Ticket Table by Masino Sinaga, May 2, 2009
',email='.db_input($var).
Now, enjoy the result. :)
Best regards,
Masino Sinaga