db: core/user table has only 'notify' column now (previous was cms_notify, thread_notify)

added: notifications for tickets (not finished yet)


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@688 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2010-12-06 00:25:46 +00:00
parent b721fb6860
commit ad9d6f4301
29 changed files with 432 additions and 269 deletions

View File

@@ -26,7 +26,22 @@ notify.o: ../core/dirs.h ../core/dircontainer.h ../notify/notify.h
notify.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
notify.o: ../core/users.h ../core/groups.h ../core/group.h ../core/loadavg.h
notify.o: ../core/sessionmanager.h ../core/sessioncontainer.h
notify.o: ../core/system.h ../core/dirs.h ../core/synchro.h
notify.o: ../core/system.h ../core/dirs.h ../core/synchro.h ../core/plugin.h
notify.o: ../core/pluginmsg.h ../core/sessionmanager.h
notify.o: ../functions/functions.h ../functions/functionbase.h
notify.o: ../functions/functionparser.h ../functions/adduser.h
notify.o: ../functions/cat.h ../functions/chmod.h ../functions/privchanger.h
notify.o: ../functions/chown.h ../functions/ckeditor.h ../functions/cp.h
notify.o: ../functions/createthread.h ../functions/default.h
notify.o: ../functions/download.h ../functions/emacs.h ../functions/last.h
notify.o: ../functions/login.h ../functions/logout.h ../functions/ls.h
notify.o: ../functions/mkdir.h ../functions/mv.h ../functions/node.h
notify.o: ../functions/priv.h ../functions/reload.h ../functions/rm.h
notify.o: ../functions/run.h ../functions/stat.h ../functions/subject.h
notify.o: ../functions/funthread.h ../functions/template.h
notify.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
notify.o: ../functions/uptime.h ../functions/who.h ../functions/vim.h
notify.o: ../core/htmlfilter.h
notifypool.o: notifypool.h ../templates/locale.h ../core/confparser.h
notifythread.o: notifythread.h ../core/basethread.h ../core/synchro.h
notifythread.o: templatesnotify.h ../../ezc/src/ezc.h ../../ezc/src/utf8.h
@@ -54,3 +69,43 @@ templatesnotify.o: ../../ezc/src/item.h ../../ezc/src/funinfo.h
templatesnotify.o: ../../ezc/src/functions.h ../../ezc/src/stringconv.h
templatesnotify.o: ../core/textstream.h ../core/misc.h notifypool.h
templatesnotify.o: ../templates/locale.h ../core/confparser.h
templatesnotify.o: ../core/plugin.h ../core/pluginmsg.h ../core/log.h
templatesnotify.o: ../core/textstream.h ../core/plugindata.h ../core/config.h
templatesnotify.o: ../core/request.h ../core/requesttypes.h ../core/session.h
templatesnotify.o: ../core/error.h ../core/user.h ../core/rebus.h
templatesnotify.o: ../templates/htmltextstream.h ../core/system.h
templatesnotify.o: ../core/sessionmanager.h ../core/synchro.h
templatesnotify.o: ../functions/functions.h ../functions/functionbase.h
templatesnotify.o: ../core/item.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
templatesnotify.o: ../db/dbtextstream.h ../core/error.h ../db/dbitemquery.h
templatesnotify.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h
templatesnotify.o: ../core/thread.h ../core/dircontainer.h
templatesnotify.o: ../core/ugcontainer.h ../core/request.h ../core/config.h
templatesnotify.o: ../core/confparser.h ../core/htmlfilter.h ../core/system.h
templatesnotify.o: ../core/dirs.h ../core/dircontainer.h ../notify/notify.h
templatesnotify.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
templatesnotify.o: ../core/users.h ../core/groups.h ../core/group.h
templatesnotify.o: ../core/ugcontainer.h ../core/loadavg.h ../core/synchro.h
templatesnotify.o: ../functions/functionparser.h ../functions/adduser.h
templatesnotify.o: ../functions/cat.h ../functions/chmod.h
templatesnotify.o: ../functions/privchanger.h ../functions/chown.h
templatesnotify.o: ../functions/ckeditor.h ../functions/cp.h
templatesnotify.o: ../functions/createthread.h ../functions/default.h
templatesnotify.o: ../functions/download.h ../functions/emacs.h
templatesnotify.o: ../functions/last.h ../functions/login.h
templatesnotify.o: ../functions/logout.h ../functions/ls.h
templatesnotify.o: ../functions/mkdir.h ../functions/mv.h ../functions/node.h
templatesnotify.o: ../functions/priv.h ../functions/reload.h
templatesnotify.o: ../functions/rm.h ../functions/run.h ../functions/stat.h
templatesnotify.o: ../functions/subject.h ../functions/funthread.h
templatesnotify.o: ../functions/template.h ../functions/tinymce.h
templatesnotify.o: ../functions/uname.h ../functions/upload.h
templatesnotify.o: ../functions/uptime.h ../functions/who.h
templatesnotify.o: ../functions/vim.h ../core/htmlfilter.h
templatesnotify.o: ../templates/templates.h ../templates/patterncacher.h
templatesnotify.o: ../templates/ckeditorgetparser.h
templatesnotify.o: ../core/httpsimpleparser.h ../core/log.h
templatesnotify.o: ../templates/indexpatterns.h ../templates/localefilter.h
templatesnotify.o: ../templates/locale.h ../templates/htmltextstream.h
templatesnotify.o: ../core/sessionmanager.h ../core/sessioncontainer.h
templatesnotify.o: ../core/lastcontainer.h

