dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #28010
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13955: Fixed bug - Display Dashboard and relationship management link in Add new entity instance for rel...
------------------------------------------------------------
revno: 13955
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2014-02-08 22:19:56 +0700
message:
Fixed bug - Display Dashboard and relationship management link in Add new entity instance for relationship.
modified:
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddTrackedEntityInstanceFormAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addRelationshipForm.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addTrackedEntityInstanceForm.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataentryRecords.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/relationship.js
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/trackedEntityInstance.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 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java 2014-02-08 15:19:56 +0000
@@ -263,10 +263,6 @@
Grid attrGrid = new ListGrid();
- attrGrid.addHeader( new GridHeader( i18n.getString( "name" ), false, true ) );
- attrGrid.addHeader( new GridHeader( i18n.getString( "value" ), false, true ) );
- attrGrid.addHeader( new GridHeader( "", true, false ) );
-
// ---------------------------------------------------------------------
// Add dynamic attribues
// ---------------------------------------------------------------------
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddTrackedEntityInstanceFormAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddTrackedEntityInstanceFormAction.java 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddTrackedEntityInstanceFormAction.java 2014-02-08 15:19:56 +0000
@@ -49,8 +49,10 @@
import org.hisp.dhis.trackedentity.TrackedEntityAttributeService;
import org.hisp.dhis.trackedentity.TrackedEntityForm;
import org.hisp.dhis.trackedentity.TrackedEntityFormService;
+import org.hisp.dhis.trackedentity.TrackedEntityInstanceService;
import org.hisp.dhis.trackedentity.comparator.TrackedEntityAttributeGroupSortOrderComparator;
import org.hisp.dhis.user.User;
+import org.springframework.beans.factory.annotation.Autowired;
import com.opensymphony.xwork2.Action;
@@ -65,6 +67,9 @@
// Dependencies
// -------------------------------------------------------------------------
+ @Autowired
+ private TrackedEntityInstanceService entityInstanceService;
+
private OrganisationUnitSelectionManager selectionManager;
public void setSelectionManager( OrganisationUnitSelectionManager selectionManager )
@@ -133,28 +138,23 @@
this.programId = programId;
}
- private Integer entityInstancesId;
+ private Integer entityInstanceId;
- public void setEntityInstanceId( Integer entityInstancesId )
+ public void setEntityInstanceId( Integer entityInstanceId )
{
- this.entityInstancesId = entityInstancesId;
+ this.entityInstanceId = entityInstanceId;
}
public Integer getEntityInstanceId()
{
- return entityInstancesId;
- }
-
- private String entityInstancesUid;
-
- public void setEntityInstanceUid( String entityInstancesUid )
- {
- this.entityInstancesUid = entityInstancesUid;
- }
+ return entityInstanceId;
+ }
+
+ private String entityInstanceUid;
public String getEntityInstanceUid()
{
- return entityInstancesUid;
+ return entityInstanceUid;
}
private Integer relatedProgramId;
@@ -261,6 +261,11 @@
public String execute()
{
+ if( entityInstanceId!=null)
+ {
+ entityInstanceUid = entityInstanceService.getTrackedEntityInstance( entityInstanceId ).getUid();
+ }
+
organisationUnit = selectionManager.getSelectedOrganisationUnit();
healthWorkers = organisationUnit.getUsers();
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addRelationshipForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addRelationshipForm.vm 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addRelationshipForm.vm 2014-02-08 15:19:56 +0000
@@ -12,7 +12,7 @@
<h5>
<a name="mainPagelink" href="javascript:onClickBackBtn();">$i18n.getString( 'tracked_entity_instance_management' )</a>
- • <a href="javascript:showTrackedEntityInstanceDashboardForm('$!entityInstance.uid');">$i18n.getString( 'tracked_entity_instance_dashboard' )</a>
+ • <a href="javascript:showTrackedEntityInstanceDashboardForm('$!entityInstance.uid');">$i18n.getString( 'dashboard' )</a>
• <a href="javascript:showRelationshipList( '$entityInstance.id' )">$i18n.getString( "relationship_management" )</a>
</h5>
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addTrackedEntityInstanceForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addTrackedEntityInstanceForm.vm 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addTrackedEntityInstanceForm.vm 2014-02-08 15:19:56 +0000
@@ -32,6 +32,16 @@
• $i18n.getString( "add_new_tracked_entity_instance" )
</h3>
+<h5 name='addRelationShipLink'>
+ <a name="mainPagelink" href="javascript:onClickBackBtn();">$i18n.getString( 'tracked_entity_instance_management' )</a>
+ • <a href="javascript:showTrackedEntityInstanceDashboardForm('$entityInstanceUid');">$i18n.getString( 'dashboard' )</a>
+ • <a href="javascript:setFieldValue( 'isShowTrackedEntityInstanceList', 'false' ); showRelationshipList('$entityInstance.id')">$i18n.getString( "relationship_management" )
+</h5>
+<h3 name='addRelationShipLink'>
+ » <a href="javascript:showAddRelationship('$entityInstanceId')" >$i18n.getString( 'seach_available_tracked_entity_instance' )</a>
+ • $i18n.getString( "add_new_tracked_entity_instance" )
+</h3>
+
<form id="entityInstanceForm" name="entityInstanceForm" method="post" class="inputForm">
<table>
#if($relatedProgram)
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataentryRecords.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataentryRecords.vm 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataentryRecords.vm 2014-02-08 15:19:56 +0000
@@ -77,7 +77,7 @@
<td><a href="javascript:loadDataEntryDialog( $programStageInstance.id );">$programStageInstance.programStage.displayName</a></td>
<td>
- <a href="javascript:isDashboard=false;showTrackedEntityInstanceDashboardForm( '$entityInstance.uid' )" title="$i18n.getString( 'tracked_entity_instance_dashboard' )"><img src="../images/enroll.png" alt='$i18n.getString( "tracked_entity_instance_dashboard" )'></a>
+ <a href="javascript:isDashboard=false;showTrackedEntityInstanceDashboardForm( '$entityInstance.uid' )" title="$i18n.getString( 'dashboard' )"><img src="../images/enroll.png" alt='$i18n.getString( "dashboard" )'></a>
<a href="javascript:loadDataEntryDialog( $programStageInstance.id );" title="$i18n.getString( 'data_entry' )"><img src="images/data_entry.png" alt="$i18n.getString( 'data_entry' )"></a>
<a href="javascript:showTrackedEntityInstanceHistory('$entityInstance.id')" title='$i18n.getString( "tracked_entity_instance_details_and_history" )'><img src="../images/information.png" alt='$i18n.getString( "tracked_entity_instance_details_and_history" )'></a>
</td>
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/relationship.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/relationship.js 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/relationship.js 2014-02-08 15:19:56 +0000
@@ -13,7 +13,9 @@
entityInstanceId:entityInstanceId
}, function()
{
+ jQuery('[name=addRelationShipLink]').hide();
showById('addRelationshipDiv');
+ hideById('entityInstanceForm');
jQuery('#loaderDiv').hide();
});
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/trackedEntityInstance.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/trackedEntityInstance.js 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/trackedEntityInstance.js 2014-02-08 15:19:56 +0000
@@ -348,10 +348,16 @@
}, function()
{
showById('editEntityInstanceDiv');
- showById('entityInstanceMamagementLink');
if(related){
+ jQuery('[name=addRelationShipLink]').show();
+ hideById('entityInstanceMamagementLink');
setFieldValue('relationshipId',entityInstanceId);
}
+ else{
+ jQuery('[name=addRelationShipLink]').hide();
+ showById('entityInstanceMamagementLink');
+ }
+
jQuery('#loaderDiv').hide();
});