diff --git a/admin/addAppNote.php b/admin/addAppNote.php index 28357c1..8d3cdc2 100644 --- a/admin/addAppNote.php +++ b/admin/addAppNote.php @@ -24,7 +24,8 @@ if(!$_SESSION['current']->hasPriv("admin") && //set link for version if(is_numeric($aClean['iVersionId']) and !empty($aClean['iVersionId'])) { - $sVersionLink = "iVersionId={$aClean['iVersionId']}"; + $oVersion = new version($aClean['iVersionId']); + $sVersionLink = $oVersion->objectMakeUrl(); } else exit; @@ -35,7 +36,7 @@ $oNote->GetOutputEditorValues($aClean); if($aClean['sSub'] == "Submit") { $oNote->create(); - util_redirect_and_exit(apidb_fullurl("appview.php?".$sVersionLink)); + util_redirect_and_exit($sVersionLink); } else if($aClean['sSub'] == 'Preview' OR empty($aClean['sSubmit'])) { @@ -54,7 +55,7 @@ else if($aClean['sSub'] == 'Preview' OR empty($aClean['sSubmit'])) echo '',"\n"; echo ''; - echo html_back_link(1,BASE."appview.php?".$sVersionLink); + echo html_back_link(1,$sVersionLink); apidb_footer(); } ?> diff --git a/admin/adminBugs.php b/admin/adminBugs.php index 3aae1ec..9bb9764 100644 --- a/admin/adminBugs.php +++ b/admin/adminBugs.php @@ -122,6 +122,8 @@ if ($aClean['sSub']) { while($oRow = mysql_fetch_object($hResult)) { + $oApp = new application($oRow->appId); + $oVersion = new version($oRow->versionId); // set row color $bgcolor = ($c % 2 == 0) ? "color0" : "color1"; echo '',"\n"; @@ -131,11 +133,11 @@ if ($aClean['sSub']) echo ' '.$oRow->bug_status.'',"\n"; echo ' '.$oRow->short_desc.'',"\n"; echo ' ',"\n"; - echo ' '.$oRow->appName.'',"\n"; + echo $oApp->objectMakeLink()."\n"; echo ' ',"\n"; echo ' '.$oRow->appDescription.'',"\n"; echo ' ',"\n"; - echo ' '.$oRow->versionName.'',"\n"; + echo $oVersion->objectMakeLink()."\n"; echo ' ',"\n"; echo ' [userId); + $oApp = new application($oRow->appId); 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 */ @@ -105,14 +106,14 @@ if ($aClean['sSub']) echo "\n"; echo " ".print_date(mysqldatetime_to_unixtimestamp($oRow->submitTime))."  \n"; echo " sEmail."\">".$oUser->sRealname."\n"; + echo " ".$oApp->objectMakeLink()."\n"; if($oRow->superMaintainer) { - echo " ".Application::lookup_name($oRow->appId)."\n"; echo " *\n"; } else { - echo " ".Application::lookup_name($oRow->appId)."\n"; - echo " ".Version::lookup_name($oRow->versionId)." \n"; + $oVersion = new version($oRow->versionId); + echo " ".$oVersion->objectMakeLink()."\n"; } echo " [delete]\n"; echo "\n\n"; diff --git a/admin/adminScreenshots.php b/admin/adminScreenshots.php index 1cdf659..7ebaadb 100644 --- a/admin/adminScreenshots.php +++ b/admin/adminScreenshots.php @@ -116,13 +116,9 @@ while ($oRow = mysql_fetch_object($Ids)) echo $img; echo "
". substr($oRow->description,0,20). "\n"; - echo "
["; - echo $oApp->sName."]"; + echo "
[".$oApp->objectMakeLink()."]"; - echo "
["; - echo "Version: ".$oVersion->sName."]"; + echo "
[".$oVersion->objectMakeLink()."]"; //show admin delete link if($_SESSION['current']->isLoggedIn() && diff --git a/admin/deleteAny.php b/admin/deleteAny.php index 8279ab9..7679675 100644 --- a/admin/deleteAny.php +++ b/admin/deleteAny.php @@ -48,7 +48,10 @@ if($aClean['sWhat']) if(!$oVersion->delete()) util_show_error_page_and_exit(); else - util_redirect_and_exit(BASE."appview.php?iAppId=".$aClean['iAppId']); + { + $oApp = new application($aClean['iAppId']); + util_redirect_and_exit($oApp->objectMakeUrl()); + } break; } } diff --git a/appview.php b/appview.php index d2ba5ae..b284fd4 100644 --- a/appview.php +++ b/appview.php @@ -55,12 +55,13 @@ function display_bundle($iAppId) $c = 0; while($ob = mysql_fetch_object($hResult)) { + $oApp = new application($ob->appId); //set row color $bgcolor = ($c % 2 == 0) ? "color0" : "color1"; //display row echo "\n"; - echo " appId\">".stripslashes($ob->appName)."\n"; + echo " ".$oApp->objectMakeLink()."\n"; echo " ".util_trim_description($oApp->sDescription)."\n"; echo "\n\n"; @@ -85,7 +86,7 @@ if ($aClean['sSub']) { $oBuglink = new Bug($aClean['iBuglinkId']); $oBuglink->delete(); - util_redirect_and_exit(apidb_fullurl("appview.php?iVersionId=".$aClean['iVersionId'])); + util_redirect_and_exit($oVersion->objectMakeUrl()); } } @@ -97,7 +98,7 @@ if ($aClean['sSub']) { $oBuglink = new Bug($aClean['iBuglinkId']); $oBuglink->unqueue(); - util_redirect_and_exit(apidb_fullurl("appview.php?iVersionId=".$aClean['iVersionId'])); + util_redirect_and_exit($oVersion->objectMakeUrl()); } } @@ -105,13 +106,13 @@ if ($aClean['sSub']) { $oBuglink = new Bug(); $oBuglink->create($aClean['iVersionId'],$aClean['iBuglinkId']); - util_redirect_and_exit(apidb_fullurl("appview.php?iVersionId=".$aClean['iVersionId'])); + util_redirect_and_exit($oVersion->objectMakeUrl()); } if($aClean['sSub'] == 'StartMonitoring') { $oMonitor = new Monitor(); $oMonitor->create($_SESSION['current']->iUserId,$aClean['iAppId'],$aClean['iVersionId']); - util_redirect_and_exit(apidb_fullurl("appview.php?iVersionId=".$aClean['iVersionId'])); + util_redirect_and_exit($oVersion->objectMakeUrl()); } if($aClean['sSub'] == 'StopMonitoring') { @@ -121,7 +122,7 @@ if ($aClean['sSub']) { $oMonitor->delete(); } - util_redirect_and_exit(apidb_fullurl("appview.php?iVersionId=".$aClean['iVersionId'])); + util_redirect_and_exit($oVersion->objectMakeUrl()); } } diff --git a/deletecomment.php b/deletecomment.php index a3104cd..3cf9aef 100644 --- a/deletecomment.php +++ b/deletecomment.php @@ -55,6 +55,7 @@ if($_SESSION['current']->getPref("confirm_comment_deletion") != "no" && !isset($ } else { $oComment->delete($aClean['sWhy']); - util_redirect_and_exit(apidb_fullurl("appview.php?iVersionId=".$oComment->iVersionId)); + $oVersion = new version($oComment->iVersionId); + util_redirect_and_exit($oVersion->objectMakeUrl()); } ?> diff --git a/include/application.php b/include/application.php index f91404c..111f3f6 100644 --- a/include/application.php +++ b/include/application.php @@ -443,7 +443,7 @@ class Application { if($this->sQueued == 'false') // Has been accepted. { $sSubject = $this->sName." has been added by ".$_SESSION['current']->sRealname; - $sMsg = APPDB_ROOT."appview.php?iAppId=".$this->iAppId."\n"; + $sMsg = $this->objectMakeUrl()."\n"; if($this->iSubmitterId) { $oSubmitter = new User($this->iSubmitterId); @@ -467,7 +467,7 @@ class Application { break; case "edit": $sSubject = $this->sName." has been modified by ".$_SESSION['current']->sRealname; - $sMsg .= APPDB_ROOT."appview.php?iAppId=".$this->iAppId."\n"; + $sMsg .= $this->objectMakeUrl()."\n"; addmsg("Application modified.", "green"); break; case "delete": @@ -810,8 +810,9 @@ class Application { for($i = 1; $oRow = mysql_fetch_object($hResult); $i++) { $oVendor = new vendor($oRow->vendorId); + $oApp = new application($oRow->appId); $sResult .= html_tr(array( - "appId\">$oRow->appName", + $oApp->objectMakeLink(), $oRow->description, $oVendor->objectMakeLink(), print_date(mysqltimestamp_to_unixtimestamp($oRow->submitTime))), diff --git a/include/bugs.php b/include/bugs.php index 7291755..552f9a5 100644 --- a/include/bugs.php +++ b/include/bugs.php @@ -219,13 +219,14 @@ class Bug { function SendNotificationMail($bDeleted=false) { - $sAppName = Application::lookup_name($this->iAppId)." ".Version::lookup_name($this->iVersionId); + $sAppName = version::fullName($this->iVersionId); + $oVersion = new version($this->iVersionId); if(!$bDeleted) { if(!$this->bQueued) { $sSubject = "Link between Bug ".$this->iBug_id." and ".$sAppName." added by ".$_SESSION['current']->sRealname; - $sMsg = APPDB_ROOT."appview.php?iVersionId=".$this->iVersionId."\n"; + $sMsg = $oVersion->objectMakeUrl()."\n"; if($this->iSubmitterId) { $oSubmitter = new User($this->iSubmitterId); @@ -236,7 +237,7 @@ class Bug { } else // Bug Link queued. { $sSubject = "Link between Bug ".$this->iBug_id." and ".$sAppName." submitted by ".$_SESSION['current']->sRealname; - $sMsg = APPDB_ROOT."appview.php?iVersionId=".$this->iVersionId."\n"; + $sMsg = $oVersion->objectMakeUrl()."\n"; $sMsg .= "This Bug Link has been queued."; $sMsg .= "\n"; addmsg("The Bug Link you submitted will be added to the database after being reviewed.", "green"); @@ -244,7 +245,7 @@ class Bug { } else // Bug Link deleted. { $sSubject = "Link between Bug ".$this->iBug_id." and ".$sAppName." deleted by ".$_SESSION['current']->sRealname; - $sMsg = APPDB_ROOT."appview.php?iVersionId=".$this->iVersionId."\n"; + $sMsg = $oVersion->objectMakeUrl()."\n"; addmsg("Bug Link deleted.", "green"); } @@ -277,7 +278,7 @@ class Bug { { $oBug = new Bug($oRow->bug_id); $sReturn .= html_tr(array( - "versionId."\">".$oRow->appName.": ".$oRow->versionName."", + version::fullNameUrl($oRow->versionId), "bug_id."\">".$oRow->bug_id."", $oBug->sBug_status, $oBug->sResolution, @@ -315,7 +316,7 @@ function view_version_bugs($iVersionId = null, $aBuglinkIds) //start format table if($_SESSION['current']->isLoggedIn()) { - echo "
\n"; + echo "\n"; } echo html_frame_start("Known bugs","98%",'',0); echo "\n\n"; @@ -352,10 +353,10 @@ function view_version_bugs($iVersionId = null, $aBuglinkIds) if($bCanEdit == true) { - echo "\n"; + echo "\n"; if ($oBuglink->bQueued) { - echo "\n"; + echo "\n"; } else { echo "\n"; diff --git a/include/comment.php b/include/comment.php index 046ce82..5f15aed 100644 --- a/include/comment.php +++ b/include/comment.php @@ -87,7 +87,7 @@ class Comment { $sSubject = "Comment for '".Application::lookup_name($this->iAppId)." ".Version::lookup_name($this->iVersionId)."' added by ".$_SESSION['current']->sRealname; $sMsg = "To reply to this email please use the link provided below.\n"; $sMsg .= "DO NOT reply via your email client as it will not reach the person who wrote the comment\n"; - $sMsg .= APPDB_ROOT."appview.php?iVersionId=".$this->iVersionId."&mode=nested#Comment-".$this->iCommentId."\n"; + $sMsg .= $this->objectMakeUrl()."\n"; $sMsg .= "\n"; $sMsg .= "Subject: ".$this->sSubject."\r\n"; $sMsg .= "\n"; @@ -165,8 +165,9 @@ class Comment { $sEmail .= $this->oOwner->sEmail; if($sEmail) { - $sSubject = "Comment for '".Application::lookup_name($this->iAppId)." ".Version::lookup_name($this->iVersionId)."' deleted by ".$_SESSION['current']->sRealname; - $sMsg = APPDB_ROOT."appview.php?iVersionId=".$this->iVersionId."\n"; + $sSubject = "Comment for '".version::fullName($this->iVersionId)."' deleted by ".$_SESSION['current']->sRealname; + $oVersion = new version($this->iVersionId); + $sMsg = $oVersion->objectMakeUrl()."\n"; $sMsg .= "\n"; $sMsg .= "This comment was made on ".substr($this->sDateCreated,0,10)." by ".$this->oOwner->sRealname."\n"; $sMsg .= "\n"; @@ -385,8 +386,10 @@ class Comment { if (!empty($aClean['sCmode'])) $_SESSION['current']->setPref("comments:mode", $aClean['sCmode']); + $oVersion = new version($versionId); $sel[$_SESSION['current']->getPref("comments:mode", "threaded")] = 'selected'; - echo '',"\n"; + echo '',"\n"; } // blank space @@ -440,7 +443,14 @@ class Comment { } echo '
[delete][delete][OK][OK]Yes',"\n"; + echo '',"\n"; echo "Application Comments $messageCount total comments "; echo 'Mode ',"\n"; - echo '
',"\n"; - } + } + + function objectMakeUrl() + { + $oVersion = new version($this->iVersionId); + $sUrl = $oVersion->objectMakeUrl()."#Comment-".$this->iCommentId; + return $sUrl; + } } diff --git a/include/distribution.php b/include/distribution.php index b030d19..c6825f2 100644 --- a/include/distribution.php +++ b/include/distribution.php @@ -527,8 +527,8 @@ class distribution { continue; echo '',"\n"; - echo '',"\n"; - echo $oApp->sName.' '.$oVersion->sName.'',"\n"; + echo '',"\n"; + echo version::fullName($oVersion->iVersionId).'',"\n"; echo '',"\n"; if($_SESSION['current']->isLoggedIn()) { diff --git a/include/downloadurl.php b/include/downloadurl.php index 8a66a2f..8bab015 100644 --- a/include/downloadurl.php +++ b/include/downloadurl.php @@ -191,13 +191,12 @@ class downloadurl if($sWhatChanged && $sEmail = User::get_notify_email_address_list($aValues['iVersionId'])) { - $oApp = new Application($aValues["iAppId"]); $oVersion = new Version($aValues["iVersionId"]); - $sSubject = "Download URLs for $oApp->sName $oVersion->sName". + $sSubject = "Download URLs for ".version::fullName($oVersion->iVersionId). " updated by ".$_SESSION['current']->sRealname; - $sMsg = APPDB_ROOT."appview.php?iVersionId=".$aValues['iVersionId']; + $sMsg = $oVersion->objectMakeUrl(); $sMsg .= "\n\n"; $sMsg .= "The following changed were made\n\n"; $sMsg .= "$sWhatChanged\n\n"; diff --git a/index.php b/index.php index 795c29c..6c8ece4 100644 --- a/index.php +++ b/index.php @@ -65,14 +65,12 @@ If you have screenshots or links to contribute, please browse the database and u $hResult = query_parameters($voteQuery); $oRow = mysql_fetch_object($hResult); - $sVoteVersionId = $oRow->versionId; - $sVoteAppName = version::fullName($oRow->versionId); - // don't mention the top application if there are no votes yet - if($sVoteVersionId != "") + if($oRow->versionId) { + $sVoteAppLink = version::fullNameLink($oRow->versionId); echo "There are $numApps applications currently in the database with\n"; - echo "$sVoteAppName being the\n"; + echo "$shVoteAppLink being the\n"; echo "top voted application.\n"; } else {