dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #28632
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14309: Fixed bug - Exception thrown when to cselect an orgunit in Single event with registration.
------------------------------------------------------------
revno: 14309
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-03-20 17:17:37 +0700
message:
Fixed bug - Exception thrown when to cselect an orgunit in Single event with registration.
modified:
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetSingleEventProgramListAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ShowEventWithRegistrationFormAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml
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/anonymousRegistration.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/jsonSingleEventPrograms.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleDataEntryForm.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/java/org/hisp/dhis/caseentry/action/caseentry/GetSingleEventProgramListAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetSingleEventProgramListAction.java 2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetSingleEventProgramListAction.java 2014-03-20 10:17:37 +0000
@@ -86,8 +86,8 @@
if ( orgunit != null )
{
programs = programService.getProgramsByCurrentUser( orgunit );
- programs.removeAll( programService.getPrograms( Program.MULTIPLE_EVENTS_WITH_REGISTRATION, orgunit ) );
- programs.removeAll( programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION, orgunit ) );
+ programs.removeAll( programService.getPrograms( Program.MULTIPLE_EVENTS_WITH_REGISTRATION) );
+ programs.removeAll( programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION) );
}
return SUCCESS;
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ShowEventWithRegistrationFormAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ShowEventWithRegistrationFormAction.java 2014-03-19 06:44:30 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ShowEventWithRegistrationFormAction.java 2014-03-20 10:17:37 +0000
@@ -147,6 +147,8 @@
private Map<Integer, Collection<TrackedEntityAttribute>> attributeGroupsMap = new HashMap<Integer, Collection<TrackedEntityAttribute>>();
+ private Program program;
+
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -157,7 +159,7 @@
organisationUnit = selectionManager.getSelectedOrganisationUnit();
healthWorkers = organisationUnit.getUsers();
- Program program = programService.getProgram( programId );
+ program = programService.getProgram( programId );
TrackedEntityForm trackedEntityForm = trackedEntityFormService.getTrackedEntityForm( program );
if ( trackedEntityForm != null )
@@ -218,6 +220,11 @@
// -------------------------------------------------------------------------
// Getter/Setter
// -------------------------------------------------------------------------
+
+ public Program getProgram()
+ {
+ return program;
+ }
public Collection<User> getHealthWorkers()
{
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 2014-03-17 06:27:47 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 2014-03-20 10:17:37 +0000
@@ -379,7 +379,7 @@
</action>
<action name="showEventWithRegistrationForm"
- class="org.hisp.dhis.caseentry.action.caseentry.ShowEventWithRegistrationFormAction">
+ class="org.hisp.dhis.caseentry.action.trackedentity.ShowAddTrackedEntityInstanceFormAction">
<result name="success" type="velocity">/content.vm</result>
<param name="page">/dhis-web-caseentry/addSingleEventRegistration.vm</param>
<param name="stylesheets">style/style.css</param>
=== 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 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addSingleEventRegistration.vm 2014-03-20 10:17:37 +0000
@@ -3,12 +3,12 @@
currentDiv = 'entityInstanceForm';
checkedDuplicate = false;
- jQuery("#entityInstanceForm").validate({
+ jQuery("#singleEventForm").validate({
meta:"validate"
,errorElement:"span"
,submitHandler: function(form)
{
- validateAddEntityInstance();
+ validateData();
}
});
@@ -20,7 +20,7 @@
<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'/>
+ <input type="hidden" id="programStageId" name="programStageId"/>
<table>
<tbody id='entityInstanceForm'>
@@ -44,16 +44,5 @@
var i18n_error_connect_to_server = '$encoder.jsEscape( $i18n.getString( "error_connect_to_server" ) , "'" )';
var i18n_add_person_successfully = '$encoder.jsEscape( $i18n.getString( "add_person_successfully" ) , "'" )';
setInnerHTML('entryName', jQuery('#programIdAddEntityInstance option:selected').text() );
-
- jQuery(document).ready( function(){
-
- jQuery("#singleEventForm").validate({
- meta:"validate"
- ,errorElement:"span"
- ,submitHandler: function(form)
- {
- validateData();
- }
- });
- });
+ setFieldValue("programStageId", getFieldValue("programIdAddEntityInstance"));
</script>
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm 2014-03-20 10:17:37 +0000
@@ -6,7 +6,8 @@
</script>
<h3>$i18n.getString( "anonymous_events_management" ) #openHelp('single_event_without_registration')</h3>
-<h4 id='programName' name='programName'></h4>
+<h3 id='orgunitNameInfor' name='orgunitNameInfor'></h3>
+<h4 id='programName' name='programName'>fasdfadfa</h4>
<input type='hidden' id='orgunitId' name='orgunitId' value='$orgunit.id'>
<input type='hidden' id='programStageInstanceId' name='programStageInstanceId' value='0'>
=== 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 2013-12-03 09:49:28 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js 2014-03-20 10:17:37 +0000
@@ -902,6 +902,7 @@
showById( 'dataEntryInfor' );
setFieldValue( 'programStageInstanceId', '0' );
setInnerHTML( 'programName', $( '#programId option:selected' ).text() );
+ setInnerHTML( 'orgunitNameInfor', getFieldValue("orgunitName"));
if( isCreateEvent != undefined ){
addNewEvent();
}
=== 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 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js 2014-03-20 10:17:37 +0000
@@ -52,7 +52,8 @@
programId: getFieldValue('programIdAddEntityInstance')
}, function()
{
- setInnerHTML('singleProgramName',jQuery('#programIdAddEntityInstance option:selected').text()); unSave = true;
+ setInnerHTML('singleProgramName',jQuery('#programIdAddEntityInstance option:selected').text());
+ unSave = true;
showById('singleProgramName');
showById('addNewDiv');
jQuery('#loaderDiv').hide();
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonSingleEventPrograms.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonSingleEventPrograms.vm 2013-01-23 10:27:28 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonSingleEventPrograms.vm 2014-03-20 10:17:37 +0000
@@ -10,6 +10,7 @@
"reportDateDescription": "$programStage.reportDateDescription",
"programStageId": "$programStage.id"
#end
+
}#if( $velocityCount < $size ),#end
#end]
}
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleDataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleDataEntryForm.vm 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleDataEntryForm.vm 2014-03-20 10:17:37 +0000
@@ -180,7 +180,7 @@
<tbody id="entryForm">
<tr>
- <th colspan='2'>$programStage.program.displayName</th>
+ <th colspan='2'>$!programStage.program.displayName</th>
</tr>
<!-- Identifiers/Attributes belong to the selected single program -->
#set($program = $programStage.program)