* finish task #6871.

This commit is contained in:
wangyidong
2020-02-14 10:45:35 +08:00
parent bf705c1f1c
commit d8d4cbf890
4 changed files with 38 additions and 46 deletions
+4 -2
View File
@@ -86,6 +86,7 @@ class repo extends control
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $link));
}
$this->repo->setMenu($this->repos, '', false);
$this->app->loadLang('action');
$this->view->groups = $this->loadModel('group')->getPairs();
@@ -120,6 +121,7 @@ class repo extends control
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('maintain')));
}
$this->repo->setMenu($this->repos, $repo->id, false);
$this->app->loadLang('action');
$repo->repoType = $repo->id . '-' . $repo->SCM;
@@ -155,8 +157,8 @@ class repo extends control
$this->dao->delete()->from(TABLE_REPOFILES)->where('repo')->eq($repoID)->exec();
$this->dao->delete()->from(TABLE_REPOBRANCH)->where('repo')->eq($repoID)->exec();
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
$this->send(array('result' => 'success'));
if(dao::isError()) die(js::error(dao::getError()));
die(js::reload('parent'));
}
/**
-1
View File
@@ -7,7 +7,6 @@ $lang->repo->createAction = 'Create Repo';
$lang->repo->edit = 'Edit';
$lang->repo->editAction = 'Edit Repo';
$lang->repo->delete = 'Delete Repo';
$lang->repo->confirmDelete = 'Do you want to delete this repo?';
$lang->repo->showSyncComment = 'Display Synchronization';
$lang->repo->ajaxSyncComment = 'Interface: Ajax Sync Note';
$lang->repo->download = 'Download File';
-1
View File
@@ -7,7 +7,6 @@ $lang->repo->createAction = '创建版本库';
$lang->repo->edit = '编辑';
$lang->repo->editAction = '编辑版本库';
$lang->repo->delete = '删除版本库';
$lang->repo->confirmDelete = '确认删除该版本库吗?';
$lang->repo->showSyncComment = '显示同步进度';
$lang->repo->ajaxSyncComment = '接口:AJAX同步注释';
$lang->repo->download = '下载';
+34 -42
View File
@@ -11,47 +11,39 @@
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php js::set('confirmDelete', $lang->repo->confirmDelete); ?>
<div id='mainContent' class='main-row'>
<div class='main-col main-content'>
<form class='main-table' id='ajaxForm' method='post'>
<table id='repoList' class='table has-sort-head table-fixed'>
<thead>
<tr>
<?php $vars = "orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}"; ?>
<th class='w-60px'><?php common::printOrderLink('id', $orderBy, $vars, $lang->repo->id); ?></th>
<th class='w-120px'><?php common::printOrderLink('SCM', $orderBy, $vars, $lang->repo->type); ?></th>
<th class='w-200px text-left'><?php common::printOrderLink('name', $orderBy, $vars, $lang->repo->name); ?></th>
<th class='text-left'><?php echo $lang->repo->path; ?></th>
<th class='w-100px c-actions-4'><?php echo $lang->actions; ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($repoList as $id => $repo): ?>
<tr>
<td class='text-center'><?php echo $id; ?></td>
<td class='text'><?php echo zget($lang->repo->scmList, $repo->SCM); ?></td>
<td class='text' title='<?php echo $repo->name; ?>'><?php echo $repo->name; ?></td>
<td class='text' title='<?php echo $repo->path; ?>'><?php echo $repo->path; ?></td>
<td class='text-center c-actions'>
<?php
common::printIcon('repo', 'edit', "repoID=$id", '', 'list', 'edit');
if (common::hasPriv('repo', 'delete'))
{
$deleteURL = $this->createLink('repo', 'delete', "repoID=$id&confirm=yes");
echo html::a("javascript:ajaxDelete(\"$deleteURL\", \"repoList\", confirmDelete)", '<i class="icon-trash"></i>', '', "title='{$lang->repo->delete}' class='btn'");
}
?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php if ($repoList): ?>
<div class='table-footer'><?php $pager->show('rignt', 'pagerjs'); ?></div>
<?php endif; ?>
</form>
</div>
<div id='mainContent'>
<form class='main-table' id='ajaxForm' method='post'>
<table id='repoList' class='table has-sort-head table-fixed'>
<thead>
<tr>
<?php $vars = "orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}"; ?>
<th class='w-60px'><?php common::printOrderLink('id', $orderBy, $vars, $lang->repo->id); ?></th>
<th class='w-120px'><?php common::printOrderLink('SCM', $orderBy, $vars, $lang->repo->type); ?></th>
<th class='w-200px text-left'><?php common::printOrderLink('name', $orderBy, $vars, $lang->repo->name); ?></th>
<th class='text-left'><?php echo $lang->repo->path; ?></th>
<th class='w-100px c-actions-4'><?php echo $lang->actions; ?></th>
</tr>
</thead>
<tbody>
<?php foreach($repoList as $id => $repo):?>
<tr>
<td class='text-center'><?php echo $id; ?></td>
<td class='text'><?php echo zget($lang->repo->scmList, $repo->SCM); ?></td>
<td class='text' title='<?php echo $repo->name; ?>'><?php echo $repo->name; ?></td>
<td class='text' title='<?php echo $repo->path; ?>'><?php echo $repo->path; ?></td>
<td class='text-left c-actions'>
<?php
common::printIcon('repo', 'edit', "repoID=$id", '', 'list', 'edit');
if(common::hasPriv('repo', 'delete')) echo html::a($this->createLink('repo', 'delete', "repoID=$id"), '<i class="icon-trash"></i>', 'hiddenwin', "title='{$lang->repo->delete}' class='btn'");
?>
</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<?php if($repoList):?>
<div class='table-footer'><?php $pager->show('rignt', 'pagerjs');?></div>
<?php endif;?>
</form>
</div>
<?php include '../../common/view/footer.html.php'; ?>