added: to templates: an interface for getting information from Space

miscspace.h, miscspace.cpp
changed: plugin ticket
         now as a config we use a PT::Space struct
         (not finished yet, only 'integer', 'select' and 'progress' are done)


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@794 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
Tomasz Sowa 2012-01-16 10:12:38 +00:00
parent b2d3ca9543
commit 424618de38
33 changed files with 1102 additions and 1164 deletions

View File

@ -233,6 +233,28 @@ Log & Log::operator<<(double s)
}
Log & Log::operator<<(const PT::Space * s)
{
if( current_level <= log_level )
{
buffer << s;
}
return *this;
}
Log & Log::operator<<(const PT::Space & s)
{
if( current_level <= log_level )
{
buffer << s;
}
return *this;
}
Log & Log::operator<<(LogManipulators m)
{

View File

@ -2,7 +2,7 @@
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2008-2011, Tomasz Sowa
* Copyright (c) 2008-2012, Tomasz Sowa
* All rights reserved.
*
*/
@ -43,8 +43,11 @@ public:
Log & operator<<(wchar_t s);
Log & operator<<(size_t s);
Log & operator<<(double s);
Log & operator<<(const PT::Space * space);
Log & operator<<(const PT::Space & space);
Log & operator<<(LogManipulators m);
template<class StringType>
void LogString(const StringType & value, size_t max_size);

View File

@ -382,7 +382,10 @@ size_t Plugin::Size()
}
// !! to nie jest dobre rozwiazanie
// obsluga jednego komunikatu moze wywolac inny komunikat
// i zmienne sie nadpisza
// potrzebujemy cos ala stos wywolan
int Plugin::True()
{
return ret_true;

View File

@ -245,7 +245,7 @@ Error Db::AddItemIntoItem(Item & item)
query.Clear();
query << R("insert into core.item (user_id, modification_user_id, group_id, privileges, "
"date_creation, date_modification, type, parent_id, content_id, "
"link_to, link_redirect, subject, guest_name, template, sort_index, url) values (")
"link_to, link_redirect, subject, guest_name, template, sort_index, meta, url) values (")
<< item.user_id
<< item.modification_user_id
<< item.group_id
@ -260,7 +260,8 @@ Error Db::AddItemIntoItem(Item & item)
<< item.subject
<< item.guest_name
<< item.html_template
<< item.sort_index;
<< item.sort_index
<< item.meta;
url_without_id = AddItemCreateUrlSubject(item);
@ -402,7 +403,7 @@ Error Db::EditItemInItem(Item & item, bool with_url)
query.Clear();
query << R("update core.item set (user_id, modification_user_id, group_id, privileges, "
"date_creation, date_modification, type, link_to, link_redirect, parent_id, subject, "
"guest_name, template, sort_index");
"guest_name, template, sort_index, meta");
if( with_url )
query << R(", url");
@ -421,7 +422,8 @@ Error Db::EditItemInItem(Item & item, bool with_url)
<< item.subject
<< item.guest_name
<< item.html_template
<< item.sort_index;
<< item.sort_index
<< item.meta;
if( with_url )
{

View File

@ -30,7 +30,7 @@
<td>
[if ticket_tab_is_select]
[if ticket_tab_type_is "select"]
<select name="ticketparam[ticket_tab_param_id]">
[for ticket_tab_select_tab]
<option [if ticket_tab_select_tab_is_selected]selected [end]value="[ticket_tab_select_tab_id]">[ticket_tab_select_tab_name]</option>
@ -39,17 +39,17 @@
[end]
[if-one ticket_tab_is_integer ticket_tab_is_progress ticket_tab_is_string]
[if-one ticket_tab_type_is "integer" ticket_tab_type_is "progress" ticket_tab_type_is "string"]
<input type="text" name="ticketparam[ticket_tab_param_id]" value="[ticket_tab_value]">
[end]
[if ticket_tab_is_multistring]
[if ticket_tab_type_is "multistring"]
<textarea name="ticketparam[ticket_tab_param_id]">[ticket_tab_value]</textarea>
[end]
[if ticket_tab_is_images]
[if ticket_tab_type_is "images"]
[for ticket_tab_files_tab]
<img src="[doc_base_url][ticket_tab_value]/-/thumb" alt="[ticket_tab_value]" height="150">
[end]
@ -59,7 +59,7 @@
[end]
[if ticket_tab_is_files]
[if ticket_tab_type_is "files"]
[for ticket_tab_files_tab]
<a href="[doc_base_url][ticket_tab_value]/download">[ticket_tab_value]</a>
[end]

View File

@ -15,7 +15,7 @@
<tr>
<th>{tickets_header_name}</th>
[for ticket_tab]
[if-any-no ticket_tab_is_images ticket_tab_is_files]
[if-any-no ticket_tab_type_is "images" ticket_tab_type_is "files"]
<th>[ticket_tab_param_name]</th>
[end]
[end]
@ -31,8 +31,8 @@
<tr>
<td class="tickettabtitle"><a href="[doc_base_url][dir][tickets_tab_url]">[if-no tickets_tab_subject_empty][tickets_tab_subject][else]&lt;[tickets_tab_url]&gt;[end]</a></td>
[for tickets_tab_conf_tab]
[if-any-no tickets_tab_conf_tab_is_images tickets_tab_conf_tab_is_files]
[if tickets_tab_conf_tab_is_progress]
[if-any-no tickets_tab_conf_tab_type_is "images" tickets_tab_conf_tab_type_is "files"]
[if tickets_tab_conf_tab_type_is "progress"]
<td><img src="[doc_base_url_common]/{ticket_progress_image_path}/progress_[tickets_tab_conf_tab_progress_image_number].gif" alt="progress [tickets_tab_conf_tab_value]%"></td>
[else]
<td>[tickets_tab_conf_tab_value]</td>

View File

@ -11,19 +11,19 @@
<th>[filter fil_firstup][ticket_tab_param_name]:[end]</th>
<td>
[if ticket_tab_is_images]
[if ticket_tab_type_is "images"]
[for ticket_tab_files_tab]
<a href="[doc_base_url][ticket_tab_value]" rel="lightbox\[a\]" class="picture"><img src="[doc_base_url][ticket_tab_value]/-/thumb" alt="[ticket_tab_value]" height="150"></a>
[end]
[end]
[if ticket_tab_is_files]
[if ticket_tab_type_is "files"]
[for ticket_tab_files_tab]
<a href="[doc_base_url][ticket_tab_value]/download">[ticket_tab_value]</a>
[end]
[end]
[if-any-no ticket_tab_is_images ticket_tab_is_files]
[if-any-no ticket_tab_type_is "images" ticket_tab_type_is "files"]
[ticket_tab_value]
[end]

View File

@ -32,8 +32,7 @@ createticket.o: ../../core/crypt.h ../../core/run.h ../../core/users.h
createticket.o: ../../core/groups.h ../../core/group.h ../../core/loadavg.h
createticket.o: ../../core/image.h ../../core/basethread.h
createticket.o: ../../core/threadmanager.h ../../core/synchro.h ticketinfo.h
createticket.o: ticketparser.h ticketconf.h ../../functions/functions.h
createticket.o: ../../functions/functionbase.h
createticket.o: ../../functions/functions.h ../../functions/functionbase.h
createticket.o: ../../functions/functionparser.h ../../core/cur.h
createticket.o: ../../functions/adduser.h ../../functions/cat.h
createticket.o: ../../functions/chmod.h ../../functions/privchanger.h
@ -58,18 +57,17 @@ createticket.o: ../../core/plugindata.h ../../functions/rm.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/misc.h ../../core/item.h ../../core/requesttypes.h
editticket.o: ../../core/error.h ticketinfo.h ticketparser.h ticketconf.h
editticket.o: ../../core/item.h ../../core/system.h ../../core/dirs.h
editticket.o: ../../core/dircontainer.h ../../db/db.h ../../db/dbbase.h
editticket.o: ../../db/dbitemquery.h ../../db/dbitemcolumns.h
editticket.o: ../../core/user.h ../../core/group.h ../../core/dircontainer.h
editticket.o: ../../core/ugcontainer.h ../../core/log.h
editticket.o: ../../core/textstream.h ../../core/logmanipulators.h
editticket.o: ../../core/slog.h ../../core/cur.h ../../core/request.h
editticket.o: ../../core/error.h ../../core/config.h ../../core/htmlfilter.h
editticket.o: ../../templates/htmltextstream.h ../../core/session.h
editticket.o: ../../core/user.h ../../core/plugindata.h ../../core/rebus.h
editticket.o: ../../core/mount.h ../../templates/locale.h
editticket.o: ../../core/error.h ticketinfo.h ../../core/item.h
editticket.o: ../../core/system.h ../../core/dirs.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/dircontainer.h ../../core/ugcontainer.h
editticket.o: ../../core/log.h ../../core/textstream.h
editticket.o: ../../core/logmanipulators.h ../../core/slog.h ../../core/cur.h
editticket.o: ../../core/request.h ../../core/error.h ../../core/config.h
editticket.o: ../../core/htmlfilter.h ../../templates/htmltextstream.h
editticket.o: ../../core/session.h ../../core/user.h ../../core/plugindata.h
editticket.o: ../../core/rebus.h ../../core/mount.h ../../templates/locale.h
editticket.o: ../../notify/notify.h ../../notify/notifypool.h
editticket.o: ../../templates/patterns.h ../../templates/locale.h
editticket.o: ../../templates/localefilter.h ../../../ezc/src/ezc.h
@ -111,18 +109,17 @@ editticket.o: ../../functions/rm.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/misc.h ../../core/item.h ../../core/requesttypes.h
funticket.o: ../../core/error.h ticketinfo.h ticketparser.h ticketconf.h
funticket.o: ../../core/item.h ../../core/system.h ../../core/dirs.h
funticket.o: ../../core/dircontainer.h ../../db/db.h ../../db/dbbase.h
funticket.o: ../../db/dbitemquery.h ../../db/dbitemcolumns.h
funticket.o: ../../core/user.h ../../core/group.h ../../core/dircontainer.h
funticket.o: ../../core/ugcontainer.h ../../core/log.h
funticket.o: ../../core/textstream.h ../../core/logmanipulators.h
funticket.o: ../../core/slog.h ../../core/cur.h ../../core/request.h
funticket.o: ../../core/error.h ../../core/config.h ../../core/htmlfilter.h
funticket.o: ../../templates/htmltextstream.h ../../core/session.h
funticket.o: ../../core/user.h ../../core/plugindata.h ../../core/rebus.h
funticket.o: ../../core/mount.h ../../templates/locale.h
funticket.o: ../../core/error.h ticketinfo.h ../../core/item.h
funticket.o: ../../core/system.h ../../core/dirs.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/dircontainer.h ../../core/ugcontainer.h
funticket.o: ../../core/log.h ../../core/textstream.h
funticket.o: ../../core/logmanipulators.h ../../core/slog.h ../../core/cur.h
funticket.o: ../../core/request.h ../../core/error.h ../../core/config.h
funticket.o: ../../core/htmlfilter.h ../../templates/htmltextstream.h
funticket.o: ../../core/session.h ../../core/user.h ../../core/plugindata.h
funticket.o: ../../core/rebus.h ../../core/mount.h ../../templates/locale.h
funticket.o: ../../notify/notify.h ../../notify/notifypool.h
funticket.o: ../../templates/patterns.h ../../templates/locale.h
funticket.o: ../../templates/localefilter.h ../../../ezc/src/ezc.h
@ -168,33 +165,33 @@ funticket.o: ../../core/sessionmanager.h ../../plugins/thread/pluginmsg.h
init.o: tdb.h ticket.h ../../db/dbbase.h ../../db/dbconn.h
init.o: ../../db/dbtextstream.h ../../core/textstream.h ../../core/misc.h
init.o: ../../core/item.h ../../core/requesttypes.h ../../core/error.h
init.o: funticket.h ticketinfo.h ticketparser.h ticketconf.h
init.o: ../../core/item.h ../../core/system.h ../../core/dirs.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/dircontainer.h ../../core/ugcontainer.h
init.o: ../../core/log.h ../../core/textstream.h ../../core/logmanipulators.h
init.o: ../../core/slog.h ../../core/cur.h ../../core/request.h
init.o: ../../core/error.h ../../core/config.h ../../core/htmlfilter.h
init.o: ../../templates/htmltextstream.h ../../core/session.h
init.o: ../../core/user.h ../../core/plugindata.h ../../core/rebus.h
init.o: ../../core/mount.h ../../templates/locale.h ../../notify/notify.h
init.o: ../../notify/notifypool.h ../../templates/patterns.h
init.o: ../../templates/locale.h ../../templates/localefilter.h
init.o: ../../../ezc/src/ezc.h ../../../ezc/src/generator.h
init.o: ../../../ezc/src/pattern.h ../../../ezc/src/functions.h
init.o: ../../../ezc/src/funinfo.h ../../../ezc/src/stringconv.h
init.o: ../../notify/notifythread.h ../../core/basethread.h
init.o: ../../core/synchro.h ../../notify/templatesnotify.h
init.o: ../../core/config.h ../../core/users.h ../../core/ugcontainer.h
init.o: ../../core/lastcontainer.h ../../templates/misc.h
init.o: ../../templates/htmltextstream.h ../../core/mounts.h
init.o: ../../core/mountparser.h ../../core/crypt.h ../../core/run.h
init.o: ../../core/users.h ../../core/groups.h ../../core/group.h
init.o: ../../core/loadavg.h ../../core/image.h ../../core/basethread.h
init.o: ../../core/threadmanager.h ../../functions/functions.h
init.o: ../../functions/functionbase.h ../../functions/functionparser.h
init.o: ../../core/cur.h ../../functions/adduser.h ../../functions/cat.h
init.o: funticket.h ticketinfo.h ../../core/item.h ../../core/system.h
init.o: ../../core/dirs.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/dircontainer.h
init.o: ../../core/ugcontainer.h ../../core/log.h ../../core/textstream.h
init.o: ../../core/logmanipulators.h ../../core/slog.h ../../core/cur.h
init.o: ../../core/request.h ../../core/error.h ../../core/config.h
init.o: ../../core/htmlfilter.h ../../templates/htmltextstream.h
init.o: ../../core/session.h ../../core/user.h ../../core/plugindata.h
init.o: ../../core/rebus.h ../../core/mount.h ../../templates/locale.h
init.o: ../../notify/notify.h ../../notify/notifypool.h
init.o: ../../templates/patterns.h ../../templates/locale.h
init.o: ../../templates/localefilter.h ../../../ezc/src/ezc.h
init.o: ../../../ezc/src/generator.h ../../../ezc/src/pattern.h
init.o: ../../../ezc/src/functions.h ../../../ezc/src/funinfo.h
init.o: ../../../ezc/src/stringconv.h ../../notify/notifythread.h
init.o: ../../core/basethread.h ../../core/synchro.h
init.o: ../../notify/templatesnotify.h ../../core/config.h ../../core/users.h
init.o: ../../core/ugcontainer.h ../../core/lastcontainer.h
init.o: ../../templates/misc.h ../../templates/htmltextstream.h
init.o: ../../core/mounts.h ../../core/mountparser.h ../../core/crypt.h
init.o: ../../core/run.h ../../core/users.h ../../core/groups.h
init.o: ../../core/group.h ../../core/loadavg.h ../../core/image.h
init.o: ../../core/basethread.h ../../core/threadmanager.h
init.o: ../../functions/functions.h ../../functions/functionbase.h
init.o: ../../functions/functionparser.h ../../core/cur.h
init.o: ../../functions/adduser.h ../../functions/cat.h
init.o: ../../functions/chmod.h ../../functions/privchanger.h
init.o: ../../core/request.h ../../functions/chown.h
init.o: ../../functions/ckeditor.h ../../functions/cp.h
@ -227,8 +224,7 @@ showtickets.o: showtickets.h tdb.h ticket.h ../../db/dbbase.h
showtickets.o: ../../db/dbconn.h ../../db/dbtextstream.h
showtickets.o: ../../core/textstream.h ../../core/misc.h ../../core/item.h
showtickets.o: ../../core/requesttypes.h ../../core/error.h ticketinfo.h
showtickets.o: ticketparser.h ticketconf.h ../../core/item.h
showtickets.o: ../../core/system.h ../../core/dirs.h
showtickets.o: ../../core/item.h ../../core/system.h ../../core/dirs.h
showtickets.o: ../../core/dircontainer.h ../../db/db.h ../../db/dbbase.h
showtickets.o: ../../db/dbitemquery.h ../../db/dbitemcolumns.h
showtickets.o: ../../core/user.h ../../core/group.h ../../core/dircontainer.h
@ -291,24 +287,24 @@ templates.o: ../../../ezc/src/ezc.h ../../../ezc/src/generator.h
templates.o: ../../../ezc/src/pattern.h ../../core/item.h
templates.o: ../../../ezc/src/functions.h ../../../ezc/src/funinfo.h
templates.o: ../../../ezc/src/stringconv.h ticketinfo.h ticket.h
templates.o: ticketparser.h ticketconf.h ../../core/item.h
templates.o: ../../core/system.h ../../core/dirs.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/dircontainer.h ../../core/ugcontainer.h
templates.o: ../../core/log.h ../../core/textstream.h
templates.o: ../../core/logmanipulators.h ../../core/slog.h ../../core/cur.h
templates.o: ../../core/request.h ../../core/requesttypes.h
templates.o: ../../core/error.h ../../core/config.h ../../core/htmlfilter.h
templates.o: ../../templates/htmltextstream.h ../../core/textstream.h
templates.o: ../../core/misc.h ../../core/session.h ../../core/user.h
templates.o: ../../core/plugindata.h ../../core/rebus.h ../../core/mount.h
templates.o: ../../templates/locale.h ../../notify/notify.h
templates.o: ../../notify/notifypool.h ../../templates/patterns.h
templates.o: ../../templates/locale.h ../../templates/localefilter.h
templates.o: ../../notify/notifythread.h ../../core/basethread.h
templates.o: ../../core/synchro.h ../../notify/templatesnotify.h
templates.o: ../../core/config.h ../../core/users.h ../../core/ugcontainer.h
templates.o: ../../core/item.h ../../core/system.h ../../core/dirs.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/dircontainer.h
templates.o: ../../core/ugcontainer.h ../../core/log.h
templates.o: ../../core/textstream.h ../../core/logmanipulators.h
templates.o: ../../core/slog.h ../../core/cur.h ../../core/request.h
templates.o: ../../core/requesttypes.h ../../core/error.h ../../core/config.h
templates.o: ../../core/htmlfilter.h ../../templates/htmltextstream.h
templates.o: ../../core/textstream.h ../../core/misc.h ../../core/session.h
templates.o: ../../core/user.h ../../core/plugindata.h ../../core/rebus.h
templates.o: ../../core/mount.h ../../templates/locale.h
templates.o: ../../notify/notify.h ../../notify/notifypool.h
templates.o: ../../templates/patterns.h ../../templates/locale.h
templates.o: ../../templates/localefilter.h ../../notify/notifythread.h
templates.o: ../../core/basethread.h ../../core/synchro.h
templates.o: ../../notify/templatesnotify.h ../../core/config.h
templates.o: ../../core/users.h ../../core/ugcontainer.h
templates.o: ../../core/lastcontainer.h ../../templates/misc.h
templates.o: ../../templates/htmltextstream.h ../../core/mounts.h
templates.o: ../../core/mountparser.h ../../core/crypt.h ../../core/run.h
@ -345,12 +341,11 @@ templates.o: ../../templates/patterncacher.h ../../templates/indexpatterns.h
templates.o: ../../templates/patterns.h ../../templates/changepatterns.h
templates.o: ../../core/sessionmanager.h sessiondata.h
templates.o: ../../core/plugindata.h ../../functions/rm.h
templates.o: ../../plugins/thread/pluginmsg.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
templates.o: ../../plugins/thread/pluginmsg.h ../../templates/miscspace.h
templates.o: ../../templates/templates.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
ticketinfo.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h
ticketinfo.o: ../../core/dircontainer.h ../../core/ugcontainer.h
ticketinfo.o: ../../core/log.h ../../core/textstream.h
@ -399,5 +394,3 @@ ticketinfo.o: ../../core/htmlfilter.h tdb.h ../../db/dbbase.h
ticketinfo.o: ../../db/dbconn.h ../../db/dbtextstream.h ../../core/error.h
ticketinfo.o: ../../core/log.h ../../core/misc.h sessiondata.h
ticketinfo.o: ../../core/plugindata.h ../../functions/rm.h
ticketparser.o: ticketparser.h ticketconf.h ../../core/log.h
ticketparser.o: ../../core/misc.h

View File

@ -1 +1 @@
o = createticket.o editticket.o funticket.o init.o sessiondata.o showtickets.o tdb.o templates.o ticketconf.o ticketinfo.o ticketparser.o
o = createticket.o editticket.o funticket.o init.o sessiondata.o showtickets.o tdb.o templates.o ticketinfo.o

View File

@ -2,7 +2,7 @@
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2008-2010, Tomasz Sowa
* Copyright (c) 2008-2012, Tomasz Sowa
* All rights reserved.
*
*/
@ -43,7 +43,7 @@ bool CreateTicket::HasAccess()
if( cur->request->is_item || !system->HasWriteAccess(*cur->request->dir_tab.back()) )
return false;
if( !system->mounts.pmount || system->mounts.pmount->type != ticket_info->mount_type_ticket )
if( cur->mount->type != ticket_info->mount_type_ticket )
return false;
return true;
@ -148,9 +148,10 @@ void CreateTicket::MakePost()
Ticket & ticket = PrepareTicket();
Item & item = cur->request->item;
ticket_info->ticket = &ticket;
ticket_info->item = &item;
std::vector<long> & file_map = PrepareFileMap();
ticket_info->ReadTicketParams(ticket, false, &file_map);
ticket_info->ReadTicketParams(ticket, false, file_map, item.meta);
functions->ReadItem(item, Item::file);
if( !cur->request->IsPostVar(L"fileuploadsubmit") )
@ -166,6 +167,7 @@ void CreateTicket::MakeGet()
Ticket & ticket = PrepareTicket();
ticket_info->ticket = &ticket;
ticket_info->item = &cur->request->item;
}

