← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8224: i18n fix for new message, also validating that at least 1 OU or 1 user/usergroup is selected.

 

------------------------------------------------------------
revno: 8224
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-09-24 15:49:54 +0700
message:
  i18n fix for new message, also validating that at least 1 OU or 1 user/usergroup is selected.
modified:
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/message.js
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/sendMessage.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-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties	2012-09-24 06:28:31 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties	2012-09-24 08:49:54 +0000
@@ -33,6 +33,7 @@
 username=Username
 user_roles=User roles
 user_usergroups=User/User Groups
+select_one_or_more_recipients=Select one or more recipients
 meta_data=Meta data
 sending_message=Sending message
 explore=Explore

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/message.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/message.js	2012-02-14 20:27:19 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/message.js	2012-09-24 08:49:54 +0000
@@ -20,7 +20,13 @@
 {
 	var subject = $( "#subject" ).val();
 	var text = $( "#text" ).val();
-	
+
+    if( $('#selectionTree').find('.selected').length == 0 && $('#additionalUsers').val().length == 0 )
+    {
+        setHeaderMessage( i18n_select_one_or_more_recipients );
+        return false;
+    }
+
 	if ( subject == null || subject.trim() == '' )
 	{
 		setHeaderMessage( i18n_enter_subject );

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/sendMessage.vm'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/sendMessage.vm	2012-09-24 06:28:31 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/sendMessage.vm	2012-09-24 08:49:54 +0000
@@ -4,6 +4,7 @@
 <script type="text/javascript">
 var i18n_enter_subject = '$encoder.jsEscape( $i18n.getString( "enter_subject" ), "'")';
 var i18n_enter_text = '$encoder.jsEscape( $i18n.getString( "enter_text" ), "'")';
+var i18n_select_one_or_more_recipients = '$encoder.jsEscape( $i18n.getString( "select_one_or_more_recipients" ), "'")';
 
 $(function() {
     $('#additionalUsers').select2({