]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1534084 - Hide Phablicator requests from Attachment list
authordklawren <dklawren@users.noreply.github.com>
Tue, 19 Mar 2019 22:07:15 +0000 (18:07 -0400)
committerGitHub <noreply@github.com>
Tue, 19 Mar 2019 22:07:15 +0000 (18:07 -0400)
extensions/BugModal/template/en/default/bug_modal/attachments.html.tmpl
extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
extensions/PhabBugz/Extension.pm

index 1e5da5b95411fbb770efb37e566ea2b0f73b2fde..b9291ef3d49e863d7623a8612e5225746ed2849d 100644 (file)
@@ -24,6 +24,7 @@
         [%~ " bz_private" IF attachment.isprivate %]
         [%~ " attach-obsolete" IF attachment.isobsolete %]
         [%~ " attach-patch" IF attachment.can_review %]
+        [%~ " bz_default_hidden" IF phabricator_revisions.size && attachment.contenttype == phabricator_content_type %]
     " [% IF attachment.isobsolete %]style="display:none"[% END %]>
       <td class="attach-desc-td">
         <div class="attach-desc">
index 281a438b898a2209384a4924d752273e85c3ad48..d3d5394267875fccc9d3ee496b26b0afaa656fa8 100644 (file)
@@ -49,6 +49,7 @@
   obsolete_attachments = 0;
   FOREACH attachment IN bug.attachments;
     NEXT IF attachment.isprivate && !(user.is_insider || attachment.attacher.id == user.id);
+    NEXT IF phabricator_revisions.size && attachment.contenttype == phabricator_content_type;
     IF attachment.isobsolete;
       obsolete_attachments = obsolete_attachments + 1;
     ELSE;
index d8d0dce392eec00cd608df31f91a0694ff9e1c43..b62b1989ce6358c1c5d6898ae2fba2edbbc9a974 100644 (file)
@@ -38,6 +38,7 @@ sub template_before_process {
       $active_revision_count++ if !$attachment->isobsolete;
       $has_revisions = 1;
     }
+    $vars->{phabricator_content_type} = PHAB_CONTENT_TYPE;
     $vars->{phabricator_revisions} = $has_revisions;
     $vars->{phabricator_active_revision_count} = $active_revision_count;
   }