=== modified file 'dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/engine/DefaultDataMartEngine.java' --- dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/engine/DefaultDataMartEngine.java 2012-02-12 17:11:20 +0000 +++ dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/engine/DefaultDataMartEngine.java 2012-02-12 19:23:31 +0000 @@ -230,7 +230,7 @@ expressionService.filterInvalidIndicators( indicators ); clock.logTime( "Filtered objects" ); - notifier.notify( DATAMART, "Loading indicator formulas" ); + notifier.notify( DATAMART, "Loading indicators" ); // --------------------------------------------------------------------- // Explode indicator expressions === modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/htmlNotifications.vm' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/htmlNotifications.vm 2012-02-12 17:11:30 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/htmlNotifications.vm 2012-02-12 19:23:31 +0000 @@ -8,16 +8,18 @@ .notificationTable td { padding: 3px; -} +} +#if( $notifications.size() > 0 ) #foreach( $notification in $notifications ) - + #end -
${format.formatDateTime( $notification.time )}:${encoder.htmlEncode( $notification.message )} #if( $velocityCount == 1 ) #end${encoder.htmlEncode( $notification.message )} #if( $velocityCount == 1 )  #end
\ No newline at end of file + +#end \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/widgets.css' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/widgets.css 2011-12-19 07:37:29 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/widgets.css 2012-02-12 19:23:31 +0000 @@ -461,7 +461,6 @@ div.inputCriteria { position: relative; - left: 2px; width: 400px; /* Override this */ height: 400px; /* Override this */ border: 1px solid #a4d2a3; === modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetNotificationsAction.java' --- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetNotificationsAction.java 2012-02-12 17:11:30 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetNotificationsAction.java 2012-02-12 19:23:31 +0000 @@ -27,6 +27,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +import java.util.ArrayList; import java.util.List; import org.hisp.dhis.system.notification.Notification; @@ -74,13 +75,13 @@ // Output // ------------------------------------------------------------------------- - private List notifications; + private List notifications = new ArrayList(); public List getNotifications() { return notifications; } - + // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- @@ -101,7 +102,7 @@ { notifications = notifier.getNotifications( max ); } - + return SUCCESS; } } === modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties' --- dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties 2012-01-19 11:43:06 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties 2012-02-12 19:23:31 +0000 @@ -395,7 +395,7 @@ error=Error warning=Warning success=Success -waiting=Please wait... +waiting=Please wait expression_not_well_formed=Expression is not well formed locate_by_code=Locate by code === modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/datamart/action/StartExportAction.java' --- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/datamart/action/StartExportAction.java 2012-02-12 14:40:54 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/datamart/action/StartExportAction.java 2012-02-12 19:23:31 +0000 @@ -2,10 +2,13 @@ import java.util.ArrayList; import java.util.Date; +import java.util.HashSet; import java.util.List; +import java.util.Set; +import org.hisp.dhis.period.CalendarPeriodType; import org.hisp.dhis.period.Period; -import org.hisp.dhis.period.PeriodService; +import org.hisp.dhis.period.PeriodType; import org.hisp.dhis.system.scheduling.DataMartTask; import org.hisp.dhis.system.scheduling.Scheduler; import org.hisp.dhis.system.util.DateUtils; @@ -33,17 +36,17 @@ this.dataMartTask = dataMartTask; } - private PeriodService periodService; - - public void setPeriodService( PeriodService periodService ) - { - this.periodService = periodService; - } - // ------------------------------------------------------------------------- // Input // ------------------------------------------------------------------------- + private Set periodType = new HashSet(); + + public void setPeriodType( Set periodType ) + { + this.periodType = periodType; + } + private String startDate; public void setStartDate( String startDate ) @@ -69,11 +72,21 @@ Date start = DateUtils.getMediumDate( startDate ); Date end = DateUtils.getMediumDate( endDate ); - List periods = new ArrayList( periodService.getPeriodsBetweenDates( start, end ) ); - - dataMartTask.setPeriods( periods ); - - scheduler.executeTask( dataMartTask ); + List periods = new ArrayList(); + + for ( String type : periodType ) + { + CalendarPeriodType periodType = (CalendarPeriodType) PeriodType.getPeriodTypeByName( type ); + + periods.addAll( periodType.generatePeriods( start, end ) ); + } + + if ( periods.size() > 0 ) + { + dataMartTask.setPeriods( periods ); + + scheduler.executeTask( dataMartTask ); + } return SUCCESS; } === modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml 2012-02-12 14:40:54 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml 2012-02-12 19:23:31 +0000 @@ -248,7 +248,6 @@ scope="prototype"> - === modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties 2012-02-12 14:40:54 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties 2012-02-12 19:23:31 +0000 @@ -405,4 +405,5 @@ data_mart_management = Data mart management start_date = Start date end_date = End date -start_export = Start export \ No newline at end of file +start_export = Start export +period_types = Period types \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataMart.js' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataMart.js 2012-02-12 17:11:20 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataMart.js 2012-02-12 19:23:31 +0000 @@ -1,20 +1,30 @@ $( document ).ready( function() { datePickerInRange( 'startDate' , 'endDate' ); + pingNotificationsTimeout(); } ); function startExport() { - var url = 'startExport.action'; var startDate = $( '#startDate' ).val(); var endDate = $( '#endDate' ).val(); - $.get( url, { startDate:startDate, endDate:endDate }, pingNotifications ); + var url = 'startExport.action?startDate=' + startDate + '&endDate=' + endDate; + + $( 'input[name="periodType"]').each( function() { + url += "&periodType=" + $( this ).val(); + } ); + + $.get( url, pingNotifications ); } function pingNotifications() { - $( '#notificationDiv' ).load( '../dhis-web-commons-ajax/getNotifications.action?category=DATAMART' ); - - setTimeout( "pingNotifications()", 2000 ); -} \ No newline at end of file + $( '#notificationDiv' ).load( '../dhis-web-commons-ajax/getNotifications.action?category=DATAMART' ); +} + +function pingNotificationsTimeout() +{ + pingNotifications(); + setTimeout( "pingNotificationsTimeout()", 2000 ); +} === modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDataMartForm.vm' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDataMartForm.vm 2012-02-12 17:11:20 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDataMartForm.vm 2012-02-12 19:23:31 +0000 @@ -1,11 +1,20 @@

$i18n.getString( "data_mart_management" )

-
+
+ + + + @@ -20,4 +29,4 @@
$i18n.getString( "period_types" )  +   +
+   +

+
$i18n.getString( "start_date" )
-
\ No newline at end of file +
\ No newline at end of file