示例#1
0
 /**
  * Adds a system comment
  * 
  * @param string $title Comment title
  * @param string $text Comment text
  * @param integer $uid The user ID that posted the comment
  * 
  * @return TBGComment
  */
 public function addSystemComment($text, $uid)
 {
     $comment = new TBGComment();
     $comment->setTitle('');
     $comment->setContent($text);
     $comment->setPostedBy($uid);
     $comment->setTargetID($this->getID());
     $comment->setTargetType(TBGComment::TYPE_ISSUE);
     $comment->setSystemComment();
     if (!TBGSettings::isCommentTrailClean()) {
         $comment->save();
     }
     return $comment;
 }
示例#2
0
 disabled<?php 
}
?>
>
				<option value=1<?php 
if (TBGSettings::isCommentTrailClean()) {
    ?>
 selected<?php 
}
?>
><?php 
echo __("Don't post system comments when an issue is updated");
?>
</option>
				<option value=0<?php 
if (!TBGSettings::isCommentTrailClean()) {
    ?>
 selected<?php 
}
?>
><?php 
echo __('Always post comments when an issue is updated');
?>
</option>
			</select>
		</td>
	</tr>
	<tr>
		<td class="config_explanation" colspan="2"><?php 
echo __('To keep the comment trail clean in issues, you can select not to post system comments when an issue is updated.');
?>
 /**
  * Adds a system comment
  * 
  * @param string $title Comment title
  * @param string $text Comment text
  * @param integer $uid The user ID that posted the comment
  * 
  * @return TBGComment
  */
 public function addSystemComment($title, $text, $uid)
 {
     $comment = new TBGComment();
     $comment->setTitle($title);
     $comment->setContent($text);
     $comment->setPostedBy($uid);
     $comment->setTargetID($this->getID());
     $comment->setTargetType(TBGComment::TYPE_ISSUE);
     $comment->setSystemComment();
     if (!TBGSettings::isCommentTrailClean()) {
         $comment->save();
     }
     TBGEvent::createNew('core', 'TBGComment::createNew', $this, array('comment' => $comment))->trigger();
     return $comment;
 }