advotracker: updated localization strings and constants
* update due to customer request * constants * translation strings * disable WIP menu widget * labels used in Email submission Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
@@ -13,7 +13,8 @@ Dictionary (
|
||||
// policycheck_view
|
||||
"Validation policy number": "Prüfung Versicherungsnummer",
|
||||
"Policy number": "Versicherungsnummer",
|
||||
"Policy code": "Policen-Code",
|
||||
"Policy code": "Vers.-Schein/Schadennummer",
|
||||
"Policy holder": "Versicherungsnehmer",
|
||||
"Checklist elements: ": "Prüflistenelemente: ",
|
||||
"Check result": "Prüfungsergebnis",
|
||||
"Importing data": "Importiere Datensätze",
|
||||
@@ -31,11 +32,11 @@ Dictionary (
|
||||
|
||||
// ticketdata_view
|
||||
"Callback number": "Rückrufnummer",
|
||||
"Callback date": "Rückrufdatum",
|
||||
"Callback date": "Erreichbarkeit",
|
||||
"Clear": "Zurücksetzen",
|
||||
"Deductible": "Selbstbehalt",
|
||||
"Harm type": "Schadenstyp",
|
||||
"IVR comment": "IVR Kommentar",
|
||||
"Harm type": "Rechtsproblem",
|
||||
"IVR comment": "Rechtsrat",
|
||||
"Policy holder": "Versicherungsnehmer",
|
||||
"Recipient (To)": "Empfänger (To)",
|
||||
"Copie (CC)": "Kopie (CC)",
|
||||
|
||||
@@ -8,16 +8,17 @@
|
||||
// Component Values (Properties)
|
||||
pub static PROP_ADVOTRACKER: &str = "advotracker";
|
||||
|
||||
pub static PROP_MAIL_CC_1: &str = "advotracker@hiedemann.de";
|
||||
pub static PROP_MAIL_CC_1: &str = "info@hiedemann.de";
|
||||
pub static PROP_MAIL_CC_2: &str = "service@hiedemann.de";
|
||||
pub static PROP_MAIL_BCC_1: &str = "schloemer@hiedemann.de";
|
||||
pub static PROP_MAIL_BCC_2: &str = "support@networkx.de";
|
||||
pub static PROP_MAIL_BCC_1: &str = "Networkx Support <support@networkx.de>";
|
||||
pub static PROP_MAIL_BCC_2: &str = "knoche@hiedemann.de";
|
||||
pub static PROP_MAIL_FROM: &str = "Kanzlei Hiedemann <info@heidemann.de>";
|
||||
pub static PROP_MAIL_REPLY: &str = "Kanzlei Hiedemann <info@heidemann.de>";
|
||||
pub static PROP_MAIL_SUBJECT: &str = "ZMB Allianz - neues Mandat";
|
||||
pub static PROP_MAIL_TO_1: &str = "allianz@ponschab-partner.com";
|
||||
pub static PROP_MAIL_TO_2: &str = "kontakt@chevalier.law";
|
||||
pub static PROP_MAIL_TO_3: &str = "kontakt@metamedlaw.de";
|
||||
pub static PROP_MAIL_TO_4: &str = "sekretariat@m2-mediation.de";
|
||||
pub static PROP_MAIL_FROM: &str = "advotracker@heidemann.de";
|
||||
pub static PROP_MAIL_SUBJECT: &str = "ZMB Allianz - neues Mandat";
|
||||
|
||||
pub static PROP_POLICY_CHECK: &str = "policy_check";
|
||||
pub static PROP_POLICY_PROGRESS_COUNT: &str = "policy_progress_count";
|
||||
@@ -128,6 +129,8 @@ pub static ID_TICKET_DATA_BUTTON_MENU: &str = "ticket_data_button_menu";
|
||||
pub static ID_TICKET_DATA_BUTTON_RESULT: &str = "ticket_data_button_result";
|
||||
pub static ID_TICKET_DATA_CALLBACK_DATE: &str = "ticket_data_label_callback_date";
|
||||
pub static ID_TICKET_DATA_CALLBACK_NUMBER: &str = "ticket_data_label_callback_number";
|
||||
pub static ID_TICKET_DATA_COMBO_BOX_MAIL_CC: &str = "ticket_data_combo_box_mail_cc";
|
||||
pub static ID_TICKET_DATA_COMBO_BOX_MAIL_TO: &str = "ticket_data_combo_box_mail_to";
|
||||
pub static ID_TICKET_DATA_CONTAINER_MAIL: &str = "ticket_data_container_mail";
|
||||
pub static ID_TICKET_DATA_COUNT_BLOCK: &str = "ticket_data_count_block";
|
||||
pub static ID_TICKET_DATA_DEDUCTIBLE: &str = "ticket_data_deductible";
|
||||
|
||||
@@ -113,7 +113,7 @@ pub struct CsvExportRecord {
|
||||
/// Handel fields of an Email (header, body)
|
||||
#[derive(Default, Debug, Clone, Deserialize, Serialize)]
|
||||
pub struct Email {
|
||||
/// recipient address
|
||||
/// Recipient address
|
||||
pub mail_to: String,
|
||||
/// Carbon Copy recipient address
|
||||
pub mail_cc: String,
|
||||
@@ -121,6 +121,8 @@ pub struct Email {
|
||||
pub mail_bcc: String,
|
||||
/// Sender address
|
||||
pub mail_from: String,
|
||||
/// Replay to given address
|
||||
pub mail_reply: String,
|
||||
/// Mail subject
|
||||
pub subject: String,
|
||||
/// Body policy code
|
||||
|
||||
@@ -172,6 +172,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
||||
// type conversion (viperus String -> u64)
|
||||
let test_policy_number = viperus.get::<String>("test_policy_number").unwrap().parse::<u64>().unwrap();
|
||||
trace!(target: "advotracker", test_policy_number = ?test_policy_number);
|
||||
|
||||
// main tasks
|
||||
res = t!("main.started", lang);
|
||||
|
||||
@@ -36,37 +36,36 @@ pub fn sendticketdata(email: &Email, lang: &str) -> Result<(), Box<dyn Error>> {
|
||||
div style="display: flex; flex-direction: column; align-items: center;" {
|
||||
// compose with variables and strings
|
||||
h2 { (email.subject) " (" (email.policy_code) ")" }
|
||||
p { "Policen-Code: " (email.policy_code) }
|
||||
p { "Policen-Code: " (email.policy_code) }
|
||||
p { "Versicherungsnehmer: " (email.policy_holder) }
|
||||
p { "Selbstbehalt: "(email.deductible) }
|
||||
p { "Rückrufnummer: " (email.callback_number) }
|
||||
p { "Rückrufdatum: " (email.callback_date) }
|
||||
p { "Schadenstyp: "(email.harm_type) }
|
||||
p { "IVR Kommentar: "(email.ivr_comment) }
|
||||
p { "Vers.-Schein/Schadennummer: " (email.policy_code) }
|
||||
p { "Versicherungsnehmer: " (email.policy_holder) }
|
||||
p { "Selbstbehalt: "(email.deductible) }
|
||||
p { "Rückrufnummer: " (email.callback_number) }
|
||||
p { "Erreichbarkeit: " (email.callback_date) }
|
||||
p { "Rechtsproblem: "(email.harm_type) }
|
||||
p { "Rechtsrat: "(email.ivr_comment) }
|
||||
}
|
||||
};
|
||||
|
||||
let ascii_body = String::new()
|
||||
+ &"Policen-Code: ".to_string() + &(email.policy_code) + &"\n"
|
||||
+ &"Vers.-Schein/Schadennummer".to_string() + &(email.policy_code) + &"\n"
|
||||
+ &"Versicherungsnehmer: ".to_string() + &(email.policy_holder) + &"\n"
|
||||
+ &"Selbstbehalt: ".to_string() + &(email.deductible) + &"\n"
|
||||
+ &"Rückrufnummer: ".to_string()+ &(email.callback_number) + &"\n"
|
||||
+ &"Rückrufdatum: ".to_string() + &(email.callback_date) + &"\n"
|
||||
+ &"Schadenstyp: ".to_string() + &(email.harm_type) + &"\n"
|
||||
+ &"IVR Kommentar: ".to_string() + &(email.ivr_comment) + &"\n";
|
||||
+ &"Erreichbarkeit: ".to_string() + &(email.callback_date) + &"\n"
|
||||
+ &"Rechtsproblem: ".to_string() + &(email.harm_type) + &"\n"
|
||||
+ &"Rechtsrat: ".to_string() + &(email.ivr_comment) + &"\n";
|
||||
|
||||
info!("email body: {:?}", ascii_body);
|
||||
|
||||
let message = Message::builder()
|
||||
.from((email.mail_from).parse().unwrap())
|
||||
//.reply_to("Support <support@networkx.de>".parse().unwrap())
|
||||
.to("Networkx-Info <info@networkx.de>".parse().unwrap())
|
||||
.cc("Ralf Zerres <ralf.zerres@networkx.de>".parse().unwrap())
|
||||
.reply_to((email.mail_from).parse().unwrap())
|
||||
//.reply_to("Kanzlei Hiedemann <info@hiedemann.de>".parse().unwrap())
|
||||
.to("Kanzlei Hiedemann <info@hiedemann.de>".parse().unwrap())
|
||||
.cc(" <ralf.zerres@networkx.de>".parse().unwrap())
|
||||
.reply_to((email.mail_reply).parse().unwrap())
|
||||
//.to((email.mail_to).parse().unwrap())
|
||||
//.cc((email.mail_cc).parse().unwrap())
|
||||
//.bcc((email.mail_bcc).parse().unwrap())
|
||||
.from((email.mail_from).parse().unwrap())
|
||||
.subject(String::new()
|
||||
+ &email.subject.to_string()
|
||||
+ &" (".to_string()
|
||||
@@ -96,11 +95,14 @@ pub fn sendticketdata(email: &Email, lang: &str) -> Result<(), Box<dyn Error>> {
|
||||
info!("message: {:?}", message);
|
||||
|
||||
// Create credential for remote authentication (username, password)
|
||||
// WIP: get credentials from config file / environment
|
||||
let creds = Credentials::new("ralf.zerres.de@gmail.com".to_string(), "20jacara03".to_string());
|
||||
// WIP: get credentials from config file / cli
|
||||
let creds = Credentials::new("info@kanzlei.hiedemann.de".to_string(), "17info67$".to_string());
|
||||
|
||||
// Open a remote connection to relay server
|
||||
let mailer = SmtpTransport::relay("smtp.gmail.com")
|
||||
|
||||
|
||||
// Open a remote connection to relay server (port 2525)
|
||||
// WIP: get relay address from config file / cli
|
||||
let mailer = SmtpTransport::relay("hiedemannsbs.kanzlei.hiedemann.de")
|
||||
.unwrap()
|
||||
.credentials(creds)
|
||||
.build();
|
||||
|
||||
@@ -15,7 +15,7 @@ use crate::{
|
||||
widgets::configuration::configuration_view::ConfigurationView,
|
||||
widgets::policycheck::policycheck_view::PolicycheckView,
|
||||
widgets::localization::localization_view::LocalizationView,
|
||||
widgets::menu::menu_view::MenuView,
|
||||
//widgets::menu::menu_view::MenuView,
|
||||
widgets::ticketdata::ticketdata_view::TicketdataView,
|
||||
};
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ pub struct PolicycheckState {
|
||||
label_result: Entity,
|
||||
lang: String,
|
||||
policy_data_count: u64,
|
||||
policy_number: Entity,
|
||||
//policy_number: Entity,
|
||||
policy_numbers: HashMap<u64, PolicyCode>,
|
||||
progress_bar: Entity,
|
||||
progress_count: f64,
|
||||
@@ -421,7 +421,7 @@ impl PolicycheckState {
|
||||
}
|
||||
|
||||
/// Update the policy code policy data list.
|
||||
fn update_policy_code(&self, ctx: &mut Context<'_>) {
|
||||
fn update_policy_code(&self, _ctx: &mut Context<'_>) {
|
||||
println!("update internal: policy_code");
|
||||
//let policy_code = ctx.widget().get::<PolicycheckState>(ID_POLICY_CHECK_POLICY_CODE);
|
||||
//ctx.widget().set(PROP_POLICY_DATA_COUNT, policy_code);
|
||||
|
||||
@@ -117,10 +117,12 @@ impl TicketdataState {
|
||||
//mail_to: ctx.child(ID_TICKET_DATA_MAIL_TO).get::<String>("text").to_string(),
|
||||
// WIP: mail_cc -> selected index auslesen
|
||||
//mail_cc: ctx.child(ID_TICKET_DATA_MAIL_CC).get::<String>("text").to_string(),
|
||||
|
||||
mail_to: PROP_MAIL_TO_1.to_string(),
|
||||
mail_cc: PROP_MAIL_CC_1.to_string(),
|
||||
mail_bcc: PROP_MAIL_BCC_1.to_string(),
|
||||
mail_from: PROP_MAIL_FROM.to_string(),
|
||||
mail_reply: PROP_MAIL_REPLY.to_string(),
|
||||
subject: PROP_MAIL_SUBJECT.to_string(),
|
||||
policy_code: ctx.child(ID_TICKET_DATA_POLICY_CODE).get::<String>("text").to_string(),
|
||||
policy_holder: ctx.child(ID_TICKET_DATA_POLICY_HOLDER).get::<String>("text").to_string(),
|
||||
@@ -133,7 +135,11 @@ impl TicketdataState {
|
||||
|
||||
info!("WIP: Sending form to construct eMail to {:?}", email);
|
||||
// send email via service
|
||||
let _ = sendticketdata(&email, &lang);
|
||||
if let Err(e) = sendticketdata(&email, &lang) {
|
||||
Button::icon_brush_set(&mut ctx.child(ID_TICKET_DATA_ACTION_BUTTON_SEND), String::from("#FF0000"));
|
||||
Button::foreground_set(&mut ctx.child(ID_TICKET_DATA_ACTION_BUTTON_SEND), String::from("#FF0000"));
|
||||
Button::icon_set(&mut ctx.child(ID_TICKET_DATA_ACTION_BUTTON_SEND), material_icons_font::MD_CLEAR);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ impl Template for TicketdataView {
|
||||
.build(ctx),
|
||||
)
|
||||
.child(
|
||||
TextBlock::new()
|
||||
TextBox::new()
|
||||
.id(ID_TICKET_DATA_POLICY_CODE)
|
||||
.attach(Grid::row(0))
|
||||
.attach(Grid::column(2))
|
||||
@@ -228,7 +228,7 @@ impl Template for TicketdataView {
|
||||
.attach(Grid::row(10))
|
||||
.attach(Grid::column(2))
|
||||
.text("")
|
||||
.water_mark("Rechtsproblem/Schadenstyp")
|
||||
.water_mark("Schadenstyp")
|
||||
.build(ctx),
|
||||
)
|
||||
.child(
|
||||
@@ -247,7 +247,7 @@ impl Template for TicketdataView {
|
||||
.attach(Grid::row(12))
|
||||
.attach(Grid::column(2))
|
||||
.text("")
|
||||
.water_mark("Rechtsrat / Kommentar zu Haftungs, bzw. Deckung")
|
||||
.water_mark("Kommentar zur Haftung, bzw. zur Deckung")
|
||||
//.height(48.0)
|
||||
.build(ctx),
|
||||
)
|
||||
@@ -319,7 +319,7 @@ impl Template for TicketdataView {
|
||||
)
|
||||
.child(
|
||||
TextBlock::new()
|
||||
.id(ID_TICKET_DATA_MAIL_TO)
|
||||
.id(ID_TICKET_DATA_LABEL_MAIL_TO)
|
||||
.attach(Grid::row(0))
|
||||
.attach(Grid::column(1))
|
||||
.style(STYLE_MAIL_LABEL)
|
||||
@@ -328,7 +328,7 @@ impl Template for TicketdataView {
|
||||
)
|
||||
.child(
|
||||
ComboBox::new()
|
||||
.id(ID_TICKET_DATA_MAIL_TO)
|
||||
.id(ID_TICKET_DATA_COMBO_BOX_MAIL_TO)
|
||||
.attach(Grid::row(0))
|
||||
.attach(Grid::column(3))
|
||||
.style(STYLE_MAIL_TO)
|
||||
|
||||
Reference in New Issue
Block a user