View File

@@ -14,6 +14,7 @@
#include "core/users.h"
#include "core/dirs.h"
#include "core/synchro.h"
#include "core/plugin.h"
@@ -67,6 +68,8 @@ void Notify::Init()
notify_template_cms = AddTemplate(L"notify_email_cms.txt"); // !! do konfiga
notify_template_thread = AddTemplate(L"notify_email_thread.txt");
plugin.Call(WINIX_NOTIFY_ADD_TEMPLATE);
}
@@ -121,8 +124,16 @@ void Notify::ItemChanged(int notify_code, const Item & item)
return;
}
ItemChanged(msg);
}
// raw form
void Notify::ItemChanged(const NotifyMsg & msg)
{
notify_pool.Add(msg);
SendSignalToThread(); //we are in the first locked thread
SendSignalToThread(); // we are in the first locked thread
}

View File

@@ -46,6 +46,7 @@ public:
void ReadTemplates();
void ItemChanged(int notify_code, const Item & item);
void ItemChanged(const NotifyMsg & msg);
private:

View File

@@ -38,6 +38,20 @@
// additional codes, use it of your own
// you should prepare NotifyMsg structure and use it with ItemChanged method of notify object
// remember that from this code an appropirate user is selected (db->core->user notify value)
// and ezc templates may behave differently
#define WINIX_NOTIFY_CODE_USER1 1024
#define WINIX_NOTIFY_CODE_USER2 2048
#define WINIX_NOTIFY_CODE_USER3 4096
#define WINIX_NOTIFY_CODE_USER4 8192
#define WINIX_NOTIFY_CODE_USER5 16384
#define WINIX_NOTIFY_CODE_USER6 32768
#define WINIX_NOTIFY_CODE_USER7 65536
#define WINIX_NOTIFY_CODE_USER8 131072
struct NotifyMsg
{

View File

@@ -69,8 +69,6 @@ bool NotifyThread::SignalReceived()
{
if( patterns_changed )
{
// !! usunac
log << log3 << "NotifyThread: copying global patterns to local ones" << logend;
patterns = *pat_global;
patterns_changed = false;
}
@@ -98,7 +96,7 @@ bool res = false;
for(i=users->Begin() ; i != users->End() ; ++i)
{
if( (i->cms_notify & TemplatesNotifyFunctions::notify_msg.code) != 0 ) // !! bedzie jedno pole i->notify
if( (i->notify & TemplatesNotifyFunctions::notify_msg.code) != 0 )
{
msg.name = i->name;
msg.email = i->email;
@@ -168,10 +166,14 @@ void NotifyThread::SendMail()
size_t lang_index = static_cast<size_t>(TemplatesNotifyFunctions::notify_user_msg.lang);
size_t template_index = TemplatesNotifyFunctions::notify_msg.template_index;
if( lang_index >= patterns.size() ||
template_index >= patterns[lang_index].size() )
if( lang_index >= patterns.size() )
return;
if( template_index >= patterns[lang_index].size() )
{
// ops, something wrong
Lock();
log << log1 << "NotifyThread: incorrect template index: " << template_index << logend;
Unlock();
return;
}

View File

@@ -8,7 +8,7 @@
*/
#include "templatesnotify.h"
#include "core/plugin.h"
@@ -115,6 +115,8 @@ void CreateFunctions()
//ezc_functions.Insert("notify_doc_base_url", notify_doc_base_url);
ezc_functions.Insert("notify_item_link", notify_item_link);
ezc_functions.Insert("notify_dir_link", notify_dir_link);
plugin.Call(WINIX_NOTIFY_TEMPLATES_CREATEFUNCTIONS, &ezc_functions);
}