fixed: find_ticket_value (in plugins/ticket/templates.cpp)
should find the first item (can be more than one item with the same 'param') fixed: added sorting tickets params in ReadTicketParams() (in plugins/ticket/ticketinfo.cpp) fixed: plugin should have its own 'PluginInfo info' struct a plugin's function can call another plugin's functions added: removing tickets files/images added: removing threads changed: rm function will call WINIX_FILE_REMOVED now when deleting directories git-svn-id: svn://ttmath.org/publicrep/winix/trunk@710 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -53,7 +53,7 @@ return true;
|
||||
|
||||
void CreateTicket::AddTicket(Ticket & ticket, Item & item)
|
||||
{
|
||||
ticket.file_id = item.id;
|
||||
ticket.file_id = item.id;
|
||||
cur->request->status = tdb->AddTicket(ticket);
|
||||
|
||||
if( cur->request->status == WINIX_ERR_OK )
|
||||
@@ -91,7 +91,7 @@ void CreateTicket::Submit(Ticket & ticket, Item & item)
|
||||
if( cur->request->status == WINIX_ERR_OK )
|
||||
{
|
||||
log << log2 << "CreateTicket: added a new ticket" << logend;
|
||||
RemoveTicket();
|
||||
RemoveTmpTicket();
|
||||
system->RedirectTo(item);
|
||||
}
|
||||
else
|
||||
@@ -103,13 +103,14 @@ void CreateTicket::Submit(Ticket & ticket, Item & item)
|
||||
|
||||
|
||||
|
||||
void CreateTicket::RemoveTicket()
|
||||
void CreateTicket::RemoveTmpTicket()
|
||||
{
|
||||
SessionData * session_data = reinterpret_cast<SessionData*>(
|
||||
cur->session->plugin_data.Get(ticket_info->plugin_id) );
|
||||
|
||||
long dir_id = cur->request->dir_tab.back()->id;
|
||||
session_data->create_ticket_map.erase(dir_id);
|
||||
session_data->create_file_map.erase(dir_id);
|
||||
}
|
||||
|
||||
|
||||
@@ -126,6 +127,17 @@ return ticket;
|
||||
}
|
||||
|
||||
|
||||
std::vector<long> & CreateTicket::PrepareFileMap()
|
||||
{
|
||||
SessionData * session_data = reinterpret_cast<SessionData*>(
|
||||
cur->session->plugin_data.Get(ticket_info->plugin_id) );
|
||||
|
||||
long dir_id = cur->request->dir_tab.back()->id;
|
||||
std::vector<long> & file_map = session_data->GetFileTab(dir_id, session_data->create_file_map);
|
||||
|
||||
return file_map;
|
||||
}
|
||||
|
||||
|
||||
void CreateTicket::MakePost()
|
||||
{
|
||||
@@ -135,8 +147,9 @@ void CreateTicket::MakePost()
|
||||
Ticket & ticket = PrepareTicket();
|
||||
Item & item = cur->request->item;
|
||||
ticket_info->ticket = &ticket;
|
||||
std::vector<long> & file_map = PrepareFileMap();
|
||||
|
||||
ticket_info->ReadTicketParams(ticket, false);
|
||||
ticket_info->ReadTicketParams(ticket, false, &file_map);
|
||||
functions->ReadItem(item, Item::file);
|
||||
|
||||
if( !cur->request->IsPostVar(L"fileuploadsubmit") )
|
||||
|
||||
Reference in New Issue
Block a user