Issue 147: Add repository type to forge management project list

master
Nathan Adams 2016-03-26 17:08:31 -05:00
parent 99137ee233
commit 31735c4048
3 changed files with 17 additions and 9 deletions

View File

@ -140,11 +140,13 @@ class IDF_Project extends Pluf_Model
$thisTable = $this->_con->pfx.'idf_projects'; $thisTable = $this->_con->pfx.'idf_projects';
$this->_a['views'] = array( $this->_a['views'] = array(
'repo_size' => [ 'repo_size' => [
'join' => "INNER JOIN $confTable ON $thisTable.id = $confTable.project", 'join' => "INNER JOIN $confTable s ON $thisTable.id = s.project " .
'select' => $this->getSelect() . ', CAST(vdesc as UNSIGNED) as vdesc', "INNER JOIN $confTable t ON $thisTable.id = t.project ",
'where' => 'vkey = "repository_size"', 'select' => $this->getSelect() . ', CAST(s.vdesc as UNSIGNED) as size, t.vdesc as scm',
'where' => 's.vkey = "repository_size" AND t.vkey = "scm"',
'props' => array( 'props' => array(
'vdesc' => 'vdesc', 'size' => 'size',
'scm' => 'scm'
), ),
], ],
'join_activities_and_tags' => 'join_activities_and_tags' =>

View File

@ -85,12 +85,13 @@ class IDF_Views_Admin
$list_display = array( $list_display = array(
'shortname' => __('Short Name'), 'shortname' => __('Short Name'),
'name' => __('Name'), 'name' => __('Name'),
'vdesc' => ["vdesc", "IDF_Views_Admin_projectSize2", __('Repository Size')], 'scm' => ["scm", "IDF_Views_Admin_projectSCM", __('Type')],
'size' => ["size", "IDF_Views_Admin_projectSize2", __('Repository Size')]
); );
$pag->configure($list_display, array('shortname', 'shortname'), $pag->configure($list_display, array('shortname', 'shortname'),
array('shortname', 'name', 'vdesc' )); array('shortname', 'name', 'scm', 'size' ));
$pag->extra_classes = array('', '', 'right'); $pag->extra_classes = array('', '', '', 'right');
$pag->items_per_page = 25; $pag->items_per_page = 25;
$pag->no_results_text = __('No projects were found.'); $pag->no_results_text = __('No projects were found.');
$pag->setFromRequest($request); $pag->setFromRequest($request);
@ -663,7 +664,12 @@ function IDF_Views_Admin_projectSize($field, $project)
function IDF_Views_Admin_projectSize2($field, $project) function IDF_Views_Admin_projectSize2($field, $project)
{ {
return Pluf_Utils::prettySize($project->vdesc); return Pluf_Utils::prettySize($project->size);
}
function IDF_Views_Admin_projectSCM($field, $project)
{
return $project->getConf()->getVal("scm");
} }
/** /**

View File

@ -289,7 +289,7 @@ class Pluf_Paginator
} }
} }
} }
//print_r($this->list_display);
if (is_array($search_fields)) { if (is_array($search_fields)) {
$this->search_fields = $search_fields; $this->search_fields = $search_fields;
} }