diff --git a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/scripts/archivePublicVersion.xml b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/scripts/archivePublicVersion.xml
deleted file mode 100644
index e0677e73a84b322b133c40411898bcb24e4911c3..0000000000000000000000000000000000000000
--- a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/scripts/archivePublicVersion.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>Script_magic</string> </key>
-            <value> <int>3</int> </value>
-        </item>
-        <item>
-            <key> <string>_bind_names</string> </key>
-            <value>
-              <object>
-                <klass>
-                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
-                </klass>
-                <tuple/>
-                <state>
-                  <dictionary>
-                    <item>
-                        <key> <string>_asgns</string> </key>
-                        <value>
-                          <dictionary>
-                            <item>
-                                <key> <string>name_container</string> </key>
-                                <value> <string>container</string> </value>
-                            </item>
-                            <item>
-                                <key> <string>name_context</string> </key>
-                                <value> <string>context</string> </value>
-                            </item>
-                            <item>
-                                <key> <string>name_m_self</string> </key>
-                                <value> <string>script</string> </value>
-                            </item>
-                            <item>
-                                <key> <string>name_subpath</string> </key>
-                                <value> <string>traverse_subpath</string> </value>
-                            </item>
-                          </dictionary>
-                        </value>
-                    </item>
-                  </dictionary>
-                </state>
-              </object>
-            </value>
-        </item>
-        <item>
-            <key> <string>_body</string> </key>
-            <value> <string>context.archiveVersion(state_change, validation_state=[\'published\', \'published_alive\'])\n
-</string> </value>
-        </item>
-        <item>
-            <key> <string>_params</string> </key>
-            <value> <string>state_change</string> </value>
-        </item>
-        <item>
-            <key> <string>id</string> </key>
-            <value> <string>archivePublicVersion</string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/scripts/archiveReleasedVersion.xml b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/scripts/archiveReleasedVersion.xml
deleted file mode 100644
index 93f3bba07e44689b237df264352e6f99f1faa872..0000000000000000000000000000000000000000
--- a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/scripts/archiveReleasedVersion.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>Script_magic</string> </key>
-            <value> <int>3</int> </value>
-        </item>
-        <item>
-            <key> <string>_bind_names</string> </key>
-            <value>
-              <object>
-                <klass>
-                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
-                </klass>
-                <tuple/>
-                <state>
-                  <dictionary>
-                    <item>
-                        <key> <string>_asgns</string> </key>
-                        <value>
-                          <dictionary>
-                            <item>
-                                <key> <string>name_container</string> </key>
-                                <value> <string>container</string> </value>
-                            </item>
-                            <item>
-                                <key> <string>name_context</string> </key>
-                                <value> <string>context</string> </value>
-                            </item>
-                            <item>
-                                <key> <string>name_m_self</string> </key>
-                                <value> <string>script</string> </value>
-                            </item>
-                            <item>
-                                <key> <string>name_subpath</string> </key>
-                                <value> <string>traverse_subpath</string> </value>
-                            </item>
-                          </dictionary>
-                        </value>
-                    </item>
-                  </dictionary>
-                </state>
-              </object>
-            </value>
-        </item>
-        <item>
-            <key> <string>_body</string> </key>
-            <value> <string>context.archiveVersion(state_change, validation_state=[\'released\', \'released_alive\'])\n
-</string> </value>
-        </item>
-        <item>
-            <key> <string>_params</string> </key>
-            <value> <string>state_change</string> </value>
-        </item>
-        <item>
-            <key> <string>id</string> </key>
-            <value> <string>archiveReleasedVersion</string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/scripts/archiveSharedVersion.xml b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/scripts/archiveSharedVersion.xml
deleted file mode 100644
index 314d01f33fdf079118c7f40c46f3495a4279ca96..0000000000000000000000000000000000000000
--- a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/scripts/archiveSharedVersion.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>Script_magic</string> </key>
-            <value> <int>3</int> </value>
-        </item>
-        <item>
-            <key> <string>_bind_names</string> </key>
-            <value>
-              <object>
-                <klass>
-                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
-                </klass>
-                <tuple/>
-                <state>
-                  <dictionary>
-                    <item>
-                        <key> <string>_asgns</string> </key>
-                        <value>
-                          <dictionary>
-                            <item>
-                                <key> <string>name_container</string> </key>
-                                <value> <string>container</string> </value>
-                            </item>
-                            <item>
-                                <key> <string>name_context</string> </key>
-                                <value> <string>context</string> </value>
-                            </item>
-                            <item>
-                                <key> <string>name_m_self</string> </key>
-                                <value> <string>script</string> </value>
-                            </item>
-                            <item>
-                                <key> <string>name_subpath</string> </key>
-                                <value> <string>traverse_subpath</string> </value>
-                            </item>
-                          </dictionary>
-                        </value>
-                    </item>
-                  </dictionary>
-                </state>
-              </object>
-            </value>
-        </item>
-        <item>
-            <key> <string>_body</string> </key>
-            <value> <string>context.archiveVersion(state_change, validation_state=[\'shared\', \'shared_alive\'])\n
-</string> </value>
-        </item>
-        <item>
-            <key> <string>_params</string> </key>
-            <value> <string>state_change</string> </value>
-        </item>
-        <item>
-            <key> <string>id</string> </key>
-            <value> <string>archiveSharedVersion</string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/scripts/archiveVersion.xml b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/scripts/archiveVersion.xml
index ca1a27329b869c1904e6721612804a19ca1f4153..2ace70cbaa078a877a6fa3d9d7f526fca011d84c 100644
--- a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/scripts/archiveVersion.xml
+++ b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/scripts/archiveVersion.xml
@@ -57,32 +57,35 @@ The previous version is archived automatically.\n
 This will only apply to documents with enough coordinates\n
 (ex. reference, language, version).\n
 """\n
-o = state_change[\'object\']\n
-reference = o.getReference()\n
+document = state_change[\'object\']\n
+reference = document.getReference()\n
 if not reference:\n
   # If this object has no reference, we can not do anything\n
   return\n
 \n
-language = o.getLanguage()\n
+portal = document.getPortalObject()\n
+portal_catalog = portal.portal_catalog\n
+language = document.getLanguage()\n
 if not language:\n
   # If language is None, we have to check is this document\n
   # is language independent. In this case, archival is possible\n
   # But if a document exists with same reference and defined\n
   # language, we can not do anything\n
-  for o in context.portal_catalog(reference=reference, validation_state=validation_state):\n
-    document = o.getObject()\n
-    if not document.getLanguage():\n
-      document.archive()\n
+  for old_document in portal_catalog(reference=reference, validation_state=validation_state):\n
+    old_document = old_document.getObject()\n
+    if not old_document.getLanguage():\n
+      old_document.archive()\n
   return\n
 \n
 # We can now archive all documents with same reference and language in published state\n
-for o in context.portal_catalog(reference=reference, language=language, validation_state=validation_state):\n
-  o.getObject().archive()\n
+for old_document in portal_catalog(reference=reference, language=language, validation_state=validation_state):\n
+  old_document = old_document.getObject()\n
+  old_document.archive()\n
 </string> </value>
         </item>
         <item>
             <key> <string>_params</string> </key>
-            <value> <string>state_change, validation_state=[\'published\', \'published_alive\']</string> </value>
+            <value> <string>state_change, validation_state=[\'published\', \'published_alive\', \'released\', \'released_alive\', \'shared\', \'shared_alive\']</string> </value>
         </item>
         <item>
             <key> <string>id</string> </key>
diff --git a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/transitions/publish.xml b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/transitions/publish.xml
index 855b4b287aa4277377d710a0bfefc0f19709209c..4dbb81708b3217c6c90181510e07c4d92f0bf6ef 100644
--- a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/transitions/publish.xml
+++ b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/transitions/publish.xml
@@ -10,6 +10,10 @@
             <key> <string>actbox_category</string> </key>
             <value> <string>workflow</string> </value>
         </item>
+        <item>
+            <key> <string>actbox_icon</string> </key>
+            <value> <string></string> </value>
+        </item>
         <item>
             <key> <string>actbox_name</string> </key>
             <value> <string></string> </value>
@@ -20,7 +24,7 @@
         </item>
         <item>
             <key> <string>after_script_name</string> </key>
-            <value> <string>archivePublicVersion</string> </value>
+            <value> <string>archiveVersion</string> </value>
         </item>
         <item>
             <key> <string>description</string> </key>
diff --git a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/transitions/publish_alive.xml b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/transitions/publish_alive.xml
index 331d932702a36086263bf1ad3211598c9865565a..13e36df5b98e08a60084501c1b19a230b4f394e6 100644
--- a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/transitions/publish_alive.xml
+++ b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/transitions/publish_alive.xml
@@ -10,6 +10,10 @@
             <key> <string>actbox_category</string> </key>
             <value> <string>workflow</string> </value>
         </item>
+        <item>
+            <key> <string>actbox_icon</string> </key>
+            <value> <string></string> </value>
+        </item>
         <item>
             <key> <string>actbox_name</string> </key>
             <value> <string></string> </value>
@@ -20,7 +24,7 @@
         </item>
         <item>
             <key> <string>after_script_name</string> </key>
-            <value> <string>archivePublicVersion</string> </value>
+            <value> <string>archiveVersion</string> </value>
         </item>
         <item>
             <key> <string>description</string> </key>
diff --git a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/transitions/release.xml b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/transitions/release.xml
index f894de081e1016d544c417d3603eef096ebf9856..c32be40ba01a4ad37bb9ef5c810bcbe3246541c2 100644
--- a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/transitions/release.xml
+++ b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/transitions/release.xml
@@ -10,6 +10,10 @@
             <key> <string>actbox_category</string> </key>
             <value> <string>workflow</string> </value>
         </item>
+        <item>
+            <key> <string>actbox_icon</string> </key>
+            <value> <string></string> </value>
+        </item>
         <item>
             <key> <string>actbox_name</string> </key>
             <value> <string></string> </value>
@@ -20,7 +24,7 @@
         </item>
         <item>
             <key> <string>after_script_name</string> </key>
-            <value> <string>archiveReleasedVersion</string> </value>
+            <value> <string>archiveVersion</string> </value>
         </item>
         <item>
             <key> <string>description</string> </key>
diff --git a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/transitions/release_alive.xml b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/transitions/release_alive.xml
index 18a268dfa7a658cdcadec33a9498a5108dc75b86..3103a89ea2551eb0800d39ddd287f116e51706fa 100644
--- a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/transitions/release_alive.xml
+++ b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/transitions/release_alive.xml
@@ -10,6 +10,10 @@
             <key> <string>actbox_category</string> </key>
             <value> <string>workflow</string> </value>
         </item>
+        <item>
+            <key> <string>actbox_icon</string> </key>
+            <value> <string></string> </value>
+        </item>
         <item>
             <key> <string>actbox_name</string> </key>
             <value> <string></string> </value>
@@ -20,7 +24,7 @@
         </item>
         <item>
             <key> <string>after_script_name</string> </key>
-            <value> <string>archiveReleasedVersion</string> </value>
+            <value> <string>archiveVersion</string> </value>
         </item>
         <item>
             <key> <string>description</string> </key>
diff --git a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/transitions/share.xml b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/transitions/share.xml
index b62aecfea270f9dbf760b115c4ea289c79c83a46..b170ea9617cd0ead1ee9e4f6ff07a0bfe30bbdc4 100644
--- a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/transitions/share.xml
+++ b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/transitions/share.xml
@@ -10,6 +10,10 @@
             <key> <string>actbox_category</string> </key>
             <value> <string>workflow</string> </value>
         </item>
+        <item>
+            <key> <string>actbox_icon</string> </key>
+            <value> <string></string> </value>
+        </item>
         <item>
             <key> <string>actbox_name</string> </key>
             <value> <string></string> </value>
@@ -20,7 +24,7 @@
         </item>
         <item>
             <key> <string>after_script_name</string> </key>
-            <value> <string>archiveSharedVersion</string> </value>
+            <value> <string>archiveVersion</string> </value>
         </item>
         <item>
             <key> <string>description</string> </key>
diff --git a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/transitions/share_alive.xml b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/transitions/share_alive.xml
index b7b8412ba4e9a87a55e8a55c2655434c919e833f..43244198644fe18e1c809b58d998297c1ead8b56 100644
--- a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/transitions/share_alive.xml
+++ b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/transitions/share_alive.xml
@@ -10,6 +10,10 @@
             <key> <string>actbox_category</string> </key>
             <value> <string>workflow</string> </value>
         </item>
+        <item>
+            <key> <string>actbox_icon</string> </key>
+            <value> <string></string> </value>
+        </item>
         <item>
             <key> <string>actbox_name</string> </key>
             <value> <string></string> </value>
@@ -20,7 +24,7 @@
         </item>
         <item>
             <key> <string>after_script_name</string> </key>
-            <value> <string>archiveSharedVersion</string> </value>
+            <value> <string>archiveVersion</string> </value>
         </item>
         <item>
             <key> <string>description</string> </key>
diff --git a/bt5/erp5_dms/bt/change_log b/bt5/erp5_dms/bt/change_log
index e55c484846d57155ca16dcf0e4dd83e01bae95d2..70e3c5af44c597a46a79619dd32d3886b5d13454 100644
--- a/bt5/erp5_dms/bt/change_log
+++ b/bt5/erp5_dms/bt/change_log
@@ -1,3 +1,6 @@
+2011-03-28 Kazuhiko
+* we should have at most only one published/released/shared document for each reference/language, i.e. we should not have both published and released document with the same reference/language at the same time.
+
 2010-07-08 mohamadou
 * revert the last commit, setting permission on this state breaks some sites security.
 
diff --git a/bt5/erp5_dms/bt/revision b/bt5/erp5_dms/bt/revision
index 09c2854e844ed8161fc0aaeb94673754e81fbb63..1280674f38f3c9a2c4d24d841dcab489b38769bc 100644
--- a/bt5/erp5_dms/bt/revision
+++ b/bt5/erp5_dms/bt/revision
@@ -1 +1 @@
-1246
\ No newline at end of file
+1247
\ No newline at end of file