[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15147: Add method DateUnit.toJdkCalendar, convert from system calendar to iso calendar in update/save or...

2014-05-05 Thread noreply

revno: 15147
committer: Morten Olav Hansen morte...@gmail.com
branch nick: dhis2
timestamp: Mon 2014-05-05 15:08:38 +0700
message:
  Add method DateUnit.toJdkCalendar, convert from system calendar to iso 
calendar in update/save orgUnit (openingDate, closingDate), wip
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/DateUnit.java
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/AddOrganisationUnitAction.java
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/UpdateOrganisationUnitAction.java


--
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-api/src/main/java/org/hisp/dhis/calendar/DateUnit.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/DateUnit.java	2014-04-29 05:05:54 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/DateUnit.java	2014-05-05 08:08:38 +
@@ -33,6 +33,7 @@
 import org.joda.time.chrono.ISOChronology;
 
 import javax.validation.constraints.NotNull;
+import java.util.GregorianCalendar;
 
 /**
  * Class representing a specific calendar date.
@@ -132,6 +133,11 @@
 return new DateTime( year, month, day, 0, 0, chronology );
 }
 
+public java.util.Calendar toJdkCalendar()
+{
+return new GregorianCalendar( year, month - 1, day );
+}
+
 public static DateUnit fromDateTime( DateTime dateTime )
 {
 return new DateUnit( dateTime.getYear(), dateTime.getMonthOfYear(), dateTime.getDayOfMonth(), dateTime.getDayOfWeek() );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/AddOrganisationUnitAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/AddOrganisationUnitAction.java	2014-04-28 18:13:09 +
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/AddOrganisationUnitAction.java	2014-05-05 08:08:38 +
@@ -30,6 +30,8 @@
 
 import com.opensymphony.xwork2.Action;
 import org.hisp.dhis.attribute.AttributeService;
+import org.hisp.dhis.calendar.CalendarService;
+import org.hisp.dhis.calendar.DateUnit;
 import org.hisp.dhis.common.IdentifiableObjectManager;
 import org.hisp.dhis.dataset.DataSetService;
 import org.hisp.dhis.i18n.I18nFormat;
@@ -43,7 +45,6 @@
 import org.springframework.beans.factory.annotation.Autowired;
 
 import java.util.Collection;
-import java.util.Date;
 import java.util.HashSet;
 import java.util.List;
 
@@ -109,6 +110,9 @@
 this.manager = manager;
 }
 
+@Autowired
+private CalendarService calendarService;
+
 // -
 // Input  Output
 // -
@@ -258,8 +262,6 @@
 email = nullIfEmpty( email );
 phoneNumber = nullIfEmpty( phoneNumber );
 
-Date date = format.parseDate( openingDate );
-
 // -
 // Get parent
 // -
@@ -279,7 +281,9 @@
 // Create organisation unit
 // -
 
-OrganisationUnit organisationUnit = new OrganisationUnit( name, shortName, code, date, null, active, comment );
+DateUnit isoOpeningDate = calendarService.getSystemCalendar().toIso( openingDate );
+
+OrganisationUnit organisationUnit = new OrganisationUnit( name, shortName, code, isoOpeningDate.toJdkCalendar().getTime(), null, active, comment );
 
 organisationUnit.setDescription( description );
 organisationUnit.setUrl( url );
@@ -340,7 +344,7 @@
 }
 
 organisationUnitService.updateOrganisationUnit( organisationUnit );
-
+
 organisationUnitService.updateOrganisationUnitVersion();
 
 return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/UpdateOrganisationUnitAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/UpdateOrganisationUnitAction.java	2014-04-28 18:13:09 +
+++ 

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15149: use new fromIso option in updateOrganisationUnitForm.vm, converts from ISO 8601 to local calendar...

2014-05-05 Thread noreply

revno: 15149
committer: Morten Olav Hansen morte...@gmail.com
branch nick: dhis2
timestamp: Mon 2014-05-05 15:33:02 +0700
message:
  use new fromIso option in updateOrganisationUnitForm.vm, converts from ISO 
8601 to local calendar (using system date format)
modified:
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitForm.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-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitForm.vm	2014-04-29 14:29:01 +
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitForm.vm	2014-05-05 08:33:02 +
@@ -15,7 +15,7 @@
 checkValueIsExistWarning( name, validateOrganisationUnit.action, { id : $organisationUnit.id } );
 checkValueIsExist( code, validateOrganisationUnit.action, { id : $organisationUnit.id } );
 
-  dhis2.period.picker.createRangedInstance('#openingDate', '#closedDate');
+  dhis2.period.picker.createRangedInstance('#openingDate', '#closedDate', true);
 
   jQuery( div[id=dynamicAttributesContainer] table tr td:first-child ).attr( style, width: 120px );
   jQuery( div[id=dynamicAttributesContainer] table tr td:last-child * ).attr( style,  );

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15148: add new option to picker.createInstance, fromIso, allows to convert field from ISO 8601 to local ...

2014-05-05 Thread noreply

revno: 15148
committer: Morten Olav Hansen morte...@gmail.com
branch nick: dhis2
timestamp: Mon 2014-05-05 15:32:13 +0700
message:
  add new option to picker.createInstance, fromIso, allows to convert field 
from ISO 8601 to local calendar, useful if date is coming directly from db
modified:
  
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js


--
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-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js	2014-05-05 04:19:56 +
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js	2014-05-05 08:32:13 +
@@ -62,10 +62,20 @@
  * Creates a date picker.
  *
  * @param el Element to select on, can be any kind of jQuery selector, or a jqEl
+ * @param fromIso Convert field from ISO 8601 to local calendar
  * @param options Additional options, will be merged with the defaults
  */
-dhis2.period.DatePicker.prototype.createInstance = function( el, options ) {
-  $(el).calendarsPicker($.extend({}, this.defaults, options));
+dhis2.period.DatePicker.prototype.createInstance = function( el, fromIso, options ) {
+  var $el = $(el);
+
+  if( fromIso ) {
+var iso8601 = $.calendars.instance('gregorian');
+var isoDate = iso8601.parseDate(this.format, $el.val());
+var cDateIsoDate = this.calendar.fromJD(isoDate.toJD());
+$el.val(this.calendar.formatDate(this.format, cDateIsoDate));
+  }
+
+  $el.calendarsPicker($.extend({}, this.defaults, options));
 };
 
 /**
@@ -73,14 +83,27 @@
  *
  * @param fromEl From element to select on, can be any kind of jQuery selector, or a jqEl
  * @param toEl To element to select on, can be any kind of jQuery selector, or a jqEl
+ * @param fromIso Convert fields from ISO 8601 to local calendar
  * @param options Additional options, will be merged with the defaults
  */
-dhis2.period.DatePicker.prototype.createRangedInstance = function( fromEl, toEl, options ) {
+dhis2.period.DatePicker.prototype.createRangedInstance = function( fromEl, toEl, fromIso, options ) {
   var mergedOptions = $.extend({}, this.defaults, options);
 
   var $fromEl = $(fromEl);
   var $toEl = $(toEl);
 
+  if( fromIso ) {
+var iso8601 = $.calendars.instance('gregorian');
+var from = iso8601.parseDate(this.format, $fromEl.val());
+var to = iso8601.parseDate(this.format, $toEl.val());
+
+var cDateFrom = this.calendar.fromJD(from.toJD());
+var cDateTo = this.calendar.fromJD(to.toJD());
+
+$fromEl.val(this.calendar.formatDate(this.format, cDateFrom));
+$toEl.val(this.calendar.formatDate(this.format, cDateTo));
+  }
+
   mergedOptions.onSelect = function( dates ) {
 if( this.id === $fromEl.attr('id') ) {
   $toEl.calendarsPicker(option, minDate, dates[0] || null);

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15150: minor js calendar fixes, removes nepali custom date format, date format is now coming from system...

2014-05-05 Thread noreply

revno: 15150
committer: Morten Olav Hansen morte...@gmail.com
branch nick: dhis2
timestamp: Mon 2014-05-05 15:51:24 +0700
message:
  minor js calendar fixes, removes nepali custom date format, date format is 
now coming from system setting
removed:
  
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.nepali.js
modified:
  
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.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-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js	2014-05-05 08:32:13 +
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js	2014-05-05 08:51:24 +
@@ -46,7 +46,20 @@
  * @see a href=http://keith-wood.name/datepick.html;http://keith-wood.name/datepick.html/a
  */
 dhis2.period.DatePicker = function( calendar, format ) {
+  if( typeof calendar === 'undefined' ) {
+if( typeof dhis2.period.calendar !== 'undefined' ) {
+  calendar = dhis2.period.calendar;
+} else {
+  throw new Error('calendar parameter is required');
+}
+  }
+
   this.calendar = calendar;
+
+  if( typeof format === 'undefined' ) {
+format = dhis2.period.DEFAULT_DATE_FORMAT;
+  }
+
   this.format = format;
 
   this.defaults = {

=== removed file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.nepali.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.nepali.js	2014-04-28 05:18:45 +
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.nepali.js	1970-01-01 00:00:00 +
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2004-2014, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-dhis2.util.namespace('dhis2.period');
-
-// HMIS period format for Nepal
-dhis2.period.DEFAULT_DATE_FORMAT = dd-mm-;

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm	2014-04-29 13:52:07 +
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm	2014-05-05 08:51:24 +
@@ -64,10 +64,6 @@
 
 script type=text/javascript src=../dhis-web-commons/javascripts/dhis2/dhis2.period.js?_rev=$!{buildRevision}/script
 
-#if( $keyCalendar == nepali )
-  script type=text/javascript src=../dhis-web-commons/javascripts/dhis2/dhis2.period.${keyCalendar}.js?_rev=$!{buildRevision}/script
-#end
-
 script type=text/javascript src=../dhis-web-commons/javascripts/jQuery/calendars/jquery.calendars.picker.min.js?_rev=$!{buildRevision}/script
 script type=text/javascript src=../dhis-web-commons/javascripts/dhis2/dhis2.selected.js?_rev=$!{buildRevision}/script
 script type=text/javascript 

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15151: [mobile] finished feedback server side

2014-05-05 Thread noreply

revno: 15151
committer: Hong Em em.hispviet...@gmail.com
branch nick: dhis2
timestamp: Mon 2014-05-05 17:16:05 +0700
message:
  [mobile] finished feedback server side
modified:
  
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/ActivityReportingService.java
  
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Message.java
  
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/MobileOrgUnitLinks.java
  
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java
  
dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/api/model/OrgUnitTest.java
  
dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/api/model/OrgUnitsTest.java
  
dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileClientController.java
  
dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileOrganisationUnitController.java


--
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-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/ActivityReportingService.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/ActivityReportingService.java	2014-04-24 07:21:13 +
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/ActivityReportingService.java	2014-05-05 10:16:05 +
@@ -33,6 +33,7 @@
 
 import org.hisp.dhis.api.mobile.model.ActivityPlan;
 import org.hisp.dhis.api.mobile.model.ActivityValue;
+import org.hisp.dhis.api.mobile.model.Message;
 import org.hisp.dhis.api.mobile.model.PatientAttribute;
 import org.hisp.dhis.api.mobile.model.LWUITmodel.LostEvent;
 import org.hisp.dhis.api.mobile.model.LWUITmodel.Notification;
@@ -98,8 +99,11 @@
 
 public Patient generateRepeatableEvent( int orgUnitId, String eventInfo )
 throws NotAllowedException;
-
+
 public String saveSingleEventWithoutRegistration( ProgramStage programStage, int orgUnitId )
 throws NotAllowedException;
 
+public String sendFeedback( Message message )
+throws NotAllowedException;
+
 }

=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Message.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Message.java	2014-04-24 09:55:26 +
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Message.java	2014-05-05 10:16:05 +
@@ -109,7 +109,8 @@
 public void serializeVersion2_8( DataOutputStream dataOutputStream )
 throws IOException
 {
-// TODO Auto-generated method stub
+dataOutputStream.writeUTF( this.subject );
+dataOutputStream.writeUTF( this.text );
 
 }
 
@@ -117,7 +118,8 @@
 public void serializeVersion2_9( DataOutputStream dataOutputStream )
 throws IOException
 {
-// TODO Auto-generated method stub
+dataOutputStream.writeUTF( this.subject );
+dataOutputStream.writeUTF( this.text );
 
 }
 
@@ -125,7 +127,8 @@
 public void serializeVersion2_10( DataOutputStream dataOutputStream )
 throws IOException
 {
-// TODO Auto-generated method stub
+dataOutputStream.writeUTF( this.subject );
+dataOutputStream.writeUTF( this.text );
 
 }
 

=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/MobileOrgUnitLinks.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/MobileOrgUnitLinks.java	2014-04-24 07:21:13 +
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/MobileOrgUnitLinks.java	2014-05-05 10:16:05 +
@@ -65,6 +65,8 @@
 
 private String updateNewVersionUrl;
 
+private String sendFeedbackUrl;
+
 private String updateContactUrl;
 
 private String findPatientUrl;
@@ -90,7 +92,7 @@
 private String handleLostToFollowUpUrl;
 
 private String generateRepeatableEventUrl;
-
+
 private String uploadSingleEventWithoutRegistration;
 
 @XmlAttribute
@@ -215,6 +217,16 @@
 this.updateNewVersionUrl = updateNewVersionUrl;
 }
 
+public String getSendFeedbackUrl()
+{
+return sendFeedbackUrl;
+}
+
+public void setSendFeedbackUrl( String sendFeedbackUrl )
+{
+this.sendFeedbackUrl = sendFeedbackUrl;
+}
+
 public String getUpdateContactUrl()
 {
 return updateContactUrl;
@@ -344,7 +356,7 @@
 {
 

[Dhis2-devs] Unique dataset section name

2014-05-05 Thread Aravind Muralikrishnan
Hello all,

We are customising DHIS2 for MSF, and we have a scenario in which we have 2
different data sets having a data set section each, with the same name.

Ex:
* Consultation (Data set section) under OPD-General (Dataset)
* Consultation (Data set section) under OPD-Chronic (Dataset)

We saw that we have a unique constraint on the data set section name.

Also when we tried to work around this by trying to add an attribute to
dataset section, called display name, we found out that, we cannot add
attributes to dataset section.

Is there another way to model this?
Also it would be helpful for us to understand the rationale behind the
unique constraint on data set section name, and attributes for data set
section.

Thanks,
Aravind
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] Unique dataset section name

2014-05-05 Thread Lars Helge Øverland
Hi Aravind,

good point. There is actually a Hibernate-managed uniqueness constraint
covering both datasetid + name, and hence there should not be a uniqueness
constraint on name only. I have removed it in trunk and 2.15 now.

Does this imply that you do not need attributes for sections?

regards,

Lars



On Mon, May 5, 2014 at 12:38 PM, Aravind Muralikrishnan 
aravi...@thoughtworks.com wrote:

 Hello all,

 We are customising DHIS2 for MSF, and we have a scenario in which we have
 2 different data sets having a data set section each, with the same name.

 Ex:
 * Consultation (Data set section) under OPD-General (Dataset)
 * Consultation (Data set section) under OPD-Chronic (Dataset)

 We saw that we have a unique constraint on the data set section name.

 Also when we tried to work around this by trying to add an attribute to
 dataset section, called display name, we found out that, we cannot add
 attributes to dataset section.

 Is there another way to model this?
 Also it would be helpful for us to understand the rationale behind the
 unique constraint on data set section name, and attributes for data set
 section.

 Thanks,
 Aravind

 ___
 Mailing list: https://launchpad.net/~dhis2-devs
 Post to : dhis2-devs@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~dhis2-devs
 More help   : https://help.launchpad.net/ListHelp


___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] Technical Development

2014-05-05 Thread Montwedi Makgetla
My name is Montwedi Bushy Makgetla and i am currently working for Ministry
of Health Botswana, under the department of Corporate Services and also the
department of Health Policy Development, Monitoring and Evaluation as the
Human Resource Information System (iHRIS) Administrator. iHRIS is a project
funded by Intrahealth and Capacity Plus(USAID).

I would like to learn more about DHIS2 and be a team member to work with
DHIS2 technically and for development as part of capacity building in order
to support the project in Botswana.

Looking forward to hear from you soon

kind regards

-- 
Montwedi B Makgetla

monttyb...@gmail.com
Skype: Montwedi B Makgetla
Botswana: +267 71257986
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Bug 1316130] [NEW] DHIS2 UPGRADE ASSISSTANCE NEEDED

2014-05-05 Thread akanji abiodun
Public bug reported:

Good day house;

I am currently working on DHIS2.10 and i want to upgrade to DHIS2.14 for some 
reasons.
 I have tried using the upgrade script but to no avail, so  i will appreciate 
if you can assist me on this please.

Thanks.

** Affects: dhis2
 Importance: Undecided
 Status: New

-- 
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1316130

Title:
  DHIS2 UPGRADE ASSISSTANCE NEEDED

Status in DHIS 2:
  New

Bug description:
  Good day house;

  I am currently working on DHIS2.10 and i want to upgrade to DHIS2.14 for some 
reasons.
   I have tried using the upgrade script but to no avail, so  i will appreciate 
if you can assist me on this please.

  Thanks.

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1316130/+subscriptions

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Bug 1316130] Re: DHIS2 UPGRADE ASSISSTANCE NEEDED

2014-05-05 Thread akanji abiodun
** Description changed:

  Good day house;
  
  I am currently working on DHIS2.10 and i want to upgrade to DHIS2.14 for some 
reasons.
-  I have tried using the upgrade script but to no avail, so  i will appreciate 
if you can assist me on this please.
+  I have tried using the upgrade script but to no avail, so  i will appreciate 
if you can assist me on this please.
  
  Thanks.

-- 
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1316130

Title:
  DHIS2 UPGRADE ASSISSTANCE NEEDED

Status in DHIS 2:
  New

Bug description:
  Good day house;

  I am currently working on DHIS2.10 and i want to upgrade to DHIS2.14 for some 
reasons.
   I have tried using the upgrade script but to no avail, so  i will appreciate 
if you can assist me on this please.

  Thanks.

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1316130/+subscriptions

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Bug 1314233] Re: Skin Care Treatment

2014-05-05 Thread Colin Watson
** Project changed: dhis2 = null-and-void

** Changed in: null-and-void
   Status: New = Invalid

** Information type changed from Public to Private Security

-- 
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1314233

Title:
  Skin Care Treatment

Status in NULL Project:
  Invalid

Bug description:
  There are a vast limit of resources that will helpfulness you ameliorate your 
skin both on the Cyberspace and offline. What you really requirement is 
straight-forward advice that not only totality, but fits in your account. This 
article module give you recyclable accumulation that is soul cozy and 
unproblematic to do.
  If you hurt from very dry strip, examine exfoliating formerly a week to 
reserve pores withdraw. Exfoliation removes dead tegument and allows new pare 
to work. The choose, unspoilt cells underneath can then hap through, which 
leaves rind hunting radiant.
  Protect your strip by applying sunscreen or cosmetics with SPF 15 or higher. 
Sunblock is the basic way to keep sunburns, peeling tegument and wrinkles. 
Regular use of emollient slows the senescent transform, sharing you younger, 
healthier-looking peel.
  Canvass the advice in this article for advice on how to amend the symptoms of 
eruption. Do not use any detergents or lotions that are heavily fragrant. 
Wares, hit careful that you are exclusive act clothes made out of shrub. 
Synthetical fibers and fabric fabrics can variety your eczema symptoms 
worsened. Use rude make-ups that hold no stylised dyes or chemicals. By 
implementing whatsoever of these tips, you can love little miffed tegument, 
which gift experience less flare-ups.  Miracle Phytoceramides
  Fastness hands covered in the vasoconstrictor. Your safekeeping get thinner 
injure which mak es them unresistant to cracking or aggression. Handwear will 
restraint in the moisture and turn your even of assuage.
  Your safekeeping can get dry from work them. Tidy it a show to use hand elite 
whenever your guardianship get wet. This can service to dungeon them 
moisturized. This give service your safekeeping be overnice and even. 
Deliberate purchasing a steering size aid cure and applying it after lavation 
in people restrooms.
  Consider it or not, both wound assist products can actually be worsened for 
your skin than the surface factors that you are disagreeable to combat. To 
abstain dry cutis, elite embody washes that hold vitamins and moisturizers. 
Moisturizers assure that your injure has the decorous moisture balance, and 
vitamins record your pare levelheaded and well-nourished.
  Put sunblock on by using a invertebrate. The assimilator method will support 
forbid the sticky, sometimes syrupy intuition, that can originate with dispense 
ointment to your tackling. This can precede to a surmount sheet of indorsement 
when out in the sun.
  Plain artifact humour contains raw lightening properties. Practical to your 
cutis where you hump a darkened maculation or a disfigure, yellow humor will 
assist lighten them and shrink their saliency. While apiece direction only 
lasts a day, it's nevertheless a gimcrack and rubicund secondary to chemical 
bleaching products.
  Using olive oil for strip desire is nothing new. Olive oil has had its uses 
in injure mind dating all the way position to Cleopatra's term. Tasty and 
useable, olive oil is a multipurpose staple symbol. Olive oil moisturizes the 
rind, creates a lusty experience and can forbear moisten dry and brickly 
fingernails or toenails. It can also be used to healthiness the tomentum and 
change the hap.
  http://miraclephytoceramidestry.com/

To manage notifications about this bug go to:
https://bugs.launchpad.net/null-and-void/+bug/1314233/+subscriptions

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Bug 1314158] Re: Skin Care Health Products

2014-05-05 Thread Colin Watson
** Project changed: dhis2 = null-and-void

** Changed in: null-and-void
   Status: New = Invalid

** Information type changed from Public to Private Security

-- 
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1314158

Title:
  Skin Care Health Products

Status in NULL Project:
  Invalid

Bug description:
  it'll also idea you don't screw to swear a makeup out with you and this is 
the surmount one that the tegument closing the max can terminate intelligent 
one is also a rattling close the plate is a little bit of amount and younger 
bit daylight out and as it's a angelic why she got rattling obedient peel 
naturally if you do guide a displace makeup an species in a liquid groundwork 
or you mightiness necessity to suffer something same these and nurturing 
intensity writing these majuscule because the truly handy and you can honorable 
takeoff the concept whatsoever situation you necessary and conscionable cater 
your grappling a slight withhold throughout the day so I think most probably 
penury one manus just the paw occurrence he on to separate two and that sneak 
and again it depends on your tegument echt lyre you'd go for vindicatory having 
a soft mirrored. Miracle Phytoceramides
  Penn perfect for shadows under the eyes and also me around the spokesperson 
and shadowy areas does broach slight bit and real nonaged imperfections if 
you've got author blemishes all pigmentation and things that solitary won't do 
the job and in that casing you probably requirement something with a soft bit 
writer foggy sum I was circulate this around me my underground hiding because 
am it's rattling accessible to use for touch-upland its it to be long-lasting 
then again she beggary equal writer amount something equivalent caramel ass 
sneaking or Edmond we could hits while that for that so subdivision 3 in this 
is our eyes I consider you can grow a padded as you search and your lives in 
one and then it's it's great I average perfect active economics the emblem use 
the soft toiletry their then you cause the additional applier up a slight.
  I can't verbalise and feel them in this one's I conclude truly sound for me 
in this is abet theologist business go on and it's conscionable to do I for 
eyes but they I could use that on my browns and my eyes and I could use that to 
line as comfortably so uncovering something that you've console got everything 
in one is fair so functional to travel up the healthy process in status of 
pencils I rattling reckon treatise unreal it's the Dual christian and this has 
phytologist one end and ignominious the otherwise so it can be prizewinning he 
can dote brown during the day and then you human to go out transparent from 
wreak each volume but the inglorious on could flat do be pretty some fair 
change you I but that on its own so on if you're somebody at just once 
advantageous eye pencil and doesn't change necessary if your feature freaking 
demon this is Renee to survey this on.
  http://miraclephytoceramidestry.com/

To manage notifications about this bug go to:
https://bugs.launchpad.net/null-and-void/+bug/1314158/+subscriptions

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Bug 1314166] Re: Skin Diseases Like Atopic Dermatitis and Forehead Wrinkles

2014-05-05 Thread Colin Watson
** Project changed: dhis2 = null-and-void

** Changed in: null-and-void
   Status: New = Invalid

** Information type changed from Public to Private Security

-- 
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1314166

Title:
  Skin Diseases Like Atopic Dermatitis and Forehead Wrinkles

Status in NULL Project:
  Invalid

Bug description:
  With the support of comely treatments, creams and ointments anyone can 
examine tegument diseases. We all eff that if our tegument is robust, we 
experience positive and it helps us a lot in touching out and breakfast new 
people.
  Atopic dermatitis is a identify of a wound disease renowned as eruption in 
which the rind reacts abnormally and easily to the environmental irritants, 
allergens and foods. Atopic dermatitis mainly occurs in the children and people 
who are low the age of 30 years. In it, the rind becomes red, itchy and 
flakyand it becomes many exposed to bacterial transmission. This is the write 
of eruption which can happen on varied parts of the body. Withal, the most 
popular areas that get elocutionary are guardianship, ankles, feet, neck, play, 
speed pectus and carpus. Sometimes it also occurs on the eyelids and the injure 
around the eyes.It should be preserved with nifty atopic dermatitis 
communicating in period.
  There are no puritanical reasons for the crusade of atopic dermatitisbut one 
of the animated or weighty and noted factors is the unfit function of 
insusceptible group. It can also befall and pass as a cipher of using 
detergents, ghb, condensation secreted and wearing ornaments may be a constant 
too. But this disease can be vulcanised with dermatitis treatmentin which the 
physician considers the information of the disease. The aim of this dermatitis 
treatmentis to refrain the itching, injure symptom piece action the premise 
from getting worse.
  There is another typewrite of peel disease that galore group are coat which 
causes the feature wrinkles. This disease occurs mostly to the group over 30 
life or 40 period of age, or when a mortal starts to get senior.This is one of 
the reasons why people conceive uncomfortablein events and gatherings. But, 
since thetechnology and ability is developing so abstinence, there are galore 
solutions to fag these wrinkles on lineament. One of the primary reasons of 
this disease is the want of wetness. Pare get breakable when it dries up and 
then wrinkles appear, thus, ownership your strip moisturized can aid the 
lineament wrinkles easily.
  Group who are unhappy from this disease can also go for facial exercises. 
With the ameliorate of these exercises, grouping can easily tighten their pare. 
If the exertion is decent done it can also change the looks and can urinate the 
uncomfortable parts fewer prominent. But, along with these exercises it is also 
discriminating to go for a correct direction of wrinkles on feature.A lusty 
tegument can fell your age and testament provide you see junior and you think 
junior as comfortably.
  http://miraclephytoceramidestry.com/

To manage notifications about this bug go to:
https://bugs.launchpad.net/null-and-void/+bug/1314166/+subscriptions

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15153: Remove the timestamp of data attribute values in TEI list of Find/Add TEI, Visit schedule, Lost t...

2014-05-05 Thread noreply

revno: 15153
committer: Tran Chau tran.hispviet...@gmail.com
branch nick: dhis2
timestamp: Mon 2014-05-05 23:31:54 +0800
message:
  Remove the timestamp of data attribute values in TEI list of Find/Add TEI, 
Visit schedule, Lost to follow up
modified:
  
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js
  
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/form.js
  
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js
  
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/trackedEntityInstance.js


--
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-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js	2014-04-24 16:30:48 +
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js	2014-05-05 15:31:54 +
@@ -87,6 +87,7 @@
 	// Yes/No and Yes Only attributes in result
 	
 	var attList = new Array();
+	var attDate = new Array();
 	$('#attributeIds option').each(function(i, item) {
 		var valueType = $(item).attr('valueType');
 		var value = $(item).val();
@@ -97,6 +98,13 @@
 }
 			}
 		}
