X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/f5ea2a9375e9fb6fc8dc0720395e761ddd3c11c0..fb083109b84a9f198b4949892b0b816801e1d196:/projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.cpp diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.cpp b/projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.cpp index 0607db6f..b1564406 100644 --- a/projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.cpp +++ b/projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.cpp @@ -114,6 +114,7 @@ void GET_TARIFFS::CreateAnswer() "tariffConf.free) + "\"/>" + "tariffConf.traffType) + "\"/>" + "tariffConf.period) + "\"/>" + + "tariffConf.changePolicy) + "\"/>" + ""; } @@ -170,7 +171,9 @@ int CHG_TARIFF::Start(void *, const char * el, const char ** attr) { if (strcasecmp(el, m_tag.c_str()) == 0) { - td.tariffConf.name = attr[1]; + const TARIFF * tariff = m_tariffs.FindByName(attr[1]); + if (tariff != NULL) + td = tariff->GetTariffData(); return 0; } } @@ -288,6 +291,12 @@ int CHG_TARIFF::Start(void *, const char * el, const char ** attr) td.tariffConf.period = TARIFF::StringToPeriod(attr[1]); return 0; } + + if (strcasecmp(el, "ChangePolicy") == 0) + { + td.tariffConf.changePolicy = TARIFF::StringToChangePolicy(attr[1]); + return 0; + } } return -1; }