Lines 8-35
return {
Link Here
|
8 |
my ( $dbh, $out ) = @$args{qw(dbh out)}; |
8 |
my ( $dbh, $out ) = @$args{qw(dbh out)}; |
9 |
|
9 |
|
10 |
# Get any existing value from the IntranetReportsHomeHTML system preference |
10 |
# Get any existing value from the IntranetReportsHomeHTML system preference |
11 |
my ($staffreportshomehtml) = $dbh->selectrow_array( |
11 |
my ($staffreportshome) = $dbh->selectrow_array( |
12 |
q| |
12 |
q| |
13 |
SELECT value FROM systempreferences WHERE variable='IntranetReportsHomeHTML'; |
13 |
SELECT value FROM systempreferences WHERE variable='IntranetReportsHomeHTML'; |
14 |
| |
14 |
| |
15 |
); |
15 |
); |
16 |
if ($staffreportshomehtml) { |
16 |
if ($staffreportshome) { |
17 |
|
17 |
|
18 |
$dbh->do( |
18 |
$dbh->do( |
19 |
"INSERT INTO additional_contents ( category, code, location, branchcode, published_on ) VALUES ('html_customizations', 'StaffReportsHomeHTML', 'StaffReportsHomeHTML', NULL, CAST(NOW() AS date) )" |
19 |
"INSERT INTO additional_contents ( category, code, location, branchcode, published_on ) VALUES ('html_customizations', 'StaffReportsHome', 'StaffReportsHome', NULL, CAST(NOW() AS date) )" |
20 |
); |
20 |
); |
21 |
|
21 |
|
22 |
my ($insert_id) = $dbh->selectrow_array( |
22 |
my ($insert_id) = $dbh->selectrow_array( |
23 |
"SELECT id FROM additional_contents WHERE category = 'html_customizations' AND code = 'StaffReportsHomeHTML' AND location = 'StaffReportsHomeHTML' LIMIT 1", |
23 |
"SELECT id FROM additional_contents WHERE category = 'html_customizations' AND code = 'StaffReportsHome' AND location = 'StaffReportsHome' LIMIT 1", |
24 |
{} |
24 |
{} |
25 |
); |
25 |
); |
26 |
|
26 |
|
27 |
$dbh->do( |
27 |
$dbh->do( |
28 |
"INSERT INTO additional_contents_localizations ( additional_content_id, title, content, lang ) VALUES ( ?, 'StaffReportsHomeHTML default', ?, 'default' )", |
28 |
"INSERT INTO additional_contents_localizations ( additional_content_id, title, content, lang ) VALUES ( ?, 'StaffReportsHome default', ?, 'default' )", |
29 |
undef, $insert_id, $staffreportshomehtml |
29 |
undef, $insert_id, $staffreportshome |
30 |
); |
30 |
); |
31 |
|
31 |
|
32 |
say $out "Added 'StaffReportsHomeHTML' HTML customization"; |
32 |
say $out "Added 'StaffReportsHome' HTML customization"; |
33 |
} |
33 |
} |
34 |
|
34 |
|
35 |
# Remove old system preference |
35 |
# Remove old system preference |