Skip to content
Snippets Groups Projects
Commit 29ca6413 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

Merge branch 'fix-project-group-sortorder' into 'master'

sorted project group list in overview

See merge request !25
parents 55a70be0 716601cf
No related branches found
No related tags found
1 merge request!25sorted project group list in overview
Pipeline #793 passed
...@@ -56,6 +56,7 @@ class projectlist extends base{ ...@@ -56,6 +56,7 @@ class projectlist extends base{
$sTrClass = "trproject"; $sTrClass = "trproject";
$sColClass = "tdphase"; $sColClass = "tdphase";
$sNone='none';
$oPrj1 = new project(); $oPrj1 = new project();
$oHtml=new htmlguielements(); $oHtml=new htmlguielements();
...@@ -96,6 +97,7 @@ class projectlist extends base{ ...@@ -96,6 +97,7 @@ class projectlist extends base{
} }
$aProgress=$oPrj->getProgress(); $aProgress=$oPrj->getProgress();
$sPrjGroup=$oPrj->getProjectGroup(); $sPrjGroup=$oPrj->getProjectGroup();
$sPrjGroup=$sPrjGroup?$sPrjGroup:$sNone;
$sClasses=$sPrj . ' ' . $sTrClass $sClasses=$sPrj . ' ' . $sTrClass
. ' trprogress' . ' trprogress'
...@@ -116,14 +118,20 @@ class projectlist extends base{ ...@@ -116,14 +118,20 @@ class projectlist extends base{
if($sPrjGroup){ if($sPrjGroup){
if(!isset($aPrjGroups[$sPrjGroup])){ $sPrjLabel=$oPrj->getProjectGroupLabel();
$aPrjGroups[$sPrjGroup]=0; $sPrjLabel=$sPrjLabel ? $sPrjLabel : $sNone;
$sPrjGroupFilter.='<option value="' . $sPrjGroup . '">' . $oPrj->getProjectGroupLabel() . '</option>'; if(!isset($aPrjGroups[$sPrjLabel])){
$aPrjGroups[$sPrjLabel]=[
'id'=>$sPrjGroup,
'count'=>1
];
// $sPrjGroupFilter.='<option value="' . $sPrjGroup . '">' . $oPrj->getProjectGroupLabel() . '</option>';
} else { } else {
$aPrjGroups[$sPrjGroup]++; $aPrjGroups[$sPrjLabel]['count']++;
} }
} }
$sOut2 .= '<div class="' . $sClasses . ' prjbox"><div class="title">' $sOut2 .= '<div class="' . $sClasses . ' prjbox"><div class="title">'
.$oHtml->getLink(array( .$oHtml->getLink(array(
'href'=>'#', 'href'=>'#',
...@@ -192,6 +200,20 @@ class projectlist extends base{ ...@@ -192,6 +200,20 @@ class projectlist extends base{
$sRowHead1 = ''; $sRowHead1 = '';
$sRowHead2 = ''; $sRowHead2 = '';
$aGrouplist=array_keys($aPrjGroups);
sort($aGrouplist);
$iNone=isset($aPrjGroups[$sNone]['count']) && $aPrjGroups[$sNone]['count'] ? $aPrjGroups[$sNone]['count'] : 0;
$sPrjGroupFilter.= ($iNone ? '<option value="none">'.t("none").' ('.$iNone.')</option>' : '')
. '<option value="">-----</option>'
;
foreach ($aGrouplist as $sLabel){
$sId=$aPrjGroups[$sLabel]['id'];
$iCount=$aPrjGroups[$sLabel]['count'];
$sPrjGroupFilter.=($sLabel!=$sNone) ? '<option value="' . $sId . '">' . $sLabel . ' ('.$iCount.')</option>' : '';
}
foreach (array_keys($oPrj1->getPhases()) as $sPhase) { foreach (array_keys($oPrj1->getPhases()) as $sPhase) {
// Anzahl colspan ist hartcodiert :-/ // Anzahl colspan ist hartcodiert :-/
$sRowHead1.='<th class="' . $sPhase . ' ' . $sColClass . '" colspan="3">' . $oHtml->getIcon('phase').$sPhase . '</th>'; $sRowHead1.='<th class="' . $sPhase . ' ' . $sColClass . '" colspan="3">' . $oHtml->getIcon('phase').$sPhase . '</th>';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment