← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10765: Add authority for acessing patient-attribute in searching patient function and tabular report.

 

------------------------------------------------------------
revno: 10765
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-05-06 13:38:48 +0700
message:
  Add authority for acessing patient-attribute in searching patient function and tabular report.
modified:
  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/jsonPatientProperties.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.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/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2013-04-24 06:11:42 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2013-05-06 06:38:48 +0000
@@ -1131,6 +1131,13 @@
       <result name="xls" type="gridXlsResult" />
       <result name="pdf" type="gridPdfResult" />
     </action>
+    
+     <action name="accessPatientAttributes"
+      class="org.hisp.dhis.caseentry.action.NoAction">
+      <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+      <param name="requiredAuthorities">F_ACCESS_PATIENT_ATTRIBUTES</param>
+    </action>
+
 	
 	<!-- Program-stage-completeness -->
 	

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonPatientProperties.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonPatientProperties.vm	2013-03-14 13:30:46 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonPatientProperties.vm	2013-05-06 06:38:48 +0000
@@ -1,4 +1,7 @@
 { "patientProperties": [
+	
+  #if( $auth.hasAccess( "dhis-web-caseentry", "accessPatientAttributes" ) )
+  
   {
 	"id": "fixedAttr_firstName",
 	"name": "$i18n.getString('first_name')",
@@ -58,5 +61,6 @@
 				 #end
   }#if( $velocityCount < $size ),#end
   #end
+  #end
   ]
 }
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm	2013-03-21 15:18:52 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm	2013-05-06 06:38:48 +0000
@@ -26,6 +26,7 @@
 					<option value="$program.id" type='$program.type'>$program.displayName</option>
 				#end
 			</select>
+			<span id="programLoader" style="display:none;" ><img src="../images/ajax-loader-bar.gif" /></span>
 		</td>
 	</tr>
 	<tr id='scheduleVisitTR' class='hidden'>
@@ -105,16 +106,21 @@
 			<tr id='advSearchBox0'>	       
 				<td>
 				  <select class='search-field' id="searchObjectId" name="searchObjectId" #if( $patientAttributes.size() == 0 ) disabled="disabled" #end onchange="searchObjectOnChange(this)">
-					<option value="iden">$i18n.getString( "search_by_name_identifier" )</option>
+					#if( $auth.hasAccess( "dhis-web-caseentry", "accessPatientAttributes" ) )
+						<option value="iden">$i18n.getString( "search_by_name_identifier" )</option>
+					#end
 					<option value="prg">$i18n.getString( "search_by_program" )</option>
-					<option value="fixedAttr_birthDate">$i18n.getString( "date_of_birth" )</option>
-					<option value="fixedAttr_age">$i18n.getString( "age_year" )</option>
-					<option value="fixedAttr_gender">$i18n.getString( "gender" )</option>
-					<option value="fixedAttr_phoneNumber">$i18n.getString( "phone_number" )</option>
-					#foreach( $attribute in $patientAttributes )
-						<option value="attr_$attribute.id" valueType='$attribute.valueType'>$encoder.htmlEncode( $attribute.displayName )</option>
+					
+					#if( $auth.hasAccess( "dhis-web-caseentry", "accessPatientAttributes" ) )
+						<option value="fixedAttr_birthDate">$i18n.getString( "date_of_birth" )</option>
+						<option value="fixedAttr_age">$i18n.getString( "age_year" )</option>
+						<option value="fixedAttr_gender">$i18n.getString( "gender" )</option>
+						<option value="fixedAttr_phoneNumber">$i18n.getString( "phone_number" )</option>
+						#foreach( $attribute in $patientAttributes )
+							<option value="attr_$attribute.id" valueType='$attribute.valueType'>$encoder.htmlEncode( $attribute.displayName )</option>
+						#end
+					  </select>
 					#end
-				  </select>
 				  <em title="$i18n.getString( 'required' )" class="required">*</em></label>
 				</td>		
 				<td>