=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml 2010-09-15 04:42:49 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml 2010-09-16 09:43:15 +0000 @@ -43,8 +43,9 @@ - /dhis-web-reporting/responseSuccess.vm - /dhis-web-reporting/responseInput.vm + + /dhis-web-commons/ajax/jsonResponseSuccess.vm + /dhis-web-commons/ajax/jsonResponseInput.vm plainTextError === modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addDocumentForm.vm' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addDocumentForm.vm 2010-03-17 11:11:37 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addDocumentForm.vm 2010-09-16 09:43:15 +0000 @@ -1,3 +1,16 @@ +

$i18n.getString( 'create_new_static_report' )

@@ -8,8 +21,8 @@ $i18n.getString( "details" ) - - + + @@ -20,7 +33,7 @@ #elseif( $!document) #else - + #end @@ -31,8 +44,9 @@
- - + +
+
@@ -40,8 +54,8 @@
- - + +
@@ -53,7 +67,7 @@ - @@ -61,7 +75,6 @@ -$!message === modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/document.js' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/document.js 2010-03-17 11:11:37 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/document.js 2010-09-16 09:43:15 +0000 @@ -1,31 +1,4 @@ -function saveDocument() -{ - var url = "validateDocument.action?name=" + getFieldValue( "name" ) + "&id=" + getFieldValue( "id" ); - - var request = new Request(); - request.setResponseTypeXML( 'message' ); - request.setCallbackSuccess( saveDocumentReceived ); - request.send( url ); -} - -function saveDocumentReceived( messageElement ) -{ - var type = messageElement.getAttribute( 'type' ); - var message = messageElement.firstChild.nodeValue; - - if ( type == "input" ) - { - setMessage( message ); - - return false; - } - else if ( type == "success" ) - { - document.getElementById( "documentForm" ).submit(); - } -} - function removeDocument( id ) { removeItem( id, "", i18n_confirm_remove_report, "removeDocument.action" ); @@ -50,10 +23,17 @@ { document.getElementById( "fileDiv" ).style.display = "none"; document.getElementById( "urlDiv" ).style.display = "block"; + $('#url').attr('class','{validate:{required:true}}'); + $('#upload').attr('class',''); } else { document.getElementById( "fileDiv" ).style.display = "block"; document.getElementById( "urlDiv" ).style.display = "none"; + if( byId('id').value == "") + { + $('#upload').attr('class','{validate:{required:true}}'); + $('#url').attr('class',''); + } } }