viewAlertBL.php
2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
require_once("../../../../config/dmsDefaults.php");
require_once("$default->fileSystemRoot/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 <michael@jamwarehouse.com>, 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();
}
}
}
?>