From 3093f017b0e66a63ece064761f2942f217fca50e Mon Sep 17 00:00:00 2001 From: Michael Joseph Date: Tue, 11 Feb 2003 08:29:19 +0000 Subject: [PATCH] initial revision of alert viewing page (clears alert and redirects) --- presentation/lookAndFeel/knowledgeTree/subscriptions/viewAlertBL.php | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+), 0 deletions(-) create mode 100644 presentation/lookAndFeel/knowledgeTree/subscriptions/viewAlertBL.php diff --git a/presentation/lookAndFeel/knowledgeTree/subscriptions/viewAlertBL.php b/presentation/lookAndFeel/knowledgeTree/subscriptions/viewAlertBL.php new file mode 100644 index 0000000..c88c4a3 --- /dev/null +++ b/presentation/lookAndFeel/knowledgeTree/subscriptions/viewAlertBL.php @@ -0,0 +1,66 @@ +owl_fs_root/lib/subscriptions/SubscriptionManager.inc"); + +/** + * $Id$ + * + * Clears the subscription alert, and forwards to the content that + * triggered the alert. + * + * Licensed under the GNU GPL. For full terms see the file DOCS/COPYING. + * + * @version $Revision$ + * @author Michael Joseph , Jam Warehouse (Pty) Ltd, South Africa + * @package presentation.lookAndFeel.knowledgeTree.subscriptions + */ + +/* + * Querystring variables + * --------------------- + * fSubscriptionID - the subscription to view + * fSubscriptionType - the subscription type (folder,document) to view + */ + +// ------------------------------- +// page start +// ------------------------------- + +// only if we have a valid session +if (checkSession()) { + + $default->log->debug("subID=$fSubscriptionID, type=$fSubscriptionType"); + // retrieve variables + if ((!$fSubscriptionID) || (!$fSubscriptionType)) { + require_once("../../../webpageTemplate.inc"); + $main->setErrorMessage("You have not selected a subscription alert"); + $oPatternCustom = & new PatternCustom(); + $main->setCentralPayload($oPatternCustom); + $main->setFormAction($_SERVER["PHP_SELF"]); + $main->render(); + } else { + + // instantiate the subscription manager + $oSubscriptionManager = new SubscriptionManager(); + // clear the subscription alert and return the url to redirect to + $sContentUrl = SubscriptionManager::viewSubscription($fSubscriptionID, $fSubscriptionType); + if ($sContentUrl) { + $default->log->debug("retrieved $sContentUrl from viewSubscription"); + // now redirect + redirect($sContentUrl); + } else { + // viewSubscription called failed + require_once("../../../webpageTemplate.inc"); + $main->setErrorMessage("This subscription alert does not exist (" . $_SESSION["errorMessage"] . ")"); + $oPatternCustom = & new PatternCustom(); + $main->setCentralPayload($oPatternCustom); + $main->setFormAction($_SERVER["PHP_SELF"]); + $main->render(); + } + } +} else { + // redirect to no permission page + redirect("$default->owl_ui_url/noAccess.php"); +} +?> -- libgit2 0.21.4