View File

@ -2,7 +2,7 @@
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2008-2010, Tomasz Sowa
* Copyright (c) 2008-2012, Tomasz Sowa
* All rights reserved.
*
*/
@ -47,7 +47,7 @@ bool EditTicket::HasAccess()
if( !cur->request->is_item || !system->HasWriteAccess(cur->request->item) )
return false;
if( !system->mounts.pmount || system->mounts.pmount->type != ticket_info->mount_type_ticket )
if( cur->mount->type != ticket_info->mount_type_ticket )
return false;
return true;
@ -98,6 +98,8 @@ void EditTicket::Submit(Ticket & ticket, Item & item)
{
log << log1 << "EditTicket: problem with editing a ticket, error code: "
<< cur->request->status << logend;
// !! add session log
}
}
@ -111,7 +113,7 @@ void EditTicket::RemoveTmpTicket()
long file_id = cur->request->item.id;
session_data->edit_ticket_map.erase(file_id);
session_data->new_file_map.erase(file_id);
session_data->edit_file_map.erase(file_id);
}
@ -141,7 +143,7 @@ std::vector<long> & EditTicket::PrepareFileMap()
cur->session->plugin_data.Get(ticket_info->plugin_id) );
long file_id = cur->request->item.id;
std::vector<long> & file_map = session_data->GetFileTab(file_id, session_data->new_file_map);
std::vector<long> & file_map = session_data->GetFileTab(file_id, session_data->edit_file_map);
return file_map;
}
@ -149,6 +151,7 @@ return file_map;
void EditTicket::MakePost()
{
ticket_info->Clear();
ticket_info->FindCurrentConf();
Ticket & ticket = PrepareTicket();
@ -156,8 +159,9 @@ void EditTicket::MakePost()
old_url = item.url;
std::vector<long> & file_map = PrepareFileMap();
ticket_info->ticket = &ticket;
ticket_info->item = &item;
ticket_info->ReadTicketParams(ticket, false, &file_map);
ticket_info->ReadTicketParams(ticket, false, file_map, item.meta);
functions->ReadItem(item, Item::file);
if( !cur->request->IsPostVar(L"fileuploadsubmit") )
@ -168,10 +172,12 @@ void EditTicket::MakePost()
void EditTicket::MakeGet()
{
ticket_info->Clear();
ticket_info->FindCurrentConf();
Ticket & ticket = PrepareTicket();
ticket_info->ticket = &ticket;
ticket_info->item = &cur->request->item;
}

View File

@ -47,6 +47,7 @@ void FunTicket::MakeGet()
ticket_info->Clear();
ticket_info->FindCurrentConf();
ticket_info->ticket = &ticket;
ticket_info->item = &cur->request->item;
tdb->GetTicket(cur->request->item.id, ticket);

View File

@ -88,6 +88,9 @@ void ProcessRequest(PluginInfo & info)
void RemoveTicket(PluginInfo & info)
{
// !! dodac nowy komunikat PREPERE_TO_REMOVE
// i tam korzystajac z meta informacji w item
// usunac odpowiednie pliki
const Item * item = reinterpret_cast<Item*>(info.p1);
if( item )

View File

@ -22,7 +22,7 @@ SessionData::SessionData()
SessionData::~SessionData()
{
RemoveFileMap(create_file_map);
RemoveFileMap(new_file_map);
RemoveFileMap(edit_file_map);
}

View File

@ -2,7 +2,7 @@
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010, Tomasz Sowa
* Copyright (c) 2010-2012, Tomasz Sowa
* All rights reserved.
*
*/
@ -48,7 +48,7 @@ struct SessionData : public PluginDataBase
// temporary files for 'editticket' function
// these files should be deleted if a user will not click on the submit button
// !! zmienic nazwe na edit_file_map albo podobnie
FileMap new_file_map;
FileMap edit_file_map;
// inserting and returning a new ticket or just returning the ticket if it exists
@ -56,7 +56,10 @@ struct SessionData : public PluginDataBase
std::vector<long> & GetFileTab(long id, FileMap & file_map);
// for deleting new_file_map files
// for deleting edit_file_map files
// !! IMPROVE ME: when the program exits there can be a situation that
// fun_rm was finished and then an object of this class exits and call fun_rm
// so we should guarantee that all sessions object are removed first
Fun::Rm * fun_rm;
void RemoveFileMap(FileMap & file_map);

View File

@ -82,6 +82,7 @@ void ShowTickets::ReadFiles()
iq.sel_guest_name = true;
iq.sel_privileges = true;
iq.sel_date = true;
iq.sel_meta = true;
iq.WhereParentId(cur->request->dir_tab.back()->id);
iq.WhereType(Item::file);
iq.WhereFileType(WINIX_ITEM_FILETYPE_NONE);

View File

@ -2,7 +2,7 @@
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010, Tomasz Sowa
* Copyright (c) 2010-2012, Tomasz Sowa
* All rights reserved.
*
*/
@ -43,6 +43,24 @@ return is;
}
void TDb::SetTicketColumns(PGresult * r)
{
cfileid = AssertColumn(r, "file_id");
cparam = AssertColumn(r, "param");
cintv = AssertColumn(r, "intv");
cdecv = AssertColumn(r, "decv");
}
void TDb::ReadTicketPar(PGresult * r, Ticket::TicketParam & par, int row)
{
par.Clear();
par.param = AssertValueInt(r, row, cparam);
par.intv = AssertValueLong(r, row, cintv);
AssertValueWide(r, row, cdecv, par.decv); // !! temporarily
}
Error TDb::GetTicket(long file_id, Ticket & ticket)
{
PGresult * r = 0;
@ -53,33 +71,26 @@ Error TDb::GetTicket(long file_id, Ticket & ticket)
{
// they should be sorted by param (they are used in a binary search later)
query.Clear();
query << R("select file_id, param, int_value, str_value from plugins.ticket "
query << R("select file_id, param, intv, decv from plugins.ticket "
"where ticket.file_id=") << file_id << R(" order by param asc;");
r = AssertQuery(query);
AssertResult(r, PGRES_TUPLES_OK);
SetTicketColumns(r);
int rows = Rows(r);
if( rows == 0 )
throw Error(WINIX_ERR_NO_TICKET);
Ticket::TicketParam par;
ticket.file_id = file_id;
int cparam = AssertColumn(r, "param");
int cintvalue = AssertColumn(r, "int_value");
int cstrvalue = AssertColumn(r, "str_value");
if( rows == 0 )
throw Error(WINIX_ERR_NO_TICKET); // !! do we need this kind or error?
// !! mozna dodac uzycie ticket.par_tab.reserve()
if( ticket.par_tab.capacity() < ticket.par_tab.size() + rows )
ticket.par_tab.reserve(ticket.par_tab.size() + rows);
for(int i=0 ; i<rows ; ++i)
{
par.param = AssertValueInt(r, i, cparam);
par.int_value = AssertValueLong(r, i, cintvalue);
AssertValueWide(r, i, cstrvalue, par.str_value);
ticket.par_tab.push_back(par);
ReadTicketPar(r, tic_par, i);
ticket.par_tab.push_back(tic_par);
}
}
catch(const Error & e)
@ -97,11 +108,13 @@ return status;
Error TDb::GetTickets(const std::vector<long> & file_id_tab, std::vector<Ticket> & ticket_tab)
Error TDb::GetTickets(const std::vector<long> & file_id_tab, std::vector<Ticket> & ticket_tab, bool clear_tab)
{
PGresult * r = 0;
Error status = WINIX_ERR_OK;
ticket_tab.clear();
if( clear_tab )
ticket_tab.clear();
if( file_id_tab.empty() )
return status;
@ -111,40 +124,30 @@ Error TDb::GetTickets(const std::vector<long> & file_id_tab, std::vector<Ticket>
// ticket_tab must be sorted by file_id (they are used in a binary search later)
// and items in a ticket should be sorted by param (they are used in a binary search later too)
query.Clear();
CreateIdList(file_id_tab, file_list);
query << R("select file_id, param, int_value, str_value from plugins.ticket "
"where ticket.file_id in ") << R(file_list) << R(" order by file_id, param;");
// !! moze dodac operator <<(std::vector(long)) do query?
query << R("select file_id, param, intv, decv from plugins.ticket "
"where ticket.file_id in ") << file_id_tab << R(" order by file_id, param;");
r = AssertQuery(query);
AssertResult(r, PGRES_TUPLES_OK);
SetTicketColumns(r);
int rows = Rows(r);
Ticket::TicketParam par;
int cfile_id = AssertColumn(r, "file_id");
int cparam = AssertColumn(r, "param");
int cintvalue = AssertColumn(r, "int_value");
int cstrvalue = AssertColumn(r, "str_value");
long last_file_id = -1;
empty_ticket.Clear();
for(int i=0 ; i<rows ; ++i)
{
long file_id = AssertValueLong(r, i, cfile_id);
long file_id = AssertValueLong(r, i, cfileid);
if( i==0 || last_file_id != file_id )
{
ticket_tab.push_back(Ticket());
ticket_tab.push_back(empty_ticket);
ticket_tab.back().file_id = file_id;
last_file_id = file_id;
}
par.param = AssertValueInt(r, i, cparam);
par.int_value = AssertValueLong(r, i, cintvalue);
AssertValueWide(r, i, cstrvalue, par.str_value);
ticket_tab.back().par_tab.push_back(par);
ReadTicketPar(r, tic_par, i);
ticket_tab.back().par_tab.push_back(tic_par);
}
}
catch(const Error & e)
@ -153,7 +156,6 @@ Error TDb::GetTickets(const std::vector<long> & file_id_tab, std::vector<Ticket>
}
ClearResult(r);
file_list.clear();
return status;
}
@ -171,11 +173,11 @@ Error TDb::AddTicket(const Ticket & ticket)
for(size_t i=0 ; i<ticket.par_tab.size() ; ++i)
{
query.Clear();
query << R("insert into plugins.ticket (file_id, param, int_value, str_value) values (")
query << R("insert into plugins.ticket (file_id, param, intv) values (")
<< ticket.file_id
<< ticket.par_tab[i].param
<< ticket.par_tab[i].int_value
<< ticket.par_tab[i].str_value
<< ticket.par_tab[i].intv
//<< ticket.par_tab[i].decv
<< R(");");
r = AssertQuery(query);

View File

@ -2,7 +2,7 @@
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010, Tomasz Sowa
* Copyright (c) 2010-2012, Tomasz Sowa
* All rights reserved.
*
*/
@ -27,7 +27,7 @@ public:
bool IsTicket(long file_id);
Error GetTicket(long file_id, Ticket & ticket);
Error GetTickets(const std::vector<long> & file_id_tab, std::vector<Ticket> & ticket_tab);
Error GetTickets(const std::vector<long> & file_id_tab, std::vector<Ticket> & ticket_tab, bool clear_tab = true);
Error AddTicket(const Ticket & ticket);
Error RemoveAddTicket(const Ticket & ticket); // first removing and then adding a ticket
Error RemoveTicket(long file_id);
@ -36,7 +36,16 @@ public:
private:
DbTextStream query;
std::wstring file_list;
Ticket empty_ticket;
Ticket::TicketParam tic_par;
int cfileid;
int cparam;
int cintv;
int cdecv;
void SetTicketColumns(PGresult * r);
void ReadTicketPar(PGresult * r, Ticket::TicketParam & par, int row);
};

View File

@ -2,7 +2,7 @@
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2008-2010, Tomasz Sowa
* Copyright (c) 2008-2012, Tomasz Sowa
* All rights reserved.
*
*/
@ -18,7 +18,8 @@
#include "templates/templates.h"
#include "sessiondata.h"
#include "plugins/thread/pluginmsg.h"
#include "templates/miscspace.h"
#include "confparser/space.h"
namespace Ticket
@ -47,10 +48,31 @@ return percent;
}
PT::Space & find_add_meta_for_param(PT::Space & meta, long param_id)
{
for(size_t i=0 ; i<meta.spaces.size() ; ++i)
{
PT::Space & sp = *meta.spaces[i];
// !! moze lepiej najpierw zamienic na string i pozniej tylko stringi porownywac (performance)
if( sp.name == L"param" && sp.Long(L"id") == param_id )
{
return sp;
}
}
PT::Space & sp = meta.AddSpace(L"param");
sp.Add(L"id", param_id);
return sp;
}
// binary search for param in ticket.par_tab (ticket.par_tab must be sorted by 'param')
// !! zmienic nazwe na find_ticket_param
bool find_ticket_value(long param, const Ticket & ticket, size_t & ticket_par_index)
bool find_ticket_param(long param, const Ticket & ticket, size_t & ticket_par_index)
{
if( ticket.par_tab.empty() )
return false;
@ -69,6 +91,8 @@ bool find_ticket_value(long param, const Ticket & ticket, size_t & ticket_par_in
if( ticket.par_tab[o2].param == param )
{
// looking for the first param
// (there can be more params with the same 'param' value)
while( o2 > 0 && ticket.par_tab[o2-1].param == param )
--o2;
@ -105,36 +129,38 @@ return false;
void ticket_print_value(Info & i, size_t conf_index, const Ticket::TicketParam & ticket_param)
void ticket_print_value(Info & i, PT::Space & space, const Ticket::TicketParam & ticket_param, PT::Space & meta)
{
if( conf_index < ticket_info.cur_conf->tab.size() )
{
const TicketConf::TicketItem & conf_item = ticket_info.cur_conf->tab[conf_index];
std::wstring & type = space.Text(L"type");
if( conf_item.type == TicketConf::TicketItem::TypeInteger ||
conf_item.type == TicketConf::TicketItem::TypeProgress )
if( type == L"integer" || type == L"progress" )
{
i.out << ticket_param.intv;
}
else
if( type == L"select" )
{
for(size_t a=0 ; a<space.spaces.size() ; ++a)
{
i.out << ticket_param.int_value;
}
else
if( conf_item.type == TicketConf::TicketItem::TypeSelect )
{
if( ticket_param.int_value < (int)conf_item.select.size() )
i.out << conf_item.select[ticket_param.int_value].name;
}
else
if( conf_item.type == TicketConf::TicketItem::TypeString ||
conf_item.type == TicketConf::TicketItem::TypeMultistring )
{
i.out << ticket_param.str_value;
}
else
if( conf_item.type == TicketConf::TicketItem::TypeImages ||
conf_item.type == TicketConf::TicketItem::TypeFiles )
{
i.out << ticket_param.str_value;
PT::Space & sp = *space.spaces[a];
if( sp.name == L"option" && Tol(sp.Text(L"id")) == ticket_param.intv )
{
i.out << sp.Text(L"value");
break;
}
}
}
else
if( type == L"string" || type == L"multistring" )
{
i.out << meta.Text(L"value");
}
else
if( type == L"images" || type == L"files" )
{
i.out << meta.Text(L"value");
}
}
@ -160,7 +186,7 @@ namespace ns_tickets_tab
static size_t item_sort_index; // index for: ticket_info.item_sort_tab
static size_t ticket_index; // index for: ticket_info.ticket_tab
static size_t par_index; // index for: ticket_info.ticket_tab[ticket_index].par_tab
static size_t conf_tab_index; // index for: ticket_info.cur_conf->tab
static size_t conf_tab_index; // index for: ticket_info.cur_conf->spaces
static bool has_ticket;
static bool has_value;
@ -249,6 +275,7 @@ void tickets_tab_subject(Info & i)
}
// !! do czego to w ogole sluzy?
void tickets_tab_has_value(Info & i)
{
if( has_ticket && ticket_index < ticket_info.ticket_tab.size() )
@ -257,37 +284,43 @@ void tickets_tab_has_value(Info & i)
long id = Tol(i.par);
Ticket & ticket = ticket_info.ticket_tab[ticket_index];
if( find_ticket_value(id, ticket, par_index) )
// !! dodac takze sprawdzanie czy jest wartosc w ticket_info.ticket->meta
if( find_ticket_param(id, ticket, par_index) )
i.res = true;
}
}
// !! czy to w ogole jest gdzies uzywane?
void tickets_tab_value_int(Info & i)
{
if( has_ticket && ticket_index < ticket_info.ticket_tab.size() )
{
size_t par_index;
long id = Tol(i.par);
long param = Tol(i.par);
Ticket & ticket = ticket_info.ticket_tab[ticket_index];
if( find_ticket_value(id, ticket, par_index) )
i.out << ticket.par_tab[par_index].int_value;
if( find_ticket_param(param, ticket, par_index) )
i.out << ticket.par_tab[par_index].intv;
}
}
void tickets_tab_value_str(Info & i)
// !! czy to w ogole jest gdzies uzywane?
void tickets_tab_value_meta(Info & i)
{
if( has_ticket && ticket_index < ticket_info.ticket_tab.size() )
if( has_ticket &&
item_sort_index < ticket_info.item_sort_tab.size() &&
ticket_index < ticket_info.ticket_tab.size() )
{
size_t par_index;
long id = Tol(i.par);
Ticket & ticket = ticket_info.ticket_tab[ticket_index];
long param = Tol(i.par);
if( find_ticket_value(id, ticket, par_index) )
i.out << ticket.par_tab[par_index].str_value;
PT::Space & meta = ticket_info.item_sort_tab[item_sort_index]->meta.FindAddSpace(L"ticket");
PT::Space & sp = find_add_meta_for_param(meta, param);
// !! to nie zadziala bo pierwszy parametr w i.par to jest param_id
space(i, sp);
}
}
@ -302,14 +335,24 @@ void tickets_tab_conf_tab(Info & i)
item_sort_index < ticket_info.item_sort_tab.size() &&
ticket_index < ticket_info.ticket_tab.size() )
{
conf_tab_index = i.iter;
i.res = conf_tab_index < ticket_info.cur_conf->tab.size();
if( i.iter == 0 )
conf_tab_index = 0;
else
conf_tab_index += 1;
PT::Space & space = *ticket_info.cur_conf;
for( ; conf_tab_index < space.spaces.size() ; conf_tab_index++)
if( space.spaces[conf_tab_index]->name == L"param" )
break;
i.res = conf_tab_index < space.spaces.size();
if( i.res )
{
const TicketConf::TicketItem & conf_item = ticket_info.cur_conf->tab[conf_tab_index];
PT::Space & sp = *space.spaces[conf_tab_index];
const Ticket & ticket = ticket_info.ticket_tab[ticket_index];
has_value = find_ticket_value(conf_item.id, ticket, par_index);
has_value = find_ticket_param(sp.Long(L"id"), ticket, par_index);
}
}
}
@ -324,82 +367,30 @@ void tickets_tab_conf_tab_has_value(Info & i)
void tickets_tab_conf_tab_value(Info & i)
{
if( has_value &&
item_sort_index < ticket_info.item_sort_tab.size() &&
ticket_index < ticket_info.ticket_tab.size() &&
conf_tab_index < ticket_info.cur_conf->spaces.size() &&
item_sort_index < ticket_info.item_sort_tab.size() &&
ticket_index < ticket_info.ticket_tab.size() &&
par_index < ticket_info.ticket_tab[ticket_index].par_tab.size() )
{
ticket_print_value(i, conf_tab_index, ticket_info.ticket_tab[ticket_index].par_tab[par_index]);
PT::Space & space = *ticket_info.cur_conf->spaces[conf_tab_index];
// !! to mozna jakos gdzies zapamietac
// aby nie wyszukiwac ciagle
PT::Space & meta_ticket = ticket_info.item_sort_tab[item_sort_index]->meta.FindAddSpace(L"ticket");
PT::Space & meta = find_add_meta_for_param(meta_ticket, space.Long(L"id"));
ticket_print_value(i, space, ticket_info.ticket_tab[ticket_index].par_tab[par_index], meta);
}
}
void tickets_tab_conf_tab_is_integer(Info & i)
void tickets_tab_conf_tab_type_is(Info & i)
{
if( conf_tab_index < ticket_info.cur_conf->tab.size() )
if( conf_tab_index < ticket_info.cur_conf->spaces.size() )
{
const TicketConf::TicketItem & conf_item = ticket_info.cur_conf->tab[conf_tab_index];
i.res = conf_item.type == TicketConf::TicketItem::TypeInteger;
}
}
void tickets_tab_conf_tab_is_progress(Info & i)
{
if( conf_tab_index < ticket_info.cur_conf->tab.size() )
{
const TicketConf::TicketItem & conf_item = ticket_info.cur_conf->tab[conf_tab_index];
i.res = conf_item.type == TicketConf::TicketItem::TypeProgress;
}
}
void tickets_tab_conf_tab_is_select(Info & i)
{
if( conf_tab_index < ticket_info.cur_conf->tab.size() )
{
const TicketConf::TicketItem & conf_item = ticket_info.cur_conf->tab[conf_tab_index];
i.res = conf_item.type == TicketConf::TicketItem::TypeSelect;
}
}
void tickets_tab_conf_tab_is_string(Info & i)
{
if( conf_tab_index < ticket_info.cur_conf->tab.size() )
{
const TicketConf::TicketItem & conf_item = ticket_info.cur_conf->tab[conf_tab_index];
i.res = conf_item.type == TicketConf::TicketItem::TypeString;
}
}
void tickets_tab_conf_tab_is_multistring(Info & i)
{
if( conf_tab_index < ticket_info.cur_conf->tab.size() )
{
const TicketConf::TicketItem & conf_item = ticket_info.cur_conf->tab[conf_tab_index];
i.res = conf_item.type == TicketConf::TicketItem::TypeMultistring;
}
}
void tickets_tab_conf_tab_is_images(Info & i)
{
if( conf_tab_index < ticket_info.cur_conf->tab.size() )
{
const TicketConf::TicketItem & conf_item = ticket_info.cur_conf->tab[conf_tab_index];
i.res = conf_item.type == TicketConf::TicketItem::TypeImages;
}
}
void tickets_tab_conf_tab_is_files(Info & i)
{
if( conf_tab_index < ticket_info.cur_conf->tab.size() )
{
const TicketConf::TicketItem & conf_item = ticket_info.cur_conf->tab[conf_tab_index];
i.res = conf_item.type == TicketConf::TicketItem::TypeFiles;
PT::Space & space = *ticket_info.cur_conf->spaces[conf_tab_index];
i.res = (space.Text(L"type") == i.par);
}
}
@ -410,7 +401,7 @@ void tickets_tab_conf_tab_progress_image_number(Info & i)
ticket_index < ticket_info.ticket_tab.size() &&
par_index < ticket_info.ticket_tab[ticket_index].par_tab.size() )
{
int progress = ticket_info.ticket_tab[ticket_index].par_tab[par_index].int_value;
int progress = ticket_info.ticket_tab[ticket_index].par_tab[par_index].intv;
i.out << ticket_calc_progress_image_number(progress);
}
}
@ -425,8 +416,8 @@ void tickets_tab_conf_tab_progress_image_number(Info & i)
namespace ns_ticket_tab
{
static size_t conf_index; // index for: ticket_info.cur_conf->tab
static size_t select_index; // index for: ticket_info.cur_conf->tab[conf_index].select
static size_t conf_index; // index for: ticket_info.cur_conf->spaces
static size_t select_index; // index for: ticket_info.cur_conf->spaces[conf_index]->spaces
static size_t par_index; // index for: ticket_info.ticket->par_tab
static size_t files_number;
static bool has_value;
@ -435,13 +426,23 @@ static bool has_value;
void ticket_tab(Info & i)
{
conf_index = i.iter;
i.res = conf_index < ticket_info.cur_conf->tab.size();
if( i.iter == 0 )
conf_index = 0;
else
conf_index += 1;
PT::Space & space = *ticket_info.cur_conf;
for( ; conf_index < space.spaces.size() ; conf_index++)
if( space.spaces[conf_index]->name == L"param" )
break;
i.res = conf_index < space.spaces.size();
if( i.res )
{
const TicketConf::TicketItem & conf_item = ticket_info.cur_conf->tab[conf_index];
has_value = find_ticket_value(conf_item.id, *ticket_info.ticket, par_index);
PT::Space & sp = *space.spaces[conf_index];
has_value = find_ticket_param(sp.Long(L"id"), *ticket_info.ticket, par_index);
}
}
@ -449,110 +450,98 @@ void ticket_tab(Info & i)
void ticket_tab_param_id(Info & i)
{
if( conf_index < ticket_info.cur_conf->tab.size() )
i.out << ticket_info.cur_conf->tab[conf_index].id;
if( conf_index < ticket_info.cur_conf->spaces.size() )
i.out << ticket_info.cur_conf->spaces[conf_index]->Long(L"id");
}
void ticket_tab_param_name(Info & i)
{
if( conf_index < ticket_info.cur_conf->tab.size() )
i.out << ticket_info.cur_conf->tab[conf_index].name;
if( conf_index < ticket_info.cur_conf->spaces.size() )
i.out << ticket_info.cur_conf->spaces[conf_index]->Text(L"name");
}
void ticket_tab_value(Info & i)
{
if( has_value && par_index < ticket_info.ticket->par_tab.size() )
ticket_print_value(i, conf_index, ticket_info.ticket->par_tab[par_index]);
// !! has_value mowi tylko czy opcja byla w tabeli tickets
// nalezy dodac aby has_value mialo obsluge meta (albo sie pozbyc go w ogole...)
if( has_value && par_index < ticket_info.ticket->par_tab.size() &&
conf_index < ticket_info.cur_conf->spaces.size() )
{
PT::Space & space = *ticket_info.cur_conf->spaces[conf_index];
PT::Space & meta = find_add_meta_for_param(ticket_info.item->meta.FindAddSpace(L"ticket"), space.Long(L"id"));
ticket_print_value(i, space, ticket_info.ticket->par_tab[par_index], meta);
}
}
void ticket_tab_value_int(Info & i)
{
if( has_value && par_index < ticket_info.ticket->par_tab.size() )
i.out << ticket_info.ticket->par_tab[par_index].int_value;
i.out << ticket_info.ticket->par_tab[par_index].intv;
}
void ticket_tab_value_str(Info & i)
void ticket_tab_value_meta(Info & i)
{
if( has_value && par_index < ticket_info.ticket->par_tab.size() )
i.out << ticket_info.ticket->par_tab[par_index].str_value;
{
PT::Space & sp = *ticket_info.cur_conf->spaces[conf_index];
PT::Space & meta = find_add_meta_for_param(ticket_info.item->meta.FindAddSpace(L"ticket"), sp.Long(L"id"));