Alexander Nicolaysen Sørnes <alex@thehandofagony.com>
Use objectManager to delete monitors.
This commit is contained in:
23
appview.php
23
appview.php
@@ -8,7 +8,7 @@
|
|||||||
* - iVersionId, version identifier
|
* - iVersionId, version identifier
|
||||||
*
|
*
|
||||||
* Optional parameters:
|
* 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
|
* - iBuglinkId, bug identifier to link a bug with a version
|
||||||
*
|
*
|
||||||
* TODO:
|
* TODO:
|
||||||
@@ -25,7 +25,6 @@ require_once(BASE."include/appdb.php");
|
|||||||
require_once(BASE."include/vote.php");
|
require_once(BASE."include/vote.php");
|
||||||
require_once(BASE."include/category.php");
|
require_once(BASE."include/category.php");
|
||||||
require_once(BASE."include/maintainer.php");
|
require_once(BASE."include/maintainer.php");
|
||||||
require_once(BASE."include/monitor.php");
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -113,26 +112,6 @@ if (isset($aClean['sSub']))
|
|||||||
$oBuglink->create();
|
$oBuglink->create();
|
||||||
util_redirect_and_exit($oVersion->objectMakeUrl());
|
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());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -899,9 +899,14 @@ class version {
|
|||||||
{
|
{
|
||||||
echo '<tr><td colspan="2" align="center">'."\n";
|
echo '<tr><td colspan="2" align="center">'."\n";
|
||||||
echo '</form>'."\n";
|
echo '</form>'."\n";
|
||||||
echo '<form method="post" name="sMessage" action='.
|
echo '<form method="post" name="sMessage" action="'.
|
||||||
$this->objectMakeUrl().'>'."\n";
|
APPDB_ROOT."objectManager.php\">\n";
|
||||||
echo '<input type=hidden name="sSub" value="StopMonitoring" />'."\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 '<input type=submit value="Stop Monitoring Version" class="button" />'."\n";
|
||||||
echo "</form>\n";
|
echo "</form>\n";
|
||||||
echo "</td></tr>\n";
|
echo "</td></tr>\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user