← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10183: close sharing dialog after save

 

------------------------------------------------------------
revno: 10183
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-03-13 22:24:18 +0700
message:
  close sharing dialog after save
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/SharingController.java
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.sharing.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/SharingController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/SharingController.java	2013-03-11 17:29:55 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/SharingController.java	2013-03-13 15:24:18 +0000
@@ -58,7 +58,7 @@
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */
 @Controller
-@RequestMapping(value = SharingController.RESOURCE_PATH, method = RequestMethod.GET)
+@RequestMapping( value = SharingController.RESOURCE_PATH, method = RequestMethod.GET )
 public class SharingController
 {
     public static final String RESOURCE_PATH = "/sharing";
@@ -78,7 +78,7 @@
     @Autowired
     private UserGroupAccessService userGroupAccessService;
 
-    @RequestMapping(value = "", produces = { "application/json", "text/*" })
+    @RequestMapping( value = "", produces = { "application/json", "text/*" } )
     public void getSharing( @RequestParam String type, @RequestParam String id, HttpServletResponse response ) throws IOException
     {
         if ( !SharingUtils.isSupported( type ) )
@@ -127,7 +127,7 @@
         JacksonUtils.toJson( response.getOutputStream(), sharing );
     }
 
-    @RequestMapping(value = "", method = { RequestMethod.POST, RequestMethod.PUT }, consumes = "application/json")
+    @RequestMapping( value = "", method = { RequestMethod.POST, RequestMethod.PUT }, consumes = "application/json" )
     public void setSharing( @RequestParam String type, @RequestParam String id, HttpServletResponse response, HttpServletRequest request ) throws IOException
     {
         BaseIdentifiableObject object = (BaseIdentifiableObject) manager.get( SharingUtils.classForType( type ), id );
@@ -146,7 +146,7 @@
         Sharing sharing = JacksonUtils.fromJson( request.getInputStream(), Sharing.class );
 
         // Ignore publicAccess if user is not allowed to make objects public
-        
+
         if ( SharingUtils.canCreatePublic( currentUserService.getCurrentUser(), object ) )
         {
             object.setPublicAccess( sharing.getObject().getPublicAccess() );
@@ -184,7 +184,7 @@
         }
 
         manager.update( object );
-        
+
         ContextUtils.okResponse( response, "Access control set" );
     }
 

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.sharing.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.sharing.js	2013-03-07 11:39:25 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.sharing.js	2013-03-13 15:24:18 +0000
@@ -14,7 +14,7 @@
     return $.ajax( {
         url: '../api/sharing?type=' + type + '&id=' + uid,
         type: 'POST',
-        dataType: 'json',
+        dataType: 'text',
         contentType: 'application/json; charset=UTF-8',
         data: JSON.stringify( data )
     } );