+		else if ( valueType == 'date' ) {
+			for (var i = idx; i  json.width; i++) {
+if( value==json.headers[i].name ){
+	attDate.push(i);
+}
+			}
+		}
 	});
 	
 	// TEI list
@@ -107,7 +115,6 @@
 		table += col /;
 	}	
 	
-	
 	table += col width='200' /;
 	table += theadtrth#/th;
 	for (var i = idx; i  json.width; i++) {
@@ -129,9 +136,14 @@
 			if (j == 4) {
 colVal = json.metaData.names[colVal];
 			}
+			
 			if( jQuery.inArray( j, attList )=0  colVal!= ){
 colVal = (colVal=='true')? i18n_yes : i18n_no;
 			}
+			else if( jQuery.inArray( j, attDate )=0  colVal!= ){
+colVal = colVal.split(' ')[0];
+			}
+			
 			table += td onclick=\javascript:isDashboard=true;showTrackedEntityInstanceDashboardForm( '
 + uid
 + ' )\ title='

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/form.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/form.js	2014-04-30 12:57:22 +
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/form.js	2014-05-05 15:31:54 +
@@ -193,7 +193,8 @@
 	if (json.metaData.pager.total  0) {
 		table += p + i18n_total_result +  :  + json.metaData.pager.total
 + /p;
-	} else {
+	}
+	else {
 		table += p + i18n_no_result_found + /p;
 	}
 	
@@ -211,13 +212,21 @@
 	// Yes/No and Yes Only attributes in result
 	
 	var attList = new Array();
+	var attDate = new Array();
 	$('#attributeIds option').each(function(i, item) {
 		var valueType = $(item).attr('valueType');
 		var value = $(item).val();
 		if ( valueType == 'bool' || valueType == 'trueOnly' ) {
+			for ( var i = idx; i  json.width; i++ ) {
+if( value==json.headers[i].name ){
+	attList.push(i);
+}
+			}
+		}
+		else if ( valueType == 'date' ) {
 			for (var i = idx; i  json.width; i++) {
 if( value==json.headers[i].name ){
-	attList.push(i);
+	attDate.push(i);
 }
 			}
 		}
@@ -254,6 +263,9 @@
 			if( jQuery.inArray( j, attList )=0  colVal!= ){
 colVal = (colVal=='true')? i18n_yes : i18n_no;
 			}
+			else if( jQuery.inArray( j, attDate )=0  colVal!= ){
+colVal = colVal.split(' ')[0];
+			}
 			
 			table += td onclick=\javascript:isDashboard=true;showUpdateEventForm( '
 + uid

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js	2014-04-24 16:30:48 +
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js	2014-05-05 15:31:54 +
@@ -108,7 +108,6 @@
 		table += p + i18n_no_result_found + /p;
 	}
 	
-	
 	table += table class='listTable' width='100%';
 	
 	var idx = 4;
@@ -122,6 +121,7 @@
 	// Yes/No and Yes Only attributes in result
 	
 	var attList = new Array();
+	var attDate = new Array();
 	$('#attributeIds option').each(function(i, item) {
 		var valueType = $(item).attr('valueType');
 		var value = $(item).val();
@@ -132,6 +132,13 @@
 }
 			}
 		}
+		else if ( valueType == 'date' ) {
+			for (var i = idx; i  json.width; i++) {
+if( value==json.headers[i].name ){
+	attDate.push(i);
+}
+			}
+		}
 	});
 	
 	// TEI list
@@ -165,6 +172,9 @@
 			if( jQuery.inArray( j, attList )=0  colVal!= ){
 colVal = (colVal=='true')? i18n_yes 

Re: [Dhis2-devs] Validation rule with yes/no and number

2014-05-05 Thread Lars Helge Øverland
Agree with Jason here.

Olav the compulsory pair operator for validation rules could be useful
here.

Lars



On Fri, May 2, 2014 at 3:14 PM, Jason Pickering jason.p.picker...@gmail.com
 wrote:

 Not sure if the Compulsory pair works for this case, but it should.

 On the other hand, it would seem little point to record Element A, as if
 Element B is non-zero, it already indicates that there was a stockout.

 Regards,
 Jason



 On Fri, May 2, 2014 at 7:39 PM, Olav Poppe olav.po...@me.com wrote:

 Hi,
 is it possible to create a validation rule with a yes/no data element and
 number type data element?

 For example:
 Element A: Was the facility out of stock?
 Element B: If yes, for how many days?

 I would like to validate that Element B is only filled if the value for
 Element A is yes. Is this possible?

 Regards,
 Olav

 ___
 Mailing list: https://launchpad.net/~dhis2-devs
 Post to : dhis2-devs@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~dhis2-devs
 More help   : https://help.launchpad.net/ListHelp



 ___
 Mailing list: https://launchpad.net/~dhis2-devs
 Post to : dhis2-devs@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~dhis2-devs
 More help   : https://help.launchpad.net/ListHelp


___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15154: Deprecation fixes

2014-05-05 Thread noreply

revno: 15154
committer: Lars Helge Overland larshe...@gmail.com
branch nick: dhis2
timestamp: Mon 2014-05-05 20:01:22 +0200
message:
  Deprecation fixes
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/PeriodService.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/StreamingJsonDataValueSet.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/filter/ops/NeqOp.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/utils/JacksonUtils.java
  
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/DefaultImportService.java


--
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-api/src/main/java/org/hisp/dhis/period/PeriodService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/PeriodService.java	2014-04-28 08:53:08 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/PeriodService.java	2014-05-05 18:01:22 +
@@ -32,9 +32,7 @@
 import java.util.Date;
 import java.util.List;
 
-import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.i18n.I18nFormat;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
 
 /**
  * @author Kristian Nordal

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java	2014-04-20 19:17:42 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java	2014-05-05 18:01:22 +
@@ -241,7 +241,7 @@
 public void writeDataValueSetTemplate( OutputStream out, DataSet dataSet, Period period, ListString orgUnits,
 boolean comment, String orgUnitIdScheme, String dataElementIdScheme ) throws IOException
 {
-ToXmlGenerator generator = (ToXmlGenerator) JacksonUtils.getXmlMapper().getJsonFactory().createJsonGenerator( out );
+ToXmlGenerator generator = (ToXmlGenerator) JacksonUtils.getXmlMapper().getFactory().createGenerator( out );
 
 try
 {

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/StreamingJsonDataValueSet.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/StreamingJsonDataValueSet.java	2014-03-18 08:10:10 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/StreamingJsonDataValueSet.java	2014-05-05 18:01:22 +
@@ -48,7 +48,7 @@
 {
 try
 {
-generator = JacksonUtils.getJsonMapper().getJsonFactory().createJsonGenerator( out );
+generator = JacksonUtils.getJsonMapper().getFactory().createGenerator( out );
 generator.writeStartObject();
 }
 catch ( IOException ignored )

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/filter/ops/NeqOp.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/filter/ops/NeqOp.java	2014-03-18 08:10:10 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/filter/ops/NeqOp.java	2014-05-05 18:01:22 +
@@ -43,15 +43,14 @@
 op.setValue( getValue() );
 OpStatus status = op.evaluate( object );
 
-// switch status from EqOp
 switch ( status )
 {
 case INCLUDE:
 return OpStatus.EXCLUDE;
 case EXCLUDE:
 return OpStatus.INCLUDE;
+default:
+return OpStatus.IGNORE;
 }
-
-return OpStatus.IGNORE;
 }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/utils/JacksonUtils.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/utils/JacksonUtils.java	2014-03-25 13:20:56 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/utils/JacksonUtils.java	2014-05-05 18:01:22 +
@@ -89,7 +89,7 @@
 objectMapper.disable( MapperFeature.AUTO_DETECT_IS_GETTERS );
 }
 
-jsonMapper.getJsonFactory().enable( JsonGenerator.Feature.QUOTE_FIELD_NAMES );
+jsonMapper.getFactory().enable( JsonGenerator.Feature.QUOTE_FIELD_NAMES );
 xmlMapper.configure( ToXmlGenerator.Feature.WRITE_XML_DECLARATION, true );
 
 // Register view classes

=== modified file 

Re: [Dhis2-devs] [DHIS2 Indicators] TRUNC function for Converting Numbers with Decimals to Integers.

2014-05-05 Thread Adebusoye Anifalaje
It would be great to use for the web pivot, visualiser and GIS. Any chance it’s 
a quick and easy function to implement?

Busoye

On 5 May 2014, at 19:10, Lars Helge Øverland larshe...@gmail.com wrote:

 Hi Busoye,
 
 yes agree that would be useful. Are you referring to web pivot table now? 
 
 Lars
 
 
 
 On Thu, May 1, 2014 at 11:16 PM, Adebusoye Anifalaje bus...@hisp.org wrote:
 Hi,
 
 Can anyone advise on how to get the equivalent of the TRUNC function in Excel 
 in DHIS2 indicators?
 
 We have defined indicators for estimating population but have to contend 
 decimals which is not ideal. This function to convert numbers to integers 
 would be quite neat.
 
 
 Thanks
 
 Busoye
 
 Version 2.15
 Build: 14986
 
 
 
 ___
 Mailing list: https://launchpad.net/~dhis2-devs
 Post to : dhis2-devs@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~dhis2-devs
 More help   : https://help.launchpad.net/ListHelp
 

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] Validation rule with yes/no and number

2014-05-05 Thread Olav Poppe
Sorry, forgot to reply to your earlier suggestion Jason. Agree that it is no 
really necessary, but it can be difficult to convince people of that…

As for the compulsory pair, I though that would only ensure that there is some 
value in both fields - but what I need is to ensure that if A is «no», the B 
SHOULD be empty - and if a is «yes», it should NOT be empty. Can I do that with 
a compulsory pair?


5. mai 2014 kl. 15:50 skrev Lars Helge Øverland larshe...@gmail.com:

 Agree with Jason here.
 
 Olav the compulsory pair operator for validation rules could be useful here.
 
 Lars
 
 
 
 On Fri, May 2, 2014 at 3:14 PM, Jason Pickering jason.p.picker...@gmail.com 
 wrote:
 Not sure if the Compulsory pair works for this case, but it should. 
 
 On the other hand, it would seem little point to record Element A, as if 
 Element B is non-zero, it already indicates that there was a stockout. 
 
 Regards,
 Jason
 
 
 
 On Fri, May 2, 2014 at 7:39 PM, Olav Poppe olav.po...@me.com wrote:
 Hi,
 is it possible to create a validation rule with a yes/no data element and 
 number type data element?
 
 For example:
 Element A: Was the facility out of stock?
 Element B: If yes, for how many days?
 
 I would like to validate that Element B is only filled if the value for 
 Element A is yes. Is this possible?
 
 Regards,
 Olav
 
 ___
 Mailing list: https://launchpad.net/~dhis2-devs
 Post to : dhis2-devs@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~dhis2-devs
 More help   : https://help.launchpad.net/ListHelp
 
 
 ___
 Mailing list: https://launchpad.net/~dhis2-devs
 Post to : dhis2-devs@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~dhis2-devs
 More help   : https://help.launchpad.net/ListHelp
 
 

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15156: add nnull (not null) operator to filter

2014-05-05 Thread noreply

revno: 15156
committer: Morten Olav Hansen morte...@gmail.com
branch nick: dhis2
timestamp: Tue 2014-05-06 10:02:33 +0700
message:
  add nnull (not null) operator to filter
added:
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/filter/ops/NnullOp.java
modified:
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/filter/OpFactory.java


--
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-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/filter/OpFactory.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/filter/OpFactory.java	2014-03-18 08:10:10 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/filter/OpFactory.java	2014-05-06 03:02:33 +
@@ -37,6 +37,7 @@
 import org.hisp.dhis.dxf2.filter.ops.LtOp;
 import org.hisp.dhis.dxf2.filter.ops.LteOp;
 import org.hisp.dhis.dxf2.filter.ops.NeqOp;
+import org.hisp.dhis.dxf2.filter.ops.NnullOp;
 import org.hisp.dhis.dxf2.filter.ops.NullOp;
 import org.hisp.dhis.dxf2.filter.ops.Op;
 
@@ -59,6 +60,7 @@
 register( lt, LtOp.class );
 register( lte, LteOp.class );
 register( null, NullOp.class );
+register( nnull, NnullOp.class );
 register( empty, EmptyCollectionOp.class );
 }
 

=== added file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/filter/ops/NnullOp.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/filter/ops/NnullOp.java	1970-01-01 00:00:00 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/filter/ops/NnullOp.java	2014-05-06 03:02:33 +
@@ -0,0 +1,52 @@
+package org.hisp.dhis.dxf2.filter.ops;
+
+/*
+ * Copyright (c) 2004-2014, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * Neither the name of the HISP project nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+* @author Morten Olav Hansen morte...@gmail.com
+*/
+public class NnullOp extends Op
+{
+@Override
+public boolean wantValue()
+{
+return false;
+}
+
+@Override
+public OpStatus evaluate( Object object )
+{
+if ( object != null )
+{
+return OpStatus.INCLUDE;
+}
+
+return OpStatus.IGNORE;
+}
+}

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15157: change viewClass settings in message class

2014-05-05 Thread noreply

revno: 15157
committer: Morten Olav Hansen morte...@gmail.com
branch nick: dhis2
timestamp: Tue 2014-05-06 10:12:46 +0700
message:
  change viewClass settings in message class
modified:
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/message/Message.java


--
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-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/message/Message.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/message/Message.java	2014-03-18 08:10:10 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/message/Message.java	2014-05-06 03:12:46 +
@@ -71,7 +71,6 @@
 }
 
 @JsonProperty
-@JsonView( {DetailedView.class} )
 @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
 public String getSubject()
 {
@@ -84,7 +83,6 @@
 }
 
 @JsonProperty
-@JsonView( {DetailedView.class} )
 @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
 public String getText()
 {
@@ -98,6 +96,7 @@
 
 @JsonProperty
 @JsonSerialize( contentAs = BaseIdentifiableObject.class )
+@JsonView( { DetailedView.class } )
 @JacksonXmlElementWrapper( localName = organisationUnits, namespace = DxfNamespaces.DXF_2_0 )
 @JacksonXmlProperty( localName = organisationUnit, namespace = DxfNamespaces.DXF_2_0 )
 public SetOrganisationUnit getOrganisationUnits()
@@ -112,6 +111,7 @@
 
 @JsonProperty
 @JsonSerialize( contentAs = BaseIdentifiableObject.class )
+@JsonView( { DetailedView.class } )
 @JacksonXmlElementWrapper( localName = users, namespace = DxfNamespaces.DXF_2_0 )
 @JacksonXmlProperty( localName = user, namespace = DxfNamespaces.DXF_2_0 )
 public SetUser getUsers()
@@ -126,6 +126,7 @@
 
 @JsonProperty
 @JsonSerialize( contentAs = BaseIdentifiableObject.class )
+@JsonView( { DetailedView.class } )
 @JacksonXmlElementWrapper( localName = userGroups, namespace = DxfNamespaces.DXF_2_0 )
 @JacksonXmlProperty( localName = userGroup, namespace = DxfNamespaces.DXF_2_0 )
 public SetUserGroup getUserGroups()

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15158: minor stylechange in js period generator

2014-05-05 Thread noreply

revno: 15158
committer: Morten Olav Hansen morte...@gmail.com
branch nick: dhis2
timestamp: Tue 2014-05-06 10:32:53 +0700
message:
  minor stylechange in js period generator
modified:
  
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js


--
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-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js	2014-05-05 08:51:24 +
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js	2014-05-06 03:32:53 +
@@ -54,21 +54,21 @@
 }
   }
 
