[CMF-checkins] CVS: CMF/CMFCollector/skins/collector - collector_issue_comment_header.py:1.1.8.1 collector_issue_contents.pt:1.9.6.1 collector_issue_edit.py:1.7.6.1 collector_issue_edit_form.pt:1.11.6.1 collector_issue_followup_form.pt:1.19.4.1 collector_issue_reject.py:1.1.8.1 collector_issue_up.py:1.1.8.1

Tres Seaver tseaver@zope.com
Thu, 27 Dec 2001 20:00:33 -0500


Update of /cvs-repository/CMF/CMFCollector/skins/collector
In directory cvs.zope.org:/tmp/cvs-serv31472/skins/collector

Modified Files:
      Tag: tseaver-collector_refactoring-branch
	collector_issue_comment_header.py collector_issue_contents.pt 
	collector_issue_edit.py collector_issue_edit_form.pt 
	collector_issue_followup_form.pt collector_issue_reject.py 
	collector_issue_up.py 
Log Message:


  - Collector: Add methods for data access;  modified issue
    skins to use these methods, rather than rely directly on attributes.

  - CollectorIssue:
  
    o Refactored to make its responsibilities clearer, and to enable
      programmatic creation of instances without requiring passed-in
      context.  In particular, added methods for direct management of
      supporters and kibitzers lists to the class (instances should
      *not* depend on a specific workflow implementation to satisfy
      their responsibilities).
    
    o Renamed all attributes to start with leading underscore, to enforce
      use of accessors / mutators (newly added) in skins.

    o Exposed and protected several helper methods, to permit their use
      from skins (where I want to move much of the policy currently
      hard-wired into the class).

    o Added unit tests for new accessor / mutator methods.

  - Assorted skin cleanups:

    o Use 'portal_membership.getAuthenticatedMember()' rather than
      'getSecurityManager...'.

    o Use accessor methods rather than attributes throughout.


=== CMF/CMFCollector/skins/collector/collector_issue_comment_header.py 1.1 => 1.1.8.1 ===
 from DateTime import DateTime
 import string
-user = context.REQUEST.AUTHENTICATED_USER
+member = context.portal_membership.getAuthenticatedMember()
 
 if string.lower(type) == "comment":
     # We number the comments (sequence_number is incremented by add_comment)
@@ -17,5 +17,5 @@
     # ... but don't number the other entries.
     lead = type
 
-return "%s by %s on %s ==>" % (lead, str(user), DateTime().aCommon())
+return "%s by %s on %s ==>" % (lead, member.getUserName(), DateTime().aCommon())
                                 


=== CMF/CMFCollector/skins/collector/collector_issue_contents.pt 1.9 => 1.9.6.1 ===
   <div metal:define-macro="transcript">
 
-    <table tal:define="entries here/action_number;
+    <table tal:define="entries here/getActionNumber;
                        ending python: (entries == 1 and 'y') or 'ies'">
 
       <tr bgcolor="#ccffcc">
         <td colspan="2" align="center">
           <font size="+1">
             <strong>
-              Issue <span tal:replace="here/id">ID</span> Transcript
+              Issue <span tal:replace="here/getId">ID</span> Transcript
             </strong>
           </font>
         </td>


=== CMF/CMFCollector/skins/collector/collector_issue_edit.py 1.7 => 1.7.6.1 ===
 was_security_related = context.security_related
 
