本文整理汇总了PHP中email_relationship_added函数的典型用法代码示例。如果您正苦于以下问题:PHP email_relationship_added函数的具体用法?PHP email_relationship_added怎么用?PHP email_relationship_added使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了email_relationship_added函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bug_update_date
# it's a child generation... let's create the relationship and add some lines in the history
# update master bug last updated
bug_update_date($f_master_bug_id);
# Add log line to record the cloning action
history_log_event_special($t_bug_id, BUG_CREATED_FROM, '', $f_master_bug_id);
history_log_event_special($f_master_bug_id, BUG_CLONED_TO, '', $t_bug_id);
if ($f_rel_type >= 0) {
# Add the relationship
relationship_add($t_bug_id, $f_master_bug_id, $f_rel_type);
# Add log line to the history (both issues)
history_log_event_special($f_master_bug_id, BUG_ADD_RELATIONSHIP, relationship_get_complementary_type($f_rel_type), $t_bug_id);
history_log_event_special($t_bug_id, BUG_ADD_RELATIONSHIP, $f_rel_type, $f_master_bug_id);
# update relationship target bug last updated
bug_update_date($t_bug_id);
# Send the email notification
email_relationship_added($f_master_bug_id, $t_bug_id, relationship_get_complementary_type($f_rel_type));
}
# copy notes from parent
if ($f_copy_notes_from_parent) {
$t_parent_bugnotes = bugnote_get_all_bugnotes($f_master_bug_id);
foreach ($t_parent_bugnotes as $t_parent_bugnote) {
$t_private = $t_parent_bugnote->view_state == VS_PRIVATE;
bugnote_add($t_bug_id, $t_parent_bugnote->note, $t_parent_bugnote->time_tracking, $t_private, $t_parent_bugnote->note_type, $t_parent_bugnote->note_attr, $t_parent_bugnote->reporter_id, FALSE, FALSE);
}
}
# copy attachments from parent
if ($f_copy_attachments_from_parent) {
file_copy_attachments($f_master_bug_id, $t_bug_id);
}
}
helper_call_custom_function('issue_create_notify', array($t_bug_id));
示例2: relationship_same_type_exists
}
# check if there is other relationship between the bugs...
$t_old_id_relationship = relationship_same_type_exists($f_src_bug_id, $f_dest_bug_id, $f_rel_type);
if ($t_old_id_relationship == -1) {
# the relationship type is exactly the same of the new one. No sense to proceed
trigger_error(ERROR_RELATIONSHIP_ALREADY_EXISTS, ERROR);
} else {
if ($t_old_id_relationship > 0) {
# there is already a relationship between them -> we have to update it and not to add a new one
helper_ensure_confirmed(lang_get('replace_relationship_sure_msg'), lang_get('replace_relationship_button'));
# Update the relationship
relationship_update($t_old_id_relationship, $f_src_bug_id, $f_dest_bug_id, $f_rel_type);
# Add log line to the history (both bugs)
history_log_event_special($f_src_bug_id, BUG_REPLACE_RELATIONSHIP, $f_rel_type, $f_dest_bug_id);
history_log_event_special($f_dest_bug_id, BUG_REPLACE_RELATIONSHIP, relationship_get_complementary_type($f_rel_type), $f_src_bug_id);
} else {
# Add the new relationship
relationship_add($f_src_bug_id, $f_dest_bug_id, $f_rel_type);
# Add log line to the history (both bugs)
history_log_event_special($f_src_bug_id, BUG_ADD_RELATIONSHIP, $f_rel_type, $f_dest_bug_id);
history_log_event_special($f_dest_bug_id, BUG_ADD_RELATIONSHIP, relationship_get_complementary_type($f_rel_type), $f_src_bug_id);
}
}
# update bug last updated (just for the src bug)
bug_update_date($f_src_bug_id);
# send email notification to the users addressed by both the bugs
email_relationship_added($f_src_bug_id, $f_dest_bug_id, $f_rel_type);
email_relationship_added($f_dest_bug_id, $f_src_bug_id, relationship_get_complementary_type($f_rel_type));
}
form_security_purge('bug_relationship_add');
print_header_redirect_view($f_src_bug_id);
示例3: mc_issue_relationship_add
/**
* Submit a new relationship.
*
* @param string $p_username The name of the user trying to add a note to an issue.
* @param string $p_password The password of the user.
* @param integer $p_issue_id The id of the issue of the source issue.
* @param stdClass $p_relationship The relationship to add (RelationshipData SOAP object).
* @return integer The id of the added relationship.
*/
function mc_issue_relationship_add($p_username, $p_password, $p_issue_id, stdClass $p_relationship)
{
global $g_project_override;
$t_user_id = mci_check_login($p_username, $p_password);
$p_relationship = SoapObjectsFactory::unwrapObject($p_relationship);
$t_dest_issue_id = $p_relationship['target_id'];
$t_rel_type = SoapObjectsFactory::unwrapObject($p_relationship['type']);
if ($t_user_id === false) {
return mci_soap_fault_login_failed();
}
$t_project_id = bug_get_field($p_issue_id, 'project_id');
$g_project_override = $t_project_id;
if (!mci_has_readwrite_access($t_user_id, $t_project_id)) {
return mci_soap_fault_access_denied($t_user_id);
}
# user has access to update the bug...
if (!access_has_bug_level(config_get('update_bug_threshold'), $p_issue_id, $t_user_id)) {
return mci_soap_fault_access_denied($t_user_id, 'Active user does not have access level required to add a relationship to this issue');
}
# source and destination bugs are the same bug...
if ($p_issue_id == $t_dest_issue_id) {
return SoapObjectsFactory::newSoapFault('Client', 'An issue can\'t be related to itself.');
}
# the related bug exists...
if (!bug_exists($t_dest_issue_id)) {
return SoapObjectsFactory::newSoapFault('Client', 'Issue \'' . $t_dest_issue_id . '\' not found.');
}
# bug is not read-only...
if (bug_is_readonly($p_issue_id)) {
return mci_soap_fault_access_denied($t_user_id, 'Issue \'' . $p_issue_id . '\' is readonly');
}
# user can access to the related bug at least as viewer...
if (!access_has_bug_level(config_get('view_bug_threshold', null, null, $t_project_id), $t_dest_issue_id, $t_user_id)) {
return mci_soap_fault_access_denied($t_user_id, 'The issue \'' . $t_dest_issue_id . '\' requires higher access level');
}
$t_old_id_relationship = relationship_same_type_exists($p_issue_id, $t_dest_issue_id, $t_rel_type['id']);
if ($t_old_id_relationship == 0) {
log_event(LOG_WEBSERVICE, 'adding relationship type \'' . $t_rel_type['id'] . '\' between \'' . $p_issue_id . '\' and \'' . $t_dest_issue_id . '\'');
relationship_add($p_issue_id, $t_dest_issue_id, $t_rel_type['id']);
# The above function call into MantisBT does not seem to return a valid BugRelationshipData object.
# So we call db_insert_id in order to find the id of the created relationship.
$t_relationship_id = db_insert_id(db_get_table('bug_relationship'));
# Add log line to the history (both bugs)
history_log_event_special($p_issue_id, BUG_ADD_RELATIONSHIP, $t_rel_type['id'], $t_dest_issue_id);
history_log_event_special($t_dest_issue_id, BUG_ADD_RELATIONSHIP, relationship_get_complementary_type($t_rel_type['id']), $p_issue_id);
# update bug last updated for both bugs
bug_update_date($p_issue_id);
bug_update_date($t_dest_issue_id);
# send email notification to the users addressed by both the bugs
email_relationship_added($p_issue_id, $t_dest_issue_id, $t_rel_type['id']);
email_relationship_added($t_dest_issue_id, $p_issue_id, relationship_get_complementary_type($t_rel_type['id']));
return $t_relationship_id;
} else {
return SoapObjectsFactory::newSoapFault('Client', 'Relationship already exists.');
}
}
示例4: mc_issue_relationship_add
/**
* Submit a new relationship.
*
* @param string $p_username The name of the user trying to add a note to an issue.
* @param string $p_password The password of the user.
* @param integer $p_issue_id The id of the issue of the source issue.
* @param RelationshipData $p_relationship The relationship to add.
* @return integer The id of the added relationship.
*/
function mc_issue_relationship_add( $p_username, $p_password, $p_issue_id, $p_relationship ) {
$t_user_id = mci_check_login( $p_username, $p_password );
$t_dest_issue_id = $p_relationship['target_id'];
$t_rel_type = $p_relationship['type'];
if( $t_user_id === false ) {
return mci_soap_fault_login_failed();
}
$t_project_id = bug_get_field( $p_issue_id, 'project_id' );
if( !mci_has_readwrite_access( $t_user_id, $t_project_id ) ) {
return mci_soap_fault_access_denied( $t_user_id );
}
# user has access to update the bug...
if( !access_has_bug_level( config_get( 'update_bug_threshold' ), $p_issue_id, $t_user_id ) ) {
return mci_soap_fault_access_denied( $t_user_id, "Active user does not have access level required to add a relationship to this issue" );
}
# source and destination bugs are the same bug...
if( $p_issue_id == $t_dest_issue_id ) {
return new soap_fault( 'Client', '', "An issue can't be related to itself." );
}
# the related bug exists...
if( !bug_exists( $t_dest_issue_id ) ) {
return new soap_fault( 'Client', '', "Issue '$t_dest_issue_id' not found." );
}
# bug is not read-only...
if( bug_is_readonly( $p_issue_id ) ) {
return new mci_soap_fault_access_denied( $t_user_id, "Issue '$p_issue_id' is readonly" );
}
# user can access to the related bug at least as viewer...
if( !access_has_bug_level( VIEWER, $t_dest_issue_id, $t_user_id ) ) {
return mci_soap_fault_access_denied( $t_user_id, "The issue '$t_dest_issue_id' requires higher access level" );
}
$t_old_id_relationship = relationship_same_type_exists( $p_issue_id, $t_dest_issue_id, $t_rel_type['id'] );
if( $t_old_id_relationship == 0 ) {
relationship_add( $p_issue_id, $t_dest_issue_id, $t_rel_type['id'] );
// The above function call into MantisBT does not seem to return a valid BugRelationshipData object.
// So we call db_insert_id in order to find the id of the created relationship.
$t_relationship_id = db_insert_id( db_get_table( 'bug_relationship' ) );
# Add log line to the history (both bugs)
history_log_event_special( $p_issue_id, BUG_ADD_RELATIONSHIP, $t_rel_type['id'], $t_dest_issue_id );
history_log_event_special( $t_dest_issue_id, BUG_ADD_RELATIONSHIP, relationship_get_complementary_type( $t_rel_type['id'] ), $p_issue_id );
# update bug last updated for both bugs
bug_update_date( $p_issue_id );
bug_update_date( $t_dest_issue_id );
# send email notification to the users addressed by both the bugs
email_relationship_added( $p_issue_id, $t_dest_issue_id, $t_rel_type['id'] );
email_relationship_added( $t_dest_issue_id, $p_issue_id, relationship_get_complementary_type( $t_rel_type['id'] ) );
return $t_relationship_id;
} else {
return new soap_fault( 'Client', '', "Relationship already exists." );
}
}
示例5: add_bug
//.........这里部分代码省略.........
$t_bug_data->reporter_id = $p_email['Reporter_id'];
// This function might do stuff that EmailReporting cannot handle. Disabled
//helper_call_custom_function( 'issue_create_validate', array( $t_bug_data ) );
// @TODO@ Disabled for now but possibly needed for other future features
# Validate the custom fields before adding the bug.
/* $t_related_custom_field_ids = custom_field_get_linked_ids( $t_bug_data->project_id );
foreach( $t_related_custom_field_ids as $t_id )
{
$t_def = custom_field_get_definition( $t_id );
# Produce an error if the field is required but wasn't posted
if ( !gpc_isset_custom_field( $t_id, $t_def['type'] ) &&
( $t_def['require_report'] ||
$t_def['type'] == CUSTOM_FIELD_TYPE_ENUM ||
$t_def['type'] == CUSTOM_FIELD_TYPE_LIST ||
$t_def['type'] == CUSTOM_FIELD_TYPE_MULTILIST ||
$t_def['type'] == CUSTOM_FIELD_TYPE_RADIO ) ) {
error_parameters( lang_get_defaulted( custom_field_get_field( $t_id, 'name' ) ) );
trigger_error( ERROR_EMPTY_FIELD, ERROR );
}
if ( !custom_field_validate( $t_id, gpc_get_custom_field( "custom_field_$t_id", $t_def['type'], NULL ) ) )
{
error_parameters( lang_get_defaulted( custom_field_get_field( $t_id, 'name' ) ) );
trigger_error( ERROR_CUSTOM_FIELD_INVALID_VALUE, ERROR );
}
}*/
# 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_REPORT_BUG_DATA', $t_bug_data);
# Create the bug
$t_bug_id = $t_bug_data->create();
// @TODO@ Disabled for now but possibly needed for other future features
# Handle custom field submission
/* foreach( $t_related_custom_field_ids as $t_id )
{
# Do not set custom field value if user has no write access.
if( !custom_field_has_write_access( $t_id, $t_bug_id ) )
{
continue;
}
$t_def = custom_field_get_definition( $t_id );
if( !custom_field_set_value( $t_id, $t_bug_id, gpc_get_custom_field( "custom_field_$t_id", $t_def['type'], '' ), false ) ) {
{
error_parameters( lang_get_defaulted( custom_field_get_field( $t_id, 'name' ) ) );
trigger_error( ERROR_CUSTOM_FIELD_INVALID_VALUE, ERROR );
}
}*/
// Lets link a readonly already existing bug to the newly created one
if ($f_master_bug_id > 0) {
$f_rel_type = BUG_RELATED;
# update master bug last updated
bug_update_date($f_master_bug_id);
# Add the relationship
relationship_add($t_bug_id, $f_master_bug_id, $f_rel_type);
# Add log line to the history (both issues)
history_log_event_special($f_master_bug_id, BUG_ADD_RELATIONSHIP, relationship_get_complementary_type($f_rel_type), $t_bug_id);
history_log_event_special($t_bug_id, BUG_ADD_RELATIONSHIP, $f_rel_type, $f_master_bug_id);
# Send the email notification
email_relationship_added($f_master_bug_id, $t_bug_id, relationship_get_complementary_type($f_rel_type));
}
helper_call_custom_function('issue_create_notify', array($t_bug_id));
# Allow plugins to post-process bug data with the new bug ID
event_signal('EVENT_REPORT_BUG', array($t_bug_data, $t_bug_id));
email_new_bug($t_bug_id);
} else {
// Not allowed to add issues and not allowed / able to add notes. Need to stop processing
$this->custom_error('Not allowed to create a new issue. Email ignored');
return;
}
$this->custom_error('Reporter: ' . $p_email['Reporter_id'] . ' - ' . $p_email['From_parsed']['email'] . ' --> Issue ID: #' . $t_bug_id, FALSE);
$this->show_memory_usage('Finished add bug');
$this->show_memory_usage('Start processing attachments');
# Add files
if ($this->_allow_file_upload) {
if (count($p_email['X-Mantis-Parts']) > 0) {
$t_rejected_files = NULL;
while ($t_part = array_shift($p_email['X-Mantis-Parts'])) {
$t_file_rejected = $this->add_file($t_bug_id, $t_part);
if ($t_file_rejected !== TRUE) {
$t_rejected_files .= $t_file_rejected;
}
}
if ($t_rejected_files !== NULL) {
$t_part = array('name' => 'Rejected files.txt', 'ctype' => 'text/plain', 'body' => 'List of rejected files' . "\n\n" . $t_rejected_files);
$t_reject_rejected_files = $this->add_file($t_bug_id, $t_part);
if ($t_reject_rejected_files !== TRUE) {
$t_part['body'] .= $t_reject_rejected_files;
$this->custom_error('Failed to add "' . $t_part['name'] . '" to the issue. See below for all errors.' . "\n" . $t_part['body']);
}
}
}
}
//Add the users in Cc and To list in mail header
$this->add_monitors($t_bug_id, $p_email);
//Add the message-id to the database
$this->add_msg_id($t_bug_id, $p_email['Message-ID']);
ERP_set_temporary_overwrite('project_override', NULL);
$this->show_memory_usage('Finished processing attachments');
}
示例6: save_bug
//.........这里部分代码省略.........
$t_bug_data->steps_to_reproduce = gpc_get_string('LOGCAT', "");
$t_bug_data->additional_information = gpc_get_string('CRASH_CONFIGURATION', "");
$t_bug_data->due_date = gpc_get_string('USER_CRASH_DATE', '');
if (is_blank($t_bug_data->due_date)) {
$t_bug_data->due_date = date_get_null();
}
$f_files = gpc_get_file('ufile', null);
/** @todo (thraxisp) Note that this always returns a structure */
$f_report_stay = gpc_get_bool('report_stay', false);
$f_copy_notes_from_parent = gpc_get_bool('copy_notes_from_parent', false);
helper_call_custom_function('issue_create_validate', array($t_bug_data));
# Validate the custom fields before adding the bug.
$t_related_custom_field_ids = custom_field_get_linked_ids($t_bug_data->project_id);
foreach ($t_related_custom_field_ids as $t_id) {
$t_def = custom_field_get_definition($t_id);
# Produce an error if the field is required but wasn't posted
if (!gpc_isset_custom_field($t_id, $t_def['type']) && $t_def['require_report']) {
error_parameters(lang_get_defaulted(custom_field_get_field($t_id, 'name')));
trigger_error(ERROR_EMPTY_FIELD, ERROR);
}
if (!custom_field_validate($t_id, gpc_get_custom_field("custom_field_{$t_id}", $t_def['type'], NULL))) {
error_parameters(lang_get_defaulted(custom_field_get_field($t_id, 'name')));
trigger_error(ERROR_CUSTOM_FIELD_INVALID_VALUE, ERROR);
}
}
# Allow plugins to pre-process bug data
$t_bug_data = event_signal('EVENT_REPORT_BUG_DATA', $t_bug_data);
# Ensure that resolved bugs have a handler
if ($t_bug_data->handler_id == NO_USER && $t_bug_data->status >= config_get('bug_resolved_status_threshold')) {
$t_bug_data->handler_id = $this->get_user_id();
}
# Create the bug
$t_bug_id = $t_bug_data->create();
# Mark the added issue as visited so that it appears on the last visited list.
last_visited_issue($t_bug_id);
# Handle the file upload
if ($f_files != null) {
$t_files = helper_array_transpose($f_files);
if ($t_files != null) {
foreach ($t_files as $t_file) {
if (!empty($t_file['name'])) {
file_add($t_bug_id, $t_file, 'bug');
}
}
}
}
# Handle custom field submission
foreach ($t_related_custom_field_ids as $t_id) {
# Do not set custom field value if user has no write access
if (!custom_field_has_write_access($t_id, $t_bug_id)) {
continue;
}
$t_def = custom_field_get_definition($t_id);
if (!custom_field_set_value($t_id, $t_bug_id, gpc_get_custom_field("custom_field_{$t_id}", $t_def['type'], $t_def['default_value']), false)) {
error_parameters(lang_get_defaulted(custom_field_get_field($t_id, 'name')));
trigger_error(ERROR_CUSTOM_FIELD_INVALID_VALUE, ERROR);
}
}
$f_master_bug_id = gpc_get_int('m_id', 0);
$f_rel_type = gpc_get_int('rel_type', -1);
if ($f_master_bug_id > 0) {
# it's a child generation... let's create the relationship and add some lines in the history
# update master bug last updated
bug_update_date($f_master_bug_id);
# Add log line to record the cloning action
history_log_event_special($t_bug_id, BUG_CREATED_FROM, '', $f_master_bug_id);
history_log_event_special($f_master_bug_id, BUG_CLONED_TO, '', $t_bug_id);
if ($f_rel_type >= 0) {
# Add the relationship
relationship_add($t_bug_id, $f_master_bug_id, $f_rel_type);
# Add log line to the history (both issues)
history_log_event_special($f_master_bug_id, BUG_ADD_RELATIONSHIP, relationship_get_complementary_type($f_rel_type), $t_bug_id);
history_log_event_special($t_bug_id, BUG_ADD_RELATIONSHIP, $f_rel_type, $f_master_bug_id);
# update relationship target bug last updated
bug_update_date($t_bug_id);
# Send the email notification
email_relationship_added($f_master_bug_id, $t_bug_id, relationship_get_complementary_type($f_rel_type));
}
# copy notes from parent
if ($f_copy_notes_from_parent) {
$t_parent_bugnotes = bugnote_get_all_bugnotes($f_master_bug_id);
foreach ($t_parent_bugnotes as $t_parent_bugnote) {
$t_private = $t_parent_bugnote->view_state == VS_PRIVATE;
bugnote_add($t_bug_id, $t_parent_bugnote->note, $t_parent_bugnote->time_tracking, $t_private, $t_parent_bugnote->note_type, $t_parent_bugnote->note_attr, $t_parent_bugnote->reporter_id, FALSE, FALSE);
}
}
}
helper_call_custom_function('issue_create_notify', array($t_bug_id));
# Allow plugins to post-process bug data with the new bug ID
event_signal('EVENT_REPORT_BUG', array($t_bug_data, $t_bug_id));
email_new_bug($t_bug_id);
// log status and resolution changes if they differ from the default
if ($t_bug_data->status != config_get('bug_submit_status')) {
history_log_event($t_bug_id, 'status', config_get('bug_submit_status'));
}
if ($t_bug_data->resolution != config_get('default_bug_resolution')) {
history_log_event($t_bug_id, 'resolution', config_get('default_bug_resolution'));
}
return $t_bug_id;
}