Commit 7866b847 authored by Falko Timme's avatar Falko Timme
Browse files

- Replace gender with correct salutation in client messaging.

parent e7e9a525
......@@ -134,4 +134,6 @@ $wb['login_as_txt'] = 'Anmelden als';
$wb['no_domain_perm'] = 'Sie haben keine Berechtigung für diese Domain.';
$wb['no_destination_perm'] = 'Sie haben keine Berechtigung für dieses Ziel.';
$wb['client_you_are_locked'] = 'Sie haben keine Berechtigung, Einstellungen zu verändern.';
$wb['gender_m_txt'] = 'Herr';
$wb['gender_f_txt'] = 'Frau';
?>
......@@ -136,4 +136,6 @@ $wb['login_as_txt'] = 'Log in as';
$wb["no_domain_perm"] = 'You have no permission for this domain.';
$wb["no_destination_perm"] = 'You have no permission for this destination.';
$wb['client_you_are_locked'] = 'You have no permission to change any settings.';
$wb['gender_m_txt'] = 'Mr.';
$wb['gender_f_txt'] = 'Ms.';
?>
......@@ -91,10 +91,15 @@ if(isset($_POST) && count($_POST) > 1) {
//* Parse client details into message
$message = $_POST['message'];
foreach($client as $key => $val) {
if($key != 'password'){
$message = str_replace('{'.$key.'}', $val, $message);
} else {
$message = str_replace('{'.$key.'}', '---', $message);
switch ($key) {
case 'password':
$message = str_replace('{'.$key.'}', '---', $message);
break;
case 'gender':
$message = str_replace('{salutation}', $wb['gender_'.$val.'_txt'], $message);
break;
default:
$message = str_replace('{'.$key.'}', $val, $message);
}
}
......@@ -145,7 +150,13 @@ $sql = "SHOW COLUMNS FROM client WHERE Field NOT IN ('client_id', 'sys_userid',
$field_names = $app->db->queryAllRecords($sql);
if(!empty($field_names) && is_array($field_names)){
foreach($field_names as $field_name){
if($field_name['Field'] != '') $message_variables .= '<a href="javascript:void(0);" class="addPlaceholder">{'.$field_name['Field'].'}</a> ';
if($field_name['Field'] != ''){
if($field_name['Field'] == 'gender'){
$message_variables .= '<a href="javascript:void(0);" class="addPlaceholder">{salutation}</a> ';
} else {
$message_variables .= '<a href="javascript:void(0);" class="addPlaceholder">{'.$field_name['Field'].'}</a> ';
}
}
}
}
$app->tpl->setVar('message_variables',trim($message_variables));
......
......@@ -15,4 +15,6 @@ $wb['recipient_txt'] = 'Empfänger';
$wb['all_clients_resellers_txt'] = 'Alle Kunden und Reseller';
$wb['all_clients_txt'] = 'Alle Kunden';
$wb['variables_txt'] = 'Variablen:';
$wb['gender_m_txt'] = 'Herr';
$wb['gender_f_txt'] = 'Frau';
?>
......@@ -15,4 +15,6 @@ $wb["recipient_txt"] = 'Recipient';
$wb["all_clients_resellers_txt"] = 'All clients and resellers';
$wb["all_clients_txt"] = 'All clients';
$wb["variables_txt"] = 'Variables:';
$wb['gender_m_txt'] = 'Mr.';
$wb['gender_f_txt'] = 'Ms.';
?>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment