← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10962: Add sharing function to cased-base tabular report.

 

------------------------------------------------------------
revno: 10962
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-05-23 21:28:28 +0700
message:
  Add sharing function to cased-base tabular report.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/SharingUtils.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientreport/hibernate/HibernatePatientTabularReportStore.java
  dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientreport/hibernate/PatientAggregateReport.hbm.xml
  dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientreport/hibernate/PatientTabularReport.hbm.xml
  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/app/app.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/i18n.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularInitialize.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReportList.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties


--
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-api/src/main/java/org/hisp/dhis/common/SharingUtils.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/SharingUtils.java	2013-03-22 06:46:45 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/SharingUtils.java	2013-05-23 14:28:28 +0000
@@ -34,6 +34,8 @@
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.indicator.IndicatorGroup;
 import org.hisp.dhis.indicator.IndicatorGroupSet;
+import org.hisp.dhis.patientreport.PatientAggregateReport;
+import org.hisp.dhis.patientreport.PatientTabularReport;
 import org.hisp.dhis.program.Program;
 import org.hisp.dhis.report.Report;
 import org.hisp.dhis.reporttable.ReportTable;
@@ -104,6 +106,12 @@
 
         SUPPORTED_TYPES.put( "chart", Chart.class );
         PUBLIC_AUTHORITIES.put( Chart.class, "F_CHART_PUBLIC_ADD" );
+        
+        SUPPORTED_TYPES.put( "patientTabularReport", PatientTabularReport.class );
+        PUBLIC_AUTHORITIES.put( PatientTabularReport.class, "F_PATIENT_TABULAR_REPORT_PUBLIC_ADD" );
+        
+        SUPPORTED_TYPES.put( "patientAggregateReport", PatientAggregateReport.class );
+        PUBLIC_AUTHORITIES.put( PatientAggregateReport.class, "F_PATIENT_TABULAR_REPORT_PUBLIC_ADD" );
     }
 
     public static boolean isSupported( String type )

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientreport/hibernate/HibernatePatientTabularReportStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientreport/hibernate/HibernatePatientTabularReportStore.java	2013-04-02 04:33:34 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientreport/hibernate/HibernatePatientTabularReportStore.java	2013-05-23 14:28:28 +0000
@@ -27,11 +27,16 @@
 
 package org.hisp.dhis.patientreport.hibernate;
 
+import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
 
 import org.hibernate.Criteria;
 import org.hibernate.criterion.Projections;
 import org.hibernate.criterion.Restrictions;
+import org.hisp.dhis.common.SharingUtils;
 import org.hisp.dhis.common.hibernate.HibernateIdentifiableObjectStore;
 import org.hisp.dhis.patientreport.PatientTabularReport;
 import org.hisp.dhis.patientreport.PatientTabularReportStore;
@@ -51,15 +56,60 @@
     @Override
     public Collection<PatientTabularReport> get( User user, String query, Integer min, Integer max )
     {
-        return search( user, query, min, max ).list();
+        Criteria criteria = getCriteria();
+
+        if ( query != null )
+        {
+            criteria.add( Restrictions.ilike( "name", "%" + query + "%" ) );
+        }
+
+        List<PatientTabularReport> result = new ArrayList<PatientTabularReport>();
+        Collection<PatientTabularReport> reports = criteria.list();
+
+        for ( PatientTabularReport report : reports )
+        {
+            if ( SharingUtils.canRead( user, report ) )
+            {
+                result.add( report );
+            }
+        }
+
+        if( min > result.size() )
+        {
+            min = result.size();
+        }
+        
+        if( max > result.size() )
+        {
+            max = result.size();
+        }
+        
+        return result.subList( min, max );
     }
 
     @Override
     public int countList( User user, String query )
     {
-        Number rs = (Number) search( user, query, null, null ).setProjection( Projections.rowCount() ).uniqueResult();
-
-        return rs != null ? rs.intValue() : 0;
+        Criteria criteria = getCriteria();
+
+        if ( query != null )
+        {
+            criteria.add( Restrictions.ilike( "name", "%" + query + "%" ) );
+        }
+
+        int result = 0;
+        @SuppressWarnings( "unchecked" )
+        Collection<PatientTabularReport> reports = criteria.list();
+
+        for ( PatientTabularReport report : reports )
+        {
+            if ( SharingUtils.canRead( user, report ) )
+            {
+                result++;
+            }
+        }
+
+        return result;
     }
 
     // -------------------------------------------------------------------------
