dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #23618
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11507: Dashboard cleanup. Disable dashboard in light module for now. Removed add to dashboard function i...
------------------------------------------------------------
revno: 11507
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-07-24 19:28:39 +0200
message:
Dashboard cleanup. Disable dashboard in light module for now. Removed add to dashboard function in GIS, now done directly in dashboard.
removed:
dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/AddMapViewToDashboardAction.java
dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/document/action/AddDocumentToDashboardAction.java
dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/AddReportToDashboardAction.java
dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/AddReportTableToDashboardAction.java
modified:
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dashboard/action/ProvideContentAction.java
dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-mapping/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-mapping/src/main/resources/struts.xml
dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/document.js
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/report.js
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/table.js
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
--
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-light/src/main/java/org/hisp/dhis/light/dashboard/action/ProvideContentAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dashboard/action/ProvideContentAction.java 2013-07-22 19:14:47 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dashboard/action/ProvideContentAction.java 2013-07-24 17:28:39 +0000
@@ -5,13 +5,12 @@
import org.hisp.dhis.chart.Chart;
import org.hisp.dhis.chart.ChartService;
-import org.hisp.dhis.dashboard.DashboardConfiguration;
-import org.hisp.dhis.dashboard.DashboardContent;
-import org.hisp.dhis.dashboard.DashboardManager;
+import org.hisp.dhis.dashboard.DashboardService;
import org.hisp.dhis.document.Document;
import org.hisp.dhis.reporttable.ReportTable;
import org.hisp.dhis.user.CurrentUserService;
import org.hisp.dhis.user.User;
+import org.springframework.beans.factory.annotation.Autowired;
import com.opensymphony.xwork2.Action;
@@ -22,12 +21,8 @@
// Dependencies
// -------------------------------------------------------------------------
- private DashboardManager dashboardManager;
-
- public void setDashboardManager( DashboardManager dashboardManager )
- {
- this.dashboardManager = dashboardManager;
- }
+ @Autowired
+ private DashboardService dashboardService;
private CurrentUserService currentUserService;
@@ -85,25 +80,9 @@
{
chartsForAll = new ArrayList<Chart>( chartService.getAllCharts() );
- DashboardConfiguration config = dashboardManager.getConfiguration();
-
- for ( int i = 0; i < 8; i++ )
- {
- String id = config.getAreaItems().get( DashboardManager.CHART_AREA_PREFIX + (i + 1) );
-
- if ( id != null )
- {
- charts.add( id );
- }
- }
-
User user = currentUserService.getCurrentUser();
-
- DashboardContent content = dashboardManager.getDashboardContent( user );
-
- reportTables = content.getReportTables();
-
- documents = content.getDocuments();
+
+ //TODO implement new dashboard solution
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml 2013-07-22 19:14:47 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml 2013-07-24 17:28:39 +0000
@@ -467,7 +467,6 @@
<bean id="org.hisp.dhis.light.dashboard.action.ProvideContentAction"
class="org.hisp.dhis.light.dashboard.action.ProvideContentAction"
scope="prototype">
- <property name="dashboardManager" ref="org.hisp.dhis.dashboard.DashboardManager" />
<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
<property name="chartService" ref="org.hisp.dhis.chart.ChartService" />
</bean>
=== removed file 'dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/AddMapViewToDashboardAction.java'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/AddMapViewToDashboardAction.java 2013-07-22 19:14:47 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/AddMapViewToDashboardAction.java 1970-01-01 00:00:00 +0000
@@ -1,101 +0,0 @@
-package org.hisp.dhis.mapping.action;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.hisp.dhis.dashboard.DashboardContent;
-import org.hisp.dhis.dashboard.DashboardManager;
-import org.hisp.dhis.mapping.Map;
-import org.hisp.dhis.mapping.MappingService;
-import org.hisp.dhis.user.CurrentUserService;
-import org.hisp.dhis.user.User;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Lars Helge Overland
- */
-public class AddMapViewToDashboardAction
- implements Action
-{
- private static final Log log = LogFactory.getLog( AddMapViewToDashboardAction.class );
-
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- @Autowired
- private CurrentUserService currentUserService;
-
- @Autowired
- private DashboardManager dashboardManager;
-
- @Autowired
- private MappingService mappingService;
-
- // -------------------------------------------------------------------------
- // Input
- // -------------------------------------------------------------------------
-
- private String id;
-
- public void setId( String id )
- {
- this.id = id;
- }
-
- // -------------------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------------------
-
- public String execute()
- {
- User user = currentUserService.getCurrentUser();
-
- if ( user != null )
- {
- DashboardContent content = dashboardManager.getDashboardContent( user );
-
- Map map = mappingService.getMap( id );
-
- content.addMap( map );
-
- dashboardManager.saveDashboardContent( content );
-
- log.info( "Added mapview '" + map.getName() + "' to dashboard for user '" + user.getName() + "'" );
- }
- else
- {
- log.warn( "Could not add mapview to dashboard, no current user" );
- }
-
- return SUCCESS;
- }
-}
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/resources/META-INF/dhis/beans.xml 2013-06-17 11:19:14 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/resources/META-INF/dhis/beans.xml 2013-07-24 17:28:39 +0000
@@ -18,12 +18,6 @@
<property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
</bean>
- <!-- Dashboard -->
-
- <bean id="org.hisp.dhis.mapping.action.AddMapViewToDashboardAction"
- class="org.hisp.dhis.mapping.action.AddMapViewToDashboardAction"
- scope="prototype"/>
-
<!-- OrganisationUnit -->
<bean id="org.hisp.dhis.mapping.action.GetOrganisationUnitChildrenAction"
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/resources/struts.xml 2013-06-17 11:19:14 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/resources/struts.xml 2013-07-24 17:28:39 +0000
@@ -14,13 +14,7 @@
<action name="index" class="org.hisp.dhis.mapping.action.NoAction">
<result name="success" type="redirect">app/index.html</result>
</action>
-
- <!-- Dashboard -->
-
- <action name="addMapViewToDashboard" class="org.hisp.dhis.mapping.action.AddMapViewToDashboardAction">
- <result name="success" type="velocity-json">/dhis-web-mapping/void.vm</result>
- </action>
-
+
<!-- Security -->
<action name="deleteMapLegendSet" class="org.hisp.dhis.mapping.action.NoAction">
=== removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/document/action/AddDocumentToDashboardAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/document/action/AddDocumentToDashboardAction.java 2013-07-22 19:14:47 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/document/action/AddDocumentToDashboardAction.java 1970-01-01 00:00:00 +0000
@@ -1,109 +0,0 @@
-package org.hisp.dhis.reporting.document.action;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.hisp.dhis.dashboard.DashboardContent;
-import org.hisp.dhis.dashboard.DashboardManager;
-import org.hisp.dhis.document.Document;
-import org.hisp.dhis.document.DocumentService;
-import org.hisp.dhis.user.CurrentUserService;
-import org.hisp.dhis.user.User;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Lars Helge Overland
- */
-public class AddDocumentToDashboardAction
- implements Action
-{
- private static final Log log = LogFactory.getLog( AddDocumentToDashboardAction.class );
-
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private CurrentUserService currentUserService;
-
- public void setCurrentUserService( CurrentUserService currentUserService )
- {
- this.currentUserService = currentUserService;
- }
-
- private DocumentService documentService;
-
- public void setDocumentService( DocumentService documentService )
- {
- this.documentService = documentService;
- }
-
- @Autowired
- private DashboardManager dashboardManager;
-
- // -------------------------------------------------------------------------
- // Input
- // -------------------------------------------------------------------------
-
- private Integer id;
-
- public void setId( Integer id )
- {
- this.id = id;
- }
-
- // -------------------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------------------
-
- public String execute()
- {
- User user = currentUserService.getCurrentUser();
-
- if ( user != null )
- {
- DashboardContent content = dashboardManager.getDashboardContent( user );
-
- Document document = documentService.getDocument( id );
-
- content.addDocument( document );
-
- dashboardManager.saveDashboardContent( content );
-
- log.info( "Added document '" + document.getName() + "' to dashboard for user '" + user.getName() + "'" );
- }
- else
- {
- log.warn( "Could not add report to dashboard, no current user" );
- }
-
- return SUCCESS;
- }
-}
=== removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/AddReportToDashboardAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/AddReportToDashboardAction.java 2013-07-22 19:14:47 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/AddReportToDashboardAction.java 1970-01-01 00:00:00 +0000
@@ -1,109 +0,0 @@
-package org.hisp.dhis.reporting.reportviewer.action;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.hisp.dhis.dashboard.DashboardContent;
-import org.hisp.dhis.dashboard.DashboardManager;
-import org.hisp.dhis.report.Report;
-import org.hisp.dhis.report.ReportService;
-import org.hisp.dhis.user.CurrentUserService;
-import org.hisp.dhis.user.User;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Lars Helge Overland
- */
-public class AddReportToDashboardAction
- implements Action
-{
- private static final Log log = LogFactory.getLog( AddReportToDashboardAction.class );
-
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private CurrentUserService currentUserService;
-
- public void setCurrentUserService( CurrentUserService currentUserService )
- {
- this.currentUserService = currentUserService;
- }
-
- private ReportService reportService;
-
- public void setReportService( ReportService reportService )
- {
- this.reportService = reportService;
- }
-
- @Autowired
- private DashboardManager dashboardManager;
-
- // -------------------------------------------------------------------------
- // Input
- // -------------------------------------------------------------------------
-
- private Integer id;
-
- public void setId( Integer id )
- {
- this.id = id;
- }
-
- // -------------------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------------------
-
- public String execute()
- {
- User user = currentUserService.getCurrentUser();
-
- if ( user != null )
- {
- DashboardContent content = dashboardManager.getDashboardContent( user );
-
- Report report = reportService.getReport( id );
-
- content.addReport( report );
-
- dashboardManager.saveDashboardContent( content );
-
- log.info( "Added report '" + report.getName() + "' to dashboard for user '" + user.getName() + "'" );
- }
- else
- {
- log.warn( "Could not add report to dashboard, no current user" );
- }
-
- return SUCCESS;
- }
-}
=== removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/AddReportTableToDashboardAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/AddReportTableToDashboardAction.java 2013-07-22 19:14:47 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/AddReportTableToDashboardAction.java 1970-01-01 00:00:00 +0000
@@ -1,110 +0,0 @@
-package org.hisp.dhis.reporting.tablecreator.action;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.hisp.dhis.dashboard.DashboardContent;
-import org.hisp.dhis.dashboard.DashboardManager;
-import org.hisp.dhis.reporttable.ReportTable;
-import org.hisp.dhis.reporttable.ReportTableService;
-import org.hisp.dhis.user.CurrentUserService;
-import org.hisp.dhis.user.User;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class AddReportTableToDashboardAction
- implements Action
-{
- private static final Log log = LogFactory.getLog( AddReportTableToDashboardAction.class );
-
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private CurrentUserService currentUserService;
-
- public void setCurrentUserService( CurrentUserService currentUserService )
- {
- this.currentUserService = currentUserService;
- }
-
- private ReportTableService reportTableService;
-
- public void setReportTableService( ReportTableService reportTableService )
- {
- this.reportTableService = reportTableService;
- }
-
- @Autowired
- private DashboardManager dashboardManager;
-
- // -------------------------------------------------------------------------
- // Input
- // -------------------------------------------------------------------------
-
- private Integer id;
-
- public void setId( Integer id )
- {
- this.id = id;
- }
-
- // -------------------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------------------
-
- public String execute()
- {
- User user = currentUserService.getCurrentUser();
-
- if ( user != null )
- {
- DashboardContent content = dashboardManager.getDashboardContent( user );
-
- ReportTable reportTable = reportTableService.getReportTable( id );
-
- content.addReportTable( reportTable );
-
- dashboardManager.saveDashboardContent( content );
-
- log.info( "Added report table '" + reportTable.getName() + "' to dashboard for user '" + user.getName() + "'" );
- }
- else
- {
- log.warn( "Could not add report to dashboard, no current user" );
- }
-
- return SUCCESS;
- }
-}
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml 2013-07-22 19:14:47 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml 2013-07-24 17:28:39 +0000
@@ -28,12 +28,6 @@
<property name="documentService" ref="org.hisp.dhis.document.DocumentService" />
</bean>
- <bean id="org.hisp.dhis.reporting.document.action.AddDocumentToDashboardAction" class="org.hisp.dhis.reporting.document.action.AddDocumentToDashboardAction"
- scope="prototype">
- <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
- <property name="documentService" ref="org.hisp.dhis.document.DocumentService" />
- </bean>
-
<!-- TableCreator -->
<bean id="org.hisp.dhis.reporting.tablecreator.action.GetReportParamsAction" class="org.hisp.dhis.reporting.tablecreator.action.GetReportParamsAction"
@@ -57,12 +51,6 @@
<property name="reportTableService" ref="org.hisp.dhis.reporttable.ReportTableService" />
</bean>
- <bean id="org.hisp.dhis.reporting.tablecreator.action.AddReportTableToDashboardAction" class="org.hisp.dhis.reporting.tablecreator.action.AddReportTableToDashboardAction"
- scope="prototype">
- <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
- <property name="reportTableService" ref="org.hisp.dhis.reporttable.ReportTableService" />
- </bean>
-
<bean id="org.hisp.dhis.reporting.tablecreator.action.ExportTableAction" class="org.hisp.dhis.reporting.tablecreator.action.ExportTableAction"
scope="prototype">
<property name="reportTableService" ref="org.hisp.dhis.reporttable.ReportTableService" />
@@ -98,12 +86,6 @@
<property name="reportService" ref="org.hisp.dhis.report.ReportService" />
</bean>
- <bean id="org.hisp.dhis.reporting.reportviewer.action.AddReportToDashboardAction" class="org.hisp.dhis.reporting.reportviewer.action.AddReportToDashboardAction"
- scope="prototype">
- <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
- <property name="reportService" ref="org.hisp.dhis.report.ReportService" />
- </bean>
-
<bean id="org.hisp.dhis.reporting.reportviewer.action.GetReportAndParamsAction" class="org.hisp.dhis.reporting.reportviewer.action.GetReportAndParamsAction"
scope="prototype">
</bean>
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/document.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/document.js 2011-09-29 12:57:18 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/document.js 2013-07-24 17:28:39 +0000
@@ -3,16 +3,6 @@
removeItem( id, "", i18n_confirm_remove_report, "removeDocument.action" );
}
-function addDocumentToDashboard( id )
-{
- var dialog = window.confirm( i18n_confirm_add_to_dashboard );
-
- if ( dialog )
- {
- $.get( "addDocumentToDashboard.action?id=" + id );
- }
-}
-
function toggleExternal()
{
var external = getListValue( "external" );
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/report.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/report.js 2013-04-30 08:03:51 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/report.js 2013-07-24 17:28:39 +0000
@@ -20,16 +20,6 @@
removeItem( id, "", i18n_confirm_remove_report, "removeReport.action" );
}
-function addToDashboard( id )
-{
- var dialog = window.confirm( i18n_confirm_add_to_dashboard );
-
- if ( dialog )
- {
- $.get( "addReportToDashboard.action?id=" + id );
- }
-}
-
function setReportType()
{
var type = $( "#type :selected" ).val();
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/table.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/table.js 2013-05-23 13:58:43 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/table.js 2013-07-24 17:28:39 +0000
@@ -3,13 +3,3 @@
{
removeItem( tableId, tableName, i18n_confirm_delete, "removeTable.action" );
}
-
-function addReportTableToDashboard( id )
-{
- var dialog = window.confirm( i18n_confirm_add_report_table_to_dashboard );
-
- if ( dialog )
- {
- $.get( "addReportTableToDashboard.action?id=" + id );
- }
-}
\ No newline at end of file
=== 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 2013-07-01 17:15:13 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDocumentForm.vm 2013-07-24 17:28:39 +0000
@@ -57,8 +57,6 @@
<img src="../images/edit-denied.png">
#end
- <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" ) && $security.canDelete( $document ) )
<a href="javascript:removeDocument( $document.id )" title="$i18n.getString( 'remove_report' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove_report' )"></a>
#else
=== 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 2013-07-01 17:15:13 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewReportForm.vm 2013-07-24 17:28:39 +0000
@@ -28,7 +28,7 @@
</table>
<table class="listTable" id="listTable">
<col>
- <col width="180px">
+ <col width="150px">
<thead>
<tr>
<th>$i18n.getString( "name" )</th>
@@ -55,8 +55,6 @@
<img src="../images/edit-denied.png">
#end
- <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" ) && $security.canDelete( $report ))
<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
=== 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 2013-06-29 14:16:34 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewTableForm.vm 2013-07-24 17:28:39 +0000
@@ -22,7 +22,7 @@
<td style="vertical-align:top">
<table class="listTable" id="listTable">
<col>
- <col width="120">
+ <col width="90">
<thead>
<tr>
<th>$i18n.getString( "name" )</th>
@@ -42,8 +42,6 @@
<img src="../images/relationship-denied.png">
#end
- <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" ) && $security.canDelete( $table ))
<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