fixed: compiling in the clang (new version of c++ std lib)
(added some header files) added: three messsages in ticket plugin: // send by showtickets winix function when tickets are loaded (and sorted) // in p1 you have a pointer to the ticket tab: std::vector<Ticket::Ticket> (include "ticket.h") // in p2 you have a pointer to the sort tab: std::vector<Item*> // those tables don't have to be equal in size (in the case when there is no some tickets in the database) #define WINIX_PL_TICKET_TICKETS_LOADED 4106 // a new ticket has been added // in p1 you have a pointer to the Ticket::Ticket structure (include "ticket.h") // in p2 you have a pointer to the Item structure #define WINIX_PL_TICKET_ADDED_NEW 4107 // a ticket has been changed // in p1 you have a pointer to the Ticket::Ticket structure (include "ticket.h") // in p2 you have a pointer to the Item structure #define WINIX_PL_TICKET_CHANGED 4108 added: two ezc functions for tickets: ticket_does_param_id_have_value() tickets_tab_does_param_id_have_value() (they take two integer arguments -- testing whether a specified param_id has the given value) changed: some more minor additions in tickets templates git-svn-id: svn://ttmath.org/publicrep/winix/trunk@932 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -37,15 +37,22 @@ extern EditTicket fun_edit_ticket;
|
||||
struct TicketValue
|
||||
{
|
||||
bool is_param; // true if there is a paremeter (in config Space)
|
||||
|
||||
PT::Space * config_par; // current space param (from current config) if is_param is true
|
||||
// when is_param is true then this pointer is never null
|
||||
long param_id; // param id (the same as config_par->Long(L"id"))
|
||||
bool is_value; // true if value for such a param was defined
|
||||
bool is_in_ticket_par; // true if the value is defined in ticket.par_tab
|
||||
// else the value is defined in meta
|
||||
|
||||
Ticket::TicketParam * ticket_par; // if is_in_ticket_par is true:
|
||||
PT::Space * value_meta; // if is_in_ticket_par is false:
|
||||
long param_id; // param id (the same as config_par->Long(L"id"))
|
||||
|
||||
bool is_value; // true if value for such a param was defined
|
||||
// (either in ticket_par or in meta)
|
||||
// *you have to check this variable first before using ticket_par or value_meta*
|
||||
|
||||
bool is_in_ticket_par; // true if the value is defined in ticket.par_tab
|
||||
// else the value can be defined in meta (or not at all)
|
||||
|
||||
Ticket::TicketParam * ticket_par; // if is_in_ticket_par is true
|
||||
PT::Space * value_meta; // if is_in_ticket_par is false and if there is such a value in meta
|
||||
|
||||
|
||||
TicketValue()
|
||||
{
|
||||
@@ -59,6 +66,7 @@ PT::Space * value_meta; // if is_in_ticket_par is false:
|
||||
param_id = 0;
|
||||
is_value = false;
|
||||
is_in_ticket_par = false;
|
||||
ticket_par = 0;
|
||||
value_meta = 0;
|
||||
}
|
||||
};
|
||||
@@ -276,8 +284,7 @@ void ticket_meta_value(Info & i)
|
||||
|
||||
void ticket_is_closed(Info & i)
|
||||
{
|
||||
// !! CHECKME should it be cur->request->item?
|
||||
PT::Space * ticket_space = cur->request->item.ameta.FindSpace(L"ticket");
|
||||
PT::Space * ticket_space = ticket_info.item->ameta.FindSpace(L"ticket");
|
||||
|
||||
if( ticket_space )
|
||||
i.res = ticket_space->Bool(L"closed", false);
|
||||
@@ -318,6 +325,53 @@ void ticket_param_value_for_param_id(Info & i)
|
||||
}
|
||||
|
||||
|
||||
// it takes two integer parameters (param id and value)
|
||||
void ticket_does_param_id_have_value(Info & i)
|
||||
{
|
||||
value_for_param_id.Clear();
|
||||
|
||||
size_t conf_index = 0;
|
||||
PT::Space & space = *ticket_info.cur_conf;
|
||||
|
||||
if( i.params.size() == 2 )
|
||||
{
|
||||
long id = Tol(i.params[0]);
|
||||
long id2 = Tol(i.params[1]);
|
||||
|
||||
for( ; conf_index < space.spaces.size() ; ++conf_index)
|
||||
{
|
||||
if( space.spaces[conf_index]->name == L"param" &&
|
||||
space.spaces[conf_index]->Int(L"id") == id )
|
||||
{
|
||||
value_for_param_id.Clear();
|
||||
value_for_param_id.is_param = true;
|
||||
value_for_param_id.config_par = space.spaces[conf_index];
|
||||
value_for_param_id.param_id = value_for_param_id.config_par->Long(L"id");
|
||||
|
||||
if( ticket_info.ticket && ticket_info.item )
|
||||
{
|
||||
find_ticket_value(value_for_param_id, ticket_info.ticket->par_tab, ticket_info.item->meta);
|
||||
|
||||
if( value_for_param_id.is_value )
|
||||
{
|
||||
if( value_for_param_id.is_in_ticket_par )
|
||||
{
|
||||
i.res = value_for_param_id.ticket_par->intv == id2;
|
||||
}
|
||||
else
|
||||
{
|
||||
log << log1 << "Ticket: ticket_does_param_id_have_value cannot be used with meta values"
|
||||
<< logend;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
namespace ns_tickets_tab
|
||||
@@ -331,7 +385,7 @@ struct TicketsTabValue
|
||||
Ticket * ticket; // pointer to the ticket (if is_ticket is true)
|
||||
|
||||
/*
|
||||
there can be two situations:
|
||||
there can be three situations:
|
||||
- is_item is false and is_ticket is false
|
||||
- is_item is true and is_ticket is false
|
||||
- is_item is true and is_ticket is true
|
||||
@@ -439,18 +493,17 @@ void tickets_tab(Info & i)
|
||||
// !! IMPROVEME if there is no a ticket (find_ticket returns false)
|
||||
// may we add en ampty ticket and tickets_value.ticket will be pointing to it?
|
||||
|
||||
// !! IMPROVE ME change the name of the message
|
||||
// !! IMPROVEME change the name of the message
|
||||
plugin.Call(WINIX_PL_TICKET_TICKETS_TAB_IS_NEXT, tickets_value.item);
|
||||
|
||||
if( find_ticket(file_id, ticket_info.ticket_tab, ticket_index) )
|
||||
{
|
||||
tickets_value.is_ticket = true;
|
||||
tickets_value.ticket = &ticket_info.ticket_tab[ticket_index];
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
log << log1 << "Ticket: I cannot find a ticket for file_id: " << file_id << logend;
|
||||
}
|
||||
|
||||
plugin.Call(WINIX_PL_THREAD_SET_SORTTAB_INDEX, item_sort_index);
|
||||
@@ -482,6 +535,7 @@ void tickets_tab_url(Info & i)
|
||||
}
|
||||
|
||||
|
||||
// !! IMPROVEME change name to tickets_tab_subject_is_empty
|
||||
void tickets_tab_subject_empty(Info & i)
|
||||
{
|
||||
tickets_tab_check_reqid();
|
||||
@@ -555,7 +609,6 @@ void tickets_tab_param_value_for_param_id(Info & i)
|
||||
value_for_param_id.config_par = space.spaces[param_index];
|
||||
value_for_param_id.param_id = value_for_param_id.config_par->Long(L"id");
|
||||
|
||||
// !! CHECKME don't we have to test tickets_value.ticket and tickets_value.item?
|
||||
find_ticket_value(value_for_param_id, tickets_value.ticket->par_tab, tickets_value.item->meta);
|
||||
ticket_print_value(i, value_for_param_id);
|
||||
|
||||
@@ -567,6 +620,50 @@ void tickets_tab_param_value_for_param_id(Info & i)
|
||||
|
||||
|
||||
|
||||
// it takes two integer parameters (param id and value)
|
||||
void tickets_tab_does_param_id_have_value(Info & i)
|
||||
{
|
||||
tickets_tab_check_reqid();
|
||||
|
||||
if( tickets_value.is_ticket && i.params.size() == 2 )
|
||||
{
|
||||
size_t param_index = 0;
|
||||
PT::Space & space = *ticket_info.cur_conf;
|
||||
long id = Toi(i.params[0]);
|
||||
long id2 = Toi(i.params[1]);
|
||||
|
||||
for( ; param_index < space.spaces.size() ; ++param_index)
|
||||
{
|
||||
if( space.spaces[param_index]->name == L"param" &&
|
||||
space.spaces[param_index]->Int(L"id") == id )
|
||||
{
|
||||
value_for_param_id.Clear();
|
||||
value_for_param_id.is_param = true;
|
||||
value_for_param_id.config_par = space.spaces[param_index];
|
||||
value_for_param_id.param_id = value_for_param_id.config_par->Long(L"id");
|
||||
|
||||
find_ticket_value(value_for_param_id, tickets_value.ticket->par_tab, tickets_value.item->meta);
|
||||
|
||||
if( value_for_param_id.is_value )
|
||||
{
|
||||
if( value_for_param_id.is_in_ticket_par )
|
||||
{
|
||||
i.res = value_for_param_id.ticket_par->intv == id2;
|
||||
}
|
||||
else
|
||||
{
|
||||
log << log1 << "Ticket: tickets_tab_does_param_id_have_value cannot be used with meta values"
|
||||
<< logend;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void tickets_tab_conf_tab(Info & i)
|
||||
{
|
||||
tickets_tab_check_reqid();
|
||||
@@ -601,6 +698,25 @@ void tickets_tab_conf_tab_has_value(Info & i)
|
||||
}
|
||||
|
||||
|
||||
void tickets_tab_conf_tab_param_id(Info & i)
|
||||
{
|
||||
tickets_tab_check_reqid();
|
||||
|
||||
if( value.is_param )
|
||||
i.out << value.param_id;
|
||||
}
|
||||
|
||||
|
||||
// takes one parameter
|
||||
void tickets_tab_conf_tab_param_id_is(Info & i)
|
||||
{
|
||||
tickets_tab_check_reqid();
|
||||
|
||||
if( value.is_param )
|
||||
i.res = (value.param_id == Tol(i.par));
|
||||
}
|
||||
|
||||
|
||||
void tickets_tab_conf_tab_param_name(Info & i)
|
||||
{
|
||||
tickets_tab_check_reqid();
|
||||
@@ -794,6 +910,16 @@ void ticket_tab_param_id(Info & i)
|
||||
}
|
||||
|
||||
|
||||
// takes one parameter
|
||||
void ticket_tab_param_id_is(Info & i)
|
||||
{
|
||||
ticket_tab_check_reqid();
|
||||
|
||||
if( value.is_param )
|
||||
i.res = (value.param_id == Tol(i.par));
|
||||
}
|
||||
|
||||
|
||||
void ticket_tab_param_name(Info & i)
|
||||
{
|
||||
ticket_tab_check_reqid();
|
||||
@@ -1034,60 +1160,64 @@ using namespace ns_ticket_tab;
|
||||
using TemplatesFunctions::EzcFun;
|
||||
EzcFun * fun = reinterpret_cast<EzcFun*>(info.p1);
|
||||
|
||||
fun->Insert("ticket_can_create", ticket_can_create);
|
||||
fun->Insert("ticket_can_edit", ticket_can_edit);
|
||||
fun->Insert("ticket_is_creating_new", ticket_is_creating_new);
|
||||
fun->Insert("ticket_meta_value", ticket_meta_value);
|
||||
fun->Insert("ticket_is_closed", ticket_is_closed);
|
||||
fun->Insert("ticket_can_create", ticket_can_create);
|
||||
fun->Insert("ticket_can_edit", ticket_can_edit);
|
||||
fun->Insert("ticket_is_creating_new", ticket_is_creating_new);
|
||||
fun->Insert("ticket_meta_value", ticket_meta_value);
|
||||
fun->Insert("ticket_is_closed", ticket_is_closed);
|
||||
|
||||
fun->Insert("ticket_param_value_for_param_id", ticket_param_value_for_param_id);
|
||||
fun->Insert("ticket_param_value_for_param_id", ticket_param_value_for_param_id);
|
||||
fun->Insert("ticket_does_param_id_have_value", ticket_does_param_id_have_value);
|
||||
|
||||
fun->Insert("tickets_tab", tickets_tab);
|
||||
fun->Insert("tickets_tab_is_closed", tickets_tab_is_closed);
|
||||
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_meta_value", tickets_tab_meta_value);
|
||||
fun->Insert("tickets_tab_date_creation", tickets_tab_date_creation);
|
||||
fun->Insert("tickets_tab_date_creation_nice", tickets_tab_date_creation_nice);
|
||||
|
||||
fun->Insert("tickets_tab_param_value_for_param_id", tickets_tab_param_value_for_param_id);
|
||||
fun->Insert("tickets_tab_does_param_id_have_value", tickets_tab_does_param_id_have_value);
|
||||
|
||||
fun->Insert("tickets_tab_conf_tab", tickets_tab_conf_tab);
|
||||
fun->Insert("tickets_tab_conf_tab_has_value", tickets_tab_conf_tab_has_value);
|
||||
fun->Insert("tickets_tab_conf_tab_param_id", tickets_tab_conf_tab_param_id);
|
||||
fun->Insert("tickets_tab_conf_tab_param_id_is", tickets_tab_conf_tab_param_id_is);
|
||||
fun->Insert("tickets_tab_conf_tab_param_name", tickets_tab_conf_tab_param_name);
|
||||
fun->Insert("tickets_tab_conf_tab_value", tickets_tab_conf_tab_value);
|
||||
fun->Insert("tickets_tab_conf_tab_type_is", tickets_tab_conf_tab_type_is);
|
||||
fun->Insert("tickets_tab_conf_tab_progress_image_number", tickets_tab_conf_tab_progress_image_number);
|
||||
fun->Insert("tickets_tab_conf_tab_file_tab", tickets_tab_conf_tab_file_tab);
|
||||
fun->Insert("tickets_tab_conf_tab_file_tab_index", tickets_tab_conf_tab_file_tab_index);
|
||||
fun->Insert("tickets_tab_conf_tab_file_tab_path", tickets_tab_conf_tab_file_tab_path);
|
||||
fun->Insert("tickets_tab_conf_tab_file_tab_itemid", tickets_tab_conf_tab_file_tab_itemid);
|
||||
fun->Insert("tickets_tab_conf_tab_file_tab_meta", tickets_tab_conf_tab_file_tab_meta);
|
||||
|
||||
|
||||
fun->Insert("tickets_tab", tickets_tab);
|
||||
fun->Insert("tickets_tab_is_closed", tickets_tab_is_closed);
|
||||
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_meta_value", tickets_tab_meta_value);
|
||||
fun->Insert("tickets_tab_date_creation", tickets_tab_date_creation);
|
||||
fun->Insert("tickets_tab_date_creation_nice", tickets_tab_date_creation_nice);
|
||||
fun->Insert("ticket_tab", ticket_tab);
|
||||
fun->Insert("ticket_tab_param_id", ticket_tab_param_id);
|
||||
fun->Insert("ticket_tab_param_id_is", ticket_tab_param_id_is);
|
||||
fun->Insert("ticket_tab_param_name", ticket_tab_param_name);
|
||||
fun->Insert("ticket_tab_has_value", ticket_tab_has_value);
|
||||
fun->Insert("ticket_tab_value", ticket_tab_value);
|
||||
fun->Insert("ticket_tab_value_int", ticket_tab_value_int);
|
||||
fun->Insert("ticket_tab_value_dec", ticket_tab_value_dec);
|
||||
fun->Insert("ticket_tab_value_meta", ticket_tab_value_meta);
|
||||
fun->Insert("ticket_tab_type_is", ticket_tab_type_is);
|
||||
|
||||
fun->Insert("tickets_tab_param_value_for_param_id", tickets_tab_param_value_for_param_id);
|
||||
fun->Insert("ticket_tab_select_tab", ticket_tab_select_tab);
|
||||
fun->Insert("ticket_tab_select_tab_is_selected", ticket_tab_select_tab_is_selected);
|
||||
fun->Insert("ticket_tab_select_tab_name", ticket_tab_select_tab_name);
|
||||
fun->Insert("ticket_tab_select_tab_id", ticket_tab_select_tab_id);
|
||||
fun->Insert("ticket_tab_select_tab_meta", ticket_tab_select_tab_meta);
|
||||
|
||||
fun->Insert("tickets_tab_conf_tab", tickets_tab_conf_tab);
|
||||
fun->Insert("tickets_tab_conf_tab_has_value", tickets_tab_conf_tab_has_value);
|
||||
fun->Insert("tickets_tab_conf_tab_param_name", tickets_tab_conf_tab_param_name);
|
||||
fun->Insert("tickets_tab_conf_tab_value", tickets_tab_conf_tab_value);
|
||||
fun->Insert("tickets_tab_conf_tab_type_is", tickets_tab_conf_tab_type_is);
|
||||
fun->Insert("tickets_tab_conf_tab_progress_image_number", tickets_tab_conf_tab_progress_image_number);
|
||||
fun->Insert("tickets_tab_conf_tab_file_tab", tickets_tab_conf_tab_file_tab);
|
||||
fun->Insert("tickets_tab_conf_tab_file_tab_index", tickets_tab_conf_tab_file_tab_index);
|
||||
fun->Insert("tickets_tab_conf_tab_file_tab_path", tickets_tab_conf_tab_file_tab_path);
|
||||
fun->Insert("tickets_tab_conf_tab_file_tab_itemid", tickets_tab_conf_tab_file_tab_itemid);
|
||||
fun->Insert("tickets_tab_conf_tab_file_tab_meta", tickets_tab_conf_tab_file_tab_meta);
|
||||
|
||||
|
||||
fun->Insert("ticket_tab", ticket_tab);
|
||||
fun->Insert("ticket_tab_param_id", ticket_tab_param_id);
|
||||
fun->Insert("ticket_tab_param_name", ticket_tab_param_name);
|
||||
fun->Insert("ticket_tab_has_value", ticket_tab_has_value);
|
||||
fun->Insert("ticket_tab_value", ticket_tab_value);
|
||||
fun->Insert("ticket_tab_value_int", ticket_tab_value_int);
|
||||
fun->Insert("ticket_tab_value_dec", ticket_tab_value_dec);
|
||||
fun->Insert("ticket_tab_value_meta", ticket_tab_value_meta);
|
||||
fun->Insert("ticket_tab_type_is", ticket_tab_type_is);
|
||||
|
||||
fun->Insert("ticket_tab_select_tab", ticket_tab_select_tab);
|
||||
fun->Insert("ticket_tab_select_tab_is_selected", ticket_tab_select_tab_is_selected);
|
||||
fun->Insert("ticket_tab_select_tab_name", ticket_tab_select_tab_name);
|
||||
fun->Insert("ticket_tab_select_tab_id", ticket_tab_select_tab_id);
|
||||
fun->Insert("ticket_tab_select_tab_meta", ticket_tab_select_tab_meta);
|
||||
|
||||
fun->Insert("ticket_tab_file_tab", ticket_tab_file_tab);
|
||||
fun->Insert("ticket_tab_file_tab_index", ticket_tab_file_tab_index);
|
||||
fun->Insert("ticket_tab_file_tab_path", ticket_tab_file_tab_path);
|
||||
fun->Insert("ticket_tab_file_tab_itemid", ticket_tab_file_tab_itemid);
|
||||
fun->Insert("ticket_tab_file_tab_meta", ticket_tab_file_tab_meta);
|
||||
fun->Insert("ticket_tab_file_tab", ticket_tab_file_tab);
|
||||
fun->Insert("ticket_tab_file_tab_index", ticket_tab_file_tab_index);
|
||||
fun->Insert("ticket_tab_file_tab_path", ticket_tab_file_tab_path);
|
||||
fun->Insert("ticket_tab_file_tab_itemid", ticket_tab_file_tab_itemid);
|
||||
fun->Insert("ticket_tab_file_tab_meta", ticket_tab_file_tab_meta);
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user