← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2740: Displaying disabled delete icon for objcets in service modules when user do not have access to de...

 

------------------------------------------------------------
revno: 2740
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-01-25 14:49:21 +0100
message:
  Displaying disabled delete icon for objcets in service modules when user do not have access to delete.
modified:
  dhis-2/dhis-web/dhis-web-datamart/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-datamart/src/main/webapp/dhis-web-datamart/viewExportForm.vm
  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-reporting/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewChartForm.vm
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDocumentForm.vm
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewReportForm.vm
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewTableForm.vm
  dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/validationRule.vm
  dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/validationRuleGroup.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-datamart/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-datamart/src/main/resources/struts.xml	2011-01-21 16:22:50 +0000
+++ dhis-2/dhis-web/dhis-web-datamart/src/main/resources/struts.xml	2011-01-25 13:49:21 +0000
@@ -21,10 +21,11 @@
       <param name="page">/dhis-web-datamart/exportForm.vm</param>
       <param name="menu">/dhis-web-datamart/menu.vm</param>
       <param name="javascripts">javascript/datamart.js</param>
+      <param name="requiredAuthorities">F_DATAMART_ADMIN</param>
     </action>
-		
+	
 	<!-- Ajax requests -->
-		
+	
     <action name="exportDataMartExport" class="org.hisp.dhis.datamart.action.ExportDataMartExportAction">
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-datamart/exportStatus.vm</param>
@@ -45,6 +46,7 @@
     
     <action name="removeDataMartExport" class="org.hisp.dhis.datamart.action.RemoveDataMartExportAction">
       <result name="success" type="redirect">getDataMartExports.action</result>
+      <param name="requiredAuthorities">F_DATAMART_ADMIN</param>
     </action>
     
     <action name="getDataMartExports" class="org.hisp.dhis.datamart.action.GetAllDataMartExportsAction">
@@ -57,6 +59,7 @@
         
     <action name="saveDataMartExport" class="org.hisp.dhis.datamart.action.SaveDataMartExportAction">
       <result name="success" type="redirect">getDataMartExports.action</result>
+      <param name="requiredAuthorities">F_DATAMART_ADMIN</param>
     </action>
     
     <!-- Ajax requests -->
@@ -80,10 +83,12 @@
     
     <action name="scheduleExport" class="org.hisp.dhis.datamart.action.ScheduleExportAction">
       <result name="success" type="redirect">getScheduledExportStatus.action</result>
+      <param name="requiredAuthorities">F_DATAMART_ADMIN</param>
     </action>
     
     <action name="executeExport" class="org.hisp.dhis.datamart.action.ExecuteExportAction">
       <result name="success" type="redirect">getScheduledExportStatus.action</result>
+      <param name="requiredAuthorities">F_DATAMART_ADMIN</param>
     </action>
     
 	</package>

=== modified file 'dhis-2/dhis-web/dhis-web-datamart/src/main/webapp/dhis-web-datamart/viewExportForm.vm'
--- dhis-2/dhis-web/dhis-web-datamart/src/main/webapp/dhis-web-datamart/viewExportForm.vm	2011-01-21 16:22:50 +0000
+++ dhis-2/dhis-web/dhis-web-datamart/src/main/webapp/dhis-web-datamart/viewExportForm.vm	2011-01-25 13:49:21 +0000
@@ -12,7 +12,7 @@
 			</table>
             <table class="listTable" id="listTable">
                 <col/>
-                <col width="100"/>               
+                <col width="120"/>               
                 <thead>                          
 					<tr>
 						<th>$i18n.getString( "name" )</th>
@@ -26,7 +26,9 @@
                     <td style="text-align:center">
 						<a href="exportDataMartExport.action?id=$export.id" title="$i18n.getString( 'export' )"><img src="../images/start_process.png" alt="$i18n.getString( 'export' )"/></a>
 						<a href="getOptions.action?id=$export.id" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
+						#if( $auth.hasAccess( "dhis-web-datamart", "removeDataMartExport" ) )
 						<a href="javascript:removeDatamartExport( $export.id, '$encoder.jsEncode( $export.name )' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"/></a>
+						#else <img src="../images/delete-denied.png"> #end
 						<a href="javascript:showDataMartExportDetails( $export.id )" title="$i18n.getString( 'show_details' )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"/></a>
 					</td>
                 </tr>

=== 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	2010-12-29 20:53:30 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties	2011-01-25 13:49:21 +0000
@@ -119,6 +119,7 @@
 F_RELATIONSHIPTYPE_UPDATE = Update Relationship Type
 F_RELATIONSHIP_DELETE = Delete Relationship
 F_GIS_ADMIN = Administrate GIS
+F_DATAMART_ADMIN = Administrate data mart
 
 #-- User module ---------------------------------------------------------------#
 

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml	2011-01-21 18:49:34 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml	2011-01-25 13:49:21 +0000
@@ -41,11 +41,11 @@
       <param name="page">/dhis-web-reporting/addDocumentForm.vm</param>
       <param name="menu">/dhis-web-reporting/menu.vm</param>
       <param name="javascripts">javascript/document.js</param>
+      <param name="requiredAuthorities">F_DOCUMENT_ADD</param>
     </action>
     
     <action name="validateDocument" class="org.hisp.dhis.reporting.document.action.ValidateDocumentAction">
