From 33057acd62356425a8c0003932a6ff671c86cb22 Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Mon, 11 Oct 2010 20:42:49 +0000 Subject: [PATCH] added ticket parser: plugins/ticket/ticketparser.h plugins/ticket/ticketparser.cpp git-svn-id: svn://ttmath.org/publicrep/winix/trunk@663 e52654a7-88a9-db11-a3e9-0013d4bc506e --- core/mounts.cpp | 1 + core/plugin.cpp | 24 +++ core/plugin.h | 3 + core/pluginmsg.h | 5 + functions/emacs.cpp | 3 +- html/fun_reload.html | 9 +- html/stats_info.html | 4 + locale/en | 5 +- locale/pl | 3 +- main/main.cpp | 11 +- plugins/ticket/Makefile.dep | 145 +++++++-------- plugins/ticket/Makefile.o.dep | 2 +- plugins/ticket/init.cpp | 22 +++ plugins/ticket/ticketconf.cpp | 28 +++ plugins/ticket/ticketconf.h | 47 +++++ plugins/ticket/ticketinfo.cpp | 122 ++++++++++++- plugins/ticket/ticketinfo.h | 34 +++- plugins/ticket/ticketparser.cpp | 308 ++++++++++++++++++++++++++++++++ plugins/ticket/ticketparser.h | 56 ++++++ templates/Makefile.dep | 11 +- templates/templates.cpp | 1 + templates/templates.h | 1 + templates/winix.cpp | 18 ++ 23 files changed, 777 insertions(+), 86 deletions(-) create mode 100755 plugins/ticket/ticketconf.cpp create mode 100755 plugins/ticket/ticketconf.h create mode 100755 plugins/ticket/ticketparser.cpp create mode 100755 plugins/ticket/ticketparser.h diff --git a/core/mounts.cpp b/core/mounts.cpp index 46542ba..ee4fd7b 100755 --- a/core/mounts.cpp +++ b/core/mounts.cpp @@ -177,6 +177,7 @@ Error Mounts::ReadMounts(const std::string & mounts) } CalcCurMount(); + plugin.Call(WINIX_FSTAB_CHANGED); return err; } diff --git a/core/plugin.cpp b/core/plugin.cpp index 2b764a5..e8ab9eb 100755 --- a/core/plugin.cpp +++ b/core/plugin.cpp @@ -8,6 +8,7 @@ */ #include +#include #include "plugin.h" #include "pluginmsg.h" @@ -195,6 +196,29 @@ int old_current_plugin; +bool Plugin::HasPlugin(const char * name) +{ + if( *name == 0 ) + return false; + + for(size_t i=0 ; i & plugins); void UnloadPlugins(); + bool HasPlugin(const char * name); + bool HasPlugin(const std::string & name); + void Call(int message); void Call(int message, void * p1_); void Call(int message, void * p1_, void * p2_); diff --git a/core/pluginmsg.h b/core/pluginmsg.h index 8fd5623..35f54c5 100755 --- a/core/pluginmsg.h +++ b/core/pluginmsg.h @@ -59,5 +59,10 @@ // if you do not select it then it will be choosen by winix #define WINIX_SELECT_DEFAULT_FUNCTION 3011 +// /etc/fstab has been changed +// now we have new mount points +#define WINIX_FSTAB_CHANGED 3012 + + #endif diff --git a/functions/emacs.cpp b/functions/emacs.cpp index fcd836d..27f3c0d 100755 --- a/functions/emacs.cpp +++ b/functions/emacs.cpp @@ -107,7 +107,8 @@ void Emacs::MakePost() if( adding ) { - request->is_item = true; + request->is_item = true; // !! moze lepiej nie ustawiac is_item? (bo jak wystapi blad np dodania do bazy danych + // to formularz edycji zmieni sie z 'dodaj' na 'edytuj' request->item.privileges = 0644; // !! tymczasowo, bedzie uzyte umask request->status = system->AddFile(request->item); } diff --git a/html/fun_reload.html b/html/fun_reload.html index bfdfb9e..f079b67 100755 --- a/html/fun_reload.html +++ b/html/fun_reload.html @@ -4,6 +4,13 @@

{reload_select}:

