Merge branch 'latest' of github.com:webnotes/erpnext into latest

Conflicts:
	index.html
	version.num
diff --git a/erpnext/home/doctype/home_control/home_control.py b/erpnext/home/doctype/home_control/home_control.py
index ce15bfd..9d82153 100644
--- a/erpnext/home/doctype/home_control/home_control.py
+++ b/erpnext/home/doctype/home_control/home_control.py
@@ -197,7 +197,10 @@
 		return count
 		
 	def get_todo_list(self):
-		return convert_to_lists(sql("select name, description, date, priority,checked from `tabToDo Item` where owner=%s order by field(priority,'High','Medium','Low') asc, date asc", session['user']))
+		return sql("""select name, description, date, 
+			priority, checked, reference_type, reference_name from `tabToDo Item` 
+			where owner=%s order by field(priority,'High','Medium','Low') asc, date asc""", \
+				session['user'], as_dict=1)
 		
 	def add_todo_item(self,args):
 		args = json.loads(args)
diff --git a/erpnext/home/page/event_updates/event_updates.js b/erpnext/home/page/event_updates/event_updates.js
index 6e09cca..9e8302e 100644
--- a/erpnext/home/page/event_updates/event_updates.js
+++ b/erpnext/home/page/event_updates/event_updates.js
@@ -346,21 +346,32 @@
 	$y(tab, {tableLayout:'fixed'});
 
 	var span = $a($td(tab, 0, 0), 'span', '', {padding:'2px',color:'#FFF',fontSize:'10px'
-		,backgroundColor:(det[3]=='Low' ? '#888' : (det[3]=='High' ? '#EDA857' : '#687FD3'))});
+		, backgroundColor:(det.priority=='Low' ? '#888' : 
+			(det.priority=='High' ? '#EDA857' : '#687FD3'))});
 		
 	$(span).css('-moz-border-radius','3px').css('-webkit-border-radius','3px');
-	span.innerHTML = det[3];
+	span.innerHTML = det.priority;
 
 	// text
-	var span = $a($td(tab, 0, 1), 'span', 'social', {lineHeight:'1.5em'}, replace_newlines(det[1]));
-	if(det[4]) $y(span,{textDecoration:'line-through'});
+	var span = $a($td(tab, 0, 1), 'div', 'social', {lineHeight:'1.5em'}, 
+		replace_newlines(det.description));
+	if(det.checked) $y(span,{textDecoration:'line-through'});
+	
+	// reference link
+	if(det.reference_name) {
+		$a($td(tab, 0, 1), 'div', 'social', '', 
+			repl('<a href="#!Form/%(reference_type)s/%(reference_name)s">%(reference_name)s</a>',
+				det))
+	}
 	
 	// if expired & open, then in red
-	if(!det[4] && dateutil.str_to_obj(det[2]) < new Date()) {
+	if(!det.checked && dateutil.str_to_obj(det.date) < new Date()) {
 		$y(span,{color:'RED'}); 
-		$a($td(tab, 0, 1), 'div', '', {fontSize:'10px', color:'#666'}, dateutil.str_to_user(det[2]) + ' (Overdue)');
+		$a($td(tab, 0, 1), 'div', '', {fontSize:'10px', color:'#666'},
+		 	dateutil.str_to_user(det.date) + ' (Overdue)');
 	} else {
-		$a($td(tab, 0, 1), 'div', '', {fontSize:'10px', color:'#666'}, dateutil.str_to_user(det[2]));		
+		$a($td(tab, 0, 1), 'div', '', {fontSize:'10px', color:'#666'}, 
+			dateutil.str_to_user(det.date));		
 	}
 }
 
@@ -371,10 +382,10 @@
 HomeToDo.prototype.set_dialog_values = function(det) {
 	var d = this.widget.dialog;
 	d.set_values({
-		date: det[2],
-		priority: det[3],
-		description: det[1],
-		checked: det[4]
+		date: det.date,
+		priority: det.priority,
+		description: det.description,
+		checked: det.checked
 	});
 	d.det = det;
 }
@@ -389,8 +400,6 @@
 	 	return;	
 	}
 
