Move getAppsFromUserId() to user::getAppsMaintained(). Also implement a unit test for
user::getAppsMaintained()
This commit is contained in:
@@ -3,29 +3,6 @@
|
||||
/* functions for maintainers */
|
||||
/*****************************/
|
||||
|
||||
/**
|
||||
* get the applications and versions that this userId maintains
|
||||
*/
|
||||
function getAppsFromUserId($userId)
|
||||
{
|
||||
/* retrieve the list of application and order them by application name */
|
||||
$hResult = query_parameters("SELECT appMaintainers.appId, versionId, superMaintainer, appName FROM ".
|
||||
"appFamily, appMaintainers WHERE appFamily.appId = appMaintainers.appId ".
|
||||
"AND userId = '?' ORDER BY appName", $userId);
|
||||
if(!$hResult || mysql_num_rows($hResult) == 0)
|
||||
return;
|
||||
|
||||
$retval = array();
|
||||
$c = 0;
|
||||
while($oRow = mysql_fetch_object($hResult))
|
||||
{
|
||||
$retval[$c] = array($oRow->appId, $oRow->versionId, $oRow->superMaintainer);
|
||||
$c++;
|
||||
}
|
||||
|
||||
return $retval;
|
||||
}
|
||||
|
||||
/*
|
||||
* get the userIds of maintainers for a versionId
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user