fixed: ticket sets a default function only for directories

fixed: reading a new url and subject in Functions::ReadItem()
added: tickets are sorted now (by date)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@659 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2010-09-30 20:58:20 +00:00
parent d94a08b991
commit 7bc17a9202
12 changed files with 178 additions and 141 deletions

View File

@@ -3,23 +3,23 @@
createticket.o: createticket.h tdb.h ticket.h ../../db/dbbase.h
createticket.o: ../../db/dbconn.h ../../db/dbtextstream.h
createticket.o: ../../core/textstream.h ../../core/error.h ../../core/log.h
createticket.o: ticketinfo.h ../../core/item.h ../../db/db.h
createticket.o: ../../db/dbbase.h ../../db/dbitemquery.h
createticket.o: ticketinfo.h ../../core/item.h ../../core/system.h
createticket.o: ../../core/dirs.h ../../core/item.h ../../core/dircontainer.h
createticket.o: ../../db/db.h ../../db/dbbase.h ../../db/dbitemquery.h
createticket.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h
createticket.o: ../../core/thread.h ../../core/dircontainer.h
createticket.o: ../../core/item.h ../../core/ugcontainer.h
createticket.o: ../../functions/functionbase.h ../../core/request.h
createticket.o: ../../core/ugcontainer.h ../../core/request.h
createticket.o: ../../core/requesttypes.h ../../core/session.h
createticket.o: ../../core/error.h ../../core/user.h ../../core/plugindata.h
createticket.o: ../../core/rebus.h ../../core/config.h
createticket.o: ../../core/confparser.h ../../core/htmlfilter.h
createticket.o: ../../core/config.h ../../core/system.h ../../core/dirs.h
createticket.o: ../../core/dircontainer.h ../../core/request.h
createticket.o: ../../core/mounts.h ../../core/mount.h
createticket.o: ../../core/mountparser.h ../../core/users.h
createticket.o: ../../core/ugcontainer.h ../../core/lastcontainer.h
createticket.o: ../../core/groups.h ../../core/group.h ../../core/loadavg.h
createticket.o: ../../core/notify.h ../../templatesnotify/templatesnotify.h
createticket.o: ../../functions/functionbase.h ../../core/request.h
createticket.o: ../../core/config.h ../../core/notify.h
createticket.o: ../../templatesnotify/templatesnotify.h
createticket.o: ../../../ezc/src/ezc.h ../../core/mount.h ../../core/locale.h
createticket.o: ../../templates/misc.h ../../templates/localefilter.h
createticket.o: ../../core/locale.h ../../core/system.h readticket.h
@@ -43,21 +43,21 @@ createticket.o: ../../functions/who.h ../../core/htmlfilter.h
editticket.o: editticket.h tdb.h ticket.h ../../db/dbbase.h ../../db/dbconn.h
editticket.o: ../../db/dbtextstream.h ../../core/textstream.h
editticket.o: ../../core/error.h ../../core/log.h ticketinfo.h
editticket.o: ../../core/item.h ../../db/db.h ../../db/dbbase.h
editticket.o: ../../db/dbitemquery.h ../../db/dbitemcolumns.h
editticket.o: ../../core/user.h ../../core/group.h ../../core/thread.h
editticket.o: ../../core/dircontainer.h ../../core/item.h
editticket.o: ../../core/ugcontainer.h ../../functions/functionbase.h
editticket.o: ../../core/request.h ../../core/requesttypes.h
editticket.o: ../../core/session.h ../../core/error.h ../../core/user.h
editticket.o: ../../core/plugindata.h ../../core/rebus.h ../../core/config.h
editticket.o: ../../core/confparser.h ../../core/htmlfilter.h
editticket.o: ../../core/config.h ../../core/system.h ../../core/dirs.h
editticket.o: ../../core/dircontainer.h ../../core/request.h
editticket.o: ../../core/mounts.h ../../core/mount.h ../../core/mountparser.h
editticket.o: ../../core/users.h ../../core/ugcontainer.h
editticket.o: ../../core/lastcontainer.h ../../core/groups.h
editticket.o: ../../core/group.h ../../core/loadavg.h ../../core/notify.h
editticket.o: ../../core/item.h ../../core/system.h ../../core/dirs.h
editticket.o: ../../core/item.h ../../core/dircontainer.h ../../db/db.h
editticket.o: ../../db/dbbase.h ../../db/dbitemquery.h
editticket.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h
editticket.o: ../../core/thread.h ../../core/dircontainer.h
editticket.o: ../../core/ugcontainer.h ../../core/request.h
editticket.o: ../../core/requesttypes.h ../../core/session.h
editticket.o: ../../core/error.h ../../core/user.h ../../core/plugindata.h
editticket.o: ../../core/rebus.h ../../core/config.h ../../core/confparser.h
editticket.o: ../../core/htmlfilter.h ../../core/mounts.h ../../core/mount.h
editticket.o: ../../core/mountparser.h ../../core/users.h
editticket.o: ../../core/ugcontainer.h ../../core/lastcontainer.h
editticket.o: ../../core/groups.h ../../core/group.h ../../core/loadavg.h
editticket.o: ../../functions/functionbase.h ../../core/request.h
editticket.o: ../../core/config.h ../../core/notify.h
editticket.o: ../../templatesnotify/templatesnotify.h ../../../ezc/src/ezc.h
editticket.o: ../../core/mount.h ../../core/locale.h ../../templates/misc.h
editticket.o: ../../templates/localefilter.h ../../core/locale.h
@@ -82,21 +82,21 @@ editticket.o: ../../core/htmlfilter.h
funticket.o: funticket.h tdb.h ticket.h ../../db/dbbase.h ../../db/dbconn.h
funticket.o: ../../db/dbtextstream.h ../../core/textstream.h
funticket.o: ../../core/error.h ../../core/log.h ticketinfo.h
funticket.o: ../../core/item.h ../../db/db.h ../../db/dbbase.h
funticket.o: ../../db/dbitemquery.h ../../db/dbitemcolumns.h
funticket.o: ../../core/user.h ../../core/group.h ../../core/thread.h
funticket.o: ../../core/dircontainer.h ../../core/item.h
funticket.o: ../../core/ugcontainer.h ../../functions/functionbase.h
funticket.o: ../../core/request.h ../../core/requesttypes.h
funticket.o: ../../core/session.h ../../core/error.h ../../core/user.h
funticket.o: ../../core/plugindata.h ../../core/rebus.h ../../core/config.h
funticket.o: ../../core/confparser.h ../../core/htmlfilter.h
funticket.o: ../../core/config.h ../../core/system.h ../../core/dirs.h
funticket.o: ../../core/dircontainer.h ../../core/request.h
funticket.o: ../../core/mounts.h ../../core/mount.h ../../core/mountparser.h
funticket.o: ../../core/users.h ../../core/ugcontainer.h
funticket.o: ../../core/lastcontainer.h ../../core/groups.h
funticket.o: ../../core/group.h ../../core/loadavg.h ../../core/notify.h
funticket.o: ../../core/item.h ../../core/system.h ../../core/dirs.h
funticket.o: ../../core/item.h ../../core/dircontainer.h ../../db/db.h
funticket.o: ../../db/dbbase.h ../../db/dbitemquery.h
funticket.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h
funticket.o: ../../core/thread.h ../../core/dircontainer.h
funticket.o: ../../core/ugcontainer.h ../../core/request.h
funticket.o: ../../core/requesttypes.h ../../core/session.h
funticket.o: ../../core/error.h ../../core/user.h ../../core/plugindata.h
funticket.o: ../../core/rebus.h ../../core/config.h ../../core/confparser.h
funticket.o: ../../core/htmlfilter.h ../../core/mounts.h ../../core/mount.h
funticket.o: ../../core/mountparser.h ../../core/users.h
funticket.o: ../../core/ugcontainer.h ../../core/lastcontainer.h
funticket.o: ../../core/groups.h ../../core/group.h ../../core/loadavg.h
funticket.o: ../../functions/functionbase.h ../../core/request.h
funticket.o: ../../core/config.h ../../core/notify.h
funticket.o: ../../templatesnotify/templatesnotify.h ../../../ezc/src/ezc.h
funticket.o: ../../core/mount.h ../../core/locale.h ../../templates/misc.h
funticket.o: ../../templates/localefilter.h ../../core/locale.h
@@ -104,19 +104,19 @@ funticket.o: ../../core/system.h
init.o: tdb.h ticket.h ../../db/dbbase.h ../../db/dbconn.h
init.o: ../../db/dbtextstream.h ../../core/textstream.h ../../core/error.h
init.o: ../../core/log.h funticket.h ticketinfo.h ../../core/item.h
init.o: ../../db/db.h ../../db/dbbase.h ../../db/dbitemquery.h
init.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h
init.o: ../../core/thread.h ../../core/dircontainer.h ../../core/item.h
init.o: ../../core/ugcontainer.h ../../functions/functionbase.h
init.o: ../../core/request.h ../../core/requesttypes.h ../../core/session.h
init.o: ../../core/error.h ../../core/user.h ../../core/plugindata.h
init.o: ../../core/rebus.h ../../core/config.h ../../core/confparser.h
init.o: ../../core/htmlfilter.h ../../core/config.h ../../core/system.h
init.o: ../../core/dirs.h ../../core/dircontainer.h ../../core/request.h
init.o: ../../core/system.h ../../core/dirs.h ../../core/item.h
init.o: ../../core/dircontainer.h ../../db/db.h ../../db/dbbase.h
init.o: ../../db/dbitemquery.h ../../db/dbitemcolumns.h ../../core/user.h
init.o: ../../core/group.h ../../core/thread.h ../../core/dircontainer.h
init.o: ../../core/ugcontainer.h ../../core/request.h
init.o: ../../core/requesttypes.h ../../core/session.h ../../core/error.h
init.o: ../../core/user.h ../../core/plugindata.h ../../core/rebus.h
init.o: ../../core/config.h ../../core/confparser.h ../../core/htmlfilter.h
init.o: ../../core/mounts.h ../../core/mount.h ../../core/mountparser.h
init.o: ../../core/users.h ../../core/ugcontainer.h
init.o: ../../core/lastcontainer.h ../../core/groups.h ../../core/group.h
init.o: ../../core/loadavg.h ../../core/notify.h
init.o: ../../core/loadavg.h ../../functions/functionbase.h
init.o: ../../core/request.h ../../core/config.h ../../core/notify.h
init.o: ../../templatesnotify/templatesnotify.h ../../../ezc/src/ezc.h
init.o: ../../core/mount.h ../../core/locale.h ../../templates/misc.h
init.o: ../../templates/localefilter.h ../../core/locale.h
@@ -144,43 +144,43 @@ init.o: ../../core/item.h ../../templates/ckeditorgetparser.h
init.o: ../../core/httpsimpleparser.h ../../core/log.h
init.o: ../../templates/indexpatterns.h ../../core/sessionmanager.h
readticket.o: readticket.h ticket.h ticketinfo.h ../../core/item.h
readticket.o: ../../db/db.h ../../db/dbbase.h ../../db/dbitemquery.h
readticket.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h
readticket.o: ../../core/thread.h ../../core/error.h ../../core/log.h
readticket.o: ../../core/dircontainer.h ../../core/item.h
readticket.o: ../../core/ugcontainer.h tdb.h ../../db/dbbase.h
readticket.o: ../../db/dbconn.h ../../db/dbtextstream.h
readticket.o: ../../core/textstream.h ../../core/request.h
readticket.o: ../../core/system.h ../../core/dirs.h ../../core/item.h
readticket.o: ../../core/dircontainer.h ../../db/db.h ../../db/dbbase.h
readticket.o: ../../db/dbitemquery.h ../../db/dbitemcolumns.h
readticket.o: ../../core/user.h ../../core/group.h ../../core/thread.h
readticket.o: ../../core/error.h ../../core/log.h ../../core/dircontainer.h
readticket.o: ../../core/ugcontainer.h ../../core/request.h
readticket.o: ../../core/requesttypes.h ../../core/session.h
readticket.o: ../../core/error.h ../../core/user.h ../../core/plugindata.h
readticket.o: ../../core/rebus.h ../../core/config.h ../../core/confparser.h
readticket.o: ../../core/htmlfilter.h ../../core/system.h ../../core/dirs.h
readticket.o: ../../core/dircontainer.h ../../core/request.h
readticket.o: ../../core/mounts.h ../../core/mount.h ../../core/mountparser.h
readticket.o: ../../core/users.h ../../core/ugcontainer.h
readticket.o: ../../core/lastcontainer.h ../../core/groups.h
readticket.o: ../../core/group.h ../../core/loadavg.h
readticket.o: ../../core/htmlfilter.h ../../core/mounts.h ../../core/mount.h
readticket.o: ../../core/mountparser.h ../../core/users.h
readticket.o: ../../core/ugcontainer.h ../../core/lastcontainer.h
readticket.o: ../../core/groups.h ../../core/group.h ../../core/loadavg.h
readticket.o: tdb.h ../../db/dbbase.h ../../db/dbconn.h
readticket.o: ../../db/dbtextstream.h ../../core/textstream.h
readticket.o: ../../core/request.h
tdb.o: tdb.h ticket.h ../../db/dbbase.h ../../db/dbconn.h
tdb.o: ../../db/dbtextstream.h ../../core/textstream.h ../../core/error.h
tdb.o: ../../core/log.h ../../core/log.h
templates.o: ../../../ezc/src/ezc.h ticketinfo.h ticket.h ../../core/item.h
templates.o: ../../db/db.h ../../db/dbbase.h ../../db/dbitemquery.h
templates.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h
templates.o: ../../core/thread.h ../../core/error.h ../../core/log.h
templates.o: ../../core/dircontainer.h ../../core/item.h
templates.o: ../../core/ugcontainer.h tdb.h ../../db/dbbase.h
templates.o: ../../db/dbconn.h ../../db/dbtextstream.h
templates.o: ../../core/textstream.h editticket.h
templates.o: ../../functions/functionbase.h ../../core/request.h
templates.o: ../../core/system.h ../../core/dirs.h ../../core/item.h
templates.o: ../../core/dircontainer.h ../../db/db.h ../../db/dbbase.h
templates.o: ../../db/dbitemquery.h ../../db/dbitemcolumns.h
templates.o: ../../core/user.h ../../core/group.h ../../core/thread.h
templates.o: ../../core/error.h ../../core/log.h ../../core/dircontainer.h
templates.o: ../../core/ugcontainer.h ../../core/request.h
templates.o: ../../core/requesttypes.h ../../core/session.h
templates.o: ../../core/error.h ../../core/user.h ../../core/plugindata.h
templates.o: ../../core/rebus.h ../../core/config.h ../../core/confparser.h
templates.o: ../../core/htmlfilter.h ../../core/config.h ../../core/system.h
templates.o: ../../core/dirs.h ../../core/dircontainer.h ../../core/request.h
templates.o: ../../core/mounts.h ../../core/mount.h ../../core/mountparser.h
templates.o: ../../core/users.h ../../core/ugcontainer.h
templates.o: ../../core/lastcontainer.h ../../core/groups.h
templates.o: ../../core/group.h ../../core/loadavg.h ../../core/notify.h
templates.o: ../../core/htmlfilter.h ../../core/mounts.h ../../core/mount.h
templates.o: ../../core/mountparser.h ../../core/users.h
templates.o: ../../core/ugcontainer.h ../../core/lastcontainer.h
templates.o: ../../core/groups.h ../../core/group.h ../../core/loadavg.h
templates.o: tdb.h ../../db/dbbase.h ../../db/dbconn.h
templates.o: ../../db/dbtextstream.h ../../core/textstream.h editticket.h
templates.o: ../../functions/functionbase.h ../../core/request.h
templates.o: ../../core/config.h ../../core/notify.h
templates.o: ../../templatesnotify/templatesnotify.h ../../core/mount.h
templates.o: ../../core/locale.h ../../templates/misc.h
templates.o: ../../templates/localefilter.h ../../core/locale.h
@@ -209,11 +209,19 @@ templates.o: ../../templates/patterncacher.h ../../core/item.h
templates.o: ../../templates/ckeditorgetparser.h
templates.o: ../../core/httpsimpleparser.h ../../core/log.h
templates.o: ../../templates/indexpatterns.h ../../core/sessionmanager.h
ticketinfo.o: ticketinfo.h ticket.h ../../core/item.h ../../db/db.h
ticketinfo.o: ../../db/dbbase.h ../../db/dbitemquery.h
ticketinfo.o: ticketinfo.h ticket.h ../../core/item.h ../../core/system.h
ticketinfo.o: ../../core/dirs.h ../../core/item.h ../../core/dircontainer.h
ticketinfo.o: ../../db/db.h ../../db/dbbase.h ../../db/dbitemquery.h
ticketinfo.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h
ticketinfo.o: ../../core/thread.h ../../core/error.h ../../core/log.h
ticketinfo.o: ../../core/dircontainer.h ../../core/item.h
ticketinfo.o: ../../core/ugcontainer.h tdb.h ../../db/dbbase.h
ticketinfo.o: ../../core/dircontainer.h ../../core/ugcontainer.h
ticketinfo.o: ../../core/request.h ../../core/requesttypes.h
ticketinfo.o: ../../core/session.h ../../core/error.h ../../core/user.h
ticketinfo.o: ../../core/plugindata.h ../../core/rebus.h ../../core/config.h
ticketinfo.o: ../../core/confparser.h ../../core/htmlfilter.h
ticketinfo.o: ../../core/mounts.h ../../core/mount.h ../../core/mountparser.h
ticketinfo.o: ../../core/users.h ../../core/ugcontainer.h
ticketinfo.o: ../../core/lastcontainer.h ../../core/groups.h
ticketinfo.o: ../../core/group.h ../../core/loadavg.h tdb.h ../../db/dbbase.h
ticketinfo.o: ../../db/dbconn.h ../../db/dbtextstream.h
ticketinfo.o: ../../core/textstream.h

