Author: jfthomps
Date: Thu Mar 1 18:58:11 2012
New Revision: 1295741
URL: http://svn.apache.org/viewvc?rev=1295741&view=rev
Log:
VCL-551
deleting an active VM doesn't remove it from the VM host
modified submitDeleteComputer and submitCompStateChange to set vmhostid to NULL
when setting deleted to 1 as a result of deleting computers
Modified:
incubator/vcl/trunk/web/.ht-inc/computers.php
Modified: incubator/vcl/trunk/web/.ht-inc/computers.php
URL:
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/computers.php?rev=1295741&r1=1295740&r2=1295741&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/computers.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/computers.php Thu Mar 1 18:58:11 2012
@@ -1727,7 +1727,8 @@ function submitDeleteComputer() {
}
else {
$query = "UPDATE computer "
- . "SET deleted = 1 "
+ . "SET deleted = 1, "
+ . "vmhostid = NULL "
. "WHERE id = $compid";
$qh = doQuery($query, 191);
}
@@ -3654,11 +3655,13 @@ function submitCompStateChange() {
print "<br>\n";
}
}
+ # set to deleted
elseif($data['stateid'] == 999) {
$compids = implode(',', $data['computerids']);
$query = "UPDATE computer "
. "SET deleted = 1, "
- . "notes = '' "
+ . "notes = '', "
+ . "vmhostid = NULL "
. "WHERE id IN ($compids)";
doQuery($query, 999);
print "The following computers were deleted:\n";