=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/struts.xml 2010-03-24 02:56:06 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/struts.xml 2010-05-24 16:30:12 +0000 @@ -20,7 +20,7 @@ class="org.hisp.dhis.dataset.action.dataentryform.SelectDataElementAction"> /main.vm /dhis-web-maintenance-dataset/editCustomValues.vm - javascript/dataSet.js,javascript/dataElementsList.js,javascript/hashtable.js + javascript/dataSet.js F_DATASET_UPDATE @@ -30,7 +30,7 @@ /main.vm /dhis-web-maintenance-dataset/dataSetList.vm /dhis-web-maintenance-dataset/menu.vm - javascript/dataSet.js,javascript/filterTable.js + javascript/dataSet.js @@ -47,7 +47,7 @@ /dhis-web-maintenance-dataset/addSection.vm /dhis-web-maintenance-dataset/menu.vm section - javascript/dataElementsList.js,javascript/section.js + javascript/section.js ,../dhis-web-commons/util/validate/jquery.validate.js,../dhis-web-commons/util/jquery.metadata.js ,../dhis-web-commons/util/validate/additional-methods.js,../dhis-web-commons/util/validate/messages_locale.js @@ -59,12 +59,12 @@ plainTextError - + /main.vm /dhis-web-maintenance-dataset/sortOrderSection.vm /dhis-web-maintenance-dataset/menu.vm section - javascript/dataElementsList.js,javascript/dataSet.js + javascript/dataSet.js /main.vm /dhis-web-maintenance-dataset/editSection.vm /dhis-web-maintenance-dataset/menu.vm - javascript/dataElementsList.js,javascript/dataSet.js + javascript/dataSet.js ,../dhis-web-commons/util/validate/jquery.validate.js,../dhis-web-commons/util/jquery.metadata.js ,../dhis-web-commons/util/validate/additional-methods.js,../dhis-web-commons/util/validate/messages_locale.js @@ -125,7 +125,7 @@ class="org.hisp.dhis.dataset.action.PeriodTypeListAction"> /main.vm /dhis-web-maintenance-dataset/addDataSet.vm - javascript/shortName.js,javascript/dataSet.js,javascript/dataElementsList.js + javascript/shortName.js,javascript/dataSet.js ,../dhis-web-commons/util/validate/jquery.validate.js,../dhis-web-commons/util/jquery.metadata.js ,../dhis-web-commons/util/validate/additional-methods.js,../dhis-web-commons/util/validate/messages_locale.js F_DATASET_ADD @@ -155,7 +155,7 @@ class="org.hisp.dhis.dataset.action.PeriodTypeListAction"> /main.vm /dhis-web-maintenance-dataset/editDataSet.vm - javascript/dataSet.js,javascript/dataElementsList.js + javascript/dataSet.js ,../dhis-web-commons/util/validate/jquery.validate.js,../dhis-web-commons/util/jquery.metadata.js ,../dhis-web-commons/util/validate/additional-methods.js,../dhis-web-commons/util/validate/messages_locale.js F_DATASET_UPDATE @@ -244,7 +244,7 @@ class="org.hisp.dhis.dataset.action.GetDataSetAction"> /main.vm /dhis-web-maintenance-dataset/dataSetAssociations.vm - ../dhis-web-commons/oust/oust.js,javascript/dataElementsList.js,javascript/associations.js + ../dhis-web-commons/oust/oust.js,javascript/associations.js F_DATASET_UPDATE @@ -254,7 +254,7 @@ class="org.hisp.dhis.dataset.action.dataentryform.ViewDataEntryFormAction"> /main.vm /dhis-web-maintenance-dataset/viewDataEntryForm.vm - javascript/dataEntryForm.js,javascript/FCK/fckeditor.js,javascript/hashtable.js + javascript/dataEntryForm.js,javascript/FCK/fckeditor.js ,../dhis-web-commons/util/validate/jquery.validate.js,../dhis-web-commons/util/jquery.metadata.js ,../dhis-web-commons/util/validate/additional-methods.js,../dhis-web-commons/util/validate/messages_locale.js css/cde.css @@ -283,25 +283,24 @@ class="org.hisp.dhis.dataset.action.dataentryform.SelectDataElementAction"> selectDataElement.vm /dhis-web-maintenance-dataset/responseInput.vm - javascript/hashtable.js /dhis-web-maintenance-dataset/responseSelDataElementList.vm - javascript/dataEntryForm.js,javascript/FCK/fckeditor.js,javascript/hashtable.js + javascript/dataEntryForm.js,javascript/FCK/fckeditor.js /dhis-web-maintenance-dataset/responseOptionCombo.vm - javascript/dataEntryForm.js,javascript/FCK/fckeditor.js,javascript/hashtable.js + javascript/dataEntryForm.js,javascript/FCK/fckeditor.js /dhis-web-maintenance-dataset/responseCustomValue.vm - javascript/dataEntryForm.js,javascript/FCK/fckeditor.js,javascript/hashtable.js + javascript/dataEntryForm.js,javascript/FCK/fckeditor.js === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/addSection.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/addSection.vm 2010-04-19 09:54:45 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/addSection.vm 2010-05-21 15:41:26 +0000 @@ -10,6 +10,7 @@ ,errorElement:"td" ,submitHandler: function(form) { + selectAllById( 'selectedList' ); validateAddSection(); } }); @@ -17,7 +18,6 @@ jQuery("#sectionName").focus(); } ); -

