Author: jfthomps
Date: Mon May  7 17:19:28 2012
New Revision: 1335135

URL: http://svn.apache.org/viewvc?rev=1335135&view=rev
Log:
VCL-576
Finalizing for 2.3 release

index.php: changed version number from 2.2.1 to 2.3

utils.php:
-modified checkAccess - changed XMLRPC error to give failure to connect to auth 
server if ldap_bind fails; added code that allows access to Current 
Reservations page if the user has any reservations even if the user does not 
have access to make them
-modified getUsersLastImage - order by id instead of start so that the most 
recently placed reservation gets picked up instead of the one with the greatest 
start time which would pick up older future reservations
-modified printHTMLHeader - added check for $contdata being array
-modified getNavMenu - show user Current Reservations link if user has any 
reservations even if user does not have access to make reservations

userpreferences.php: modified userpreferences - removed "(Vista only)" from 32 
bit color depth option

serverprofiles.php: modified processProfileInput - validate specified user 
groups for server profiles against any user groups instead of just those the 
user has access to edit

requests.php: modified AJupdateWaitTime - added javascript to save the text of 
the submit button so that it can be restored to what it was before changing it 
to "View Available Times"

images.php: modified subimageDialogContent, AJaddSubimage, and AJremSubimage - 
changed userimages key in continuation to userimageids

groups.php: modified viewGroups - added code to specify the datagrid column 
widths based on px for IE and em for all other browsers

blockallocations.php:
-modified blockAllocationForm - added a filter to the dijit NumberSpinner 
because IE was jumping to fractions when using the mouse wheel
-modified getChartHTML - added width and height to enclosing div; changed 
maxLabelSize to 85 and added maxLabelCharCount to allow the horizontal axis 
labels to display better

shibauth/index.php: changed cookie duration from "SECINDAY * 31" to 2678400 
because SECINDAY is not yet defined

blockallocations.js:
-modified updateAllocatedMachinesCB - added a hack that sets height of charts 
so that labels will display better
-added machinecntfilter

requests.js:
-added global resbtntxt
-modified selectLater - if resbtntxt is set to something other than an empty 
string, set the submit button text to it; otherwise set it to "Create 
Reservation"; this was causing a problem when the button text initially said 
"Create Imaging Reservation"
-modified showRDPbutton - changed wait time from 5 seconds to 2

groups.js:
-modified buildUserFilterStores and buildResourceFilterStores - changed code 
that was using Object.keys - IE does not (always?) suppor this
-modified resourcegroupGridFilter - changed how showtype is set to work better 
with IE

Modified:
    incubator/vcl/trunk/web/.ht-inc/blockallocations.php
    incubator/vcl/trunk/web/.ht-inc/groups.php
    incubator/vcl/trunk/web/.ht-inc/images.php
    incubator/vcl/trunk/web/.ht-inc/requests.php
    incubator/vcl/trunk/web/.ht-inc/serverprofiles.php
    incubator/vcl/trunk/web/.ht-inc/userpreferences.php
    incubator/vcl/trunk/web/.ht-inc/utils.php
    incubator/vcl/trunk/web/index.php
    incubator/vcl/trunk/web/js/blockallocations.js
    incubator/vcl/trunk/web/js/groups.js
    incubator/vcl/trunk/web/js/requests.js
    incubator/vcl/trunk/web/shibauth/index.php

