← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8462: Dashboard search field now includes users in search

 

------------------------------------------------------------
revno: 8462
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-10-10 15:23:23 +0200
message:
  Dashboard search field now includes users in search
added:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/user_small.png
modified:
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/impl/DefaultDashboardService.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/hits.vm
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/mainForm.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-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/impl/DefaultDashboardService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/impl/DefaultDashboardService.java	2012-10-06 09:26:35 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/impl/DefaultDashboardService.java	2012-10-10 13:23:23 +0000
@@ -45,6 +45,7 @@
 import org.hisp.dhis.reporttable.ReportTable;
 import org.hisp.dhis.reporttable.ReportTableService;
 import org.hisp.dhis.user.User;
+import org.hisp.dhis.user.UserService;
 import org.springframework.transaction.annotation.Transactional;
 
 /**
@@ -70,6 +71,13 @@
         this.dashboardContentStore = dashboardContentStore;
     }
     
+    private UserService userService;
+    
+    public void setUserService( UserService userService )
+    {
+        this.userService = userService;
+    }
+
     private ChartService chartService;
 
     public void setChartService( ChartService chartService )
@@ -117,14 +125,21 @@
         
         int remaining = 0;
         
+        objects.addAll( userService.getAllUsersBetweenByName( query, 0, MAX_PER_OBJECT ) );
         objects.addAll( chartService.getChartsBetweenByName( query, 0, MAX_PER_OBJECT ) );
-        objects.addAll( mappingService.getMapViewsBetweenByName( query, 0, MAX_PER_OBJECT ) );
-        objects.addAll( reportService.getReportsBetweenByName( query, 0, MAX_PER_OBJECT ) );
+        objects.addAll( mappingService.getMapViewsBetweenByName( query, 0, MAX_PER_OBJECT ) );        
 
         remaining = MAX_OBJECTS - objects.size();
         
         if ( remaining > 0 )
         {
+            objects.addAll( reportService.getReportsBetweenByName( query, 0, MAX_PER_OBJECT ) );
+        }
+        
+        remaining = MAX_OBJECTS - objects.size();
+        
+        if ( remaining > 0 )
+        {
             objects.addAll( reportTableService.getReportTablesBetweenByName( query, 0, Math.min( remaining, MAX_OBJECTS ) ) );
         }
 

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml	2012-10-05 16:00:19 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml	2012-10-10 13:23:23 +0000
@@ -155,6 +155,7 @@
 
   <bean id="org.hisp.dhis.dashboard.DashboardService" class="org.hisp.dhis.dashboard.impl.DefaultDashboardService">
     <property name="dashboardContentStore" ref="org.hisp.dhis.dashboard.DashboardContentStore" />
+    <property name="userService" ref="org.hisp.dhis.user.UserService" />
     <property name="chartService" ref="org.hisp.dhis.chart.ChartService" />
     <property name="mappingService" ref="org.hisp.dhis.mapping.MappingService" />
     <property name="reportService" ref="org.hisp.dhis.report.ReportService" />

=== added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/user_small.png'
Binary files dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/user_small.png	1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/user_small.png	2012-10-10 13:23:23 +0000 differ
=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties	2012-10-08 13:44:41 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties	2012-10-10 13:23:23 +0000
@@ -63,7 +63,7 @@
 data_visualizer=Data visualizer
 report_table=Report table
 data_set_report=Data set report
-search_for_charts_maps_reports=Search for charts, maps and reports
+search_for_users_charts_maps_reports=Search for users, charts, maps and reports
 no_hits=No hits, try again
 profile=Profile
 introduction=Introduction

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/hits.vm'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/hits.vm	2012-10-05 16:00:19 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/hits.vm	2012-10-10 13:23:23 +0000
@@ -2,7 +2,9 @@
 #if( $objects.size() > 0 )
 #foreach( $o in $objects )
 #if( $o )
-#if( "Chart" == $o.getClass().getSimpleName() )
+#if( "User" == $o.getClass().getSimpleName() )
+<li><a href="profile.action?id=${o.uid}"><img src="../images/user_small.png">&nbsp; $encoder.htmlEncode( $o.name )</a></li>
+#elseif( "Chart" == $o.getClass().getSimpleName() )
 <li><a href="../dhis-web-visualizer/app/index.html?id=${o.uid}"><img src="../images/chart_small.png">&nbsp; $encoder.htmlEncode( $o.name )</a></li>
 #elseif( "MapView" == $o.getClass().getSimpleName() )
 <li><a href="../dhis-web-mapping/mapping/index.html?id=${o.uid}"><img src="../images/map_small.png">&nbsp; $encoder.htmlEncode( $o.name )</a></li>
@@ -16,6 +18,6 @@
 #end
 #end
 #else
-<li>$i18n.getString( "no_hits" )</li>
+<li style="padding-left:12px">$i18n.getString( "no_hits" )</li>
 #end
 </ul>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/mainForm.vm'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/mainForm.vm	2012-10-08 13:29:11 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/mainForm.vm	2012-10-10 13:23:23 +0000
@@ -20,7 +20,7 @@
 	</ul>
 </div>
 
-<div id="searchDiv"><input type="text" id="searchField" autocomplete="off" placeholder="$i18n.getString( 'search_for_charts_maps_reports' )"></div>
+<div id="searchDiv"><input type="text" id="searchField" autocomplete="off" placeholder="$i18n.getString( 'search_for_users_charts_maps_reports' )"></div>
 <div id="hitDiv"></div>
 
 <div id="contentDiv"></div>