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

69 lines
1.9 KiB
PHP
Raw Normal View History

<?php
/************************/
/* Add Application Note */
/************************/
2004-03-15 16:22:00 +00:00
include("path.php");
require(BASE."include/incl.php");
require(BASE."include/application.php");
require(BASE."include/mail.php");
$aClean = array(); //array of filtered user input
$aClean['iVersionId'] = makeSafe($_REQUEST['iVersionId']);
$aClean['iAppId'] = makeSafe( $_REQUEST['iAppId']);
$aClean['sSub'] = makeSafe($_REQUEST['sSub']);
$aClean['sSubmit'] = makeSafe($_REQUEST['sSubmit']);
//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']))
{
$sVersionLink = "iVersionId={$aClean['iVersionId']}";
}
else
exit;
$oNote = new Note();
$oNote->GetOutputEditorValues();
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(apidb_fullurl("appview.php?".$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,BASE."appview.php?".$sVersionLink);
apidb_footer();
2004-03-15 16:22:00 +00:00
}
?>