← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9756: Added script for populating dashboards for new users

 

------------------------------------------------------------
revno: 9756
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-02-06 18:46:14 +0200
message:
  Added script for populating dashboards for new users
modified:
  resources/sql/div.sql


--
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 'resources/sql/div.sql'
--- resources/sql/div.sql	2012-12-23 14:38:42 +0000
+++ resources/sql/div.sql	2013-02-06 16:46:14 +0000
@@ -119,6 +119,19 @@
   or cast(substring(coordinates from '\[(.+?\..+?),.+?\..+?\]') as double precision) > 43
 );
 
+-- Populate dashboards for all users (7666 is userinfoid for target dashboard, replace with preferred id)
+
+insert into usersetting (userinfoid, name, value)
+select userinfoid, 'dashboardConfig', (
+  select value
+  from usersetting
+  where userinfoid=7666) as value
+from userinfo
+where userinfoid not in (
+  select userinfoid
+  from usersetting
+  where name='dashboardConfig')
+
 -- Insert random org unit codes
 
 create function setrandomcode() returns integer AS $$