timeline 추가

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4733 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
haneul 2008-10-30 10:15:25 +00:00
parent 2fd078ff5c
commit 82068ec7c1
12 changed files with 156 additions and 1 deletions

View file

@ -53,7 +53,9 @@
<action name="dispIssuetrackerDeleteTrackback" type="view" standalone="true"/>
<action name="dispIssuetrackerMilestone" type="view" standalone="true" />
<action name="dispIssuetrackerDownload" type="view" standalone="true" />
<actino name="dispIssuetrackerTimeline" type="view" standalone="true" />
<action name="procIssuetrackerSync" type="controller" standalone="true" />
<action name="procIssuetrackerInsertIssue" type="controller" standalone="true" />
<action name="procIssuetrackerDeleteIssue" type="controller" standalone="true" />
<action name="procIssuetrackerDeleteTrackback" type="controller" standalone="true" />

View file

@ -47,6 +47,9 @@
$oModuleController->insertActionForward('issuetracker', 'view', 'dispIssuetrackerAdminAttachRelease');
$oModuleController->insertActionForward('issuetracker', 'controller', 'procIssuetrackerAdminAttachRelease');
$oDB = &DB::getInstance();
$oDB->addIndex("issue_changesets","idx_unique_revision", array("module_srl","revision"), true);
}
function checkUpdate()

View file

@ -57,7 +57,10 @@
$oDB->begin();
$output = executeQuery("issuetracker.insertIssue", $obj);
if(!$output->toBool()) return $output;
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
$output = $oDocumentController->insertDocument($obj);
$msg_code = 'success_registed';
@ -367,5 +370,35 @@
$this->setMessage('success_deleted');
}
function syncChangeset()
{
require_once($this->module_path.'classes/svn.class.php');
$oSvn = new Svn($this->module_info->svn_url, $this->module_info->svn_cmd, $this->module_info->diff_cmd);
$oModel = &getModel('issuetracker');
$status = $oSvn->getStatus();
$latestRevision = $oModel->getLatestRevision($this->module_info->module_srl);
$oController = &getController('issuetracker');
if($latestRevision < $status->revision)
{
$logs = $oSvn->getLog("/", $latestRevision+1, $status->revision, false, $status->revision-$latestRevision);
foreach($logs as $log)
{
$obj = null;
$obj->revision = $log->revision;
$obj->author = $log->author;
$obj->date = date("YmdHis", strtotime($log->date));
$obj->message = trim($log->msg);
$obj->module_srl = $this->module_info->module_srl;
executeQuery("issuetracker.insertChangeset", $obj);
}
}
}
function procIssuetrackerSync()
{
$this->syncChangeset();
}
}
?>

View file

@ -8,6 +8,7 @@
require_once(_XE_PATH_.'modules/issuetracker/issuetracker.item.php');
class issuetrackerModel extends issuetracker {
var $oSvn = null;
function init()
{
@ -348,5 +349,36 @@
$output = executeQueryArray('issuetracker.getGroupMembers', $args);
return $output->data;
}
function getLatestRevision($module_srl) {
$args->module_srl = $module_srl;
$output = executeQuery('issuetracker.getLatestRevision', $args);
if($output->data && $output->data->revision)
{
return $output->data->revision;
}
else return 0;
}
function getChangesets($module_srl, $enddate = null, $limit = 90)
{
if(!$enddate)
{
$enddate = date("Ymd");
}
$args->enddate = date("Ymd", ztime($enddate)+24*60*60);
$args->startdate = date("Ymd", ztime($enddate)-24*60*60*$limit);
$args->module_srl = $module_srl;
$output = executeQueryArray("issuetracker.getChangesets", $args);
if(!$output->toBool() || !$output->data)
{
debugPrint($output);
return array();
}
else
{
return $output->data;
}
}
}
?>

View file

@ -67,6 +67,14 @@
if(!Context::get('act')) Context::set('act','dispIssuetrackerViewIssue');
}
function dispIssuetrackerTimeline() {
if(!$this->grant->access) return $this->dispIssuetrackerMessage('msg_not_permitted');
$oModel = &getModel('issuetracker');
$changesets = $oModel->getChangesets($this->module_info->module_srl);
Context::set('changesets', $changesets);
$this->setTemplateFile('timeline');
}
/**
* @brief 마일스톤과 그에 따른 통계 제공
**/

