Index: extensions/pydevutils.py =================================================================== --- extensions/pydevutils.py (revision 88865) +++ extensions/pydevutils.py (working copy) @@ -14,6 +14,29 @@ db = request.client.db return 'Coordinator' in db.user.get(user, 'roles') + +def issueid_and_action_from_class(cls): + """ + Return the id of the issue where the msg/file is/was linked + and if the last "linking action" was 'link' or 'unlink'. + """ + last_action = '' + for entry in cls._klass.history(cls._nodeid): + if 'unlink' in entry: + last_unlink = entry + last_action = 'unlink' + elif 'link' in entry: + last_entry = entry + last_action = 'link' + if last_action in ('link', 'unlink'): + # the msg has been unlinked and not linked back + # the link looks like: ('16', , '4', + # 'link', ('issue', '1', 'messages')) + return last_entry[4][1], last_action + return None, None + def init(instance): instance.registerUtil('is_history_ok', is_history_ok) instance.registerUtil('is_coordinator', is_coordinator) + instance.registerUtil('issueid_and_action_from_class', + issueid_and_action_from_class) Index: html/msg.item.html =================================================================== --- html/msg.item.html (revision 88842) +++ html/msg.item.html (working copy) @@ -124,6 +124,27 @@ + +
+ + + +

This message is linked to : +

+
+ + +

This message has been unlinked from : +

+ + + + Index: html/file.item.html =================================================================== --- html/file.item.html (revision 88842) +++ html/file.item.html (working copy) @@ -81,6 +81,27 @@ + +
+ + + +

This file is linked to : +

+ + + +

This file has been unlinked from : +

+ + + + Index: html/issue.item.html =================================================================== --- html/issue.item.html (revision 88843) +++ html/issue.item.html (working copy) @@ -240,7 +240,6 @@ Uploaded Description Edit - Remove @@ -258,14 +257,6 @@
review - -
- - - -
- @@ -321,14 +312,6 @@ Date: - -
- - - -
-