View File

@@ -86,6 +86,7 @@ void FunTicket::MakeGet()
db->GetItems(request->item_tab, iq);
tdb->GetTickets(request->dir_tab.back()->id, ticket_info->ticket_tab);
ticket_info->SortTickets();
TicketDeleteFirst();
system->CheckAccessToItems(request->item_tab);

View File

@@ -41,6 +41,9 @@ void AddFunctions(PluginInfo & info)
void SelectDefaultFunction(PluginInfo & info)
{
if( info.request->is_item )
return;
if( info.system->mounts.pmount->type == ticket_info.mount_type_ticket )
info.request->function = &fun_ticket;
}
@@ -85,6 +88,7 @@ using namespace Ticket;
ticket_info.SetDb(info.db);
ticket_info.SetTDb(&tdb);
ticket_info.SetSystem(info.system);
fun_ticket.SetTDb(&tdb);
fun_ticket.SetTicketInfo(&ticket_info);

View File

@@ -11,6 +11,7 @@
#define headerfile_winix_plugins_ticket_ticket
#include <string>
#include <ctime>
namespace Ticket
@@ -31,7 +32,8 @@ struct Ticket
// the first item (with the content for the ticket)
long item_id;
// an auxiliary object used when sorting a table with tickets
unsigned long sort_id;
void Clear()
{
@@ -45,6 +47,8 @@ struct Ticket
expected = 0;
progress = 0;
item_id = -1;
sort_id = 0;
}

