]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 675502 - show_bug.cgi ctype=xml should include some more comment information
authorFrank Becker <Frank@Frank-Becker.de>
Fri, 20 Apr 2012 17:56:54 +0000 (10:56 -0700)
committerDave Lawrence <dlawrence@mozilla.com>
Fri, 20 Apr 2012 17:56:54 +0000 (10:56 -0700)
r=dkl, a=LpSolit

template/en/default/bug/show.xml.tmpl
template/en/default/pages/bugzilla.dtd.tmpl

index 05e52256b5d8f10357dd88e28007e1af21c5fbbd..9964cd800f91604976a8ed8b0fbb4efc2044ed96 100644 (file)
       [% PROCESS section_flags obj => bug %]
 
       [% IF displayfields.long_desc %]
+          [% sort_order = user.settings.comment_sort_order.value %]
+          <comment_sort_order>[% sort_order FILTER xml %]</comment_sort_order>  
+          
         [% FOREACH c = bug.comments %]
-          [% NEXT IF c.is_private && !user.is_insider %]
-          <long_desc isprivate="[% c.is_private FILTER xml %]">
-            <commentid>[% c.id FILTER xml %]</commentid>
-            [% IF c.is_about_attachment %]
-              <attachid>[% c.extra_data FILTER xml %]</attachid>
-            [% END %]
-            <who name="[% c.author.name FILTER xml %]">[% c.author.email FILTER email FILTER xml %]</who>
-            <bug_when>[% c.creation_ts FILTER time("%Y-%m-%d %T %z") FILTER xml %]</bug_when>
-            [% IF user.is_timetracker && (c.work_time - 0 != 0) %]
-              <work_time>[% PROCESS formattimeunit time_unit = c.work_time FILTER xml %]</work_time>
-            [% END %]
-            <thetext>[% c.body_full FILTER xml %]</thetext>
-          </long_desc>
+          [% PROCESS a_comment %]
         [% END %]
       [% END %]
       
     />
   [% END %]
 [% END %]
+
+[% BLOCK a_comment %]
+  [% RETURN IF c.is_private && !user.is_insider %]
+  <long_desc isprivate="[% c.is_private FILTER xml %]" >
+    <commentid>[% c.id FILTER xml %]</commentid>
+    <comment_count>[% c.count FILTER xml %]</comment_count>
+    [% IF c.is_about_attachment %]
+      <attachid>[% c.extra_data FILTER xml %]</attachid>
+    [% END %]
+    <who name="[% c.author.name FILTER xml %]">[% c.author.email FILTER email FILTER xml %]</who>
+    <bug_when>[% c.creation_ts FILTER time("%Y-%m-%d %T %z") FILTER xml %]</bug_when>
+    [% IF user.is_timetracker && (c.work_time - 0 != 0) %]
+      <work_time>[% PROCESS formattimeunit time_unit = c.work_time FILTER xml %]</work_time>
+    [% END %]
+    <thetext>[% c.body_full FILTER xml %]</thetext>
+  </long_desc>
+[% END %]
index 4de26859006921733708cae37d0fa4eee80f8ef1..2cf42a151f21983cc390dd85a6d1b7bb50ef1e32 100644 (file)
@@ -56,6 +56,7 @@
                 token?, 
                 group*, 
                 flag*, 
+                comment_sort_order*,
                 long_desc*, 
                 attachment*)?)>
 <!ATTLIST [% "bug" %]
 [% FOREACH field = Bugzilla.active_custom_fields %]
 <!ELEMENT [% field.name FILTER xml %] (#PCDATA)>
 [% END %]
-<!ELEMENT long_desc (commentid, attachid?, who, bug_when, work_time?, thetext)>
+<!ELEMENT comment_sort_order (#PCDATA)>
+<!ELEMENT long_desc (commentid, comment_count, attachid?, who, bug_when, work_time?, thetext)>
 <!ATTLIST long_desc
           isprivate (0|1) #REQUIRED
 >
 <!ELEMENT commentid (#PCDATA)>
+<!ELEMENT comment_count (#PCDATA)>
 <!ELEMENT who (#PCDATA)>
 <!ATTLIST who
           name CDATA #REQUIRED