| 1 |
<?php |
| 2 |
add_filter( 'wpas_plugin_settings', 'wpas_core_basic_time_tracking', 5, 1 ); |
| 3 |
/** |
| 4 |
* Add plugin core settings for basic time tracking |
| 5 |
* |
| 6 |
* @param array $def Array of existing settings |
| 7 |
* |
| 8 |
* @return array Updated settings |
| 9 |
*/ |
| 10 |
function wpas_core_basic_time_tracking( $def ) { |
| 11 |
|
| 12 |
$settings = array( |
| 13 |
'basictimetracking' => array( |
| 14 |
'name' => __( 'Basic Time Tracking', 'awesome-support' ), |
| 15 |
'options' => array( |
| 16 |
array( |
| 17 |
'name' => __( 'Basic Time Tracking', 'awesome-support' ), |
| 18 |
'type' => 'heading', |
| 19 |
'options' => wpas_get_basic_time_tracking_options() |
| 20 |
), |
| 21 |
array( |
| 22 |
'name' => __( 'Front-end Options', 'awesome-support' ), |
| 23 |
'id' => 'basic-time-tracking-front-end-options', |
| 24 |
'type' => 'heading', |
| 25 |
'options' => wpas_get_basic_time_tracking_fe_options() |
| 26 |
), |
| 27 |
|
| 28 |
) |
| 29 |
), |
| 30 |
); |
| 31 |
|
| 32 |
return array_merge( $def, apply_filters('wpas_settings_basic_time_tracking', $settings ) ); |
| 33 |
|
| 34 |
} |
| 35 |
|
| 36 |
/** |
| 37 |
* Prepare the available options for basic time tracking... |
| 38 |
* |
| 39 |
* @since 3.3.5 |
| 40 |
* @return array |
| 41 |
*/ |
| 42 |
function wpas_get_basic_time_tracking_options() { |
| 43 |
|
| 44 |
$basic_time_tracking_options = array( |
| 45 |
array( |
| 46 |
'name' => __( 'Show Basic Time Tracking Fields', 'awesome-support' ), |
| 47 |
'id' => 'show_basic_time_tracking_fields', |
| 48 |
'type' => 'checkbox', |
| 49 |
'desc' => __( 'Would you like to show the basic time tracking fields?', 'awesome-support' ), |
| 50 |
'default' => true |
| 51 |
), |
| 52 |
|
| 53 |
array( |
| 54 |
'name' => __( 'Allow Agents To Enter Time', 'awesome-support' ), |
| 55 |
'id' => 'allow_agents_to_enter_time', |
| 56 |
'type' => 'checkbox', |
| 57 |
'desc' => __( 'Can agents enter time? If unchecked, agents cannot enter or adjust time and it is assumed that another add-on will do time tracking and update these fields', 'awesome-support' ), |
| 58 |
'default' => true |
| 59 |
), |
| 60 |
|
| 61 |
array( |
| 62 |
'name' => __( 'Recalculate Final Time On Save', 'awesome-support' ), |
| 63 |
'id' => 'recalculate_final_time_on_save', |
| 64 |
'type' => 'checkbox', |
| 65 |
'desc' => __( 'Recalculate the final time when the ticket is saved? This should be checked for manual time tracking not handled by another add-on. It takes the original time, adds or subtracts the adjustments and enters the new amount in the final time field. This should be unchecked if another add-on is handling the time tracking and updates!', 'awesome-support' ), |
| 66 |
'default' => true |
| 67 |
), |
| 68 |
|
| 69 |
array( |
| 70 |
'name' => __( 'Keep Audit Log', 'awesome-support' ), |
| 71 |
'id' => 'keep_audit_log_time_tracking', |
| 72 |
'type' => 'checkbox', |
| 73 |
'desc' => __( 'Adds an internal note to the ticket every time someone updates the basic time tracking fields', 'awesome-support' ), |
| 74 |
'default' => true |
| 75 |
), |
| 76 |
|
| 77 |
array( |
| 78 |
'name' => __( 'Show Total Time In Ticket List', 'awesome-support' ), |
| 79 |
'id' => 'show_total_time_in_ticket_list', |
| 80 |
'type' => 'checkbox', |
| 81 |
'desc' => __( 'Adds a column to the ticket list to show the total original time recorded for the ticket', 'awesome-support' ), |
| 82 |
'default' => false |
| 83 |
), |
| 84 |
|
| 85 |
array( |
| 86 |
'name' => __( 'Show Total Time Adjustments In Ticket List', 'awesome-support' ), |
| 87 |
'id' => 'show_total_time_adj_in_ticket_list', |
| 88 |
'type' => 'checkbox', |
| 89 |
'desc' => __( 'Adds a column to the ticket list to show the time adjustments recorded for the ticket', 'awesome-support' ), |
| 90 |
'default' => false |
| 91 |
), |
| 92 |
|
| 93 |
array( |
| 94 |
'name' => __( 'Show Final Recorded Time In Ticket List', 'awesome-support' ), |
| 95 |
'id' => 'show_final_time_in_ticket_list', |
| 96 |
'type' => 'checkbox', |
| 97 |
'desc' => __( 'Adds a column to the ticket list to show the final time recorded for the ticket', 'awesome-support' ), |
| 98 |
'default' => false |
| 99 |
) |
| 100 |
); |
| 101 |
|
| 102 |
|
| 103 |
return $basic_time_tracking_options; |
| 104 |
} |
| 105 |
|
| 106 |
/** |
| 107 |
* Prepare the available options for basic time tracking - front-end options... |
| 108 |
* |
| 109 |
* @since 5.8.1 |
| 110 |
* @return array |
| 111 |
*/ |
| 112 |
function wpas_get_basic_time_tracking_fe_options() { |
| 113 |
|
| 114 |
$basic_time_tracking_options = array( |
| 115 |
array( |
| 116 |
'name' => __( 'Show Final Time On Front-end Ticket List', 'awesome-support' ), |
| 117 |
'id' => 'show_final_time_in_fe_ticket_list', |
| 118 |
'type' => 'checkbox', |
| 119 |
'desc' => __( 'Turn this on to allow the client to see the final time recorded in the front-end ticket list', 'awesome-support' ), |
| 120 |
'default' => false |
| 121 |
), |
| 122 |
|
| 123 |
array( |
| 124 |
'name' => __( 'Show Final Time On Front-end Ticket', 'awesome-support' ), |
| 125 |
'id' => 'show_final_time_in_fe_ticket', |
| 126 |
'type' => 'checkbox', |
| 127 |
'desc' => __( 'Turn this on to allow the client to see the final time recorded in the front-end ticket', 'awesome-support' ), |
| 128 |
'default' => false |
| 129 |
), |
| 130 |
|
| 131 |
); |
| 132 |
|
| 133 |
|
| 134 |
return $basic_time_tracking_options; |
| 135 |
} |