Sort maintainers in adminMaintainers.php by their name. Add header for each maintainer that has a summary of the number of applications and versions they maintain
This commit is contained in:
@@ -38,7 +38,8 @@ if ($_REQUEST['sub'])
|
|||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
// get available maintainers
|
// get available maintainers
|
||||||
$sQuery = "SELECT * FROM appMaintainers;";
|
$sQuery = "SELECT * FROM appMaintainers, user_list where appMaintainers.userId = user_list.userid";
|
||||||
|
$sQuery.= " ORDER BY realname;";
|
||||||
$hResult = query_appdb($sQuery);
|
$hResult = query_appdb($sQuery);
|
||||||
|
|
||||||
if(!$hResult || !mysql_num_rows($hResult))
|
if(!$hResult || !mysql_num_rows($hResult))
|
||||||
@@ -63,10 +64,44 @@ if ($_REQUEST['sub'])
|
|||||||
echo "</tr>\n\n";
|
echo "</tr>\n\n";
|
||||||
|
|
||||||
$c = 1;
|
$c = 1;
|
||||||
|
$oldUserId = 0;
|
||||||
while($ob = mysql_fetch_object($hResult))
|
while($ob = mysql_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$oUser = new User($ob->userId);
|
$oUser = new User($ob->userId);
|
||||||
if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; }
|
if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; }
|
||||||
|
|
||||||
|
/* if this is a new user we should print a header that has the aggregate of the applications */
|
||||||
|
/* the user super maintains and versions they maintain */
|
||||||
|
if($ob->userId != $oldUserId)
|
||||||
|
{
|
||||||
|
$style = "border-top:thin solid;border-bottom:thin solid";
|
||||||
|
|
||||||
|
echo "<tr class=color4>\n";
|
||||||
|
echo " <td style=\"$style;border-left:thin solid\">Maintainer summary</td>\n";
|
||||||
|
echo " <td style=\"$style\"><a href=\"mailto:".$oUser->sEmail."\">".$oUser->sRealname."</a></td>\n";
|
||||||
|
$count = $oUser->getMaintainerCount(true);
|
||||||
|
if($count == 0)
|
||||||
|
echo " <td style=\"$style\"></td>\n";
|
||||||
|
else if($count <= 1)
|
||||||
|
echo " <td style=\"$style\">".$count." app</td>\n";
|
||||||
|
else
|
||||||
|
echo " <td style=\"$style\">".$count." apps</td>\n";
|
||||||
|
|
||||||
|
|
||||||
|
$count = $oUser->getMaintainerCount(false);
|
||||||
|
if($count == 0)
|
||||||
|
echo " <td style=\"$style\"></td>\n";
|
||||||
|
else if($count <= 1)
|
||||||
|
echo " <td style=\"$style\">".$count." version</td>\n";
|
||||||
|
else
|
||||||
|
echo " <td style=\"$style\">".$count." versions</td>\n";
|
||||||
|
|
||||||
|
echo " <td align=\"center\" style=\"$style;border-right:thin solid\"> </td>\n";
|
||||||
|
echo "</tr>\n\n";
|
||||||
|
|
||||||
|
$oldUserId = $ob->userId;
|
||||||
|
}
|
||||||
|
|
||||||
echo "<tr class=$bgcolor>\n";
|
echo "<tr class=$bgcolor>\n";
|
||||||
echo " <td>".print_date(mysqldatetime_to_unixtimestamp($ob->submitTime))." </td>\n";
|
echo " <td>".print_date(mysqldatetime_to_unixtimestamp($ob->submitTime))." </td>\n";
|
||||||
echo " <td><a href=\"mailto:".$oUser->sEmail."\">".$oUser->sRealname."</a></td>\n";
|
echo " <td><a href=\"mailto:".$oUser->sEmail."\">".$oUser->sRealname."</a></td>\n";
|
||||||
|
|||||||
@@ -247,6 +247,19 @@ class User {
|
|||||||
return mysql_num_rows($hResult);
|
return mysql_num_rows($hResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getMaintainerCount($bSuperMaintainer)
|
||||||
|
{
|
||||||
|
if(!$this->isLoggedIn()) return 0;
|
||||||
|
|
||||||
|
$sQuery = "SELECT count(*) as cnt from appMaintainers WHERE userid = '$this->iUserId' AND superMaintainer = '$bSuperMaintainer'";
|
||||||
|
$hResult = query_appdb($sQuery);
|
||||||
|
if(!$hResult)
|
||||||
|
return 0;
|
||||||
|
$ob = mysql_fetch_object($hResult);
|
||||||
|
return $ob->cnt;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add the user as a maintainer
|
* Add the user as a maintainer
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user