/etc/horde/whups/hooks.php.dist is in php-horde-whups 3.0.12-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | <?php
/**
* Whups Hooks configuration file.
*
* THE HOOKS PROVIDED IN THIS FILE ARE EXAMPLES ONLY. DO NOT ENABLE THEM
* BLINDLY IF YOU DO NOT KNOW WHAT YOU ARE DOING. YOU HAVE TO CUSTOMIZE THEM
* TO MATCH YOUR SPECIFIC NEEDS AND SYSTEM ENVIRONMENT.
*
* For more information please see the horde/config/hooks.php.dist file.
*/
class Whups_Hooks
{
/**
* Customize the order and grouping of ticket fields.
*
* @param string $type A ticket type.
* @param array $fields A list of field names.
*
* @return array A one-dimensional array with field names, or a
* two-dimensional array with header labels as keys and
* field names as values.
*/
// public function group_fields($type, $fields)
// {
// // Example #1: Split all fields into two groups, one for custom
// // attribute fields and one for the regular fields.
// $common_fields = $attributes = array();
// foreach ($fields as $field) {
// if (substr($field, 0, 10) == 'attribute_') {
// $attributes[] = $field;
// } else {
// $common_fields[] = $field;
// }
// }
// return array('Common Fields' => $common_fields,
// 'Attributes' => $attributes);
//
// // Example #2: Move the 'queue' field at the top of the regular
// // fields list.
// $new_fields = array();
// foreach ($fields as $field) {
// if ($field == 'queue') {
// array_unshift($new_fields, $field);
// } else {
// array_push($new_fields, $field);
// }
// }
// return $new_fields;
// }
/**
* Intercept ticket changes.
*
* @param Whups_Ticket $ticket A ticket object.
* @param array $changes A list of change hashes.
*
* @return array The modified changes.
*/
// public function ticket_update($ticket, $changes)
// {
// // Example #1: If a comment has been added to a closed ticket,
// // re-open the ticket and set the state to "assigned".
// // You might want to use numeric ids for the 'to' item in
// // a real life hook.
// /* We only want to change the ticket state if it is closed, a comment
// * has been added, and the state hasn't been changed already. */
// if (!empty($changes['comment']) &&
// empty($changes['state']) &&
// $ticket->get('state_category') == 'resolved') {
// /* Pick the first state from the state category 'assigned'. */
// $states = $GLOBALS['whups_driver']->getStates($ticket->get('type'),
// 'assigned');
// /* These three item have to exist in a change set. */
// $changes['state'] = array(
// 'to' => key($states),
// 'from' => $ticket->get('state'),
// 'from_name' => $ticket->get('state_name'));
// }
//
// // Example #2: Simple spam check.
// if (isset($changes['comment']['to']) &&
// stripos($changes['comment']['to'], 'some spam text') !== false) {
// throw new Whups_Exception('Spammer!');
// }
//
// return $changes;
// }
}
|