=== modified file 'local/vn/dhis-service-vn/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateLocalDataElementStore.java' --- local/vn/dhis-service-vn/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateLocalDataElementStore.java 2012-03-24 01:29:01 +0000 +++ local/vn/dhis-service-vn/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateLocalDataElementStore.java 2012-03-29 04:55:32 +0000 @@ -49,6 +49,6 @@ { return getCriteria().createAlias( "attributeValues", "attributeValue" ).add( Restrictions.eq( "attributeValue.attribute", attribute ) ).add( - Restrictions.eq( "attributeValue.value", value ) ).list(); + Restrictions.ilike( "attributeValue.value", value ) ).list(); } } === modified file 'local/vn/dhis-web-dataentry-hospital/src/main/java/org/hisp/dhis/dataelement/LoadFormAction.java' --- local/vn/dhis-web-dataentry-hospital/src/main/java/org/hisp/dhis/dataelement/LoadFormAction.java 2012-03-26 02:41:46 +0000 +++ local/vn/dhis-web-dataentry-hospital/src/main/java/org/hisp/dhis/dataelement/LoadFormAction.java 2012-03-29 04:55:32 +0000 @@ -231,6 +231,8 @@ List dataElements = new ArrayList( dataSet.getDataElements() ); + Collections.sort( dataElements, new DataElementFormNameComparator() ); + if ( dataElements.isEmpty() ) { return INPUT; === modified file 'local/vn/dhis-web-dataentry-hospital/src/main/webapp/WEB-INF/web.xml' --- local/vn/dhis-web-dataentry-hospital/src/main/webapp/WEB-INF/web.xml 2012-03-24 01:29:01 +0000 +++ local/vn/dhis-web-dataentry-hospital/src/main/webapp/WEB-INF/web.xml 2012-03-29 04:55:32 +0000 @@ -18,7 +18,7 @@ org.hisp.dhis.servlet.filter.HttpRedirectFilter redirectPath - dhis-web-dataentry-hospital/index.action + dhis-web-dataentry/index.action === added directory 'local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-commons' === added directory 'local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-commons/about' === added file 'local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-commons/about/modules.vm' --- local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-commons/about/modules.vm 1970-01-01 00:00:00 +0000 +++ local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-commons/about/modules.vm 2012-03-29 04:55:32 +0000 @@ -0,0 +1,29 @@ + + + +#if( $maintenanceModules && $maintenanceModules.size() > 0 ) + +#end + +#if( $serviceModules && $serviceModules.size() > 0 ) + +#end + + +
+
    +#foreach( $module in $maintenanceModules ) + #if( $module.name!='dhis-web-dataentry-hospital' ) + #introListImgItem( "${module.defaultAction}" "${module.name}" "${module.name}" ) + #end +#end +
+
+
    +#foreach( $module in $serviceModules ) + #if( $module.name!='dhis-web-dataentry-hospital' ) + #introListImgItem( "${module.defaultAction}" "${module.name}" "${module.name}" ) + #end +#end +
+
=== modified file 'local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry/javascript/form.js' --- local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry/javascript/form.js 2012-03-24 01:29:01 +0000 +++ local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry/javascript/form.js 2012-03-29 04:55:32 +0000 @@ -400,7 +400,7 @@ $( '#contentDiv' ).load( '../dhis-web-dataentry-hospital/loadForm.action', { dataSetId : dataSetId, attributeId: getFieldValue( 'attributeId' ), - value: getFieldValue( 'value' ) + value: byId( 'valueInput' ).value }, loadDataValues ); //} } @@ -1641,3 +1641,109 @@ } } ); } + +function getSuggestedAttrValue() +{ + clearListById( 'value' ); + $.getJSON( '../dhis-web-dataentry-hospital/loadAttributeValuesByAttribute.action', + { + attributeId: getFieldValue( 'attributeId' ) + } + , function( json ) + { + addOptionById( 'value', '', i18n_please_select_attribute ); + + for ( i in json.attributeValues ) + { + $('#value').append(''); + } + + autoCompletedField(); + } ); +} + + +function autoCompletedField() +{ + var select = jQuery( "#value" ); + $( "#valueButton" ).unbind('click'); + enable( 'valueButton' ); + var selected = select.children( ":selected" ); + var value = selected.val() ? selected.text() : ""; + + var input = jQuery( "#valueInput" ) + .insertAfter( select ) + .val( value ) + .autocomplete({ + delay: 0, + minLength: 0, + source: function( request, response ) { + var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" ); + response( select.children( "option" ).map(function() { + var text = $( this ).text(); + if ( this.value && ( !request.term || matcher.test(text) ) ) + return { + label: text, + value: text, + option: this + }; + }) ); + }, + select: function( event, ui ) { + ui.item.option.selected = true; + }, + change: function( event, ui ) { + if ( !ui.item ) { + var matcher = new RegExp( "^" + $.ui.autocomplete.escapeRegex( $(this).val() ) + "$", "i" ), + valid = false; + select.children( "option" ).each(function() { + if ( $( this ).text().match( matcher ) ) { + this.selected = valid = true; + return false; + } + }); + if ( !valid ) { + // remove invalid value, as it didn't match anything + $( this ).val( "" ); + select.val( "" ); + input.data( "autocomplete" ).term = ""; + return false; + } + } + } + }) + .addClass( "ui-widget ui-widget-content ui-corner-left" ); + + input.data( "autocomplete" )._renderItem = function( ul, item ) { + return $( "
  • " ) + .data( "item.autocomplete", item ) + .append( "" + item.label + "" ) + .appendTo( ul ); + }; + + showById('valueButton'); + var button = $( "#valueButton" ) + .attr( "title", i18n_show_all_items ) + .button({ + icons: { + primary: "ui-icon-triangle-1-s" + }, + text: false + }) + .removeClass( "ui-corner-all" ) + .addClass( "ui-corner-right ui-button-icon" ) + .click(function() { + // close if already visible + if ( input.autocomplete( "widget" ).is( ":visible" ) ) { + input.autocomplete( "close" ); + return; + } + + // work around a bug (likely same cause as #5265) + $( this ).blur(); + + // pass empty string as value to search for, displaying all results + input.autocomplete( "search", "" ); + input.focus(); + }); +} === added file 'local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry/jsonAttributeValues.vm' --- local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry/jsonAttributeValues.vm 1970-01-01 00:00:00 +0000 +++ local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry/jsonAttributeValues.vm 2012-03-29 04:55:32 +0000 @@ -0,0 +1,9 @@ +#set( $size = $values.size() ) +{ "attributeValues": [ + #foreach( $value in $values ) + { + "value": "$!encoder.jsonEncode( $value )" + }#if( $velocityCount < $size ),#end + #end + ] +} \ No newline at end of file === modified file 'local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry/select.vm' --- local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry/select.vm 2012-03-24 01:29:01 +0000 +++ local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry/select.vm 2012-03-29 04:55:32 +0000 @@ -37,7 +37,7 @@ var i18n_dataset_is_locked = '$encoder.jsEscape( $i18n.getString( "dataset_is_locked" ) , "'")'; var i18n_register_complete_failed_dataset_is_locked = '$encoder.jsEscape( $i18n.getString( "register_complete_failed_dataset_is_locked" ) , "'")'; var i18n_unregister_complete_failed_dataset_is_locked = '$encoder.jsEscape( $i18n.getString( "unregister_complete_failed_dataset_is_locked" ) , "'")'; - +var i18n_show_all_items = '$encoder.jsEscape( $i18n.getString( "show_all_items" ) , "'")'; jQuery(document).ready( function(){ getAttributes(); }); @@ -68,7 +68,7 @@ - + @@ -77,16 +77,19 @@ - - + + + + + +

    - +