added: issues ticket system
added functions: ticket, createticket, editticket (there is no 'rm' function working for tickets yet) changed: mount parser and mount points now we have more parameters (arguments in parameters) some refactoring in functions 'emacs' and 'mkdir' git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@554 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -5,8 +5,8 @@ dir.o: ../core/requesttypes.h ../core/session.h ../core/done.h ../core/item.h
|
||||
dir.o: ../core/error.h ../core/log.h ../core/user.h ../core/rebus.h
|
||||
dir.o: ../core/function.h ../core/thread.h ../core/compress.h
|
||||
dir.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
||||
dir.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/data.h
|
||||
dir.o: ../core/dirs.h ../core/dircontainer.h ../core/users.h
|
||||
dir.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h
|
||||
dir.o: ../core/data.h ../core/dirs.h ../core/dircontainer.h ../core/users.h
|
||||
dir.o: ../core/ugcontainer.h ../core/groups.h ../core/group.h
|
||||
dir.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
|
||||
dir.o: ../core/mount.h ../core/db.h ../core/log.h ../core/misc.h
|
||||
@@ -15,122 +15,134 @@ doc.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
||||
doc.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
||||
doc.o: ../core/group.h ../core/functions.h ../core/function.h
|
||||
doc.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
||||
doc.o: ../core/rebus.h ../core/request.h ../core/requesttypes.h
|
||||
doc.o: ../core/session.h ../core/done.h ../core/error.h ../core/thread.h
|
||||
doc.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||
doc.o: ../core/error.h ../core/rebus.h ../core/request.h
|
||||
doc.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
doc.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
doc.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
doc.o: ../core/postmultiparser.h ../core/misc.h
|
||||
doc.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||
done.o: templates.h patterncacher.h ../core/item.h ../core/request.h
|
||||
done.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
done.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
||||
done.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
||||
done.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||
done.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
done.o: ../core/postmultiparser.h ../core/misc.h
|
||||
done.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||
item.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
||||
item.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
||||
item.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
||||
item.o: ../core/group.h ../core/functions.h ../core/function.h
|
||||
item.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
||||
item.o: ../core/rebus.h ../core/request.h ../core/requesttypes.h
|
||||
item.o: ../core/session.h ../core/done.h ../core/error.h ../core/thread.h
|
||||
item.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||
item.o: ../core/error.h ../core/rebus.h ../core/request.h
|
||||
item.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
item.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
item.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
item.o: ../core/postmultiparser.h ../core/misc.h
|
||||
item.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||
last.o: templates.h patterncacher.h ../core/item.h ../core/lastcontainer.h
|
||||
last.o: ../core/data.h ../core/dirs.h ../core/item.h ../core/dircontainer.h
|
||||
last.o: ../core/users.h ../core/user.h ../core/ugcontainer.h ../core/log.h
|
||||
last.o: ../core/groups.h ../core/group.h ../core/functions.h
|
||||
last.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h
|
||||
last.o: ../core/mount.h ../core/rebus.h ../core/request.h
|
||||
last.o: ../core/mount.h ../core/error.h ../core/rebus.h ../core/request.h
|
||||
last.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
last.o: ../core/error.h ../core/thread.h ../core/compress.h
|
||||
last.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
||||
last.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/misc.h
|
||||
last.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
last.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
last.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||
mount.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
||||
mount.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
||||
mount.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
||||
mount.o: ../core/group.h ../core/functions.h ../core/function.h
|
||||
mount.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
||||
mount.o: ../core/rebus.h
|
||||
mount.o: ../core/error.h ../core/rebus.h
|
||||
patterncacher.o: patterncacher.h ../core/item.h ../core/data.h ../core/dirs.h
|
||||
patterncacher.o: ../core/item.h ../core/dircontainer.h ../core/users.h
|
||||
patterncacher.o: ../core/user.h ../core/ugcontainer.h ../core/log.h
|
||||
patterncacher.o: ../core/groups.h ../core/group.h ../core/functions.h
|
||||
patterncacher.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h
|
||||
patterncacher.o: ../core/mount.h ../core/rebus.h ../core/log.h
|
||||
patterncacher.o: ../core/mount.h ../core/error.h ../core/rebus.h
|
||||
patterncacher.o: ../core/log.h
|
||||
priv.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
||||
priv.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
||||
priv.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
||||
priv.o: ../core/group.h ../core/functions.h ../core/function.h
|
||||
priv.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
||||
priv.o: ../core/rebus.h ../core/request.h ../core/requesttypes.h
|
||||
priv.o: ../core/session.h ../core/done.h ../core/error.h ../core/thread.h
|
||||
priv.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||
priv.o: ../core/error.h ../core/rebus.h ../core/request.h
|
||||
priv.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
priv.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
priv.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
priv.o: ../core/postmultiparser.h ../core/misc.h
|
||||
priv.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||
rebus.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
||||
rebus.o: ../core/done.h ../core/item.h ../core/error.h ../core/log.h
|
||||
rebus.o: ../core/user.h ../core/rebus.h ../core/function.h ../core/thread.h
|
||||
rebus.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||
rebus.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
rebus.o: ../core/postmultiparser.h ../core/data.h ../core/dirs.h
|
||||
rebus.o: ../core/dircontainer.h ../core/users.h ../core/ugcontainer.h
|
||||
rebus.o: ../core/groups.h ../core/group.h ../core/functions.h
|
||||
rebus.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h templates.h
|
||||
rebus.o: patterncacher.h ../core/item.h
|
||||
rebus.o: ../core/postmultiparser.h ../core/ticket.h ../core/data.h
|
||||
rebus.o: ../core/dirs.h ../core/dircontainer.h ../core/users.h
|
||||
rebus.o: ../core/ugcontainer.h ../core/groups.h ../core/group.h
|
||||
rebus.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
|
||||
rebus.o: ../core/mount.h templates.h patterncacher.h ../core/item.h
|
||||
sys.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
||||
sys.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
||||
sys.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
||||
sys.o: ../core/group.h ../core/functions.h ../core/function.h
|
||||
sys.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
||||
sys.o: ../core/rebus.h ../core/request.h ../core/requesttypes.h
|
||||
sys.o: ../core/session.h ../core/done.h ../core/error.h ../core/thread.h
|
||||
sys.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||
sys.o: ../core/error.h ../core/rebus.h ../core/request.h
|
||||
sys.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
sys.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
sys.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
sys.o: ../core/postmultiparser.h ../core/misc.h
|
||||
sys.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||
templates.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
||||
templates.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h
|
||||
templates.o: ../core/users.h ../core/user.h ../core/ugcontainer.h
|
||||
templates.o: ../core/log.h ../core/groups.h ../core/group.h
|
||||
templates.o: ../core/functions.h ../core/function.h ../core/lastcontainer.h
|
||||
templates.o: ../core/mounts.h ../core/mount.h ../core/rebus.h
|
||||
templates.o: ../core/mounts.h ../core/mount.h ../core/error.h ../core/rebus.h
|
||||
templates.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
||||
templates.o: ../core/done.h ../core/error.h ../core/thread.h
|
||||
templates.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||
templates.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
templates.o: ../core/postmultiparser.h ../core/misc.h ../core/plugin.h
|
||||
templates.o: ../core/request.h ../core/data.h ../core/pluginmsg.h
|
||||
templates.o: ../core/done.h ../core/thread.h ../core/compress.h
|
||||
templates.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
||||
templates.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h
|
||||
templates.o: ../core/misc.h ../core/plugin.h ../core/request.h ../core/data.h
|
||||
templates.o: ../core/pluginmsg.h
|
||||
thread.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
||||
thread.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h
|
||||
thread.o: ../core/users.h ../core/user.h ../core/ugcontainer.h ../core/log.h
|
||||
thread.o: ../core/groups.h ../core/group.h ../core/functions.h
|
||||
thread.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h
|
||||
thread.o: ../core/mount.h ../core/rebus.h ../core/request.h
|
||||
thread.o: ../core/mount.h ../core/error.h ../core/rebus.h ../core/request.h
|
||||
thread.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
thread.o: ../core/error.h ../core/thread.h ../core/compress.h
|
||||
thread.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
||||
thread.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/misc.h
|
||||
thread.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
thread.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
thread.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||
ticket.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
||||
ticket.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h
|
||||
ticket.o: ../core/users.h ../core/user.h ../core/ugcontainer.h ../core/log.h
|
||||
ticket.o: ../core/groups.h ../core/group.h ../core/functions.h
|
||||
ticket.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h
|
||||
ticket.o: ../core/mount.h ../core/error.h ../core/rebus.h ../core/request.h
|
||||
ticket.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
ticket.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
ticket.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
ticket.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||
user.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
||||
user.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
||||
user.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
||||
user.o: ../core/group.h ../core/functions.h ../core/function.h
|
||||
user.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
||||
user.o: ../core/rebus.h ../core/request.h ../core/requesttypes.h
|
||||
user.o: ../core/session.h ../core/done.h ../core/error.h ../core/thread.h
|
||||
user.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||
user.o: ../core/error.h ../core/rebus.h ../core/request.h
|
||||
user.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
user.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
user.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
user.o: ../core/postmultiparser.h ../core/misc.h
|
||||
user.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||
who.o: templates.h patterncacher.h ../core/item.h ../core/sessioncontainer.h
|
||||
who.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||
who.o: ../core/log.h ../core/user.h ../core/rebus.h
|
||||
who.o: ../core/requestcontroller.h ../content/content.h
|
||||
who.o: ../templates/templates.h ../core/thread.h ../core/sessionmanager.h
|
||||
who.o: ../core/sessioncontainer.h ../core/functionparser.h
|
||||
who.o: ../core/requesttypes.h ../core/data.h ../core/dirs.h
|
||||
who.o: ../core/dircontainer.h ../core/users.h ../core/ugcontainer.h
|
||||
who.o: ../core/groups.h ../core/group.h ../core/functions.h
|
||||
who.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h
|
||||
who.o: ../core/mount.h ../core/request.h ../core/thread.h ../core/compress.h
|
||||
who.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
||||
who.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/misc.h
|
||||
who.o: ../templates/templates.h ../core/thread.h ../core/ticket.h
|
||||
who.o: ../core/done.h ../core/sessionmanager.h ../core/sessioncontainer.h
|
||||
who.o: ../core/functionparser.h ../core/requesttypes.h ../core/data.h
|
||||
who.o: ../core/dirs.h ../core/dircontainer.h ../core/users.h
|
||||
who.o: ../core/ugcontainer.h ../core/groups.h ../core/group.h
|
||||
who.o: ../core/functions.h ../core/function.h ../core/lastcontainer.h
|
||||
who.o: ../core/mounts.h ../core/mount.h ../core/request.h ../core/thread.h
|
||||
who.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||
who.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
who.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||
|
@@ -1 +1 @@
|
||||
o = dir.o doc.o done.o item.o last.o mount.o patterncacher.o priv.o rebus.o sys.o templates.o thread.o user.o who.o
|
||||
o = dir.o doc.o done.o item.o last.o mount.o patterncacher.o priv.o rebus.o sys.o templates.o thread.o ticket.o user.o who.o
|
||||
|
@@ -65,28 +65,25 @@ void item_content_noescape(Info & i)
|
||||
|
||||
void item_content_type_is(Info & i)
|
||||
{
|
||||
switch(request.item.content_type)
|
||||
{
|
||||
case Item::ct_text:
|
||||
i.out_string = "text";
|
||||
break;
|
||||
i.result = false;
|
||||
|
||||
case Item::ct_formatted_text:
|
||||
i.out_string = "formatted text";
|
||||
break;
|
||||
if( !i.is )
|
||||
return;
|
||||
|
||||
case Item::ct_html:
|
||||
i.out_string = "html";
|
||||
break;
|
||||
if( request.item.content_type == Item::ct_text && (*i.is) == "text" )
|
||||
i.result = true;
|
||||
|
||||
case Item::ct_bbcode:
|
||||
i.out_string = "bbcode";
|
||||
break;
|
||||
if( request.item.content_type == Item::ct_formatted_text && (*i.is) == "formatted text" )
|
||||
i.result = true;
|
||||
|
||||
case Item::ct_raw:
|
||||
i.out_string = "raw";
|
||||
break;
|
||||
}
|
||||
if( request.item.content_type == Item::ct_html && (*i.is) == "html" )
|
||||
i.result = true;
|
||||
|
||||
if( request.item.content_type == Item::ct_bbcode && (*i.is) == "bbcode" )
|
||||
i.result = true;
|
||||
|
||||
if( request.item.content_type == Item::ct_raw && (*i.is) == "raw" )
|
||||
i.result = true;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -16,40 +16,44 @@ namespace TemplatesFunctions
|
||||
{
|
||||
|
||||
|
||||
void mount_param_withheader(Info & i)
|
||||
|
||||
|
||||
void mount_page_is(Info & i)
|
||||
{
|
||||
i.result = data.mounts.CurrentMountIsParam(Mount::withheader);
|
||||
if( !i.is )
|
||||
return;
|
||||
|
||||
i.result = data.mounts.pmount->IsArg(Mount::par_page, *i.is);
|
||||
}
|
||||
|
||||
void mount_thread_is(Info & i)
|
||||
{
|
||||
if( !i.is )
|
||||
return;
|
||||
|
||||
i.result = data.mounts.pmount->IsArg(Mount::par_thread, *i.is);
|
||||
}
|
||||
|
||||
|
||||
void mount_type_is_thread(Info & i)
|
||||
{
|
||||
i.result = data.mounts.pmount->type == Mount::thread;
|
||||
}
|
||||
|
||||
|
||||
void mount_type_is_ticket(Info & i)
|
||||
{
|
||||
i.result = data.mounts.pmount->type == Mount::ticket;
|
||||
}
|
||||
|
||||
|
||||
void mount_type_is_cms(Info & i)
|
||||
{
|
||||
i.result = data.mounts.pmount->type == Mount::cms;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void mount_param_withinfo(Info & i)
|
||||
{
|
||||
i.result = data.mounts.CurrentMountIsParam(Mount::withinfo);
|
||||
}
|
||||
|
||||
|
||||
void mount_param_thread_with_header(Info & i)
|
||||
{
|
||||
i.result = data.mounts.CurrentMountIsParam(Mount::thread_with_header);
|
||||
}
|
||||
|
||||
|
||||
void mount_param_thread_with_info(Info & i)
|
||||
{
|
||||
i.result = data.mounts.CurrentMountIsParam(Mount::thread_with_info);
|
||||
}
|
||||
|
||||
|
||||
void mount_is_thread(Info & i)
|
||||
{
|
||||
i.result = data.mounts.CurrentMountType() == Mount::thread;
|
||||
}
|
||||
|
||||
void mount_is_cms(Info & i)
|
||||
{
|
||||
i.result = data.mounts.CurrentMountType() == Mount::cms;
|
||||
}
|
||||
|
||||
} // namespace TemplatesFunctions
|
||||
|
||||
|
@@ -31,6 +31,8 @@ Ezc::Pattern pat_fun_thread;
|
||||
Ezc::Pattern pat_fun_reload;
|
||||
Ezc::Pattern pat_fun_createthread;
|
||||
Ezc::Pattern pat_fun_upload;
|
||||
Ezc::Pattern pat_fun_ticket;
|
||||
Ezc::Pattern pat_fun_createticket;
|
||||
Ezc::Pattern pat_err_item_required;
|
||||
Ezc::Pattern pat_err_404;
|
||||
Ezc::Pattern pat_err_per_denied;
|
||||
@@ -120,6 +122,15 @@ Ezc::Pattern * p = 0;
|
||||
p = &pat_fun_createthread;
|
||||
break;
|
||||
|
||||
case FUN_TICKET:
|
||||
p = &pat_fun_ticket;
|
||||
break;
|
||||
|
||||
case FUN_CREATETICKET:
|
||||
case FUN_EDITTICKET:
|
||||
p = &pat_fun_createticket;
|
||||
break;
|
||||
|
||||
case FUN_UPLOAD:
|
||||
p = &pat_fun_upload;
|
||||
break;
|
||||
@@ -217,6 +228,7 @@ void Templates::CreateFunctions()
|
||||
functions.Insert("doc_is_error", doc_is_error);
|
||||
functions.Insert("doc_status", doc_status);
|
||||
|
||||
|
||||
/*
|
||||
item
|
||||
*/
|
||||
@@ -390,15 +402,69 @@ void Templates::CreateFunctions()
|
||||
functions.Insert("thread_can_create", thread_can_create);
|
||||
|
||||
|
||||
/*
|
||||
ticket
|
||||
*/
|
||||
functions.Insert("ticket_is", ticket_is);
|
||||
functions.Insert("ticket_can_create", ticket_can_create);
|
||||
functions.Insert("ticket_type", ticket_type);
|
||||
functions.Insert("ticket_status", ticket_status);
|
||||
functions.Insert("ticket_priority", ticket_priority);
|
||||
functions.Insert("ticket_category", ticket_category);
|
||||
functions.Insert("ticket_expected", ticket_expected);
|
||||
functions.Insert("ticket_progress", ticket_progress);
|
||||
|
||||
functions.Insert("ticket_tab", ticket_tab);
|
||||
functions.Insert("ticket_tab_url", ticket_tab_url);
|
||||
functions.Insert("ticket_tab_subject", ticket_tab_subject);
|
||||
functions.Insert("ticket_tab_subject_empty", ticket_tab_subject_empty);
|
||||
functions.Insert("ticket_tab_author", ticket_tab_author);
|
||||
functions.Insert("ticket_tab_type", ticket_tab_type);
|
||||
functions.Insert("ticket_tab_status", ticket_tab_status);
|
||||
functions.Insert("ticket_tab_priority", ticket_tab_priority);
|
||||
functions.Insert("ticket_tab_category", ticket_tab_category);
|
||||
functions.Insert("ticket_tab_expected", ticket_tab_expected);
|
||||
functions.Insert("ticket_tab_progress", ticket_tab_progress);
|
||||
|
||||
functions.Insert("ticket_type_tab", ticket_type_tab);
|
||||
functions.Insert("ticket_type_tab_defined", ticket_type_tab_defined);
|
||||
functions.Insert("ticket_type_tab_isdefault", ticket_type_tab_isdefault);
|
||||
functions.Insert("ticket_type_tab_index", ticket_type_tab_index);
|
||||
functions.Insert("ticket_type_tab_name", ticket_type_tab_name);
|
||||
|
||||
functions.Insert("ticket_status_tab", ticket_status_tab);
|
||||
functions.Insert("ticket_status_tab_defined", ticket_status_tab_defined);
|
||||
functions.Insert("ticket_status_tab_isdefault", ticket_status_tab_isdefault);
|
||||
functions.Insert("ticket_status_tab_index", ticket_status_tab_index);
|
||||
functions.Insert("ticket_status_tab_name", ticket_status_tab_name);
|
||||
|
||||
functions.Insert("ticket_priority_tab", ticket_priority_tab);
|
||||
functions.Insert("ticket_priority_tab_defined", ticket_priority_tab_defined);
|
||||
functions.Insert("ticket_priority_tab_isdefault", ticket_priority_tab_isdefault);
|
||||
functions.Insert("ticket_priority_tab_index", ticket_priority_tab_index);
|
||||
functions.Insert("ticket_priority_tab_name", ticket_priority_tab_name);
|
||||
|
||||
functions.Insert("ticket_category_tab", ticket_category_tab);
|
||||
functions.Insert("ticket_category_tab_defined", ticket_category_tab_defined);
|
||||
functions.Insert("ticket_category_tab_isdefault", ticket_category_tab_isdefault);
|
||||
functions.Insert("ticket_category_tab_index", ticket_category_tab_index);
|
||||
functions.Insert("ticket_category_tab_name", ticket_category_tab_name);
|
||||
|
||||
functions.Insert("ticket_expected_tab", ticket_expected_tab);
|
||||
functions.Insert("ticket_expected_tab_defined", ticket_expected_tab_defined);
|
||||
functions.Insert("ticket_expected_tab_isdefault", ticket_expected_tab_isdefault);
|
||||
functions.Insert("ticket_expected_tab_index", ticket_expected_tab_index);
|
||||
functions.Insert("ticket_expected_tab_name", ticket_expected_tab_name);
|
||||
|
||||
|
||||
/*
|
||||
mount
|
||||
*/
|
||||
functions.Insert("mount_param_withheader", mount_param_withheader);
|
||||
functions.Insert("mount_param_withinfo", mount_param_withinfo);
|
||||
functions.Insert("mount_param_thread_with_header", mount_param_thread_with_header);
|
||||
functions.Insert("mount_param_thread_with_info", mount_param_thread_with_info);
|
||||
functions.Insert("mount_is_thread", mount_is_thread);
|
||||
functions.Insert("mount_is_cms", mount_is_cms);
|
||||
functions.Insert("mount_page_is", mount_page_is);
|
||||
functions.Insert("mount_thread_is", mount_thread_is);
|
||||
functions.Insert("mount_type_is_thread", mount_type_is_thread);
|
||||
functions.Insert("mount_type_is_ticket", mount_type_is_ticket);
|
||||
functions.Insert("mount_type_is_cms", mount_type_is_cms);
|
||||
|
||||
|
||||
/*
|
||||
@@ -485,6 +551,12 @@ void Templates::ReadTemplates()
|
||||
|
||||
pat_fun_upload.Directory(data.templates);
|
||||
pat_fun_upload.ParseFile("fun_upload.html");
|
||||
|
||||
pat_fun_ticket.Directory(data.templates);
|
||||
pat_fun_ticket.ParseFile("fun_ticket.html");
|
||||
|
||||
pat_fun_createticket.Directory(data.templates);
|
||||
pat_fun_createticket.ParseFile("fun_createticket.html");
|
||||
}
|
||||
|
||||
|
||||
|
@@ -55,7 +55,7 @@ namespace TemplatesFunctions
|
||||
/*
|
||||
item
|
||||
*/
|
||||
void item_is(Info & i);
|
||||
void item_is(Info & i); // !! change to is_item lub na item_defined
|
||||
void item_id(Info & i);
|
||||
void item_subject(Info & i);
|
||||
void item_subject_noescape(Info & i);
|
||||
@@ -164,6 +164,7 @@ namespace TemplatesFunctions
|
||||
|
||||
void priv_privileges(Info & i);
|
||||
|
||||
|
||||
/*
|
||||
done
|
||||
*/
|
||||
@@ -209,7 +210,7 @@ namespace TemplatesFunctions
|
||||
/*
|
||||
thread
|
||||
*/
|
||||
void thread_is(Info & i);
|
||||
void thread_is(Info & i); // !! change to is_thread lub na thread_defined
|
||||
void thread_tab(Info & i);
|
||||
void thread_tab_url(Info & i);
|
||||
void thread_tab_subject(Info & i);
|
||||
@@ -219,16 +220,70 @@ namespace TemplatesFunctions
|
||||
void thread_tab_last_item_user(Info & i);
|
||||
void thread_can_create(Info & i);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
ticket
|
||||
*/
|
||||
void ticket_is(Info & i); // !! change to is_ticket lub na ticket_defined
|
||||
void ticket_can_create(Info & i);
|
||||
void ticket_type(Info & i);
|
||||
void ticket_status(Info & i);
|
||||
void ticket_priority(Info & i);
|
||||
void ticket_category(Info & i);
|
||||
void ticket_expected(Info & i);
|
||||
void ticket_progress(Info & i);
|
||||
|
||||
void ticket_tab(Info & i);
|
||||
void ticket_tab_url(Info & i);
|
||||
void ticket_tab_subject(Info & i);
|
||||
void ticket_tab_subject_empty(Info & i);
|
||||
void ticket_tab_author(Info & i);
|
||||
void ticket_tab_type(Info & i);
|
||||
void ticket_tab_status(Info & i);
|
||||
void ticket_tab_priority(Info & i);
|
||||
void ticket_tab_category(Info & i);
|
||||
void ticket_tab_expected(Info & i);
|
||||
void ticket_tab_progress(Info & i);
|
||||
|
||||
void ticket_type_tab(Info & i);
|
||||
void ticket_type_tab_defined(Info & i);
|
||||
void ticket_type_tab_isdefault(Info & i);
|
||||
void ticket_type_tab_index(Info & i);
|
||||
void ticket_type_tab_name(Info & i);
|
||||
|
||||
void ticket_status_tab(Info & i);
|
||||
void ticket_status_tab_defined(Info & i);
|
||||
void ticket_status_tab_isdefault(Info & i);
|
||||
void ticket_status_tab_index(Info & i);
|
||||
void ticket_status_tab_name(Info & i);
|
||||
|
||||
void ticket_priority_tab(Info & i);
|
||||
void ticket_priority_tab_defined(Info & i);
|
||||
void ticket_priority_tab_isdefault(Info & i);
|
||||
void ticket_priority_tab_index(Info & i);
|
||||
void ticket_priority_tab_name(Info & i);
|
||||
|
||||
void ticket_category_tab(Info & i);
|
||||
void ticket_category_tab_defined(Info & i);
|
||||
void ticket_category_tab_isdefault(Info & i);
|
||||
void ticket_category_tab_index(Info & i);
|
||||
void ticket_category_tab_name(Info & i);
|
||||
|
||||
void ticket_expected_tab(Info & i);
|
||||
void ticket_expected_tab_defined(Info & i);
|
||||
void ticket_expected_tab_isdefault(Info & i);
|
||||
void ticket_expected_tab_index(Info & i);
|
||||
void ticket_expected_tab_name(Info & i);
|
||||
|
||||
|
||||
/*
|
||||
mount
|
||||
*/
|
||||
void mount_param_withheader(Info & i);
|
||||
void mount_param_withinfo(Info & i);
|
||||
void mount_param_thread_with_header(Info & i);
|
||||
void mount_param_thread_with_info(Info & i);
|
||||
void mount_is_thread(Info & i);
|
||||
void mount_is_cms(Info & i);
|
||||
void mount_page_is(Info & i);
|
||||
void mount_thread_is(Info & i);
|
||||
void mount_type_is_thread(Info & i);
|
||||
void mount_type_is_ticket(Info & i);
|
||||
void mount_type_is_cms(Info & i);
|
||||
|
||||
|
||||
/*
|
||||
|
519
templates/ticket.cpp
Executable file
519
templates/ticket.cpp
Executable file
@@ -0,0 +1,519 @@
|
||||
/*
|
||||
* This file is a part of CMSLU -- Content Management System like Unix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2008-2009, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "templates.h"
|
||||
#include "../core/data.h"
|
||||
#include "../core/request.h"
|
||||
#include "../core/misc.h"
|
||||
|
||||
|
||||
|
||||
namespace TemplatesFunctions
|
||||
{
|
||||
|
||||
|
||||
void ticket_is(Info & i)
|
||||
{
|
||||
i.result = request.is_ticket;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void ticket_can_create(Info & i)
|
||||
{
|
||||
i.result = request.CanCreateTicket(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ticket_type(Info & i)
|
||||
{
|
||||
if( request.ticket.type < data.mounts.pmount->param[Mount::par_ticket_type].arg.size() )
|
||||
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_type].arg[request.ticket.type]);
|
||||
}
|
||||
|
||||
|
||||
void ticket_status(Info & i)
|
||||
{
|
||||
if( request.ticket.status < data.mounts.pmount->param[Mount::par_ticket_status].arg.size() )
|
||||
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_status].arg[request.ticket.status]);
|
||||
}
|
||||
|
||||
|
||||
void ticket_priority(Info & i)
|
||||
{
|
||||
if( request.ticket.priority < data.mounts.pmount->param[Mount::par_ticket_priority].arg.size() )
|
||||
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_priority].arg[request.ticket.priority]);
|
||||
}
|
||||
|
||||
|
||||
void ticket_category(Info & i)
|
||||
{
|
||||
if( request.ticket.category < data.mounts.pmount->param[Mount::par_ticket_category].arg.size() )
|
||||
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_category].arg[request.ticket.category]);
|
||||
}
|
||||
|
||||
|
||||
void ticket_expected(Info & i)
|
||||
{
|
||||
if( request.ticket.expected < data.mounts.pmount->param[Mount::par_ticket_expected].arg.size() )
|
||||
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_expected].arg[request.ticket.expected]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ticket_progress(Info & i)
|
||||
{
|
||||
i.out << request.ticket.progress;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
static size_t ticket_tab_index;
|
||||
|
||||
|
||||
|
||||
void ticket_tab(Info & i)
|
||||
{
|
||||
ticket_tab_index = i.iter;
|
||||
|
||||
i.result = ticket_tab_index < request.ticket_tab.size();
|
||||
}
|
||||
|
||||
|
||||
void ticket_tab_url(Info & i)
|
||||
{
|
||||
if( ticket_tab_index < request.ticket_tab.size() )
|
||||
{
|
||||
Item * dir = data.dirs.GetDir( request.ticket_tab[ticket_tab_index].dir_id );
|
||||
|
||||
if( dir )
|
||||
{
|
||||
HtmlEscape(i.out, dir->url);
|
||||
}
|
||||
else
|
||||
{
|
||||
i.out << "<!-- unknown directory -->";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ticket_tab_subject(Info & i)
|
||||
{
|
||||
if( ticket_tab_index < request.ticket_tab.size() )
|
||||
{
|
||||
Item * dir = data.dirs.GetDir( request.ticket_tab[ticket_tab_index].dir_id );
|
||||
|
||||
if( dir )
|
||||
{
|
||||
if( !dir->subject.empty() )
|
||||
HtmlEscape(i.out, dir->subject);
|
||||
else
|
||||
HtmlEscape(i.out, dir->url);
|
||||
}
|
||||
else
|
||||
{
|
||||
i.out << "<!-- unknown subject -->";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ticket_tab_subject_empty(Info & i)
|
||||
{
|
||||
i.result = true;
|
||||
|
||||
if( ticket_tab_index < request.ticket_tab.size() )
|
||||
{
|
||||
Item * dir = data.dirs.GetDir( request.ticket_tab[ticket_tab_index].dir_id );
|
||||
|
||||
if( dir )
|
||||
i.result = dir->subject.empty();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ticket_tab_author(Info & i)
|
||||
{
|
||||
bool unknown = true;
|
||||
|
||||
|
||||
if( ticket_tab_index < request.ticket_tab.size() )
|
||||
{
|
||||
Item * dir = data.dirs.GetDir( request.ticket_tab[ticket_tab_index].dir_id );
|
||||
|
||||
if( dir )
|
||||
{
|
||||
User * puser = data.users.GetUser(dir->user_id);
|
||||
unknown = false;
|
||||
|
||||
if( puser )
|
||||
HtmlEscape(i.out, puser->name);
|
||||
else
|
||||
{
|
||||
i.out << "~";
|
||||
|
||||
if( !dir->guest_name.empty() )
|
||||
HtmlEscape(i.out, dir->guest_name);
|
||||
else
|
||||
i.out << "guest"; // !! dodac do konfiga
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( unknown )
|
||||
{
|
||||
i.out << "<!-- unknown user -->";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ticket_tab_type(Info & i)
|
||||
{
|
||||
if( ticket_tab_index >= request.ticket_tab.size() )
|
||||
return;
|
||||
|
||||
Ticket & t = request.ticket_tab[ticket_tab_index];
|
||||
|
||||
if( t.type < data.mounts.pmount->param[Mount::par_ticket_type].arg.size() )
|
||||
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_type].arg[t.type]);
|
||||
}
|
||||
|
||||
|
||||
void ticket_tab_status(Info & i)
|
||||
{
|
||||
if( ticket_tab_index >= request.ticket_tab.size() )
|
||||
return;
|
||||
|
||||
Ticket & t = request.ticket_tab[ticket_tab_index];
|
||||
|
||||
if( t.status < data.mounts.pmount->param[Mount::par_ticket_status].arg.size() )
|
||||
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_status].arg[t.status]);
|
||||
}
|
||||
|
||||
|
||||
void ticket_tab_priority(Info & i)
|
||||
{
|
||||
if( ticket_tab_index >= request.ticket_tab.size() )
|
||||
return;
|
||||
|
||||
Ticket & t = request.ticket_tab[ticket_tab_index];
|
||||
|
||||
if( t.priority < data.mounts.pmount->param[Mount::par_ticket_priority].arg.size() )
|
||||
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_priority].arg[t.priority]);
|
||||
}
|
||||
|
||||
|
||||
void ticket_tab_category(Info & i)
|
||||
{
|
||||
if( ticket_tab_index >= request.ticket_tab.size() )
|
||||
return;
|
||||
|
||||
Ticket & t = request.ticket_tab[ticket_tab_index];
|
||||
|
||||
if( t.category < data.mounts.pmount->param[Mount::par_ticket_category].arg.size() )
|
||||
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_category].arg[t.category]);
|
||||
}
|
||||
|
||||
|
||||
void ticket_tab_expected(Info & i)
|
||||
{
|
||||
if( ticket_tab_index >= request.ticket_tab.size() )
|
||||
return;
|
||||
|
||||
Ticket & t = request.ticket_tab[ticket_tab_index];
|
||||
|
||||
if( t.expected < data.mounts.pmount->param[Mount::par_ticket_expected].arg.size() )
|
||||
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_expected].arg[t.expected]);
|
||||
}
|
||||
|
||||
|
||||
void ticket_tab_progress(Info & i)
|
||||
{
|
||||
if( ticket_tab_index >= request.ticket_tab.size() )
|
||||
return;
|
||||
|
||||
i.out << request.ticket_tab[ticket_tab_index].progress;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
|
||||
static size_t ticket_type_tab_ind;
|
||||
|
||||
|
||||
void ticket_type_tab(Info & i)
|
||||
{
|
||||
ticket_type_tab_ind = i.iter;
|
||||
|
||||
i.result = ticket_type_tab_ind < data.mounts.pmount->param[Mount::par_ticket_type].arg.size();
|
||||
}
|
||||
|
||||
|
||||
void ticket_type_tab_defined(Info & i)
|
||||
{
|
||||
i.result = data.mounts.pmount->param[Mount::par_ticket_type].defined;
|
||||
}
|
||||
|
||||
|
||||
void ticket_type_tab_isdefault(Info & i)
|
||||
{
|
||||
if( request.is_ticket )
|
||||
{
|
||||
i.result = (ticket_type_tab_ind == request.ticket.type);
|
||||
}
|
||||
else
|
||||
{
|
||||
Mount::ParamRow & p = data.mounts.pmount->param[Mount::par_ticket_type_default];
|
||||
|
||||
if( !p.defined || p.arg.empty() )
|
||||
return; // default false
|
||||
|
||||
size_t value = atoi( p.arg[0].c_str() );
|
||||
i.result = (ticket_type_tab_ind == value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ticket_type_tab_index(Info & i)
|
||||
{
|
||||
i.out << ticket_type_tab_ind;
|
||||
}
|
||||
|
||||
|
||||
void ticket_type_tab_name(Info & i)
|
||||
{
|
||||
if( ticket_type_tab_ind < data.mounts.pmount->param[Mount::par_ticket_type].arg.size() )
|
||||
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_type].arg[ticket_type_tab_ind]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
|
||||
static size_t ticket_status_tab_ind;
|
||||
|
||||
|
||||
void ticket_status_tab(Info & i)
|
||||
{
|
||||
ticket_status_tab_ind = i.iter;
|
||||
|
||||
i.result = ticket_status_tab_ind < data.mounts.pmount->param[Mount::par_ticket_status].arg.size();
|
||||
}
|
||||
|
||||
|
||||
void ticket_status_tab_defined(Info & i)
|
||||
{
|
||||
i.result = data.mounts.pmount->param[Mount::par_ticket_status].defined;
|
||||
}
|
||||
|
||||
|
||||
void ticket_status_tab_isdefault(Info & i)
|
||||
{
|
||||
if( request.is_ticket )
|
||||
{
|
||||
i.result = (ticket_status_tab_ind == request.ticket.status);
|
||||
}
|
||||
else
|
||||
{
|
||||
Mount::ParamRow & p = data.mounts.pmount->param[Mount::par_ticket_status_default];
|
||||
|
||||
if( !p.defined || p.arg.empty() )
|
||||
return; // default false
|
||||
|
||||
size_t value = atoi( p.arg[0].c_str() );
|
||||
i.result = (ticket_status_tab_ind == value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ticket_status_tab_index(Info & i)
|
||||
{
|
||||
i.out << ticket_status_tab_ind;
|
||||
}
|
||||
|
||||
|
||||
void ticket_status_tab_name(Info & i)
|
||||
{
|
||||
if( ticket_status_tab_ind < data.mounts.pmount->param[Mount::par_ticket_status].arg.size() )
|
||||
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_status].arg[ticket_status_tab_ind]);
|
||||
}
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
|
||||
static size_t ticket_priority_tab_ind;
|
||||
|
||||
|
||||
void ticket_priority_tab(Info & i)
|
||||
{
|
||||
ticket_priority_tab_ind = i.iter;
|
||||
|
||||
i.result = ticket_priority_tab_ind < data.mounts.pmount->param[Mount::par_ticket_priority].arg.size();
|
||||
}
|
||||
|
||||
|
||||
void ticket_priority_tab_defined(Info & i)
|
||||
{
|
||||
i.result = data.mounts.pmount->param[Mount::par_ticket_priority].defined;
|
||||
}
|
||||
|
||||
|
||||
void ticket_priority_tab_isdefault(Info & i)
|
||||
{
|
||||
if( request.is_ticket )
|
||||
{
|
||||
i.result = (ticket_priority_tab_ind == request.ticket.priority);
|
||||
}
|
||||
else
|
||||
{
|
||||
Mount::ParamRow & p = data.mounts.pmount->param[Mount::par_ticket_priority_default];
|
||||
|
||||
if( !p.defined || p.arg.empty() )
|
||||
return; // default false
|
||||
|
||||
size_t value = atoi( p.arg[0].c_str() );
|
||||
i.result = (ticket_priority_tab_ind == value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ticket_priority_tab_index(Info & i)
|
||||
{
|
||||
i.out << ticket_priority_tab_ind;
|
||||
}
|
||||
|
||||
|
||||
void ticket_priority_tab_name(Info & i)
|
||||
{
|
||||
if( ticket_priority_tab_ind < data.mounts.pmount->param[Mount::par_ticket_priority].arg.size() )
|
||||
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_priority].arg[ticket_priority_tab_ind]);
|
||||
}
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
|
||||
static size_t ticket_category_tab_ind;
|
||||
|
||||
|
||||
void ticket_category_tab(Info & i)
|
||||
{
|
||||
ticket_category_tab_ind = i.iter;
|
||||
|
||||
i.result = ticket_category_tab_ind < data.mounts.pmount->param[Mount::par_ticket_category].arg.size();
|
||||
}
|
||||
|
||||
|
||||
void ticket_category_tab_defined(Info & i)
|
||||
{
|
||||
i.result = data.mounts.pmount->param[Mount::par_ticket_category].defined;
|
||||
}
|
||||
|
||||
|
||||
void ticket_category_tab_isdefault(Info & i)
|
||||
{
|
||||
if( request.is_ticket )
|
||||
{
|
||||
i.result = (ticket_category_tab_ind == request.ticket.category);
|
||||
}
|
||||
else
|
||||
{
|
||||
Mount::ParamRow & p = data.mounts.pmount->param[Mount::par_ticket_category_default];
|
||||
|
||||
if( !p.defined || p.arg.empty() )
|
||||
return; // default false
|
||||
|
||||
size_t value = atoi( p.arg[0].c_str() );
|
||||
i.result = (ticket_category_tab_ind == value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ticket_category_tab_index(Info & i)
|
||||
{
|
||||
i.out << ticket_category_tab_ind;
|
||||
}
|
||||
|
||||
|
||||
void ticket_category_tab_name(Info & i)
|
||||
{
|
||||
if( ticket_category_tab_ind < data.mounts.pmount->param[Mount::par_ticket_category].arg.size() )
|
||||
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_category].arg[ticket_category_tab_ind]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
|
||||
static size_t ticket_expected_tab_ind;
|
||||
|
||||
|
||||
void ticket_expected_tab(Info & i)
|
||||
{
|
||||
ticket_expected_tab_ind = i.iter;
|
||||
|
||||
i.result = ticket_expected_tab_ind < data.mounts.pmount->param[Mount::par_ticket_expected].arg.size();
|
||||
}
|
||||
|
||||
|
||||
void ticket_expected_tab_defined(Info & i)
|
||||
{
|
||||
i.result = data.mounts.pmount->param[Mount::par_ticket_expected].defined;
|
||||
}
|
||||
|
||||
|
||||
void ticket_expected_tab_isdefault(Info & i)
|
||||
{
|
||||
if( request.is_ticket )
|
||||
{
|
||||
i.result = (ticket_expected_tab_ind == request.ticket.expected);
|
||||
}
|
||||
else
|
||||
{
|
||||
Mount::ParamRow & p = data.mounts.pmount->param[Mount::par_ticket_expected_default];
|
||||
|
||||
if( !p.defined || p.arg.empty() )
|
||||
return; // default false
|
||||
|
||||
size_t value = atoi( p.arg[0].c_str() );
|
||||
i.result = (ticket_expected_tab_ind == value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ticket_expected_tab_index(Info & i)
|
||||
{
|
||||
i.out << ticket_expected_tab_ind;
|
||||
}
|
||||
|
||||
|
||||
void ticket_expected_tab_name(Info & i)
|
||||
{
|
||||
if( ticket_expected_tab_ind < data.mounts.pmount->param[Mount::par_ticket_expected].arg.size() )
|
||||
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_expected].arg[ticket_expected_tab_ind]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace TemplatesFunctions
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user