To configure email ticket submission some additional steps are necessary. First you need to create a POP3 email account for each department that will receive email. Next, go to "Manage Departments" in the xhelp Admin Panel. Next, edit the department you wish to hold the newly created tickets. Next, Add a new mailbox to monitor:
Mailbox Type - currently the only option is POP3.
Server - DNS name of mail server (get from your hosting provider)
Port - Mail Service Port Number. For POP3 this is usually 110.
Username - Username to access mailbox (get from your hosting provider)
Password - Password to access mailbox (also get from your hosting provider)
Default Ticket Priority - Adjust default priority for incoming tickets.
Reply-To Email Address - the email address for this account. Used for
handling replies (responses) to tickets.
Repeat this process for each mailbox you wish to monitor.
Once all mailboxes have been added, you need to setup a scheduled task or a cron job to check these mailboxes on a regular basis.
For *nix machines the following crontab line should do the trick:
Unfortunately we cannot support you in the configuration of this scheduled task. Please contact your hosting provider with any questions.
Custom Fields Use Cases
1. Get the custom fields for a given department
$hTicketCustField =xoops_getModuleHandler('ticketCustomField');$fields =& $hTicketCustField->getByDept($deptid);foreach($fields as $field) {echo $field->getVar('name'); //Display Pretty Name for fieldecho $field->getVar('description'); //Display Pretty Descriptionecho $field->getVar('fieldname'); //name of element in formecho $field->getVar('controltype'); //which type of form element to displayecho $field->getVar('required'); //Is this entry required?echo $field->getVar('weight'); //Which order should this field be displayed $values = $field->getValues(); // An hash of name / value pairsecho $field->getVar('defaultvalue'); //Default value of field $validators = $field->getValidators(); //An array of validation objects to validate data entryecho $field->getVar('promptuser');echo $ticket->getCustomVar($field->getVar('fieldname')); // get the current fields value}
3. Retrieving a custom ticket var from form submission and storing it in the ticket
// ... Retrieve a list of fields expected for this department (in $fields)// ... Set normal ticket values// Set value for each custom fieldforeach ($fields as $field) { $fieldname = $field->getVar('fieldname'); $submission = $_POST[$fieldname];//... Validate Entryif ($validEntry) { $ticket->setCustomVar($fieldname, $submission); }}// Store ticket (and custom fields)$ret = $hTicket->insert($ticket);
4. Get Custom Fields for a ticket (after dept is set)
$fields = $ticket->getCustomFields();
xHelp Events Service
// * All functions should return a boolean unless otherwise noted/** * Getting an instance of the xHelp event service */$_eventSrv =&xhelp_eventService::singleton();/** * Listening for an event * @paramstring $event_name Event to listen for * @paramobject $obj Object that will handle the event * @paramstring $function_name Name of callback function within object * @returnint Value used to identify callback function in future */$id = $_eventSrv->advise($event_name, $obj, $function_name);/** * Stop listening for an event * @paramstring $event_name Event to stop listening to * @paramint $id ID for callback function (from advise) */$_eventSrv->unadvise($event_name, $id);/** * Event: batch_delete_ticket * Triggered after a batch ticket deletion * @paramarray $tickets The xhelp\Ticket objects that were deleted */functionbatch_delete_ticket($tickets){}/** * Event: batch_dept * Triggered after a batch ticket department change * @paramarray $tickets The xhelp\Ticket objects that were modified * @paramint $department The new department for the tickets */functionbatch_dept($tickets, $department){}/** * Event: batch_owner * Triggered after a batch ticket ownership change * @paramarray $tickets The xhelp\Ticket objects that were modified * @paramint $owner The XOOPS UID of the new owner */functionbatch_owner($tickets, $owner){}/** * Event: batch_priority * Triggered after a batch ticket priority change * @paramarray $tickets The xhelp\Ticket objects that were modified * @paramint $priority The new ticket priority */functionbatch_priority($tickets, $priority){}/** * Event: batch_response * Triggered after a batch response addition * Note: the $response->getVar('ticketid') field is empty for this function * @paramarray $tickets The xhelp\Ticket objects that were modified * @paramxhelp\Responses $response The response added to each ticket */functionbatch_response($tickets, $response){}/** * Event: batch_status * Triggered after a batch ticket status change * @paramarray $tickets The xhelp\Ticket objects that were modified * @paramxhelp\Status $status The new ticket status */functionbatch_status($tickets, $status){}/** * Event: close_ticket * Triggered after a ticket's status change from a status * with a state of XHELP_STATE_UNRESOLVED to a status * with a state of XHELP_STATE_RESOLVED * Also See: update_status, reopen_ticket * @paramxhelp\Ticket $ticket The ticket that was closed */functionclose_ticket($ticket){}/** * Event: delete_department * Triggered after a department is removed from xHelp * @paramxhelp\Department $dept Department that was removed */functiondelete_department($dept){}/** * Event: delete_field * Triggered after a custom field is removed from xHelp * @paramxhelp\TicketField $field Custom field that was removed */functiondelete_field($field){}/** * Event: delete_file * Triggered after a file is removed from a ticket * @paramxhelp\File $file File that was removed */functiondelete_file($file){}/** * Event: delete_responseTpl * Triggered after a staff auto-response is deleted * @paramxhelpResponseTemplates $responseTpl auto-response that was deleted */functiondelete_responseTpl($responseTpl){}/** * Event: delete_staff * Triggered after a staff member is removed from xHelp * @paramxhelp\Staff $staff Staff Member that was removed */functiondelete_staff($staff){}/** * Event: delete_ticket * Triggered after a ticket is deleted * @paramxhelp\Ticket $ticket Ticket that was deleted */functiondelete_ticket($ticket){}/** * Event: edit_response * Triggered after a response has been modified * Also See: new_response * @paramxhelp\Ticket $newTicket Ticket after modifications * @paramxhelp\Responses $newResponse Modified response * @paramxhelp\Ticket $oldTicket Ticket before modifications * @paramxhelp\Responses $oldResponse Response modifications */functionedit_response($newTicket, $newResponse, $oldTicket, $oldResponse){}/** * Event: edit_ticket * Triggered after a ticket is modified * @paramxhelp\Ticket $oldTicket Ticket information before modifications * @paramxhelp\Ticket $newTicket Ticket information after modifications */functionedit_ticket($oldTicket, $newTicket){}/** * Event: merge_tickets * Triggered after two tickets are merged * @paramint $ticket1 First ticketid being merged * @paramint $ticket2 Second ticketid being merged * @paramint $mergedTicket Resulting ticketid after merge */functionmerge_tickets($ticket1, $ticket2, $mergedTicket){}/** * Event: new_faq * Triggered after FAQ addition * @paramxhelp\Ticket $ticket Ticket used as base for FAQ * @paramxhelp\Faq $faq FAQ that was added */functionnew_faq($ticket, $faq){}/** * Event: new_file * Triggered after a file is added to a ticket * @paramxhelp\Ticket $ticket Ticket file was attached to * @paramxhelp\File $file Information about file uploaded */functionnew_file($ticket, $file){}/** * Event: new_response * Triggered after a response has been added to a ticket * @paramxhelp\Ticket $ticket Ticket containing response * @paramxhelp\Responses $newResponse Response that was added */functionnew_response($ticket, $newResponse){}/** * Event: new_response_rating * Triggered after a user rates a staff member response * @paramxhelp\StaffReview $review Review specifics * @paramxhelp\Ticket $ticket Ticket that was reviewed * @paramxhelp\Responses $response Exact response that was reviewed */functionnew_response_rating($review, $ticket, $response){}/** * Event: new_ticket * Triggered after a ticket is added to the helpdesk * @paramxhelp\Ticket $ticket Ticket that was added */functionnew_ticket($ticket){}/** * Event: new_user_by_email * Triggered after new user account is created during ticket submission * @paramstring $password Password for new account * @paramXoopsUser $xoopsUser XOOPS user object for new account */functionnew_user_by_email($password, $xoopsUser){}/** * Event: reopen_ticket * Triggered after a ticket's status change from a status * with a state of XHELP_STATE_RESOLVED to a status * with a state of XHELP_STATE_UNRESOLVED * Also See: update_status, close_ticket * @paramxhelp\Ticket $ticket The ticket that was re-opened */functionreopen_ticket($ticket){}/** * Event: update_owner * Triggered after ticket ownership change (Individual) * Also See: batch_owner * @paramxhelp\Ticket $ticket Ticket that was changed * @paramint $oldOwner UID of previous owner * @paramint $newOwner UID of new owner */functionupdate_owner($ticket, $oldOwner, $newOwner){}/** * Event: update_priority * Triggered after a ticket priority is modified * Also See: batch_priority * @paramxhelp\Ticket $ticket Ticket that was modified * @paramint $oldPriority Previous ticket priority */functionupdate_priority($ticket, $oldPriority){}/** * Event: update_status * Triggered after a ticket status change * Also See: batch_status, close_ticket, reopen_ticket * @paramxhelp\Ticket $ticket The ticket that was modified * @paramxhelp\Status $oldStatus The previous ticket status * @paramxhelp\Status $newStatus The new ticket status */functionupdate_status($ticket, $oldStatus, $newStatus){}/** * Event: view_ticket * Triggered after a staff member views a ticket * @paramxhelp\Ticket $ticket Ticket that was viewed */functionview_ticket($ticket){}