Alexander Nicolaysen Sørnes <alex@thehandofagony.com>

Use objectManager to delete monitors.
This commit is contained in:
Chris Morgan
2007-09-14 23:27:36 -04:00
parent 2827e0654e
commit d5cf2375dd
2 changed files with 9 additions and 25 deletions

View File

@@ -8,7 +8,7 @@
* - iVersionId, version identifier
*
* Optional parameters:
* - sSub, action to perform ("delete", "unqueue", "Submit a new bug link.", "StartMonitoring", "StopMonitoring")
* - sSub, action to perform ("delete", "unqueue", "Submit a new bug link.")
* - iBuglinkId, bug identifier to link a bug with a version
*
* TODO:
@@ -25,7 +25,6 @@ require_once(BASE."include/appdb.php");
require_once(BASE."include/vote.php");
require_once(BASE."include/category.php");
require_once(BASE."include/maintainer.php");
require_once(BASE."include/monitor.php");
/**
@@ -113,26 +112,6 @@ if (isset($aClean['sSub']))
$oBuglink->create();
util_redirect_and_exit($oVersion->objectMakeUrl());
}
if($aClean['sSub'] == 'StartMonitoring')
{
$oMonitor = new Monitor();
$oMonitor->iUserId = $_SESSION['current']->iUserId;
$oMonitor->iAppId = $aClean['iAppId'];
$oMonitor->iVersionId = $aClean['iVersionId'];
$oMonitor->create();
util_redirect_and_exit($oVersion->objectMakeUrl());
}
if($aClean['sSub'] == 'StopMonitoring')
{
$oMonitor = new Monitor();
$oMonitor->find($_SESSION['current']->iUserId, $aClean['iVersionId']);
if($oMonitor->iMonitorId)
{
$oMonitor->delete();
}
util_redirect_and_exit($oVersion->objectMakeUrl());
}
}
/**

View File

@@ -899,9 +899,14 @@ class version {
{
echo '<tr><td colspan="2" align="center">'."\n";
echo '</form>'."\n";
echo '<form method="post" name="sMessage" action='.
$this->objectMakeUrl().'>'."\n";
echo '<input type=hidden name="sSub" value="StopMonitoring" />'."\n";
echo '<form method="post" name="sMessage" action="'.
APPDB_ROOT."objectManager.php\">\n";
echo "\t<input type=\"hidden\" name=\"iId\" value=\"".
$oMonitor->iMonitorId."\" />\n";
echo "\t<input type=\"hidden\" name=\"sSubmit\" value=\"Delete\" />\n";
echo "\t<input type=\"hidden\" name=\"sClass\" value=\"monitor\" />\n";
echo "\t<input type=\"hidden\" name=\"sReturnTo\" value=\"".
$this->objectMakeUrl()."\" />\n";
echo '<input type=submit value="Stop Monitoring Version" class="button" />'."\n";
echo "</form>\n";
echo "</td></tr>\n";