namespace PT renamed to pt
This commit is contained in:
@@ -164,13 +164,13 @@ return ticket;
|
||||
}
|
||||
|
||||
|
||||
PT::Space & CreateTicket::PrepareSpace()
|
||||
pt::Space & CreateTicket::PrepareSpace()
|
||||
{
|
||||
SessionData * session_data = reinterpret_cast<SessionData*>(
|
||||
cur->session->plugin_data.Get(ticket_info->plugin_id) );
|
||||
|
||||
long dir_id = cur->request->dir_tab.back()->id;
|
||||
PT::Space & new_space = session_data->GetNewSpace(dir_id, session_data->create_space_map);
|
||||
pt::Space & new_space = session_data->GetNewSpace(dir_id, session_data->create_space_map);
|
||||
|
||||
return new_space;
|
||||
}
|
||||
@@ -182,7 +182,7 @@ void CreateTicket::MakePost()
|
||||
ticket_info->FindCurrentConf();
|
||||
|
||||
Ticket & ticket = PrepareTicket();
|
||||
PT::Space & meta = PrepareSpace();
|
||||
pt::Space & meta = PrepareSpace();
|
||||
Item & item = cur->request->item;
|
||||
ticket_info->ticket = &ticket;
|
||||
ticket_info->item = &item;
|
||||
@@ -209,7 +209,7 @@ void CreateTicket::MakeGet()
|
||||
ticket_info->FindCurrentConf();
|
||||
|
||||
Ticket & ticket = PrepareTicket();
|
||||
PT::Space & meta = PrepareSpace();
|
||||
pt::Space & meta = PrepareSpace();
|
||||
ticket_info->ticket = &ticket;
|
||||
ticket_info->item = &cur->request->item;
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ private:
|
||||
void Submit(Ticket & ticket, Item & item);
|
||||
void RemoveTmpTicket();
|
||||
Ticket & PrepareTicket();
|
||||
PT::Space & PrepareSpace();
|
||||
pt::Space & PrepareSpace();
|
||||
|
||||
TDb * tdb;
|
||||
TicketInfo * ticket_info;
|
||||
|
||||
@@ -174,23 +174,23 @@ return ticket;
|
||||
|
||||
|
||||
|
||||
PT::Space & EditTicket::PrepareSpace()
|
||||
pt::Space & EditTicket::PrepareSpace()
|
||||
{
|
||||
SessionData * session_data = reinterpret_cast<SessionData*>(
|
||||
cur->session->plugin_data.Get(ticket_info->plugin_id) );
|
||||
|
||||
bool is_new;
|
||||
long file_id = cur->request->item.id;
|
||||
PT::Space & new_space = session_data->GetNewSpace(file_id, session_data->edit_space_map, &is_new);
|
||||
pt::Space & new_space = session_data->GetNewSpace(file_id, session_data->edit_space_map, &is_new);
|
||||
|
||||
if( is_new )
|
||||
{
|
||||
PT::Space * ticket_space = cur->request->item.item_content.meta.find_child_space(L"ticket");
|
||||
pt::Space * ticket_space = cur->request->item.item_content.meta.find_child_space(L"ticket");
|
||||
|
||||
if( ticket_space )
|
||||
{
|
||||
new_space = *ticket_space;
|
||||
PT::Space & old_space = session_data->GetOldSpace(file_id, session_data->edit_space_map);
|
||||
pt::Space & old_space = session_data->GetOldSpace(file_id, session_data->edit_space_map);
|
||||
old_space = new_space;
|
||||
}
|
||||
}
|
||||
@@ -203,10 +203,10 @@ bool EditTicket::CloseTicket()
|
||||
{
|
||||
cur->request->item.propagate_connector();
|
||||
|
||||
PT::Space & ticket_space = cur->request->item.item_content.meta_admin.find_add_child_space(L"ticket");
|
||||
pt::Space & ticket_space = cur->request->item.item_content.meta_admin.find_add_child_space(L"ticket");
|
||||
ticket_space.add(L"closed", true);
|
||||
|
||||
PT::Space & thread_space = cur->request->item.item_content.meta_admin.find_add_child_space(L"thread");
|
||||
pt::Space & thread_space = cur->request->item.item_content.meta_admin.find_add_child_space(L"thread");
|
||||
thread_space.add(L"closed", true);
|
||||
|
||||
//if( db->EditAdminMetaById(cur->request->item.ameta, cur->request->item.id) == WINIX_ERR_OK )
|
||||
@@ -228,7 +228,7 @@ void EditTicket::MakePost()
|
||||
ticket_info->FindCurrentConf();
|
||||
|
||||
Ticket & ticket = PrepareTicket();
|
||||
PT::Space & meta = PrepareSpace();
|
||||
pt::Space & meta = PrepareSpace();
|
||||
Item & item = cur->request->item;
|
||||
|
||||
old_url = item.url;
|
||||
@@ -267,7 +267,7 @@ void EditTicket::MakeGet()
|
||||
ticket_info->FindCurrentConf();
|
||||
|
||||
Ticket & ticket = PrepareTicket();
|
||||
PT::Space & meta = PrepareSpace();
|
||||
pt::Space & meta = PrepareSpace();
|
||||
ticket_info->ticket = &ticket;
|
||||
ticket_info->item = &cur->request->item;
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ private:
|
||||
|
||||
void RemoveTmpTicket();
|
||||
Ticket & PrepareTicket();
|
||||
PT::Space & PrepareSpace();
|
||||
pt::Space & PrepareSpace();
|
||||
void ChangeTicket(Ticket & ticket, Item & item);
|
||||
void Submit(Ticket & ticket, Item & item);
|
||||
bool CloseTicket();
|
||||
|
||||
@@ -83,7 +83,7 @@ SpaceMap::iterator i;
|
||||
|
||||
|
||||
|
||||
void SessionData::RemoveAllFiles(PT::Space & new_space)
|
||||
void SessionData::RemoveAllFiles(pt::Space & new_space)
|
||||
{
|
||||
std::vector<long> new_file_tab;
|
||||
BuildFileList(new_file_tab, new_space);
|
||||
@@ -94,7 +94,7 @@ void SessionData::RemoveAllFiles(PT::Space & new_space)
|
||||
|
||||
|
||||
|
||||
void SessionData::RemoveAllStaleFiles(PT::Space & new_space, PT::Space & old_space)
|
||||
void SessionData::RemoveAllStaleFiles(pt::Space & new_space, pt::Space & old_space)
|
||||
{
|
||||
std::vector<long> new_file_tab;
|
||||
std::vector<long> old_file_tab;
|
||||
@@ -140,7 +140,7 @@ void SessionData::RemoveAllStaleFiles(PT::Space & new_space, PT::Space & old_spa
|
||||
|
||||
|
||||
|
||||
void SessionData::BuildFileList(std::vector<long> & file_tab, PT::Space & space)
|
||||
void SessionData::BuildFileList(std::vector<long> & file_tab, pt::Space & space)
|
||||
{
|
||||
file_tab.clear();
|
||||
|
||||
@@ -148,7 +148,7 @@ void SessionData::BuildFileList(std::vector<long> & file_tab, PT::Space & space)
|
||||
{
|
||||
for(size_t i=0 ; i<space.child_spaces->size() ; ++i)
|
||||
{
|
||||
PT::Space & sp = *(*space.child_spaces)[i];
|
||||
pt::Space & sp = *(*space.child_spaces)[i];
|
||||
|
||||
if( sp.name && (*sp.name) == L"param" )
|
||||
CheckFile(file_tab, sp);
|
||||
@@ -157,13 +157,13 @@ void SessionData::BuildFileList(std::vector<long> & file_tab, PT::Space & space)
|
||||
}
|
||||
|
||||
|
||||
void SessionData::CheckFile(std::vector<long> & file_tab, PT::Space & space)
|
||||
void SessionData::CheckFile(std::vector<long> & file_tab, pt::Space & space)
|
||||
{
|
||||
if( space.child_spaces )
|
||||
{
|
||||
for(size_t i=0 ; i<space.child_spaces->size() ; ++i)
|
||||
{
|
||||
PT::Space & subsp = *(*space.child_spaces)[i];
|
||||
pt::Space & subsp = *(*space.child_spaces)[i];
|
||||
|
||||
if( subsp.name && *subsp.name == L"file" )
|
||||
{
|
||||
@@ -194,7 +194,7 @@ return res.first->second;
|
||||
|
||||
|
||||
|
||||
PT::Space & SessionData::GetOldSpace(long id, SpaceMap & space_map, bool * is_new)
|
||||
pt::Space & SessionData::GetOldSpace(long id, SpaceMap & space_map, bool * is_new)
|
||||
{
|
||||
std::pair<SpaceMap::iterator, bool> res = space_map.insert( std::make_pair(id, SpacePair()) );
|
||||
|
||||
@@ -205,7 +205,7 @@ return res.first->second.old_space;
|
||||
}
|
||||
|
||||
|
||||
PT::Space & SessionData::GetNewSpace(long id, SpaceMap & space_map, bool * is_new)
|
||||
pt::Space & SessionData::GetNewSpace(long id, SpaceMap & space_map, bool * is_new)
|
||||
{
|
||||
std::pair<SpaceMap::iterator, bool> res = space_map.insert( std::make_pair(id, SpacePair()) );
|
||||
|
||||
|
||||
@@ -58,8 +58,8 @@ struct SessionData : public PluginDataBase
|
||||
|
||||
struct SpacePair
|
||||
{
|
||||
PT::Space new_space;
|
||||
PT::Space old_space;
|
||||
pt::Space new_space;
|
||||
pt::Space old_space;
|
||||
|
||||
// old_space is used when editing an existing ticket
|
||||
// current ticket space is copied to old_space
|
||||
@@ -95,8 +95,8 @@ struct SessionData : public PluginDataBase
|
||||
Ticket & GetTicket(long id, TicketMap & ticket_map, bool * is_new = 0);
|
||||
|
||||
// inserting and returning a new/old space or just returning the space if it exists
|
||||
PT::Space & GetOldSpace(long id, SpaceMap & space_map, bool * is_new = 0);
|
||||
PT::Space & GetNewSpace(long id, SpaceMap & space_map, bool * is_new = 0);
|
||||
pt::Space & GetOldSpace(long id, SpaceMap & space_map, bool * is_new = 0);
|
||||
pt::Space & GetNewSpace(long id, SpaceMap & space_map, bool * is_new = 0);
|
||||
|
||||
// for deleting files
|
||||
Fun::Rm * fun_rm;
|
||||
@@ -104,11 +104,11 @@ struct SessionData : public PluginDataBase
|
||||
private:
|
||||
|
||||
void RemoveFiles(SpaceMap & space_map, bool only_stale_files);
|
||||
void RemoveAllFiles(PT::Space & new_space);
|
||||
void RemoveAllStaleFiles(PT::Space & new_space, PT::Space & old_space);
|
||||
void RemoveAllFiles(pt::Space & new_space);
|
||||
void RemoveAllStaleFiles(pt::Space & new_space, pt::Space & old_space);
|
||||
|
||||
void BuildFileList(std::vector<long> & file_tab, PT::Space & space);
|
||||
void CheckFile(std::vector<long> & file_tab, PT::Space & space);
|
||||
void BuildFileList(std::vector<long> & file_tab, pt::Space & space);
|
||||
void CheckFile(std::vector<long> & file_tab, pt::Space & space);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ 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
|
||||
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"))
|
||||
@@ -79,7 +79,7 @@ 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
|
||||
pt::Space * value_meta; // if is_in_ticket_par is false and if there is such a value in meta
|
||||
|
||||
|
||||
TicketValue()
|
||||
@@ -169,7 +169,7 @@ return false;
|
||||
looking for a subspace in meta which has id equal to param_id
|
||||
can return a null pointer
|
||||
*/
|
||||
PT::Space * find_ticket_param(long param_id, PT::Space & meta)
|
||||
pt::Space * find_ticket_param(long param_id, pt::Space & meta)
|
||||
{
|
||||
wchar_t param_id_str[50];
|
||||
|
||||
@@ -181,7 +181,7 @@ wchar_t param_id_str[50];
|
||||
|
||||
for(size_t i=0 ; i<meta.child_spaces->size() ; ++i)
|
||||
{
|
||||
PT::Space & sp = *(*meta.child_spaces)[i];
|
||||
pt::Space & sp = *(*meta.child_spaces)[i];
|
||||
|
||||
if( sp.name && *sp.name == L"param" && sp.is_equal(L"id", param_id_str) )
|
||||
return &sp;
|
||||
@@ -211,7 +211,7 @@ return 0;
|
||||
value.ticket_par
|
||||
value.value_meta
|
||||
*/
|
||||
void find_ticket_value(TicketValue & value, Ticket::ParTab & par_tab, PT::Space & item_meta)
|
||||
void find_ticket_value(TicketValue & value, Ticket::ParTab & par_tab, pt::Space & item_meta)
|
||||
{
|
||||
size_t par_index;
|
||||
|
||||
@@ -229,11 +229,11 @@ size_t par_index;
|
||||
}
|
||||
else
|
||||
{
|
||||
PT::Space * meta = item_meta.find_child_space(L"ticket");
|
||||
pt::Space * meta = item_meta.find_child_space(L"ticket");
|
||||
|
||||
if( meta )
|
||||
{
|
||||
PT::Space * sp = find_ticket_param(value.param_id, *meta);
|
||||
pt::Space * sp = find_ticket_param(value.param_id, *meta);
|
||||
|
||||
if( sp )
|
||||
{
|
||||
@@ -253,7 +253,7 @@ void ticket_print_value_select(Info & i, TicketValue & value)
|
||||
{
|
||||
for(size_t a=0 ; a<value.config_par->child_spaces->size() ; ++a)
|
||||
{
|
||||
PT::Space & sp = *(*value.config_par->child_spaces)[a];
|
||||
pt::Space & sp = *(*value.config_par->child_spaces)[a];
|
||||
|
||||
if( sp.name && *sp.name == L"option" && sp.to_long(L"id") == value.ticket_par->intv )
|
||||
{
|
||||
@@ -322,7 +322,7 @@ void ticket_meta_value(Info & i)
|
||||
|
||||
void ticket_is_closed(Info & i)
|
||||
{
|
||||
PT::Space * ticket_space = ticket_info.item->item_content.meta_admin.find_child_space(L"ticket");
|
||||
pt::Space * ticket_space = ticket_info.item->item_content.meta_admin.find_child_space(L"ticket");
|
||||
|
||||
if( ticket_space )
|
||||
i.res = ticket_space->to_bool(L"closed", false);
|
||||
@@ -337,14 +337,14 @@ void ticket_param_value_for_param_id(Info & i)
|
||||
value_for_param_id.Clear();
|
||||
|
||||
size_t conf_index = 0;
|
||||
PT::Space & space = *ticket_info.cur_conf;
|
||||
pt::Space & space = *ticket_info.cur_conf;
|
||||
int id = Toi(i.par);
|
||||
|
||||
if( space.child_spaces )
|
||||
{
|
||||
for( ; conf_index < space.child_spaces->size() ; ++conf_index)
|
||||
{
|
||||
PT::Space & sp = *(*space.child_spaces)[conf_index];
|
||||
pt::Space & sp = *(*space.child_spaces)[conf_index];
|
||||
|
||||
if( sp.name && *sp.name == L"param" && sp.to_int(L"id") == id )
|
||||
{
|
||||
@@ -372,7 +372,7 @@ 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;
|
||||
pt::Space & space = *ticket_info.cur_conf;
|
||||
|
||||
if( i.params.size() == 2 && space.child_spaces )
|
||||
{
|
||||
@@ -381,7 +381,7 @@ void ticket_does_param_id_have_value(Info & i)
|
||||
|
||||
for( ; conf_index < space.child_spaces->size() ; ++conf_index)
|
||||
{
|
||||
PT::Space & sp = *(*space.child_spaces)[conf_index];
|
||||
pt::Space & sp = *(*space.child_spaces)[conf_index];
|
||||
|
||||
if( sp.name && *sp.name == L"param" && sp.to_long(L"id") == id )
|
||||
{
|
||||
@@ -559,7 +559,7 @@ void tickets_tab_is_closed(Info & i)
|
||||
|
||||
if( tickets_value.is_item )
|
||||
{
|
||||
PT::Space * ticket_space = tickets_value.item->item_content.meta_admin.find_child_space(L"ticket");
|
||||
pt::Space * ticket_space = tickets_value.item->item_content.meta_admin.find_child_space(L"ticket");
|
||||
|
||||
if( ticket_space )
|
||||
i.res = ticket_space->to_bool(L"closed", false);
|
||||
@@ -638,14 +638,14 @@ void tickets_tab_param_value_for_param_id(Info & i)
|
||||
if( tickets_value.is_ticket )
|
||||
{
|
||||
size_t param_index = 0;
|
||||
PT::Space & space = *ticket_info.cur_conf;
|
||||
pt::Space & space = *ticket_info.cur_conf;
|
||||
long id = Tol(i.par);
|
||||
|
||||
if( space.child_spaces )
|
||||
{
|
||||
for( ; param_index < space.child_spaces->size() ; ++param_index)
|
||||
{
|
||||
PT::Space & sp = *(*space.child_spaces)[param_index];
|
||||
pt::Space & sp = *(*space.child_spaces)[param_index];
|
||||
|
||||
if( sp.name && *sp.name == L"param" &&
|
||||
sp.to_long(L"id") == id )
|
||||
@@ -675,7 +675,7 @@ void tickets_tab_does_param_id_have_value(Info & i)
|
||||
if( tickets_value.is_ticket && i.params.size() == 2 )
|
||||
{
|
||||
size_t param_index = 0;
|
||||
PT::Space & space = *ticket_info.cur_conf;
|
||||
pt::Space & space = *ticket_info.cur_conf;
|
||||
long id = Toi(i.params[0].str);
|
||||
long id2 = Toi(i.params[1].str);
|
||||
|
||||
@@ -683,7 +683,7 @@ void tickets_tab_does_param_id_have_value(Info & i)
|
||||
{
|
||||
for( ; param_index < space.child_spaces->size() ; ++param_index)
|
||||
{
|
||||
PT::Space & sp = *(*space.child_spaces)[param_index];
|
||||
pt::Space & sp = *(*space.child_spaces)[param_index];
|
||||
|
||||
if( sp.name && *sp.name == L"param" && sp.to_long(L"id") == id )
|
||||
{
|
||||
@@ -723,13 +723,13 @@ void tickets_tab_conf_tab(Info & i)
|
||||
if( tickets_value.is_ticket )
|
||||
{
|
||||
conf_index = i.iter;
|
||||
PT::Space & space = *ticket_info.cur_conf;
|
||||
pt::Space & space = *ticket_info.cur_conf;
|
||||
|
||||
if( space.child_spaces )
|
||||
{
|
||||
while( conf_index < space.child_spaces->size() )
|
||||
{
|
||||
PT::Space & sp = *(*space.child_spaces)[conf_index];
|
||||
pt::Space & sp = *(*space.child_spaces)[conf_index];
|
||||
|
||||
if( sp.name && *sp.name == L"param" )
|
||||
break;
|
||||
@@ -840,13 +840,13 @@ void tickets_tab_conf_tab_file_tab(Info & i)
|
||||
if( i.iter == 0 )
|
||||
tickets_file_number = 0;
|
||||
|
||||
PT::Space & mt = *value.value_meta;
|
||||
pt::Space & mt = *value.value_meta;
|
||||
|
||||
if( mt.child_spaces )
|
||||
{
|
||||
while( tickets_file_index < mt.child_spaces->size() )
|
||||
{
|
||||
PT::Space & sp = *(*mt.child_spaces)[tickets_file_index];
|
||||
pt::Space & sp = *(*mt.child_spaces)[tickets_file_index];
|
||||
|
||||
if( sp.name && *sp.name == L"file" )
|
||||
break;
|
||||
@@ -869,7 +869,7 @@ void tickets_tab_conf_tab_file_tab_index(Info & i)
|
||||
|
||||
if( value.is_value && !value.is_in_ticket_par )
|
||||
{
|
||||
PT::Space & mt = *value.value_meta;
|
||||
pt::Space & mt = *value.value_meta;
|
||||
|
||||
if( mt.child_spaces && tickets_file_index < mt.child_spaces->size() )
|
||||
i.out << tickets_file_number;
|
||||
@@ -884,7 +884,7 @@ void tickets_tab_conf_tab_file_tab_path(Info & i)
|
||||
|
||||
if( value.is_value && !value.is_in_ticket_par )
|
||||
{
|
||||
PT::Space & mt = *value.value_meta;
|
||||
pt::Space & mt = *value.value_meta;
|
||||
|
||||
if( mt.child_spaces && tickets_file_index < mt.child_spaces->size() )
|
||||
i.out << (*mt.child_spaces)[tickets_file_index]->to_wstr(L"path");
|
||||
@@ -898,7 +898,7 @@ void tickets_tab_conf_tab_file_tab_itemid(Info & i)
|
||||
|
||||
if( value.is_value && !value.is_in_ticket_par )
|
||||
{
|
||||
PT::Space & mt = *value.value_meta;
|
||||
pt::Space & mt = *value.value_meta;
|
||||
|
||||
if( mt.child_spaces && tickets_file_index < mt.child_spaces->size() )
|
||||
i.out << (*mt.child_spaces)[tickets_file_index]->to_wstr(L"itemid");
|
||||
@@ -912,7 +912,7 @@ void tickets_tab_conf_tab_file_tab_meta(Info & i)
|
||||
|
||||
if( value.is_value && !value.is_in_ticket_par )
|
||||
{
|
||||
PT::Space & mt = *value.value_meta;
|
||||
pt::Space & mt = *value.value_meta;
|
||||
|
||||
if( mt.child_spaces && tickets_file_index < mt.child_spaces->size() )
|
||||
space_value(i, *(*mt.child_spaces)[tickets_file_index]);
|
||||
@@ -954,13 +954,13 @@ void ticket_tab(Info & i)
|
||||
value.Clear();
|
||||
|
||||
conf_index = i.iter;
|
||||
PT::Space & space = *ticket_info.cur_conf;
|
||||
pt::Space & space = *ticket_info.cur_conf;
|
||||
|
||||
if( space.child_spaces )
|
||||
{
|
||||
while( conf_index < space.child_spaces->size() )
|
||||
{
|
||||
PT::Space & sp = *(*space.child_spaces)[conf_index];
|
||||
pt::Space & sp = *(*space.child_spaces)[conf_index];
|
||||
|
||||
if( sp.name && *sp.name == L"param" )
|
||||
break;
|
||||
@@ -1072,13 +1072,13 @@ void ticket_tab_select_tab(Info & i)
|
||||
if( value.is_param )
|
||||
{
|
||||
select_index = i.iter;
|
||||
PT::Space & sp = *value.config_par;
|
||||
pt::Space & sp = *value.config_par;
|
||||
|
||||
if( sp.child_spaces )
|
||||
{
|
||||
while( select_index < sp.child_spaces->size() )
|
||||
{
|
||||
PT::Space & sp_child = *(*sp.child_spaces)[select_index];
|
||||
pt::Space & sp_child = *(*sp.child_spaces)[select_index];
|
||||
|
||||
if( sp_child.name && *sp_child.name == L"option" )
|
||||
break;
|
||||
@@ -1098,11 +1098,11 @@ void ticket_tab_select_tab_is_selected(Info & i)
|
||||
|
||||
if( value.is_param )
|
||||
{
|
||||
PT::Space & sp = *value.config_par;
|
||||
pt::Space & sp = *value.config_par;
|
||||
|
||||
if( sp.child_spaces && select_index < sp.child_spaces->size() )
|
||||
{
|
||||
PT::Space & sp_child = *(*sp.child_spaces)[select_index];
|
||||
pt::Space & sp_child = *(*sp.child_spaces)[select_index];
|
||||
|
||||
long id = sp_child.to_long(L"id");
|
||||
|
||||
@@ -1126,7 +1126,7 @@ void ticket_tab_select_tab_name(Info & i)
|
||||
|
||||
if( value.is_param )
|
||||
{
|
||||
PT::Space & sp = *value.config_par;
|
||||
pt::Space & sp = *value.config_par;
|
||||
|
||||
if( sp.child_spaces && select_index < sp.child_spaces->size() )
|
||||
i.out << (*sp.child_spaces)[select_index]->to_wstr(L"value");
|
||||
@@ -1140,7 +1140,7 @@ void ticket_tab_select_tab_id(Info & i)
|
||||
|
||||
if( value.is_param )
|
||||
{
|
||||
PT::Space & sp = *value.config_par;
|
||||
pt::Space & sp = *value.config_par;
|
||||
|
||||
if( sp.child_spaces && select_index < sp.child_spaces->size() )
|
||||
i.out << (*sp.child_spaces)[select_index]->to_wstr(L"id");
|
||||
@@ -1153,7 +1153,7 @@ void ticket_tab_select_tab_meta(Info & i)
|
||||
|
||||
if( value.is_param )
|
||||
{
|
||||
PT::Space & sp = *value.config_par;
|
||||
pt::Space & sp = *value.config_par;
|
||||
|
||||
if( sp.child_spaces && select_index < sp.child_spaces->size() )
|
||||
space_value(i, *(*sp.child_spaces)[select_index]);
|
||||
@@ -1173,13 +1173,13 @@ void ticket_tab_file_tab(Info & i)
|
||||
if( i.iter == 0 )
|
||||
ticket_file_number = 0;
|
||||
|
||||
PT::Space & mt = *value.value_meta;
|
||||
pt::Space & mt = *value.value_meta;
|
||||
|
||||
if( mt.child_spaces )
|
||||
{
|
||||
while( ticket_file_index < mt.child_spaces->size() )
|
||||
{
|
||||
PT::Space & sp = *(*mt.child_spaces)[ticket_file_index];
|
||||
pt::Space & sp = *(*mt.child_spaces)[ticket_file_index];
|
||||
|
||||
if( sp.name && *sp.name == L"file" )
|
||||
break;
|
||||
@@ -1202,7 +1202,7 @@ void ticket_tab_file_tab_index(Info & i)
|
||||
|
||||
if( value.is_value && !value.is_in_ticket_par )
|
||||
{
|
||||
PT::Space & mt = *value.value_meta;
|
||||
pt::Space & mt = *value.value_meta;
|
||||
|
||||
if( mt.child_spaces && ticket_file_index < mt.child_spaces->size() )
|
||||
i.out << ticket_file_number;
|
||||
@@ -1216,7 +1216,7 @@ void ticket_tab_file_tab_path(Info & i)
|
||||
|
||||
if( value.is_value && !value.is_in_ticket_par )
|
||||
{
|
||||
PT::Space & mt = *value.value_meta;
|
||||
pt::Space & mt = *value.value_meta;
|
||||
|
||||
if( mt.child_spaces && ticket_file_index < mt.child_spaces->size() )
|
||||
i.out << (*mt.child_spaces)[ticket_file_index]->to_wstr(L"path");
|
||||
@@ -1229,7 +1229,7 @@ void ticket_tab_file_tab_itemid(Info & i)
|
||||
|
||||
if( value.is_value && !value.is_in_ticket_par )
|
||||
{
|
||||
PT::Space & mt = *value.value_meta;
|
||||
pt::Space & mt = *value.value_meta;
|
||||
|
||||
if( mt.child_spaces && ticket_file_index < mt.child_spaces->size() )
|
||||
i.out << (*mt.child_spaces)[ticket_file_index]->to_wstr(L"itemid");
|
||||
@@ -1242,7 +1242,7 @@ void ticket_tab_file_tab_meta(Info & i)
|
||||
|
||||
if( value.is_value && !value.is_in_ticket_par )
|
||||
{
|
||||
PT::Space & mt = *value.value_meta;
|
||||
pt::Space & mt = *value.value_meta;
|
||||
|
||||
if( mt.child_spaces && ticket_file_index < mt.child_spaces->size() )
|
||||
space_value(i, *(*mt.child_spaces)[ticket_file_index]);
|
||||
|
||||
@@ -169,7 +169,7 @@ bool TicketInfo::ParseTicketConf(long mount_dir_id, const std::wstring & path)
|
||||
conf_parser.SetSpace(conf_tab[mount_dir_id].conf);
|
||||
conf_tab[mount_dir_id].conf.clear();
|
||||
|
||||
return (conf_parser.ParseSpace(config_file.item_content.content_raw) == PT::SpaceParser::ok);
|
||||
return (conf_parser.ParseSpace(config_file.item_content.content_raw) == pt::SpaceParser::ok);
|
||||
}
|
||||
|
||||
|
||||
@@ -262,7 +262,7 @@ void TicketInfo::FindCurrentConf()
|
||||
|
||||
|
||||
|
||||
void TicketInfo::CheckMinMaxValue(PT::Space & space, Ticket::TicketParam & par)
|
||||
void TicketInfo::CheckMinMaxValue(pt::Space & space, Ticket::TicketParam & par)
|
||||
{
|
||||
std::wstring * type = space.get_wstr(L"type");
|
||||
|
||||
@@ -307,7 +307,7 @@ void TicketInfo::CheckMinMaxValue(PT::Space & space, Ticket::TicketParam & par)
|
||||
{
|
||||
for(size_t a=0 ; a<space.child_spaces->size() ; ++a)
|
||||
{
|
||||
PT::Space & sp = *(*space.child_spaces)[a];
|
||||
pt::Space & sp = *(*space.child_spaces)[a];
|
||||
|
||||
if( sp.name && *sp.name == L"option" && sp.to_long(L"id") == par.intv )
|
||||
return;
|
||||
@@ -323,20 +323,20 @@ void TicketInfo::CheckMinMaxValue(PT::Space & space, Ticket::TicketParam & par)
|
||||
}
|
||||
|
||||
|
||||
PT::Space & TicketInfo::FindAddMetaByParam(PT::Space & meta, long param)
|
||||
pt::Space & TicketInfo::FindAddMetaByParam(pt::Space & meta, long param)
|
||||
{
|
||||
if( meta.child_spaces )
|
||||
{
|
||||
for(size_t i=0 ; i<meta.child_spaces->size() ; ++i)
|
||||
{
|
||||
PT::Space & sp = *(*meta.child_spaces)[i];
|
||||
pt::Space & sp = *(*meta.child_spaces)[i];
|
||||
|
||||
if( sp.name && *sp.name == L"param" && sp.to_long(L"id") == param )
|
||||
return sp;
|
||||
}
|
||||
}
|
||||
|
||||
PT::Space & sp = meta.add_child_space(L"param");
|
||||
pt::Space & sp = meta.add_child_space(L"param");
|
||||
sp.add(L"id", param);
|
||||
|
||||
return sp;
|
||||
@@ -344,7 +344,7 @@ return sp;
|
||||
|
||||
|
||||
|
||||
bool TicketInfo::ReadTicketValue(PT::Space & space, long param_id, Ticket::TicketParam & par, const std::wstring & value, PT::Space & meta)
|
||||
bool TicketInfo::ReadTicketValue(pt::Space & space, long param_id, Ticket::TicketParam & par, const std::wstring & value, pt::Space & meta)
|
||||
{
|
||||
if( space.is_equal(L"type", L"integer") ||
|
||||
space.is_equal(L"type", L"progress") ||
|
||||
@@ -360,7 +360,7 @@ bool TicketInfo::ReadTicketValue(PT::Space & space, long param_id, Ticket::Ticke
|
||||
space.is_equal(L"type", L"multistring") )
|
||||
{
|
||||
// !! dodac cos co sprawdzi czy string nie zawiera znakow konca linii
|
||||
PT::Space & sp = FindAddMetaByParam(meta, param_id);
|
||||
pt::Space & sp = FindAddMetaByParam(meta, param_id);
|
||||
sp.add(L"value", value);
|
||||
return false;
|
||||
}
|
||||
@@ -391,10 +391,10 @@ return false;
|
||||
|
||||
|
||||
|
||||
void TicketInfo::ReadTicketValue(PT::Space & space,
|
||||
void TicketInfo::ReadTicketValue(pt::Space & space,
|
||||
long param_id,
|
||||
const PostFile & value,
|
||||
PT::Space & meta,
|
||||
pt::Space & meta,
|
||||
Item & upload_dir)
|
||||
{
|
||||
file.Clear(); // clearing and setting date
|
||||
@@ -409,8 +409,8 @@ void TicketInfo::ReadTicketValue(PT::Space & space,
|
||||
|
||||
if( cur->request->status == WINIX_ERR_OK )
|
||||
{
|
||||
PT::Space & space = FindAddMetaByParam(meta, param_id);
|
||||
PT::Space & file_space = space.add_child_space(L"file");
|
||||
pt::Space & space = FindAddMetaByParam(meta, param_id);
|
||||
pt::Space & file_space = space.add_child_space(L"file");
|
||||
|
||||
if( file.item_content.file_type == WINIX_ITEM_FILETYPE_IMAGE )
|
||||
file_space.add(L"type", L"image");
|
||||
@@ -428,8 +428,8 @@ void TicketInfo::ReadTicketValue(PT::Space & space,
|
||||
}
|
||||
|
||||
|
||||
void TicketInfo::ReadTicketValue(PT::Space & space,
|
||||
long param_id, const PostFile & value, PT::Space & meta)
|
||||
void TicketInfo::ReadTicketValue(pt::Space & space,
|
||||
long param_id, const PostFile & value, pt::Space & meta)
|
||||
{
|
||||
std::wstring * type = space.get_wstr(L"type");
|
||||
|
||||
@@ -456,7 +456,7 @@ void TicketInfo::ReadTicketValue(PT::Space & space,
|
||||
|
||||
|
||||
// adding a new parameter only if it not exists in ticket.par_tab
|
||||
void TicketInfo::ReadTicketParam(PT::Space & space, Ticket & ticket, long param_id, const std::wstring & value, PT::Space & meta)
|
||||
void TicketInfo::ReadTicketParam(pt::Space & space, Ticket & ticket, long param_id, const std::wstring & value, pt::Space & meta)
|
||||
{
|
||||
ticket_param.param = param_id;
|
||||
|
||||
@@ -481,7 +481,7 @@ void TicketInfo::ReadTicketParam(PT::Space & space, Ticket & ticket, long param_
|
||||
|
||||
|
||||
|
||||
void TicketInfo::ReadTicketParam(Ticket & ticket, long param_id, const std::wstring & value, PT::Space & meta)
|
||||
void TicketInfo::ReadTicketParam(Ticket & ticket, long param_id, const std::wstring & value, pt::Space & meta)
|
||||
{
|
||||
ticket_param.Clear();
|
||||
|
||||
@@ -489,7 +489,7 @@ void TicketInfo::ReadTicketParam(Ticket & ticket, long param_id, const std::wstr
|
||||
{
|
||||
for(size_t i=0 ; i<cur_conf->child_spaces->size() ; ++i)
|
||||
{
|
||||
PT::Space & space = *(*cur_conf->child_spaces)[i];
|
||||
pt::Space & space = *(*cur_conf->child_spaces)[i];
|
||||
|
||||
if( space.name && *space.name == L"param" && space.to_long(L"id") == param_id )
|
||||
{
|
||||
@@ -504,13 +504,13 @@ void TicketInfo::ReadTicketParam(Ticket & ticket, long param_id, const std::wstr
|
||||
|
||||
|
||||
// always adds a new parameter
|
||||
void TicketInfo::ReadTicketParam(long param_id, const PostFile & value, PT::Space & meta)
|
||||
void TicketInfo::ReadTicketParam(long param_id, const PostFile & value, pt::Space & meta)
|
||||
{
|
||||
if( cur_conf->child_spaces )
|
||||
{
|
||||
for(size_t i=0 ; i<cur_conf->child_spaces->size() ; ++i)
|
||||
{
|
||||
PT::Space & space = *(*cur_conf->child_spaces)[i];
|
||||
pt::Space & space = *(*cur_conf->child_spaces)[i];
|
||||
|
||||
if( space.name && *space.name == L"param" && space.to_long(L"id") == param_id )
|
||||
{
|
||||
@@ -527,19 +527,19 @@ void TicketInfo::ReadTicketParam(long param_id, const PostFile & value, PT::Spac
|
||||
|
||||
|
||||
|
||||
bool TicketInfo::DeleteTicketFile(Ticket & ticket, long file_id, PT::Space & meta)
|
||||
bool TicketInfo::DeleteTicketFile(Ticket & ticket, long file_id, pt::Space & meta)
|
||||
{
|
||||
if( meta.child_spaces )
|
||||
{
|
||||
for(size_t i=0 ; i<meta.child_spaces->size() ; ++i)
|
||||
{
|
||||
PT::Space & param = *(*meta.child_spaces)[i];
|
||||
pt::Space & param = *(*meta.child_spaces)[i];
|
||||
|
||||
if( param.name && *param.name == L"param" && param.child_spaces )
|
||||
{
|
||||
for(size_t z=0 ; z<param.child_spaces->size() ; ++z)
|
||||
{
|
||||
PT::Space & file = *(*param.child_spaces)[z];
|
||||
pt::Space & file = *(*param.child_spaces)[z];
|
||||
|
||||
if( file.name && *file.name == L"file" )
|
||||
{
|
||||
@@ -566,7 +566,7 @@ return false;
|
||||
|
||||
|
||||
|
||||
void TicketInfo::ReadTicketParams(Ticket & ticket, bool clear_ticket, PT::Space & meta, bool & file_was_deleted)
|
||||
void TicketInfo::ReadTicketParams(Ticket & ticket, bool clear_ticket, pt::Space & meta, bool & file_was_deleted)
|
||||
{
|
||||
PostTab::iterator i;
|
||||
PostFileTab::iterator i2;
|
||||
@@ -583,13 +583,13 @@ PostFileTab::iterator i2;
|
||||
{
|
||||
// !! CHECKME why ticket_form_prefix is in the global config?
|
||||
// (this is a plugin variable)
|
||||
if( PT::is_substr(config->ticket_form_prefix, i->first) )
|
||||
if( pt::is_substr(config->ticket_form_prefix, i->first) )
|
||||
{
|
||||
long param_id = Tol(i->first.c_str() + config->ticket_form_prefix.size());
|
||||
ReadTicketParam(ticket, param_id, i->second, meta);
|
||||
}
|
||||
|
||||
if( PT::is_substr(ticket_delete_prefix, i->first) )
|
||||
if( pt::is_substr(ticket_delete_prefix, i->first) )
|
||||
{
|
||||
long file_id = Tol(i->first.c_str() + ticket_delete_prefix.size());
|
||||
|
||||
@@ -602,7 +602,7 @@ PostFileTab::iterator i2;
|
||||
|
||||
for(i2=cur->request->post_file_tab.begin() ; i2!=cur->request->post_file_tab.end() ; ++i2)
|
||||
{
|
||||
if( PT::is_substr(config->ticket_form_prefix, i2->first) )
|
||||
if( pt::is_substr(config->ticket_form_prefix, i2->first) )
|
||||
ReadTicketParam(Tol(i2->first.c_str() + config->ticket_form_prefix.size()), i2->second, meta);
|
||||
}
|
||||
|
||||
@@ -629,9 +629,9 @@ void TicketInfo::RemoveTicket(long file_id)
|
||||
}
|
||||
|
||||
|
||||
void TicketInfo::CopyTicketSpace(PT::Space & ticket_space, Item & item)
|
||||
void TicketInfo::CopyTicketSpace(pt::Space & ticket_space, Item & item)
|
||||
{
|
||||
PT::Space & ticket_meta = item.item_content.meta.find_add_child_space(L"ticket");
|
||||
pt::Space & ticket_meta = item.item_content.meta.find_add_child_space(L"ticket");
|
||||
ticket_meta = ticket_space;
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ struct TicketConfWrap
|
||||
{
|
||||
bool to_delete;
|
||||
std::wstring file_name;
|
||||
PT::Space conf;
|
||||
pt::Space conf;
|
||||
|
||||
TicketConfWrap()
|
||||
{
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
// current ticket config
|
||||
// will be set by FindCurrentConf()
|
||||
TicketConfWrap * cur_conf_wrap;
|
||||
PT::Space * cur_conf;
|
||||
pt::Space * cur_conf;
|
||||
|
||||
// default: "progress"
|
||||
// can be set in config in option: ticket_form_progress_prefix
|
||||
@@ -127,9 +127,9 @@ public:
|
||||
void ReadTicketConf(bool skip_existing_configs = false);
|
||||
void FindCurrentConf(long dir_id);
|
||||
void FindCurrentConf();
|
||||
void ReadTicketParams(Ticket & ticket, bool clear_ticket, PT::Space & meta, bool & file_was_deleted);
|
||||
void ReadTicketParams(Ticket & ticket, bool clear_ticket, pt::Space & meta, bool & file_was_deleted);
|
||||
void RemoveTicket(long file_id);
|
||||
void CopyTicketSpace(PT::Space & ticket_space, Item & item);
|
||||
void CopyTicketSpace(pt::Space & ticket_space, Item & item);
|
||||
|
||||
void MakeRedirectIfPossible(const Item & item);
|
||||
|
||||
@@ -154,14 +154,14 @@ private:
|
||||
std::wstring file_path;
|
||||
|
||||
// for reading config file
|
||||
PT::SpaceParser conf_parser;
|
||||
pt::SpaceParser conf_parser;
|
||||
std::vector<Item*> config_dir_tab;
|
||||
Item config_file;
|
||||
|
||||
// for Clearing
|
||||
// (we don't want to use empty pointers)
|
||||
TicketConfWrap cur_conf_wrap_empty;
|
||||
PT::Space cur_conf_empty;
|
||||
pt::Space cur_conf_empty;
|
||||
Ticket ticket_empty;
|
||||
Item item_empty;
|
||||
|
||||
@@ -174,17 +174,17 @@ private:
|
||||
void MarkAllConfToDelete();
|
||||
void DeleteAllMarkedConf();
|
||||
void ReadTicketConf(const Mount & mount, bool skip_existing_configs);
|
||||
PT::Space & FindAddMetaByParam(PT::Space & meta, long param);
|
||||
pt::Space & FindAddMetaByParam(pt::Space & meta, long param);
|
||||
|
||||
|
||||
void CheckMinMaxValue(PT::Space & space, Ticket::TicketParam & par);
|
||||
bool ReadTicketValue(PT::Space & space, long param_id, Ticket::TicketParam & par, const std::wstring & value, PT::Space & meta);
|
||||
void ReadTicketValue(PT::Space & space, long param_id, const PostFile & value, PT::Space & meta, Item & upload_dir);
|
||||
void ReadTicketValue(PT::Space & space, long param_id, const PostFile & value, PT::Space & meta);
|
||||
void ReadTicketParam(PT::Space & space, Ticket & ticket, long param_id, const std::wstring & value, PT::Space & meta);
|
||||
void ReadTicketParam(Ticket & ticket, long param_id, const std::wstring & value, PT::Space & meta);
|
||||
void ReadTicketParam(long param_id, const PostFile & value, PT::Space & meta);
|
||||
bool DeleteTicketFile(Ticket & ticket, long file_id, PT::Space & meta);
|
||||
void CheckMinMaxValue(pt::Space & space, Ticket::TicketParam & par);
|
||||
bool ReadTicketValue(pt::Space & space, long param_id, Ticket::TicketParam & par, const std::wstring & value, pt::Space & meta);
|
||||
void ReadTicketValue(pt::Space & space, long param_id, const PostFile & value, pt::Space & meta, Item & upload_dir);
|
||||
void ReadTicketValue(pt::Space & space, long param_id, const PostFile & value, pt::Space & meta);
|
||||
void ReadTicketParam(pt::Space & space, Ticket & ticket, long param_id, const std::wstring & value, pt::Space & meta);
|
||||
void ReadTicketParam(Ticket & ticket, long param_id, const std::wstring & value, pt::Space & meta);
|
||||
void ReadTicketParam(long param_id, const PostFile & value, pt::Space & meta);
|
||||
bool DeleteTicketFile(Ticket & ticket, long file_id, pt::Space & meta);
|
||||
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user