Author: jfthomps
Date: Fri Dec 12 18:20:12 2014
New Revision: 1645017

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

fixed a problem where when the Reservations page is initially loaded, an image 
only has 1 revision. So, the data for imagestore contains 'revisions' = 0. 
However, if a user creates a new revision and never leaves the page, once the 
revision has been captured, the user will not be prompted to select a revision. 
Fixed this by setting 'revisions' in imagestore for the image to 1. There is a 
problem that needs to be fixed later where the new revision will not show up in 
the prompting until it is finished and has 'deleted' set to 0. This results in 
a user being prompted to select a revision when only 1 revision exists until 
the catpure is finished.

image.php: modified AJupdateImage: send imageid back with returned data

requests.php: modified newReservationHTML: changed imagestore from 
ItemFileReadStore to ItemFileWriteStore so we can change the value of 
'revisions'

image.js: modified submitUpdateImageClickthroughCB: update value of 'revisions' 
for entry in imagestore to = 1 so that user will get prompted to select an 
image revision

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

Modified: vcl/trunk/web/.ht-inc/image.php
URL: 
http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/image.php?rev=1645017&r1=1645016&r2=1645017&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/image.php (original)
+++ vcl/trunk/web/.ht-inc/image.php Fri Dec 12 18:20:12 2014
@@ -943,7 +943,10 @@ class Image extends Resource {
                       .        "'$agree')";
                doQuery($query, 101);
        
-               sendJSON(array('status' => 'success', 'action' => 'update'));
+               $return = array('status' => 'success',
+                               'action' => 'update',
+                               'imageid' => $imageid);
+               sendJSON($return);
        }
 
        
/////////////////////////////////////////////////////////////////////////////

Modified: vcl/trunk/web/.ht-inc/requests.php
URL: 
http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/requests.php?rev=1645017&r1=1645016&r2=1645017&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/requests.php (original)
+++ vcl/trunk/web/.ht-inc/requests.php Fri Dec 12 18:20:12 2014
@@ -1461,7 +1461,7 @@ function newReservationHTML() {
        # image
        $h .= "<span class=\"labeledform\">";
        $h .= resourceStore('image', 1, 'detailimagestore');
-       $h .= "<div dojoType=\"dojo.data.ItemFileReadStore\" data=\"images\" ";
+       $h .= "<div dojoType=\"dojo.data.ItemFileWriteStore\" data=\"images\" ";
        $h .= "jsId=\"imagestore\"></div>\n";
        $h .= "<select dojoType=\"dijit.form.FilteringSelect\" 
id=\"deployimage\" ";
        $h .= "style=\"width: 400px\" required=\"true\" store=\"imagestore\" ";

Modified: vcl/trunk/web/js/resources/image.js
URL: 
http://svn.apache.org/viewvc/vcl/trunk/web/js/resources/image.js?rev=1645017&r1=1645016&r2=1645017&view=diff
==============================================================================
--- vcl/trunk/web/js/resources/image.js (original)
+++ vcl/trunk/web/js/resources/image.js Fri Dec 12 18:20:12 2014
@@ -716,6 +716,12 @@ function submitUpdateImageClickthroughCB
                dijit.byId('clickthroughDlgBtn').set('disabled', false);
                return;
        }
+       imagestore.fetch({
+               query: {id: data.items.imageid},
+               onItem: function(item, request) {
+                       imagestore.setValue(item, 'revisions', 1);
+               }
+       });
        dijit.byId('updateimagedlg').hide();
        dijit.byId('clickthroughdlg').hide();
        dijit.byId('clickthroughDlgBtn').set('disabled', false);


Reply via email to