Index: /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/accesscodes.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/accesscodes.py	(revision 6419)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/accesscodes.py	(revision 6420)
@@ -411,5 +411,5 @@
     return code
 
-def fire_transition(access_code, arg, toward=False):
+def fire_transition(access_code, arg, toward=False, comment=None):
     """Fire workflow transition for access code.
 
@@ -424,4 +424,9 @@
     transition id as `arg`, otherwise you must give a transition
     target.
+
+    If `comment` is specified (default is ``None``) the given string
+    will be passed along as transition comment. It will appear in the
+    history of the changed access code. You can use this to place
+    remarks like for which object the access code was used or similar.
 
     :func:`fire_transition` might raise exceptions depending on the
@@ -458,36 +463,46 @@
     info = IWorkflowInfo(ac)
     if toward:
-        info.fireTransitionToward(arg)
+        info.fireTransitionToward(arg, comment=comment)
     else:
-        info.fireTransition(arg)
+        info.fireTransition(arg, comment=comment)
     return True
 
-def invalidate_accesscode(access_code):
+def invalidate_accesscode(access_code, comment=None):
     """Invalidate AccessCode denoted by string ``access_code``.
 
     Fires an appropriate transition to perform the task.
+
+    `comment` is a string that will appear in the access code
+    history.
 
     See :func:`fire_transition` for possible exceptions and their
     meanings.
     """
-    return fire_transition(access_code, 'use')
-
-def disable_accesscode(access_code):
+    return fire_transition(access_code, 'use', comment=comment)
+
+def disable_accesscode(access_code, comment=None):
     """Disable AccessCode denoted by string ``access_code``.
 
     Fires an appropriate transition to perform the task.
+
+    `comment` is a string that will appear in the access code
+    history.
 
     See :func:`fire_transition` for possible exceptions and their
     meanings.
     """
-    return fire_transition(access_code, DISABLED, toward=True)
-
-def reenable_accesscode(access_code):
+    return fire_transition(
+        access_code, DISABLED, toward=True, comment=comment)
+
+def reenable_accesscode(access_code, comment=None):
     """Reenable AccessCode denoted by string ``access_code``.
 
     Fires an appropriate transition to perform the task.
+
+    `comment` is a string that will appear in the access code
+    history.
 
     See :func:`fire_transition` for possible exceptions and their
     meanings.
     """
-    return fire_transition(access_code, 'reenable')
+    return fire_transition(access_code, 'reenable', comment=comment)
Index: /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/workflow.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/workflow.py	(revision 6419)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/workflow.py	(revision 6420)
@@ -119,4 +119,6 @@
     msg = '%s - %s (new state: %s)' % (
         timestamp, event.destination.title, event.destination)
+    if event.comment is not None:
+        msg = '%s, %s' % (msg, event.comment)
     history = IObjectHistory(obj)
     history.addMessage(msg)