View file

@ -76,6 +76,7 @@
$lang->project_menus = array(
'dispIssuetrackerViewIssue' => '문제 열람',
'dispIssuetrackerNewIssue' => '문제 작성',
'dispIssuetrackerTimeline' => '타임 라인',
'dispIssuetrackerViewMilestone' => '개발계획',
'dispIssuetrackerViewSource' => '코드 열람',
'dispIssuetrackerDownload' => '다운로드',

View file

@ -0,0 +1,16 @@
<query id="getChangesets" action="select">
<tables>
<table name="issue_changesets" />
</tables>
<columns>
<column name="*" />
</columns>
<conditions>
<condition operation="equal" column="module_srl" var="module_srl" />
<condition operation="below" column="date" var="enddate" pipe="and" />
<condition operation="more" column="date" var="startdate" pipe="and" />
</conditions>
<navigation>
<index var="sort_index" default="revision" order="desc" />
</navigation>
</query>

View file

@ -0,0 +1,11 @@
<query id="getLatestRevision" action="select">
<tables>
<table name="issue_changesets" />
</tables>
<columns>
<column name="max(revision)" alias="revision" />
</columns>
<conditions>
<condition operation="equal" column="module_srl" var="module_srl" notnull="notnull" />
</conditions>
</query>

View file

@ -0,0 +1,12 @@
<query id="insertChangeset" action="insert">
<tables>
<table name="issue_changesets" />
</tables>
<columns>
<column name="module_srl" var="module_srl" notnull="notnull" />
<column name="revision" var="revision" notnull="notnull" />
<column name="author" var="author" notnull="notnull" />
<column name="date" var="date" notnull="notnull" />
<column name="message" var="message" />
</columns>
</query>

View file

@ -0,0 +1,7 @@
<table name="issue_changesets">
<column name="revision" type="number" size="11" notnull="notnull" index="idx_revision" />
<column name="module_srl" type="number" size="11" notnull="notnull" index="idx_module_srl" />
<column name="date" type="date" index="idx_date" />
<column name="author" type="varchar" size="255" notnull="notnull" />
<column name="message" type="bigtext" />
</table>

View file

@ -263,3 +263,13 @@ fieldset.history ul li.content { padding:10px; color:#444444;}
.pagination.c2 a.next{ background:url(../images/arrowNextC1.gif) no-repeat center;}
.pagination.c2 a.prev span,
.pagination.c2 a.next span{ position:absolute; width:0; height:0; overflow:hidden; visibility:hidden;}
/* Timeline */
h4 { background: #F7F7F7 none repeat scroll 0 0; border-bottom:1px solid #D7D7D7; font-size:1.05em; }
dt .time { color: #999999; font-size: 0.90em; }
dt em { border-bottom: 1px dotted #BBBBBB; color: #BB0000; font-style:normal; text-decoration: none; }
dt .author { color: #666666; }
dd { color: #777766; font-size: 0.90em; }
dl { line-height: 1.3em; margin: 0; }
dt { padding: 5px 4px 2px 0 }
dd.changeset p { margin: 0; padding: 0; }

View file

@ -0,0 +1,20 @@
<!--#include('header.html')-->
<h2> Timeline </h2>
{@ $curDate = null }
<!--@foreach($changesets as $changeset)-->
<!--@if($curdate || strcmp(zdate($changeset->date, "Ymd"), $curDate))-->
<h4>{zdate($changeset->date, "Y-m-d")}</h4>
<!--@if($curDate)-->
</dl>
<!--@end-->
<dl>
{@ $curDate = zdate($changeset->date, "Ymd") }
<!--@end-->
<dt class="changeset">
<span class="time">{zdate($changeset->date,"H:i")}</span>
Changeset <em>[{$changeset->revision}]</em> by <span class="author">{$changeset->author}</span>
</dt>
<dd class="changeset"> <p>{$changeset->message}</p> </dd>
<!--@end-->
</dl>