dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #20078
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9036: Improve single event with registrationdata entry UI.
------------------------------------------------------------
revno: 9036
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-11-15 10:47:43 +0700
message:
Improve single event with registrationdata entry UI.
modified:
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addSingleEventRegistration.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryMenu.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataRecordingSelect.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/detailsPartner.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/listPatient.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.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 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addSingleEventRegistration.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addSingleEventRegistration.vm 2012-11-09 08:29:29 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addSingleEventRegistration.vm 2012-11-15 03:47:43 +0000
@@ -1,6 +1,6 @@
<script>
- jQuery(document).ready( function(){
+ jQuery("#singleEventForm").ready( function(){
currentDiv = 'patientForm';
checkedDuplicate = false;
@@ -35,14 +35,8 @@
});
</script>
-<h3>
- <a href="javascript:backMainPage();">$i18n.getString( "single_event_with_registration_management" )</a>
- • <span id='singleProgramName' name='singleProgramName'></span>
- » $i18n.getString( "add_new_patient" )
-</h3>
<form id='singleEventForm'>
-
<input type="hidden" id="representativeId" name="representativeId"/>
<input type="hidden" id="relationshipTypeId" name="relationshipTypeId"/>
<input type="hidden" id="programStageId" name="programStageId" value='$programStage.id'/>
@@ -53,12 +47,15 @@
</tbody>
<tr><td>$programStage.program.name</td></tr>
#parse( "/dhis-web-caseentry/singleDataEntryForm.vm" )
+ <tr><td> </td><tr>
+ <tr>
+ <td></td>
+ <td>
+ <input type="submit" class="button" value="$i18n.getString( 'add' )" onclick='_continue=false;'/>
+ <input type="button" class="button" value="$i18n.getString( 'back' )" onclick="javascript:backEventList();"/>
+ </td>
+ </tr>
</table>
- <p>
- <input type="submit" class="button" value="$i18n.getString( 'add' )" onclick='_continue=false;'/>
- <input type="submit" class="button" value="$i18n.getString( 'add_and_continue' )" onclick='_continue=true;'/>
- <input type="button" class="button" value="$i18n.getString( 'back' )" onclick="javascript:backMainPage();"/>
- </p>
</form>
<script>
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryMenu.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryMenu.vm 2012-11-14 05:52:34 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryMenu.vm 2012-11-15 03:47:43 +0000
@@ -13,7 +13,7 @@
<div id="eventActionMenu" class="hidden">
<ul>
<li><a href="javascript:backEventList();">$i18n.getString( "back_to_event_list" )</a></li>
- <li name="eventActionLink"><a href="javascript:completedAndAddNewEvent();">$i18n.getString('complete_and_add_new_event')</a></li>
- <li name="eventActionLink"><a href="javascript:javascript:removeCurrentEvent();">$i18n.getString('remove')</a></li>
+ <li id="nextEventLink" name="eventActionLink"><a href="javascript:completedAndAddNewEvent();">$i18n.getString('complete_and_add_new_event')</a></li>
+ <li id="removeEventLink" name="eventActionLink"><a href="javascript:javascript:removeCurrentEvent();">$i18n.getString('remove')</a></li>
</ul>
</div>
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataRecordingSelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataRecordingSelect.vm 2012-10-23 08:11:54 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataRecordingSelect.vm 2012-11-15 03:47:43 +0000
@@ -1,9 +1,3 @@
-<h3>
- <a href="javascript:backMainPage();">$i18n.getString( 'single_event_with_registration_management' )</a>
- • <span id='singleProgramName' name='singleProgramName'></span>
- » $i18n.getString( "edit" )
-</h3>
-
<form id='dataRecordingSelectForm' name='dataRecordingSelectForm' method='post'>
<table class="mainPageTable" id='patientInfoDiv'>
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/detailsPartner.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/detailsPartner.vm 2012-10-03 08:00:10 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/detailsPartner.vm 2012-11-15 03:47:43 +0000
@@ -65,18 +65,15 @@
</td>
</tr>
-
<tr><td></td></tr>
<tr>
- #if( $partnerIsRepresentative == 'true' )
- <td>
- <input type="button" value="$i18n.getString('is_not_representative')" onclick="javascript:removeRepresentative( getFieldValue('id'), $partner.id );" style='width:150px;' >
- </td>
- #else
- <td>
- <input type="button" value="$i18n.getString('save')" title="$i18n.getString('set_as_representative')" onclick="javascript:saveRepresentative( getFieldValue('id'), $partner.id, false )" style='width:150px;' >
- <input type="button" value="$i18n.getString('save_all')" title="$i18n.getString('set_as_representative_and_copy_attributes_for_the_person')" onclick="javascript:saveRepresentative( getFieldValue('id'), $partner.id, true )" style='width:150px;' >
- </td>
- #end
+ <td colspan='2'>
+ #if( $partnerIsRepresentative == 'true' )
+ <input type="button" value="$i18n.getString('is_not_representative')" onclick="javascript:removeRepresentative( getFieldValue('id'), $partner.id );" style='width:150px;' >
+ #else
+ <input type="button" value="$i18n.getString('save')" title="$i18n.getString('set_as_representative')" onclick="javascript:saveRepresentative( getFieldValue('id'), $partner.id, false )" style='width:150px;' >
+ <input type="button" value="$i18n.getString('save_all')" title="$i18n.getString('set_as_representative_and_copy_attributes_for_the_person')" onclick="javascript:saveRepresentative( getFieldValue('id'), $partner.id, true )" style='width:150px;' >
+ #end
+ </td>
</tr>
</table>
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js 2012-11-15 02:37:17 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js 2012-11-15 03:47:43 +0000
@@ -472,7 +472,7 @@
function removeEmptyEvents()
{
- var result = window.confirm( i18n_confirm_remove_empty_events );
+ var result = window.confirm( i18n_confirm_delete );
if ( result )
{
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js 2012-11-13 04:54:30 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js 2012-11-15 03:47:43 +0000
@@ -3,7 +3,6 @@
function orgunitSelected( orgUnits, orgUnitNames )
{
- showById('mainLinkLbl');
hideById('addNewDiv');
organisationUnitSelected( orgUnits, orgUnitNames );
clearListById('programIdAddPatient');
@@ -20,13 +19,14 @@
function showAddPatientForm()
{
+ hideById('dataEntryMenu');
+ showById('eventActionMenu');
+ showById('nextEventLink');
hideById('contentDiv');
- hideById('mainLinkLbl');
hideById('searchDiv');
hideById('advanced-search');
setInnerHTML('addNewDiv','');
setInnerHTML('dataRecordingSelectDiv','');
-
jQuery('#loaderDiv').show();
jQuery('#addNewDiv').load('showEventWithRegistrationForm.action',
{
@@ -34,11 +34,24 @@
}, function()
{
setInnerHTML('singleProgramName',jQuery('#programIdAddPatient option:selected').text()); unSave = true;
+ showById('singleProgramName');
showById('addNewDiv');
jQuery('#loaderDiv').hide();
});
}
+function showUpdatePatientForm( patientId )
+{
+ hideById('dataEntryMenu');
+ showById('eventActionMenu');
+ hideById('nextEventLink');
+ setInnerHTML('singleProgramName',jQuery('#programIdAddPatient option:selected').text());
+ showById('singleProgramName');
+ setInnerHTML('addNewDiv','');
+ unSave = false;
+ showSelectedDataRecoding(patientId, getFieldValue('programIdAddPatient'));
+}
+
function addEventForPatientForm( divname )
{
jQuery("#" + divname + " [id=checkDuplicateBtn]").click(function() {
@@ -118,23 +131,23 @@
}
else if ( type == 'error' ){
showWarningMessage( i18n_program_enrollment_failed + ':' + '\n' + message );
- removePatientInSingleProgram(patientId);
+ removeEvent( patientId );
}
else if ( type == 'input' ){
showWarningMessage( json.message );
- removePatientInSingleProgram(patientId);
+ removeEvent( patientId );
}
jQuery('#loaderDiv').hide();
});
}
-function removePatientInSingleProgram( patientId )
+function removeEvent( patientId )
{
$("#patientForm :input").attr("disabled",false);
jQuery.postJSON( "removePatient.action",
{
id: patientId
- }, function(){});
+ }, function(json){});
}
function addData( programId, patientId )
@@ -268,9 +281,11 @@
});
}
-function backMainPage()
+function backEventList()
{
- showById('mainLinkLbl');
+ showById('dataEntryMenu');
+ hideById('eventActionMenu');
+ hideById('singleProgramName');
showSearchForm();
if( getFieldValue('listAll')=='true'){
listAllPatient();
@@ -301,4 +316,10 @@
showWarningMessage( json.message );
}
});
+}
+
+function completedAndAddNewEvent()
+{
+ _continue=true;
+ jQuery("#singleEventForm").submit();
}
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/listPatient.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/listPatient.vm 2012-11-09 08:34:16 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/listPatient.vm 2012-11-15 03:47:43 +0000
@@ -81,7 +81,7 @@
#if($value=="")
#set($value=$patient.getFullName())
#end
- <td style='cursor:pointer;' onclick="javascript:setInnerHTML('addNewDiv','');unSave = false;showSelectedDataRecoding('$patient.id', getFieldValue('programIdAddPatient'));">
+ <td style='cursor:pointer;' onclick="javascript:">
<a>$value</a>
</td>
<td>
@@ -98,8 +98,8 @@
<td>$!mapPatientOrgunit.get($patient.id)</td>
#end
<td>
- <a href="javascript:setInnerHTML('addNewDiv','');unSave = false;validateAllowEnrollment('$patient.id', getFieldValue('programIdAddPatient'));" title="$i18n.getString( 'data_entry' )"><img src="images/data_entry.png" alt="$i18n.getString( 'data_entry' )"></a>
- <a href="javascript:showPatientHistory( '$patient.id' )" title='$i18n.getString( "patient_details_and_history" )'><img src="../images/information.png" alt='$i18n.getString( "patient_details_and_history" )'></a>
+ <a href="javascript:showUpdatePatientForm('$patient.id');" title="$i18n.getString( 'data_entry' )"><img src="images/data_entry.png" alt="$i18n.getString( 'data_entry' )"></a>
+ <a href="javascript:showPatientHistory('$patient.id')" title='$i18n.getString( "patient_details_and_history" )'><img src="../images/information.png" alt='$i18n.getString( "patient_details_and_history" )'></a>
</td>
</tr>
#if( $mark )
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.vm 2012-10-23 08:11:54 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.vm 2012-11-15 03:47:43 +0000
@@ -8,12 +8,14 @@
}
});
disable('advancedSearchBtn');
+ hideById('removeEventLink');
setFieldValue('isSearchByProgram', true);
$("#searchObjectId option[value='prg']").remove();
});
</script>
-<h3 id='mainLinkLbl'>$i18n.getString( "single_event_with_registration_management" ) #openHelp('single_event_with_registration')</h3>
+<h3>$i18n.getString( "single_event_with_registration_management" ) #openHelp('single_event_with_registration')</h3>
+<h4 id='singleProgramName' name='singleProgramName'></h4>
<input type='hidden' id='isRegistration' name= 'isRegistration' value='true'>
<input type='hidden' id='listAll' name='listAll'>
@@ -24,7 +26,7 @@
#parse( "dhis-web-caseentry/searchPatientCriteria.vm" )
</div>
-<p><input type="button" class='button' value="$i18n.getString( 'back_to_search' )" id='backBtnFromEntry' onclick='backMainPage();' style='display:none;'></p>
+<p><input type="button" class='button' value="$i18n.getString( 'back_to_search' )" id='backBtnFromEntry' onclick='backEventList();' style='display:none;'></p>
<div class='hidden' id='selectForm' name='selectForm'>
<input id='executionDateNewEvent' name='executionDateNewEvent'>