-	det.name = d.det ? d.det[0] : '';
-	
 	var callback = function(r,rt) {
 		btn.done_working();
 		me.widget.dialog.hide();
@@ -420,9 +429,6 @@
 	// head
 
 	$a(this.head,'h1','', {display:'inline'}, 'Home'); 
-	$a(this.head,'span','link_type', {marginLeft:'7px', fontSize:'11px'}, 'help', function() {
-		msgprint('<b>What appears here?</b> This is where you get updates of everything you are permitted to follow')
-	})
 
 	// refresh
 	$a(this.head,'span','link_type', 
@@ -583,10 +589,6 @@
 	
 	this.render = function(r) {
 		this.wrapper.innerHTML = '';
-		this.profile_settings = $a($a(this.wrapper, 'p'), 'span', 'link_type', {fontWeight:'bold'});
-		this.profile_settings.innerHTML = user_fullname + ' (Profile Settings)';
-		this.profile_settings.onclick = function() { loadpage('profile-settings'); }
-
 		this.span = $a($a(this.wrapper, 'p'), 'span', 'link_type', {fontWeight:'bold'});
 		this.span.onclick = function() { loadpage('My Company')	}
 		
diff --git a/erpnext/home/page/my_company/my_company.js b/erpnext/home/page/my_company/my_company.js
index a057ac3..0aea99b 100644
--- a/erpnext/home/page/my_company/my_company.js
+++ b/erpnext/home/page/my_company/my_company.js
@@ -579,7 +579,7 @@
 		$ds(this.member_item.working_img);
 		$dh(this.wrapper);
 		this.loading = 1;
-		$c('webnotes.widgets.form.getdoc', {'name':this.uid, 'doctype':'Profile', 'user':user}, callback);	// onload		
+		$c('webnotes.widgets.form.load.getdoc', {'name':this.uid, 'doctype':'Profile', 'user':user}, callback);	// onload		
 	}
 	
 	// show / hide
diff --git a/erpnext/hr/doctype/appraisal/appraisal.js b/erpnext/hr/doctype/appraisal/appraisal.js
index d040c53..78b5fd3 100644
--- a/erpnext/hr/doctype/appraisal/appraisal.js
+++ b/erpnext/hr/doctype/appraisal/appraisal.js
@@ -90,8 +90,6 @@
 		
 		declare_completed_dialog.refresh_dt = function(){
 			cur_frm.cscript.refresh(this.doc, this.cdt, this.cdn);
-			msgprint("refersh done");
-			$c('webnotes.widgets.form.form_header.refresh_labels',this.doc,function(r,rt){});
 		}
 		
 		declare_completed_dialog.add = function() {
diff --git a/index.html b/index.html
index e375c2d..970c9e3 100644
--- a/index.html
+++ b/index.html
@@ -3,7 +3,92 @@
 	<meta charset="utf-8">
 	<title>ERPNext</title>
 	<meta name="author" content="">
-	<script type="text/javascript">window._version_number="104"
+	<script type="text/javascript">window._version_number="136";
+
+/*
+*	lib/js/wn/class.js
+*/
+/*
+
+Inheritence "Class"
+-------------------
+see: http://ejohn.org/blog/simple-javascript-inheritance/
+To subclass, use:
+
+	var MyClass = Class.extend({
+		init: function
+	})
+
+*/
+
+/* Simple JavaScript Inheritance
+ * By John Resig http://ejohn.org/
+ * MIT Licensed.
+ */
+// Inspired by base2 and Prototype
+
+(function(){
+	var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/;
+	// The base Class implementation (does nothing)
+	this.Class = function(){};
+	
+	// Create a new Class that inherits from this class
+	Class.extend = function(prop) {
+		var _super = this.prototype;
+		
+		// Instantiate a base class (but only create the instance,
+		// don't run the init constructor)
+		initializing = true;
+		var prototype = new this();
+		initializing = false;
+		
+		// Copy the properties over onto the new prototype
+		for (var name in prop) {
+			// Check if we're overwriting an existing function
+			prototype[name] = typeof prop[name] == "function" && 
+				typeof _super[name] == "function" && fnTest.test(prop[name]) ?
+				(function(name, fn){
+					return function() {
+						var tmp = this._super;
+						
+						// Add a new ._super() method that is the same method
+						// but on the super-class
+						this._super = _super[name];
+						
+						// The method only need to be bound temporarily, so we
+						// remove it when we're done executing
+						var ret = fn.apply(this, arguments);				
+						this._super = tmp;
+						
+						return ret;
+					};
+				})(name, prop[name]) :
+				prop[name];
+		}
+		
+		// The dummy class constructor
+		function Class() {
+			// All construction is actually done in the init method
+			if ( !initializing && this.init )
+				this.init.apply(this, arguments);
+		}
+		
+		// Populate our constructed prototype object
+		Class.prototype = prototype;
+		
+		// Enforce the constructor to be what we expect
+		Class.prototype.constructor = Class;
+
+		// And make this class extendable
+		Class.extend = arguments.callee;
+		
+		return Class;
+	};
+})();
+
+/*
+*	lib/js/wn/provide.js
+*/
 
 wn={}
 wn.provide=function(namespace){var nsl=namespace.split('.');var l=nsl.length;var parent=window;for(var i=0;i<l;i++){var n=nsl[i];if(!parent[n]){parent[n]={}}
diff --git a/version.num b/version.num
index dec4c59..7296f25 100644
--- a/version.num
+++ b/version.num
@@ -1 +1 @@
-104
\ No newline at end of file
+136