svn commit: r1041116 - /incubator/vcl/trunk/web/.ht-inc/computers.php

2010-12-01 Thread jfthomps
Author: jfthomps
Date: Wed Dec  1 18:27:51 2010
New Revision: 1041116

URL: http://svn.apache.org/viewvc?rev=1041116&view=rev
Log:
VCL-232
add way to delete multiple computers

applied patch submitted by David Hutchins
patch is attached to JIRA issue

-modified computerUtilities - added code to select DELETE as one of the options 
along with state change
-modified compStateChange - added section to handle when DELETE is selected
-modified submitCompStateChange - added section to handle when DELETE is 
selected

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=1041116&r1=1041115&r2=1041116&view=diff
==
--- incubator/vcl/trunk/web/.ht-inc/computers.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/computers.php Wed Dec  1 18:27:51 2010
@@ -,14 +,15 @@ function computerUtilities() {
print "  \n";
}
print "  \n";
-   print "Change state of selected computers to:";
+   print "Change state of or delete selected computers:";
$states = array("2" => "available",
"23" => "hpc",
"10" => "maintenance",
-   "20" => "convert to vmhostinuse");
+   "20" => "convert to vmhostinuse",
+   "999" => "DELETE");
print "\n";
printSelectInput("stateid", $states);
-   print "";
+   print "";
print "\n";
$cont = addContinuationsEntry('compStateChange', array(), SECINDAY, 0);
print "\n";
@@ -2468,6 +2469,11 @@ function compStateChange() {
print "hpc state:\n";
print "\n";
}
+   elseif($data['stateid'] == 999) {
+   print "You are about to DELETE 
the following computers";
+   print "\n";
+   }
+
$cont = addContinuationsEntry('submitCompStateChange', $data, SECINDAY, 
0, 0);
print "  \n";
print "\n";
@@ -2972,6 +2978,22 @@ function submitCompStateChange() {
print "\n";
}
}
+   elseif($data['stateid'] == 999) {
+   $compids = implode(',', $data['computerids']);
+   $query = "UPDATE computer "
+  . "SET deleted = 1, "
+  . "notes = '' "
+  . "WHERE id IN ($compids)";
+   doQuery($query, 999);
+   print "The following computers were deleted:\n";
+   print "\n";
+   foreach($data['computerids'] as $compid) {
+   print "  \n";
+   print "
{$computers[$compid]['hostname']}\n";
+   print "  \n";
+   }
+   print "\n";
+   }
else
abort(50);
 }




svn commit: r1041129 - /incubator/vcl/trunk/web/.ht-inc/vm.php

2010-12-01 Thread jfthomps
Author: jfthomps
Date: Wed Dec  1 18:50:31 2010
New Revision: 1041129

URL: http://svn.apache.org/viewvc?rev=1041129&view=rev
Log:
VCL-395
cannot add new vmprofiles

applied patch submitted by David Hutchins

-modified AJnewProfile - changed query to include vmtypeid and imageid

Modified:
incubator/vcl/trunk/web/.ht-inc/vm.php

Modified: incubator/vcl/trunk/web/.ht-inc/vm.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/vm.php?rev=1041129&r1=1041128&r2=1041129&view=diff
==
--- incubator/vcl/trunk/web/.ht-inc/vm.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/vm.php Wed Dec  1 18:50:31 2010
@@ -858,7 +858,7 @@ function AJnewProfile() {
sendJSON(array('failed' => 'exists'));
return;
}
-   $query = "INSERT INTO vmprofile (profilename) VALUES ('$newprofile')";
+   $query = "INSERT INTO vmprofile (profilename, vmtypeid, imageid) VALUES 
('$newprofile',1,4)";
doQuery($query, 101);
$qh = doQuery("SELECT LAST_INSERT_ID() FROM vmprofile", 101);
$row = mysql_fetch_row($qh);