@@ -68,18 +118,23 @@
 
     private Criteria search( User user, String query, Integer min, Integer max )
     {
-        Criteria criteria = getCriteria( Restrictions.eq( "user", user ) );
+        Criteria criteria = getCriteria();
 
         if ( query != null )
         {
             criteria.add( Restrictions.ilike( "name", "%" + query + "%" ) );
         }
 
-        if ( min != null && max != null )
+        Iterator<PatientTabularReport> iterReports = criteria.list().iterator();
+
+        while ( iterReports.hasNext() )
         {
-            criteria.setFirstResult( min ).setMaxResults( max );
+            if ( !SharingUtils.canRead( user, iterReports.next() ) )
+            {
+                iterReports.remove();
+            }
         }
-        
+
         return criteria;
     }
 

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientreport/hibernate/PatientAggregateReport.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientreport/hibernate/PatientAggregateReport.hbm.xml	2013-02-07 10:25:34 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientreport/hibernate/PatientAggregateReport.hbm.xml	2013-05-23 14:28:28 +0000
@@ -67,9 +67,6 @@
 
     <property name="aggregateType" />
 
-    <many-to-one name="user" class="org.hisp.dhis.user.User"
-      column="userid" foreign-key="fk_patientaggregatereport_userid" />
-
     <property name="useCompletedEvents" />
 
     <property name="userOrganisationUnit" />
@@ -79,5 +76,18 @@
     <many-to-one name="deSum" class="org.hisp.dhis.dataelement.DataElement"
       column="desumid" foreign-key="fk_patientaggregatereport_dataelementsumtid" />
 
+    <!-- Access properties -->
+	
+    <many-to-one name="user" class="org.hisp.dhis.user.User"
+      column="userid" foreign-key="fk_patientaggregatereport_userid" />
+	
+    <property name="publicAccess" length="8" />
+
+    <set name="userGroupAccesses" table="patientaggregatereportusergroupaccesses">
+      <cache usage="read-write" />
+      <key column="patientaggregatereportid" />
+      <many-to-many class="org.hisp.dhis.user.UserGroupAccess" column="usergroupaccessid" unique="true" />
+    </set>
+    
   </class>
 </hibernate-mapping>

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientreport/hibernate/PatientTabularReport.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientreport/hibernate/PatientTabularReport.hbm.xml	2013-05-19 08:24:25 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientreport/hibernate/PatientTabularReport.hbm.xml	2013-05-23 14:28:28 +0000
@@ -36,9 +36,6 @@
 
     <property name="facilityLB" />
 
-    <many-to-one name="user" class="org.hisp.dhis.user.User"
-      column="userid" foreign-key="fk_patienttabularreport_userid" />
-      
     <property name="useCompletedEvents" />
     
     <property name="userOrganisationUnit" />
@@ -51,6 +48,19 @@
         <list-index column="sort_order" base="1" />
       <element type="text" column="filtervalue" />
     </list>
+    
+    <!-- Access properties -->
+   
+    <many-to-one name="user" class="org.hisp.dhis.user.User"
+      column="userid" foreign-key="fk_patienttabularreport_userid" />
+      
+    <property name="publicAccess" length="8" />
+
+    <set name="userGroupAccesses" table="patienttabularreportusergroupaccesses">
+      <cache usage="read-write" />
+      <key column="patienttabularreportid" />
+      <many-to-many class="org.hisp.dhis.user.UserGroupAccess" column="usergroupaccessid" unique="true" />
+    </set>
 
   </class>
 </hibernate-mapping>

=== 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-05-21 10:08:44 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2013-05-23 14:28:28 +0000
@@ -905,7 +905,7 @@
       <result name="success" type="velocity-json">
         /dhis-web-commons/ajax/jsonResponseSuccess.vm
       </result>
-      <param name="requiredAuthorities">F_GENERATE_BENEFICIARY_TABULAR_REPORT</param>
+      <param name="anyAuthorities">F_PATIENT_TABULAR_REPORT_PUBLIC_ADD,F_PATIENT_TABULAR_REPORT_PRIVATE_ADD</param>
     </action>
 
     <action name="getTabularReports"
@@ -967,7 +967,7 @@
       <result name="success" type="velocity-json">
         /dhis-web-commons/ajax/jsonResponseSuccess.vm
       </result>
-      <param name="requiredAuthorities">F_GENERATE_BENEFICIARY_TABULAR_REPORT</param>
+      <param name="anyAuthorities">F_PATIENT_AGGREGATE_REPORT_PUBLIC_ADD,F_PATIENT_AGGREGATE_REPORT_PRIVATE_ADD</param>
     </action>
 
     <action name="getAggregateReports"

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js	2013-05-23 05:47:24 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js	2013-05-23 14:28:28 +0000
@@ -13,6 +13,8 @@
 					obj.system.rootnodes.push({id: r.user.ous[i].id, localid: r.user.ous[i].localid,text: r.user.ous[i].name, leaf: r.user.ous[i].leaf});
 				}
 				
