← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21053: PT noext.

 

------------------------------------------------------------
revno: 21053
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2015-11-14 00:15:35 +0100
message:
  PT noext.
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/plugin.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app2.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/core2.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/table.js


--
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-apps/src/main/webapp/dhis-web-pivot/plugin.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/plugin.html	2015-11-10 22:06:00 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/plugin.html	2015-11-13 23:15:35 +0000
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
-	<script src="//localhost:8888/dhis-web-commons/javascripts/ext/ext-all.js"></script>
+	<script src="//localhost:8080/dhis-web-commons/javascripts/ext/ext-all.js"></script>
 	<script src="scripts/table.js"></script>
 
     <style type="text/css">
@@ -12,7 +12,7 @@
 
 	<script>
 		Ext.onReady(function() {
-			var url = 'http://localhost:8888',
+			var url = 'http://localhost:8080',
                 username = 'admin',
                 password = 'district';
 

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app2.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app2.js	2015-11-13 20:25:47 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app2.js	2015-11-13 23:15:35 +0000
@@ -1,6 +1,59 @@
 Ext.onReady( function() {
 	var N = PT;
 
+    // UiManager
+    (function() {
+        var UiManager = function() {
+            var t = this;
+
+            t.getScrollbarSize = function(force) {
+                var scrollbarSize,
+                    db = document.body,
+                    div = document.createElement('div');
+
+                div.style.width = div.style.height = '100px';
+                div.style.overflow = 'scroll';
+                div.style.position = 'absolute';
+
+                db.appendChild(div);
+
+                scrollbarSize = {
+                    width: div.offsetWidth - div.clientWidth,
+                    height: div.offsetHeight - div.clientHeight
+                };
+
+                db.removeChild(div);
+
+                return scrollbarSize;
+            };
+        };
+
+        N.UiManager = new UiManager();
+    })();
+
+    // UiMenuRegion
+    (function() {
+        var UiMenuRegion = function(config) {
+            var t = this;
+
+            config = N.isObject(config) ? config : {};
+
+            // constants
+            var width = config.width || 424;
+
+            // constructor
+            $.extend(this, Ext.create('Ext.panel.Panel', {
+                region: 'west',
+                preventHeader: true,
+                collapsible: true,
+                collapseMode: 'mini',
+                border: false,
+                width: width + N.UiManager.getScrollbarSize().width,
+                items: new N.UiMenuAccordion()
+            }));
+        };
+    })();
+
     // initialize
     (function() {
         var appManager = N.AppManager,

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/core2.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/core2.js	2015-11-13 20:25:47 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/core2.js	2015-11-13 23:15:35 +0000
@@ -371,28 +371,6 @@
         N.uuid = uuid;
     })();
 
-    // DateManager TODO import
-    (function() {
-        var DateManager = function() {};
-
-        DateManager.prototype.getYYYYMMDD = function(param) {
-            if (!(Object.prototype.toString.call(param) === '[object Date]' && param.toString() !== 'Invalid date')) {
-                return null;
-            }
-
-            var date = new Date(param),
-                month = '' + (1 + date.getMonth()),
-                day = '' + date.getDate();
-
-            month = month.length === 1 ? '0' + month : month;
-            day = day.length === 1 ? '0' + day : day;
-
-            return date.getFullYear() + '-' + month + '-' + day;
-        };
-
-        N.DateManager = new DateManager();
-    })();
-
     // AppManager
     (function() {
         var AppManager = function() {
@@ -557,6 +535,28 @@
         N.AppManager = new AppManager();
     })();
 
+    // DateManager TODO import
+    (function() {
+        var DateManager = function() {};
+
+        DateManager.prototype.getYYYYMMDD = function(param) {
+            if (!(Object.prototype.toString.call(param) === '[object Date]' && param.toString() !== 'Invalid date')) {
+                return null;
+            }
+
+            var date = new Date(param),
+                month = '' + (1 + date.getMonth()),
+                day = '' + date.getDate();
+
+            month = month.length === 1 ? '0' + month : month;
+            day = day.length === 1 ? '0' + day : day;
+
+            return date.getFullYear() + '-' + month + '-' + day;
+        };
+
+        N.DateManager = new DateManager();
+    })();
+
     // CalendarManager
     (function() {
         var CalendarManager = function(config) {

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/table.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/table.js	2015-11-10 22:06:00 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/table.js	2015-11-13 23:15:35 +0000
@@ -3203,36 +3203,36 @@
         });
 
         // user orgunit
-		requests.push({
-			url: init.contextPath + '/api/organisationUnits.' + type + '?userOnly=true&fields=id,name,children[id,name]&paging=false',
-            disableCaching: false,
-			success: function(r) {
-				var organisationUnits = (r.responseText ? Ext.decode(r.responseText).organisationUnits : r) || [],
-                    ou = [],
-                    ouc = [];
-
-                if (organisationUnits.length) {
-                    for (var i = 0, org; i < organisationUnits.length; i++) {
-                        org = organisationUnits[i];
-
-                        ou.push(org.id);
-
-                        if (org.children) {
-                            ouc = Ext.Array.clean(ouc.concat(Ext.Array.pluck(org.children, 'id') || []));
-                        }
-                    }
-
-                    init.user = init.user || {};
-                    init.user.ou = ou;
-                    init.user.ouc = ouc;
-                }
-                else {
-                    alert('User is not assigned to any organisation units');
-                }
-
-                fn();
-			}
-		});
+		//requests.push({
+			//url: init.contextPath + '/api/organisationUnits.' + type + '?userOnly=true&fields=id,name,children[id,name]&paging=false',
+            //disableCaching: false,
+			//success: function(r) {
+				//var organisationUnits = (r.responseText ? Ext.decode(r.responseText).organisationUnits : r) || [],
+                    //ou = [],
+                    //ouc = [];
+
+                //if (organisationUnits.length) {
+                    //for (var i = 0, org; i < organisationUnits.length; i++) {
+                        //org = organisationUnits[i];
+
+                        //ou.push(org.id);
+
+                        //if (org.children) {
+                            //ouc = Ext.Array.clean(ouc.concat(Ext.Array.pluck(org.children, 'id') || []));
+                        //}
+                    //}
+
+                    //init.user = init.user || {};
+                    //init.user.ou = ou;
+                    //init.user.ouc = ouc;
+                //}
+                //else {
+                    //alert('User is not assigned to any organisation units');
+                //}
+
+                //fn();
+			//}
+		//});
 
         // dimensions
 		requests.push({