~dhis2-devs-core/dhis2/dhis2-patient-tz

« back to all changes in this revision

Viewing changes to local/tz/dhis-web-maintenance-patient-tz/src/main/webapp/dhis-web-maintenance-patient/javascript/import.js

  • Committer: John Francis Mukulu
  • Date: 2011-08-09 06:36:18 UTC
  • mfrom: (4244.1.21 dhis2)
  • Revision ID: john.f.mukulu@gmail.com-20110809063618-wad1pcc9fd1mnc6k
[merge]

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//------------------------------------------------------------------------------
2
 
// Save Configuration
3
 
//------------------------------------------------------------------------------
4
 
 
5
 
function saveConfiguration()
6
 
{       
7
 
        var url = 'saveConfiguration.action?' +
8
 
                        'fileName=' + getFieldValue( 'fileName' );
9
 
        
10
 
        var request = new Request();
11
 
    request.setResponseTypeXML( 'message' );
12
 
    request.setCallbackSuccess( saveConfigurationCompleted );    
13
 
    request.send( url );        
14
 
 
15
 
    return false;
16
 
}
17
 
 
18
 
function saveConfigurationCompleted( messageElement )
19
 
{
20
 
    showSuccessMessage( i18n_save_successfull );
21
 
}
22
 
 
23
 
function validateUploadExcelFile()
24
 
{
25
 
        jQuery( "#upload" ).upload( 'validateUploadExcelFile.action',
26
 
                function( data )
27
 
                {
28
 
                        data = data.getElementsByTagName('message')[0]; 
29
 
                        var type = data.getAttribute("type");
30
 
                        
31
 
                        if ( type=='error' ) showErrorMessage(data.firstChild.nodeValue);
32
 
                        else uploadExcelImportPatient();
33
 
                }, 'xml'
34
 
        );
35
 
}
36
 
 
37
 
function uploadExcelImportPatient()
38
 
{
39
 
        jQuery( "#upload" ).upload( 'importPatient.action',
40
 
                function(data)
41
 
                {
42
 
                        data = data.getElementsByTagName('message')[0];
43
 
                        if ( data != undefined )
44
 
                        {
45
 
                                var type = data.getAttribute("type");
46
 
                                if ( type=='error' ) alert(data.firstChild.nodeValue);
47
 
                        }
48
 
                        else window.location.reload();
49
 
                }, 'xml'
50
 
        );
51
 
}
 
 
b'\\ No newline at end of file'