This repository has been archived on 2025-05-24. You can view files and clone it, but cannot push or open issues or pull requests.
Files
qemudb/admin/addAppNote.php

62 lines
1.6 KiB
PHP
Raw Normal View History

<?php
/************************/
/* Add Application Note */
/************************/
2004-03-15 16:22:00 +00:00
require("path.php");
require(BASE."include/incl.php");
require_once(BASE."include/note.php");
//FIXME: get rid of appId references everywhere, as version is enough.
$sQuery = "SELECT appId FROM appVersion WHERE versionId = '?'";
$hResult = query_parameters($sQuery, $aClean['iVersionId']);
$oRow = mysql_fetch_object($hResult);
$appId = $oRow->appId;
2004-03-15 16:22:00 +00:00
//check for admin privs
if(!$_SESSION['current']->hasPriv("admin") &&
!$_SESSION['current']->isMaintainer($aClean['iVersionId']) &&
!$_SESSION['current']->isSuperMaintainer($aClean['iAppId']))
2004-03-15 16:22:00 +00:00
{
util_show_error_page_and_exit("Insufficient Privileges!");
2004-03-15 16:22:00 +00:00
}
//set link for version
if(is_numeric($aClean['iVersionId']) and !empty($aClean['iVersionId']))
{
$oVersion = new version($aClean['iVersionId']);
$sVersionLink = $oVersion->objectMakeUrl();
}
else
exit;
$oNote = new Note();
$oNote->GetOutputEditorValues($aClean);
2004-03-15 16:22:00 +00:00
if($aClean['sSub'] == "Submit")
2004-03-15 16:22:00 +00:00
{
$oNote->create();
util_redirect_and_exit($sVersionLink);
2004-03-15 16:22:00 +00:00
}
else if($aClean['sSub'] == 'Preview' OR empty($aClean['sSubmit']))
2004-03-15 16:22:00 +00:00
{
// show form
apidb_header("Application Note");
if($aClean['sSub'] == 'Preview')
$oNote->show(true);
2004-03-15 16:22:00 +00:00
echo "<form method=post action='addAppNote.php'>\n";
2004-03-15 16:22:00 +00:00
$oNote->outputEditor();
2004-03-15 16:22:00 +00:00
echo '<center>';
echo '<input type="submit" name="sSub" value="Preview">&nbsp',"\n";
echo '<input type="submit" name="sSub" value="Submit"></td></tr>',"\n";
echo '</center>';
2004-03-15 16:22:00 +00:00
echo html_back_link(1,$sVersionLink);
apidb_footer();
2004-03-15 16:22:00 +00:00
}
?>