From d3ea5701baadcdbc6df8775d88f173e52936307a Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 21 Aug 2008 09:49:37 +0000 Subject: Fixed hardcoded CPR in widgetgenerator - yrk. --- server/src/server.cc | 2 +- server/src/widgetgenerator.cc | 4 ++-- server/src/widgetgenerator.h | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'server') diff --git a/server/src/server.cc b/server/src/server.cc index 96c5006..75dc341 100644 --- a/server/src/server.cc +++ b/server/src/server.cc @@ -187,7 +187,7 @@ static std::string handleTransaction(Transaction &transaction) LUAQueryMapper lqm(qp.result); //////////////////////// - answer += widgetgenerator(*m, lqm, db); + answer += widgetgenerator(transaction.cpr, *m, lqm, db); } answer += " \n"; mi2++; diff --git a/server/src/widgetgenerator.cc b/server/src/widgetgenerator.cc index ad9ffc6..26dcf37 100644 --- a/server/src/widgetgenerator.cc +++ b/server/src/widgetgenerator.cc @@ -116,12 +116,12 @@ static void get_fields(Widget &widget, Fieldnames &fields) } } -std::string widgetgenerator(Macro ¯o, LUAQueryMapper &mapper, Database &db) +std::string widgetgenerator(std::string cpr, Macro ¯o, LUAQueryMapper &mapper, Database &db) { Fieldnames fields; get_fields(macro.window, fields); - Values values = db.getValues("2003791613", fields); + Values values = db.getValues(cpr, fields); return send_macro_widget(macro, macro.window, " ", mapper, values); } diff --git a/server/src/widgetgenerator.h b/server/src/widgetgenerator.h index 66d3690..6a27ab0 100644 --- a/server/src/widgetgenerator.h +++ b/server/src/widgetgenerator.h @@ -34,7 +34,8 @@ #include "luaquerymapper.h" #include "database.h" -std::string widgetgenerator(Macro ¯o, +std::string widgetgenerator(std::string cpr, + Macro ¯o, LUAQueryMapper &mapper, Database &db); -- cgit v1.2.3