+				obj.system.user = {id: r.user.id, name: r.user.name};
+				
 				obj.system.program = [];
 				for (var i = 0; i < r.programs.length; i++) {
 					obj.system.program.push({id: r.programs[i].id, name: r.programs[i].name, type: r.programs[i].type });
@@ -1584,7 +1586,7 @@
 			});
         },
 		caseBasedFavorite: Ext.create('Ext.data.Store', {
-			fields: ['id', 'name', 'lastUpdated'],
+			fields: ['id', 'uid', 'name', 'lastUpdated', 'access'],
 			proxy: {
 				type: 'ajax',
 				reader: {
@@ -3273,6 +3275,9 @@
 					items: [
 						{
 							iconCls: 'tr-grid-row-icon-edit',
+							getClass: function(value, metaData, record) {
+								return 'tooltip-favorite-edit' + (!record.data.access.update ? ' disabled' : '');
+							},
 							handler: function(grid, rowIndex, colIndex, col, event) {
 								var record = this.up('grid').store.getAt(rowIndex);
 								nameWindow = new NameWindow(record.data.id);
@@ -3280,7 +3285,35 @@
 							}
 						},
 						{
+							iconCls: 'tr-grid-row-icon-sharing',
+							getClass: function(value, metaData, record) {
+								return 'tooltip-favorite-sharing' + (!record.data.access.manage ? ' disabled' : '');
+							},
+							handler: function(grid, rowIndex) {
+								var record = this.up('grid').store.getAt(rowIndex);
+
+								if (record.data.access.manage) {
+									Ext.Ajax.request({
+										url:TR.conf.finals.ajax.path_api + 'sharing?type=patientTabularReport&id=' + record.data.uid,
+										method: 'GET',
+										failure: function(r) {
+											TR.util.mask.hideMask();
+											alert(r.responseText);
+										},
+										success: function(r) {
+											var sharing = Ext.decode(r.responseText),
+												window = TR.app.SharingWindow(sharing);
+											window.show();
+										}
+									});
+								}
+							}
+						},
+						{
 							iconCls: 'tr-grid-row-icon-delete',
+							getClass: function(value, metaData, record) {
+								return 'tooltip-favorite-overwrite' + (!record.data.access.update ? ' disabled' : '');
+							},
 							handler: function(grid, rowIndex, colIndex, col, event) {
 								var record = this.up('grid').store.getAt(rowIndex);
 									
@@ -3828,7 +3861,6 @@
 			return true;
 		}
 	});
-
 	
 	TR.app.OptionsWindow = function() {
 		var optionsWindow;
@@ -4175,6 +4207,261 @@
 		
 		return optionsWindow;
 	};
+		
+	TR.app.SharingWindow = function(sharing) {
+
+		// Objects
+		var UserGroupRow,
+
+		// Functions
+			getBody,
+
+		// Components
+			userGroupStore,
+			userGroupField,
+			userGroupButton,
+			userGroupRowContainer,
+			publicGroup,
+			window;
+
+		UserGroupRow = function(obj, isPublicAccess, disallowPublicAccess) {
+			var getData,
+				store,
+				getItems,
+				combo,
+				getAccess,
+				panel;
+
+			getData = function() {
+				var data = [
+					{id: 'r-------', name: TR.i18n.can_view}, //i18n
+					{id: 'rw------', name: TR.i18n.can_edit_and_view}
+				];
+
+				if (isPublicAccess) {
+					data.unshift({id: '-------', name: TR.i18n.none});
+				}
+
+				return data;
+			}
+
+			store = Ext.create('Ext.data.Store', {
+				fields: ['id', 'name'],
+				data: getData()
+			});
+
+			getItems = function() {
+				var items = [];
+
+				combo = Ext.create('Ext.form.field.ComboBox', {
+					fieldLabel: isPublicAccess ? TR.i18n.public_access : obj.name, //i18n
+					labelStyle: 'color:#333',
+					cls: 'dv-combo',
+					fieldStyle: 'padding-left:5px',
+					width: 380,
+					labelWidth: 250,
+					queryMode: 'local',
+					valueField: 'id',
+					displayField: 'name',
+					labelSeparator: null,
+					editable: false,
+					disabled: !!disallowPublicAccess,
+					value: obj.access || 'rw------',
+					store: store
+				});
+
+				items.push(combo);
+
+				if (!isPublicAccess) {
+					items.push(Ext.create('Ext.Img', {
+						src: 'images/grid-delete_16.png',
+						style: 'margin-top:2px; margin-left:7px',
+						overCls: 'pointer',
+						width: 16,
+						height: 16,
+						listeners: {
+							render: function(i) {
+								i.getEl().on('click', function(e) {
+									i.up('panel').destroy();
+									window.doLayout();
+								});
+							}
+						}
+					}));
+				}
+
+				return items;
+			};
+
+			getAccess = function() {
+				return {
+					id: obj.id,
+					name: obj.name,
+					access: combo.getValue()
+				};
+			};
+
+			panel = Ext.create('Ext.panel.Panel', {
+				layout: 'column',
+				bodyStyle: 'border:0 none',
+				getAccess: getAccess,
+				items: getItems()
+			});
+
+			return panel;
+		};
+
+		getBody = function() {
+			var body = {
+				object: {
+					id: sharing.object.uid,
+					name: sharing.object.name,
+					publicAccess: publicGroup.down('combobox').getValue(),
+					user: {
+						id: TR.init.system.user.id,
+						name: TR.init.system.user.name
+					}
+				}
+			};
+
+			if (userGroupRowContainer.items.items.length > 1) {
+				body.object.userGroupAccesses = [];
+				for (var i = 1, item; i < userGroupRowContainer.items.items.length; i++) {
+					item = userGroupRowContainer.items.items[i];
+					body.object.userGroupAccesses.push(item.getAccess());
+				}
+			}
+
+			return body;
+		};
+
+		// Initialize
+		userGroupStore = Ext.create('Ext.data.Store', {
+			fields: ['id', 'name'],
+			proxy: {
+				type: 'ajax',
+				url: TR.init.path_api + '/sharing/search',
+				reader: {
+					type: 'json',
+					root: 'userGroups'
+				}
+			}
+		});
+
+		userGroupField = Ext.create('Ext.form.field.ComboBox', {
+			valueField: 'id',
+			displayField: 'name',
+			emptyText: 'Search for user groups', //i18n
+			queryParam: 'key',
+			queryDelay: 200,
+			minChars: 1,
+			hideTrigger: true,
+			fieldStyle: 'height:26px; padding-left:6px; border-radius:1px; font-size:11px',
+			style: 'margin-bottom:5px',
+			width: 380,
+			store: userGroupStore,
+			listeners: {
+				beforeselect: function(cb) { // beforeselect instead of select, fires regardless of currently selected item
+					userGroupButton.enable();
+				},
+				afterrender: function(cb) {
+					cb.inputEl.on('keyup', function() {
+						userGroupButton.disable();
+					});
+				}
+			}
+		});
+
+		userGroupButton = Ext.create('Ext.button.Button', {
+			text: '+',
+			style: 'margin-left:2px; padding-right:4px; padding-left:4px; border-radius:1px',
+			disabled: true,
+			height: 26,
+			handler: function(b) {
+				userGroupRowContainer.add(UserGroupRow({
+					id: userGroupField.getValue(),
+					name: userGroupField.getRawValue(),
+					access: 'r-------'
+				}));
+
+				userGroupField.clearValue();
+				b.disable();
+			}
+		});
+
+		userGroupRowContainer = Ext.create('Ext.container.Container', {
+			bodyStyle: 'border:0 none'
+		});
+
+		publicGroup = userGroupRowContainer.add(UserGroupRow({
+			id: sharing.object.id,
+			name: sharing.object.name,
+			access: sharing.object.publicAccess
+		}, true, !sharing.meta.allowPublicAccess));
+
+		if (Ext.isArray(sharing.object.userGroupAccesses)) {
+			for (var i = 0, userGroupRow; i < sharing.object.userGroupAccesses.length; i++) {
+				userGroupRow = UserGroupRow(sharing.object.userGroupAccesses[i]);
+				userGroupRowContainer.add(userGroupRow);
+			}
+		}
+
+		window = Ext.create('Ext.window.Window', {
+			title: 'Sharing layout',
+			bodyStyle: 'padding:6px 6px 0px; background-color:#fff',
+			resizable: false,
+			modal: true,
+			destroyOnBlur: true,
+			items: [
+				{
+					html: sharing.object.name,
+					bodyStyle: 'border:0 none; font-weight:bold; color:#333',
+					style: 'margin-bottom:8px'
+				},
+				{
+					xtype: 'container',
+					layout: 'column',
+					bodyStyle: 'border:0 none',
+					items: [
+						userGroupField,
+						userGroupButton
+					]
+				},
+				userGroupRowContainer
+			],
+			bbar: [
+				'->',
+				{
+					text: 'Save',
+					handler: function() {
+						Ext.Ajax.request({
+							url: TR.conf.finals.ajax.path_api + 'sharing?type=patientTabularReport&id=' + sharing.object.id,
+							method: 'POST',
+							headers: {
+								'Content-Type': 'application/json'
+							},
+							params: Ext.encode(getBody())
+						});
+
+						window.destroy();
+					}
+				}
+			],
+			listeners: {
+				show: function(w) {
+					var pos = TR.cmp.caseBasedFavorite.window.getPosition();
+					w.setPosition(pos[0] + 5, pos[1] + 5);
+					TR.cmp.caseBasedFavorite.window.destroyOnBlur = false;
+				},
+				destroy: function() {
+					TR.cmp.caseBasedFavorite.window.destroyOnBlur = true;
+				}
+			}
+		});
+
+		return window;
+	};
+	
 	
     TR.viewport = Ext.create('Ext.container.Viewport', {
         layout: 'border',

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/i18n.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/i18n.vm	2013-05-23 05:47:24 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/i18n.vm	2013-05-23 14:28:28 +0000
@@ -189,5 +189,8 @@
 aggregate_options: '$encoder.jsEscape($i18n.getString( 'aggregate_options' ) , "'")',
 display_totals: '$encoder.jsEscape($i18n.getString( 'display_totals' ) , "'")',
 options: '$encoder.jsEscape($i18n.getString( 'options' ) , "'")',
-hide: '$encoder.jsEscape($i18n.getString( 'hide' ) , "'")'
+hide: '$encoder.jsEscape($i18n.getString( 'hide' ) , "'")',
+can_view: '$encoder.jsEscape($i18n.getString( 'can_view' ) , "'")',
+can_edit_and_view: '$encoder.jsEscape($i18n.getString( 'can_edit_and_view' ) , "'")',
+public_access: '$encoder.jsEscape($i18n.getString( 'public_access' ) , "'")'
 };
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularInitialize.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularInitialize.vm	2013-05-19 08:24:25 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularInitialize.vm	2013-05-23 14:28:28 +0000
@@ -2,6 +2,7 @@
 	"user":
 	{
 		"id":"$!currentUser.id",
+		"name":"$!currentUser.name",
 		"accessPatientAttributes":$auth.hasAccess( "dhis-web-caseentry", "accessPatientAttributes" ),
 		"isAdmin":$!currentUser.userCredentials.isSuper(),
 		"ous":[

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReportList.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReportList.vm	2013-04-02 04:33:34 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReportList.vm	2013-05-23 14:28:28 +0000
@@ -3,8 +3,17 @@
   #foreach( ${tabularReport} in $!{reports} )
   {
 	"id": "${tabularReport.id}",
+	"uid": "${tabularReport.uid}",
 	"name": "$!encoder.jsonEncode( ${tabularReport.name} )",
-	"lastUpdated": "${tabularReport.lastUpdated}"
+	"lastUpdated": "${tabularReport.lastUpdated}",
+	"access":
+	{
+		"manage":$security.canManage( $tabularReport ),
+		"write":$security.canWrite( $tabularReport ),
+		"read":$security.canRead( $tabularReport ),
+		"update":$security.canUpdate( $tabularReport ),
+		"delete":$security.canDelete( $tabularReport )
+	}
   }#if( $velocityCount < $size ),#end
   #end
   ],

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties	2013-05-06 06:48:46 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties	2013-05-23 14:28:28 +0000
@@ -181,6 +181,10 @@
 F_PATIENT_DASHBOARD = Person Dashboard
 F_PATIENT_COMMENT_ADD = Add Person Comment
 F_PATIENT_COMMENT_DELETE = Delete Person Comment
+F_PATIENT_AGGREGATE_REPORT_PUBLIC_ADD = Add Public Person Aggregate Report
+F_PATIENT_AGGREGATE_REPORT_PRIVATE_ADD = Add Private Person Aggregate Report
+F_PATIENT_TABULAR_REPORT_PUBLIC_ADD = Add Public Cased based Report
+F_PATIENT_TABULAR_REPORT_PRIVATE_ADD = Add Private Person Aggregate Report
 F_SCHEDULING_SEND_MESSAGE = Scheduling send messages
 F_SCHEDULING_CASE_AGGREGATE_QUERY_BUILDER = Scheduling case aggregate query builder
 F_ACTIVITY_PLAN = Search Activity Plan