From bd2b891f92d52cd889495edc88b9adba9934d9c3 Mon Sep 17 00:00:00 2001 From: Akhilesh Darjee Date: Tue, 14 Jan 2014 13:09:37 +0530 Subject: [PATCH 1/3] set default condition only if not conditions in filters --- public/js/wn/ui/filters.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/js/wn/ui/filters.js b/public/js/wn/ui/filters.js index 15735782ce..3178cacac2 100644 --- a/public/js/wn/ui/filters.js +++ b/public/js/wn/ui/filters.js @@ -145,7 +145,8 @@ wn.ui.Filter = Class.extend({ me.field.desc_area = $a(me.field.wrapper, 'span', 'help', null, 'values separated by comma'); } else { - me.set_field(me.field.df.parent, me.field.df.fieldname); + me.set_field(me.field.df.parent, me.field.df.fieldname, null, + me.$w.find('.condition').val()); } }); @@ -166,7 +167,7 @@ wn.ui.Filter = Class.extend({ if(value!=null) this.field.set_input(value); }, - set_field: function(tablename, fieldname, fieldtype) { + set_field: function(tablename, fieldname, fieldtype, condition) { var me = this; // set in fieldname (again) @@ -212,7 +213,7 @@ wn.ui.Filter = Class.extend({ if(old_text) me.field.set_input(old_text); - this.set_default_condition(df, fieldtype); + if(!condition) this.set_default_condition(df, fieldtype); $(me.field.wrapper).find(':input').keydown(function(ev) { if(ev.which==13) { From 529b52cc96368a57f639605ebfb05178376e6fb6 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 14 Jan 2014 15:53:16 +0530 Subject: [PATCH 2/3] Delete notification count for messages, after read or post --- core/page/messages/messages.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/page/messages/messages.py b/core/page/messages/messages.py index 363a06ce66..b010b42f9d 100644 --- a/core/page/messages/messages.py +++ b/core/page/messages/messages.py @@ -3,6 +3,8 @@ from __future__ import unicode_literals import webnotes +from core.doctype.notification_count.notification_count import delete_notification_count_for + @webnotes.whitelist() def get_list(arg=None): @@ -17,6 +19,9 @@ def get_list(arg=None): set docstatus = 1 where comment_doctype in ('My Company', 'Message') and comment_docname = %s """, webnotes.user.name) + + delete_notification_count_for("Messages") + webnotes.conn.commit() if webnotes.form_dict['contact'] == webnotes.session['user']: @@ -69,6 +74,8 @@ def post(arg=None): d.comment_docname = arg['contact'] d.comment_doctype = 'Message' d.save() + + delete_notification_count_for("Messages") import webnotes.utils if webnotes.utils.cint(arg.get('notify')): From 2722caba5956a0235cf4e750f233afc593880a07 Mon Sep 17 00:00:00 2001 From: Pratik Vyas Date: Tue, 14 Jan 2014 19:19:10 +0600 Subject: [PATCH 3/3] bumped to version 3.7.1 --- config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.json b/config.json index d23f57a1b9..4c93bafc7f 100644 --- a/config.json +++ b/config.json @@ -1,6 +1,6 @@ { "base_template": "lib/website/templates/base.html", - "framework_version": "3.7.0", + "framework_version": "3.7.1", "modules": { "Calendar": { "color": "#2980b9",