|
Lines 38-51
return {
Link Here
|
| 38 |
|); |
38 |
|); |
| 39 |
} |
39 |
} |
| 40 |
|
40 |
|
| 41 |
$dbh->do(q| |
41 |
my $contents = $dbh->selectall_arrayref(q|SELECT * FROM additional_contents|, { Slice => {} }); |
| 42 |
UPDATE letter |
42 |
my $sth_update = $dbh->prepare(q| |
| 43 |
SET content = REGEXP_REPLACE(content, '<<\\\\s*opac_news\.', '<<additional_contents.') |
43 |
UPDATE additional_contents |
| 44 |
|); |
44 |
SET content=? |
| 45 |
$dbh->do(q| |
45 |
WHERE idnew=? |
| 46 |
UPDATE letter |
|
|
| 47 |
SET content = REGEXP_REPLACE(content, '\\\\[%\\\\s*opac_news\.', '[% additional_contents.') |
| 48 |
|); |
46 |
|); |
|
|
47 |
for my $c ( @$contents ) { |
| 48 |
my $content = $c->{content}; |
| 49 |
$content =~ s|<<\s*opac_news\.|<<additional_contents.|g; |
| 50 |
$content =~ s|\[%\s*opac_news\.|[% additional_contents.|g; |
| 51 |
$sth_update->execute($content, $c->{idnew}); |
| 52 |
} |
| 49 |
|
53 |
|
| 50 |
$dbh->do(q| |
54 |
$dbh->do(q| |
| 51 |
UPDATE systempreferences |
55 |
UPDATE systempreferences |
|
Lines 82-88
return {
Link Here
|
| 82 |
|); |
86 |
|); |
| 83 |
} |
87 |
} |
| 84 |
|
88 |
|
| 85 |
my $contents = $dbh->selectall_arrayref(q|SELECT * FROM additional_contents|, { Slice => {} }); |
89 |
$sth_update = $dbh->prepare(q| |
|
|
90 |
UPDATE additional_contents |
| 91 |
SET category=?, location=?, lang=? |
| 92 |
WHERE idnew=? |
| 93 |
|); |
| 94 |
|
| 95 |
|
| 96 |
$contents = $dbh->selectall_arrayref(q|SELECT * FROM additional_contents|, { Slice => {} }); |
| 86 |
for my $c ( @$contents ) { |
97 |
for my $c ( @$contents ) { |
| 87 |
my ( $category, $location, $new_lang ); |
98 |
my ( $category, $location, $new_lang ); |
| 88 |
if ( $c->{lang} eq '' ) { |
99 |
if ( $c->{lang} eq '' ) { |
|
Lines 113-124
return {
Link Here
|
| 113 |
|
124 |
|
| 114 |
$new_lang = "default" if $new_lang eq 'en'; # Assume that "en" is "default" |
125 |
$new_lang = "default" if $new_lang eq 'en'; # Assume that "en" is "default" |
| 115 |
|
126 |
|
| 116 |
my $sth_update = $dbh->prepare(q| |
|
|
| 117 |
UPDATE additional_contents |
| 118 |
SET category=?, location=?, lang=? |
| 119 |
WHERE idnew=? |
| 120 |
|); |
| 121 |
|
| 122 |
my $parent_idnew; |
127 |
my $parent_idnew; |
| 123 |
if ( $new_lang ne 'default' ) { |
128 |
if ( $new_lang ne 'default' ) { |
| 124 |
$dbh->do(q| |
129 |
$dbh->do(q| |
| 125 |
- |
|
|