Author: jfthomps
Date: Thu Apr 26 15:05:05 2012
New Revision: 1330897

URL: http://svn.apache.org/viewvc?rev=1330897&view=rev
Log:
VCL-576

computers.php:
-modified editOrAddComputer - added an 'i' for ignore case when matching any 
provisioning modules starting with 'xcat'
-modified submitEditComputer - fixed bug with updating vmprofile for vmhosts
-modified computerUtilities - changed id of continuation from 'continuation' to 
'utilformcont' - this was causing a problem with IE because of the locale form 
that had a continuation; with IE, document.getElementById will also get 
elements with the specified name; so, the locale continuation object was 
getting returned instead of the computer utility continuation object

code.js: modified reloadComputerSubmit, compStateChangeSubmit, and 
compScheduleChangeSubmit to get the object with id 'utilformcont' instead of 
'continuation' to match changes made in computers.php

Modified:
    incubator/vcl/trunk/web/.ht-inc/computers.php
    incubator/vcl/trunk/web/js/code.js

Modified: incubator/vcl/trunk/web/.ht-inc/computers.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/computers.php?rev=1330897&r1=1330896&r2=1330897&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/computers.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/computers.php Thu Apr 26 15:05:05 2012
@@ -629,7 +629,7 @@ function editOrAddComputer($state) {
                        if($data['type'] == 'lab')
                                $showprovisioning[$id] = $val['prettyname'];
                }
-               elseif(preg_match('/^xcat/', $val['name']) || $val['name'] == 
'none') {
+               elseif(preg_match('/^xcat/i', $val['name']) || $val['name'] == 
'none') {
                        $allowedprovisioning['blade'][] = array('id' => $id, 
'name' => $val['prettyname']);
                        if($data['type'] == 'blade')
                                $showprovisioning[$id] = $val['prettyname'];
@@ -1387,10 +1387,16 @@ function submitEditComputer() {
                        doQuery($query);
                }
                # update vmprofile
-               $query = "UPDATE vmhost "
-                                . "SET vmprofileid = $profileid "
-                                . "WHERE id = {$row['id']}";
-               doQuery($query, 101);
+               $query = "SELECT id "
+                      . "FROM vmhost "
+                      . "WHERE computerid = $compid";
+               $qh = doQuery($query, 101);
+               if($row = mysql_fetch_assoc($qh)) {
+                       $query = "UPDATE vmhost "
+                              . "SET vmprofileid = $profileid "
+                              . "WHERE id = {$row['id']}";
+                       doQuery($query, 101);
+               }
        }
        updateComputer($data);
        viewComputers();
@@ -2853,7 +2859,7 @@ function computerUtilities() {
                        "999" => "DELETE");
        print "    <TD colspan=2>\n";
        printSelectInput("stateid", $states);
-       print "    <INPUT type=button onclick=compStateChangeSubmit(); 
value=\"Confirm Change\">";
+       print "    <INPUT type=button onclick=\"compStateChangeSubmit();\" 
value=\"Confirm Change\">";
        print "    </TD>\n";
        $cont = addContinuationsEntry('compStateChange', array(), SECINDAY, 0);
        print "    <INPUT type=hidden id=statecont value=\"$cont\">\n";
@@ -2882,7 +2888,7 @@ function computerUtilities() {
        print "    </TD>\n";
        print "  </TR>\n";
        print "</TABLE>\n";
-       print "<INPUT type=hidden name=continuation id=continuation>\n";
+       print "<INPUT type=\"hidden\" name=\"continuation\" 
id=\"utilformcont\">\n";
        print "</FORM>\n";
 
        print "<br>$count computers found<br>\n";

Modified: incubator/vcl/trunk/web/js/code.js
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/js/code.js?rev=1330897&r1=1330896&r2=1330897&view=diff
==============================================================================
--- incubator/vcl/trunk/web/js/code.js (original)
+++ incubator/vcl/trunk/web/js/code.js Thu Apr 26 15:05:05 2012
@@ -72,7 +72,7 @@ function uncheckAllCompUtils() {
 
 function reloadComputerSubmit() {
        var formobj = document.getElementById('utilform');
-       var obj = document.getElementById('continuation');
+       var obj = document.getElementById('utilformcont');
        var contobj = document.getElementById('reloadcont');
        obj.value = contobj.value;
        formobj.submit();
@@ -80,7 +80,7 @@ function reloadComputerSubmit() {
 
 function compStateChangeSubmit() {
        var formobj = document.getElementById('utilform');
-       var obj = document.getElementById('continuation');
+       var obj = document.getElementById('utilformcont');
        var contobj = document.getElementById('statecont');
        obj.value = contobj.value;
        formobj.submit();
@@ -88,7 +88,7 @@ function compStateChangeSubmit() {
 
 function compScheduleChangeSubmit() {
        var formobj = document.getElementById('utilform');
-       var obj = document.getElementById('continuation');
+       var obj = document.getElementById('utilformcont');
        var contobj = document.getElementById('schcont');
        obj.value = contobj.value;
        formobj.submit();


Reply via email to