This commit is contained in:
Rushabh Mehta 2012-01-23 16:18:34 +05:30
parent 843db59fcb
commit c5bf642c7d
6 changed files with 29 additions and 26 deletions

View File

@ -197,7 +197,10 @@ class DocType:
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)

View File

@ -346,21 +346,32 @@ HomeToDo.prototype.render_item = function(item, det) {
$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.clear_dialog = function() {
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 @@ HomeToDo.prototype.save = function(btn) {
return;
}
det.name = d.det ? d.det[0] : '';
var callback = function(r,rt) {
btn.done_working();
me.widget.dialog.hide();
@ -420,9 +429,6 @@ FeedList.prototype.make_head = function() {
// 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 @@ HomeStatusBar = function() {
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') }

View File

@ -579,7 +579,7 @@ MemberProfile = function(parent, uid, member_item) {
$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

View File

@ -90,8 +90,6 @@ cur_frm.cscript['Declare Completed'] = function(doc,cdt,cdn){
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() {

View File

@ -3,7 +3,7 @@
<meta charset="utf-8">
<title>ERPNext</title>
<meta name="author" content="">
<script type="text/javascript">window._version_number="102";
<script type="text/javascript">window._version_number="136";
/*
* lib/js/wn/class.js

View File

@ -1 +1 @@
102
136