- When a user does not have any favorites in his list, show a message instead of an empty screen
- Added the ability to show all the users in a paginated list in the admin section (bug://report/55)
- Can export search results to an XML file (bug://report/41)
+- Links in comments are now parsed if the user so desires (bug://report/2)
1.1.4
===============================
## SVN $Id$
-ALTER TABLE user CHANGE timezone timezone float(4) NOT NULL DEFAULT 0;
+ALTER TABLE `comment` ADD parselinks BOOL NULL;
- Mass updates and deletes
- Ability to show votes on bug listings (bug://report/13)
- Ability to show components on bug listings (bug://report/43)
-- Parse links in bug comments (bug://report/2)
- Importing from other bug systems (bug://report/41)
- Workflow interface
}
$commentapi->set('comment', $bugsys->in['comment']);
+ $commentapi->set('parselinks', $bugsys->in['parselinks']);
$commentapi->set('hidden', $bugsys->in['hidden']);
if ($bugsys->in['commentid'] == $bug['initialreport'] AND $bugsys->in['hidden'])
$comment->set('bugid', $bugsys->in['bugid']);
$comment->set('userid', $bugsys->userinfo['userid']);
$comment->set('comment', $commenttext);
+ $comment->set('parselinks', $bugsys->in['parselinks']);
$comment->insert();
// we redefine the bug data later, but it needs to be here in order to generate the user list
'bugid' => array(TYPE_UINT, REQ_YES, 'verify_nozero'),
'userid' => array(TYPE_UINT, REQ_NO, null, array('includes/api_user.php', 'UserAPI')),
'dateline' => array(TYPE_UINT, REQ_SET),
+ 'parselinks' => array(TYPE_BOOL, REQ_NO),
'comment' => array(TYPE_STR, REQ_YES, 'verify_noempty'),
'comment_parsed' => array(TYPE_NONE, REQ_SET),
'hidden' => array(TYPE_BOOL, REQ_NO)
*/
function set_comment_parsed()
{
+ $comment = $this->values['comment'];
+ if ($this->values['parselinks'])
+ {
+ $comment = str_replace('bug://new', '<a href="newreport.php">New Bug</a>', $comment);
+ $comment = preg_replace('#bug://((report|problem)/)?([0-9]*)#i', '<a href="showreport.php?bugid=\3">bug \3</a>', $comment);
+ $comment = preg_replace('#(https?://|www\.)\S+#i', '<a href="\0">\0</a>', $comment);
+ }
+
if ($this->registry->options['allowhtml'])
{
- $this->set('comment_parsed', nl2br($this->registry->unsanitize($this->values['comment'])));
+ $this->set('comment_parsed', nl2br($this->registry->unsanitize($comment)));
}
else
{
- $this->set('comment_parsed', nl2br($this->values['comment']));
+ $this->set('comment_parsed', nl2br($comment));
}
}
$comment->set('userid', $bugsys->userinfo['userid']);
$comment->set('comment', $bugsys->in['comment']);
+ $comment->set('parselinks', $bugsys->in['parselinks']);
// -------------------------------------------------------------------
// check permissions on various input values
<div class="box-mid" style="text-align: $stylevar[left]">
<if condition="$show['hide']"><div><strong<if condition="$comment['hidden']"> style="color: red"</if>>{@"Hidden"}:</strong> <input type="checkbox" name="hidden" value="1"<if condition="$comment['hidden']"> checked="checked"</if> /></div></if>
+ <div><strong>{@"Parse Links in the Comment"}:</strong> <input type="checkbox" name="parselinks" value="1"<if condition="$comment['parselinks']"> checked="checked"</if> /></div>
<textarea name="comment" cols="50" rows="15" class="textarea">$comment[comment]</textarea>
</div>
</div>
<legend>{@"Description/Initial Report"}</legend>
<textarea name="comment" cols="50" rows="10" class="textarea"><if condition="$bugsys->in['comment']">{$bugsys->in['comment']}<else />{$bugsys->options['defaultcomment']}</if></textarea>
+
+ <div><input type="checkbox" name="parselinks" value="1"<if condition="$bugsys->in['parselinks']"> checked="checked"</if> /> {@"Parse Links in the Comment"}</div>
</fieldset>
</div>
<!-- / new reply -->
<legend>{@"New Reply"}<if condition="$show['automations']"> : <a href="explain.php?do=automations">{@"Automation"}</a> <select name="automation">$select[automation]</select></if> $help[newreply]</legend>
<textarea name="comment" cols="50" rows="10" class="textarea"></textarea>
+
+ <div><input type="checkbox" name="parselinks" value="1"<if condition="$bugsys->in['parselinks']"> checked="checked"</if> /> {@"Parse Links in the Comment"}</div>
</fieldset>
</div>
<!-- / new reply -->