dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #22423
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10767: Don't display demographics tab if users not have authority to access person attributes in dashboa...
------------------------------------------------------------
revno: 10767
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-05-06 14:12:06 +0700
message:
Don't display demographics tab if users not have authority to access person attributes in dashboard; and when to click on person list button, just display system identifiers instead of private information.
modified:
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientRegistrationList.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/patientDashboard.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm 2013-04-18 06:45:36 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm 2013-05-06 07:12:06 +0000
@@ -7,6 +7,7 @@
<div class='dashboard-area'>
<table>
<tr>
+#if( $auth.hasAccess( "dhis-web-caseentry", "accessPatientAttributes" ) )
<td>
<div class="link-area">
<p class='header'>
@@ -100,12 +101,17 @@
</div>
</td>
+#end
+
<td>
<div class="link-area" id="activeDiv" name="activeDiv">
<p class='header'>
$i18n.getString("active_programs")
• <a href='javascript:viewPersonProgram( "completedDiv","activeDiv" )'>$i18n.getString("completed_programs")</a>
+
+ #if( $auth.hasAccess( "dhis-web-caseentry", "showProgramEnrollmentForm" ) )
• <a href='javascript:showProgramEnrollmentForm( "$patient.id" )'>$i18n.getString("enroll")</a>
+ #end
</p>
<div class="contentProviderTable">
<table id='activeTB' name='activeTB' style='cursor:pointer;'>
@@ -187,8 +193,14 @@
<div class="link-area">
<p class='header'>
$i18n.getString("relationships")
- • <a href="javascript:setFieldValue( 'isShowPatientList', 'false' ); showRelationshipList( '$patient.id' );">$i18n.getString("management")</a>
- • <a href="javascript:showAddRelationshipPatient( '$patient.id', false );">$i18n.getString("add_new_patient")</a>
+
+ #if( $auth.hasAccess( "dhis-web-caseentry", "showRelationshipList" ) )
+ • <a href="javascript:setFieldValue( 'isShowPatientList', 'false' ); showRelationshipList( '$patient.id' );">$i18n.getString("management")</a>
+ #end
+
+ #if( $auth.hasAccess( "dhis-web-caseentry", "showAddRelationshipPatient" ) )
+ • <a href="javascript:showAddRelationshipPatient( '$patient.id', false );">$i18n.getString("add_new_patient")</a>
+ #end
</p>
<div class="contentProviderTable">
<table>
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientRegistrationList.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientRegistrationList.vm 2013-04-18 06:45:36 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientRegistrationList.vm 2013-05-06 07:12:06 +0000
@@ -25,6 +25,7 @@
<td>
<table class="listTable" id="patientList" width='100%'>
<col width="30"/>
+ #if( $auth.hasAccess( "dhis-web-caseentry", "accessPatientAttributes" ) )
#foreach( $attribute in $patientAttributes )
#if($attribute)<col/>#end
#end
@@ -35,34 +36,42 @@
#if( $identifierTypes.size()==0 )
<col/>
#end
- <col/>
- <col/>
- <col/>
- <col/>
+ <col/>
+ <col/>
+ <col/>
+ <col/>
+ #end
+
#if($mapPatientOrgunit.size()!=0)
- <col/>
+ <col/>
#end
- <col width="200"/>
+ <col/>
+ <col width="200"/>
<thead>
<tr>
<th>#</th>
- #foreach( $attribute in $patientAttributes )
- #if($attribute)
- <th id="patientAttributeName">$encoder.htmlEncode($attribute.displayName)</th>
- #end
- #end
-
- #foreach( $identifierType in $identifierTypes)
- <th>$encoder.htmlEncode($identifierType.displayName)</th>
- #end
- #if( $identifierTypes.size()==0 )
- <th>$i18n.getString( "full_name" )</th>
- #end
- <th>$i18n.getString( "gender" )</th>
- <th>$i18n.getString( "date_of_birth" )</th>
- <th class="{sorter: false}">$i18n.getString( "age" )</th>
- <th class="{sorter: false}">$i18n.getString( "phone_number" )</th>
+ #if( $auth.hasAccess( "dhis-web-caseentry", "accessPatientAttributes" ) )
+
+ #foreach( $attribute in $patientAttributes )
+ #if($attribute)
+ <th id="patientAttributeName">$encoder.htmlEncode($attribute.displayName)</th>
+ #end
+ #end
+
+ #foreach( $identifierType in $identifierTypes)
+ <th>$encoder.htmlEncode($identifierType.displayName)</th>
+ #end
+ #if( $identifierTypes.size()==0 )
+ <th>$i18n.getString( "full_name" )</th>
+ #end
+ <th>$i18n.getString( "gender" )</th>
+ <th>$i18n.getString( "date_of_birth" )</th>
+ <th class="{sorter: false}">$i18n.getString( "age" )</th>
+ <th class="{sorter: false}">$i18n.getString( "phone_number" )</th>
+ #else
+ <th>$i18n.getString("system_identifier")</th>
+ #end
#if($mapPatientOrgunit.size()!=0)
<th>$i18n.getString( "hierachy_orgunit" )</th>
#end
@@ -79,53 +88,67 @@
$nr
</td>
- #foreach( $attribute in $patientAttributes )
- #if( $attribute )
- #set ( $key = $patient.id + '-' + $attribute.id )
- <td>
- #if( $attribute.valueType == 'bool')
- $i18n.getString( $mapPatientPatientAttr.get($key) )
- #else
- $mapPatientPatientAttr.get($key)
- #end
- </td>
- #end
- #end
-
- #set($value="")
- #foreach( $identifierType in $identifierTypes)
- #foreach( $identifier in $patient.identifiers)
- #if($identifier.identifierType.id==$identifierType.id)
- #set($value=$identifier.identifier)
- #end
- #if($!identifier.identifierType)
- #else
- #set($systemId=$identifier.identifier)
- #end
- #end
- #end
- #if($value=="")
- #set($value=$!patient.getFullName())
- #end
- #if($value=="")
- #foreach( $identifier in $patient.identifiers)
- #if($!identifier.identifierType)
- #else
- #set($value=$identifier.identifier)
- #end
- #end
- #end
- <td style="cursor:pointer;" onclick="javascript:isDashboard=true;showPatientDashboardForm( '$patient.id' )">
- <a>$encoder.htmlEncode($value)</a>
- </td>
-
- <td>#if($!patient.gender) $i18n.getString($!patient.gender) #end</td>
-
- <td>#if($!patient.birthDate) $format.formatDate( $!patient.birthDate) #end</td>
-
- <td>#if($!patient.birthDate) $!patient.getAge() #end</td>
-
- <td>$!patient.phoneNumber</td>
+ #if( $auth.hasAccess( "dhis-web-caseentry", "accessPatientAttributes" ) )
+
+ #foreach( $attribute in $patientAttributes )
+ #if( $attribute )
+ #set ( $key = $patient.id + '-' + $attribute.id )
+ <td>
+ #if( $attribute.valueType == 'bool')
+ $i18n.getString( $mapPatientPatientAttr.get($key) )
+ #else
+ $mapPatientPatientAttr.get($key)
+ #end
+ </td>
+ #end
+ #end
+
+ #set($value="")
+ #foreach( $identifierType in $identifierTypes)
+ #foreach( $identifier in $patient.identifiers)
+ #if($identifier.identifierType.id==$identifierType.id)
+ #set($value=$identifier.identifier)
+ #end
+ #if($!identifier.identifierType)
+ #else
+ #set($systemId=$identifier.identifier)
+ #end
+ #end
+ #end
+ #if($value=="")
+ #set($value=$!patient.getFullName())
+ #end
+ #if($value=="")
+ #foreach( $identifier in $patient.identifiers)
+ #if($!identifier.identifierType)
+ #else
+ #set($value=$identifier.identifier)
+ #end
+ #end
+ #end
+ <td style="cursor:pointer;" onclick="javascript:isDashboard=true;showPatientDashboardForm( '$patient.id' )">
+ <a>$encoder.htmlEncode($value)</a>
+ </td>
+
+ <td>#if($!patient.gender) $i18n.getString($!patient.gender) #end</td>
+
+ <td>#if($!patient.birthDate) $format.formatDate( $!patient.birthDate) #end</td>
+
+ <td>#if($!patient.birthDate) $!patient.getAge() #end</td>
+
+ <td>$!patient.phoneNumber</td>
+ #else
+ #set($value="")
+ #foreach( $identifier in $patient.identifiers)
+ #if($!identifier.identifierType)
+ #else
+ #set($value=$identifier.identifier)
+ #end
+ #end
+ <td style="cursor:pointer;" onclick="javascript:isDashboard=true;showPatientDashboardForm( '$patient.id' )">
+ <a>$value</a>
+ </td>
+ #end
#if($mapPatientOrgunit.size()!=0)
<td>$!mapPatientOrgunit.get($patient.id)</td>