diff --git a/include/note.php b/include/note.php
index 3cf1157..7866f9e 100644
--- a/include/note.php
+++ b/include/note.php
@@ -136,6 +136,10 @@ class Note {
return TRUE;
}
+ function objectShowPreview()
+ {
+ return TRUE;
+ }
function SendNotificationMail($sAction="add",$sMsg=null)
{
@@ -183,7 +187,7 @@ class Note {
/* Show note */
/* $bDisplayOnly means we should not display any editing controls, even if */
/* the user has the ability to edit this note */
- function display($bDisplayOnly = false)
+ function display($aVars = null)
{
switch($this->sTitle)
{
@@ -216,15 +220,12 @@ class Note {
$shOutput .= $this->shDescription;
$shOutput .= "\n";
- if(!$bDisplayOnly)
+ if((!$aVars || $aVars['bEditing'] != "true") && $this->canEdit())
{
- if ($this->canEdit())
- {
- $shOutput .= "
";
- $shOutput .= "
';
- }
+ $shOutput .= "
";
+ $shOutput .= "
';
}
$shOutput .= "\n";
@@ -237,6 +238,9 @@ class Note {
{
switch($sAction)
{
+ case "preview":
+ return array("bEditing");
+
case "add":
return array("iVersionId","sNoteTitle");
@@ -261,6 +265,7 @@ class Note {
echo html_frame_start("Edit Application Note {$aClean['noteId']}", "90%","",0);
echo html_table_begin("width='100%' border=0 align=left cellpadding=6 cellspacing=0 class='box-body'");
+ echo '';
echo '';
echo '';
diff --git a/include/objectManager.php b/include/objectManager.php
index 0cd500c..7d749ae 100644
--- a/include/objectManager.php
+++ b/include/objectManager.php
@@ -1,5 +1,7 @@
getOutputEditorValues($aClean);
+
+ if($sErrors == PREVIEW_ENTRY)
+ $this->show_preview($oObject, $aClean);
}
echo '\n";
-
echo html_back_link(1, $sBackLink);
echo "\n";
}
+ function handle_preview_button()
+ {
+ $oObject = new $this->sClass($this->iId);
+
+ if(!method_exists($oObject, "objectShowPreview"))
+ return;
+
+ if(!$oObject->objectShowPreview())
+ return;
+
+ echo '';
+ }
+
function handle_anonymous_submission()
{
$oObject = new $this->sClass();
@@ -822,6 +858,9 @@ class ObjectManager
// have to correct
switch($aClean['sSubmit'])
{
+ case "Preview":
+ return PREVIEW_ENTRY;
+
case "Submit":
// if we have errors, return them
if($sErrors)
@@ -1070,6 +1109,10 @@ class ObjectManager
if($sErrors === TRUE)
return TRUE;
+
+ if($sErrors == PREVIEW_ENTRY)
+ return TRUE;
+
echo "\n";
echo "The following errors were found \n";
echo "