Lisää puhelinnumero yrityksen asetuksiin ja allekirjoituksiin
Puhelinnumero-kenttä yrityksen asetuksissa tallennetaan tietokantaan ja näkyy automaattisesti kaikissa oletusallekirjoituksissa viimeisenä rivinä (sekä SMTP- että Zammad-postilaatikoille). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
6
api.php
6
api.php
@@ -1499,7 +1499,7 @@ switch ($action) {
|
||||
foreach ($allCompanies as $comp) {
|
||||
// Superadmin näkee kaikki yritykset
|
||||
if ($u['role'] === 'superadmin' || in_array($comp['id'], $userCompanies)) {
|
||||
$entry = ['id' => $comp['id'], 'nimi' => $comp['nimi']];
|
||||
$entry = ['id' => $comp['id'], 'nimi' => $comp['nimi'], 'phone' => $comp['phone'] ?? ''];
|
||||
// Merkitse IP-estetyt yritykset (superadmin ohittaa)
|
||||
if ($u['role'] !== 'superadmin' && !isIpAllowed($ip, $comp['allowed_ips'] ?? '')) {
|
||||
$entry['ip_blocked'] = true;
|
||||
@@ -1559,7 +1559,7 @@ switch ($action) {
|
||||
foreach ($allCompanies as $comp) {
|
||||
// Superadmin näkee kaikki yritykset
|
||||
if ($isSuperAdmin || in_array($comp['id'], $userCompanyIds)) {
|
||||
$entry = ['id' => $comp['id'], 'nimi' => $comp['nimi']];
|
||||
$entry = ['id' => $comp['id'], 'nimi' => $comp['nimi'], 'phone' => $comp['phone'] ?? ''];
|
||||
if (!$isSuperAdmin && !isIpAllowed($ip, $comp['allowed_ips'] ?? '')) {
|
||||
$entry['ip_blocked'] = true;
|
||||
} else {
|
||||
@@ -3922,6 +3922,7 @@ switch ($action) {
|
||||
'smtp_from_email' => $mb['smtp_from_email'] ?? $mb['imap_user'] ?? '',
|
||||
'company_id' => $comp['id'],
|
||||
'company_nimi' => $comp['nimi'],
|
||||
'company_phone' => $comp['phone'] ?? '',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -4029,6 +4030,7 @@ switch ($action) {
|
||||
}
|
||||
if (isset($input['primary_color'])) $c['primary_color'] = trim($input['primary_color']);
|
||||
if (isset($input['subtitle'])) $c['subtitle'] = trim($input['subtitle']);
|
||||
if (isset($input['phone'])) $c['phone'] = trim($input['phone']);
|
||||
if (isset($input['enabled_modules']) && is_array($input['enabled_modules'])) {
|
||||
$c['enabled_modules'] = array_values($input['enabled_modules']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user