2004-12-12 03:51:51 +00:00
|
|
|
<?php
|
|
|
|
|
/*****************************/
|
|
|
|
|
/* functions for maintainers */
|
|
|
|
|
/*****************************/
|
2004-11-09 22:41:18 +00:00
|
|
|
|
2004-12-12 03:51:51 +00:00
|
|
|
/**
|
|
|
|
|
* get the applications and versions that this userId maintains
|
2004-11-09 22:41:18 +00:00
|
|
|
*/
|
|
|
|
|
function getAppsFromUserId($userId)
|
|
|
|
|
{
|
2005-08-25 02:26:18 +00:00
|
|
|
/* retrieve the list of application and order them by application name */
|
2006-06-27 19:16:27 +00:00
|
|
|
$hResult = query_parameters("SELECT appMaintainers.appId, versionId, superMaintainer, appName FROM ".
|
|
|
|
|
"appFamily, appMaintainers WHERE appFamily.appId = appMaintainers.appId ".
|
|
|
|
|
"AND userId = '?' ORDER BY appName", $userId);
|
2006-06-21 01:04:12 +00:00
|
|
|
if(!$hResult || mysql_num_rows($hResult) == 0)
|
2004-11-09 22:41:18 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
$retval = array();
|
|
|
|
|
$c = 0;
|
2006-06-21 01:04:12 +00:00
|
|
|
while($oRow = mysql_fetch_object($hResult))
|
2004-11-09 22:41:18 +00:00
|
|
|
{
|
2006-06-21 01:04:12 +00:00
|
|
|
$retval[$c] = array($oRow->appId, $oRow->versionId, $oRow->superMaintainer);
|
2004-11-09 22:41:18 +00:00
|
|
|
$c++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $retval;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
2005-06-05 18:33:01 +00:00
|
|
|
* get the userIds of maintainers for a versionId
|
2004-11-09 22:41:18 +00:00
|
|
|
*/
|
2005-02-17 01:01:01 +00:00
|
|
|
function getMaintainersUserIdsFromAppIdVersionId($versionId)
|
2004-11-09 22:41:18 +00:00
|
|
|
{
|
2005-08-13 01:45:42 +00:00
|
|
|
$retval = array();
|
|
|
|
|
|
|
|
|
|
/* early out if the versionId isn't valid */
|
|
|
|
|
if($versionId == 0)
|
|
|
|
|
return $retval;
|
|
|
|
|
|
2006-06-21 01:04:12 +00:00
|
|
|
$sQuery = "SELECT userId FROM ".
|
2006-06-27 19:16:27 +00:00
|
|
|
"appMaintainers WHERE versionId = '?';";
|
|
|
|
|
$hResult = query_parameters($sQuery, $versionId);
|
2004-11-09 22:41:18 +00:00
|
|
|
$c = 0;
|
2006-06-21 01:04:12 +00:00
|
|
|
while($oRow = mysql_fetch_object($hResult))
|
2004-11-09 22:41:18 +00:00
|
|
|
{
|
2006-06-21 01:04:12 +00:00
|
|
|
$retval[$c] = $oRow->userId;
|
2004-11-09 22:41:18 +00:00
|
|
|
$c++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $retval;
|
|
|
|
|
}
|
|
|
|
|
|
2004-12-10 00:18:01 +00:00
|
|
|
/*
|
|
|
|
|
* get the userIds of super maintainers for this appId
|
|
|
|
|
*/
|
|
|
|
|
function getSuperMaintainersUserIdsFromAppId($appId)
|
|
|
|
|
{
|
2006-06-21 01:04:12 +00:00
|
|
|
$sQuery = "SELECT userId FROM ".
|
2006-06-27 19:16:27 +00:00
|
|
|
"appMaintainers WHERE appId = '?' " .
|
2004-12-10 00:18:01 +00:00
|
|
|
"AND superMaintainer = '1';";
|
2006-06-27 19:16:27 +00:00
|
|
|
$hResult = query_parameters($sQuery, $appId);
|
2004-12-10 00:18:01 +00:00
|
|
|
$retval = array();
|
|
|
|
|
$c = 0;
|
2006-06-21 01:04:12 +00:00
|
|
|
while($oRow = mysql_fetch_object($hResult))
|
2004-12-10 00:18:01 +00:00
|
|
|
{
|
2006-06-21 01:04:12 +00:00
|
|
|
$retval[$c] = $oRow->userId;
|
2004-12-10 00:18:01 +00:00
|
|
|
$c++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $retval;
|
|
|
|
|
}
|
|
|
|
|
|
2004-12-12 03:51:51 +00:00
|
|
|
?>
|