SimpleDesk API
Procedural File: SimpleDesk-Delete.php
Source Location: /source/SimpleDesk-Delete.phpThis file deals with deletion/recycling of tickets and replies, subsequent restoration back to the helpdesk, and lastly, permanent deletion of the same.
Tags:
- todo
- Finish documenting this file.
- since
- 1.0
Contains the following functions:
shd_perma_delete [line 191]
shd_recalc_ids [line 543]
array shd_recalc_ids (
int $ticket )
Clean up tickets that have been modified by replies being altered through restore and delete.
Operations:
- Identify how many deleted and non deleted replies there are in the ticket.
- Identify the last non deleted reply in the ticket (if there are no undeleted replies, use the ticket post itself for cohesion)
- Update the ticket's record with the first and last posters, as well as the correct number of active and deleted replies, and whether there are any deleted replies on the ticket generally
Parameters
- int $ticket
- The ticket id to recalculate.
Return value
Returns a type array. An array detailing the user id of the starter, the last replier and the number of active replies in a ticket.[ Top ]
shd_reply_delete [line 110]
shd_reply_restore [line 450]
shd_ticket_delete [line 49]
void shd_ticket_delete (
)
Delete the given ticket, i.e move it to the recycling bin.
Accessed through ?action=helpdesk;sa=deleteticket;ticket=x;sessvar=sessid
Operations:
- Session check
- Check there's a ticket id
- Check the ticket exists and is visible to the current user
- Check permission to delete ticket matches (i.e. can delete any, or can delete own and this is one of ours)
- Update the ticket's status to deleted
- Log the deletion
- Clear the menu's Helpdesk active items cache
- return to the front page
Tags:
- since
- 1.0
Return value
This function has no return value.[ Top ]



