Centarra/panel2 — pull request #18 by nasonfish (2014-04-05 18:37:54+00:00)
Title: admins' adding credit form now displays as "modifying" credit, tickets now have statuses attached to them

**06aa8ed**: In order to make it clear that admins can remove credit just as easily as they can create it, ChrisK suggested making a way for admins to remove service credit - so it seemed clear that an easy way to do that is just to clarify the existing form, which already had the ability to easily remove credit.

So, now the form simply reminds the user that negative values are allowed, and that the form is not only for modifying credit. Seems simple enough.

**6c22b15**: Tickets have long been only tagged as either "OPEN" or "CLOSED", and that has been all the user has been displayed. In order to allow for a clearer list of tickets, it seemed necessary to attach a status to a ticket, that gives more information about what the ticket is waiting on - whether it be a third party service, a staff reply, or a client reply.

Admins now have the ability to attach a status to tickets, to make it clear what the ticket is waiting for at a glance - tickets awaiting client reply are also shown in green, for clarity on which tickets require attention.

Schema change:

```sql
ALTER TABLE `ticket`
ADD COLUMN `status` VARCHAR(255);
```

Suggested one-time script to update statuses:

```python
for ticket in Ticket.query.filter_by(is_open=True).all():
if ticket.replies[-1].from_user.is_admin: # last user to reply was an admin, so they're waiting on the client
ticket.set_status("Awaiting client reply")
else: # client replied last, so we're waiting on the staff member.
ticket.set_status("Awaiting staff reply")
```

Obviously this script won't capture every ticket's situation, but it will prevent blank statuses that will look odd (and possibly even errors), and it will give staff members an idea of what tickets have which statuses until the usage of the new system allows the tickets to hold an accurate status.

"Awaiting client reply" should be used for when you're waiting for the client to reply to a ticket, while "Awaiting staff reply" will be used when the user replies (provided the ticket was not set to something other than "Awaiting client reply").

This means if a ticket exists with the status "Awaiting client reply" and the client replies, the status will be set to "Awaiting staff reply". If the ticket is set to "Awaiting datacenter reply" and the client replies, however, the status will not be changed.

Staff will always have the option to change the status in their replies.