-{reload_templates} + diff --git a/html/stats_info.html b/html/stats_info.html index fce7d29..87af0a5 100755 --- a/html/stats_info.html +++ b/html/stats_info.html @@ -1,3 +1,5 @@ +[if winix_has_plugin "stats"] + + +[end] diff --git a/locale/en b/locale/en index 466efe6..4c43301 100755 --- a/locale/en +++ b/locale/en @@ -119,8 +119,9 @@ priv_change_all = Change subdirectories as well priv_change_current_dir = Change also the current directory reload_header = Reload -reload_select = What to reload: -reload_templates = templates +reload_select = Choose an item to reload +reload_templates = html templates +reload_tickets = tickets config files rm_file_header = Are you sure you want to delete the file? diff --git a/locale/pl b/locale/pl index 892072e..44e88b1 100755 --- a/locale/pl +++ b/locale/pl @@ -122,7 +122,8 @@ priv_change_current_dir = Zmie reload_header = Przeładuj reload_select = Wybierz pozycję -reload_templates = templates +reload_templates = szablony html +reload_tickets = pliki konfiguracyjne ticketów rm_file_header = Czy napewno chcesz usun±ć podan± pozycję? diff --git a/main/main.cpp b/main/main.cpp index 325da79..3b90e6a 100755 --- a/main/main.cpp +++ b/main/main.cpp @@ -33,7 +33,9 @@ void signal_term(int) { plugin.Call(WINIX_CLOSE); app.Close(); - log << log1 << "winix stopped" << logend << logsave; + + log.PutDate(log1); + log << "winix stopped" << logend << logsave; // !! sprawdzic czemu ta flaga zatrzymania nie dzialala // i sprobowac pozbyc sie tego exita tutaj @@ -101,7 +103,8 @@ int main(int argv, char ** argc) signal(SIGTERM, signal_term); signal(SIGINT, signal_term); - log << log1 << "winix started" << logend << logsavenow; + log.PutDate(log1); + log << "winix started" << logend << logsavenow; // !! wywalic to sprawdzanie //log << log2 << "checking for table consistency:" << logend; @@ -112,7 +115,9 @@ int main(int argv, char ** argc) plugin.Call(WINIX_CLOSE); app.Close(); - log << log1 << "winix stopped" << logend << logsave; + + log.PutDate(log1); + log << "winix stopped" << logend << logsave; return 0; } diff --git a/plugins/ticket/Makefile.dep b/plugins/ticket/Makefile.dep index 975596e..faa01af 100755 --- a/plugins/ticket/Makefile.dep +++ b/plugins/ticket/Makefile.dep @@ -3,20 +3,21 @@ createticket.o: createticket.h tdb.h ticket.h ../../db/dbbase.h createticket.o: ../../db/dbconn.h ../../db/dbtextstream.h createticket.o: ../../core/textstream.h ../../core/error.h ../../core/log.h -createticket.o: ticketinfo.h ../../core/item.h ../../core/system.h -createticket.o: ../../core/dirs.h ../../core/item.h ../../core/dircontainer.h -createticket.o: ../../db/db.h ../../db/dbbase.h ../../db/dbitemquery.h -createticket.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h -createticket.o: ../../core/thread.h ../../core/dircontainer.h -createticket.o: ../../core/ugcontainer.h ../../core/request.h -createticket.o: ../../core/requesttypes.h ../../core/session.h -createticket.o: ../../core/error.h ../../core/user.h ../../core/plugindata.h -createticket.o: ../../core/rebus.h ../../core/config.h -createticket.o: ../../core/confparser.h ../../core/htmlfilter.h -createticket.o: ../../core/mounts.h ../../core/mount.h -createticket.o: ../../core/mountparser.h ../../core/users.h -createticket.o: ../../core/ugcontainer.h ../../core/lastcontainer.h -createticket.o: ../../core/groups.h ../../core/group.h ../../core/loadavg.h +createticket.o: ticketinfo.h ticketparser.h ticketconf.h ../../core/item.h +createticket.o: ../../core/system.h ../../core/dirs.h ../../core/item.h +createticket.o: ../../core/dircontainer.h ../../db/db.h ../../db/dbbase.h +createticket.o: ../../db/dbitemquery.h ../../db/dbitemcolumns.h +createticket.o: ../../core/user.h ../../core/group.h ../../core/thread.h +createticket.o: ../../core/dircontainer.h ../../core/ugcontainer.h +createticket.o: ../../core/request.h ../../core/requesttypes.h +createticket.o: ../../core/session.h ../../core/error.h ../../core/user.h +createticket.o: ../../core/plugindata.h ../../core/rebus.h +createticket.o: ../../core/config.h ../../core/confparser.h +createticket.o: ../../core/htmlfilter.h ../../core/mounts.h +createticket.o: ../../core/mount.h ../../core/mountparser.h +createticket.o: ../../core/users.h ../../core/ugcontainer.h +createticket.o: ../../core/lastcontainer.h ../../core/groups.h +createticket.o: ../../core/group.h ../../core/loadavg.h createticket.o: ../../functions/functionbase.h ../../core/request.h createticket.o: ../../core/config.h ../../core/notify.h createticket.o: ../../templatesnotify/templatesnotify.h @@ -42,10 +43,10 @@ createticket.o: ../../functions/upload.h ../../functions/uptime.h createticket.o: ../../functions/who.h ../../core/htmlfilter.h editticket.o: editticket.h tdb.h ticket.h ../../db/dbbase.h ../../db/dbconn.h editticket.o: ../../db/dbtextstream.h ../../core/textstream.h -editticket.o: ../../core/error.h ../../core/log.h ticketinfo.h -editticket.o: ../../core/item.h ../../core/system.h ../../core/dirs.h -editticket.o: ../../core/item.h ../../core/dircontainer.h ../../db/db.h -editticket.o: ../../db/dbbase.h ../../db/dbitemquery.h +editticket.o: ../../core/error.h ../../core/log.h ticketinfo.h ticketparser.h +editticket.o: ticketconf.h ../../core/item.h ../../core/system.h +editticket.o: ../../core/dirs.h ../../core/item.h ../../core/dircontainer.h +editticket.o: ../../db/db.h ../../db/dbbase.h ../../db/dbitemquery.h editticket.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h editticket.o: ../../core/thread.h ../../core/dircontainer.h editticket.o: ../../core/ugcontainer.h ../../core/request.h @@ -81,10 +82,10 @@ editticket.o: ../../functions/uptime.h ../../functions/who.h editticket.o: ../../core/htmlfilter.h funticket.o: funticket.h tdb.h ticket.h ../../db/dbbase.h ../../db/dbconn.h funticket.o: ../../db/dbtextstream.h ../../core/textstream.h -funticket.o: ../../core/error.h ../../core/log.h ticketinfo.h -funticket.o: ../../core/item.h ../../core/system.h ../../core/dirs.h -funticket.o: ../../core/item.h ../../core/dircontainer.h ../../db/db.h -funticket.o: ../../db/dbbase.h ../../db/dbitemquery.h +funticket.o: ../../core/error.h ../../core/log.h ticketinfo.h ticketparser.h +funticket.o: ticketconf.h ../../core/item.h ../../core/system.h +funticket.o: ../../core/dirs.h ../../core/item.h ../../core/dircontainer.h +funticket.o: ../../db/db.h ../../db/dbbase.h ../../db/dbitemquery.h funticket.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h funticket.o: ../../core/thread.h ../../core/dircontainer.h funticket.o: ../../core/ugcontainer.h ../../core/request.h @@ -103,17 +104,17 @@ funticket.o: ../../templates/localefilter.h ../../core/locale.h funticket.o: ../../core/system.h init.o: tdb.h ticket.h ../../db/dbbase.h ../../db/dbconn.h init.o: ../../db/dbtextstream.h ../../core/textstream.h ../../core/error.h -init.o: ../../core/log.h funticket.h ticketinfo.h ../../core/item.h -init.o: ../../core/system.h ../../core/dirs.h ../../core/item.h -init.o: ../../core/dircontainer.h ../../db/db.h ../../db/dbbase.h -init.o: ../../db/dbitemquery.h ../../db/dbitemcolumns.h ../../core/user.h -init.o: ../../core/group.h ../../core/thread.h ../../core/dircontainer.h -init.o: ../../core/ugcontainer.h ../../core/request.h -init.o: ../../core/requesttypes.h ../../core/session.h ../../core/error.h -init.o: ../../core/user.h ../../core/plugindata.h ../../core/rebus.h -init.o: ../../core/config.h ../../core/confparser.h ../../core/htmlfilter.h -init.o: ../../core/mounts.h ../../core/mount.h ../../core/mountparser.h -init.o: ../../core/users.h ../../core/ugcontainer.h +init.o: ../../core/log.h funticket.h ticketinfo.h ticketparser.h ticketconf.h +init.o: ../../core/item.h ../../core/system.h ../../core/dirs.h +init.o: ../../core/item.h ../../core/dircontainer.h ../../db/db.h +init.o: ../../db/dbbase.h ../../db/dbitemquery.h ../../db/dbitemcolumns.h +init.o: ../../core/user.h ../../core/group.h ../../core/thread.h +init.o: ../../core/dircontainer.h ../../core/ugcontainer.h +init.o: ../../core/request.h ../../core/requesttypes.h ../../core/session.h +init.o: ../../core/error.h ../../core/user.h ../../core/plugindata.h +init.o: ../../core/rebus.h ../../core/config.h ../../core/confparser.h +init.o: ../../core/htmlfilter.h ../../core/mounts.h ../../core/mount.h +init.o: ../../core/mountparser.h ../../core/users.h ../../core/ugcontainer.h init.o: ../../core/lastcontainer.h ../../core/groups.h ../../core/group.h init.o: ../../core/loadavg.h ../../functions/functionbase.h init.o: ../../core/request.h ../../core/config.h ../../core/notify.h @@ -143,42 +144,43 @@ init.o: ../../templates/misc.h ../../templates/patterncacher.h init.o: ../../core/item.h ../../templates/ckeditorgetparser.h init.o: ../../core/httpsimpleparser.h ../../core/log.h init.o: ../../templates/indexpatterns.h ../../core/sessionmanager.h -readticket.o: readticket.h ticket.h ticketinfo.h ../../core/item.h -readticket.o: ../../core/system.h ../../core/dirs.h ../../core/item.h -readticket.o: ../../core/dircontainer.h ../../db/db.h ../../db/dbbase.h -readticket.o: ../../db/dbitemquery.h ../../db/dbitemcolumns.h -readticket.o: ../../core/user.h ../../core/group.h ../../core/thread.h -readticket.o: ../../core/error.h ../../core/log.h ../../core/dircontainer.h -readticket.o: ../../core/ugcontainer.h ../../core/request.h -readticket.o: ../../core/requesttypes.h ../../core/session.h -readticket.o: ../../core/error.h ../../core/user.h ../../core/plugindata.h -readticket.o: ../../core/rebus.h ../../core/config.h ../../core/confparser.h -readticket.o: ../../core/htmlfilter.h ../../core/mounts.h ../../core/mount.h -readticket.o: ../../core/mountparser.h ../../core/users.h -readticket.o: ../../core/ugcontainer.h ../../core/lastcontainer.h -readticket.o: ../../core/groups.h ../../core/group.h ../../core/loadavg.h -readticket.o: tdb.h ../../db/dbbase.h ../../db/dbconn.h -readticket.o: ../../db/dbtextstream.h ../../core/textstream.h -readticket.o: ../../core/request.h +readticket.o: readticket.h ticket.h ticketinfo.h ticketparser.h ticketconf.h +readticket.o: ../../core/item.h ../../core/system.h ../../core/dirs.h +readticket.o: ../../core/item.h ../../core/dircontainer.h ../../db/db.h +readticket.o: ../../db/dbbase.h ../../db/dbitemquery.h +readticket.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h +readticket.o: ../../core/thread.h ../../core/error.h ../../core/log.h +readticket.o: ../../core/dircontainer.h ../../core/ugcontainer.h +readticket.o: ../../core/request.h ../../core/requesttypes.h +readticket.o: ../../core/session.h ../../core/error.h ../../core/user.h +readticket.o: ../../core/plugindata.h ../../core/rebus.h ../../core/config.h +readticket.o: ../../core/confparser.h ../../core/htmlfilter.h +readticket.o: ../../core/mounts.h ../../core/mount.h ../../core/mountparser.h +readticket.o: ../../core/users.h ../../core/ugcontainer.h +readticket.o: ../../core/lastcontainer.h ../../core/groups.h +readticket.o: ../../core/group.h ../../core/loadavg.h tdb.h ../../db/dbbase.h +readticket.o: ../../db/dbconn.h ../../db/dbtextstream.h +readticket.o: ../../core/textstream.h ../../core/request.h tdb.o: tdb.h ticket.h ../../db/dbbase.h ../../db/dbconn.h tdb.o: ../../db/dbtextstream.h ../../core/textstream.h ../../core/error.h tdb.o: ../../core/log.h ../../core/log.h -templates.o: ../../../ezc/src/ezc.h ticketinfo.h ticket.h ../../core/item.h -templates.o: ../../core/system.h ../../core/dirs.h ../../core/item.h -templates.o: ../../core/dircontainer.h ../../db/db.h ../../db/dbbase.h -templates.o: ../../db/dbitemquery.h ../../db/dbitemcolumns.h -templates.o: ../../core/user.h ../../core/group.h ../../core/thread.h -templates.o: ../../core/error.h ../../core/log.h ../../core/dircontainer.h -templates.o: ../../core/ugcontainer.h ../../core/request.h -templates.o: ../../core/requesttypes.h ../../core/session.h -templates.o: ../../core/error.h ../../core/user.h ../../core/plugindata.h -templates.o: ../../core/rebus.h ../../core/config.h ../../core/confparser.h -templates.o: ../../core/htmlfilter.h ../../core/mounts.h ../../core/mount.h -templates.o: ../../core/mountparser.h ../../core/users.h -templates.o: ../../core/ugcontainer.h ../../core/lastcontainer.h -templates.o: ../../core/groups.h ../../core/group.h ../../core/loadavg.h -templates.o: tdb.h ../../db/dbbase.h ../../db/dbconn.h -templates.o: ../../db/dbtextstream.h ../../core/textstream.h editticket.h +templates.o: ../../../ezc/src/ezc.h ticketinfo.h ticket.h ticketparser.h +templates.o: ticketconf.h ../../core/item.h ../../core/system.h +templates.o: ../../core/dirs.h ../../core/item.h ../../core/dircontainer.h +templates.o: ../../db/db.h ../../db/dbbase.h ../../db/dbitemquery.h +templates.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h +templates.o: ../../core/thread.h ../../core/error.h ../../core/log.h +templates.o: ../../core/dircontainer.h ../../core/ugcontainer.h +templates.o: ../../core/request.h ../../core/requesttypes.h +templates.o: ../../core/session.h ../../core/error.h ../../core/user.h +templates.o: ../../core/plugindata.h ../../core/rebus.h ../../core/config.h +templates.o: ../../core/confparser.h ../../core/htmlfilter.h +templates.o: ../../core/mounts.h ../../core/mount.h ../../core/mountparser.h +templates.o: ../../core/users.h ../../core/ugcontainer.h +templates.o: ../../core/lastcontainer.h ../../core/groups.h +templates.o: ../../core/group.h ../../core/loadavg.h tdb.h ../../db/dbbase.h +templates.o: ../../db/dbconn.h ../../db/dbtextstream.h +templates.o: ../../core/textstream.h editticket.h templates.o: ../../functions/functionbase.h ../../core/request.h templates.o: ../../core/config.h ../../core/notify.h templates.o: ../../templatesnotify/templatesnotify.h ../../core/mount.h @@ -209,9 +211,11 @@ templates.o: ../../templates/patterncacher.h ../../core/item.h templates.o: ../../templates/ckeditorgetparser.h templates.o: ../../core/httpsimpleparser.h ../../core/log.h templates.o: ../../templates/indexpatterns.h ../../core/sessionmanager.h -ticketinfo.o: ticketinfo.h ticket.h ../../core/item.h ../../core/system.h -ticketinfo.o: ../../core/dirs.h ../../core/item.h ../../core/dircontainer.h -ticketinfo.o: ../../db/db.h ../../db/dbbase.h ../../db/dbitemquery.h +ticketconf.o: ticketconf.h +ticketinfo.o: ticketinfo.h ticket.h ticketparser.h ticketconf.h +ticketinfo.o: ../../core/item.h ../../core/system.h ../../core/dirs.h +ticketinfo.o: ../../core/item.h ../../core/dircontainer.h ../../db/db.h +ticketinfo.o: ../../db/dbbase.h ../../db/dbitemquery.h ticketinfo.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h ticketinfo.o: ../../core/thread.h ../../core/error.h ../../core/log.h ticketinfo.o: ../../core/dircontainer.h ../../core/ugcontainer.h @@ -224,4 +228,5 @@ ticketinfo.o: ../../core/users.h ../../core/ugcontainer.h ticketinfo.o: ../../core/lastcontainer.h ../../core/groups.h ticketinfo.o: ../../core/group.h ../../core/loadavg.h tdb.h ../../db/dbbase.h ticketinfo.o: ../../db/dbconn.h ../../db/dbtextstream.h -ticketinfo.o: ../../core/textstream.h +ticketinfo.o: ../../core/textstream.h ../../core/log.h +ticketparser.o: ticketparser.h ticketconf.h ../../core/log.h diff --git a/plugins/ticket/Makefile.o.dep b/plugins/ticket/Makefile.o.dep index 280d82d..0fd39b5 100755 --- a/plugins/ticket/Makefile.o.dep +++ b/plugins/ticket/Makefile.o.dep @@ -1 +1 @@ -o = createticket.o editticket.o funticket.o init.o readticket.o tdb.o templates.o ticketinfo.o +o = createticket.o editticket.o funticket.o init.o readticket.o tdb.o templates.o ticketconf.o ticketinfo.o ticketparser.o diff --git a/plugins/ticket/init.cpp b/plugins/ticket/init.cpp index 2ad7d7e..9b97c35 100755 --- a/plugins/ticket/init.cpp +++ b/plugins/ticket/init.cpp @@ -55,6 +55,8 @@ void AddMounts(PluginInfo & info) ticket_info.mount_type_ticket = m.AddMountType("ticket"); ticket_info.mount_par_ticket = m.AddMountPar("ticket"); + ticket_info.mount_par_ticket_conf = m.AddMountPar("ticket_conf"); + ticket_info.mount_par_ticket_type = m.AddMountPar("ticket_type"); ticket_info.mount_par_ticket_type_default = m.AddMountPar("ticket_type_default"); ticket_info.mount_par_ticket_status = m.AddMountPar("ticket_status"); @@ -69,6 +71,24 @@ void AddMounts(PluginInfo & info) } + + +void FstabChanged(PluginInfo & info) +{ + ticket_info.ReadTicketConf(true); +} + + +void ContentMake(PluginInfo & info) +{ + if( info.request->function == &info.functions->fun_reload ) + { + if( info.request->IsParam("tickets") ) + ticket_info.ReadTicketConf(); + } +} + + void AddEzcFunctions(PluginInfo & info); } // namespace Ticket @@ -83,6 +103,8 @@ using namespace Ticket; plugin.Assign(WINIX_CREATE_FUNCTIONS, AddFunctions); plugin.Assign(WINIX_SELECT_DEFAULT_FUNCTION, SelectDefaultFunction); plugin.Assign(WINIX_ADD_MOUNTS, AddMounts); + plugin.Assign(WINIX_FSTAB_CHANGED, FstabChanged); + plugin.Assign(WINIX_CONTENT_MAKE, ContentMake); tdb.SetConn(info.db->GetConn()); diff --git a/plugins/ticket/ticketconf.cpp b/plugins/ticket/ticketconf.cpp new file mode 100755 index 0000000..98af9c5 --- /dev/null +++ b/plugins/ticket/ticketconf.cpp @@ -0,0 +1,28 @@ +#include +#include "ticketconf.h" + + +TicketConf::TicketItem::TicketItem() +{ + Clear(); +} + + +void TicketConf::TicketItem::Clear() +{ + id = 0; + name.clear(); + type = TypeInteger; + integer_min = std::numeric_limits::min(); + integer_max = std::numeric_limits::max(); + select.clear(); + select_default = 0; +} + +void TicketConf::Clear() +{ + tab.clear(); +} + + + diff --git a/plugins/ticket/ticketconf.h b/plugins/ticket/ticketconf.h new file mode 100755 index 0000000..f9dc643 --- /dev/null +++ b/plugins/ticket/ticketconf.h @@ -0,0 +1,47 @@ +#ifndef headerfile_winix_plugins_ticket_ticketconf +#define headerfile_winix_plugins_ticket_ticketconf + +#include +#include + + + + +struct TicketConf +{ + struct TicketItem + { + struct Select + { + std::string name; + int id; + }; + + + TicketItem(); + void Clear(); + + enum Type { TypeInteger, TypeSelect }; + + int id; + + std::string name; + Type type; + + // used when type is TypeInteger + int integer_min, integer_max; + + // used when type is TypeSelect + std::vector