Fix for company logo image paths

Fixed company logo not loading on non-root-path installations
This commit is contained in:
CatFlip™ committed 2022-05-29 19:33:52 -05:00
1 parent 938b62706d
commit cfa9d88a3b
3 files changed
+11 -5

No files matched your search

+9 -3
View File
@@ -97,7 +97,7 @@ class Service
$query = "SELECT param, value
FROM setting
WHERE param IN('".implode("', '", $params)."')
";
";
$rows = $this->di['db']->getAll($query);
$result = [];
foreach ($rows as $row) {
@@ -128,13 +128,19 @@ class Service
];
$results = $this->_getMultipleParams($c);
$baseurl = $this->di['config']['url'];
$logo_url = $this->di['array_get']($results, 'company_logo', null);
if (null !== $logo_url && false === strpos($logo_url, 'http')) {
$logo_url = $baseurl.$logo_url;
}
return [
'www' => $this->di['config']['url'],
'www' => $baseurl,
'name' => $this->di['array_get']($results, 'company_name', null),
'email' => $this->di['array_get']($results, 'company_email', null),
'tel' => $this->di['array_get']($results, 'company_tel', null),
'signature' => $this->di['array_get']($results, 'company_signature', null),
'logo_url' => $this->di['array_get']($results, 'company_logo', null),
'logo_url' => $logo_url,
'address_1' => $this->di['array_get']($results, 'company_address_1', null),
'address_2' => $this->di['array_get']($results, 'company_address_2', null),
'address_3' => $this->di['array_get']($results, 'company_address_3', null),
+1 -1
View File
@@ -350,7 +350,7 @@ VALUES
(2,'company_name','Company Name',0,NULL,NULL,'2021-01-01 12:00:00','2021-01-01 12:00:00'),
(3,'company_email','company@email.com',0,NULL,NULL,'2021-01-01 12:00:00','2021-01-01 12:00:00'),
(4,'company_signature','FOSSBilling.org - Client Management, Invoice and Support Software',0,NULL,NULL,'2021-01-01 12:00:00','2021-01-01 12:00:00'),
(5,'company_logo','/bb-themes/boxbilling/assets/images/logo.png',0,NULL,NULL,'2021-01-01 12:00:00','2021-01-01 12:00:00'),
(5,'company_logo','bb-themes/boxbilling/assets/images/logo.png',0,NULL,NULL,'2021-01-01 12:00:00','2021-01-01 12:00:00'),
(6,'company_address_1','Demo address line 1',0,NULL,NULL,'2021-01-01 12:00:00','2021-01-01 12:00:00'),
(7,'company_address_2','Demo address line 2',0,NULL,NULL,'2021-01-01 12:00:00','2021-01-01 12:00:00'),
(8,'company_address_3','Demo address line 3',0,NULL,NULL,'2021-01-01 12:00:00','2021-01-01 12:00:00'),
+1 -1
View File
@@ -551,7 +551,7 @@ VALUES
(2,'company_name','Demo FOSSBilling.org',0,NULL,NULL,'2021-01-01 12:00:00','2021-01-01 12:00:00'),
(3,'company_email','my@mycompany.com',0,NULL,NULL,'2021-01-01 12:00:00','2021-01-01 12:00:00'),
(4,'company_signature','FOSSBilling.org - Client Management, Invoice and Support Software',0,NULL,NULL,'2021-01-01 12:00:00','2021-01-01 12:00:00'),
(5,'company_logo','/bb-themes/boxbilling/assets/images/logo.png',0,NULL,NULL,'2021-01-01 12:00:00','2021-01-01 12:00:00'),
(5,'company_logo','bb-themes/boxbilling/assets/images/logo.png',0,NULL,NULL,'2021-01-01 12:00:00','2021-01-01 12:00:00'),
(6,'company_address_1','Demo address line 1',0,NULL,NULL,'2021-01-01 12:00:00','2021-01-01 12:00:00'),
(7,'company_address_2','Demo address line 2',0,NULL,NULL,'2021-01-01 12:00:00','2021-01-01 12:00:00'),
(8,'company_address_3','Demo address line 3',0,NULL,NULL,'2021-01-01 12:00:00','2021-01-01 12:00:00'),