-      <result name="success" type="velocity-json">
-				/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+      <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
       <result name="input" type="velocity-json">/dhis-web-commons/ajax/jsonResponseInput.vm</result>
       <param name="onExceptionReturn">plainTextError</param>
     </action>

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewChartForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewChartForm.vm	2010-12-13 16:32:50 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewChartForm.vm	2011-01-25 13:49:21 +0000
@@ -29,7 +29,9 @@
                     <td style="text-align:right">
 						<a href="javascript:viewChart( 'viewChart.action?id=$chart.id' )" title="$i18n.getString( "view_chart" )"><img src="../images/start_process.png" alt="$i18n.getString( "view_chart" )"></a>
 						<a href="displayAddChartForm.action?id=$chart.id&dimension=$chart.dimension" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a>
+						#if( $auth.hasAccess( "dhis-web-reporting", "removeChart" ) )
 						<a href="javascript:removeChart( $chart.id, '$encoder.jsEncode( $chart.title )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a>
+						#else <img src="../images/delete-denied.png"> #end
 						<a href="javascript:showChartDetails( $chart.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a>
 					</td>
                 </tr>

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDocumentForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDocumentForm.vm	2010-12-13 15:18:59 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDocumentForm.vm	2011-01-25 13:49:21 +0000
@@ -34,7 +34,9 @@
                     	<img src="../images/start_process.png" alt="$i18n.getString( 'view_report' )"></a>                    
                     	<a href="displayAddDocumentForm.action?id=$!document.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a>
 						<a href="javascript:addDocumentToDashboard( '$document.id' )" title="$i18n.getString( 'add_to_dashboard' )"><img src="../images/add_to_dashboard.png" alt="$i18n.getString( 'add_to_dashboard' )"></a>
+						#if( $auth.hasAccess( "dhis-web-reporting", "removeDocument" ) )
 						<a href="javascript:removeDocument( $document.id )" title="$i18n.getString( 'remove_report' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove_report' )"></a>
+						#else <img src="../images/delete-denied.png"> #end
 					</td>
                 </tr>
                 #end

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewReportForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewReportForm.vm	2011-01-20 08:46:49 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewReportForm.vm	2011-01-25 13:49:21 +0000
@@ -31,7 +31,9 @@
                     	<img src="../images/start_process.png" alt="$i18n.getString( 'create' )"></a>                   
 						<a href="displayAddReportForm.action?id=$report.id" title="$i18n.getString( 'edit_report' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit_report' )"></a>
 						<a href="javascript:addToDashboard( '$report.id' )" title="$i18n.getString( 'add_to_dashboard' )"><img src="../images/add_to_dashboard.png" alt="$i18n.getString( 'add_to_dashboard' )"></a>
+						#if( $auth.hasAccess( "dhis-web-reporting", "removeReport" ) )
 						<a href="javascript:removeReport( $report.id )" title="$i18n.getString( 'remove_report' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove_report' )"></a>
+						#else <img src="../images/delete-denied.png"> #end
 					</td>
                 </tr>
                 #end

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewTableForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewTableForm.vm	2010-12-26 18:47:16 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewTableForm.vm	2011-01-25 13:49:21 +0000
@@ -32,7 +32,9 @@
 						<a href="getReportParams.action?id=$table.id&mode=table" title="$i18n.getString( "create" )"><img src="../images/start_process.png" alt="$i18n.getString( "create" )"></a>
 						<a href="displayAddTableForm.action?id=$table.id&mode=$table.mode&dimension=$table.isDimensional()" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a>						
 						<a href="javascript:addReportTableToDashboard( '$table.id' )" title="$i18n.getString( 'add_to_dashboard' )"><img src="../images/add_to_dashboard.png" alt="$i18n.getString( 'add_to_dashboard' )"></a>
+						#if( $auth.hasAccess( "dhis-web-reporting", "removeTable" ) )
 						<a href="javascript:removeTable( $table.id, '$encoder.jsEncode( $table.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a>
+						#else <img src="../images/delete-denied.png"> #end
 						<a href="javascript:showTableDetails( $table.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a>
 					</td>
 				</tr>

=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/validationRule.vm'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/validationRule.vm	2010-12-09 05:53:20 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/validationRule.vm	2011-01-25 13:49:21 +0000
@@ -30,7 +30,9 @@
 					<td onclick="showValidationRuleDetails( $validationRule.id )">$i18n.getString($!validationRule.periodType.name) </td>
 					<td style="text-align:right">
 						<a href="showUpdateValidationRuleForm.action?id=$validationRule.id" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
+						#if( $auth.hasAccess( "dhis-web-validationrule", "removeValidationRule" ) )
 						<a href="javascript:removeValidationRule( $validationRule.id, '$encoder.jsEncode( $validationRule.name )' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
+						#else <img src="../images/delete-denied.png"> #end
 						<a href="javascript:showValidationRuleDetails( $validationRule.id )" title="$i18n.getString( 'show_details' )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"></a>
 					</td>
 				</tr>

=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/validationRuleGroup.vm'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/validationRuleGroup.vm	2010-12-03 16:15:40 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/validationRuleGroup.vm	2011-01-25 13:49:21 +0000
@@ -26,7 +26,9 @@
                     <td onclick="showValidationRuleGroupDetails( $group.id )">$!encoder.htmlEncode( $group.name )</td>
                     <td style="text-align:right">
 						<a href="showUpdateValidationRuleGroupForm.action?id=$group.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a>
+						#if( $auth.hasAccess( "dhis-web-validationrule", "removeValidationRuleGroup" ) )
 						<a href="javascript:removeValidationRuleGroup( $group.id, '$encoder.jsEncode( $group.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a>
+						#else <img src="../images/delete-denied.png"> #end
 						<a href="javascript:showValidationRuleGroupDetails( $group.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a>
 					</td>
                 </tr>