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 2014/10/27 18:09:11 UTC

svn commit: r1634601 - in /vcl/trunk/web: .ht-inc/requests.php .ht-inc/states.php js/requests.js

Author: jfthomps
Date: Mon Oct 27 17:09:11 2014
New Revision: 1634601

URL: http://svn.apache.org/r1634601
Log:
VCL-780 - combine new reservation and current reservations pages

requests.php:
-modified viewRequests: added continuation and dialog for displaying preview of click through agreement
-modified AJconnectRequest: changed link for previewing click through agreement to fetch agreement and display in dialog box
-added AJpreviewClickThrough

requests.js:
-modified checkTimeouts: use parseInt to convert nodes[i].value to int for comparison to nextcheck
-added previewClickThrough and previewClickThroughCB

states.php: added AJpreviewClickThrough

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

Modified: vcl/trunk/web/.ht-inc/requests.php
URL: http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/requests.php?rev=1634601&r1=1634600&r2=1634601&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/requests.php (original)
+++ vcl/trunk/web/.ht-inc/requests.php Mon Oct 27 17:09:11 2014
@@ -459,6 +459,9 @@ function viewRequests() {
 	$cont = addContinuationsEntry('AJviewRequests', array(), SECINDAY);
 	$text .= "<INPUT type=hidden id=resRefreshCont value=\"$cont\">\n";
 
+	$cont = addContinuationsEntry('AJpreviewClickThrough', array());
+	$text .= "<INPUT type=hidden id=previewclickthroughcont value=\"$cont\">\n";
+
 	$text .= "</div>\n";
 	if($mode != 'AJviewRequests') {
 		$text .= newReservationHTML();
@@ -848,6 +851,21 @@ function viewRequests() {
 		$text .= "   </div>\n";
 		$text .= "</div>\n";
 
+		$text .= "<div dojoType=dijit.Dialog\n";
+		$text .= "      id=\"clickthroughpreviewdlg\"\n";
+		$text .= "      duration=250\n";
+		$text .= "      draggable=true>\n";
+		$text .= "   <div id=\"clickthroughPreviewDlgContent\"></div>\n";
+		$text .= "   <div align=\"center\">\n";
+		$text .= "   <button dojoType=\"dijit.form.Button\">\n";
+		$text .= "     " . _("Close") . "\n";
+		$text .= "     <script type=\"dojo/method\" event=\"onClick\">\n";
+		$text .= "       dijit.byId('clickthroughpreviewdlg').hide();\n";
+		$text .= "     </script>\n";
+		$text .= "   </button>\n";
+		$text .= "   </div>\n";
+		$text .= "</div>\n";
+
 		print $text;
 	}
 	else {
@@ -4103,7 +4121,7 @@ function AJconnectRequest() {
 
 	if($requestData['forimaging']) {
 		$h .= _("<font color=red><big><strong>NOTICE:</strong> Later in this process, you must accept a ");
-		$h .= " <a href=\"" . BASEURL . SCRIPT . "?mode=imageClickThrough\">";
+		$h .= " <a href=\"" . BASEURL . SCRIPT . "?mode=viewRequests#\" onClick=\"previewClickThrough();\">";
 		$h .= _("click-through agreement</a> about software licensing.</big></font><br><br>\n");
 	}
 	$imagenotes = getImageNotes($requestData['reservations'][0]['imageid']);
@@ -4846,4 +4864,19 @@ function AJsubmitSetImageProduction() {
 	   . "resRefresh();";
 	print $a;
 }
+
+////////////////////////////////////////////////////////////////////////////////
+///
+/// \fn AJpreviewClickThrough()
+///
+/// \brief prompts user if really ready to set image to production
+///
+////////////////////////////////////////////////////////////////////////////////
+function AJpreviewClickThrough() {
+	global $clickThroughText;
+	$text = sprintf($clickThroughText, '');
+	$text = preg_replace("/(.{1,80}([ \n]|$))/", '\1<br>', $text);
+	$text = preg_replace("/<\/p>\n<br>/", '', $text);
+	sendJSON(array('text' => $text));
+}
 ?>

Modified: vcl/trunk/web/.ht-inc/states.php
URL: http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/states.php?rev=1634601&r1=1634600&r2=1634601&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/states.php (original)
+++ vcl/trunk/web/.ht-inc/states.php Mon Oct 27 17:09:11 2014
@@ -207,6 +207,7 @@ $noHTMLwrappers = array('sendRDPfile',
                         'AJupdateAllSettings',
                         'AJdeleteAffiliationSetting',
                         'AJaddAffiliationSetting',
+                        'AJpreviewClickThrough',
 );
 
 # main
@@ -236,6 +237,7 @@ $actions['mode']['AJsubmitRemoveRequest'
 $actions['mode']['AJconnectRequest'] = "AJconnectRequest";
 $actions['mode']['sendRDPfile'] = "sendRDPfile";
 $actions['mode']['AJcheckConnectTimeout'] = "AJcheckConnectTimeout";
+$actions['mode']['AJpreviewClickThrough'] = "AJpreviewClickThrough";
 #$actions['mode']['connectMindterm'] = "connectMindterm";
 #$actions['mode']['connectRDPapplet'] = "connectRDPapplet";
 $actions['pages']['AJnewRequest'] = "reservations";
@@ -258,6 +260,7 @@ $actions['pages']['AJsubmitRemoveRequest
 $actions['pages']['AJconnectRequest'] = "reservations";
 $actions['pages']['sendRDPfile'] = "reservations";
 $actions['pages']['AJcheckConnectTimeout'] = "reservations";
+$actions['pages']['AJpreviewClickThrough'] = "reservations";
 #$actions['pages']['connectMindterm'] = "currentReservations";
 #$actions['pages']['connectRDPapplet'] = "currentReservations";
 

Modified: vcl/trunk/web/js/requests.js
URL: http://svn.apache.org/viewvc/vcl/trunk/web/js/requests.js?rev=1634601&r1=1634600&r2=1634601&view=diff
==============================================================================
--- vcl/trunk/web/js/requests.js (original)
+++ vcl/trunk/web/js/requests.js Mon Oct 27 17:09:11 2014
@@ -1255,12 +1255,13 @@ function checkTimeouts() {
 	var tmp = new Date();
 	var now = (tmp.getTime() - tmp.getMilliseconds()) / 1000;
 	for(var i = 0; i < nodes.length; i++) {
-		if(nodes[i].value <= now) {
+		var testval = parseInt(nodes[i].value);
+		if(testval <= now) {
 			resRefresh();
 			break;
 		}
-		else if(nodes[i].value - now < nextcheck)
-			nextcheck = nodes[i].value - now;
+		else if(testval - now < nextcheck)
+			nextcheck = testval - now;
 	}
 	check_timeout_timer = setTimeout(checkTimeouts, nextcheck * 1000);
 }
@@ -1723,3 +1724,13 @@ function checkConnectTimeoutCB(data, ioA
 	}
 }
 
+function previewClickThrough() {
+	RPCwrapper({continuation: dojo.byId('previewclickthroughcont').value},
+	            previewClickThroughCB, 1);
+	return false;
+}
+
+function previewClickThroughCB(data, ioArgs) {
+	dojo.byId('clickthroughPreviewDlgContent').innerHTML = data.items.text;
+	dijit.byId('clickthroughpreviewdlg').show();
+}