added: winix uses now [filter] statement from ezc
added: notifications to threads (were temporarily disabled) changed: templates in notifications git-svn-id: svn://ttmath.org/publicrep/winix/trunk@712 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -50,6 +50,18 @@ return true;
|
||||
}
|
||||
|
||||
|
||||
void CreateThread::SendNotify(const Item & item)
|
||||
{
|
||||
// sending notification
|
||||
notify_msg.code = WINIX_NOTIFY_CODE_ADD;
|
||||
notify_msg.template_index = thread_info->template_index;
|
||||
notify_msg.dir_link = config->base_url;
|
||||
system->dirs.MakePath(item.parent_id, notify_msg.dir_link, false);
|
||||
notify_msg.item_link = notify_msg.dir_link;
|
||||
notify_msg.item_link += item.url;
|
||||
|
||||
system->notify.ItemChanged(notify_msg);
|
||||
}
|
||||
|
||||
|
||||
void CreateThread::MakePost()
|
||||
@@ -77,6 +89,7 @@ void CreateThread::MakePost()
|
||||
{
|
||||
log << log2 << "CreateThread: added a new thread" << logend;
|
||||
system->RedirectTo(cur->request->item);
|
||||
SendNotify(cur->request->item);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -13,6 +13,7 @@
|
||||
#include "functions/functionbase.h"
|
||||
#include "tdb.h"
|
||||
#include "threadinfo.h"
|
||||
#include "notify/notify.h"
|
||||
|
||||
|
||||
namespace Thread
|
||||
@@ -35,7 +36,9 @@ private:
|
||||
TDb * tdb;
|
||||
ThreadInfo * thread_info;
|
||||
Thread thread;
|
||||
NotifyMsg notify_msg;
|
||||
|
||||
void SendNotify(const Item & item);
|
||||
};
|
||||
|
||||
|
||||
|
@@ -56,6 +56,19 @@ return true;
|
||||
}
|
||||
|
||||
|
||||
void Reply::SendNotify(const Item & item)
|
||||
{
|
||||
// sending notification
|
||||
notify_msg.code = WINIX_NOTIFY_CODE_REPLY;
|
||||
notify_msg.template_index = thread_info->template_index;
|
||||
notify_msg.dir_link = config->base_url;
|
||||
system->dirs.MakePath(item.parent_id, notify_msg.dir_link, false);
|
||||
notify_msg.item_link = notify_msg.dir_link;
|
||||
notify_msg.item_link += item.url;
|
||||
|
||||
system->notify.ItemChanged(notify_msg);
|
||||
}
|
||||
|
||||
|
||||
void Reply::MakePost()
|
||||
{
|
||||
@@ -93,6 +106,7 @@ void Reply::MakePost()
|
||||
{
|
||||
log << log2 << "Reply: added an answer in a thread" << logend;
|
||||
system->RedirectTo(cur->request->item);
|
||||
SendNotify(cur->request->item);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -13,6 +13,7 @@
|
||||
#include "functions/functionbase.h"
|
||||
#include "tdb.h"
|
||||
#include "threadinfo.h"
|
||||
#include "notify/notify.h"
|
||||
|
||||
|
||||
|
||||
@@ -39,7 +40,9 @@ private:
|
||||
Item answer;
|
||||
Thread thread;
|
||||
Item * files_dir;
|
||||
NotifyMsg notify_msg;
|
||||
|
||||
void SendNotify(const Item & item);
|
||||
};
|
||||
|
||||
|
||||
|
@@ -59,7 +59,7 @@ void CreateTicket::AddTicket(Ticket & ticket, Item & item)
|
||||
if( cur->request->status == WINIX_ERR_OK )
|
||||
{
|
||||
// sending notification
|
||||
notify_msg.code = WINIX_NOTIFY_CODE_USER1;
|
||||
notify_msg.code = WINIX_NOTIFY_CODE_ADD;
|
||||
notify_msg.template_index = ticket_info->template_index;
|
||||
notify_msg.dir_link = config->base_url;
|
||||
system->dirs.MakePath(item.parent_id, notify_msg.dir_link, false);
|
||||
|
@@ -63,8 +63,8 @@ void EditTicket::ChangeTicket(Ticket & ticket, Item & item)
|
||||
if( cur->request->status == WINIX_ERR_OK )
|
||||
{
|
||||
// sending notification
|
||||
/*
|
||||
notify_msg.code = WINIX_NOTIFY_CODE_USER1;
|
||||
|
||||
notify_msg.code = WINIX_NOTIFY_CODE_EDIT;
|
||||
notify_msg.template_index = ticket_info->template_index;
|
||||
notify_msg.dir_link = config->base_url;
|
||||
system->dirs.MakePath(item.parent_id, notify_msg.dir_link, false);
|
||||
@@ -72,7 +72,6 @@ void EditTicket::ChangeTicket(Ticket & ticket, Item & item)
|
||||
notify_msg.item_link += item.url;
|
||||
|
||||
system->notify.ItemChanged(notify_msg);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -14,6 +14,8 @@
|
||||
#include "ticket.h"
|
||||
#include "ticketinfo.h"
|
||||
#include "functions/functionbase.h"
|
||||
#include "notify/notify.h"
|
||||
|
||||
|
||||
|
||||
namespace Ticket
|
||||
@@ -34,16 +36,17 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
TDb * tdb;
|
||||
TicketInfo * ticket_info;
|
||||
std::wstring old_url;
|
||||
NotifyMsg notify_msg;
|
||||
|
||||
void RemoveTmpTicket();
|
||||
Ticket & PrepareTicket();
|
||||
std::vector<long> & PrepareFileMap();
|
||||
std::wstring old_url;
|
||||
|
||||
void ChangeTicket(Ticket & ticket, Item & item);
|
||||
void Submit(Ticket & ticket, Item & item);
|
||||
|
||||
TDb * tdb;
|
||||
TicketInfo * ticket_info;
|
||||
};
|
||||
|
||||
|
||||
|
@@ -336,8 +336,6 @@ bool exists = false;
|
||||
|
||||
ticket_param.Clear();
|
||||
|
||||
log << log1 << "szukamy dla param_id: " << param_id << logend;
|
||||
|
||||
for(size_t i=0 ; i<cur_conf->tab.size() ; ++i)
|
||||
{
|
||||
if( param_id == cur_conf->tab[i].id )
|
||||
|
Reference in New Issue
Block a user