]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.cpp
Ticket 37. The stgTime argument added in TariffChangeIsAllowed()
[stg.git] / projects / stargazer / plugins / configuration / sgconfig / parser_tariffs.cpp
index b2b079978f869cf7a52f32f572deb97853b8870d..daf4ef629af69934e1633f8ea3afdbd9b8b00761 100644 (file)
@@ -115,7 +115,7 @@ void GET_TARIFFS::CreateAnswer()
                   "<TraffType value=\"" + TARIFF::TraffTypeToString(it->tariffConf.traffType) + "\"/>" +
                   "<Period value=\"" + TARIFF::PeriodToString(it->tariffConf.period) + "\"/>" +
                   "<ChangePolicy value=\"" + TARIFF::ChangePolicyToString(it->tariffConf.changePolicy) + "\"/>" +
                   "<TraffType value=\"" + TARIFF::TraffTypeToString(it->tariffConf.traffType) + "\"/>" +
                   "<Period value=\"" + TARIFF::PeriodToString(it->tariffConf.period) + "\"/>" +
                   "<ChangePolicy value=\"" + TARIFF::ChangePolicyToString(it->tariffConf.changePolicy) + "\"/>" +
-                  "<ChangePolicyTimeout value=\"" + x2str(it->tariffConf.changePolicyTimeout) + "\"/>" +
+                  "<ChangePolicyTimeout value=\"" + formatTime(it->tariffConf.changePolicyTimeout) + "\"/>" +
                   "</tariff>";
         }
 
                   "</tariff>";
         }
 
@@ -303,7 +303,7 @@ int CHG_TARIFF::Start(void *, const char * el, const char ** attr)
 
         if (strcasecmp(el, "ChangePolicyTimeout") == 0)
         {
 
         if (strcasecmp(el, "ChangePolicyTimeout") == 0)
         {
-            long int policyTime = 0;
+            int64_t policyTime = 0;
             if (str2x(attr[1], policyTime) == 0)
                 td.tariffConf.changePolicyTimeout = (time_t)policyTime;
             return 0;
             if (str2x(attr[1], policyTime) == 0)
                 td.tariffConf.changePolicyTimeout = (time_t)policyTime;
             return 0;