plugin ticket: rewritten templates ezc functions

(now images/files are working fine)


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@795 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2012-01-17 22:54:41 +00:00
parent 424618de38
commit 631ca4f8a3
15 changed files with 641 additions and 392 deletions

View File

@@ -16,6 +16,7 @@
#include "core/plugindata.h"
#include "ticket.h"
#include "functions/rm.h"
#include "confparser/space.h"
namespace Ticket
@@ -28,8 +29,8 @@ struct SessionData : public PluginDataBase
~SessionData();
typedef std::map<long, Ticket> TicketMap;
typedef std::map<long, std::vector<long> > FileMap;
typedef std::map<long, Ticket> TicketMap;
typedef std::map<long, PT::Space> SpaceMap;
// temporary tickets for 'createticket' function
@@ -41,28 +42,34 @@ struct SessionData : public PluginDataBase
TicketMap edit_ticket_map;
// temporary files for 'createticket' function
// temporary spaces for 'createticket' function
// these files should be deleted if a user will not click on the submit button
FileMap create_file_map;
SpaceMap create_space_map;
// temporary files for 'editticket' function
// temporary spaces for 'editticket' function
// these files should be deleted if a user will not click on the submit button
// !! zmienic nazwe na edit_file_map albo podobnie
FileMap edit_file_map;
SpaceMap edit_space_map;
// inserting and returning a new ticket or just returning the ticket if it exists
Ticket & GetTicket(long id, TicketMap & ticket_map, bool * is_new = 0);
std::vector<long> & GetFileTab(long id, FileMap & file_map);
// inserting and returning a new space or just returning the space if it exists
PT::Space & GetSpace(long id, SpaceMap & space_map, bool * is_new = 0);
// for deleting edit_file_map files
// for deleting files
// !! IMPROVE ME: when the program exits there can be a situation that
// fun_rm was finished and then an object of this class exits and call fun_rm
// so we should guarantee that all sessions object are removed first
Fun::Rm * fun_rm;
void RemoveFileMap(FileMap & file_map);
void RemoveFiles(SpaceMap & space_map);
private:
void RemoveFiles(PT::Space & space);
};