| action->objectTypes[$action->objectType];?> |
objectID;?> |
- objectName;?> |
+ createLink($module, 'view', "id=$action->objectID"), $action->objectName);?> |
actor];?> |
date;?> |
id", $lang->action->undelete, 'hiddenwin');?>
diff --git a/trunk/module/build/control.php b/trunk/module/build/control.php
index 6509bb4312..54bb185ff6 100644
--- a/trunk/module/build/control.php
+++ b/trunk/module/build/control.php
@@ -28,8 +28,9 @@ class build extends control
{
if(!empty($_POST))
{
- $this->build->create($projectID);
+ $buildID = $this->build->create($projectID);
if(dao::isError()) die(js::error(dao::getError()));
+ $this->loadModel('action')->create('build', $buildID, 'Opened');
die(js::locate($this->createLink('project', 'build', "project=$projectID"), 'parent'));
}
@@ -48,9 +49,11 @@ class build extends control
{
if(!empty($_POST))
{
- $this->build->update($buildID);
+ $changes = $this->build->update($buildID);
if(dao::isError()) die(js::error(dao::getError()));
- die(js::locate($this->createLink('project', 'build', "projectID={$this->post->project}"), 'parent'));
+ $actionID = $this->loadModel('action')->create('build', $buildID, 'edited');
+ $this->action->logHistory($actionID, $changes);
+ die(js::locate(inlink('view', "buildID=$buildID"), 'parent'));
}
/* 设置菜单。*/
@@ -79,6 +82,7 @@ class build extends control
$this->view->products = $this->project->getProducts($build->project);
$this->view->users = $this->loadModel('user')->getPairs();
$this->view->build = $build;
+ $this->view->actions = $this->loadModel('action')->getList('build', $buildID);
$this->display();
}
@@ -92,7 +96,7 @@ class build extends control
else
{
$build = $this->build->getById($buildID);
- $this->build->delete($buildID);
+ $this->build->delete(TABLE_BUILD, $buildID);
die(js::locate($this->createLink('project', 'build', "projectID=$build->project"), 'parent'));
}
}
@@ -110,5 +114,4 @@ class build extends control
if($varName == 'openedBuild') die(html::select($varName . '[]', $this->build->getProjectBuildPairs($projectID, 'noempty'), $build, 'size=4 class=select-3 multiple'));
if($varName == 'resolvedBuild') die(html::select($varName, $this->build->getProjectBuildPairs($projectID, 'noempty'), $build, 'class=select-3'));
}
-
}
diff --git a/trunk/module/build/model.php b/trunk/module/build/model.php
index 364603e650..ea8d9cd7f0 100644
--- a/trunk/module/build/model.php
+++ b/trunk/module/build/model.php
@@ -45,6 +45,7 @@ class buildModel extends model
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t1.product = t3.id')
->where('t1.project')->eq((int)$projectID)
+ ->andWhere('t1.deleted')->eq(0)
->orderBy('t1.id DESC')
->fetchAll();
}
@@ -56,9 +57,15 @@ class buildModel extends model
if(strpos($params, 'noempty') === false) $sysBuilds = array('' => '');
if(strpos($params, 'notrunk') === false) $sysBuilds = $sysBuilds + array('trunk' => 'Trunk');
- $builds = $this->dao->select('id,name')->from(TABLE_BUILD)->where('project')->eq((int)$projectID)->orderBy('id desc')->fetchPairs();
+ $builds = $this->dao->select('id,name')->from(TABLE_BUILD)
+ ->where('project')->eq((int)$projectID)
+ ->andWhere('deleted')->eq(0)
+ ->orderBy('id desc')->fetchPairs();
if(!$builds) return $sysBuilds;
- $releases = $this->dao->select('build,name')->from(TABLE_RELEASE)->where('build')->in(array_keys($builds))->fetchPairs();
+ $releases = $this->dao->select('build,name')->from(TABLE_RELEASE)
+ ->where('build')->in(array_keys($builds))
+ ->andWhere('deleted')->eq(0)
+ ->fetchPairs();
foreach($releases as $buildID => $releaseName) $builds[$buildID] = $releaseName;
return $sysBuilds + $builds;
}
@@ -70,9 +77,15 @@ class buildModel extends model
if(strpos($params, 'noempty') === false) $sysBuilds = array('' => '');
if(strpos($params, 'notrunk') === false) $sysBuilds = $sysBuilds + array('trunk' => 'Trunk');
- $builds = $this->dao->select('id,name')->from(TABLE_BUILD)->where('product')->eq((int)$productID)->orderBy('id desc')->fetchPairs();
+ $builds = $this->dao->select('id,name')->from(TABLE_BUILD)
+ ->where('product')->eq((int)$productID)
+ ->andWhere('deleted')->eq(0)
+ ->orderBy('id desc')->fetchPairs();
if(!$builds) return $sysBuilds;
- $releases = $this->dao->select('build,name')->from(TABLE_RELEASE)->where('build')->in(array_keys($builds))->fetchPairs();
+ $releases = $this->dao->select('build,name')->from(TABLE_RELEASE)
+ ->where('build')->in(array_keys($builds))
+ ->andWhere('deleted')->eq(0)
+ ->fetchPairs();
foreach($releases as $buildID => $releaseName) $builds[$buildID] = $releaseName;
return $sysBuilds + $builds;
}
@@ -92,16 +105,12 @@ class buildModel extends model
/* 编辑。*/
public function update($buildID)
{
+ $oldBuild = $this->getByID($buildID);
$build = fixer::input('post')
->stripTags('name')
->specialChars('desc')
->get();
$this->dao->update(TABLE_BUILD)->data($build)->autoCheck()->batchCheck($this->config->build->edit->requiredFields, 'notempty')->where('id')->eq((int)$buildID)->exec();
- }
-
- /* 删除build。*/
- public function delete($buildID)
- {
- return $this->dao->update(TABLE_BUILD)->set('deleted')->eq(1)->where('id')->eq((int)$buildID)->exec();
+ if(!dao::isError()) return common::createChanges($oldBuild, $build);
}
}
diff --git a/trunk/module/build/view/view.html.php b/trunk/module/build/view/view.html.php
index f29bd95441..3001288be6 100644
--- a/trunk/module/build/view/view.html.php
+++ b/trunk/module/build/view/view.html.php
@@ -24,47 +24,46 @@
?>
-
+
+ build->view;?>
+
+ | build->product;?> |
+ productName;?> |
+
+
+ | build->name;?> |
+ name;?> |
+
+
+ | build->builder;?> |
+ builder];?> |
+
+
+ | build->date;?> |
+ date;?> |
+
+
+ | build->scmPath;?> |
+ scmPath, 'http') === 0 ? printf(html::a($build->scmPath)) : printf($build->scmPath);?> |
+
+
+ | build->filePath;?> |
+ filePath, 'http') === 0 ? printf(html::a($build->filePath)) : printf($build->filePath);?> |
+
+
+
+ | build->desc;?> |
+ desc);?> |
+
+
+
+ session->buildList ? $this->session->buildList : $this->createLink('project', 'build', "projectID=$build->project");
+ common::printLink('build', 'edit', "buildID=$build->id", $lang->edit);
+ common::printLink('build', 'delete', "buildID=$build->id", $lang->delete, 'hiddenwin');
+ echo html::a($browseLink, $lang->goback);
+ ?>
+
+
diff --git a/trunk/module/project/control.php b/trunk/module/project/control.php
index da735ff0d6..2fe34084d8 100644
--- a/trunk/module/project/control.php
+++ b/trunk/module/project/control.php
@@ -257,6 +257,8 @@ class project extends control
/* 浏览某一个项目下面的build。*/
public function build($projectID = 0)
{
+ $this->session->set('buildList', $this->app->getURI(true));
+
/* 公共的操作。*/
$project = $this->commonAction($projectID);
diff --git a/trunk/module/project/view/build.html.php b/trunk/module/project/view/build.html.php
index 6c2b91f457..83da3a923e 100644
--- a/trunk/module/project/view/build.html.php
+++ b/trunk/module/project/view/build.html.php
@@ -30,13 +30,13 @@
-
+
| build->product;?> |
- build->name;?> |
- build->scmPath;?> |
- build->filePath;?> |
+ build->name;?> |
+ build->scmPath;?> |
+ build->filePath;?> |
build->date;?> |
build->builder;?> |
actions;?> |
@@ -46,7 +46,7 @@
| productName;?> |
- createLink('build', 'view', "build=$build->id"), $build->name);?> |
+ createLink('build', 'view', "build=$build->id"), $build->name);?> |
scmPath, 'http') === 0 ? printf(html::a($build->scmPath)) : printf($build->scmPath);?> |
filePath, 'http') === 0 ? printf(html::a($build->filePath)) : printf($build->filePath);?> |
date?> |
|