dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #17540
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7010: local vn - Removed offline mode in hospital entry form.
------------------------------------------------------------
revno: 7010
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-05-23 16:36:45 +0700
message:
local vn - Removed offline mode in hospital entry form.
modified:
local/vn/dhis-service-spreadsheet-reporting/src/main/java/org/hisp/dhis/reportsheet/ExportReportAttribute.java
local/vn/dhis-web-dataentry-hospital/src/main/resources/org/hisp/dhis/de/i18n_module.properties
local/vn/dhis-web-dataentry-hospital/src/main/resources/org/hisp/dhis/de/i18n_module_vi_VN.properties
local/vn/dhis-web-dataentry-hospital/src/main/resources/struts.xml
local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/javascript/entry.js
local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/javascript/form.js
local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/select.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 'local/vn/dhis-service-spreadsheet-reporting/src/main/java/org/hisp/dhis/reportsheet/ExportReportAttribute.java'
--- local/vn/dhis-service-spreadsheet-reporting/src/main/java/org/hisp/dhis/reportsheet/ExportReportAttribute.java 2012-04-16 03:00:30 +0000
+++ local/vn/dhis-service-spreadsheet-reporting/src/main/java/org/hisp/dhis/reportsheet/ExportReportAttribute.java 2012-05-23 09:36:45 +0000
@@ -68,36 +68,6 @@
}
@Override
- public boolean isAttribute()
- {
- return true;
- }
-
- @Override
- public boolean isCategory()
- {
- return false;
- }
-
- @Override
- public boolean isNormal()
- {
- return false;
- }
-
- @Override
- public boolean isOrgUnitGroupListing()
- {
- return false;
- }
-
- @Override
- public boolean isPeriodColumnListing()
- {
- return false;
- }
-
- @Override
public List<String> getItemTypes()
{
List<String> types = new ArrayList<String>();
=== modified file 'local/vn/dhis-web-dataentry-hospital/src/main/resources/org/hisp/dhis/de/i18n_module.properties'
--- local/vn/dhis-web-dataentry-hospital/src/main/resources/org/hisp/dhis/de/i18n_module.properties 2012-05-17 09:03:46 +0000
+++ local/vn/dhis-web-dataentry-hospital/src/main/resources/org/hisp/dhis/de/i18n_module.properties 2012-05-23 09:36:45 +0000
@@ -104,4 +104,6 @@
department = Khoa (Ph\u00f2ng)
please_select_department = Please select department
show_export_params = Show export params
-hide_export_params = Hide export params
\ No newline at end of file
+hide_export_params = Hide export params
+disconnect_server = Disconnect to server
+please_select_organisation_unit = Please select organisation unit
\ No newline at end of file
=== modified file 'local/vn/dhis-web-dataentry-hospital/src/main/resources/org/hisp/dhis/de/i18n_module_vi_VN.properties'
--- local/vn/dhis-web-dataentry-hospital/src/main/resources/org/hisp/dhis/de/i18n_module_vi_VN.properties 2012-05-17 09:03:46 +0000
+++ local/vn/dhis-web-dataentry-hospital/src/main/resources/org/hisp/dhis/de/i18n_module_vi_VN.properties 2012-05-23 09:36:45 +0000
@@ -110,4 +110,6 @@
no_period_selected=Kh\u00f4ng th\u1eddi \u0111i\u1ec3m n\u00e0o \u0111\u01b0\u1ee3c ch\u1ecdn
run_validation=Ki\u1ec3m tra d\u1eef li\u1ec7u
show_export_params = Hi\u1ec3n th\u1ecb khung ch\u1ecdn
-hide_export_params = \u1ea8n khung ch\u1ecdn
\ No newline at end of file
+hide_export_params = \u1ea8n khung ch\u1ecdn
+disconnect_server = Kh\u00f4ng th\u1ec3 k\u1ebft n\u1ed1i t\u1edbi m\u00e1y ch\u1ee7
+please_select_organisation_unit = H\u00e3y ch\u1ecdn \u0111\u01a1n v\u1ecb
\ No newline at end of file
=== modified file 'local/vn/dhis-web-dataentry-hospital/src/main/resources/struts.xml'
--- local/vn/dhis-web-dataentry-hospital/src/main/resources/struts.xml 2012-05-15 06:05:09 +0000
+++ local/vn/dhis-web-dataentry-hospital/src/main/resources/struts.xml 2012-05-23 09:36:45 +0000
@@ -13,9 +13,12 @@
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-dataentry-hospital/select.vm</param>
<param name="menu">/dhis-web-dataentry-hospital/menu.vm</param>
- <param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,javascript/form.js,javascript/entry.js,javascript/history.js</param>
+ <param name="javascripts">
+ ../dhis-web-commons/ouwt/ouwt.js,
+ javascript/form.js,javascript/entry.js,
+ javascript/history.js</param>
<param name="stylesheets">style/dhis-web-dataentry.css</param>
- <param name="offline">true</param>
+ <param name="offline">false</param>
</action>
<action name="getMetaData" class="org.hisp.dhis.de.action.GetMetaDataAction">
=== modified file 'local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/javascript/entry.js'
--- local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/javascript/entry.js 2012-05-10 16:18:43 +0000
+++ local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/javascript/entry.js 2012-05-23 09:36:45 +0000
@@ -248,7 +248,7 @@
this.save = function()
{
- storageManager.saveDataValue( dataValue );
+ //storageManager.saveDataValue( dataValue );
$.ajax( {
url: 'saveValue.action',
@@ -265,7 +265,7 @@
if ( code == 0 ) // Value successfully saved on server
{
- storageManager.clearDataValueJSON( dataValue );
+ //storageManager.clearDataValueJSON( dataValue );
markValue( resultColor );
}
else if(code == 2)
@@ -282,8 +282,8 @@
function handleError( jqXHR, textStatus, errorThrown )
{
- setHeaderMessage( i18n_offline_notification );
- markValue( resultColor );
+ setHeaderDelayMessage( i18n_disconnect_server );
+ markValue( COLOR_PINK );
}
function markValue( color )
=== modified file 'local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/javascript/form.js'
--- local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/javascript/form.js 2012-05-17 09:03:46 +0000
+++ local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/javascript/form.js 2012-05-23 09:36:45 +0000
@@ -56,6 +56,7 @@
var COLOR_ORANGE = '#ff6600';
var COLOR_WHITE = '#ffffff';
var COLOR_GREY = '#cccccc';
+var COLOR_PINK = '#cd78cd';
var DEFAULT_TYPE = 'int';
var DEFAULT_NAME = '[unknown]';
@@ -220,12 +221,22 @@
hideExportDiv();
showLoader();
- $( '#contentDiv' ).load( 'loadForm.action', {
+ $( '#contentDiv' ).load( 'loadForm.action',
+ {
dataSetId : dataSetId,
value: value
- }, function(html){
- loadDataValues(dataSetId);
- });
+ },
+ function ( responseText, textStatus, req )
+ {
+ if ( textStatus == "error" ) {
+ hideLoader();
+ clearEntryForm();
+ setHeaderDelayMessage( i18n_disconnect_server );
+ return;
+ }
+
+ loadDataValues( dataSetId );
+ } );
}
function getDataElementType( dataElementId )
@@ -484,17 +495,17 @@
// Form
// -----------------------------------------------------------------------------
-function loadDataValues(dataSetId)
+function loadDataValues( dataSetId )
{
$( '#completeButton' ).removeAttr( 'disabled' );
$( '#undoButton' ).attr( 'disabled', 'disabled' );
$( '#infoDiv' ).css( 'display', 'none' );
- insertDataValues(dataSetId);
+ insertDataValues( dataSetId );
displayEntryFormCompleted();
}
-function insertDataValues(dataSetId)
+function insertDataValues( dataSetId )
{
var dataValueMap = [];
currentMinMaxValueMap = []; // Reset
@@ -513,7 +524,7 @@
$( '[name="max"]' ).html( '' );
$( '[name="entryfield"]' ).filter( ':disabled' ).css( 'background-color', COLOR_GREY );
-
+
$.ajax( {
url: 'getDataValues.action',
data:
@@ -525,11 +536,13 @@
organisationUnitId : currentOrganisationUnitId
},
dataType: 'json',
- error: function() // offline
+ error: function() // disconnect to server
{
$( '#contentDiv' ).show();
$( '#completenessDiv' ).show();
$( '#infoDiv' ).hide();
+ setHeaderDelayMessage( i18n_disconnect_server );
+ return;
},
success: function( json ) // online
{
@@ -608,8 +621,7 @@
$( '#undoButton' ).attr( 'disabled', 'disabled' );
$( '#infoDiv' ).hide();
}
-
-
+
showById('completenessDiv');
hideLoader();
}
@@ -732,7 +744,7 @@
{
var params = storageManager.getCurrentCompleteDataSetParams();
- storageManager.saveCompleteDataSet( params );
+ //storageManager.saveCompleteDataSet( params );
$.ajax( {
url: 'registerCompleteDataSet.action',
@@ -749,7 +761,7 @@
{
disableCompleteButton();
- storageManager.clearCompleteDataSet( params );
+ //storageManager.clearCompleteDataSet( params );
if ( json.response == 'input' )
{
@@ -785,13 +797,13 @@
else
{
disableUndoButton();
- storageManager.clearCompleteDataSet( params );
+ //storageManager.clearCompleteDataSet( params );
}
},
error: function()
{
- storageManager.clearCompleteDataSet( params );
+ //storageManager.clearCompleteDataSet( params );
}
} );
}
@@ -931,6 +943,7 @@
// Local storage of forms
// -----------------------------------------------------------------------------
+/*
function updateForms()
{
purgeLocalForms();
@@ -995,6 +1008,7 @@
}
}
}
+*/
// TODO break if local storage is full
@@ -1021,7 +1035,7 @@
*
* @return number of characters.
*/
- this.totalSize = function()
+ /*this.totalSize = function()
{
var totalSize = new Number();
@@ -1036,7 +1050,7 @@
}
return totalSize;
- };
+ };*/
/**
* Returns the total numbers of characters in stored forms currently in the
@@ -1044,7 +1058,7 @@
*
* @return number of characters.
*/
- this.totalFormSize = function()
+ /*this.totalFormSize = function()
{
var totalSize = new Number();
@@ -1062,16 +1076,16 @@
}
return totalSize;
- };
+ };*/
/**
* Return the remaining capacity of the local storage in characters, ie. the
* maximum size minus the current size.
*/
- this.remainingStorage = function()
+ /*this.remainingStorage = function()
{
return MAX_SIZE - this.totalSize();
- };
+ };*/
/**
* Saves the content of a data entry form.
@@ -1080,7 +1094,7 @@
* @param html the form HTML content.
* @return true if the form saved successfully, false otherwise.
*/
- this.saveForm = function( dataSetId, html )
+ /*this.saveForm = function( dataSetId, html )
{
var id = KEY_FORM_PREFIX + dataSetId;
@@ -1104,7 +1118,7 @@
}
return true;
- };
+ };*/
/**
* Gets the content of a data entry form.
@@ -1112,31 +1126,31 @@
* @param dataSetId the identifier of the data set of the form.
* @return the content of a data entry form.
*/
- this.getForm = function( dataSetId, attributeId, value )
+ /*this.getForm = function( dataSetId, attributeId, value )
{
var id = KEY_FORM_PREFIX + dataSetId + "_" + attributeId + "_" + value;
return localStorage[id];
- };
+ };*/
/**
* Removes a form.
*
* @param dataSetId the identifier of the data set of the form.
*/
- this.deleteForm = function( dataSetId, attributeId, value )
+ /*this.deleteForm = function( dataSetId, attributeId, value )
{
var id = KEY_FORM_PREFIX + dataSetId + "_" + attributeId + "_" + value;
localStorage.removeItem( id );
- };
+ };*/
/**
* Returns an array of the identifiers of all forms.
*
* @return array with form identifiers.
*/
- this.getAllForms = function()
+ /*this.getAllForms = function()
{
var formIds = [];
@@ -1155,7 +1169,7 @@
}
return formIds;
- };
+ };*/
/**
* Indicates whether a form exists.
@@ -1163,12 +1177,12 @@
* @param dataSetId the identifier of the data set of the form.
* @return true if a form exists, false otherwise.
*/
- this.formExists = function( dataSetId, attributeId, value )
+ /*this.formExists = function( dataSetId, attributeId, value )
{
var id = KEY_FORM_PREFIX + dataSetId + "_" + attributeId + "_" + value;
return localStorage[id] != null;
- };
+ };*/
/**
* Downloads the form for the data set with the given identifier from the
@@ -1178,7 +1192,7 @@
* @param dataSetId the identifier of the data set of the form.
* @param formVersion the version of the form of the remote data set.
*/
- this.downloadForm = function( dataSetId, attributeId, value, formVersion )
+ /*this.downloadForm = function( dataSetId, attributeId, value, formVersion )
{
$.ajax( {
url: 'loadForm.action',
@@ -1197,7 +1211,7 @@
storageManager.saveFormVersion( this.dataSetId, attributeId, value, this.formVersion );
}
} );
- };
+ };*/
/**
* Saves a version for a form.
@@ -1205,7 +1219,7 @@
* @param the identifier of the data set of the form.
* @param formVersion the version of the form.
*/
- this.saveFormVersion = function( dataSetId, attributeId, value, formVersion )
+ /*this.saveFormVersion = function( dataSetId, attributeId, value, formVersion )
{
var id = dataSetId + "_" + attributeId + "_" + value;
@@ -1227,7 +1241,7 @@
{
log( 'Max local storage quota reached, ignored form version: ' + dataSetId );
}
- };
+ };*/
/**
* Returns the version of the form of the data set with the given
@@ -1236,7 +1250,7 @@
* @param dataSetId the identifier of the data set of the form.
* @return the form version.
*/
- this.getFormVersion = function( dataSetId, attributeId, value )
+ /*this.getFormVersion = function( dataSetId, attributeId, value )
{
var id = dataSetId + "_" + attributeId + "_" + value;
@@ -1248,14 +1262,14 @@
}
return null;
- };
+ };*/
/**
* Deletes the form version of the data set with the given identifier.
*
* @param dataSetId the identifier of the data set of the form.
*/
- this.deleteFormVersion = function( dataSetId, attributeId, value )
+ /*this.deleteFormVersion = function( dataSetId, attributeId, value )
{
if ( localStorage[KEY_FORM_VERSIONS] != null )
{
@@ -1269,26 +1283,26 @@
localStorage[KEY_FORM_VERSIONS] = JSON.stringify( formVersions );
}
}
- }
+ }*/
- this.getAllFormVersions = function()
+ /*this.getAllFormVersions = function()
{
return localStorage[KEY_FORM_VERSIONS] != null ? JSON.parse( localStorage[KEY_FORM_VERSIONS] ) : null;
- };
+ };*/
/**
* Saves a data value.
*
* @param dataValue The datavalue and identifiers in json format.
*/
- this.saveDataValue = function( dataValue )
+ /*this.saveDataValue = function( dataValue )
{
var id = this.getDataValueIdentifier( dataValue.dataElementId, dataValue.optionComboId, dataValue.periodId,
dataValue.organisationUnitId );
var dataValues = {};
- /* if ( localStorage[KEY_DATAVALUES] != null )
+ if ( localStorage[KEY_DATAVALUES] != null )
{
dataValues = JSON.parse( localStorage[KEY_DATAVALUES] );
}
@@ -1303,8 +1317,8 @@
} catch ( e )
{
log( 'Max local storage quota reached, ignored data value' );
- } */
- };
+ }
+ };*/
/**
* Gets the value for the data value with the given arguments, or null if it
@@ -1317,7 +1331,7 @@
* @return the value for the data value with the given arguments, null if
* non-existing.
*/
- this.getDataValue = function( dataElementId, categoryOptionComboId, periodId, organisationUnitId )
+ /*this.getDataValue = function( dataElementId, categoryOptionComboId, periodId, organisationUnitId )
{
var id = this.getDataValueIdentifier( dataElementId, categoryOptionComboId, periodId, organisationUnitId );
@@ -1329,18 +1343,18 @@
}
return null;
- };
+ };*/
/**
* Removes the given dataValue from localStorage.
*
* @param dataValue The datavalue and identifiers in json format.
*/
- this.clearDataValueJSON = function( dataValue )
+ /*this.clearDataValueJSON = function( dataValue )
{
this.clearDataValue( dataValue.dataElementId, dataValue.optionComboId, dataValue.periodId,
dataValue.organisationUnitId );
- };
+ };*/
/**
* Removes the given dataValue from localStorage.
@@ -1350,7 +1364,7 @@
* @param periodId the period identifier.
* @param organisationUnitId the organisation unit identifier.
*/
- this.clearDataValue = function( dataElementId, categoryOptionComboId, periodId, organisationUnitId )
+ /*this.clearDataValue = function( dataElementId, categoryOptionComboId, periodId, organisationUnitId )
{
var id = this.getDataValueIdentifier( dataElementId, categoryOptionComboId, periodId, organisationUnitId );
var dataValues = this.getAllDataValues();
@@ -1360,7 +1374,7 @@
delete dataValues[id];
localStorage[KEY_DATAVALUES] = JSON.stringify( dataValues );
}
- };
+ };*/
/**
* Returns a JSON associative array where the keys are on the form <data
@@ -1369,10 +1383,10 @@
*
* @return a JSON associative array.
*/
- this.getAllDataValues = function()
+ /*this.getAllDataValues = function()
{
return localStorage[KEY_DATAVALUES] != null ? JSON.parse( localStorage[KEY_DATAVALUES] ) : null;
- };
+ };*/
/**
* Supportive method.
@@ -1411,7 +1425,7 @@
*
* @return all complete data set registrations as JSON.
*/
- this.getCompleteDataSets = function()
+ /*this.getCompleteDataSets = function()
{
if ( localStorage[KEY_COMPLETEDATASETS] != null )
{
@@ -1419,14 +1433,14 @@
}
return null;
- };
+ };*/
/**
* Saves a complete data set registration.
*
* @param json the complete data set registration as JSON.
*/
- this.saveCompleteDataSet = function( json )
+ /*this.saveCompleteDataSet = function( json )
{
var completeDataSets = this.getCompleteDataSets();
var completeDataSetId = this.getCompleteDataSetId( json );
@@ -1442,14 +1456,14 @@
}
localStorage[KEY_COMPLETEDATASETS] = JSON.stringify( completeDataSets );
- };
+ };*/
/**
* Removes the given complete data set registration.
*
* @param the complete data set registration as JSON.
*/
- this.clearCompleteDataSet = function( json )
+ /*this.clearCompleteDataSet = function( json )
{
var completeDataSets = this.getCompleteDataSets();
var completeDataSetId = this.getCompleteDataSetId( json );
@@ -1467,7 +1481,7 @@
localStorage[KEY_COMPLETEDATASETS] = JSON.stringify( completeDataSets );
}
}
- };
+ };*/
/**
* Indicates whether there exists data values or complete data set
@@ -1475,7 +1489,7 @@
*
* @return true if local data exists, false otherwise.
*/
- this.hasLocalData = function()
+ /*this.hasLocalData = function()
{
var dataValues = this.getAllDataValues();
var completeDataSets = this.getCompleteDataSets();
@@ -1500,22 +1514,23 @@
}
return true;
- };
+ };*/
}
function getAttributes()
{
clearListById( 'attributeId' );
+
$.getJSON( '../dhis-web-commons-ajax-json/getAttributes.action',{}
- , function( json )
- {
- addOptionById( 'attributeId', '', i18n_please_select_attribute );
-
- for ( i in json.attributes )
- {
- $('#attributeId').append('<option value=' + json.attributes[i].id + '>' + json.attributes[i].name + '</option>');
- }
- } );
+ , function( json )
+ {
+ addOptionById( 'attributeId', '', i18n_please_select_attribute );
+
+ for ( i in json.attributes )
+ {
+ $('#attributeId').append('<option value=' + json.attributes[i].id + '>' + json.attributes[i].name + '</option>');
+ }
+ } );
}
function getSuggestedAttrValue()
@@ -1538,7 +1553,6 @@
} );
}
-
function autoCompletedField()
{
var select = jQuery( "#value" );
=== modified file 'local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/select.vm'
--- local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/select.vm 2012-05-17 09:03:46 +0000
+++ local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/select.vm 2012-05-23 09:36:45 +0000
@@ -27,6 +27,7 @@
var i18n_operation_not_available_offline = '$encoder.jsEscape( $i18n.getString( "operation_not_available_offline" ) , "'")';
var i18n_online_notification = '$encoder.jsEscape( $i18n.getString( "online_notification" ) , "'")';
var i18n_offline_notification = '$encoder.jsEscape( $i18n.getString( "offline_notification" ) , "'")';
+var i18n_disconnect_server = '$encoder.jsEscape( $i18n.getString( "disconnect_server" ) , "'")';
var i18n_need_to_sync_notification = '$encoder.jsEscape( $i18n.getString( "need_to_sync_notification" ) , "'")';
var i18n_sync_now = '$encoder.jsEscape( $i18n.getString( "sync_now" ) , "'")';
var i18n_sync_success = '$encoder.jsEscape( $i18n.getString( "sync_success" ) , "'")';
@@ -40,6 +41,7 @@
var i18n_please_select_attribute = "[ " + '$encoder.jsEscape( $i18n.getString( "please_select_attribute" ) , "'")' + " ]";
var i18n_show_all_items = '$encoder.jsEscape( $i18n.getString( "show_all_items" ) , "'")';
var i18n_please_select_department = "[ " + '$encoder.jsEscape( $i18n.getString( "please_select_department" ) , "'")' + " ]";
+var i18n_please_select_unit = "[ " + '$encoder.jsEscape( $i18n.getString( "please_select_organisation_unit" ) , "'")' + " ]";
</script>
<h3>$i18n.getString( "data_entry" ) #openHelp( "dataEntry" )</h3>
@@ -58,6 +60,8 @@
<input type="button" onclick="showExportDiv();" value="$i18n.getString( 'show_export_params' )"/>
</div>
+<br/>
+
<div class="inputCriteria" id='inputCriteria' style="width:620px;height:270px;">
<input type='hidden' id='dataSetId' name='dataSetId'>
<table>