Bugzilla – Attachment 148796 Details for
Bug 33350
Show items info several times in notice content
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Allow to show item info several times in notices content
0001-Fix-Bug-33350-Show-items-info-several-times-in-notic.patch (text/plain), 2.56 KB, created by
Adolfo RodrÃguez Taboada
on 2023-03-28 09:25:13 UTC
(
hide
)
Description:
Allow to show item info several times in notices content
Filename:
MIME Type:
Creator:
Adolfo RodrÃguez Taboada
Created:
2023-03-28 09:25:13 UTC
Size:
2.56 KB
patch
obsolete
>From 30e84e5e131a9f67c5f2ff59e5699a77e71475f9 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Adolfo=20Rodr=C3=ADguez?= <adolfo.rodriguez@xercode.es> >Date: Tue, 28 Mar 2023 11:18:47 +0200 >Subject: [PATCH 1/1] Fix - Bug 33350 - Show items info several times in notice > content > >--- > C4/Letters.pm | 39 +++++++++++++++++++++++++++++++-------- > 1 file changed, 31 insertions(+), 8 deletions(-) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index 36d3f5d77e..07d0480922 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -635,14 +635,37 @@ sub GetPreparedLetter { > > if ($repeat_enclosing_tags) { > while ( my ($tag, $tag_tables) = each %$repeat_enclosing_tags ) { >- if ( $letter->{content} =~ m!<$tag>(.*)</$tag>!s ) { >- my $subcontent = $1; >- my @lines = map { >- my %subletter = ( title => '', content => $subcontent ); >- _substitute_tables( \%subletter, $_ ); >- $subletter{content}; >- } @$tag_tables; >- $letter->{content} =~ s!<$tag>.*</$tag>!join( "\n", @lines )!se; >+ my @lc_separated_1 = split(/<$tag>/, $letter->{content}); >+ my @lc_separated_final; >+ foreach my $lc1 (@lc_separated_1) { >+ if ( $lc1 =~ m!</$tag>!g) { >+ my @lc_separated_2 = split(/<\/$tag>/, $lc1); >+ foreach my $lc2 (@lc_separated_2) { >+ if ( $lc2 =~ m!"<<.*!g) {push(@lc_separated_final, "<".$tag.">".$lc2."</".$tag.">"); >+ } else { >+ push(@lc_separated_final, $lc2); >+ } >+ } >+ } else { >+ push(@lc_separated_final, $lc1); >+ } >+ } >+ my @letter; >+ if ( $letter->{content} =~ m!<$tag>(.*)</$tag>!s) { >+ foreach my $subcontent (@lc_separated_final) { >+ if ($subcontent =~ m!<$tag>!g) { >+ my @lines = map { >+ my %subletter = ( title => '', content => $subcontent ); >+ _substitute_tables( \%subletter, $_ ); >+ $subletter{content}; >+ } @$tag_tables; >+ push(@letter, @lines); >+ } else { >+ push(@letter, $subcontent); >+ } >+ } >+ my $string_letter = join( "\n", @letter ); >+ $letter->{content} = $string_letter; > } > } > } >-- >2.30.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33350
: 148796