Modified: incubator/vcl/trunk/web/.ht-inc/blockallocations.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/blockallocations.php?rev=1335135&r1=1335134&r2=1335135&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/blockallocations.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/blockallocations.php Mon May  7 17:19:28 
2012
@@ -191,7 +191,7 @@ function blockAllocationForm() {
        print "    <td>\n";
        print "      <input dojoType=\"dijit.form.NumberSpinner\" 
value=\"{$data['seats']}\" ";
        print "smallDelta=1 largeDelta=5 constraints=\"{min:" . 
MIN_BLOCK_MACHINES . ", max:";
-       print MAX_BLOCK_MACHINES . "}\" id=machinecnt required=\"true\" 
style=\"width: 70px\"/>\n";
+       print MAX_BLOCK_MACHINES . "}\" id=machinecnt required=\"true\" 
style=\"width: 70px\" filter=\"machinecntfilter\"/>\n";
        print "      <img src=\"images/helpicon.png\" id=\"seathelp\" />\n";
        print "    </td>\n";
        print "  </tr>\n";
@@ -3485,7 +3485,7 @@ function viewBlockAllocatedMachines() {
 ///
 
////////////////////////////////////////////////////////////////////////////////
 function getChartHTML($id) {
-       $txt  = "<div class=\"dashwidget\">\n";
+       $txt  = "<div style=\"width:500px; height: 320px;\">\n";
        $txt .= "<div dojoType=\"dojox.charting.widget.Chart2D\" id=\"$id\"\n";
        $txt .= "     theme=\"dojox.charting.themes.ThreeD\"\n";
        $txt .= "     style=\"width: 500px; height: 300px;\">\n";
@@ -3495,7 +3495,8 @@ function getChartHTML($id) {
                $txt .= "     labelFunc=\"timestampToTimeBare\"\n";
        elseif($id == 'allocatedVirtualMachines')
                $txt .= "     labelFunc=\"timestampToTimeVirtual\"\n";
-       $txt .= "     maxLabelSize=\"35\"\n";
+       $txt .= "     maxLabelSize=\"85\"\n";
+       $txt .= "     maxLabelCharCount=\"8\"\n";
        $txt .= "     rotation=\"-90\"\n";
        $txt .= "     majorTickStep=\"4\"\n";
        $txt .= "     minorTickStep=\"1\">\n";

Modified: incubator/vcl/trunk/web/.ht-inc/groups.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/groups.php?rev=1335135&r1=1335134&r2=1335135&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/groups.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/groups.php Mon May  7 17:19:28 2012
@@ -142,18 +142,22 @@ function viewGroups() {
        print "height: 580px;\" query=\"{type: new 
RegExp('normal|federated|courseroll')}\">\n";
        print "<thead>\n";
        print "<tr>\n";
-       print "<th field=\"id\" width=\"4.5em\" 
formatter=\"fmtUserGroupDeleteBtn\">&nbsp;</th>\n";
-       print "<th field=\"id\" width=\"3em\" 
formatter=\"fmtUserGroupEditBtn\">&nbsp;</th>\n";
-       print "<th field=\"name\" width=\"17em\">Name</th>\n";
-       print "<th field=\"owner\" width=\"12em\">Owner</th>\n";
+       if(preg_match('/MSIE/i', $_SERVER['HTTP_USER_AGENT']))
+               $w = array('54px', '38px', '200px', '142px', '65px', '142px', 
'59px', '58px', '63px', '73px');
+       else
+               $w = array('4.5em', '3em', '17em', '12em', '5em', '12em', 
'5em', '5em', '5.6em', '6.3em');
+       print "<th field=\"id\" width=\"{$w[0]}\" 
formatter=\"fmtUserGroupDeleteBtn\">&nbsp;</th>\n";
+       print "<th field=\"id\" width=\"{$w[1]}\" 
formatter=\"fmtUserGroupEditBtn\">&nbsp;</th>\n";
+       print "<th field=\"name\" width=\"{$w[2]}\">Name</th>\n";
+       print "<th field=\"owner\" width=\"{$w[3]}\">Owner</th>\n";
        if($showusergrouptype)
-               print "<th field=\"prettytype\" width=\"5em\">Type</th>\n";
-       print "<th field=\"editgroup\" width=\"12em\">Editable by</th>\n";
-       print "<th field=\"initialmaxtime\" width=\"5em\" 
formatter=\"fmtDuration\">Initial Max<br>Time</th>\n";
-       print "<th field=\"totalmaxtime\" width=\"5em\" 
formatter=\"fmtDuration\">Total Max<br>Time</th>\n";
-       print "<th field=\"maxextendtime\" width=\"5.6em\" 
formatter=\"fmtDuration\">Max Extend<br>Time</th>\n";
+               print "<th field=\"prettytype\" width=\"{$w[4]}\">Type</th>\n";
+       print "<th field=\"editgroup\" width=\"{$w[5]}\">Editable by</th>\n";
+       print "<th field=\"initialmaxtime\" width=\"{$w[6]}\" 
formatter=\"fmtDuration\">Initial Max<br>Time</th>\n";
+       print "<th field=\"totalmaxtime\" width=\"{$w[7]}\" 
formatter=\"fmtDuration\">Total Max<br>Time</th>\n";
+       print "<th field=\"maxextendtime\" width=\"{$w[8]}\" 
formatter=\"fmtDuration\">Max Extend<br>Time</th>\n";
        if(checkUserHasPerm('Set Overlapping Reservation Count'))
-               print "<th field=\"overlapResCount\" 
width=\"6.3em\">Max<br>Overlapping<br>Reservations</th>\n";
+               print "<th field=\"overlapResCount\" 
width=\"{$w[9]}\">Max<br>Overlapping<br>Reservations</th>\n";
        print "</tr>\n";
        print "</thead>\n";
        print "</table>\n";
@@ -259,12 +263,17 @@ function viewGroups() {
        print "height: 580px;\" query=\"{type: new RegExp('.*')}\">\n";
        print "<thead>\n";
        print "<tr>\n";
-       print "<th field=\"id\" width=\"4.5em\" 
formatter=\"fmtResourceGroupDeleteBtn\">&nbsp;</th>\n";
-       print "<th field=\"id\" width=\"3em\" 
formatter=\"fmtResourceGroupEditBtn\">&nbsp;</th>\n";
-       print "<th field=\"type\" width=\"9em\">Type</th>\n";
-       print "<th field=\"name\" width=\"20em\">Name</th>\n";
-       print "<th field=\"owninggroup\" width=\"20em\">Owning User 
Group</th>\n";
-       print "<th field=\"id\" width=\"1.2em\" formatter=\"fmtGroupInfo\">\n";
+       if(preg_match('/MSIE/i', $_SERVER['HTTP_USER_AGENT']))
+               $w = array('54px', '38px', '108px', '240px', '250px', '24px');
+       else
+               $w = array('4.5em', '3em', '9em', '20em', '21em', '1.6em');
+
+       print "<th field=\"id\" width=\"{$w[0]}\" 
formatter=\"fmtResourceGroupDeleteBtn\">&nbsp;</th>\n";
+       print "<th field=\"id\" width=\"{$w[1]}\" 
formatter=\"fmtResourceGroupEditBtn\">&nbsp;</th>\n";
+       print "<th field=\"type\" width=\"{$w[2]}\">Type</th>\n";
+       print "<th field=\"name\" width=\"{$w[3]}\">Name</th>\n";
+       print "<th field=\"owninggroup\" width=\"{$w[4]}\">Owning User 
Group</th>\n";
+       print "<th field=\"id\" width=\"{$w[5]}\" 
formatter=\"fmtGroupInfo\">\n";
        print "<a onmouseover=\"mouseoverHelp();\" ";
        print "onmouseout=\"showGroupInfoCancel(0);\" id=\"listicon0\">\n";
        print "<img alt=\"\" src=\"images/list.gif\"></a></th>\n";

Modified: incubator/vcl/trunk/web/.ht-inc/images.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/images.php?rev=1335135&r1=1335134&r2=1335135&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/images.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/images.php Mon May  7 17:19:28 2012
@@ -1568,7 +1568,7 @@ function subimageDialogContent() {
        $data = array('imageid' => $imageid,
                      'adminids' => $adminids,
                      'imagemetaid' => $image['imagemetaid'],
-                     'userimages' => $resources['image'],
+                     'userimageids' => array_keys($resources['image']),
                      'subimages' => $image['subimages']);
        $cont = addContinuationsEntry('AJaddSubimage', $data, SECINDAY, 1, 0);
        $content .= "<INPUT type=hidden id=addsubimagecont value=\"$cont\">";
@@ -1589,7 +1589,7 @@ function subimageDialogContent() {
 function AJaddSubimage() {
        $imageid = getContinuationVar('imageid');
        $adminids = getContinuationVar('adminids');
-       $userimages = getContinuationVar('userimages');
+       $userimageids = getContinuationVar('userimageids');
        $subimages = getContinuationVar('subimages');
        $imagemetaid = getContinuationVar('imagemetaid');
        if(! in_array($imageid, $adminids)) {
@@ -1599,7 +1599,7 @@ function AJaddSubimage() {
                return;
        }
        $newid = processInputVar('imageid', ARG_NUMERIC);
-       if(! array_key_exists($newid, $userimages)) {
+       if(! in_array($newid, $userimageids)) {
                $arr = array('error' => 'nosubimageaccess',
                        'msg' => 'You do not have access to add this 
subimage.');
                sendJSON($arr);
@@ -1632,7 +1632,7 @@ function AJaddSubimage() {
        $data = array('imageid' => $imageid,
                      'adminids' => $adminids,
                      'imagemetaid' => $imagemetaid,
-                     'userimages' => $userimages,
+                     'userimageids' => $userimageids,
                      'subimages' => $subimages);
        $addcont = addContinuationsEntry('AJaddSubimage', $data, SECINDAY, 1, 
0);
        $remcont = addContinuationsEntry('AJremSubimage', $data, SECINDAY, 1, 
0);
@@ -1655,7 +1655,7 @@ function AJaddSubimage() {
 function AJremSubimage() {
        $imageid = getContinuationVar('imageid');
        $adminids = getContinuationVar('adminids');
-       $userimages = getContinuationVar('userimages');
+       $userimageids = getContinuationVar('userimageids');
        $subimages = getContinuationVar('subimages');
        $imagemetaid = getContinuationVar('imagemetaid');
        if(! in_array($imageid, $adminids)) {
@@ -1715,7 +1715,7 @@ function AJremSubimage() {
        $data = array('imageid' => $imageid,
                      'adminids' => $adminids,
                      'imagemetaid' => $imagemetaid,
-                     'userimages' => $userimages,
+                     'userimageids' => $userimageids,
                      'subimages' => $subimages);
        $addcont = addContinuationsEntry('AJaddSubimage', $data, SECINDAY, 1, 
0);
        $remcont = addContinuationsEntry('AJremSubimage', $data, SECINDAY, 1, 
0);

Modified: incubator/vcl/trunk/web/.ht-inc/requests.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/requests.php?rev=1335135&r1=1335134&r2=1335135&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/requests.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/requests.php Mon May  7 17:19:28 2012
@@ -307,7 +307,11 @@ function AJupdateWaitTime() {
                        print "dojo.byId('suggestcont').value = 'cluster';";
                else
                        print "dojo.byId('suggestcont').value = '$cont';";
-               print "if(dojo.byId('newsubmit')) dojo.byId('newsubmit').value 
= _('View Available Times');";
+               print "if(dojo.byId('newsubmit')) {";
+               print "if(dojo.byId('newsubmit').value != _('View Available 
Times')) ";
+               print "resbtntxt = dojo.byId('newsubmit').value; ";
+               print "dojo.byId('newsubmit').value = _('View Available 
Times');";
+               print "}";
        }
        print "dojo.byId('waittime').innerHTML = ";
        if($rc == -2)

Modified: incubator/vcl/trunk/web/.ht-inc/serverprofiles.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/serverprofiles.php?rev=1335135&r1=1335134&r2=1335135&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/serverprofiles.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/serverprofiles.php Mon May  7 17:19:28 2012
@@ -1165,22 +1165,23 @@ function processProfileInput() {
                return $err;
        }
 
-       $usergroups = getUserEditGroups($user['id']);
-       $extraadmingroups = getServerProfileGroups($user['id'], 'admin');
+       $usergroups = getUserGroups();
+       /*$usergroups = getUserEditGroups($user['id']);
+       $extraadmingroups = getServerProfileGroups($user['id'], 'admin');*/
        if($ret['admingroupid'] == 0)
                $ret['admingroupid'] = 'NULL';
-       elseif(! array_key_exists($ret['admingroupid'], $usergroups) &&
-              ! array_key_exists($ret['admingroupid'], $extraadmingroups)) {
+       elseif(! array_key_exists($ret['admingroupid'], $usergroups) /*&&
+              ! array_key_exists($ret['admingroupid'], $extraadmingroups)*/) {
           $err['msg'] = "Invalid Admin User Group selected";
                $err['field'] = 'admingroupid';
                $err['error'] = 1;
                return $err;
        }
-       $extralogingroups = getServerProfileGroups($user['id'], 'login');
+       #$extralogingroups = getServerProfileGroups($user['id'], 'login');
        if($ret['logingroupid'] == 0)
                $ret['logingroupid'] = 'NULL';
-       elseif(! array_key_exists($ret['logingroupid'], $usergroups) &&
-              ! array_key_exists($ret['logingroupid'], $extralogingroups)) {
+       elseif(! array_key_exists($ret['logingroupid'], $usergroups) /*&&
+              ! array_key_exists($ret['logingroupid'], $extralogingroups)*/) {
           $err['msg'] = "Invalid Access User Group selected";
                $err['field'] = 'logingroupid';
                $err['error'] = 1;

Modified: incubator/vcl/trunk/web/.ht-inc/userpreferences.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/userpreferences.php?rev=1335135&r1=1335134&r2=1335135&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/userpreferences.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/userpreferences.php Mon May  7 17:19:28 2012
@@ -204,8 +204,7 @@ function userpreferences() {
        print "        <TR>\n";
        print _("          <TH align=right>Color Depth:</TH>\n");
        print "          <TD>\n";
-       #$colordepth = array("8" => "8", "16" => "16", "24" => "24");
-       $colordepth = array("8" => "8", "16" => "16", "24" => "24", "32" => "32 
(Vista only)");
+       $colordepth = array("8" => "8", "16" => "16", "24" => "24", "32" => 
"32");
        printSelectInput("bpp", $colordepth, $data["bpp"]);
        print "          </TD>\n";
        print "          <TD></TD>\n";

Modified: incubator/vcl/trunk/web/.ht-inc/utils.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/utils.php?rev=1335135&r1=1335134&r2=1335135&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/utils.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/utils.php Mon May  7 17:19:28 2012
@@ -377,7 +377,7 @@ function checkAccess() {
                                                $res = ldap_bind($ds);
                                        if(! $res) {
                                                addLoginLog($user['unityid'], 
$authtype, $user['affiliationid'], 0);
-                                               printXMLRPCerror(3);   # access 
denied
+                                               printXMLRPCerror(5);    # 
failed to connect to auth server
                                                dbDisconnect();
                                                exit;
                                        }
@@ -472,8 +472,10 @@ function checkAccess() {
                                # check that user has access to this area
                                switch($mode) {
                                        case 'viewRequests':
+                                               $requests = 
getUserRequests("all", $user["id"]);
                                                if(! in_array("imageCheckOut", 
$user["privileges"]) &&
-                                                       ! 
in_array("imageAdmin", $user["privileges"])) {
+                                                       ! 
in_array("imageAdmin", $user["privileges"]) &&
+                                                  ! count($requests)) {
                                                        $mode = "";
                                                        $actionFunction = 
"main";
                                                        return;
@@ -2906,7 +2908,7 @@ function getUsersLastImage($userid) {
        $query = "SELECT imageid "
               . "FROM log "
               . "WHERE userid = $userid "
-              . "ORDER BY start DESC "
+              . "ORDER BY id DESC "
               . "LIMIT 1";
        $qh = doQuery($query, 101);
        if($row = mysql_fetch_assoc($qh))
@@ -10300,7 +10302,8 @@ function printHTMLHeader() {
                $HTMLheader .= getHeader($refresh);
 
        if(! in_array($mode, $noHTMLwrappers) &&
-          (! array_key_exists('noHTMLwrappers', $contdata) ||
+               (! is_array($contdata) ||
+           ! array_key_exists('noHTMLwrappers', $contdata) ||
            $contdata['noHTMLwrappers'] == 0)) {
                print $HTMLheader;
                if($mode != 'inmaintenance')
@@ -10326,8 +10329,10 @@ function printHTMLHeader() {
 function getNavMenu($inclogout, $inchome, $homeurl=HOMEURL) {
        global $user, $docreaders, $authed, $userlookupUsers;
        global $mode;
-       if($authed && $mode != 'expiredemouser')
+       if($authed && $mode != 'expiredemouser') {
                $computermetadata = getUserComputerMetaData();
+               $requests = getUserRequests("all", $user["id"]);
+       }
        else
                $computermetadata = array("platforms" => array(),
                                          "schedules" => array());
@@ -10340,7 +10345,8 @@ function getNavMenu($inclogout, $inchome
        $rt .= "<a href=\"" . BASEURL . SCRIPT . "?mode=newRequest\">";
        $rt .= _("New Reservation</a></li>\n");
        if(in_array("imageCheckOut", $user["privileges"]) ||
-               in_array("imageAdmin", $user["privileges"])) {
+               in_array("imageAdmin", $user["privileges"]) ||
+          count($requests)) {
                $rt .= menulistLI('currentReservations');
                $rt .= "<a href=\"" . BASEURL . SCRIPT . 
"?mode=viewRequests\">";
                $rt .= _("Current Reservations</a></li>\n");
@@ -10807,7 +10813,7 @@ function getDojoHTML($refresh) {
                        $rt .= "<style type=\"text/css\">\n";
                        $rt .= "   @import 
\"themes/$skin/css/dojo/$skin.css\";\n";
                        $rt .= "</style>\n";
-         $rt .= "<script type=\"text/javascript\" 
src=\"js/requests.js\"></script>\n";
+                       $rt .= "<script type=\"text/javascript\" 
src=\"js/requests.js\"></script>\n";
                        $rt .= "<script type=\"text/javascript\" 
src=\"dojo/dojo/dojo.js\"\n";
                        $rt .= "   djConfig=\"parseOnLoad: true, locale: 
'$jslocale'\">\n";
                        $rt .= "</script>\n";

Modified: incubator/vcl/trunk/web/index.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/index.php?rev=1335135&r1=1335134&r2=1335135&view=diff
==============================================================================
--- incubator/vcl/trunk/web/index.php (original)
+++ incubator/vcl/trunk/web/index.php Mon May  7 17:19:28 2012
@@ -16,7 +16,7 @@
   limitations under the License.
 */
 
-# ASF VCL v2.2.1
+# ASF VCL v2.3
 
 @include_once("fckeditor/fckeditor.php");
 require_once(".ht-inc/conf.php");

Modified: incubator/vcl/trunk/web/js/blockallocations.js
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/js/blockallocations.js?rev=1335135&r1=1335134&r2=1335135&view=diff
==============================================================================
--- incubator/vcl/trunk/web/js/blockallocations.js (original)
+++ incubator/vcl/trunk/web/js/blockallocations.js Mon May  7 17:19:28 2012
@@ -1342,6 +1342,10 @@ function updateAllocatedMachinesCB(data,
                dojo.byId('totalvirtual').innerHTML = _('Total online: ') + 
data.items.virtual.total;
        else
                dojo.byId('totalvirtual').innerHTML = '';
+       dojo.byId('allocatedBareMachines').style.height = '320px';
+       
dojo.byId('allocatedBareMachines').childNodes[0].attributes[1].nodeValue = 
'320';
+       dojo.byId('allocatedVirtualMachines').style.height = '320px';
+       
dojo.byId('allocatedVirtualMachines').childNodes[0].attributes[1].nodeValue = 
'320';
 }
 
 function timestampToTimeBare(val) {
@@ -1359,3 +1363,7 @@ function timestampToTimeVirtual(val) {
                var data = 
dijit.byId('allocatedVirtualMachines').chart.labeldata;
        return data[val]['text'];
 }
+
+function machinecntfilter(val) {
+       return parseInt(val);
+}

Modified: incubator/vcl/trunk/web/js/groups.js
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/js/groups.js?rev=1335135&r1=1335134&r2=1335135&view=diff
==============================================================================
--- incubator/vcl/trunk/web/js/groups.js (original)
+++ incubator/vcl/trunk/web/js/groups.js Mon May  7 17:19:28 2012
@@ -29,7 +29,7 @@ function getGroupInfo(groupid) {
                handleAs: "json",
                error: errorHandler,
                content: {continuation: cont,
-                                        groupid: groupid},
+                         groupid: groupid},
                timeout: 15000
        });
 }
@@ -115,7 +115,7 @@ function usergroupGridFilter() {
        if(owner == 'all')
                owner = '*';
 
-   var query = new Array();
+       var query = new Array();
        if(! dijit.byId('shownormal') &&
           ! dijit.byId('showfederated') &&
           ! dijit.byId('showcourseroll')) {
@@ -129,9 +129,9 @@ function usergroupGridFilter() {
                if(dijit.byId('showcourseroll').get('value'))
                        query.push('courseroll');
        }
-   var type = query.join('|');
-   if(query.length == 0)
-      type = 'foo';
+       var type = query.join('|');
+       if(query.length == 0)
+               type = 'foo';
 
        var editid = dijit.byId('editgroupfilter').get('value');
        if(editid == 0)
@@ -139,7 +139,7 @@ function usergroupGridFilter() {
        if(editid == -1)
                editid = 'NULL';
 
-   usergroupgrid.setQuery({type: new RegExp(type),
+       usergroupgrid.setQuery({type: new RegExp(type),
                                owner: owner,
                                name: new RegExp(name, 'i'),
                                groupaffiliationid: affilid,
@@ -168,8 +168,16 @@ function buildUserFilterStores() {
                                usergroupstore.editgroups[editid] = edit;
                },
                onComplete: function() {
-                       if(Object.keys(usergroupstore.owners).length == 0)
+                       var cnt = 0;
+                       for(var p in usergroupstore.owners) {
+                               if(usergroupstore.owners.hasOwnProperty(p))
+                                       cnt = 1;
+                                       break;
+                       }
+                       if(cnt == 0) {
                                dojo.byId('usergroupcontainer').innerHTML = 
"You do not have access to any user groups.";
+                               return;
+                       }
                        var newitem = {};
                        newitem = {'id': '0', 'name': ' Any'};
                        affiliationstore.newItem(newitem);
@@ -258,22 +266,22 @@ function resourcegroupGridFilter() {
        if(dojo.byId('resnamefilter') && 
dojo.byId('resnamefilter').value.length)
                name += dojo.byId('resnamefilter').value + '.*';
 
-   var query = new Array();
+       var query = new Array();
        var nodes = dojo.query('label', dojo.byId('resourcetypes'));
        for(var i = 0; i < nodes.length; i++) {
-               var showtype = nodes[i].getAttribute('for');
+               var showtype = 'show' + nodes[i].innerHTML;
                if(dijit.byId(showtype) && dijit.byId(showtype).get('value'))
                        query.push(nodes[i].innerHTML);
        }
-   var restype = query.join('|');
-   if(query.length == 0)
-      restype = 'foo';
+       var restype = query.join('|');
+       if(query.length == 0)
+               restype = 'foo';
 
        var owninggroupid = dijit.byId('owninggroupfilter').get('value');
        if(owninggroupid == 0)
                owninggroupid = '*';
 
-   resourcegroupgrid.setQuery({type: new RegExp(restype),
+       resourcegroupgrid.setQuery({type: new RegExp(restype),
                                    name: new RegExp(name, 'i'),
                                    owninggroupid: owninggroupid});
 }
@@ -293,8 +301,16 @@ function buildResourceFilterStores() {
                        resourcegroupstore.ownergroups[ownerid] = owner;
                },
                onComplete: function() {
-                       if(Object.keys(resourcegroupstore.ownergroups).length 
== 0)
+                       var cnt = 0;
+                       for(var p in resourcegroupstore.ownergroups) {
+                               
if(resourcegroupstore.ownergroups.hasOwnProperty(p))
+                                       cnt = 1;
+                                       break;
+                       }
+                       if(cnt == 0) {
                                dojo.byId('resourcegroupcontainer').innerHTML = 
"You do not have access to any resource groups.";
+                               return;
+                       }
                        var newitem = {};
                        newitem = {'id': '0', 'name': ' Any'};
                        owninggroupstore.newItem(newitem);

Modified: incubator/vcl/trunk/web/js/requests.js
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/js/requests.js?rev=1335135&r1=1335134&r2=1335135&view=diff
==============================================================================
--- incubator/vcl/trunk/web/js/requests.js (original)
+++ incubator/vcl/trunk/web/js/requests.js Mon May  7 17:19:28 2012
@@ -16,6 +16,7 @@
 */
 var resSubmitted = 0;
 var suggestTimeData = {}
+var resbtntxt = '';
 
 function RPCwrapper(data, CB, dojson) {
        if(dojson) {
@@ -157,8 +158,12 @@ function useSuggestedSlot() {
 
 function selectLater() {
        dojo.byId('laterradio').checked = true;
-       if(dojo.byId('newsubmit'))
-               dojo.byId('newsubmit').value = 'Create Reservation';
+       if(dojo.byId('newsubmit')) {
+               if(resbtntxt != '')
+                       dojo.byId('newsubmit').value = resbtntxt;
+               else
+                       dojo.byId('newsubmit').value = _('Create Reservation');
+       }
        dojo.byId('waittime').innerHTML = '';
 }
 
@@ -751,7 +756,7 @@ function showRDPbutton() {
        // submitted by Gerhard Harti from ODU
        if(! dojo.byId('counterdiv') || ! dojo.byId('connectdiv'))
                return;
-       var timeInterval = 5;
+       var timeInterval = 2;
        if(typeof timeInterval === 'undefined' || parseInt(timeInterval) <= 0) {
                timeInterval = 1
        }

Modified: incubator/vcl/trunk/web/shibauth/index.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/shibauth/index.php?rev=1335135&r1=1335134&r2=1335135&view=diff
==============================================================================
--- incubator/vcl/trunk/web/shibauth/index.php (original)
+++ incubator/vcl/trunk/web/shibauth/index.php Mon May  7 17:19:28 2012
@@ -242,10 +242,10 @@ switch($affil) {
        case 'Example1':
        case 'EXAMPLE2':
                $skin = strtoupper($affil);
-               setcookie("VCLSKIN", $skin, (time() + (SECINDAY * 31)), "/", 
COOKIEDOMAIN);
+               setcookie("VCLSKIN", $skin, (time() + 2678400), "/", 
COOKIEDOMAIN);
                break;
        default:
-               setcookie("VCLSKIN", "default", (time() + (SECINDAY * 31)), 
"/", COOKIEDOMAIN);
+               setcookie("VCLSKIN", "default", (time() + 2678400), "/", 
COOKIEDOMAIN);
 }
 header("Location: " . BASEURL . "/");
 dbDisconnect();


Reply via email to