diff --git a/appview.php b/appview.php
index c288e27..9767217 100644
--- a/appview.php
+++ b/appview.php
@@ -82,55 +82,6 @@ function display_bundle($iAppId)
echo html_frame_end();
}
-/* Show note */
-function show_note($sType,$oData)
-{
- global $oVersion;
-
- switch($sType)
- {
- case 'WARNING':
- $color = 'red';
- $title = 'Warning';
- break;
-
- case 'HOWTO';
- $color = 'green';
- $title = 'HOWTO';
- break;
-
- default:
-
- if(!empty($oData->noteTitle))
- $title = $oData->noteTitle;
- else
- $title = 'Note';
-
- $color = 'blue';
- }
-
- $s = html_frame_start("","98%",'',0);
-
- $s .= "
\n";
- $s .= "| ".$title." |
\n";
- $s .= "| \n";
- $s .= $oData->noteDesc;
- $s .= " |
\n";
-
- if ($_SESSION['current']->hasPriv("admin") || $_SESSION['current']->isMaintainer($oVersion->iVersionId) || $_SESSION['current']->isSuperMaintainer($oVersion->iAppId))
- {
- $s .= "| ";
- $s .= " |
';
- }
-
- $s .= "
\n";
- $s .= html_frame_end();
-
- return $s;
-}
-
if(!is_numeric($aClean['appId']) && !is_numeric($aClean['versionId']))
{
util_show_error_page("Something went wrong with the application or version id");
diff --git a/include/note.php b/include/note.php
index e780946..a89993d 100644
--- a/include/note.php
+++ b/include/note.php
@@ -158,5 +158,53 @@ class Note {
if($sEmail)
mail_appdb($sEmail, $sSubject ,$sMsg);
}
+
+ /* Show note */
+ function show()
+ {
+ switch($this->sTitle)
+ {
+ case 'WARNING':
+ $sColor = 'red';
+ $sTitle = 'Warning';
+ break;
+
+ case 'HOWTO':
+ $sColor = 'green';
+ $sTitle = 'HOWTO';
+ break;
+
+ default:
+ if(!empty($this->sTitle))
+ $sTitle = $this->sTitle;
+ else
+ $sTitle = 'Note';
+
+ $sColor = 'blue';
+ }
+
+ $shOutput = html_frame_start("","98%",'',0);
+
+ $shOutput .= "\n";
+ $shOutput .= "| ".$sTitle." |
\n";
+ $shOutput .= "| \n";
+ $shOutput .= $this->sDescription;
+ $shOutput .= " |
\n";
+
+ if ($_SESSION['current']->hasPriv("admin") ||
+ $_SESSION['current']->isMaintainer($this->iVersionId) ||
+ $_SESSION['current']->isSuperMaintainer($this->iAppId))
+ {
+ $shOutput .= "| ";
+ $shOutput .= " |
';
+ }
+
+ $shOutput .= "
\n";
+ $shOutput .= html_frame_end();
+
+ echo $shOutput;
+ }
}
?>
diff --git a/include/version.php b/include/version.php
index c49c6f4..fe48b21 100644
--- a/include/version.php
+++ b/include/version.php
@@ -827,12 +827,14 @@ class Version {
view_version_bugs($this->iVersionId, $this->aBuglinkIds);
- $rNotes = query_parameters("SELECT * FROM appNotes WHERE versionId = '?'",
+ /* display the notes for the application */
+ $hNotes = query_parameters("SELECT noteId FROM appNotes WHERE versionId = '?'",
$this->iVersionId);
- while( $oNote = mysql_fetch_object($rNotes) )
+ while( $oRow = mysql_fetch_object($hNotes) )
{
- echo show_note($oNote->noteTitle,$oNote);
+ $oNote = new Note($oRow->noteId);
+ $oNote->show();
}
// Comments Section