dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #27795
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13843: Data entry, doc
------------------------------------------------------------
revno: 13843
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-01-24 15:32:59 +0200
message:
Data entry, doc
modified:
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/responseMetaData.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-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js 2014-01-23 19:05:43 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js 2014-01-24 13:32:59 +0000
@@ -2513,6 +2513,12 @@
// Option set
// -----------------------------------------------------------------------------
+/**
+ * Performs a search for options for the option set with the given identifier based
+ * on the given query. If query is null, the first MAX options for the option set
+ * is used. Checks and uses option set from local store, if not fetches option
+ * set from server.
+ */
dhis2.de.searchOptionSet = function( uid, query, success )
{
if ( window.DAO !== undefined && window.DAO.store !== undefined ) {
@@ -2556,6 +2562,10 @@
}
};
+/**
+ * Retrieves options from server. Provides result as jquery ui structure to the
+ * given jquery ui success callback.
+ */
dhis2.de.getOptions = function( uid, query, success )
{
$.ajax( {
@@ -2574,9 +2584,12 @@
} );
};
+/**
+ * Loads option sets from server into local store.
+ */
dhis2.de.loadOptionSets = function()
{
- var options = _.values( dhis2.de.optionSets );
+ var options = _.values( dhis2.de.optionSets ); // Array of objects with uid and v
var uids = [];
var deferred = $.Deferred();
@@ -2613,6 +2626,9 @@
deferred.resolve();
};
+/**
+ * Insersts option sets in the appropriate input fields.
+ */
dhis2.de.insertOptionSets = function()
{
$( '.entryoptionset').each( function( idx, item ) {
@@ -2631,6 +2647,10 @@
} );
};
+/**
+ * Applies the autocomplete widget on the given input field using the option set
+ * with the given identifier.
+ */
dhis2.de.autocompleteOptionSetField = function( idField, optionSetUid )
{
var input = jQuery( '#' + idField );
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/responseMetaData.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/responseMetaData.vm 2013-12-22 10:06:39 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/responseMetaData.vm 2014-01-24 13:32:59 +0000
@@ -19,12 +19,10 @@
"optionSets": {
#set( $size = $dataElementsWithOptionSet.size() )
#foreach( $dataElement in $dataElementsWithOptionSet )
- #set( $size2 = $dataElement.categoryCombo.getSortedOptionCombos().size() )
- #foreach( $option in $dataElement.categoryCombo.getSortedOptionCombos() )
- "${dataElement.uid}-$option.uid":{"uid": "$encoder.jsonEncode( ${dataElement.optionSet.uid} )", "v":${dataElement.optionSet.version}}
- #if( $velocityCount < $size2 ),#end
- #end
-#if( $velocityCount < $size ),#end
+#set( $size2 = $dataElement.categoryCombo.getSortedOptionCombos().size() )
+#foreach( $option in $dataElement.categoryCombo.getSortedOptionCombos() )
+"${dataElement.uid}-$option.uid":{"uid":"$encoder.jsonEncode( ${dataElement.optionSet.uid} )","v":${dataElement.optionSet.version}}#if( $velocityCount < $size2 ),#end
+#end #if( $velocityCount < $size ),#end
#end },
"indicatorFormulas": {