[CMF-checkins] CVS: CMF/CMFCollector - Collector.py:1.3 CollectorIssue.py:1.4 CollectorPermissions.py:1.2 __init__.py:1.2

Ken Manheimer klm@zope.com
Fri, 12 Oct 2001 10:42:08 -0400


Update of /cvs-repository/CMF/CMFCollector
In directory cvs.zope.org:/tmp/cvs-serv4899

Modified Files:
	Collector.py CollectorIssue.py CollectorPermissions.py 
	__init__.py 
Log Message:
Combining permissions:

  AddCollectorIssueFollowup = AddCollectorIssueComment
                              + AddCollectorIssueArtifact 

... and mixing artifact upload into the commenting procedure.
(Haven't completed that, but want to check in the new CollectorIssue
type info asap, so early adopters don't get sticky obsolete settings
that requires intervention - ie, wiping out the old type objects in
the portal_types tool and rerunning the install_collector method...)


=== CMF/CMFCollector/Collector.py 1.2 => 1.3 ===
                          roles=['Reviewer'],
                          acquire=1)
-    it.manage_permission(AddCollectorIssueComment,
-                         roles=['Reviewer', 'Owner'],
-                         acquire=1)
-    it.manage_permission(AddCollectorIssueArtifact,
+    it.manage_permission(AddCollectorIssueFollowup,
                          roles=['Reviewer', 'Owner'],
                          acquire=1)
     if REQUEST is not None:


=== CMF/CMFCollector/CollectorIssue.py 1.3 => 1.4 ===
                   'name': 'Followup',
                   'action': 'collector_issue_followup_form',
-                  'permissions': (AddCollectorIssueComment,)},
-                 {'id': 'artifacts',
-                  'name': 'Add Artifacts',
-                  'action': 'collector_issue_add_artifact_form',
-                  'permissions': (AddCollectorIssueArtifact,)},
+                  'permissions': (AddCollectorIssueFollowup,)},
                  {'id': 'edit',
                   'name': 'Edit Issue',
                   'action': 'collector_issue_edit_form',
@@ -195,8 +191,8 @@
     def get_transcript(self):
         return self._getOb(TRANSCRIPT_NAME)
     
-    security.declareProtected(AddCollectorIssueComment, 'do_action')
-    def do_action(self, action, comment, attachments=None, assignees=None):
+    security.declareProtected(AddCollectorIssueFollowup, 'do_action')
+    def do_action(self, action, comment, assignees=None):
         """Execute an action, adding comment to the transcript."""
 
         username = str(getSecurityManager().getUser())
@@ -214,7 +210,7 @@
 
         transcript = self.get_transcript()
         self.comment_number = self.comment_number + 1
-        entry_leader = "\n" + self._entry_header(action, username) + "\n"
+        entry_leader = "\n\n" + self._entry_header(action, username) + "\n"
         transcript._edit('stx',
                          transcript.EditableBody()
                          + entry_leader
@@ -238,22 +234,13 @@
         wftool = getToolByName(self, 'portal_workflow')
         return wftool.getInfoFor(self, 'state', '??')
 
-    security.declareProtected(AddCollectorIssueArtifact, 'add_artifact')
-    def add_artifact(self, id, type, description, file):
-        """Add new artifact, and note in transcript."""
+    def _add_artifact(self, id, type, description, file):
+        """Add new artifact, and return object."""
         self.invokeFactory(type, id)
         it = self._getOb(id)
         it.description = description
         it.manage_upload(file)
-        transcript = self.get_transcript()
-        user = getSecurityManager().getUser()
-        entry_leader = ("\n\n"
-                        + self._entry_header("New Artifact '%s'" % id, user)
-                        + "\n")
-        transcript._edit('stx',
-                         transcript.EditableBody()
-                         + entry_leader
-                         + util.process_comment(description))
+        return it
 
     def _create_transcript(self, description, container,
                            text_format=DEFAULT_TRANSCRIPT_FORMAT):


=== CMF/CMFCollector/CollectorPermissions.py 1.1 => 1.2 ===
 ManageCollector = 'Add portal collector'
 AddCollectorIssue = 'Add collector issue'
-AddCollectorIssueComment = 'Add collector issue comment'
-AddCollectorIssueArtifact = 'Add collector issue artifact'
+AddCollectorIssueFollowup = 'Add collector issue comment'
 EditCollectorIssue = 'Edit collector issue'
 SupportIssue = 'Support collector issue'
 
@@ -17,9 +16,7 @@
                 ('Manager', 'Owner'))
 setDefaultRoles(AddCollectorIssue,
                 ('Anonymous', 'Manager', 'Reviewer', 'Owner'))
-setDefaultRoles(AddCollectorIssueComment,
-                ('Manager', 'Reviewer', 'Owner'))
-setDefaultRoles(AddCollectorIssueArtifact,
+setDefaultRoles(AddCollectorIssueFollowup,
                 ('Manager', 'Reviewer', 'Owner'))
 setDefaultRoles(EditCollectorIssue,
                 ('Manager', 'Reviewer'))


=== CMF/CMFCollector/__init__.py 1.1 => 1.2 ===
                       'action': 'collector_transcript_comment_form',
                       'permissions':
-                      (CollectorPermissions.AddCollectorIssueComment,)},
+                      (CollectorPermissions.AddCollectorIssueFollowup,)},
                      {'id': 'edittranscript',
                       'name': 'Edit Transcript',
                       'action': 'collector_transcript_edit_form',