-  this.calendar = calendar;
-
   if( typeof format === 'undefined' ) {
 format = dhis2.period.DEFAULT_DATE_FORMAT;
   }
 
-  this.format = format;
-
-  this.defaults = {
-calendar: this.calendar,
-dateFormat: this.format,
-showAnim: '',
-maxDate: this.calendar.today(),
-yearRange: 'c-100:c+100'
-  };
+  $.extend(this, {
+calendar: calendar,
+format: format,
+defaults: {
+  calendar: calendar,
+  dateFormat: format,
+  showAnim: '',
+  maxDate: calendar.today(),
+  yearRange: 'c-100:c+100'
+}
+  });
 };
 
 /**
@@ -156,23 +156,23 @@
 format = dhis2.period.DEFAULT_DATE_FORMAT;
   }
 
-  this.calendar = calendar;
-
-  this.format = format;
-
-  this.generators = {
-Daily: dhis2.period.makeDailyPeriodGenerator(calendar, format),
-Weekly: dhis2.period.makeWeeklyPeriodGenerator(calendar, format),
-Monthly: dhis2.period.makeMonthlyPeriodGenerator(calendar, format),
-BiMonthly: dhis2.period.makeBiMonthlyPeriodGenerator(calendar, format),
-Quarterly: dhis2.period.makeQuarterlyPeriodGenerator(calendar, format),
-SixMonthly: dhis2.period.makeSixMonthlyPeriodGenerator(calendar, format),
-SixMonthlyApril: dhis2.period.makeSixMonthlyAprilPeriodGenerator(calendar, format),
-Yearly: dhis2.period.makeYearlyPeriodGenerator(calendar, format),
-FinancialApril: dhis2.period.makeFinancialAprilPeriodGenerator(calendar, format),
-FinancialJuly: dhis2.period.makeFinancialJulyPeriodGenerator(calendar, format),
-FinancialOct: dhis2.period.makeFinancialOctoberPeriodGenerator(calendar, format)
-  };
+  $.extend(this, {
+calendar: calendar,
+format: format,
+generators: {
+  Daily: dhis2.period.makeDailyPeriodGenerator(calendar, format),
+  Weekly: dhis2.period.makeWeeklyPeriodGenerator(calendar, format),
+  Monthly: dhis2.period.makeMonthlyPeriodGenerator(calendar, format),
+  BiMonthly: dhis2.period.makeBiMonthlyPeriodGenerator(calendar, format),
+  Quarterly: dhis2.period.makeQuarterlyPeriodGenerator(calendar, format),
+  SixMonthly: dhis2.period.makeSixMonthlyPeriodGenerator(calendar, format),
+  SixMonthlyApril: dhis2.period.makeSixMonthlyAprilPeriodGenerator(calendar, format),
+  Yearly: dhis2.period.makeYearlyPeriodGenerator(calendar, format),
+  FinancialApril: dhis2.period.makeFinancialAprilPeriodGenerator(calendar, format),
+  FinancialJuly: dhis2.period.makeFinancialJulyPeriodGenerator(calendar, format),
+  FinancialOct: dhis2.period.makeFinancialOctoberPeriodGenerator(calendar, format)
+}
+  });
 };
 
 /**

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15159: minor cleanup in dhis2.* js files

2014-05-05 Thread noreply

revno: 15159
committer: Morten Olav Hansen morte...@gmail.com
branch nick: dhis2
timestamp: Tue 2014-05-06 10:55:23 +0700
message:
  minor cleanup in dhis2.* js files
modified:
  
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.availability.js
  
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.comparator.js
  
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.contextmenu.js
  
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js
  
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.selected.js
  
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.sharing.js
  
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.storage.js
  
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.trigger.js
  
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.util.js
  
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.validation.js


--
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-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.availability.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.availability.js	2013-11-27 17:34:02 +
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.availability.js	2014-05-06 03:55:23 +
@@ -1,5 +1,7 @@
+use strict;
+
 /*
- * Copyright (c) 2004-2013, University of Oslo
+ * Copyright (c) 2004-2014, University of Oslo
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -26,7 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-dhis2.util.namespace( 'dhis2.availability' );
+dhis2.util.namespace('dhis2.availability');
 
 dhis2.availability._isAvailable = -1;
 dhis2.availability._isLoggedIn = -1;
@@ -35,110 +37,96 @@
 /**
  * Start availability check, will trigger dhis2.online / dhis2.offline events
  * when availability changes.
- * 
+ *
  * @param onlineInterval How often to check for availability when online,
  *default is 1.
  * @param offlineInterval How often to check for availability when offline,
  *default is 1000.
  */
