=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/i18n/i18n.vm' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/i18n/i18n.vm 2010-08-23 08:51:26 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/i18n/i18n.vm 2010-10-04 10:59:24 +0000 @@ -139,5 +139,6 @@ ,password: '$encoder.jsEscape($i18n.getString( 'password_must_contain_at_least_one_capital_letter_and_one_digit' ) , "'")' ,notOnlyDigits: '$encoder.jsEscape($i18n.getString('only_digits_are_not_allowed' ) , "'")' ,custome_regex: validatorFormat("{1}") + ,greaterDate: '$encoder.jsEscape($i18n.getString('closedDate_should_be_greater_than_openDate' ) , "'")' }; === modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.validate.ext.js' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.validate.ext.js 2010-09-08 10:40:26 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.validate.ext.js 2010-10-04 10:59:24 +0000 @@ -141,6 +141,17 @@ }, "Please Letters, numbers, spaces or some special chars like .,-,%,(,) only "); + jQuery.validator.addMethod("greaterDate",function(value, element, params) { + + if ($(params).val()){ + var closedDate = new Date(value); + var openDate= new Date($(params).val()); + return closedDate > openDate; + } + return true; + + }, ""); + jQuery.validator.addMethod("alphanumeric", function(value, element) { return this.optional(element) || /^[\w\s]+$/i.test(value); }, "Letters, numbers, spaces or underscores only please"); === 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 2010-09-23 15:16:08 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties 2010-10-04 10:59:24 +0000 @@ -316,6 +316,7 @@ please_fill_out_at_least_one_of_these_fields = Please fill out at least one of these fields. password_must_contain_at_least_one_capital_letter_and_one_digit = Password must contain at least one capital letter and one digit only_digits_are_not_allowed = Only digits are not allowed +closedDate_should_be_greater_than_openDate = ClosedDate should be greater than OpenDate please_enter_name = Please enter name! please_select_period = Please select period! === 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-09-09 09:38:13 +0000 +++ 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 @@ -69,7 +69,15 @@ { this.name = name; } - + + private String code; + + public void setCode( String code ) + { + this.code = code; + } + + // ------------------------------------------------------------------------- // Output // ------------------------------------------------------------------------- @@ -109,6 +117,20 @@ return ERROR; } + } + + + if ( code != null ) + { + + OrganisationUnit match = organisationUnitService.getOrganisationUnitByCode( code ); + + if ( match != null && (id == null || match.getId() != id) ) + { + message = i18n.getString( "name_in_use" ); + + return ERROR; + } } message = "OK"; === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/resources/org/hisp/dhis/oum/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/resources/org/hisp/dhis/oum/i18n_module.properties 2010-10-01 13:08:28 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/resources/org/hisp/dhis/oum/i18n_module.properties 2010-10-04 10:59:24 +0000 @@ -117,3 +117,4 @@ filter_by_name = Filter by name loading = Loading coordinates = Coordinates + === 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-09-21 06:16:05 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitForm.vm 2010-10-04 10:59:24 +0000 @@ -3,6 +3,7 @@ validation( 'addOrganisationUnitForm' ); checkValueIsExist( "name", "validateOrganisationUnit.action"); + checkValueIsExist( "code", "validateOrganisationUnit.action"); datePicker( 'openingDate' ); === 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-09-21 06:16:05 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitForm.vm 2010-10-04 10:59:24 +0000 @@ -4,9 +4,15 @@ checkValueIsExist( "name", "validateOrganisationUnit.action", { id: $organisationUnit.id - }); + }); + + checkValueIsExist( "code", "validateOrganisationUnit.action", { + id: $organisationUnit.id + }); datePickerInRange( 'openingDate', 'closedDate', true, false ); + + }); @@ -44,7 +50,7 @@ - + === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js 2010-09-28 09:06:13 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js 2010-10-04 10:59:24 +0000 @@ -625,6 +625,14 @@ { var pageSize = jQuery("#sizeOfPage").val(); var currentPage = jQuery("#jumpToPage").val(); + var numberOfPages = jQuery("#numberOfPages").val(); + + if( currentPage > numberOfPages ) + { + //alert( "currentPage is: " +currentPage + " Greater than No of Pages: " +numberOfPages ); + alert("Current Page should be less than No of pages" ); + return false; + } window.location.href = baseLink +"pageSize=" + pageSize +"¤tPage=" +currentPage; } === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/paging.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/paging.vm 2010-09-01 08:32:05 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/paging.vm 2010-10-04 10:59:24 +0000 @@ -7,13 +7,14 @@ + #if ( $numberOfPages > 0 )
#if ($currentPage > 1)