#17569922 : added link to issue and changeset

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@5165 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
haneul 2008-12-23 06:30:56 +00:00
parent 75c211f98e
commit f788064050
3 changed files with 21 additions and 3 deletions

View file

@ -245,7 +245,7 @@
return $output;
}
function getLog($path, $erev=null, $brev=null, $quiet = false, $limit = 2) {
function getLog($path, $erev=null, $brev=null, $quiet = false, $limit = 2, $link = true) {
if(strpos($path,'..')!==false) return;
$command = sprintf(
@ -287,7 +287,7 @@
$obj->paths[] = $tmp_obj;
}
$obj->msg = $this->linkXE($tmp->msg->body);
$obj->msg = $link?$this->linkXE($tmp->msg->body):$tmp->msg->body;
$output[] = $obj;
}
return $output;

View file

@ -396,7 +396,7 @@
$oController = &getController('issuetracker');
if($latestRevision < $status->revision)
{
$logs = $oSvn->getLog("/", $latestRevision+1, $status->revision, false, $status->revision-$latestRevision);
$logs = $oSvn->getLog("/", $latestRevision+1, $status->revision, false, $status->revision-$latestRevision, false);
foreach($logs as $log)
{
$obj = null;

View file

@ -190,6 +190,10 @@
for($k=0;$k<count($mat[1]);$k++) {
$histories[$i]->content = str_replace('r'.$mat[1][$k], sprintf('<a href="%s" onclick="window.open(this.href); return false;">%s</a>',getUrl('','mid',Context::get('mid'),'act','dispIssuetrackerViewSource','type','compare','erev',$mat[1][$k],'brev',''), 'r'.$mat[1][$k]), $histories[$i]->content);
}
preg_match_all('/\[([0-9]+)\]/',$histories[$i]->content, $mat);
for($k=0;$k<count($mat[1]);$k++) {
$histories[$i]->content = str_replace('['.$mat[1][$k].']', sprintf('<a href="%s" onclick="window.open(this.href); return false;">%s</a>',getUrl('','mid',Context::get('mid'),'act','dispIssuetrackerViewSource','type','compare','erev',$mat[1][$k],'brev',''), '['.$mat[1][$k].']'), $histories[$i]->content);
}
}
return $histories;
}
@ -368,6 +372,16 @@
else return 0;
}
function _linkDocument($matches) {
$document_srl = $matches[1];
return sprintf('<a href="%s" onclick="window.open(this.href); return false;">#%d</a>', getUrl('','document_srl',$document_srl), $document_srl);
}
function _linkXE($message)
{
return preg_replace_callback('/^\#?([0-9]+)( |\:)/', array($this, '_linkDocument'), $message);
}
function getChangesets($module_srl, $enddate = null, $limit = 10)
{
@ -384,6 +398,10 @@
debugPrint($output);
return array();
}
foreach($output->data as $key => $changeset)
{
$changeset->message = $this->_linkXE($changeset->message);
}
$solvedHistory = array();
$output2 = executeQueryArray("issuetracker.getHistories", $args);