← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19317: Introduced system setting, allow assigning object to related objects during add or update. This t...

 

------------------------------------------------------------
revno: 19317
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-06-09 14:52:15 +0200
message:
  Introduced system setting, allow assigning object to related objects during add or update. This to control whether users can assign e.g. org units to data sets and group when creating/editing org units.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/SystemSettingManager.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/SystemSettingInterceptor.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/SetAccessSettingsAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/org/hisp/dhis/settings/i18n_module.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemAccessSettings.vm


--
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-api/src/main/java/org/hisp/dhis/setting/SystemSettingManager.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/SystemSettingManager.java	2015-04-16 21:17:08 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/SystemSettingManager.java	2015-06-09 12:52:15 +0000
@@ -108,6 +108,7 @@
     final String KEY_ANALYSIS_RELATIVE_PERIOD = "keyAnalysisRelativePeriod";
     final String KEY_CORS_WHITELIST = "keyCorsWhitelist";
     final String KEY_REQUIRE_ADD_TO_VIEW = "keyRequireAddToView";
+    final String KEY_ALLOW_OBJECT_ASSIGNMENT = "keyAllowObjectAssignment";
 
     final String DEFAULT_SCHEDULE_AGGREGATE_QUERY_BUILDER_TASK_STRATEGY = "lastMonth";
     final String DEFAULT_FLAG = "dhis2";

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/SystemSettingInterceptor.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/SystemSettingInterceptor.java	2015-04-07 09:42:13 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/SystemSettingInterceptor.java	2015-06-09 12:52:15 +0000
@@ -131,6 +131,7 @@
         map.put( KEY_ACCEPTANCE_REQUIRED_FOR_APPROVAL, systemSettingManager.getSystemSetting( KEY_ACCEPTANCE_REQUIRED_FOR_APPROVAL, false ) );
         map.put( KEY_SYSTEM_NOTIFICATIONS_EMAIL, systemSettingManager.getSystemSetting( KEY_SYSTEM_NOTIFICATIONS_EMAIL ) );
         map.put( KEY_REQUIRE_ADD_TO_VIEW, systemSettingManager.getSystemSetting( KEY_REQUIRE_ADD_TO_VIEW, false ) );
+        map.put( KEY_ALLOW_OBJECT_ASSIGNMENT, systemSettingManager.getSystemSetting( KEY_ALLOW_OBJECT_ASSIGNMENT, false ) );
         map.put( SYSPROP_PORTAL, defaultIfEmpty( System.getProperty( SYSPROP_PORTAL ), String.valueOf( false ) ) );
 
         invocation.getStack().push( map );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitForm.vm	2015-01-12 08:42:48 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitForm.vm	2015-06-09 12:52:15 +0000
@@ -116,6 +116,7 @@
 	</tr>
 </table>
 
+#if( $keyAllowObjectAssignment )
 <table>
 	<tr>
 		<th colspan="2">$i18n.getString( "data_sets" )</th>
@@ -162,6 +163,7 @@
     </tr>
 	#end
 </table>
+#end
 
 <p>
 	<input type="submit" name="save" value="$i18n.getString( 'add' )" style="width: 10em;" />

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitForm.vm	2015-01-12 08:42:48 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitForm.vm	2015-06-09 12:52:15 +0000
@@ -112,6 +112,7 @@
 	</tr>
 </table>
 
+#if( $keyAllowObjectAssignment )
 <table>    
     <tr>
 		<th colspan="2">$i18n.getString( "data_sets" )</th>
@@ -164,6 +165,7 @@
     </tr>
 	#end
 </table>
+#end
 
 <p>
 	<input type="submit" name="save" value="$i18n.getString( 'save' )" style="width:10em" />

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/SetAccessSettingsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/SetAccessSettingsAction.java	2015-04-01 09:10:55 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/SetAccessSettingsAction.java	2015-06-09 12:52:15 +0000
@@ -35,6 +35,7 @@
 import static org.hisp.dhis.setting.SystemSettingManager.KEY_OPENID_PROVIDER;
 import static org.hisp.dhis.setting.SystemSettingManager.KEY_OPENID_PROVIDER_LABEL;
 import static org.hisp.dhis.setting.SystemSettingManager.KEY_SELF_REGISTRATION_NO_RECAPTCHA;
