Indefero

Indefero Commit Details


Date:2009-06-19 09:01:17 (15 years 6 months ago)
Author:Baptiste Durand-Bret
Branch:develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, master, release-1.1, release-1.2, release-1.3
Commit:29e053bf6b800beee8f55405fe92f7566b6a1917
Parents: a15107558c3d811a44ba550b3323d09e1120daea
Message:Fixed issue 217, can't link directly to a user comment when linking to an issue

Changes:

File differences

src/IDF/Template/IssueComment.php
4444
4545
4646
47
47
4848
4949
5050
......
6666
6767
6868
69
69
7070
7171
72
72
73
74
75
76
7377
7478
7579
......
156160
157161
158162
159
163
160164
161165
162166
163
167
164168
165169
'<a href="\1">\1</a>', $text);
}
if ($request->rights['hasIssuesAccess']) {
$text = preg_replace_callback('#(issues?|bugs?|tickets?)\s+(\d+)((\s+and|\s+or|,)\s+(\d+)){0,}#im',
$text = preg_replace_callback('#(issues?|bugs?|tickets?)\s+(\d+)(\#ic\d*){0,1}((\s+and|\s+or|,)\s+(\d+)(\#ic\d*){0,1}){0,}#im',
array($this, 'callbackIssues'), $text);
}
if ($request->rights['hasSourceAccess']) {
*/
function callbackIssues($m)
{
if (count($m) == 3) {
if (count($m) == 3 || count($m) == 4) {
$issue = new IDF_Issue($m[2]);
if ($issue->id > 0 and $issue->project == $this->project->id) {
return $this->linkIssue($issue, $m[1].' '.$m[2]);
if (count($m) == 3) {
return $this->linkIssue($issue, $m[1].' '.$m[2]);
} else {
return $this->linkIssue($issue, $m[1].' '.$m[2], $m[3]);
}
} else {
return $m[0]; // not existing issue.
}
* @param string Name of the link.
* @return string Linked issue.
*/
public function linkIssue($issue, $title)
public function linkIssue($issue, $title, $anchor='')
{
$ic = (in_array($issue->status, $this->project->getTagIdsByStatus('closed'))) ? 'issue-c' : 'issue-o';
return '<a href="'.Pluf_HTTP_URL_urlForView('IDF_Views_Issue::view',
array($this->project->shortname, $issue->id)).'" class="'.$ic.'" title="'.Pluf_esc($issue->summary).'">'.Pluf_esc($title).'</a>';
array($this->project->shortname, $issue->id)).$anchor.'" class="'.$ic.'" title="'.Pluf_esc($issue->summary).'">'.Pluf_esc($title).'</a>';
}
}

Archive Download the corresponding diff file

Page rendered in 0.08228s using 14 queries.