=== modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/resources/org/hisp/dhis/web/mobile/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-mobile/src/main/resources/org/hisp/dhis/web/mobile/i18n_module.properties 2013-10-09 10:43:45 +0000 +++ dhis-2/dhis-web/dhis-web-mobile/src/main/resources/org/hisp/dhis/web/mobile/i18n_module.properties 2013-12-17 15:17:33 +0000 @@ -9,4 +9,5 @@ none_selected=None selected no_organisation_units_for_data_entry=No organisation units available for data entry change_to_invalid_page=Tried changing to invalid page -logout=Log out \ No newline at end of file +logout=Log out +send_and_complete=Send and Complete \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/data-entry.vm' --- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/data-entry.vm 2013-12-17 14:41:36 +0000 +++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/data-entry.vm 2013-12-17 15:17:33 +0000 @@ -172,7 +172,8 @@ $( '#data-entry-page' ).trigger( 'pagecreate' ); $( '#data-entry-list' ).listview( 'refresh' ); - $( '#send_button' ).bind( 'click', saveValues ); + $( '#send_button' ).bind( 'click', saveValuesNotCompleted ); + $( '#send_and_complete_button' ).bind( 'click', saveValuesCompleted ); } var dvs = { @@ -213,7 +214,20 @@ } } - function saveValues() { + function getCurrentDate() { + var d = new Date(); + return d.getFullYear() + '-' + (d.getMonth()+1) + '-' + d.getDate(); + } + + function saveValuesCompleted() { + saveValues(true); + } + + function saveValuesNotCompleted() { + saveValues(false); + } + + function saveValues(completed) { $.mobile.loading( 'show' ); var fields = $('#data-entry-form :input[name]'); @@ -224,6 +238,10 @@ period: Selected.period.toString() }; + if( completed ) { + dataValueSet.completeDate = getCurrentDate(); + } + var dataValues = []; _.each(fields, function(field) { @@ -368,6 +386,7 @@ <% }); %>
  • +