| src/IDF/Template/IssueComment.php |
| 44 | 44 | '<a href="\1">\1</a>', $text); |
| 45 | 45 | } |
| 46 | 46 | if ($request->rights['hasIssuesAccess']) { |
| 47 | | $text = preg_replace_callback('#(issues?|bugs?|tickets?)\s+(\d+)((\s+and|\s+or|,)\s+(\d+)){0,}#im', |
| 47 | $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', |
| 48 | 48 | array($this, 'callbackIssues'), $text); |
| 49 | 49 | } |
| 50 | 50 | if ($request->rights['hasSourceAccess']) { |
| ... | ... | |
| 66 | 66 | */ |
| 67 | 67 | function callbackIssues($m) |
| 68 | 68 | { |
| 69 | | if (count($m) == 3) { |
| 69 | if (count($m) == 3 || count($m) == 4) { |
| 70 | 70 | $issue = new IDF_Issue($m[2]); |
| 71 | 71 | if ($issue->id > 0 and $issue->project == $this->project->id) { |
| 72 | | return $this->linkIssue($issue, $m[1].' '.$m[2]); |
| 72 | if (count($m) == 3) { |
| 73 | return $this->linkIssue($issue, $m[1].' '.$m[2]); |
| 74 | } else { |
| 75 | return $this->linkIssue($issue, $m[1].' '.$m[2], $m[3]); |
| 76 | } |
| 73 | 77 | } else { |
| 74 | 78 | return $m[0]; // not existing issue. |
| 75 | 79 | } |
| ... | ... | |
| 156 | 160 | * @param string Name of the link. |
| 157 | 161 | * @return string Linked issue. |
| 158 | 162 | */ |
| 159 | | public function linkIssue($issue, $title) |
| 163 | public function linkIssue($issue, $title, $anchor='') |
| 160 | 164 | { |
| 161 | 165 | $ic = (in_array($issue->status, $this->project->getTagIdsByStatus('closed'))) ? 'issue-c' : 'issue-o'; |
| 162 | 166 | return '<a href="'.Pluf_HTTP_URL_urlForView('IDF_Views_Issue::view', |
| 163 | | array($this->project->shortname, $issue->id)).'" class="'.$ic.'" title="'.Pluf_esc($issue->summary).'">'.Pluf_esc($title).'</a>'; |
| 167 | array($this->project->shortname, $issue->id)).$anchor.'" class="'.$ic.'" title="'.Pluf_esc($issue->summary).'">'.Pluf_esc($title).'</a>'; |
| 164 | 168 | } |
| 165 | 169 | } |