This mod, formerly known as SimpleStatus, adds a second, update-able status field to the edit ticket page, in the form of a Select (dropdown) with an update button. It also displays the status on the view tickets page. This mod comes in particularly useful on RMA systems, or any secondary system that has lots of steps. It is written on 1.7 RC4, and should carry on into 1.7ST. Files will be updated periodically.

Instead of writing a long tutorial on how to do this and that, I have provided here the files and clearly commented each one with the changes that should be made. All changes/additions are clearly marked with giant spaces and comments as such...

//SS

code

//SS

or

SS

Code

SS

I also signed each comment, so you could just search for "Aki" in each of the files and you'll go straight to the changes.

The only thing you need to do before implementing these changes, is open up your PHPMyAdmin, click the SQL tab, and paste in this code and go...

ALTER TABLE ost_ticket ADD COLUMN work int;

After that you could just replace your files with the ones I have provided, unless you have already started making major changes, in that case, I suggest you do it by hand.

Merry Christmas everyone and don't forget to rate this thread!!

Download for 1.7RC4

(SecondStatus.zip)

Download for 1.7ST

(SecondStatus1_7ST.zip)

This is how it looks on the edit ticket page...

blank

and this is what you'll see on the ticket view...

blank

problem after install this mod

DB Error #1054

Unknown column 'ticket.work' in 'field list'

ghostx, make sure you do this part!

The only thing you need to do before implementing these changes, is open up your PHPMyAdmin, click the SQL tab, and paste in this code and go...

ALTER TABLE ost_ticket ADD COLUMN work int;

.

Now it is work, i'm restart my server and now i fork fine...

2 months later

Anyone found a way to allow sorting on the new field?

Anyone found a way to allow sorting on the new field?

(Array Sorting)

It's not difficult at all

In include/staff/ticket_view.inc.php on line 11, we have the $status_arr variable which holds the array that populates the select. What we want to do is sort the array before it gets to the foreach().

function showOptionsDrop($selected){ // shows all options but selected...

$string = '';

$status_arr = array("Reviewed","Responded","Quotation Sent","PO Requested","PO Recieved","Awaiting Payment","Payment Recieved","In Transit", "Working", "Finished", "In Return Transit");

natsort($status_arr);

foreach($status_arr as $k=>$v){

if($selected == $k) // don't double display the selected option

$string .= '<option selected value="'.$k.'">'.$v.'</option>'."\n";

else

$string .= '<option value="'.$k.'">'.$v.'</option>'."\n";

}

return $string;

}

the function natsort() sorts the array items in their 'natural' order, which, in this case, would be alphabetically ascending.

As I mentioned in the comments, this array could also be moved to a database table and the sort could then be performed in the query that populates the select.

I tried, but it produced no results. When we are viewing the ticket list, the headings Subject, From, Priority, Assigned To are clickable links to sort the list, but can't click on this 'Status' field to sort.

Here is my code:

//SS

function showOptionsDrop($selected){ // shows all options but selected...

$string = '';

$status_arr = array("Awaiting Response","Reviewed","Responded","Quote Requested","Quote Received","PO Requested","PO Recieved","Order Placed","Order Received","In Transit To", "Repair Working", "Finished", "In Transit From");

natsort($status_arr);

foreach($status_arr as $k=>$v){

if($selected == $k) // don't double display the selected option

$string .= ''.$v.''."\n";

else

$string .= ''.$v.''."\n";

}

return $string;

}

//SS

Who updated status

Can someone help???

I make when you click on submit it gets who updated status too but when i exit from that ticket and enter again i can't see name so i must submit again.

How to get name to stay???

I implemented this:

<?php if($_POST['user_update' == Submit) {

echo Format: ($thisstaff->getName());

}

?>

10 days later

Admin see,staff dont

I make this little mod if you dont want for everyone to see your second status.

In view.ticket.php

<?php if($thisstaff->isAdmin()) { ?>

RMA status:

getId(); ?>" name="update">

<?php csrf_token(); ?>

<?php echo showOptionsDrop($ticket->getSimpleStatus()); ?>

<?php } ?>

In this case only admins can see this fields.

You can do this also on department level. If you want for some department to not see this field just add

<?php

if($dept->getId()== 1 || $dept->getId()== 3 || $dept->getId()== 4 || $dept->getId()== 7){ ?>

instead of

<?php if($thisstaff->isAdmin()) { ?>

Notice that you must go to your sql table to see dept_id number so you can add on getId() = number you see in ur table.

Sorry for my bad english. I hope i've helped somehow

a month later

The link for the files appears to be dead.

7 days later

Hi,

Can you reupload your file please?

Thanks

6 days later

Re-upped. Was doing a little server house cleaning.

Hi teryakisan,

Well I had to undo the changes for second status. We were getting errors every time someone created a ticket on the staff side. they would create a ticket then hit submit on get a server error message. The ticket would in fact be created, and the admin would get an email stating "Ticket rejected ( ) by filter "SYSTEM BAN LIST". Maybe I need to reload it again to see what happens. Any ideas what would cause this?

Hm,

We're getting white(blank) pages when closing tickets now, and the following error in our logs:

PHP Fatal error: Call to undefined method Format:() in D:\\apache_www_root\\site\\public_html\\include\\class.ticket.php on line 1584, referer: http://site/scp/tickets.php?id=27(http://site/scp/tickets.php?id=27)

19 days later

Hm,

We're getting white(blank) pages when closing tickets now, and the following error in our logs:

PHP Fatal error: Call to undefined method Format:() in D:\\apache_www_root\\site\\public_html\\include\\class.ticket.php on line 1584, referer: http://site/scp/tickets.php?id=27(http://site/scp/tickets.php?id=27)

Your error is referring to...

($files=Format:($_FILES)))

My modification has nothing at all to do with attachments or in any way shape or form or even touches the attachment code. If changes have been made to your attachment system I'd start there.