+import static org.hisp.dhis.setting.SystemSettingManager.KEY_ALLOW_OBJECT_ASSIGNMENT;
 
 import java.io.Serializable;
 import java.util.ArrayList;
@@ -117,6 +118,13 @@
         this.canGrantOwnUserAuthorityGroups = canGrantOwnUserAuthorityGroups;
     }
 
+    private Boolean allowObjectAssignment;
+
+    public void setAllowObjectAssignment( Boolean allowObjectAssignment )
+    {
+        this.allowObjectAssignment = allowObjectAssignment;
+    }
+
     private Integer credentialsExpires;
 
     public void setCredentialsExpires( Integer credentialsExpires )
@@ -191,8 +199,8 @@
         systemSettingManager.saveSystemSetting( KEY_ACCOUNT_RECOVERY, accountRecovery );
         systemSettingManager.saveSystemSetting( KEY_ACCOUNT_INVITE, accountInvite );
         systemSettingManager.saveSystemSetting( KEY_CAN_GRANT_OWN_USER_AUTHORITY_GROUPS, canGrantOwnUserAuthorityGroups );
+        systemSettingManager.saveSystemSetting( KEY_ALLOW_OBJECT_ASSIGNMENT, allowObjectAssignment );
         systemSettingManager.saveSystemSetting( KEY_SELF_REGISTRATION_NO_RECAPTCHA, selfRegistrationNoRecaptcha );
-
         systemSettingManager.saveSystemSetting( KEY_OPENID_PROVIDER, StringUtils.isEmpty( openIdProvider ) ? null : openIdProvider );
 
         if ( !StringUtils.isEmpty( openIdProviderLabel ) )

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/org/hisp/dhis/settings/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/org/hisp/dhis/settings/i18n_module.properties	2015-05-08 20:26:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/org/hisp/dhis/settings/i18n_module.properties	2015-06-09 12:52:15 +0000
@@ -123,7 +123,8 @@
 acceptance_required_before_approval=Acceptance required before approval
 system_notifications_email_address=System notifications email address
 default_analysis_relative_period=Default relative period for analysis
-infrastructural_indicators=Infrastructural indicators
-cors_whitelist=CORS Whitelist
+infrastructural_indicators=Infrastructure indicators
+cors_whitelist=CORS whitelist
 require_authority_to_add_to_view_object_lists=Require authority to add to view object lists
-for_example=For example
\ No newline at end of file
+for_example=For example
+allow_assigning_object_to_related_objects_during_add_or_update=Allow assigning object to related objects during add or update
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemAccessSettings.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemAccessSettings.vm	2015-03-31 15:57:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemAccessSettings.vm	2015-06-09 12:52:15 +0000
@@ -11,7 +11,7 @@
             return options;
         };
 
-        $.ajax( {
+        jQuery.ajax( {
             url: 'setSystemAccessSettings.action',
             type:'post',
             contentType:'application/x-www-form-urlencoded;charset=utf-8',
@@ -23,6 +23,7 @@
                 accountRecovery: jQuery( '#accountRecovery' ).is( ':checked' ),
                 accountInvite: jQuery( '#accountInvite' ).is( ':checked' ),
                 canGrantOwnUserAuthorityGroups: jQuery( '#canGrantOwnUserAuthorityGroups' ).is( ':checked' ),
+                allowObjectAssignment: jQuery( '#allowObjectAssignment' ).is( ':checked' ),
                 credentialsExpires: jQuery( '#credentialsExpires' ).val(),
                 openIdProvider: jQuery( '#openIdProvider' ).val(),
                 openIdProviderLabel: jQuery( '#openIdProviderLabel' ).val(),
@@ -97,6 +98,11 @@
     <label for="canGrantOwnUserAuthorityGroups">$i18n.getString( "allow_users_to_grant_own_user_roles" )</label>
 </div>
 
+<div class="setting">
+    <input type="checkbox" id="allowObjectAssignment" name="allowObjectAssignment"#if( $keyAllowObjectAssignment ) checked="checked"#end>
+    <label for="allowObjectAssignment">$i18n.getString( "allow_assigning_object_to_related_objects_during_add_or_update" )</label>
+</div>
+
 <div class="settingLabel">$i18n.getString( "user_credentials_expires" )</div>
 
 <div class="setting">