* Finish task #7628.

This commit is contained in:
tianshujie98
2020-08-25 08:57:39 +08:00
parent 7f4c8ac9ac
commit d62d93baa7
6 changed files with 51 additions and 10 deletions
+6 -1
View File
@@ -1450,7 +1450,12 @@ class block extends control
public function printProgramteamBlock()
{
$this->loadModel('project');
$num = isset($this->params->num) ? (int)$this->params->num : 15;
/* Get projects. */
$this->view->programs = $this->loadModel('program')->getUserPrograms('all', 'id_desc', $num);
}
/**
@@ -0,0 +1,24 @@
<?php if(empty($programs)): ?>
<div class='empty-tip'><?php echo $lang->block->emptyTip;?></div>
<?php else:?>
<div class='panel-body has-table scrollbar-hover'>
<table>
<thead>
<tr>
<th class='w-200px'></th>
<th><?php echo $lang->program->teamCount;?></th>
<th><?php echo $lang->task->consumed;?></th>
</tr>
</thead>
<tbody>
<?php foreach($programs as $program):?>
<tr>
<td title='<?php echo $program->name?>'><?php echo $program->name;?></td>
<td><?php echo $program->teamCount;?></td>
<td><?php echo $program->consumed;?></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
</div>
<?php endif;?>
+5 -2
View File
@@ -220,7 +220,7 @@ class design extends control
* @access public
* @return void
*/
public function commit($designID, $begin = '', $end = '', $recTotal = 0, $recPerPage = 50, $pageID = 1)
public function commit($designID, $repoID = 0, $begin = '', $end = '', $recTotal = 0, $recPerPage = 50, $pageID = 1)
{
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
@@ -229,8 +229,10 @@ class design extends control
$begin = $begin ? date('Y-m-d', strtotime($begin)) : $program->begin;
$end = $end ? date('Y-m-d', strtotime($end)) : helper::today();
$repoID = $this->session->repoID;
$repos = $this->loadModel('repo')->getRepoPairs();
$repoID = $repoID ? $repoID : key($repos);
$repo = $this->loadModel('repo')->getRepoByID($repoID);
$revisions = $this->repo->getCommits($repo, '', 'HEAD', '', $pager, $begin, $end);
if($_POST)
@@ -250,6 +252,7 @@ class design extends control
$this->view->title = $this->lang->design->commit;
$this->view->position[] = $this->lang->design->commit;
$this->view->repos = $repos;
$this->view->repoID = $repoID;
$this->view->repo = $repo;
$this->view->revisions = $revisions;
+3 -2
View File
@@ -1,7 +1,8 @@
$('#begin, #end').change(function()
$('#begin, #end, #repo').change(function()
{
var begin = $('#begin').val();
var end = $('#end').val();
var repo = $('#repo').val();
if(begin.indexOf('-') != -1)
{
@@ -16,5 +17,5 @@ $('#begin, #end').change(function()
for(i = 0 ; i < endarray.length ; i++) end = end + endarray[i];
}
location.href = createLink('design', 'commit', "designID=" + designID + '&begin=' + begin + '&end=' + end);
location.href = createLink('design', 'commit', "designID=" + designID + '&repoID=' + repo + '&begin=' + begin + '&end=' + end);
})
+12 -4
View File
@@ -20,10 +20,18 @@
</h2>
</div>
<div class='searchBox'>
<h4><?php echo $lang->design->commitDate . ':';?></h4>
<?php echo html::input('begin', $begin, "class='form-control form-date srearch-date'");?>
<span>~</span>
<?php echo html::input('end', $end, "class='form-control form-date srearch-date'");?>
<table class="table">
<tr>
<td class="w-100px"><h4><?php echo $lang->repo->maintain . ': ';?></h4></td>
<td><?php echo html::select('repo', $repos, $repoID, "class='form-control chosen'");?></td>
<td>
<h4><?php echo $lang->design->commitDate . ':';?></h4>
<?php echo html::input('begin', $begin, "class='form-control form-date srearch-date'");?>
<span>~</span>
<?php echo html::input('end', $end, "class='form-control form-date srearch-date'");?>
</td>
</tr>
</table>
</div>
<form id='logForm' class='main-table form-ajax' data-ride='table' action=<?php echo inlink('commit', "designID=$designID");?> method='post'>
<table class='table'>
+1 -1
View File
@@ -19,7 +19,7 @@ $typeInfo = $type == 'file' ? '&type=file' : '';
<?php include '../../common/view/header.html.php';?>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left'>
<?php echo html::a($this->repo->createLink('browse', "repoID=$repoID", $preDir), "<i class='icon icon-back'></i>" . $lang->goback, '', "class='btn btn-link'");?>
<?php echo html::a($this->repo->createLink('browse', "repoID=$repoID", $preDir), "<i class='icon icon-back'></i>" . $lang->goback, '', "class='btn btn-secondary'");?>
<div class="divider"></div>
<div class="page-title">
<?php echo $lang->repo->revisionA . ' ' . ($repo->SCM == 'Git' ? $this->repo->getGitRevisionName($revision, $log->commit) : $revision);?>