Index: core/config_api.php
===================================================================
--- core/config_api.php (revision 994)
+++ core/config_api.php (working copy)
@@ -164,7 +164,14 @@
?>
>
|
-
+
|
' . plugin_lang_get( 'unknown_setting' ) . $p_name . ' -> level 1 |
';
+ default:
+ $plugin_name = event_signal('EVENT_ERP_GET_EXTRA_FIELD_NAME', $p_name);
+ if ($plugin_name != null)
+ {
+ echo '';
+ echo '| '.$plugin_name.' | ';
+ echo event_signal('EVENT_ERP_OUTPUT_EXTRA_FIELD_TYPE', array($p_name, $p_type, $t_value));
+ echo '
';
+ }
+ else
+ {
+ echo '| ' . plugin_lang_get( 'unknown_setting' ) . $p_name . ' -> level 1 |
';
+ }
}
}
Index: core/mail_api.php
===================================================================
--- core/mail_api.php (revision 994)
+++ core/mail_api.php (working copy)
@@ -592,6 +592,8 @@
$t_status = bug_get_field( $t_bug_id, 'status' );
+ $t_description = event_signal( 'EVENT_ERP_PROCESS_BUGNOTE_DATA', $t_description, array($p_email, $this->_mailbox) );
+
if ( $this->_bug_resolved_status_threshold <= $t_status )
{
# Reopen issue and add a bug note
@@ -662,6 +664,7 @@
# Allow plugins to pre-process bug data
$t_bug_data = event_signal( 'EVENT_REPORT_BUG_DATA', $t_bug_data );
+ $t_bug_data = event_signal( 'EVENT_ERP_PROCESS_BUG_DATA', $t_bug_data, array($p_email, $this->_mailbox) );
# Create the bug
$t_bug_id = $t_bug_data->create();
Index: EmailReporting.php
===================================================================
--- EmailReporting.php (revision 995)
+++ EmailReporting.php (working copy)
@@ -215,6 +215,46 @@
}
}
+ function events() {
+ return array(
+ # Allow other plugins to process bugdata before the bug is added
+ # Parameters are BugData, Email details array, Mailbox data
+ # Result is BugData
+ 'EVENT_ERP_PROCESS_BUG_DATA' => EVENT_TYPE_CHAIN,
+
+ # Allow other plugins to process bugnote data before the bug is added
+ # Parameters are bugnote text, Email details array, Mailbox data
+ # Result is bugnote text
+ 'EVENT_ERP_PROCESS_BUGNOTE_DATA' => EVENT_TYPE_CHAIN,
+
+ # Allow other plugins to add configuration elements in the form displayed
+ # by manage_mailbox.php in the mailbox_settings_issue section
+ # Parameters are extra fields from other plugins and mailbox data (value of $t_mailbox)
+ # Result is an array of key/value pairs used as the first two parameters
+ # in a call to ERP_output_config_options
+ 'EVENT_ERP_GET_EXTRA_MAILBOX_SETTINGS_ISSUE_FIELDS' => EVENT_TYPE_CHAIN,
+
+ # Allow other plugins to add elements in the mailbox data that is saved in the config
+ # Parameters are extra data from other plugins and Mailbox data from manage_mailbox_edit.php
+ # Result is Mailbox data
+ 'EVENT_ERP_GET_EXTRA_MAILBOX_DATA' => EVENT_TYPE_CHAIN,
+
+ # Allow other plugins to give the name for an extra field added via the
+ # EVENT_ERP_GET_EXTRA_MAILBOX_SETTINGS_ISSUE_FIELDS event
+ # Parameter is the name of the extra field
+ # Result is the displayable string as returned by plugin_lang_get
+ 'EVENT_ERP_GET_EXTRA_FIELD_NAME' => EVENT_TYPE_FIRST,
+
+ # Allow other plugins to output the input HTML elements for a specific type
+ # as given for an extra field added via the
+ # EVENT_ERP_GET_EXTRA_MAILBOX_SETTINGS_ISSUE_FIELDS event
+ # Parameters are the name, the type and the value of the extra field
+ # Result is the HTML code that will be displayed on the right part of the table
+ # and must include the | tags
+ 'EVENT_ERP_OUTPUT_EXTRA_FIELD_TYPE' => EVENT_TYPE_FIRST,
+ );
+ }
+
/**
* EmailReporting plugin hooks.
*/
Index: pages/manage_mailbox.php
===================================================================
--- pages/manage_mailbox.php (revision 994)
+++ pages/manage_mailbox.php (working copy)
@@ -73,6 +73,14 @@
ERP_output_config_option( 'mailbox_project_id', 'dropdown_projects', -3, $t_mailbox );
ERP_output_config_option( 'mailbox_global_category_id', 'dropdown_global_categories', -3, $t_mailbox );
+$extra_fields = event_signal('EVENT_ERP_GET_EXTRA_MAILBOX_SETTINGS_ISSUE_FIELDS', null, $t_mailbox);
+
+if (is_array($extra_fields))
+{
+ foreach ($extra_fields as $field_id => $field_type_id)
+ ERP_output_config_option( $field_id, $field_type_id, -3, $t_mailbox );
+}
+
ERP_output_config_option( $f_mailbox_action . '_mailbox', 'submit' );
?>
Index: pages/manage_mailbox_edit.php
===================================================================
--- pages/manage_mailbox_edit.php (revision 994)
+++ pages/manage_mailbox_edit.php (working copy)
@@ -31,6 +31,11 @@
$t_mailbox += $t_mailbox_imap;
}
+
+ $t_extra_data = event_signal('EVENT_ERP_GET_EXTRA_MAILBOX_DATA', null, array($t_mailbox));
+
+ if (is_array($t_extra_data))
+ $t_mailbox = array_merge($t_mailbox, $t_extra_data);
}
if ( $f_mailbox_action === 'add' || $f_mailbox_action === 'copy' )