dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #20552
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9421: Data entry. Added informative message in period dropdown when there are no periods
------------------------------------------------------------
revno: 9421
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-01-02 22:52:37 +0100
message:
Data entry. Added informative message in period dropdown when there are no periods
modified:
dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.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-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties 2012-12-04 17:33:33 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties 2013-01-02 21:52:37 +0000
@@ -106,4 +106,5 @@
all_values_for_data_element_must_be_filled=This form requires that all fields for a data element must be filled, please correct this before continuing.
childrens_forms=Childrens forms
left_side=Left side
-right_side=Right side
\ No newline at end of file
+right_side=Right side
+no_periods_click_prev_year_button=No periods, click "Prev year" button
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js 2013-01-02 20:50:36 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js 2013-01-02 21:52:37 +0000
@@ -895,8 +895,15 @@
clearListById( 'selectedPeriodId' );
- addOptionById( 'selectedPeriodId', '-1', '[ ' + i18n_select_period + ' ]' );
-
+ if ( periods.length > 0 )
+ {
+ addOptionById( 'selectedPeriodId', '-1', '[ ' + i18n_select_period + ' ]' );
+ }
+ else
+ {
+ addOptionById( 'selectedPeriodId', '-1', i18n_no_periods_click_prev_year_button );
+ }
+
$.safeEach(periods, function(idx, item) {
addOptionById( 'selectedPeriodId', item.id, item.name );
});
@@ -929,8 +936,15 @@
clearListById( 'selectedPeriodId' );
clearSectionFilters();
- addOptionById( 'selectedPeriodId', '-1', '[ ' + i18n_select_period + ' ]' );
-
+ if ( periods.length > 0 )
+ {
+ addOptionById( 'selectedPeriodId', '-1', '[ ' + i18n_select_period + ' ]' );
+ }
+ else
+ {
+ addOptionById( 'selectedPeriodId', '-1', i18n_no_periods_click_prev_year_button );
+ }
+
$.safeEach(periods, function(idx, item) {
addOptionById( 'selectedPeriodId', item.id, item.name );
});
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm 2012-11-15 11:11:53 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm 2013-01-02 21:52:37 +0000
@@ -42,6 +42,7 @@
var i18n_successful_validation = '$encoder.jsEscape( $i18n.getString( "successful_validation" ) , "'")';
var i18n_no_organisationunit_selected = '$encoder.jsEscape( $i18n.getString( "no_organisationunit_selected" ) , "'")';
var i18n_childrens_forms = '$encoder.jsEscape( $i18n.getString( "childrens_forms" ) , "'")';
+var i18n_no_periods_click_prev_year_button = '$encoder.jsEscape( $i18n.getString( "no_periods_click_prev_year_button" ) , "'")';
</script>
<h3>$i18n.getString( "data_entry" ) #openHelp( "dataEntry" )</h3>