Author: jfthomps
Date: Thu Apr  8 15:16:06 2010
New Revision: 931967

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

modified confirmEditOrAddComputer - added extra conditional for continuations 
mode to only be computerAddMaintenanceNote if doing an edit
modified addComputer - if the state is maintenance state, we create a note to 
be placed in the notes field

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=931967&r1=931966&r2=931967&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/computers.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/computers.php Thu Apr  8 15:16:06 2010
@@ -875,7 +875,7 @@ function confirmEditOrAddComputer($state
        print "  <TR>\n";
        print "    <TD>\n";
        print "      <FORM action=\"" . BASEURL . SCRIPT . "\" method=post>\n";
-       if($data['stateid'] == 10)
+       if(! $state && $data['stateid'] == 10)
                $cont = addContinuationsEntry('computerAddMaintenanceNote', 
$data, SECINDAY, 0);
        else
                $cont = addContinuationsEntry($nextmode, $data, SECINDAY, 0, 0);
@@ -3335,7 +3335,14 @@ function updateComputer($data) {
 ///
 
////////////////////////////////////////////////////////////////////////////////
 function addComputer($data) {
+       global $user;
        $ownerid = getUserlistID($data["owner"]);
+       if($data['stateid'] == 10) {
+               $now = unixToDatetime(time());
+               $notes = "'{$user['unityid']} $...@in maintenance state when 
added to database'";
+       }
+       else
+               $notes = 'NULL';
        $query = "INSERT INTO computer "
               .        "(stateid, "
               .        "ownerid, "
@@ -3349,6 +3356,7 @@ function addComputer($data) {
               .        "hostname, "
               .        "IPaddress, "
               .        "type, "
+              .        "notes, "
               .        "provisioningid) "
               . "VALUES (" . $data["stateid"] . ", "
               .         "$ownerid, "
@@ -3362,6 +3370,7 @@ function addComputer($data) {
               .         "'" . $data["hostname"] . "', "
               .         "'" . $data["ipaddress"] . "', "
               .         "'" . $data["type"] . "', "
+              .         "$notes, "
               .         "'" . $data["provisioningid"] . "')";
        doQuery($query, 195);
 


Reply via email to