You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vcl.apache.org by jf...@apache.org on 2010/08/05 21:54:16 UTC

svn commit: r982752 - in /incubator/vcl/trunk/web: .ht-inc/requests.php .ht-inc/utils.php js/requests.js

Author: jfthomps
Date: Thu Aug  5 19:54:16 2010
New Revision: 982752

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

utils.php:
-modified getDojoHTML - added FilteringSelect to newRequest, submitRequest, createSelectImage, submitCreateImage; changed updateWaitTime call in dojo's onload to be a setTimeout with a 1 sec wait
-fixed typo bug in getUserInfo and updated header to include $numeric

requests.php - changed calls to printSelectInput to be inline declarations of dojo filteringselects

js/requests.js - updated selectEnvironment to use dijit.byId for imagesel instead of dojo.byId

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

Modified: incubator/vcl/trunk/web/.ht-inc/requests.php
URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/requests.php?rev=982752&r1=982751&r2=982752&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/requests.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/requests.php Thu Aug  5 19:54:16 2010
@@ -102,10 +102,30 @@ function newReservation() {
 	print "<FORM action=\"" . BASEURL . SCRIPT . "\" method=post>\n";
 	// list of images
 	uasort($resources["image"], "sortKeepIndex");
-	if($imaging)
-		printSelectInput("imageid", $resources["image"], $imageid, 1, 0, 'imagesel', "onChange=\"updateWaitTime(1);\" tabIndex=1");
-	else
-		printSelectInput("imageid", $resources["image"], $imageid, 1, 0, 'imagesel', "onChange=\"selectEnvironment();\" tabIndex=1");
+	if($imaging) {
+		print "      <select dojoType=\"dijit.form.FilteringSelect\" id=imagesel ";
+		print "onChange=\"updateWaitTime(1);\" tabIndex=1 style=\"width: 400px\" ";
+		print "queryExpr=\"*\${0}*\" highlightMatch=\"all\" autoComplete=\"false\" ";
+		print "name=imageid>\n";
+		foreach($resources['image'] as $id => $image)
+			if($id == $imageid)
+				print "        <option value=\"$id\" selected>$image</option>\n";
+			else
+				print "        <option value=\"$id\">$image</option>\n";
+		print "      </select>\n";
+	}
+	else {
+		print "      <select dojoType=\"dijit.form.FilteringSelect\" id=imagesel ";
+		print "onChange=\"selectEnvironment();\" tabIndex=1 style=\"width: 400px\" ";
+		print "queryExpr=\"*\${0}*\" highlightMatch=\"all\" autoComplete=\"false\" ";
+		print "name=imageid>\n";
+		foreach($resources['image'] as $id => $image)
+			if($id == $imageid)
+				print "        <option value=\"$id\" selected>$image</option>\n";
+			else
+				print "        <option value=\"$id\">$image</option>\n";
+		print "      </select>\n";
+	}
 	print "<br><br>\n";
 
 	$imagenotes = getImageNotes($imageid);

Modified: incubator/vcl/trunk/web/.ht-inc/utils.php
URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/utils.php?rev=982752&r1=982751&r2=982752&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/utils.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/utils.php Thu Aug  5 19:54:16 2010
@@ -2838,11 +2838,13 @@ function processInputData($data, $type, 
 
 ////////////////////////////////////////////////////////////////////////////////
 ///
-/// \fn getUserInfo($id, $noupdate)
+/// \fn getUserInfo($id, $noupdate, $numeric)
 ///
 /// \param $id - unity ID for the user or user's id from database
 /// \param $noupdate - (optional, default=0) specify 1 to skip updating user's
 /// data if lastupdated timestamp is expired
+/// \param $numeric - (optional, default=0) 1 specifies $id corresponds to the
+/// id field from the user table; 0 otherwise
 ///
 /// \return 0 if fail to fetch data or $user - an array with these elements:\n
 /// \b unityid - unity ID for the user\n
@@ -2881,7 +2883,7 @@ function processInputData($data, $type, 
 ////////////////////////////////////////////////////////////////////////////////
 function getUserInfo($id, $noupdate=0, $numeric=0) {
 	$affilid = DEFAULT_AFFILID;
-	if(! $numeric)) {
+	if(! $numeric) {
 		$rc = getAffilidAndLogin($id, $affilid);
 		if($rc == -1)
 			return NULL;
@@ -8661,7 +8663,8 @@ function getDojoHTML($refresh) {
 		case 'submitRequest':
 		case 'createSelectImage':
 		case 'submitCreateImage':
-			$dojoRequires = array('dojo.parser');
+			$dojoRequires = array('dojo.parser',
+			                      'dijit.form.FilteringSelect');
 			break;
 		case 'viewRequests':
 			$dojoRequires = array('dojo.parser',
@@ -8815,7 +8818,7 @@ function getDojoHTML($refresh) {
 			}
 			# TODO check flow of which modes should call updateWaitTime
 			if($mode == 'newRequest')
-				$rt .= "     updateWaitTime(0);\n";
+				$rt .= "     setTimeout(function() {updateWaitTime(0);}, 1000);\n";
 			$rt .= "   });\n";
 			$rt .= "</script>\n";
 			return $rt;

Modified: incubator/vcl/trunk/web/js/requests.js
URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/web/js/requests.js?rev=982752&r1=982751&r2=982752&view=diff
==============================================================================
--- incubator/vcl/trunk/web/js/requests.js (original)
+++ incubator/vcl/trunk/web/js/requests.js Thu Aug  5 19:54:16 2010
@@ -26,7 +26,7 @@ function generalReqCB(data, ioArgs) {
 }
 
 function selectEnvironment() {
-	var imageid = dojo.byId('imagesel').value;
+	var imageid = dijit.byId('imagesel').value;
 	if(maxTimes[imageid])
 		setMaxRequestLength(maxTimes[imageid]);
 	else
@@ -48,7 +48,7 @@ function updateWaitTime(cleardesc) {
 		dojo.byId('waittime').className = 'hidden';
 		desconly = 1;
 	}
-	var imageid = dojo.byId('imagesel').value;
+	var imageid = dijit.byId('imagesel').value;
 	if(dojo.byId('reqlength'))
 		var length = dojo.byId('reqlength').value;
 	else