messages.js: allow user to task messages
diff --git a/utilities/page/messages/messages.js b/utilities/page/messages/messages.js
index 8e8cb6f..5ad540f 100644
--- a/utilities/page/messages/messages.js
+++ b/utilities/page/messages/messages.js
@@ -129,18 +129,22 @@
if(data.owner==user) {
data.cls = 'message-self';
data.comment_by_fullname = 'You';
- data.delete_html = repl('<a class="close" \
- onclick="erpnext.messages.delete(this)"\
- data-name="%(name)s">×</a>', data);
} else {
data.cls = 'message-other';
- data.delete_html = '';
if(this.contact==user) {
data.reply_html = repl('<a href="#!messages/%(owner)s">\
<i class="icon-share-alt"></i> Reply</a>', data)
}
}
+ // delete
+ data.delete_html = "";
+ if(data.owner==user || data.comment.indexOf("assigned to")!=-1) {
+ data.delete_html = repl('<a class="close" \
+ onclick="erpnext.messages.delete(this)"\
+ data-name="%(name)s">×</a>', data);
+ }
+
wrapper.innerHTML = repl('<div class="message %(cls)s">%(delete_html)s\
<b>%(comment)s</b>\
<div class="help">by %(comment_by_fullname)s, %(creation)s</div>\