------------------------------------------------------------ revno: 2212 committer: Lars Helge Overland <larshe...@gmail.com> branch nick: dhis2 timestamp: Mon 2010-11-29 15:40:20 +0100 message: Fixed issue with closed date on update orgunit modified: dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/GetOrganisationUnitAction.java dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/PrepareAddOrganisationUnitAction.java dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/ValidateOrganisationUnitAction.java dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitForm.vm 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-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js 2010-11-24 20:34:35 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js 2010-11-29 14:40:20 +0000 @@ -754,7 +754,7 @@ /** * Create jQuery datepicker for input text with id * * - * @param id the id of input filed which you want enter date * + * @param id the id of input field which you want enter date * */ function datePicker( id ) { @@ -794,7 +794,7 @@ /** * Create jQuery datepicker for input text with id * * - * @param id the id of input filed which you want enter date * + * @param id the id of input field which you want enter date * */ function datePickerValid( id, today ) { @@ -822,8 +822,8 @@ /** * Create jQuery datepicker for start date and end ate text with id * * - * @param startdate the id of input filed which you want enter start date * - * @param enddate the id of input filed which you want enter end date * + * @param startdate the id of input field which you want enter start date * + * @param enddate the id of input field which you want enter end date * */ function datePickerInRange ( startdate, enddate, setCurrentStartDate, setCurrentEndDate ) === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/GetOrganisationUnitAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/GetOrganisationUnitAction.java 2010-04-12 21:23:33 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/GetOrganisationUnitAction.java 2010-11-29 14:40:20 +0000 @@ -82,7 +82,7 @@ public String execute() throws Exception { - organisationUnit = organisationUnitService.getOrganisationUnit( id.intValue() ); + organisationUnit = organisationUnitService.getOrganisationUnit( id ); numberOfChildren = organisationUnit.getChildren().size(); === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/PrepareAddOrganisationUnitAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/PrepareAddOrganisationUnitAction.java 2010-05-26 04:01:21 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/PrepareAddOrganisationUnitAction.java 2010-11-29 14:40:20 +0000 @@ -53,9 +53,9 @@ public String execute() { Calendar cal = Calendar.getInstance(); - //cal.set( Calendar.YEAR, 1990 ); - //cal.set( Calendar.MONTH, 0 ); - //cal.set( Calendar.DATE, 1 ); + cal.set( Calendar.YEAR, 1990 ); + cal.set( Calendar.MONTH, 0 ); + cal.set( Calendar.DATE, 1 ); this.defaultDate = cal.getTime(); return SUCCESS; === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/ValidateOrganisationUnitAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/ValidateOrganisationUnitAction.java 2010-10-04 10:59:24 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/ValidateOrganisationUnitAction.java 2010-11-29 14:40:20 +0000 @@ -76,8 +76,7 @@ { this.code = code; } - - + // ------------------------------------------------------------------------- // Output // ------------------------------------------------------------------------- @@ -108,7 +107,6 @@ if ( name != null ) { - OrganisationUnit match = organisationUnitService.getOrganisationUnitByName( name ); if ( match != null && (id == null || match.getId() != id) ) @@ -117,12 +115,10 @@ return ERROR; } - } - + } if ( code != null ) { - OrganisationUnit match = organisationUnitService.getOrganisationUnitByCode( code ); if ( match != null && (id == null || match.getId() != id) ) === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitForm.vm 2010-10-15 13:15:20 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitForm.vm 2010-11-29 14:40:20 +0000 @@ -5,8 +5,7 @@ checkValueIsExist( "name", "validateOrganisationUnit.action"); checkValueIsExist( "code", "validateOrganisationUnit.action"); - datePickerValid( 'openingDate', false ); - + datePickerValid( 'openingDate', false ); }); </script> === 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 2010-10-15 13:15:20 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitForm.vm 2010-11-29 14:40:20 +0000 @@ -10,10 +10,11 @@ id: $organisationUnit.id }); - datePickerInRange( 'openingDate', 'closedDate', false, false ); - - - + #if ( $numberOfChildren == 0 ) + datePickerInRange( 'openingDate', 'closedDate', false, false ); + #else + datePickerValid( 'openingDate', false ); + #end }); </script> @@ -46,12 +47,13 @@ <td><label for="openingDate">$i18n.getString( "opening_date" ) ($i18n.getString( "format.date.label" )) <em title="$i18n.getString( "required" )" class="required">*</em></label></td> <td><input type="text" id="openingDate" name="openingDate" value="$!format.formatDate( $organisationUnit.openingDate )" style="width:20em" class="{validate:{required:true}}"/></td> <td></td> - </tr> - - <tr #if( $numberOfChildren != 0 ) style="display:none" #end> + </tr> + #if( $numberOfChildren == 0 ) + <tr> <td><label for="closedDate">$i18n.getString( "closed_date" ) ($i18n.getString( "format.date.label" ))</label></td> <td><input type="text" id="closedDate" name="closedDate" value="$!format.formatDate( $organisationUnit.closedDate )" style="width:20em"/></td> </tr> + #end <tr> <td><label for="active">$i18n.getString( "registers_date" )</label></td> <td> @@ -82,7 +84,6 @@ </form> <script type="text/javascript"> - var previousName = '$encoder.jsEscape( $organisationUnit.name, "'" )'; var saving_the_org_unit_failed = '$encoder.jsEscape( $i18n.getString( "saving_the_org_unit_failed" ) , "'" )'; </script>
_______________________________________________ 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