dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #17542
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7012: CCEM work in progress
------------------------------------------------------------
revno: 7012
committer: Mithilesh Kumar Thakur<mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-05-23 15:33:31 +0530
message:
CCEM work in progress
modified:
local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/equipmentDataEntry.vm
local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/javascript/equipmentDataEntry.js
--
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/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/equipmentDataEntry.vm'
--- local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/equipmentDataEntry.vm 2012-05-23 06:35:17 +0000
+++ local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/equipmentDataEntry.vm 2012-05-23 10:03:31 +0000
@@ -53,7 +53,7 @@
#end
</select>
<span id="loaderSpan" style="display:none"><img src='../images/ajax-loader-bar.gif'></span></td>
- </tr>
+ </tr>
<tr>
<td><label for="selectedPeriodId">$i18n.getString( "period" )</label></td>
<td><select id="selectedPeriodId" name="selectedPeriodId" style="width:220px" disabled="disabled" onchange="loadDataEntryForm()">
@@ -73,7 +73,7 @@
<p>
- <input type="submit" class="button" value="$i18n.getString( 'save' )"/>
+ <input type="submit" class="button" id="saveButton" name="saveButton" value="$i18n.getString( 'save' )" disabled="disabled"/>
<input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='enquipmentSelect.action'" />
</p>
=== modified file 'local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/javascript/equipmentDataEntry.js'
--- local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/javascript/equipmentDataEntry.js 2012-05-23 06:35:17 +0000
+++ local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/javascript/equipmentDataEntry.js 2012-05-23 10:03:31 +0000
@@ -197,6 +197,8 @@
//alert("mmmmm");
$( '#dataEntryFormDiv' ).html('');
+
+ $( '#saveButton' ).removeAttr( 'disabled' );
//alert("mmmmm");
//setInnerHTML('dataEntryFormDiv', '');
//hideById('dataEntryFormDiv');
@@ -213,25 +215,36 @@
var selectedPeriodId = $( '#selectedPeriodId' ).val();
- //setInnerHTML('dataEntryFormDiv', '');
- //alert( dataSetId +"---"+ selectedPeriodId +"----"+ equipmentInstanceId );
-
- //hideById('dataEntryFormDiv');
- jQuery('#loaderDiv').show();
-
- //contentDiv = 'dataEntryFormDiv';
-
- jQuery('#dataEntryFormDiv').load('loadDataEntryForm.action',
- {
- dataSetId:dataSetId,
- selectedPeriodId:selectedPeriodId,
- equipmentInstanceId:equipmentInstanceId
- }, function()
- {
- showById('dataEntryFormDiv');
- jQuery('#loaderDiv').hide();
- });
- hideLoader();
+ if ( selectedPeriodId == "-1" )
+ {
+ $( '#dataEntryFormDiv' ).html('');
+ document.getElementById( "saveButton" ).disabled = true;
+ return false;
+ }
+
+ else
+ {
+ //setInnerHTML('dataEntryFormDiv', '');
+ //alert( dataSetId +"---"+ selectedPeriodId +"----"+ equipmentInstanceId );
+
+ //hideById('dataEntryFormDiv');
+ jQuery('#loaderDiv').show();
+
+ //contentDiv = 'dataEntryFormDiv';
+
+ jQuery('#dataEntryFormDiv').load('loadDataEntryForm.action',
+ {
+ dataSetId:dataSetId,
+ selectedPeriodId:selectedPeriodId,
+ equipmentInstanceId:equipmentInstanceId
+ }, function()
+ {
+ showById('dataEntryFormDiv');
+ jQuery('#loaderDiv').hide();
+ });
+ hideLoader();
+ }
+
}