$i18n.getString( "add_section" )

@@ -65,7 +65,7 @@ - #foreach ( $availableDataElement in $dataElements ) @@ -74,13 +74,13 @@ - +
- + - === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editSection.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editSection.vm 2010-04-21 11:40:59 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editSection.vm 2010-05-21 09:02:33 +0000 @@ -11,7 +11,7 @@ ,submitHandler: function(form) { // select all in the selectedList! - submitForm(); + selectAllById( 'selectedList' ); // actually submit the form document.forms['editDataSetForm'].submit(); } @@ -68,7 +68,7 @@ - #foreach ( $availableDataElement in $dataElementOfDataSet ) @@ -76,12 +76,12 @@ - +
- + - #foreach ( $dataElement in $dataElementsOfSection ) #end === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/dataElementsList.js' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/dataElementsList.js 2009-03-03 16:46:36 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/dataElementsList.js 1970-01-01 00:00:00 +0000 @@ -1,51 +0,0 @@ -var selectedList; -var availableList; - -function move( listId ) { - - var fromList = document.getElementById(listId); - - if ( fromList.selectedIndex == -1 ) { return; } - - if ( ! availableList ) { - availableList = document.getElementById('availableList'); - } - - if ( ! selectedList ) { - selectedList = document.getElementById('selectedList'); - } - - var toList = ( fromList == availableList ? selectedList : availableList ); - - while ( fromList.selectedIndex > -1 ) { - option = fromList.options.item(fromList.selectedIndex); - fromList.remove(fromList.selectedIndex); - toList.add(option, null); - } - -} - -function submitForm() { - - if ( ! availableList ) { - availableList = document.getElementById('availableList'); - } - - if ( ! selectedList ) { - selectedList = document.getElementById('selectedList'); - } - - // selectAll(availableList); - selectAll(selectedList); - - return false; - -} - -function selectAll(list) { - - for ( var i = 0, option; option = list.options.item(i); i++ ) { - option.selected = true; - } - -} \ No newline at end of file === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/filterTable.js' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/filterTable.js 2009-03-03 16:46:36 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/filterTable.js 1970-01-01 00:00:00 +0000 @@ -1,26 +0,0 @@ - -function filterValues( filter ) -{ - var list = document.getElementById( 'list' ); - - var rows = list.getElementsByTagName( 'tr' ); - - for ( var i = 0; i < rows.length; ++i ) - { - var cell = rows[i].getElementsByTagName( 'td' )[0]; - - var value = cell.firstChild.nodeValue; - - value = value.toLowerCase(); - filter = filter.toLowerCase(); - - if ( value.indexOf( filter ) != -1 ) - { - rows[i].style.display = 'table-row'; - } - else - { - rows[i].style.display = 'none'; - } - } -} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/hashtable.js' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/hashtable.js 2009-03-03 16:46:36 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/hashtable.js 1970-01-01 00:00:00 +0000 @@ -1,310 +0,0 @@ -/** - *

Implements a sortable hashtable which accepts non-null String - * keys and non-null values.

- * - *

This object is primarily intended to address the shortcomings of using an - * Object as a hashtable, by managing the names of the properties which are - * stored in an Object.

- * - *

HashTable does not define a hashing function, as Object's built-in - * hashing is used for storing and retrieving items.

- * - *

Initial values are taken from any Objects passed into the constructor: - * if another HashTable is given as an argument, its contents will be taken.

- * - * @constructor - */ -var HashTable = function() -{ - /** - * Storage object - values are stored as properties whose names are hashtable - * keys. - * - * @type Object - * @private - */ - this._store = {}; - - /** - * A list of hashtable keys. - * - * @type Array - * @private - */ - this._keys = []; - - for (var i = 0; i < arguments.length; i++) - { - this._putFromObject(arguments[i]); - } -}; - -/** - * Puts all properties from a given HashTable or Object into the hashtable. - * - * @param {Object} source an object whose values will be put into the hashtable. - * @private - */ -HashTable.prototype._putFromObject = function(source) -{ - if (source.constructor == HashTable) - { - source.forEach(function(k, v) - { - this.put(k, v); - }, this); - } - else - { - for (property in source) - { - if (source.hasOwnProperty(property)) - { - this.put(property, source[property]); - } - } - } -}; - -/** - * Clears the hashtable. - */ -HashTable.prototype.clear = function() -{ - this._store = {}; - this._keys = []; -}; - -/** - * An iterator which calls the given function, passing key, value, item index and a - * reference to this Hashtable for each item in the hashtable. - * - * @param {Function} callback the function to be called for each item. - * @param {Object} context an optional context object for the calls to block. - * - * @see "Enumerating Javascript Objects", http://dean.edwards.name/weblog/2006/07/enum/ - */ -HashTable.prototype.forEach = function(callback, context) -{ - for (var i = 0, l = this._keys.length; i < l; i++) - { - callback.call(context, this._keys[i], this._store[this._keys[i]], i, this); - } -}; - -/** - * Retrieves the item with the given key. - * - * @param {String} key the key for the item to be retrieved. - * @return the item stored in this HashTable with the given key if one exists, - * null otherwise. - */ -HashTable.prototype.get = function(key) -{ - var result = null; - if (typeof(this._store[key]) != "undefined") - { - result = this._store[key]; - } - return result; -}; - -/** - * Determines if the hashtable contains the given key. - * - * @param {String} key the key to be searched for. - * @return true if this HashTable contains the given key, - * false otherwise. - * @type Boolean - */ -HashTable.prototype.hasKey = function(key) -{ - var result = false; - this.forEach(function(k) - { - if (key == k) - { - result = true; - return true; - } - }); - return result; -}; - -/** - * Determines if the hashtable contains the given value. - * - * @param {Object} value the value to be searched for. - * @return true if this HashTable contains the given value, - * false otherwise. - * @type Boolean - */ -HashTable.prototype.hasValue = function(value) -{ - var result = false; - this.forEach(function(k, v) - { - if (value == v) - { - result = true; - return true; - } - }); - return result; -}; - -/** - * Creates Object representations of the items in the hashtable. - * - * @return the items in the hashtable, represented as Objects with "key" - * and "value" properties. - * @type Array - */ -HashTable.prototype.items = function() -{ - var items = []; - this.forEach(function(k, v) - { - items.push({"key": k, "value": v}); - }); - return items; -}; - -/** - * Retrieves the hashtable's keys. - * - * @return the hashtable's keys. - * @type Array - */ -HashTable.prototype.keys = function() -{ - var keys = []; - this.forEach(function(key) - { - keys.push(key); - }); - return keys; -}; - -/** - * Puts an item into the hashtable. - * - * @param {String} key the key under which the item should be stored. - * @param {Object} value the item to be stored. - */ -HashTable.prototype.put = function(key, value) -{ - if (key == undefined || key == null || typeof(key) != "string" - || value == undefined || value == null) - { - return; - } - - if (typeof(this._store[key]) == "undefined") - { - this._keys.push(key); - } - - this._store[key] = value; -}; - -/** - * Removes an item from the hashtable and returns it. - * - * @param {String} key the key for the item to be removed. - * @return the item which was removed, or null if the item did not - * exist. - */ -HashTable.prototype.remove = function(key) -{ - var result = null; - for (var i = 0, l = this._keys.length; i < l; i++) - { - if (key == this._keys[i]) - { - result = this._store[key]; - delete(this._store[key]); - this._keys.splice(i, 1); - break; - } - } - return result; -}; - -/** - * Determines the number of entries in the hashtable. - * - * @return the number of entries in this HashTable. - * @type Number - */ -HashTable.prototype.size = function() -{ - return this._keys.length; -}; - -/** - * Sorts the keys of the hashtable. - * - * @param {Function} comparator an optional function which will be used to sort - * the keys - if not provided, they will be sorted - * lexographically (in dictionary order). - */ -HashTable.prototype.sort = function(comparator) -{ - if (typeof(comparator) == "function") - { - this._keys.sort(comparator); - } - else - { - this._keys.sort(); - } -}; - -/** - * Creates a String representation of the hashtable. - * - * @return a String representation of this {@link HashTable}. - * @type String - */ -HashTable.prototype.toString = function() -{ - var result = "{"; - this.forEach(function(key, value, index) - { - if (index != 0) - { - result += ", "; - } - result += key + ": " + value; - }); - result += "}"; - return result; -}; - -/** - * Updates the hashtable with the values contained in a given {@link HashTable} - * or Object. - * - * @param {Object} source an object whose values will be put into the hashtable. - */ -HashTable.prototype.update = function(source) -{ - this._putFromObject(source); -}; - -/** - * Retrieves the hashtable's values. - * - * @return the hashtable's values. - * @type Array - */ -HashTable.prototype.values = function() -{ - var values = []; - this.forEach(function(key, value) - { - values.push(value); - }); - return values; -}; \ No newline at end of file === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/request.js' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/request.js 2009-03-03 16:46:36 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/request.js 1970-01-01 00:00:00 +0000 @@ -1,199 +0,0 @@ - -// ----------------------------------------------------------------------------- -// Author: Torgeir Lorange Ostby, torgeilo@gmail.com -// Version: $Id: request.js 2644 2007-01-03 13:24:56Z torgeilo $ -// ----------------------------------------------------------------------------- - -/* - * Usage: - * - * function processResponse( response ) { ... } // Text or XML - * function requestFailed( httpStatusCode ) { ... } - * - * var request = new Request(); - * request.setResponseTypeXML( 'rootElement' ); // Optional - * request.sendAsPost( 'value=1&value=2' ); // Optional - * request.setCallbackSuccess( processResponse ); // Optional - * request.setCallbackError( requestFailed ); // Optional - * request.send( 'url.action?value=1' ); - */ - -function Request() -{ - var request; - var responseType = 'TEXT'; - var requestMethod = 'GET'; - var requestParameters = null; - var rootElementName; - var callbackSuccess; - var callbackError; - - this.setResponseTypeXML = function( rootElementName_ ) - { - responseType = 'XML'; - rootElementName = rootElementName_; - }; - - this.sendAsPost = function( requestParameters_ ) - { - requestMethod = 'POST'; - requestParameters = requestParameters_; - }; - - this.setCallbackSuccess = function( callbackSuccess_ ) - { - callbackSuccess = callbackSuccess_; - }; - - this.setCallbackError = function( callbackError_ ) - { - callbackError = callbackError_; - }; - - this.send = function( url ) - { - request = newXMLHttpRequest(); - - if ( !request ) - { - window.alert( "Your browser doesn't support XMLHttpRequest" ); - return; - } - - request.onreadystatechange = responseReceived; - request.open( requestMethod, url, true ); - request.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded' ); - request.send( requestParameters ); - }; - - function newXMLHttpRequest() - { - if ( window.XMLHttpRequest ) - { - try - { - return new XMLHttpRequest(); - } - catch ( e ) - { - return false; - } - } - else if ( window.ActiveXObject ) - { - try - { - return new ActiveXObject( 'Msxml2.XMLHTTP' ); - } - catch ( e ) - { - try - { - return new ActiveXObject( 'Microsoft.XMLHTTP' ); - } - catch ( ee ) - { - return false; - } - } - } - - return false; - } - - function responseReceived() - { - if ( request.readyState == 4 ) - { - switch( request.status ) - { - case 200: - if ( callbackSuccess ) - { - if ( responseType == 'TEXT' ) - { - callbackSuccess( request.responseText ); - } - else - { - var xml = textToXML( request.responseText, rootElementName ); - - callbackSuccess( xml ); - } - } - break; - case 204: - if ( callbackSuccess ) - { - callbackSuccess( null ); - } - break; - case 500: - var message = 'Operation failed - internal server error'; - - var serverMessage = request.responseText; - - if ( serverMessage ) - { - var maxLength = 512; - - if ( serverMessage.length > maxLength ) - { - serverMessage = serverMessage.substring( 0, maxLength - 3 ) + '...'; - } - - if ( serverMessage.length > 0 ) - { - message += '\n\n' + serverMessage; - } - } - - message += '\n\nThe error details are logged'; - - window.alert( message ); - - break; - default: - if ( callbackError ) - { - callbackError( request.status ); - } - } - } - } - - function textToXML( text, rootElementName ) - { - var docImpl = document.implementation; - var parser, dom; - - // For standards compliant browsers - if ( docImpl && docImpl.createLSParser ) - { - parser = docImpl.createLSParser( docImpl.MODE_SYNCHRONOUS, null ); - var input = docImpl.createLSInput(); - input.stringData = text; - return parser.parse( input ).documentElement; - } - - // For IE - else if ( window.ActiveXObject ) - { - dom = new ActiveXObject( 'Microsoft.XMLDOM' ); - dom.async = "false"; - dom.loadXML( text ); - return dom.getElementsByTagName( rootElementName )[0]; - } - - // For Mozilla - else if ( window.DOMParser ) - { - parser = new DOMParser(); - dom = parser.parseFromString( text, 'application\/xml' ); - return dom.documentElement; - } - - // No parsing abilities - return null; - } -} === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/sortOrderSection.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/sortOrderSection.vm 2009-11-03 09:05:08 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/sortOrderSection.vm 2010-05-21 16:16:11 +0000 @@ -1,7 +1,7 @@

$i18n.getString( "add_section" )

-
+ ## Labels ## Input @@ -34,19 +34,19 @@
- #foreach ( $section in $sections ) #end - +
- +
-