added: now plugin ticket uses a new horizontal table (plugins.ticket)
columns: dir_id, param, value we are able to build complicated tickets git-svn-id: svn://ttmath.org/publicrep/winix/trunk@664 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -46,12 +46,56 @@ return percent;
|
||||
|
||||
|
||||
|
||||
void find_ticket_value(const TicketConf::TicketItem & conf_item, const Ticket & ticket, bool * has_value, int * value)
|
||||
{
|
||||
*has_value = false;
|
||||
*value = 0;
|
||||
|
||||
for(size_t a=0 ; a < ticket.par_tab.size() ; a++)
|
||||
{
|
||||
int par = ticket.par_tab[a].param;
|
||||
int val = ticket.par_tab[a].value;
|
||||
|
||||
if( par == conf_item.id )
|
||||
{
|
||||
*has_value = true;
|
||||
*value = val;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ticket_print_value(Info & i, size_t conf_index, int value)
|
||||
{
|
||||
if( conf_index < ticket_info.cur_conf->tab.size() )
|
||||
{
|
||||
const TicketConf::TicketItem & conf_item = ticket_info.cur_conf->tab[conf_index];
|
||||
|
||||
if( conf_item.type == TicketConf::TicketItem::TypeInteger )
|
||||
i.out << value;
|
||||
else
|
||||
if( conf_item.type == TicketConf::TicketItem::TypeSelect )
|
||||
{
|
||||
if( value < (int)conf_item.select.size() )
|
||||
HtmlEscape(i.out, conf_item.select[value].name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void ticket_is(Info & i)
|
||||
{
|
||||
i.res = ticket_info.is_ticket;
|
||||
}
|
||||
|
||||
|
||||
void ticket_item_subject(Info & i)
|
||||
{
|
||||
HtmlEscape(i.out, ticket_info.item.subject);
|
||||
}
|
||||
|
||||
|
||||
void ticket_item_content(Info & i)
|
||||
{
|
||||
@@ -85,511 +129,277 @@ void ticket_can_edit(Info & i)
|
||||
}
|
||||
|
||||
|
||||
void ticket_type(Info & i)
|
||||
|
||||
|
||||
|
||||
namespace ns_tickets_tab
|
||||
{
|
||||
if( ticket_info.ticket.type < system->mounts.pmount->param[ticket_info.mount_par_ticket_type].arg.size() )
|
||||
HtmlEscape(i.out, system->mounts.pmount->param[ticket_info.mount_par_ticket_type].arg[ticket_info.ticket.type]);
|
||||
}
|
||||
static size_t tickets_tab_index;
|
||||
static size_t conf_tab_index;
|
||||
static bool has_value;
|
||||
static int value;
|
||||
|
||||
|
||||
void ticket_status(Info & i)
|
||||
void tickets_tab(Info & i)
|
||||
{
|
||||
if( ticket_info.ticket.status < system->mounts.pmount->param[ticket_info.mount_par_ticket_status].arg.size() )
|
||||
HtmlEscape(i.out, system->mounts.pmount->param[ticket_info.mount_par_ticket_status].arg[ticket_info.ticket.status]);
|
||||
}
|
||||
|
||||
|
||||
void ticket_priority(Info & i)
|
||||
{
|
||||
if( ticket_info.ticket.priority < system->mounts.pmount->param[ticket_info.mount_par_ticket_priority].arg.size() )
|
||||
HtmlEscape(i.out, system->mounts.pmount->param[ticket_info.mount_par_ticket_priority].arg[ticket_info.ticket.priority]);
|
||||
}
|
||||
|
||||
|
||||
void ticket_category(Info & i)
|
||||
{
|
||||
if( ticket_info.ticket.category < system->mounts.pmount->param[ticket_info.mount_par_ticket_category].arg.size() )
|
||||
HtmlEscape(i.out, system->mounts.pmount->param[ticket_info.mount_par_ticket_category].arg[ticket_info.ticket.category]);
|
||||
}
|
||||
|
||||
|
||||
void ticket_expected(Info & i)
|
||||
{
|
||||
if( ticket_info.ticket.expected < system->mounts.pmount->param[ticket_info.mount_par_ticket_expected].arg.size() )
|
||||
HtmlEscape(i.out, system->mounts.pmount->param[ticket_info.mount_par_ticket_expected].arg[ticket_info.ticket.expected]);
|
||||
tickets_tab_index = i.iter;
|
||||
i.res = tickets_tab_index < ticket_info.ticket_tab.size();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ticket_progress(Info & i)
|
||||
Item * tickets_tab_find_index_dir()
|
||||
{
|
||||
i.out << ticket_info.ticket.progress;
|
||||
}
|
||||
Item * dir = 0;
|
||||
|
||||
if( tickets_tab_index < ticket_info.ticket_tab.size() )
|
||||
{
|
||||
long dir_id = ticket_info.ticket_tab[tickets_tab_index].dir_id;
|
||||
dir = system->dirs.GetDir(dir_id);
|
||||
}
|
||||
|
||||
void ticket_progress_image_number(Info & i)
|
||||
{
|
||||
int percent = ticket_info.ticket.progress;
|
||||
i.out << ticket_calc_progress_image_number(percent);
|
||||
return dir;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
void tickets_tab_url(Info & i)
|
||||
{
|
||||
Item * dir = tickets_tab_find_index_dir();
|
||||
|
||||
if( dir )
|
||||
HtmlEscape(i.out, dir->url);
|
||||
}
|
||||
|
||||
|
||||
void tickets_tab_subject_empty(Info & i)
|
||||
{
|
||||
Item * dir = tickets_tab_find_index_dir();
|
||||
|
||||
if( dir )
|
||||
i.res = dir->subject.empty();
|
||||
}
|
||||
|
||||
|
||||
void tickets_tab_subject(Info & i)
|
||||
{
|
||||
Item * dir = tickets_tab_find_index_dir();
|
||||
|
||||
if( dir )
|
||||
HtmlEscape(i.out, dir->subject);
|
||||
}
|
||||
|
||||
|
||||
void tickets_tab_conf_tab(Info & i)
|
||||
{
|
||||
if( tickets_tab_index < ticket_info.ticket_tab.size() )
|
||||
{
|
||||
conf_tab_index = i.iter;
|
||||
i.res = conf_tab_index < ticket_info.cur_conf->tab.size();
|
||||
|
||||
if( i.res )
|
||||
{
|
||||
const TicketConf::TicketItem & conf_item = ticket_info.cur_conf->tab[conf_tab_index];
|
||||
const Ticket & ticket = ticket_info.ticket_tab[tickets_tab_index];
|
||||
find_ticket_value(conf_item, ticket, &has_value, &value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void tickets_tab_conf_tab_value(Info & i)
|
||||
{
|
||||
if( has_value )
|
||||
ticket_print_value(i, conf_tab_index, value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static size_t ticket_tab_index;
|
||||
void tickets_tab_conf_tab_is_progress(Info & i)
|
||||
{
|
||||
if( has_value &&
|
||||
conf_tab_index < ticket_info.cur_conf->tab.size() )
|
||||
{
|
||||
const TicketConf::TicketItem & conf_item = ticket_info.cur_conf->tab[conf_tab_index];
|
||||
i.res = IsSubString(ticket_info.progress_prefix, conf_item.name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void tickets_tab_conf_tab_progress_image_number(Info & i)
|
||||
{
|
||||
if( has_value )
|
||||
i.out << ticket_calc_progress_image_number(value);
|
||||
}
|
||||
|
||||
|
||||
} // namespace ns_tickets_tab
|
||||
|
||||
|
||||
|
||||
namespace ns_ticket_tab
|
||||
{
|
||||
static size_t conf_index;
|
||||
static size_t select_index;
|
||||
static bool has_value;
|
||||
static int value;
|
||||
|
||||
|
||||
void ticket_tab(Info & i)
|
||||
{
|
||||
ticket_tab_index = i.iter;
|
||||
conf_index = i.iter;
|
||||
i.res = conf_index < ticket_info.cur_conf->tab.size();
|
||||
|
||||
i.res = ticket_tab_index < ticket_info.ticket_tab.size();
|
||||
if( i.res )
|
||||
{
|
||||
const TicketConf::TicketItem & conf_item = ticket_info.cur_conf->tab[conf_index];
|
||||
find_ticket_value(conf_item, ticket_info.ticket, &has_value, &value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ticket_tab_url(Info & i)
|
||||
void ticket_tab_param(Info & i)
|
||||
{
|
||||
if( ticket_tab_index < ticket_info.ticket_tab.size() )
|
||||
if( conf_index < ticket_info.cur_conf->tab.size() )
|
||||
HtmlEscape(i.out, ticket_info.cur_conf->tab[conf_index].name);
|
||||
}
|
||||
|
||||
|
||||
void ticket_tab_value(Info & i)
|
||||
{
|
||||
if( has_value )
|
||||
ticket_print_value(i, conf_index, value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ticket_tab_param_index(Info & i)
|
||||
{
|
||||
if( conf_index < ticket_info.cur_conf->tab.size() )
|
||||
i.out << ticket_info.cur_conf->tab[conf_index].id;
|
||||
}
|
||||
|
||||
|
||||
void ticket_tab_value_index(Info & i)
|
||||
{
|
||||
if( has_value )
|
||||
i.out << value;
|
||||
}
|
||||
|
||||
|
||||
void ticket_tab_is_select(Info & i)
|
||||
{
|
||||
if( conf_index < ticket_info.cur_conf->tab.size() )
|
||||
i.res = ticket_info.cur_conf->tab[conf_index].type == TicketConf::TicketItem::TypeSelect;
|
||||
}
|
||||
|
||||
|
||||
void ticket_tab_is_integer(Info & i)
|
||||
{
|
||||
if( conf_index < ticket_info.cur_conf->tab.size() )
|
||||
i.res = ticket_info.cur_conf->tab[conf_index].type == TicketConf::TicketItem::TypeInteger;
|
||||
}
|
||||
|
||||
|
||||
void ticket_tab_select_tab(Info & i)
|
||||
{
|
||||
if( conf_index < ticket_info.cur_conf->tab.size() )
|
||||
{
|
||||
Item * dir = system->dirs.GetDir( ticket_info.ticket_tab[ticket_tab_index].dir_id );
|
||||
|
||||
if( dir )
|
||||
select_index = i.iter;
|
||||
i.res = select_index < ticket_info.cur_conf->tab[conf_index].select.size();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ticket_tab_select_tab_is_default(Info & i)
|
||||
{
|
||||
if( has_value )
|
||||
{
|
||||
i.res = select_index == value;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( conf_index < ticket_info.cur_conf->tab.size() &&
|
||||
select_index < ticket_info.cur_conf->tab[conf_index].select.size() )
|
||||
{
|
||||
HtmlEscape(i.out, dir->url);
|
||||
}
|
||||
else
|
||||
{
|
||||
i.out << "<!-- unknown directory -->";
|
||||
i.res = select_index == ticket_info.cur_conf->tab[conf_index].select_default;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ticket_tab_subject(Info & i)
|
||||
void ticket_tab_select_tab_name(Info & i)
|
||||
{
|
||||
if( ticket_tab_index < ticket_info.ticket_tab.size() )
|
||||
if( conf_index < ticket_info.cur_conf->tab.size() &&
|
||||
select_index < ticket_info.cur_conf->tab[conf_index].select.size() )
|
||||
{
|
||||
Item * dir = system->dirs.GetDir( ticket_info.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 -->";
|
||||
}
|
||||
HtmlEscape(i.out, ticket_info.cur_conf->tab[conf_index].select[select_index].name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ticket_tab_subject_empty(Info & i)
|
||||
void ticket_tab_select_tab_id(Info & i)
|
||||
{
|
||||
i.res = true;
|
||||
|
||||
if( ticket_tab_index < ticket_info.ticket_tab.size() )
|
||||
if( conf_index < ticket_info.cur_conf->tab.size() &&
|
||||
select_index < ticket_info.cur_conf->tab[conf_index].select.size() )
|
||||
{
|
||||
Item * dir = system->dirs.GetDir( ticket_info.ticket_tab[ticket_tab_index].dir_id );
|
||||
|
||||
if( dir )
|
||||
i.res = dir->subject.empty();
|
||||
i.out << ticket_info.cur_conf->tab[conf_index].select[select_index].id;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ticket_tab_author(Info & i)
|
||||
{
|
||||
bool unknown = true;
|
||||
|
||||
|
||||
if( ticket_tab_index < ticket_info.ticket_tab.size() )
|
||||
{
|
||||
Item * dir = system->dirs.GetDir( ticket_info.ticket_tab[ticket_tab_index].dir_id );
|
||||
|
||||
if( dir )
|
||||
{
|
||||
User * puser = system->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
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace ns_ticket_tab
|
||||
|
||||
|
||||
if( unknown )
|
||||
{
|
||||
i.out << "<!-- unknown user -->";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ticket_tab_type(Info & i)
|
||||
{
|
||||
if( ticket_tab_index >= ticket_info.ticket_tab.size() )
|
||||
return;
|
||||
|
||||
Ticket & t = ticket_info.ticket_tab[ticket_tab_index];
|
||||
|
||||
if( t.type < system->mounts.pmount->param[ticket_info.mount_par_ticket_type].arg.size() )
|
||||
HtmlEscape(i.out, system->mounts.pmount->param[ticket_info.mount_par_ticket_type].arg[t.type]);
|
||||
}
|
||||
|
||||
|
||||
void ticket_tab_status(Info & i)
|
||||
{
|
||||
if( ticket_tab_index >= ticket_info.ticket_tab.size() )
|
||||
return;
|
||||
|
||||
Ticket & t = ticket_info.ticket_tab[ticket_tab_index];
|
||||
|
||||
if( t.status < system->mounts.pmount->param[ticket_info.mount_par_ticket_status].arg.size() )
|
||||
HtmlEscape(i.out, system->mounts.pmount->param[ticket_info.mount_par_ticket_status].arg[t.status]);
|
||||
}
|
||||
|
||||
|
||||
void ticket_tab_priority(Info & i)
|
||||
{
|
||||
if( ticket_tab_index >= ticket_info.ticket_tab.size() )
|
||||
return;
|
||||
|
||||
Ticket & t = ticket_info.ticket_tab[ticket_tab_index];
|
||||
|
||||
if( t.priority < system->mounts.pmount->param[ticket_info.mount_par_ticket_priority].arg.size() )
|
||||
HtmlEscape(i.out, system->mounts.pmount->param[ticket_info.mount_par_ticket_priority].arg[t.priority]);
|
||||
}
|
||||
|
||||
|
||||
void ticket_tab_category(Info & i)
|
||||
{
|
||||
if( ticket_tab_index >= ticket_info.ticket_tab.size() )
|
||||
return;
|
||||
|
||||
Ticket & t = ticket_info.ticket_tab[ticket_tab_index];
|
||||
|
||||
if( t.category < system->mounts.pmount->param[ticket_info.mount_par_ticket_category].arg.size() )
|
||||
HtmlEscape(i.out, system->mounts.pmount->param[ticket_info.mount_par_ticket_category].arg[t.category]);
|
||||
}
|
||||
|
||||
|
||||
void ticket_tab_expected(Info & i)
|
||||
{
|
||||
if( ticket_tab_index >= ticket_info.ticket_tab.size() )
|
||||
return;
|
||||
|
||||
Ticket & t = ticket_info.ticket_tab[ticket_tab_index];
|
||||
|
||||
if( t.expected < system->mounts.pmount->param[ticket_info.mount_par_ticket_expected].arg.size() )
|
||||
HtmlEscape(i.out, system->mounts.pmount->param[ticket_info.mount_par_ticket_expected].arg[t.expected]);
|
||||
}
|
||||
|
||||
|
||||
void ticket_tab_progress(Info & i)
|
||||
{
|
||||
if( ticket_tab_index >= ticket_info.ticket_tab.size() )
|
||||
return;
|
||||
|
||||
i.out << ticket_info.ticket_tab[ticket_tab_index].progress;
|
||||
}
|
||||
|
||||
|
||||
void ticket_tab_progress_image_number(Info & i)
|
||||
{
|
||||
if( ticket_tab_index >= ticket_info.ticket_tab.size() )
|
||||
return;
|
||||
|
||||
int percent = ticket_info.ticket_tab[ticket_tab_index].progress;
|
||||
i.out << ticket_calc_progress_image_number(percent);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
|
||||
static size_t ticket_type_tab_ind;
|
||||
|
||||
|
||||
void ticket_type_tab(Info & i)
|
||||
{
|
||||
ticket_type_tab_ind = i.iter;
|
||||
|
||||
i.res = ticket_type_tab_ind < system->mounts.pmount->param[ticket_info.mount_par_ticket_type].arg.size();
|
||||
}
|
||||
|
||||
|
||||
void ticket_type_tab_defined(Info & i)
|
||||
{
|
||||
i.res = system->mounts.pmount->param[ticket_info.mount_par_ticket_type].defined;
|
||||
}
|
||||
|
||||
|
||||
void ticket_type_tab_isdefault(Info & i)
|
||||
{
|
||||
if( ticket_info.is_ticket )
|
||||
{
|
||||
i.res = (ticket_type_tab_ind == ticket_info.ticket.type);
|
||||
}
|
||||
else
|
||||
{
|
||||
Mount::ParamRow & p = system->mounts.pmount->param[ticket_info.mount_par_ticket_type_default];
|
||||
|
||||
if( !p.defined || p.arg.empty() )
|
||||
return; // default false
|
||||
|
||||
size_t value = atoi( p.arg[0].c_str() );
|
||||
i.res = (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 < system->mounts.pmount->param[ticket_info.mount_par_ticket_type].arg.size() )
|
||||
HtmlEscape(i.out, system->mounts.pmount->param[ticket_info.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.res = ticket_status_tab_ind < system->mounts.pmount->param[ticket_info.mount_par_ticket_status].arg.size();
|
||||
}
|
||||
|
||||
|
||||
void ticket_status_tab_defined(Info & i)
|
||||
{
|
||||
i.res = system->mounts.pmount->param[ticket_info.mount_par_ticket_status].defined;
|
||||
}
|
||||
|
||||
|
||||
void ticket_status_tab_isdefault(Info & i)
|
||||
{
|
||||
if( ticket_info.is_ticket )
|
||||
{
|
||||
i.res = (ticket_status_tab_ind == ticket_info.ticket.status);
|
||||
}
|
||||
else
|
||||
{
|
||||
Mount::ParamRow & p = system->mounts.pmount->param[ticket_info.mount_par_ticket_status_default];
|
||||
|
||||
if( !p.defined || p.arg.empty() )
|
||||
return; // default false
|
||||
|
||||
size_t value = atoi( p.arg[0].c_str() );
|
||||
i.res = (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 < system->mounts.pmount->param[ticket_info.mount_par_ticket_status].arg.size() )
|
||||
HtmlEscape(i.out, system->mounts.pmount->param[ticket_info.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.res = ticket_priority_tab_ind < system->mounts.pmount->param[ticket_info.mount_par_ticket_priority].arg.size();
|
||||
}
|
||||
|
||||
|
||||
void ticket_priority_tab_defined(Info & i)
|
||||
{
|
||||
i.res = system->mounts.pmount->param[ticket_info.mount_par_ticket_priority].defined;
|
||||
}
|
||||
|
||||
|
||||
void ticket_priority_tab_isdefault(Info & i)
|
||||
{
|
||||
if( ticket_info.is_ticket )
|
||||
{
|
||||
i.res = (ticket_priority_tab_ind == ticket_info.ticket.priority);
|
||||
}
|
||||
else
|
||||
{
|
||||
Mount::ParamRow & p = system->mounts.pmount->param[ticket_info.mount_par_ticket_priority_default];
|
||||
|
||||
if( !p.defined || p.arg.empty() )
|
||||
return; // default false
|
||||
|
||||
size_t value = atoi( p.arg[0].c_str() );
|
||||
i.res = (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 < system->mounts.pmount->param[ticket_info.mount_par_ticket_priority].arg.size() )
|
||||
HtmlEscape(i.out, system->mounts.pmount->param[ticket_info.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.res = ticket_category_tab_ind < system->mounts.pmount->param[ticket_info.mount_par_ticket_category].arg.size();
|
||||
}
|
||||
|
||||
|
||||
void ticket_category_tab_defined(Info & i)
|
||||
{
|
||||
i.res = system->mounts.pmount->param[ticket_info.mount_par_ticket_category].defined;
|
||||
}
|
||||
|
||||
|
||||
void ticket_category_tab_isdefault(Info & i)
|
||||
{
|
||||
if( ticket_info.is_ticket )
|
||||
{
|
||||
i.res = (ticket_category_tab_ind == ticket_info.ticket.category);
|
||||
}
|
||||
else
|
||||
{
|
||||
Mount::ParamRow & p = system->mounts.pmount->param[ticket_info.mount_par_ticket_category_default];
|
||||
|
||||
if( !p.defined || p.arg.empty() )
|
||||
return; // default false
|
||||
|
||||
size_t value = atoi( p.arg[0].c_str() );
|
||||
i.res = (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 < system->mounts.pmount->param[ticket_info.mount_par_ticket_category].arg.size() )
|
||||
HtmlEscape(i.out, system->mounts.pmount->param[ticket_info.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.res = ticket_expected_tab_ind < system->mounts.pmount->param[ticket_info.mount_par_ticket_expected].arg.size();
|
||||
}
|
||||
|
||||
|
||||
void ticket_expected_tab_defined(Info & i)
|
||||
{
|
||||
i.res = system->mounts.pmount->param[ticket_info.mount_par_ticket_expected].defined;
|
||||
}
|
||||
|
||||
|
||||
void ticket_expected_tab_isdefault(Info & i)
|
||||
{
|
||||
if( ticket_info.is_ticket )
|
||||
{
|
||||
i.res = (ticket_expected_tab_ind == ticket_info.ticket.expected);
|
||||
}
|
||||
else
|
||||
{
|
||||
Mount::ParamRow & p = system->mounts.pmount->param[ticket_info.mount_par_ticket_expected_default];
|
||||
|
||||
if( !p.defined || p.arg.empty() )
|
||||
return; // default false
|
||||
|
||||
size_t value = atoi( p.arg[0].c_str() );
|
||||
i.res = (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 < system->mounts.pmount->param[ticket_info.mount_par_ticket_expected].arg.size() )
|
||||
HtmlEscape(i.out, system->mounts.pmount->param[ticket_info.mount_par_ticket_expected].arg[ticket_expected_tab_ind]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void AddEzcFunctions(PluginInfo & info)
|
||||
{
|
||||
using namespace ns_tickets_tab;
|
||||
using namespace ns_ticket_tab;
|
||||
|
||||
|
||||
Ezc::Functions * fun = reinterpret_cast<Ezc::Functions*>(info.p1);
|
||||
|
||||
fun->Insert("ticket_is", ticket_is);
|
||||
fun->Insert("ticket_item_subject", ticket_item_subject);
|
||||
fun->Insert("ticket_item_content", ticket_item_content);
|
||||
fun->Insert("ticket_item_content_type_is", ticket_item_content_type_is);
|
||||
fun->Insert("ticket_item_print_content", ticket_item_print_content);
|
||||
fun->Insert("ticket_can_create", ticket_can_create);
|
||||
fun->Insert("ticket_can_edit", ticket_can_edit);
|
||||
|
||||
fun->Insert("tickets_tab", tickets_tab);
|
||||
fun->Insert("tickets_tab_url", tickets_tab_url);
|
||||
fun->Insert("tickets_tab_subject_empty", tickets_tab_subject_empty);
|
||||
fun->Insert("tickets_tab_subject", tickets_tab_subject);
|
||||
fun->Insert("tickets_tab_url", tickets_tab_url);
|
||||
|
||||
|
||||
fun->Insert("tickets_tab_conf_tab", tickets_tab_conf_tab);
|
||||
fun->Insert("tickets_tab_conf_tab_value", tickets_tab_conf_tab_value);
|
||||
fun->Insert("tickets_tab_conf_tab_is_progress", tickets_tab_conf_tab_is_progress);
|
||||
fun->Insert("tickets_tab_conf_tab_progress_image_number", tickets_tab_conf_tab_progress_image_number);
|
||||
|
||||
|
||||
fun->Insert("ticket_tab", ticket_tab);
|
||||
fun->Insert("ticket_tab_param", ticket_tab_param);
|
||||
fun->Insert("ticket_tab_value", ticket_tab_value);
|
||||
fun->Insert("ticket_tab_param_index", ticket_tab_param_index);
|
||||
fun->Insert("ticket_tab_value_index", ticket_tab_value_index);
|
||||
|
||||
fun->Insert("ticket_tab_is_select", ticket_tab_is_select);
|
||||
fun->Insert("ticket_tab_is_integer", ticket_tab_is_integer);
|
||||
|
||||
fun->Insert("ticket_tab_select_tab", ticket_tab_select_tab);
|
||||
fun->Insert("ticket_tab_select_tab_is_default", ticket_tab_select_tab_is_default);
|
||||
fun->Insert("ticket_tab_select_tab_id", ticket_tab_select_tab_id);
|
||||
fun->Insert("ticket_tab_select_tab_name", ticket_tab_select_tab_name);
|
||||
|
||||
|
||||
/*
|
||||
fun->Insert("ticket_type", ticket_type);
|
||||
fun->Insert("ticket_status", ticket_status);
|
||||
fun->Insert("ticket_priority", ticket_priority);
|
||||
@@ -640,6 +450,7 @@ void AddEzcFunctions(PluginInfo & info)
|
||||
fun->Insert("ticket_expected_tab_isdefault", ticket_expected_tab_isdefault);
|
||||
fun->Insert("ticket_expected_tab_index", ticket_expected_tab_index);
|
||||
fun->Insert("ticket_expected_tab_name", ticket_expected_tab_name);
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user