-dhis2.availability.startAvailabilityCheck = function( onlineInterval, offlineInterval )
-{
-onlineInterval = onlineInterval ? onlineInterval : 1;
-offlineInterval = offlineInterval ? offlineInterval : 1000;
-
-function _checkAvailability()
-{
-$.ajax( {
-url : ../dhis-web-commons-stream/ping.action,
-cache : false,
-timeout: 1,
-		dataType : text,
-success : function( data, textStatus, jqXHR )
-{
-try {
-data = JSON.parse(data);
-} catch(e) {}
-
-dhis2.availability._isAvailable = true;
-var loggedIn = data.loggedIn ? true : false;
-
-if ( loggedIn != dhis2.availability._isLoggedIn )
-{
-dhis2.availability._isLoggedIn = loggedIn;
-$( document ).trigger( dhis2.online, [ loggedIn ] );
-}
-},
-error : function( jqXHR, textStatus, errorThrown )
-{
-if ( dhis2.availability._isAvailable )
-{
-dhis2.availability._isAvailable = false;
-dhis2.availability._isLoggedIn = -1;
-$( document ).trigger( dhis2.offline );
-}
-},
-	complete : function()
-	{
-	if ( dhis2.availability._isAvailable )
-	{
-	dhis2.availability._availableTimeoutHandler = setTimeout( _checkAvailability, onlineInterval );
-	}
-	else
-	{
-	dhis2.availability._availableTimeoutHandler = setTimeout( _checkAvailability, offlineInterval );
-	}
-	}
-} );
-}
-
-// use 500ms for initial check
-_availableTimeoutHandler = setTimeout( _checkAvailability, 500 );
+dhis2.availability.startAvailabilityCheck = function( onlineInterval, offlineInterval ) {
+  onlineInterval = onlineInterval ? onlineInterval : 1;
+  offlineInterval = 

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15160: minor simplification in period js generator

2014-05-05 Thread noreply

revno: 15160
committer: Morten Olav Hansen morte...@gmail.com
branch nick: dhis2
timestamp: Tue 2014-05-06 11:09:19 +0700
message:
  minor simplification in period js generator
modified:
  
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js


--
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-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js	2014-05-06 03:55:23 +
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js	2014-05-06 04:09:19 +
@@ -102,7 +102,7 @@
  * @param options Additional options, will be merged with the defaults
  */
 dhis2.period.DatePicker.prototype.createRangedInstance = function( fromEl, toEl, fromIso, options ) {
-  var mergedOptions = $.extend({}, this.defaults, options);
+  var mergedOptions = $.extend({}, this.defaults, options || {});
 
   var $fromEl = $(fromEl);
   var $toEl = $(toEl);
@@ -150,13 +150,8 @@
  * @constructor
  */
 dhis2.period.PeriodGenerator = function( calendar, format ) {
-  if( typeof calendar === 'undefined' ) {
-calendar = dhis2.period.calendar;
-  }
-
-  if( typeof format === 'undefined' ) {
-format = dhis2.period.DEFAULT_DATE_FORMAT;
-  }
+  calendar = calendar || dhis2.period.calendar;
+  format = format || dhis2.period.DEFAULT_DATE_FORMAT;
 
   $.extend(this, {
 calendar: calendar,

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15161: minor error check in PeriodGenerator constructor

2014-05-05 Thread noreply

revno: 15161
committer: Morten Olav Hansen morte...@gmail.com
branch nick: dhis2
timestamp: Tue 2014-05-06 11:11:23 +0700
message:
  minor error check in PeriodGenerator constructor
modified:
  
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js


--
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-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js	2014-05-06 04:09:19 +
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js	2014-05-06 04:11:23 +
@@ -153,6 +153,10 @@
   calendar = calendar || dhis2.period.calendar;
   format = format || dhis2.period.DEFAULT_DATE_FORMAT;
 
+  if( typeof calendar === 'undefined' ) {
+throw new Error('calendar parameter was not provided or is undefined, and no global dhis2.period.calendar instance exists.')
+  }
+
   $.extend(this, {
 calendar: calendar,
 format: format,

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15163: change parameter names in period js generator

2014-05-05 Thread noreply

revno: 15163
committer: Morten Olav Hansen morte...@gmail.com
branch nick: dhis2
timestamp: Tue 2014-05-06 12:08:44 +0700
message:
  change parameter names in period js generator
modified:
  
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js


--
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-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js	2014-05-06 04:19:30 +
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js	2014-05-06 05:08:44 +
@@ -42,7 +42,7 @@
  * There is probably no reason to use this directly, since on startup, a global variable have been made available:
  *  - dhis2.period.picker   DatePicker object created with system calendar and system date format
  *
- * @param {Object} calendar Calendar to use, this must come from $.calendars.instance(chronology).
+ * @param {$.calendars.baseCalendar} calendar Calendar to use, this must come from $.calendars.instance(chronology).
  * @param {String} format Date format to use for formatting, will default to ISO 8601
  * @constructor
  * @see a href=http://keith-wood.name/datepick.html;http://keith-wood.name/datepick.html/a
@@ -145,7 +145,7 @@
  *  - dhis2.period.calendar   The currently selected system calendar
  *  - dhis2.period.generator  An instance of this class using the system calendar
  *
- * @param {Object} calendar Calendar to use, this must come from $.calendars.instance(chronology).
+ * @param {$.calendars.baseCalendar} calendar Calendar to use, this must come from $.calendars.instance(chronology).
  * @param {String} format Date format to use for formatting, will default to ISO 8601
  * @constructor
  */
@@ -345,17 +345,17 @@
   return array;
 };
 
-dhis2.period.makeDailyPeriodGenerator = function( cal, format ) {
+dhis2.period.makeDailyPeriodGenerator = function( calendar, format ) {
   var self = {};
   self.generatePeriods = function( offset ) {
 offset = offset || 0;
 
-var year = offset + cal.today().year();
+var year = offset + calendar.today().year();
 var periods = [];
 
-var startDate = cal.newDate(year, 1, 1);
+var startDate = calendar.newDate(year, 1, 1);
 
-for( var day = 1; day = cal.daysInYear(year); day++ ) {
+for( var day = 1; day = calendar.daysInYear(year); day++ ) {
   var period = {};
   period['startDate'] = startDate.formatDate(format);
   period['endDate'] = startDate.formatDate(format);
@@ -377,15 +377,15 @@
   return self;
 };
 
-dhis2.period.makeWeeklyPeriodGenerator = function( cal, format ) {
+dhis2.period.makeWeeklyPeriodGenerator = function( calendar, format ) {
   var self = {};
   self.generatePeriods = function( offset ) {
 offset = offset || 0;
 
-var year = offset + cal.today().year();
+var year = offset + calendar.today().year();
 var periods = [];
 
-var startDate = cal.newDate(year, 1, 1);
+var startDate = calendar.newDate(year, 1, 1);
 startDate.add(-(startDate.dayOfWeek() - 1), 'd'); // rewind to start of week, might cross year boundary
 
 // no reliable way to figure out number of weeks in a year (can differ in different calendars)
@@ -395,7 +395,7 @@
   period['startDate'] = startDate.formatDate(format);
 
   // not very elegant, but seems to be best way to get week end, adds a week, then minus 1 day
-  var endDate = cal.newDate(startDate).add(1, 'w').add(-1, 'd');
+  var endDate = calendar.newDate(startDate).add(1, 'w').add(-1, 'd');
 
   period['endDate'] = endDate.formatDate(format);
   period['name'] = 'W' + week + ' - ' + period['startDate'] + ' - ' + period['endDate'];
@@ -420,17 +420,17 @@
   return self;
 };
 
-dhis2.period.makeMonthlyPeriodGenerator = function( cal, format ) {
+dhis2.period.makeMonthlyPeriodGenerator = function( calendar, format ) {
   var self = {};
   self.generatePeriods = function( offset ) {
 offset = offset || 0;
 
-var year = offset + cal.today().year();
+var year = offset + calendar.today().year();
 var periods = [];
 
-for( var month = 1; month = cal.monthsInYear(year); month++ ) {
-  var startDate = cal.newDate(year, month, 1);
-  var endDate = cal.newDate(startDate).set(startDate.daysInMonth(month), 'd');
+for( var month = 1; month = calendar.monthsInYear(year); month++ ) {
+  var startDate = calendar.newDate(year, month, 1);
+  var endDate = calendar.newDate(startDate).set(startDate.daysInMonth(month), 'd');
 
   var period = {};
   

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 15164: rewrite of period generators, uses dhis2.period.BaseGenerator as base class for all generators, wip

2014-05-05 Thread noreply

revno: 15164
committer: Morten Olav Hansen morte...@gmail.com
branch nick: dhis2
timestamp: Tue 2014-05-06 12:31:36 +0700
message:
  rewrite of period generators, uses dhis2.period.BaseGenerator as base class 
for all generators, wip
modified:
  
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js


--
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-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js	2014-05-06 05:08:44 +
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js	2014-05-06 05:31:36 +
@@ -161,10 +161,10 @@
 calendar: calendar,
 format: format,
 generators: {
-  Daily: dhis2.period.makeDailyPeriodGenerator(calendar, format),
-  Weekly: dhis2.period.makeWeeklyPeriodGenerator(calendar, format),
-  Monthly: dhis2.period.makeMonthlyPeriodGenerator(calendar, format),
-  BiMonthly: dhis2.period.makeBiMonthlyPeriodGenerator(calendar, format),
+  Daily: new dhis2.period.DailyGenerator(calendar, format),
+  Weekly: new dhis2.period.WeeklyGenerator(calendar, format),
+  Monthly: new dhis2.period.MonthlyGenerator(calendar, format),
+  BiMonthly: new dhis2.period.BiMonthlyGenerator(calendar, format),
   Quarterly: dhis2.period.makeQuarterlyPeriodGenerator(calendar, format),
   SixMonthly: dhis2.period.makeSixMonthlyPeriodGenerator(calendar, format),
   SixMonthlyApril: dhis2.period.makeSixMonthlyAprilPeriodGenerator(calendar, format),
@@ -345,81 +345,6 @@
   return array;
 };
 
-dhis2.period.makeDailyPeriodGenerator = function( calendar, format ) {
-  var self = {};
-  self.generatePeriods = function( offset ) {
-offset = offset || 0;
-
-var year = offset + calendar.today().year();
-var periods = [];
-
-var startDate = calendar.newDate(year, 1, 1);
-
-for( var day = 1; day = calendar.daysInYear(year); day++ ) {
-  var period = {};
-  period['startDate'] = startDate.formatDate(format);
-  period['endDate'] = startDate.formatDate(format);
-  period['name'] = startDate.formatDate(format);
-  period['id'] = 'Daily_' + period['startDate'];
-  period['iso'] = startDate.formatDate(mmdd);
-
-  period['_startDate'] = startDate;
-  period['_endDate'] = startDate;
-
-  periods.push(period);
-
-  startDate.add(1, 'd');
-}
-
-return periods;
-  };
-
-  return self;
-};
-
-dhis2.period.makeWeeklyPeriodGenerator = function( calendar, format ) {
-  var self = {};
-  self.generatePeriods = function( offset ) {
-offset = offset || 0;
-
-var year = offset + calendar.today().year();
-var periods = [];
-
-var startDate = calendar.newDate(year, 1, 1);
-startDate.add(-(startDate.dayOfWeek() - 1), 'd'); // rewind to start of week, might cross year boundary
-
-// no reliable way to figure out number of weeks in a year (can differ in different calendars)
-// goes up to 200, but break when week is back to 1
-for( var week = 1; week  200; week++ ) {
-  var period = {};
-  period['startDate'] = startDate.formatDate(format);
-
-  // not very elegant, but seems to be best way to get week end, adds a week, then minus 1 day
-  var endDate = calendar.newDate(startDate).add(1, 'w').add(-1, 'd');
-
-  period['endDate'] = endDate.formatDate(format);
-  period['name'] = 'W' + week + ' - ' + period['startDate'] + ' - ' + period['endDate'];
-  period['id'] = 'Weekly_' + period['startDate'];
-  period['iso'] = year + 'W' + week;
-
-  period['_startDate'] = startDate;
-  period['_endDate'] = endDate;
-
-  periods.push(period);
-
-  startDate.add(1, 'w');
-
-  if( startDate.weekOfYear() == 1 ) {
-break;
-  }
-}
-
-return periods;
-  };
-
-  return self;
-};
-
 dhis2.period.makeMonthlyPeriodGenerator = function( calendar, format ) {
   var self = {};
   self.generatePeriods = function( offset ) {
@@ -451,38 +376,6 @@
   return self;
 };
 
-dhis2.period.makeBiMonthlyPeriodGenerator = function( calendar, format ) {
-  var self = {};
-  self.generatePeriods = function( offset ) {
-offset = offset || 0;
-
-var year = offset + calendar.today().year();
-var periods = [];
-
-for( var month = 1; month = calendar.monthsInYear(year); month += 2 ) {
-  var startDate = calendar.newDate(year, month, 1);
-  var endDate = calendar.newDate(startDate).set(month + 1, 'm');
-  endDate.set(endDate.daysInMonth(month + 1), 'd');
-
-  var period = {};