[Rt-commit] rt branch, 5.0/self-service-display-article, repushed

Jim Brandt jbrandt at bestpractical.com
Wed Dec 16 16:22:18 EST 2020


The branch 5.0/self-service-display-article was deleted and repushed:
       was a21dca46386025f495c33686b35cca6bf85a0941
       now c1b7c4c52aecb544574fc6a6f0b58ac2962e125d

1: 67e5fbc322 = 1: 67e5fbc322 Add SelfServiceShowArticleSearch configuration option
2: 1d382799b6 = 2: 1d382799b6 Allow class-level rights to show self service articles
3: 2d3d55a665 = 3: 2d3d55a665 Display article content in a titlebox container
4: a21dca4638 ! 4: c1b7c4c52a Load class show/hide settings for article components
    @@ -71,6 +71,7 @@
     +%   'custom-field',
     +%   'custom-field-'.$CustomField->id,
     +%   'custom-field-'.$CustomFieldName,
    ++%   'article-custom-field',
     +% );
     +% push @classes, 'unset-field' if not $count;
     +% $m->callback( CallbackName => 'ModifyFieldClasses', CustomField => $CustomField,
    @@ -113,7 +114,7 @@
     +    CustomFields => $CustomFields,
     +);
     +
    -+# don't print anything if there is no custom fields
    ++# don't print anything if there are no custom fields
     +return unless $CustomFields->First;
     +$CustomFields->GotoFirstItem;
     +
    @@ -128,7 +129,7 @@
     +        Object       => $Object,
     +    );
     +    if ( $m->comp_exists( $comp ) ) {
    -+        $m->comp( $comp, Object => $value, EscapeHTML => $EscapeHTML );
    ++        $m->comp( $comp, Object => $value );
     +    } else {
     +        $m->out( $m->interp->apply_escapes( $value->Content, 'h' ) );
     +    }
    @@ -140,33 +141,7 @@
     +$CustomFields => $Object->CustomFields
     +$HideEmpty => 0
     +$HideFieldnames => {}
    -+$EscapeHTML => 1
     +</%ARGS>
    -
    -diff --git a/share/html/Elements/ShowCustomFieldText b/share/html/Elements/ShowCustomFieldText
    ---- a/share/html/Elements/ShowCustomFieldText
    -+++ b/share/html/Elements/ShowCustomFieldText
    -@@
    - %#
    - %# END BPS TAGGED BLOCK }}}
    - <%init>
    -- my $content = $Object->LargeContent || $Object->Content;
    -- $content = $m->comp('/Elements/ScrubHTML', Content => $content);
    -- $content =~ s|\n|<br />|g;
    -+my $content = $Object->LargeContent || $Object->Content;
    -+if ($EscapeHTML) {
    -+    RT::Interface::Web::EscapeHTML(\$content);
    -+    $content =~ s|\n|<br />|g;
    -+} else {
    -+    $content = $m->comp('/Elements/ScrubHTML', Content => $content);
    -+    $content =~ s|\n|<br />|g;
    -+}
    - </%init>
    - <%$content|n%>
    - <%ARGS>
    - $Object
    -+$EscapeHTML => 0
    - </%ARGS>
     
     diff --git a/share/html/SelfService/Article/Display.html b/share/html/SelfService/Article/Display.html
     --- a/share/html/SelfService/Article/Display.html
    @@ -180,7 +155,7 @@
     +% my $title = "";
     +% $title = $article->Summary if $include{Summary};
     +<&| /Widgets/TitleBox, title => $title, class => 'article-display-simple', content_class => 'mx-auto width-md' &>
    -+<& /Elements/ShowArticleCustomFields, Object => $article, CustomFields => $custom_fields, HideFieldnames => \%hide_field_names, EscapeHTML => $include{EscapeHTML} &>
    ++<& /Elements/ShowArticleCustomFields, Object => $article, CustomFields => $custom_fields, HideFieldnames => \%hide_field_names &>
      </&>
      </div>
      <%init>
    @@ -201,6 +176,8 @@
     +    $include{"CF-Title-" . $cf->Id} = 1;
     +    $include{"CF-Value-" . $cf->Id} = 1;
     +}
    ++
    ++# Load show/hide settings from class configuration
     +foreach my $key ( keys %include ) {
     +    $include{$key} = not $class->FirstAttribute("Skip-$key");
     +    if ($key =~ /^CF-Value-(\d+)$/ && !$include{$key}) {
    @@ -212,10 +189,10 @@
     +}
     +
     +my $custom_fields = $article->CustomFields;
    -+if (scalar(@exclude_cf_ids)) {
    -+    $custom_fields->Limit(FIELD    => 'id',
    -+                          OPERATOR => 'NOT IN',
    -+                          VALUE    => \@exclude_cf_ids);
    ++if ( scalar(@exclude_cf_ids) ) {
    ++    $custom_fields->Limit( FIELD    => 'id',
    ++                           OPERATOR => 'NOT IN',
    ++                           VALUE    => \@exclude_cf_ids );
     +}
      
      </%init>



More information about the rt-commit mailing list