Author: jfthomps
Date: Mon Apr 20 19:00:20 2009
New Revision: 766797

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

added modified version of patch submitted by Nathan Dawson
modified viewRequests to not print the Create Image button unless the 
reservation has current state or last state as inuse

modified printEditNewUpdate to return if reservation doesn't have current state 
or last state as inuse

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

Modified: incubator/vcl/trunk/web/.ht-inc/requests.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/requests.php?rev=766797&r1=766796&r2=766797&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/requests.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/requests.php Mon Apr 20 19:00:20 2009
@@ -1640,13 +1640,20 @@
                                $text .= "      </FORM>\n";
                                $text .= "    </TD>\n";
                                if($requests[$i]['forimaging']) {
+                                       # this is the imaging case, need to do 
sanity check here for if the request
+                                       #   state currstateid or laststateid 
are "inuse", otherwise disable out the
+                                       #   create image button                 
                
                                        $noedit = 1;
                                        $text .= "    <TD>\n";
-                                       $text .= "      <FORM action=\"" . 
BASEURL . SCRIPT . "\" method=post>\n";
-                                       $cont = 
addContinuationsEntry('startImage', $cdata);
-                                       $text .= "      <INPUT type=hidden 
name=continuation value=\"$cont\">\n";
-                                       $text .= "      <INPUT type=submit 
value=\"Create\nImage\">\n";
-                                       $text .= "      </FORM>\n";
+                                       if($requests[$i]['currstateid'] == 8 || 
$requests[$i]['laststateid'] == 8) {
+                                               # the user has connected 
successfully so we will allow create image button
+                                               #   to be displayed
+                                               $text .= "      <FORM 
action=\"" . BASEURL . SCRIPT . "\" method=post>\n";
+                                               $cont = 
addContinuationsEntry('startImage', $cdata);
+                                               $text .= "      <INPUT 
type=hidden name=continuation value=\"$cont\">\n";
+                                               $text .= "      <INPUT 
type=submit value=\"Create\nImage\">\n";
+                                               $text .= "      </FORM>\n";
+                                       }
                                        $text .= "    </TD>\n";
                                        $text .= "    <TD>\n";
                                        $text .= "      <FORM action=\"" . 
BASEURL . SCRIPT . "\" method=post>\n";
@@ -2543,6 +2550,10 @@
        # if already an imaging reservation, don't display update info here
        if($request['forimaging'])
                return;
+       
+       # don't allow save/update unless reservation has made inuse state
+       if($request['stateid'] != 8 && $request['laststateid'] != 8)
+               return;
 
        $resources = getUserResources(array("imageAdmin"));
        if(! array_key_exists($res['imageid'], $resources['image']))


Reply via email to