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/editAppNote.php

75 lines
1.9 KiB
PHP
Raw Normal View History

<?php
/****************/
/* Edit AppNote */
/****************/
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");
2004-03-15 16:22:00 +00:00
$aClean = array(); //array of filtered user input
$aClean['iNoteId'] = makeSafe($_REQUEST['iNoteId']);
$aClean['sSub'] = makeSafe($_REQUEST['sSub']);
$aClean['sSubmit'] = makeSafe($_REQUEST['sSubmit']);
$aClean['sPreview'] = makeSafe($_REQUEST['sPreview']);
if(!is_numeric($aClean['iNoteId']))
2004-03-15 16:22:00 +00:00
{
util_show_error_page('Wrong note ID');
2004-03-15 16:22:00 +00:00
exit;
}
/* Get note data */
$oNote = new Note($aClean['iNoteId']);
2004-03-15 16:22:00 +00:00
/* Check for privs */
2005-02-19 01:23:02 +00:00
if(!$_SESSION['current']->hasPriv("admin") && !$_SESSION['current']->isMaintainer($oNote->iVersionId) && !$_SESSION['current']->isSuperMaintainer($oNote->iAppId))
{
util_show_error_page("Insufficient Privileges!");
exit;
}
2004-03-15 16:22:00 +00:00
if(!empty($aClean['sSub']))
2004-03-15 16:22:00 +00:00
{
$oNote->GetOutputEditorValues(); /* retrieve the updated values */
if ($aClean['sSub'] == 'Delete')
{
$oNote->delete();
}
else if ($aClean['sSub'] == 'Update')
{
$oNote->update();
}
redirect(apidb_fullurl("appview.php?iVersionId={$oNote->iVersionId}"));
} else /* display note */
2004-03-15 16:22:00 +00:00
{
// show form
apidb_header("Application Note");
2004-03-15 16:22:00 +00:00
/* if preview is set display the note for review */
if($aClean['sPreview'])
{
$oNote->GetOutputEditorValues(); /* retrieve the updated values */
$oNote->show(true);
}
2004-03-15 16:22:00 +00:00
echo "<form method=post action='editAppNote.php'>\n";
/* display the editor for this note */
$oNote->OutputEditor();
echo '<center>';
echo '<input type="submit" name=sPreview value="Preview">&nbsp',"\n";
echo '<input type="submit" name=sSub value="Update">&nbsp',"\n";
echo '<input type="submit" name=sSub value="Delete"></td></tr>',"\n";
echo '</center>';
echo html_back_link(1,BASE."appview.php?iVersionId=".$oNote->iVersionId);
2004-03-15 16:22:00 +00:00
}
apidb_footer();
?>