View File

@@ -7,6 +7,8 @@
*
*/
#include <algorithm>
#include <ctime>
#include "ticketinfo.h"
#include "core/error.h"
@@ -35,6 +37,11 @@ void TicketInfo::SetDb(Db * pdb)
}
void TicketInfo::SetSystem(System * psystem)
{
system = psystem;
}
void TicketInfo::Clear()
{
item.Clear();
@@ -54,4 +61,24 @@ void TicketInfo::ReadTicket(long dir_id)
}
bool TicketInfo::SortTicketsFun(const Ticket & t1, const Ticket & t2)
{
return t1.sort_id > t2.sort_id;
}
void TicketInfo::SortTickets()
{
std::vector<Ticket>::iterator i;
for(i=ticket_tab.begin() ; i!=ticket_tab.end() ; ++i)
{
Item * dir = system->dirs.GetDir(i->dir_id);
i->sort_id = ( dir ) ? (unsigned long)mktime(&dir->date_creation) : 0;
}
std::sort(ticket_tab.begin(), ticket_tab.end(), SortTicketsFun);
}
} // namespace

View File

@@ -14,10 +14,12 @@
#include <vector>
#include "ticket.h"
#include "core/item.h"
#include "core/system.h"
#include "db/db.h"
#include "tdb.h"
namespace Ticket
{
@@ -30,10 +32,11 @@ public:
void SetTDb(TDb * ptdb);
void SetDb(Db * pdb);
void SetSystem(System * psystem);
void Clear();
void ReadTicket(long dir_id);
void SortTickets();
Item item;
bool is_ticket;
@@ -56,10 +59,15 @@ public:
int mount_par_createticket_on;
private:
TDb * tdb;
Db * db;
System * system;
static bool SortTicketsFun(const Ticket & t1, const Ticket & t2);
};