This file serves as the entry point for SimpleDesk generally, as well as the home of the ticket listing code, for open, closed and deleted tickets.
Several things are done here, the results of which are unilaterally assumed by all other SimpleDesk functions. - work out which departments are applicable, and which department we are currently in (as far as possible) - set up general navigation - see if the URL or POST data contains a ticket, if so sanitise and store that value - see if a msg was specified in the URL, if so identify the relevant ticket - add in the helpdesk CSS file - identify the sub action to direct them to, then send them on their way.
This function sets up multiple blocks to be shown to users, defines what columns these blocks should have and states the rules to be used in getting the data. Each block has multiple parameters, and is stated in $context['ticket_blocks']:
$context['dept_list'] contains the list of departments that the user can see, key/value pair, array is ordered according to the ordering specified in the Departments administration area. The key for $context['dept_list'] is the department's id, with the array content being: - id_dept - departmental id (numeric) - dept_name - department's name - tickets - an array containing three elements, open, closed and assigned - containing the counts thereof for each department for the current user. - new - boolean whether this department has some new items to be read by the current user The linktree is also modified to inclue the department list.
This provides the ability to see all of a given type of ticket at once without paging through them, which are all sortable.
Much like the main helpdesk, this function prepares a list of all the closed/resolved tickets, with a more specific list of columns that is better suited to resolved tickets.
Much like the main helpdesk, this function prepares a list of all the deleted tickets, with a more specific list of columns that is better suited to recyclable or permadeletable tickets.
Actually performs the queries to get data for each block, subject to the parameters specified by the calling functions. It also sets up per-block pagination links, collects a variety of data (enough to populate all the columns as listed in shd_main_helpdesk, even if not entirely applicable, and populates it all into $context['ticket_blocks']['tickets'], extending the array that was already there.
In order to centralise the list of actions to be displayed in a block, and in its counterpart that displays all the values, the lists of columns per block is kept here.
Parameter: $block
Expected type: string
The block we are calling from: - assigned: assigned to me - new: new tickets - staff: pending staff - user_staff: pending with user (staff view) - user_user: pending with user (user view) - closed: resolved tickets - recycled: deleted tickets - withdeleted: tickets with deleted replies
Page created in 0.016 seconds with 11 queries.