diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 6cf97b0e8..ab0400404 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -12,6 +12,8 @@ - fixed #11154: vendor payouts screen borked ( Martin Kamerbeek / Oqapi ) - fixed #11166: Documentation bug - addChild - fixed #11116: Deleted user's version tags and revisions + - fixed #11168: Points do not work with uncommitted Map + - fixed #10888: Add Point... how do I enter details? 7.8.2 - Added scheduled vendor payout workflow activity. (Special thanks to Martin @ Oqapi) diff --git a/lib/WebGUI/Asset/Wobject/Map.pm b/lib/WebGUI/Asset/Wobject/Map.pm index c924269b0..3af388789 100644 --- a/lib/WebGUI/Asset/Wobject/Map.pm +++ b/lib/WebGUI/Asset/Wobject/Map.pm @@ -556,8 +556,19 @@ sub www_ajaxEditPointSave { my $errors = $asset->processAjaxEditForm; # Commit! - if ($asset->getAutoCommitWorkflowId && $self->hasBeenCommitted) { - $asset->requestAutoCommit; + if ( $asset->getAutoCommitWorkflowId ) { + if ( $self->hasBeenCommitted) { + $asset->requestAutoCommit; + } + else { + # Add mappoint to map's version tag + my $oldTagId = $asset->get('tagId'); + $asset->setVersionTag( $self->get('tagId') ); + my $oldTag = WebGUI::VersionTag->new( $session, $oldTagId ); + if ( $oldTag->getAssetCount <= 0 ) { + $oldTag->rollback; + } + } } # Encode entities because we're returning as HTML diff --git a/www/extras/yui-webgui/build/map/map.js b/www/extras/yui-webgui/build/map/map.js index 4a326950f..b2165cf5a 100644 --- a/www/extras/yui-webgui/build/map/map.js +++ b/www/extras/yui-webgui/build/map/map.js @@ -9,6 +9,9 @@ if (typeof WebGUI.Map == "undefined") { // Keep track of all points on all maps and how to focus on them WebGUI.Map.markers = {}; +// Keep a loading dialog +WebGUI.Map.loadingDialog = undefined; + /** * WebGUI.Map.deletePoint( map, mgr, mapUrl, marker ) * Delete a point from the map. @@ -17,12 +20,14 @@ WebGUI.Map.markers = {}; WebGUI.Map.deletePoint = function ( map, mgr, mapUrl, marker ) { var callback = function ( text, code ) { + WebGUI.Map.hideLoading(); var response = YAHOO.lang.JSON.parse( text ); // remove the marker from the map if ( !response.error ) { mgr.removeMarker( marker ); } }; + WebGUI.Map.showLoading(); GDownloadUrl( mapUrl + '?func=ajaxDeletePoint;assetId=' + marker.assetId, callback); }; @@ -51,21 +56,6 @@ WebGUI.Map.editPoint assetId = marker.assetId; } - // Create a loading dialog - var loadingDialog = new YAHOO.widget.Panel("loading", { width:"240px", - fixedcenter:true, - close:false, - draggable:false, - zindex:4, - modal:true, - visible:false - } - ); - - loadingDialog.setHeader("Loading, please wait..."); - loadingDialog.setBody(''); - loadingDialog.render(document.body); - // Callback should open the window with the form var callback = function (text, code) { YAHOO.util.Dom.addClass( document.body, "yui-skin-sam" ); @@ -84,7 +74,7 @@ WebGUI.Map.editPoint var lng = marker.getLatLng().lng(); this.form.elements['latitude'].value = lat; this.form.elements['longitude'].value = lng; - + WebGUI.Map.showLoading(); this.submit(); } @@ -143,15 +133,16 @@ WebGUI.Map.editPoint GEvent.addListener( marker, "dragend", function (latlng) { WebGUI.Map.setPointLocation( marker, latlng, mapUrl ); } ); + WebGUI.Map.hideLoading(); } }; // Hide the loading dialog - loadingDialog.hide(); + WebGUI.Map.hideLoading(); }; // Show the loading dialog - loadingDialog.show(); + WebGUI.Map.showLoading(); // Get the form GDownloadUrl( mapUrl + '?func=ajaxEditPoint;assetId=' + assetId, callback ); @@ -174,6 +165,11 @@ WebGUI.Map.focusOn marker.openInfoWindow( marker.infoWin ); }; +WebGUI.Map.hideLoading += function () { + WebGUI.Map.loadingDialog.hide(); +}; + /** * WebGUI.Map.preparePoints ( map, mgr, mapUrl, points ) * Prepare the points from WebGUI into Google Map GMarkers @@ -251,7 +247,9 @@ WebGUI.Map.setCenter ; var callback = function ( text, code ) { // TODO: Notify the poor user + WebGUI.Map.hideLoading(); }; + WebGUI.Map.showLoading(); GDownloadUrl(url,callback); }; @@ -268,8 +266,31 @@ WebGUI.Map.setPointLocation ; var callback = function ( text, code ) { // TODO: Notify the poor user + WebGUI.Map.hideLoading(); }; + WebGUI.Map.showLoading(); GDownloadUrl(url, callback); }; +WebGUI.Map.showLoading += function () { + // Create a loading dialog + if ( !WebGUI.Map.loadingDialog ) { + var loadingDialog = new YAHOO.widget.Panel("loading", { width:"240px", + fixedcenter:true, + close:false, + draggable:false, + zindex:4, + modal:true, + visible:false + } + ); + loadingDialog.setHeader("Loading, please wait..."); + loadingDialog.setBody(''); + loadingDialog.render(document.body); + WebGUI.Map.loadingDialog = loadingDialog; + } + + WebGUI.Map.loadingDialog.show(); +};