Esempio n. 1
0
 /**
  * Process mentions in the current issue, for example, after the issue is created.
  * @return void
  * @access public
  */
 function process_mentions()
 {
     # Now that the issue is added process the @ mentions
     $t_all_mentioned_user_ids = array();
     $t_mentioned_user_ids = mention_get_users($this->summary);
     $t_all_mentioned_user_ids = array_merge($t_all_mentioned_user_ids, $t_mentioned_user_ids);
     $t_mentioned_user_ids = mention_get_users($this->description);
     $t_all_mentioned_user_ids = array_merge($t_all_mentioned_user_ids, $t_mentioned_user_ids);
     if (!is_blank($this->steps_to_reproduce)) {
         $t_mentioned_user_ids = mention_get_users($this->steps_to_reproduce);
         $t_all_mentioned_user_ids = array_merge($t_all_mentioned_user_ids, $t_mentioned_user_ids);
     }
     if (!is_blank($this->additional_information)) {
         $t_mentioned_user_ids = mention_get_users($this->additional_information);
         $t_all_mentioned_user_ids = array_merge($t_all_mentioned_user_ids, $t_mentioned_user_ids);
     }
     $t_filtered_mentioned_user_ids = access_has_bug_level_filter(config_get('view_bug_threshold'), $this->id, $t_all_mentioned_user_ids);
     $t_removed_mentions_user_ids = array_diff($t_all_mentioned_user_ids, $t_filtered_mentioned_user_ids);
     if (!empty($t_all_mentioned_user_ids)) {
         $t_mention_text = $this->description . "\n\n";
         if (!is_blank($this->steps_to_reproduce)) {
             $t_mention_text .= lang_get('email_steps_to_reproduce') . "\n\n";
             $t_mention_text .= $this->steps_to_reproduce . "\n\n";
         }
         if (!is_blank($this->additional_information)) {
             $t_mention_text .= lang_get('email_additional_information') . "\n\n";
             $t_mention_text .= $this->additional_information . "\n\n";
         }
         mention_process_user_mentions($this->id, $t_filtered_mentioned_user_ids, $t_mention_text, $t_removed_mentions_user_ids);
     }
 }
Esempio n. 2
0
/**
 * Process mentions in bugnote, typically after its added.
 *
 * @param  int $p_bug_id          The bug id
 * @param  int $p_bugnote_id      The bugnote id
 * @param  string $p_bugnote_text The bugnote text
 * @return void
 * @access public
 */
function bugnote_process_mentions($p_bug_id, $p_bugnote_id, $p_bugnote_text)
{
    # Process the mentions that have access to the issue note
    $t_mentioned_user_ids = mention_get_users($p_bugnote_text);
    $t_filtered_mentioned_user_ids = access_has_bugnote_level_filter(config_get('view_bug_threshold'), $p_bugnote_id, $t_mentioned_user_ids);
    $t_removed_mentions_user_ids = array_diff($t_mentioned_user_ids, $t_filtered_mentioned_user_ids);
    mention_process_user_mentions($p_bug_id, $t_filtered_mentioned_user_ids, $p_bugnote_text, $t_removed_mentions_user_ids);
}