Author: jfthomps
Date: Fri Oct 24 14:58:09 2014
New Revision: 1634070

URL: http://svn.apache.org/r1634070
Log:
VCL-780 - combine new reservation and current reservations pages
VCL-776 - rework resource code to have a base class for all resources and 
inheriting classes for each resource type

requests.php: modified viewRequests: moved commands that run when "I do not 
agree" button clicked to a function connected to when the dialog is hidden

resource.php: modified AJstartImage: tell getImageRevisions to included deleted 
revisions when getting data; helps to handle case where a capture has already 
started which would have the deleted flag set on the image revision

image.js: created hideClickThroughDlg: this is called when clickthrough dialog 
is hidden; there was a problem where the circle/X button could be clicked to 
hide the dialog which would leave the comments dialog open; clicking the Submit 
button in that dialog at this point caused the request to be updated to the 
imaging state and a new entry created in the imagerevision table; moving things 
to run when the dialog is hidden causes thing to properly get cleared/cleaned 
up when the circle/X button is clicked instead of the "I do not agree" button

Modified:
    vcl/trunk/web/.ht-inc/requests.php
    vcl/trunk/web/.ht-inc/resource.php
    vcl/trunk/web/js/resources/image.js

Modified: vcl/trunk/web/.ht-inc/requests.php
URL: 
http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/requests.php?rev=1634070&r1=1634069&r2=1634070&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/requests.php (original)
+++ vcl/trunk/web/.ht-inc/requests.php Fri Oct 24 14:58:09 2014
@@ -827,6 +827,9 @@ function viewRequests() {
                $text .= "      id=\"clickthroughdlg\"\n";
                $text .= "      duration=250\n";
                $text .= "      draggable=true>\n";
+               $text .= "    <script type=\"dojo/connect\" event=onHide>\n";
+               $text .= "      hideClickThroughDlg();\n";
+               $text .= "    </script>\n";
                $text .= "   <div id=\"clickthroughDlgContent\">\n";
                $text .= "   </div>\n";
                $text .= "   <div align=\"center\" id=\"imagebtns\">\n";
@@ -840,8 +843,6 @@ function viewRequests() {
                $text .= "     " . _("I do not agree") . "\n";
                $text .= "     <script type=\"dojo/method\" 
event=\"onClick\">\n";
                $text .= "       dijit.byId('clickthroughdlg').hide();\n";
-               $text .= "       dijit.byId('addeditdlg').hide();\n";
-               $text .= "       dijit.byId('updateimagedlg').hide();\n";
                $text .= "     </script>\n";
                $text .= "   </button>\n";
                $text .= "   </div>\n";

Modified: vcl/trunk/web/.ht-inc/resource.php
URL: 
http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/resource.php?rev=1634070&r1=1634069&r2=1634070&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/resource.php (original)
+++ vcl/trunk/web/.ht-inc/resource.php Fri Oct 24 14:58:09 2014
@@ -1655,7 +1655,7 @@ function AJstartImage() {
        $arr['connectmethodurl'] = BASEURL . SCRIPT . "?continuation=$cont";
 
        if(! $disableUpdate) {
-               $revisions = getImageRevisions($imageid);
+               $revisions = getImageRevisions($imageid, 1);
                if(array_key_exists($revid, $revisions))
                        $comments = $revisions[$revid]['comments'];
                else {

Modified: vcl/trunk/web/js/resources/image.js
URL: 
http://svn.apache.org/viewvc/vcl/trunk/web/js/resources/image.js?rev=1634070&r1=1634069&r2=1634070&view=diff
==============================================================================
--- vcl/trunk/web/js/resources/image.js (original)
+++ vcl/trunk/web/js/resources/image.js Fri Oct 24 14:58:09 2014
@@ -557,6 +557,11 @@ function hideUpdateImageDlg() {
        dijit.byId('newcomments').reset();
 }
 
+function hideClickThroughDlg() {
+       dijit.byId('addeditdlg').hide();
+       dijit.byId('updateimagedlg').hide();
+}
+
 function startImage(cont) {
        RPCwrapper({continuation: cont}, startImageCB, 1);
 }
@@ -628,12 +633,14 @@ function submitCreateUpdateImage() {
 }
 
 function submitUpdateImage() {
+       dijit.byId('updateImageDlgBtn').set('disabled', true);
        var data = {continuation: dojo.byId('updateimage').value,
                    comments: dijit.byId('newcomments').value};
        RPCwrapper(data, updateImageCB, 1);
 }
 
 function updateImageCB(data, ioArgs) {
+       dijit.byId('updateImageDlgBtn').set('disabled', false);
        if(data.items.status == 'error') {
                alert(data.items.errmsg);
                dijit.byId('updateimagedlg').hide();


Reply via email to