← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4874: User settings - Added new more setting called "Completeness email notification".

 

------------------------------------------------------------
revno: 4874
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2011-10-07 15:07:51 +0700
message:
  User settings - Added new more setting called "Completeness email notification".
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetEmailSettingsAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetEmailSettingsAction.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/resources/org/hisp/dhis/settings/i18n_module_vi_VN.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/userEmailSettings.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-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetEmailSettingsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetEmailSettingsAction.java	2011-10-06 09:37:47 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetEmailSettingsAction.java	2011-10-07 08:07:51 +0000
@@ -27,7 +27,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-
+import static org.hisp.dhis.user.UserSettingService.KEY_COMPLETENESS_EMAIL_NOTIFICATION;
 import static org.hisp.dhis.user.UserSettingService.KEY_MESSAGE_EMAIL_NOTIFICATION;
 
 import org.hisp.dhis.user.UserSettingService;
@@ -57,6 +57,13 @@
     // Output
     // -------------------------------------------------------------------------
 
+    private Boolean completenessEmailNotification;
+
+    public Boolean getCompletenessEmailNotification()
+    {
+        return completenessEmailNotification;
+    }
+
     private Boolean messageEmailNotification;
 
     public Boolean getMessageEmailNotification()
@@ -72,6 +79,13 @@
         throws Exception
     {
         // ---------------------------------------------------------------------
+        // Get Completeness-email-notification
+        // ---------------------------------------------------------------------
+
+        completenessEmailNotification = (Boolean) userSettingService.getUserSetting(
+            KEY_COMPLETENESS_EMAIL_NOTIFICATION, false );
+
+        // ---------------------------------------------------------------------
         // Get Message-email-notification
         // ---------------------------------------------------------------------
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetEmailSettingsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetEmailSettingsAction.java	2011-10-06 09:36:05 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetEmailSettingsAction.java	2011-10-07 08:07:51 +0000
@@ -27,6 +27,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import static org.hisp.dhis.user.UserSettingService.KEY_COMPLETENESS_EMAIL_NOTIFICATION;
 import static org.hisp.dhis.user.UserSettingService.KEY_MESSAGE_EMAIL_NOTIFICATION;
 
 import org.hisp.dhis.i18n.I18n;
@@ -63,6 +64,13 @@
         this.messageEmailNotification = messageEmailNotification;
     }
 
+    private Boolean completenessEmailNotification;
+
+    public void setCompletenessEmailNotification( Boolean completenessEmailNotification )
+    {
+        this.completenessEmailNotification = completenessEmailNotification;
+    }
+
     private String message;
 
     public String getMessage()
@@ -84,8 +92,10 @@
     public String execute()
         throws Exception
     {
+        userSettingService.saveUserSetting( KEY_COMPLETENESS_EMAIL_NOTIFICATION, completenessEmailNotification );
+        
         userSettingService.saveUserSetting( KEY_MESSAGE_EMAIL_NOTIFICATION, messageEmailNotification );
-        
+
         message = i18n.getString( "settings_updated" );
 
         return SUCCESS;

=== 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	2011-10-07 03:04:44 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/org/hisp/dhis/settings/i18n_module.properties	2011-10-07 08:07:51 +0000
@@ -114,4 +114,5 @@
 feedback_recipients = Feedback recipients
 no_feedback_recipients = No message recipients
 settings_updated = Settings were updated
-message_email_notification = Message email notification
\ No newline at end of file
+message_email_notification = Message email notification
+completeness_email_notification = Completeness email notification
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/org/hisp/dhis/settings/i18n_module_vi_VN.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/org/hisp/dhis/settings/i18n_module_vi_VN.properties	2011-10-07 03:04:44 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/org/hisp/dhis/settings/i18n_module_vi_VN.properties	2011-10-07 08:07:51 +0000
@@ -129,6 +129,7 @@
 password = M\u1eadt kh\u1ea9u
 settings_updated = C\u00e1c thi\u1ebft l\u1eadp \u0111\u00e3 \u0111\u01b0\u1ee3c thay \u0111\u1ed5i
 message_email_notification = Th\u00f4ng b\u00e1o tin nh\u1eafn qua th\u01b0 \u0111i\u1ec7n t\u1eed
+completeness_email_notification = Th\u00f4ng b\u00e1o tin nh\u1eafn v\u1ec1 b\u00e1o c\u00e1o nh\u1eadp \u0111\u1ea7y \u0111\u1ee7 qua th\u01b0 \u0111i\u1ec7n t\u1eed
 user_general_settings = C\u00e1c thi\u1ebft l\u1eadp chung cho ng\u01b0\u1eddi d\u00f9ng
 user_email_settings = C\u00e1c thi\u1ebft l\u1eadp c\u1ea5u h\u00ecnh th\u01b0 \u0111i\u1ec7n t\u1eed cho ng\u01b0\u1eddi d\u00f9ng
 system_general_settings = C\u00e1c thi\u1ebft l\u1eadp chung cho h\u1ec7 th\u1ed1ng

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/userEmailSettings.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/userEmailSettings.vm	2011-10-07 03:04:44 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/userEmailSettings.vm	2011-10-07 08:07:51 +0000
@@ -3,6 +3,7 @@
 	jQuery(document).ready(function() {
 		jQuery("input[type=button]").click(function() {
 			jQuery.postJSON( 'setUserEmailSettings.action', {
+				completenessEmailNotification: jQuery( '#completenessEmailNotification' ).is(':checked' ),
 				messageEmailNotification: jQuery( '#messageEmailNotification' ).is(':checked' )
 			}, function ( json ) {
 				if ( json.response == "success" )
@@ -14,6 +15,9 @@
 
 <h3>$i18n.getString("user_email_settings")</h3>
 
+<h4>$i18n.getString( "completeness_email_notification" )</h4>
+<input type="checkbox" id="completenessEmailNotification" name="completenessEmailNotification" #if( $completenessEmailNotification ) checked="checked"#end/>
+
 <h4>$i18n.getString( "message_email_notification" )</h4>
 <input type="checkbox" id="messageEmailNotification" name="messageEmailNotification" #if( $messageEmailNotification ) checked="checked"#end/>