login, analytics fix
diff --git a/erpnext/home/page/dashboard/dashboard.js b/erpnext/home/page/dashboard/dashboard.js
index e8f2992..b622808 100644
--- a/erpnext/home/page/dashboard/dashboard.js
+++ b/erpnext/home/page/dashboard/dashboard.js
@@ -1,6 +1,6 @@
pscript.onload_dashboard = function() {
// load jqplot
- wn.require('lib/css/jqpot.css');
+ wn.require('lib/css/jqplot.css');
wn.require('lib/js/legacy/jquery/jquery.jqplot.min.js');
wn.require('lib/js/legacy/jquery/jqplot-plugins/jqplot.barRenderer.js');
wn.require('lib/js/legacy/jquery/jqplot-plugins/jqplot.canvasAxisTickRenderer.min.js');
diff --git a/erpnext/patches/jan_mar_2012/website/analytics.py b/erpnext/patches/jan_mar_2012/website/analytics.py
new file mode 100644
index 0000000..68ccfcf
--- /dev/null
+++ b/erpnext/patches/jan_mar_2012/website/analytics.py
@@ -0,0 +1,5 @@
+def execute():
+ from webnotes.modules import reload_doc
+ reload_doc('website', 'doctype', 'website_settings')
+ reload_doc('website', 'doctype', 'product_settings')
+
\ No newline at end of file
diff --git a/erpnext/startup/event_handlers.py b/erpnext/startup/event_handlers.py
index d9fbbed..8b81c39 100644
--- a/erpnext/startup/event_handlers.py
+++ b/erpnext/startup/event_handlers.py
@@ -56,6 +56,10 @@
parent_label, parentfield
from `tabTop Bar Item` where parent='Website Settings' order by idx asc""", as_dict=1)
bootinfo['custom_css'] = webnotes.conn.get_value('Style Settings', None, 'custom_css') or ''
+ bootinfo['analytics_code'] = \
+ webnotes.conn.get_value('Website Settings', None, 'analytics_code')
+ bootinfo['analytics_call'] = \
+ webnotes.conn.get_value('Website Settings', None, 'analytics_call')
else:
bootinfo['letter_heads'] = get_letter_heads()
diff --git a/erpnext/website/doctype/products_settings/products_settings.txt b/erpnext/website/doctype/products_settings/products_settings.txt
index 9e60f95..aa0fbb3 100644
--- a/erpnext/website/doctype/products_settings/products_settings.txt
+++ b/erpnext/website/doctype/products_settings/products_settings.txt
@@ -5,68 +5,68 @@
{
'creation': '2012-01-30 12:15:00',
'docstatus': 0,
- 'modified': '2012-01-30 13:50:53',
- 'modified_by': 'Administrator',
- 'owner': 'Administrator'
+ 'modified': '2012-02-14 14:29:41',
+ 'modified_by': u'Administrator',
+ 'owner': u'Administrator'
},
# These values are common for all DocType
{
- '_last_update': '1327906116',
- 'colour': 'White:FFF',
- 'description': 'Products are automatically updated from the item master. To add products to the website, go to the <a href="#!List/Item">Item master</a> and check "Show in Website" in the "Website Details"\n\n',
+ '_last_update': u'1327911653',
+ 'colour': u'White:FFF',
+ 'description': u'\n\n',
'doctype': 'DocType',
'issingle': 1,
- 'module': 'Website',
+ 'module': u'Website',
'name': '__common__',
- 'section_style': 'Simple',
+ 'section_style': u'Simple',
'show_in_menu': 0,
- 'version': 3
+ 'version': 4
},
# These values are common for all DocField
{
- 'colour': 'White:FFF',
- 'description': 'Product Groups that are listed on the website. The first product group from this list will be listed by default on the "Products Page"',
- 'doctype': 'DocField',
- 'fieldname': 'groups',
- 'fieldtype': 'Table',
- 'label': 'Groups',
+ 'colour': u'White:FFF',
+ 'description': u'Product Groups that are listed on the website. The first product group from this list will be listed by default on the "Products Page"',
+ 'doctype': u'DocField',
+ 'fieldname': u'groups',
+ 'fieldtype': u'Table',
+ 'label': u'Groups',
'name': '__common__',
- 'options': 'Product Group',
- 'parent': 'Products Settings',
- 'parentfield': 'fields',
- 'parenttype': 'DocType',
+ 'options': u'Product Group',
+ 'parent': u'Products Settings',
+ 'parentfield': u'fields',
+ 'parenttype': u'DocType',
'permlevel': 0
},
# These values are common for all DocPerm
{
'create': 1,
- 'doctype': 'DocPerm',
+ 'doctype': u'DocPerm',
'name': '__common__',
- 'parent': 'Products Settings',
- 'parentfield': 'permissions',
- 'parenttype': 'DocType',
+ 'parent': u'Products Settings',
+ 'parentfield': u'permissions',
+ 'parenttype': u'DocType',
'permlevel': 0,
'read': 1,
- 'role': 'Website Manager',
+ 'role': u'Website Manager',
'write': 1
},
# DocType, Products Settings
{
'doctype': 'DocType',
- 'name': 'Products Settings'
+ 'name': u'Products Settings'
},
# DocPerm
{
- 'doctype': 'DocPerm'
+ 'doctype': u'DocPerm'
},
# DocField
{
- 'doctype': 'DocField'
+ 'doctype': u'DocField'
}
]
\ No newline at end of file
diff --git a/erpnext/website/doctype/website_settings/website_settings.txt b/erpnext/website/doctype/website_settings/website_settings.txt
index 0ceac47..b6ea7a3 100644
--- a/erpnext/website/doctype/website_settings/website_settings.txt
+++ b/erpnext/website/doctype/website_settings/website_settings.txt
@@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
- 'creation': '2012-02-02 13:51:29',
+ 'creation': '2012-02-02 13:19:50',
'docstatus': 0,
- 'modified': '2012-02-13 12:23:36',
+ 'modified': '2012-02-14 16:13:59',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@@ -23,7 +23,7 @@
'name': '__common__',
'section_style': u'Simple',
'show_in_menu': 0,
- 'version': 8
+ 'version': 9
},
# These values are common for all DocField
@@ -205,5 +205,35 @@
'label': u'Domain List',
'permlevel': 0,
'reqd': 0
+ },
+
+ # DocField
+ {
+ 'doctype': u'DocField',
+ 'fieldtype': u'Section Break',
+ 'label': u'Analytics',
+ 'permlevel': 0
+ },
+
+ # DocField
+ {
+ 'colour': u'White:FFF',
+ 'description': u'Code pasted in the head tag to start an Analytics engine like Google Analytics',
+ 'doctype': u'DocField',
+ 'fieldname': u'analytics_code',
+ 'fieldtype': u'Text',
+ 'label': u'Analytics Code',
+ 'permlevel': 0
+ },
+
+ # DocField
+ {
+ 'colour': u'White:FFF',
+ 'description': u"Function to be called when page is changed. (_gaq.push['_trackPageview'] for Google Code)",
+ 'doctype': u'DocField',
+ 'fieldname': u'analytics_call',
+ 'fieldtype': u'Text',
+ 'label': u'Analytics Call',
+ 'permlevel': 0
}
]
\ No newline at end of file
diff --git a/js/all-app.js b/js/all-app.js
index 826b6e0..da1a02b 100644
--- a/js/all-app.js
+++ b/js/all-app.js
Binary files differ
diff --git a/js/all-web.js b/js/all-web.js
index 6f466ed..6ebbfc2 100644
--- a/js/all-web.js
+++ b/js/all-web.js
@@ -750,7 +750,7 @@
en_t=encodeURIComponent(t);en_dt=encodeURIComponent(dt);en_dn=dn?encodeURIComponent(dn):'';if(en_t=='Page'){var id=en_dt+(dn?('/'+en_dn):'')}else{var id=en_t+'/'+en_dt+(dn?('/'+en_dn):'')}
if(nav_obj.on_open)
nav_obj.on_open(id);if(window.location.hash!='!'+id){window.location.hash='!'+id;}}
-nav_obj.notify_observers(t,dt,dn);}
+nav_obj.notify_observers(t,dt,dn);if(wn.boot.analytics_code){try{eval(wn.boot.analytics_code);}catch(e){console.log(e);}}}
nav_obj.notify_observers=function(t,dt,dn){for(var i=0;i<nav_obj.observers.length;i++){var o=nav_obj.observers[i];if(o&&o.notify)o.notify(t,dt,dn);}}
nav_obj.rename_notify=function(dt,oldn,newn){for(var i=0;i<nav_obj.ol.length;i++){var o=nav_obj.ol[i];if(o[1]==dt&&o[2]==oldn)o[2]=newn;}}
nav_obj.show_last_open=function(){var l=nav_obj.ol[nav_obj.ol.length-2];delete nav_obj.ol[nav_obj.ol.length-1];if(!l)loadpage('_home');else if(l[0]=='Page'){loadpage(l[1]);}else if(l[0]=='Report'){loadreport(l[1],l[2]);}else if(l[0]=='Form'){loaddoc(l[1],l[2]);}else if(l[0]=='DocBrowser'||l[0]=='List'){loaddocbrowser(l[1]);}}
diff --git a/version.num b/version.num
index 8d73f93..26f5507 100644
--- a/version.num
+++ b/version.num
@@ -1 +1 @@
-422
+423
\ No newline at end of file