+#
+#   XXX:  Move all the "change computation" to this method, simplifying
+#         the actual 'edit' method.
+#
+
 changed = context.edit(title=REQGET('title'),
                        submitter_id=REQGET('submitter_id', None),
                        submitter_name=REQGET('submitter_name', None),


=== CMF/CMFCollector/skins/collector/collector_issue_edit_form.pt 1.11 => 1.11.6.1 ===
-      tal:define="has_edit_priv nocall: here/edit">
+      tal:define="has_edit_priv nocall: here/edit"
+>
   This span ensures that the visitor has edit privilege, by fetching - but
   not displaying - the protected issue.edit method.
 </span>
@@ -22,7 +23,8 @@
 
 </div>
 
-<div metal:fill-slot="main">
+<div metal:fill-slot="main"
+     tal:define="collector nocall: here/aq_parent;" >
 
   <div tal:condition="not: collector_issue_header_present|nothing">
     <!-- Master template has no "header" macro... -->
@@ -37,7 +39,7 @@
       <td>
         <font size="+1">
           <strong>
-            Edit Collector Issue <span tal:replace="here/id"></span>
+            Edit Collector Issue <span tal:replace="here/getId"></span>
           </strong>
         </font>
       </td>
@@ -71,7 +73,7 @@
           <td> ISSUE TITLE </td>
           <td metal:fill-slot="issue_title_slot" colspan="3">
             <input name="title" value="TITLE" size="65"
-                   tal:attributes="value python: here.Title()">
+                   tal:attributes="value here/Title">
           </td>
         </tr>
 
@@ -79,7 +81,7 @@
           <td align="right"> Security Related: </td>
           <td metal:fill-slot="issue_security_slot"> related?
             <input type="checkbox" name="security_related:int" value="1"
-                   tal:attributes="checked here/security_related">
+                   tal:attributes="checked here/getSecurityRelated">
           </td>
         </tr>
 
@@ -87,7 +89,7 @@
           <td> ISSUE DESCRIPTION </td>
           <td metal:fill-slot="issue_description_slot" colspan="3">
             <textarea name="description:text" rows="4" cols="60"
-                      tal:content="here/description">
+                      tal:content="here/Description">
 </textarea>
           </td>
         </tr>
@@ -97,7 +99,7 @@
           <td>
             <span metal:fill-slot="issue_from_slot">
               <input name="submitter_name" value="NAME" size="25"
-                     tal:attributes="value python: here.submitter_name">
+                     tal:attributes="value here/getSubmitterName">
             </span>
           </td>
         </tr>
@@ -107,11 +109,11 @@
           <td>
             <span metal:fill-slot="issue_submitter_id_slot">
               Id: <input name="submitter_id" value="ID" size="12"
-                     tal:attributes="value python: here.submitter_id">
+                     tal:attributes="value here/getSubmitterId">
                 <br>
                   <font size="-1">Alt Email:</font>
                   <input name="submitter_email" value="EMAIL" size="22"
-                         tal:attributes="value here/submitter_email|nothing">
+                        tal:attributes="value here/getSubmitterEmail | nothing">
             </span>
           </td>
         </tr>
@@ -121,7 +123,7 @@
           <td>
             <span metal:fill-slot="issue_submitter_email_slot">
               <input name="submitter_email" value="EMAIL" size="20"
-                     tal:attributes="value python: here.submitter_email or ''">
+                     tal:attributes="value here/getSubmitterEmail | nothing">
             </span>
           </td>
         </tr>
@@ -132,9 +134,9 @@
             <span metal:fill-slot="issue_topic_slot">
               <select name="topic">
                 <option value=""
-                        tal:repeat="it here/aq_parent/topics"
+                        tal:repeat="it collector/listTopics"
                         tal:attributes="value it;
-                                        selected python: here.topic == it"
+                                        selected python: here.getTopic() == it"
                         tal:content="python: it.capitalize()">
                 </option>
               </select>
@@ -148,10 +150,10 @@
             <span metal:fill-slot="issue_classification_slot">
               <select name="classification">
                 <option value=""
-                        tal:repeat="it here/aq_parent/classifications"
+                        tal:repeat="it collector/listClassifications"
                         tal:attributes="value it;
-                                        selected python: here.classification
-                                                         == it"
+                               selected python: here.getClassification() == it;
+                                       "
                         tal:content="python: it.capitalize()">
                 </option>
               </select>
@@ -164,9 +166,10 @@
           <td metal:fill-slot="issue_importance_slot">
             <select name="importance">
               <option value=""
-                      tal:repeat="it here/aq_parent/importances"
+                      tal:repeat="it collector/listImportances"
                       tal:attributes="value it;
-                                      selected python: here.importance == it"
+                                    selected python: here.getImportance() == it;
+                                     "
                       tal:content="python: it.capitalize()">
               </option>
             </select>
@@ -178,7 +181,7 @@
           <td colspan="3"
               metal:fill-slot="issue_version_info_slot">
             <textarea name="version_info" rows="2" cols="40"
-                      tal:content="here/version_info">
+                      tal:content="here/getVersionInfo">
 </textarea>
           </td>
         </tr>
@@ -210,10 +213,10 @@
       <tr>
         <th> Edit Transcript </th>
       </tr>
-      <tr tal:define="transcript here/get_transcript">
+      <tr tal:define="transcript here/getTranscript">
         <td>
           <textarea name="text" rows="10" cols="75" wrap="soft"
-                    tal:content="transcript/text">
+                    tal:content="transcript/EditableBody">
 </textarea>
         </td>
       </tr>


=== CMF/CMFCollector/skins/collector/collector_issue_followup_form.pt 1.19 => 1.19.4.1 ===
       <tr bgcolor="#ccffcc">
         <td NOWRAP colspan="DEPENDS"
-            tal:attributes="colspan python: (here.no_submitter_email() and 1)
-                                            or 3">
+            tal:attributes="colspan python: here.getSubmitterEmail() and 3 or 1;
+                           ">
           <font size="+1">
             <strong>
-              Issue <span tal:replace="here/id">ID</span>
+              Issue <span tal:replace="here/getId">ID</span>
             </strong>
           </font>
         </td>
-        <td tal:condition="here/no_submitter_email" align="right">
+        <td tal:condition="not: here/getSubmitterEmail" align="right">
           <em>
             Note: We have no submitter address, so they won't get followups.
           </em>
@@ -54,7 +54,7 @@
 
       <tr>
         <th align="left" NOWRAP>
-          Entry <span tal:replace="python: here.action_number + 1"></span>
+          Entry <span tal:replace="python: here.getActionNumber() + 1"></span>
         </th>
         <td align="center">
           Click <a href="QUALIFIED" 
@@ -106,7 +106,7 @@
         <td valign="top"
             tal:define="assigning python: [1 for i in actions_pairs
                                              if i[1] == 'Assign'];
-                        supporters here/aq_parent/supporters"
+                        supporters here/aq_parent/listSupporters"
             tal:condition="assigning">
           <select name="assignees:list" MULTIPLE size="5"
                   tal:attributes="size python:
@@ -114,7 +114,7 @@
             <option tal:content="supporter"
                     tal:repeat="supporter supporters"
                     tal:attributes="selected python:
-                    supporter in here.assigned_to()">
+                    supporter in here.listSupporters()">
               SUPPORTER
             </option>
           </select>


=== CMF/CMFCollector/skins/collector/collector_issue_reject.py 1.1 => 1.1.8.1 ===
 ##title=Reject a collector issue
 
+# XXX: Huh?
 context.REQUEST.RESPONSE.redirect(context.absolute_url())
 


=== CMF/CMFCollector/skins/collector/collector_issue_up.py 1.1 => 1.1.8.1 ===
 ##title=Submit a Request
 
+# XXX: Huh?
+
 context.REQUEST.RESPONSE.redirect(context.aq_parent.absolute_url())