diff --git a/admin/adminMaintainerQueue.php b/admin/adminMaintainerQueue.php index 92c9f70..8403ef8 100644 --- a/admin/adminMaintainerQueue.php +++ b/admin/adminMaintainerQueue.php @@ -8,6 +8,7 @@ require(BASE."include/incl.php"); require(BASE."include/tableve.php"); require(BASE."include/category.php"); require(BASE."include/maintainer.php"); +require(BASE."include/application.php"); require(BASE."include/mail.php"); if(!$_SESSION['current']->hasPriv("admin")) @@ -111,37 +112,42 @@ if ($_REQUEST['sub']) { while(list($index, list($appIdOther, $versionIdOther, $superMaintainerOther)) = each($other_apps)) { + $oApp = new Application($appIdOther); + $oVersion = new Application($versionIdOther); if($firstDisplay) { $firstDisplay = false; if($superMaintainerOther) - echo "".lookup_app_name($appIdOther)."*\n"; + echo "".$oApp->sName."*\n"; else - echo "".lookup_app_name($appIdOther).lookup_version_name($versionIdOther)."\n"; + echo "".$oApp->sName." ".$oVersion->sName."\n"; } else { if($superMaintainerOther) - echo "".lookup_app_name($appIdOther)."*\n"; + echo "".$oApp->sName."*\n"; else - echo "".lookup_app_name($appIdOther).lookup_version_name($versionIdOther)."\n"; + echo "".$oApp->sName." ".$oVersion->sName."\n"; } } } else { echo "User maintains no other applications\n"; } - + + $oApp = new Application($ob->appId); + $oVersion = new Application($ob->versionId); + //app name echo 'App Name',"\n"; - echo "".lookup_app_name($ob->appId)."\n"; + echo "".$oApp->sName."\n"; //version echo 'App Version',"\n"; - echo "".lookup_version_name($ob->versionId)."\n"; + echo "".$oVersion->sName."\n"; //maintainReason echo 'Maintainer request reason',"\n"; - echo '',"\n"; + echo '',"\n"; //email response echo 'Email reply',"\n"; @@ -182,13 +188,14 @@ if ($_REQUEST['sub']) //delete the item from the queue query_appdb("DELETE from appMaintainerQueue where queueId = ".$_REQUEST['queueId'].";"); - + $oApp = new Application($ob->appId); + $oVersion = new Version($ob->versionId); //Send Status Email $sEmail = $oUser->sEmail; if ($sEmail) { $sSubject = "Application Maintainer Request Report"; - $sMsg = "Your application to be the maintainer of ".lookup_app_name($ob->appId).lookup_version_name($ob->versionId)." has been accepted. "; + $sMsg = "Your application to be the maintainer of ".$oApp->sName." ".$oVersion->sName." has been accepted. "; $sMsg .= $_REQUEST['replyText']; $sMsg .= "We appreciate your help in making the Application Database better for all users.\n\n"; @@ -204,8 +211,10 @@ if ($_REQUEST['sub']) $sEmail = $oUser->sEmail; if ($sEmail) { + $oApp = new Application($ob->appId); + $oVersion = new Application($ob->versionId); $sSubject = "Application Maintainer Request Report"; - $sMsg = "Your application to be the maintainer of ".lookup_app_name($ob->appId).lookup_version_name($ob->versionId)." was rejected. "; + $sMsg = "Your application to be the maintainer of ".$oApp->sName." ".$oVersion->sName." was rejected. "; $sMsg .= $_REQUEST['replyText']; $sMsg .= ""; $sMsg .= "-The AppDB admins\n"; @@ -279,12 +288,14 @@ if ($_REQUEST['sub']) while($ob = mysql_fetch_object($result)) { $oUser = new User($ob->userId); + $oApp = new Application($ob->appId); + $oVersion = new Version($ob->versionId); if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; } echo "\n"; echo " ".date("Y-n-t h:i:sa", $ob->submitTime)."  \n"; echo " $ob->queueId\n"; echo " ".$oUser->sRealName."\n"; - echo " ".lookup_app_name($ob->appId)."\n"; + echo " ".$oApp->sName."\n"; if($ob->superMaintainer) { @@ -292,7 +303,7 @@ if ($_REQUEST['sub']) echo "Yes\n"; } else { - echo "".lookup_version_name($ob->versionId)."  \n"; + echo "".$oVersion->sName."  \n"; echo "No\n"; } diff --git a/include/screenshot.php b/include/screenshot.php index c38a200..3ef2710 100644 --- a/include/screenshot.php +++ b/include/screenshot.php @@ -369,7 +369,7 @@ function get_screenshots($iAppId = null, $iVersionId = null) FROM appData, appVersion WHERE appVersion.versionId = appData.versionId AND type = 'image' - AND appId = ".$iAppId; + AND appData.appId = ".$iAppId; } /* * We want all screenshots for this version. diff --git a/maintainerdelete.php b/maintainerdelete.php index 1f6a49b..fab986b 100644 --- a/maintainerdelete.php +++ b/maintainerdelete.php @@ -7,9 +7,10 @@ * application environment */ include("path.php"); -require(BASE."include/"."incl.php"); -require(BASE."include/"."tableve.php"); -require(BASE."include/"."category.php"); +require(BASE."include/incl.php"); +require(BASE."include/tableve.php"); +require(BASE."include/category.php"); +require(BASE."include/application.php"); if(!$_SESSION['current']->isLoggedIn()) { @@ -24,33 +25,34 @@ $superMaintainer = strip_tags($_POST['superMaintainer']); if($confirmed) { - +$oApp = new Application($appId); if($superMaintainer) { - apidb_header("You have resigned as supermaintainer of ".lookup_app_name($appId)); - $query = "DELETE FROM appMaintainers WHERE userId = ".$_SESSION['current']->userid. - " AND appId = ".$appId." AND superMaintainer = ".$superMaintainer.";"; + apidb_header("You have resigned as supermaintainer of ".$oApp->sName); + $query = "DELETE FROM appMaintainers WHERE userId = ".$_SESSION['current']->iUserId. + " AND appId = ".$oApp->iAppId." AND superMaintainer = ".$superMaintainer.";"; } else { - apidb_header("You have resigned as maintainer of ".lookup_app_name($appId)); - $query = "DELETE FROM appMaintainers WHERE userId = ".$_SESSION['current']->userid. - " AND appId = ".$appId." AND versionId = ".$versionId." AND superMaintainer = ".$superMaintainer.";"; + $oVersion = new Version($versionId); + apidb_header("You have resigned as maintainer of ".$oApp->sName." ".$oVersion->sName); + $query = "DELETE FROM appMaintainers WHERE userId = ".$_SESSION['current']->iUserId. + " AND appId = ".$oApp->iAppId." AND versionId = ".$oVersion->iVersionId." AND superMaintainer = ".$superMaintainer.";"; } /* echo html_frame_start("Removing",400,"",0); */ if($result = query_appdb($query)) { if($superMaintainer) - echo "You were removed as a supermaintainer of ".lookup_app_name($appId); + echo "You were removed as a supermaintainer of ".$oApp->sName; else - echo "You were removed as a maintainer of ".lookup_app_name($appId).lookup_version_name($versionId); + echo "You were removed as a maintainer of ".$oApp->sName." ".$oVersion->sName; } } else { if($superMaintainer) - apidb_header("Confirm supermaintainer resignation of ".lookup_app_name($appId)); + apidb_header("Confirm supermaintainer resignation of ".$oApp->sName); else - apidb_header("Confirm maintainer resignation of ".lookup_app_name($appId).lookup_version_name ($versionId)); + apidb_header("Confirm maintainer resignation of ".$oApp->sName." ".$oVersion->sName); echo '
',"\n"; diff --git a/maintainersubmit.php b/maintainersubmit.php index 5a7270b..8e662f8 100644 --- a/maintainersubmit.php +++ b/maintainersubmit.php @@ -10,6 +10,7 @@ include("path.php"); require(BASE."include/incl.php"); require(BASE."include/tableve.php"); require(BASE."include/category.php"); +require(BASE."include/application.php"); /** * Check the input of a submitted form. And output with a list @@ -93,9 +94,16 @@ if($_REQUEST['maintainReason']) { // header if($versionId) - apidb_header("Request to become an application maintainer of ".lookup_app_name($appId)." ".lookup_version_name($versionId)); + { + $oVersion = new Version($versionId); + $oApp = new Application($oVersion->iAppId); + apidb_header("Request to become an application maintainer of ".$oApp->sName." ".$oVersion->sName); + } else - apidb_header("Request to become an application super maintainer of ".lookup_app_name($appId)); + { + $oApp = new Application($appId); + apidb_header("Request to become an application super maintainer of ".$oApp->sName); + } // show add to queue form @@ -138,12 +146,12 @@ if($_REQUEST['maintainReason']) echo "\n"; echo "',"\n"; if($versionId) { echo "',"\n"; } echo "";
"; - echo 'Application'.lookup_app_name($appId); + echo 'Application'.$oApp->sName; echo '
"; - echo 'Version'.lookup_version_name($versionId); + echo 'Version'.$oVersion->sName; echo '