changed: notification's template
added: notifications in tickets git-svn-id: svn://ttmath.org/publicrep/winix/trunk@650 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -68,7 +68,11 @@ db_itemcolumns.o: dircontainer.h ugcontainer.h ticket.h
|
|||||||
dircontainer.o: dircontainer.h item.h log.h
|
dircontainer.o: dircontainer.h item.h log.h
|
||||||
dirs.o: dirs.h item.h dircontainer.h db.h user.h group.h thread.h error.h
|
dirs.o: dirs.h item.h dircontainer.h db.h user.h group.h thread.h error.h
|
||||||
dirs.o: log.h ugcontainer.h ticket.h request.h requesttypes.h session.h
|
dirs.o: log.h ugcontainer.h ticket.h request.h requesttypes.h session.h
|
||||||
dirs.o: plugindata.h rebus.h config.h confparser.h htmlfilter.h
|
dirs.o: plugindata.h rebus.h config.h confparser.h htmlfilter.h notify.h
|
||||||
|
dirs.o: ../templatesnotify/templatesnotify.h ../../ezc/src/ezc.h
|
||||||
|
dirs.o: ../core/mount.h ../core/locale.h ../core/config.h ../templates/misc.h
|
||||||
|
dirs.o: ../templates/localefilter.h ../core/locale.h system.h mounts.h
|
||||||
|
dirs.o: mount.h users.h lastcontainer.h groups.h loadavg.h
|
||||||
groups.o: groups.h group.h ugcontainer.h log.h db.h item.h user.h thread.h
|
groups.o: groups.h group.h ugcontainer.h log.h db.h item.h user.h thread.h
|
||||||
groups.o: error.h dircontainer.h ticket.h
|
groups.o: error.h dircontainer.h ticket.h
|
||||||
htmlfilter.o: htmlfilter.h
|
htmlfilter.o: htmlfilter.h
|
||||||
|
@@ -10,6 +10,7 @@
|
|||||||
#include "dirs.h"
|
#include "dirs.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
#include "notify.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -418,6 +419,7 @@ Error Dirs::AddDirectory(Item & item, bool add_to_dir_tab)
|
|||||||
|
|
||||||
if( status == WINIX_ERR_OK )
|
if( status == WINIX_ERR_OK )
|
||||||
{
|
{
|
||||||
|
request->notify_code |= WINIX_NOTIFY_DIR_ADD;
|
||||||
Item * pdir = AddDir(item);
|
Item * pdir = AddDir(item);
|
||||||
|
|
||||||
if( add_to_dir_tab && request->dir_tab.back()->id == item.parent_id )
|
if( add_to_dir_tab && request->dir_tab.back()->id == item.parent_id )
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is not publicly distributed
|
||||||
*
|
*
|
||||||
* Copyright (c) 2009, Tomasz Sowa
|
* Copyright (c) 2009-2010, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
* This file is a part of Winix
|
* This file is a part of Winix
|
||||||
* and is not publicly distributed
|
* and is not publicly distributed
|
||||||
*
|
*
|
||||||
* Copyright (c) 2009, Tomasz Sowa
|
* Copyright (c) 2009-2010, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@@ -108,7 +108,7 @@ void Notify::SendEmail(const std::string & email, const std::string & message)
|
|||||||
|
|
||||||
if( !ValidateEmail(email) )
|
if( !ValidateEmail(email) )
|
||||||
{
|
{
|
||||||
nlog << "Notify: email: " << email << " is not correct" << logend;
|
nlog << log1 << "Notify: email: " << email << " is not correct" << logend;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,14 +117,14 @@ void Notify::SendEmail(const std::string & email, const std::string & message)
|
|||||||
|
|
||||||
if( !sendmail )
|
if( !sendmail )
|
||||||
{
|
{
|
||||||
nlog << "Notify: can't run sendmail" << logend;
|
nlog << log1 << "Notify: can't run sendmail" << logend;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SendMessage(sendmail, message);
|
SendMessage(sendmail, message);
|
||||||
pclose(sendmail);
|
pclose(sendmail);
|
||||||
|
|
||||||
nlog << "Notify: email to: " << email << " has been sent" << logend;
|
nlog << log1 << "Notify: email to: " << email << " has been sent" << logend;
|
||||||
nlog << logsave;
|
nlog << logsave;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -252,7 +252,7 @@ Users::Iterator i;
|
|||||||
{
|
{
|
||||||
sending = false;
|
sending = false;
|
||||||
|
|
||||||
if( system->mounts.pmount->type == Mount::thread )
|
if( system->mounts.pmount->type == Mount::thread || system->mounts.pmount->type == Mount::ticket )
|
||||||
{
|
{
|
||||||
if( (i->thread_notify & notify_code) != 0 )
|
if( (i->thread_notify & notify_code) != 0 )
|
||||||
sending = true;
|
sending = true;
|
||||||
|
@@ -93,6 +93,12 @@ void CreateTicket::AddTicket()
|
|||||||
functions->fun_ticket.ticket.item_id = request->item.id; // this id is set by PostFunEmacsAdd()
|
functions->fun_ticket.ticket.item_id = request->item.id; // this id is set by PostFunEmacsAdd()
|
||||||
|
|
||||||
request->status = db->AddTicket(functions->fun_ticket.ticket);
|
request->status = db->AddTicket(functions->fun_ticket.ticket);
|
||||||
|
|
||||||
|
if( request->status == WINIX_ERR_OK )
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
#include "emacs.h"
|
#include "emacs.h"
|
||||||
#include "templates/templates.h"
|
#include "templates/templates.h"
|
||||||
#include "core/notify.h"
|
|
||||||
#include "functions.h"
|
#include "functions.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -46,12 +45,7 @@ return false;
|
|||||||
|
|
||||||
bool Emacs::HasAccess()
|
bool Emacs::HasAccess()
|
||||||
{
|
{
|
||||||
if( !request->is_item )
|
return HasAccess(*request->last_item);
|
||||||
return HasAccess(*request->dir_tab.back()); // adding a new item
|
|
||||||
else
|
|
||||||
return HasAccess(request->item); // editing an existing item
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
#include "mkdir.h"
|
#include "mkdir.h"
|
||||||
#include "functions.h"
|
#include "functions.h"
|
||||||
#include "core/notify.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -69,7 +68,6 @@ void Mkdir::PostFunMkdir(bool add_to_dir_tab, int privileges)
|
|||||||
|
|
||||||
if( request->status == WINIX_ERR_OK )
|
if( request->status == WINIX_ERR_OK )
|
||||||
{
|
{
|
||||||
request->notify_code |= WINIX_NOTIFY_DIR_ADD;
|
|
||||||
system->RedirectTo(request->item);
|
system->RedirectTo(request->item);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -1,46 +1,70 @@
|
|||||||
Subject: [if-one notify_item_added]{notify_new}[else]{notify_change}[end]
|
Subject: [if notify_item_added]{notify_new}[else]{notify_change}[end]\n
|
||||||
From: {notify_from}
|
From: {notify_from}\n
|
||||||
To: [notify_to]
|
To: [notify_to]\n
|
||||||
Content-Type: {notify_content_type}
|
Content-Type: {notify_content_type}
|
||||||
|
\n\n
|
||||||
{notify_header}
|
{notify_header}
|
||||||
|
\n\n
|
||||||
|
|
||||||
{notify_msg1}[if-one notify_mount_type_is_thread]
|
{notify_msg1}\s
|
||||||
|
[if-one notify_mount_type_is_thread notify_mount_type_is_ticket]
|
||||||
|
|
||||||
[if-one notify_dir_added] {notify_msg2}
|
[if notify_dir_added]
|
||||||
[notify_doc_base_url][notify_item_dir]
|
[if notify_mount_type_is_thread]
|
||||||
[else]
|
{notify_msg2}\n
|
||||||
[if-one notify_item_added] {notify_msg3}
|
[else]
|
||||||
[notify_doc_base_url][notify_item_dir]
|
{notify_msg2b}\n
|
||||||
[end]
|
[end]
|
||||||
[end]
|
|
||||||
|
|
||||||
[if-one notify_item_edited] {notify_msg4}
|
[notify_doc_base_url][notify_item_dir]\n\n
|
||||||
[notify_doc_base_url][notify_item_dir]
|
[else]
|
||||||
[end]
|
[if notify_item_added]
|
||||||
|
[if notify_mount_type_is_thread]
|
||||||
|
{notify_msg3}\n
|
||||||
|
[else]
|
||||||
|
{notify_msg3b}\n
|
||||||
|
[end]
|
||||||
|
|
||||||
[if-one notify_item_deleted] {notify_msg5}
|
[notify_doc_base_url][notify_item_dir]\n\n
|
||||||
[notify_doc_base_url][notify_item_dir]
|
[end]
|
||||||
[end]
|
[end]
|
||||||
|
|
||||||
|
[if notify_item_edited]
|
||||||
|
{notify_msg4}\n
|
||||||
|
[notify_doc_base_url][notify_item_dir]\n\n
|
||||||
|
[end]
|
||||||
|
|
||||||
|
[if notify_item_deleted]
|
||||||
|
{notify_msg5}\n
|
||||||
|
[notify_doc_base_url][notify_item_dir]\n\n
|
||||||
|
[end]
|
||||||
|
|
||||||
[else]
|
[else]
|
||||||
[if-one notify_mount_type_is_cms]
|
[if notify_mount_type_is_cms]
|
||||||
|
|
||||||
[if-one notify_item_added] {notify_msg6}
|
[if-one notify_item_added notify_dir_added]
|
||||||
[notify_item_link]
|
{notify_msg6}\n
|
||||||
|
[notify_item_link]\n\n
|
||||||
|
[end]
|
||||||
|
|
||||||
|
[if notify_item_edited]
|
||||||
|
{notify_msg7}\n
|
||||||
|
[notify_item_link]\n\n
|
||||||
|
[end]
|
||||||
|
|
||||||
|
[if notify_item_deleted]
|
||||||
|
{notify_msg8}\n
|
||||||
|
[notify_item_link]\n\n
|
||||||
|
[end]
|
||||||
|
|
||||||
|
[end]
|
||||||
[end]
|
[end]
|
||||||
|
|
||||||
[if-one notify_item_edited] {notify_msg7}
|
{notify_msg9}\n
|
||||||
[notify_item_link]
|
{notify_msg9b}\n
|
||||||
[end]
|
\n
|
||||||
|
-- \n
|
||||||
[if-one notify_item_deleted] {notify_msg8}
|
{notify_footer1}\n
|
||||||
[notify_item_link]
|
{notify_footer2}\n
|
||||||
[end]
|
{notify_footer3}\n
|
||||||
|
{notify_footer4}\n
|
||||||
[end]
|
|
||||||
[end]
|
|
||||||
|
|
||||||
{notify_msg9}
|
|
||||||
|
|
||||||
{notify_footer}
|
|
||||||
|
14
locale/en
14
locale/en
@@ -230,19 +230,25 @@ uname_header = Uname
|
|||||||
# notifications
|
# notifications
|
||||||
notify_new = News
|
notify_new = News
|
||||||
notify_change = Changes
|
notify_change = Changes
|
||||||
notify_from = ttmath.org notifications <dontreply@ttmath.org>
|
notify_from = winix notifications <dontreply@winix.org>
|
||||||
notify_content_type = text/plain; charset="ISO-8859-1"
|
notify_content_type = text/plain; charset="ISO-8859-1"
|
||||||
notify_header = Welcome
|
notify_header = Welcome
|
||||||
notify_msg1 = We would like to inform you that
|
notify_msg1 = We would like to inform you that
|
||||||
notify_msg2 = someone started a new thread:
|
notify_msg2 = someone created a new thread:
|
||||||
|
notify_msg2b = someone created a new ticket:
|
||||||
notify_msg3 = someone replayed in a thread:
|
notify_msg3 = someone replayed in a thread:
|
||||||
|
notify_msg3b = someone replayed in a ticket:
|
||||||
notify_msg4 = someone has changed its post:
|
notify_msg4 = someone has changed its post:
|
||||||
notify_msg5 = a post has been deleted from a thread:
|
notify_msg5 = a post has been deleted from a thread:
|
||||||
notify_msg6 = a new page has been added:
|
notify_msg6 = a new page has been added:
|
||||||
notify_msg7 = a page has been modified:
|
notify_msg7 = a page has been modified:
|
||||||
notify_msg8 = a page has been deleted:
|
notify_msg8 = a page has been deleted:
|
||||||
notify_msg9 = We invite you to read.\nHave a good day. Bye.
|
notify_msg9 = We invite you to read.
|
||||||
notify_footer = \n\n-- \nhttp://www.ttmath.org\nThis message has been sent automatically - do not answer please.\nIf you do not want to receive such messages you can switch them off\nin your user control panel.
|
notify_msg9b = Have a good day. Bye.
|
||||||
|
notify_footer1 = http://www.winix.org
|
||||||
|
notify_footer2 = This message has been sent automatically - do not answer please.
|
||||||
|
notify_footer3 = If you do not want to receive such messages you can switch them off
|
||||||
|
notify_footer4 = in your user control panel.
|
||||||
|
|
||||||
# errors
|
# errors
|
||||||
winix_err_default = An error occured, error code:
|
winix_err_default = An error occured, error code:
|
||||||
|
10
locale/pl
10
locale/pl
@@ -234,19 +234,25 @@ uname_header = Nazwa systemu
|
|||||||
# notifications
|
# notifications
|
||||||
notify_new = Co<43> nowego
|
notify_new = Co<43> nowego
|
||||||
notify_change = Zmiany
|
notify_change = Zmiany
|
||||||
notify_from = <EFBFBD>limaczkowe powiadomienia <dontreply@slimaczek.pl>
|
notify_from = winix notifications <dontreply@winix.org>
|
||||||
notify_content_type = text/plain; charset="ISO-8859-2"
|
notify_content_type = text/plain; charset="ISO-8859-2"
|
||||||
notify_header = Witamy
|
notify_header = Witamy
|
||||||
notify_msg1 = Chcieliby<62>my powiadomi<6D> <20>e w<>a<EFBFBD>nie
|
notify_msg1 = Chcieliby<62>my powiadomi<6D> <20>e w<>a<EFBFBD>nie
|
||||||
notify_msg2 = kto<74> rozpocz<63><7A> nowy w<>tek:
|
notify_msg2 = kto<74> rozpocz<63><7A> nowy w<>tek:
|
||||||
|
notify_msg2b = kto<74> rozpocz<63><7A> nowy ticket:
|
||||||
notify_msg3 = kto<74> odpowiedzia<69> w w<>tku:
|
notify_msg3 = kto<74> odpowiedzia<69> w w<>tku:
|
||||||
|
notify_msg3b = kto<74> odpowiedzia<69> w tickecie:
|
||||||
notify_msg4 = kto<74> zmieni<6E> swoj<6F> odpowied<65> w w<>tku:
|
notify_msg4 = kto<74> zmieni<6E> swoj<6F> odpowied<65> w w<>tku:
|
||||||
notify_msg5 = czyja<6A> odpowied<65> zosta<74>a skasowana z w<>tku:
|
notify_msg5 = czyja<6A> odpowied<65> zosta<74>a skasowana z w<>tku:
|
||||||
notify_msg6 = pojawi<77>a si<73> nowa pozycja do poczytania:
|
notify_msg6 = pojawi<77>a si<73> nowa pozycja do poczytania:
|
||||||
notify_msg7 = zmieniono co<63> na:
|
notify_msg7 = zmieniono co<63> na:
|
||||||
notify_msg8 = skasowano nast<73>puj<75>c<EFBFBD> pozycj<63>:
|
notify_msg8 = skasowano nast<73>puj<75>c<EFBFBD> pozycj<63>:
|
||||||
notify_msg9 = <20>yczymy mi<6D>ego dnia i zapraszamy do lektury.
|
notify_msg9 = <20>yczymy mi<6D>ego dnia i zapraszamy do lektury.
|
||||||
notify_footer = \n\n-- \nhttp://www.slimaczek.pl\nTa wiadomo<6D><6F> zosta<74>a wys<79>ana automatycznie - prosimy na ni<6E> nie odpowiada<64>.\nJe<4A>li nie chcesz dostawa<77> wi<77>cej takich wiadomo<6D>ci mo<6D>esz je wy<77><79>czy<7A>\nw swoim panelu u<>ytkownika.
|
notify_msg9b = ""
|
||||||
|
notify_footer1 = http://www.winix.org
|
||||||
|
notify_footer2 = Ta wiadomo<6D><6F> zosta<74>a wys<79>ana automatycznie - prosimy na ni<6E> nie odpowiada<64>.
|
||||||
|
notify_footer3 = Je<4A>li nie chcesz dostawa<77> wi<77>cej takich wiadomo<6D>ci mo<6D>esz je wy<77><79>czy<7A>
|
||||||
|
notify_footer4 = w swoim panelu u<>ytkownika.
|
||||||
|
|
||||||
|
|
||||||
# errors
|
# errors
|
||||||
|
@@ -55,6 +55,10 @@ void notify_mount_type_is_thread(Info & i)
|
|||||||
i.res = notify_msg->current_mount_type == Mount::thread;
|
i.res = notify_msg->current_mount_type == Mount::thread;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void notify_mount_type_is_ticket(Info & i)
|
||||||
|
{
|
||||||
|
i.res = notify_msg->current_mount_type == Mount::ticket;
|
||||||
|
}
|
||||||
|
|
||||||
void notify_mount_type_is_cms(Info & i)
|
void notify_mount_type_is_cms(Info & i)
|
||||||
{
|
{
|
||||||
|
@@ -55,6 +55,7 @@ using namespace TemplatesNotifyFunctions;
|
|||||||
ezc_functions.Insert("notify_dir_added", notify_dir_added);
|
ezc_functions.Insert("notify_dir_added", notify_dir_added);
|
||||||
ezc_functions.Insert("notify_to", notify_to);
|
ezc_functions.Insert("notify_to", notify_to);
|
||||||
ezc_functions.Insert("notify_mount_type_is_thread", notify_mount_type_is_thread);
|
ezc_functions.Insert("notify_mount_type_is_thread", notify_mount_type_is_thread);
|
||||||
|
ezc_functions.Insert("notify_mount_type_is_ticket", notify_mount_type_is_ticket);
|
||||||
ezc_functions.Insert("notify_mount_type_is_cms", notify_mount_type_is_cms);
|
ezc_functions.Insert("notify_mount_type_is_cms", notify_mount_type_is_cms);
|
||||||
ezc_functions.Insert("notify_doc_base_url", notify_doc_base_url);
|
ezc_functions.Insert("notify_doc_base_url", notify_doc_base_url);
|
||||||
ezc_functions.Insert("notify_item_dir", notify_item_dir);
|
ezc_functions.Insert("notify_item_dir", notify_item_dir);
|
||||||
@@ -112,6 +113,9 @@ using namespace TemplatesNotifyFunctions;
|
|||||||
}
|
}
|
||||||
|
|
||||||
Ezc::Generator generator(notify_str, patterns[lang][pat_email_notify], ezc_functions);
|
Ezc::Generator generator(notify_str, patterns[lang][pat_email_notify], ezc_functions);
|
||||||
|
generator.RecognizeSpecialChars(true);
|
||||||
|
generator.TrimWhite(true);
|
||||||
|
generator.SkipNewLine(true);
|
||||||
generator.Generate();
|
generator.Generate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -56,6 +56,7 @@ namespace TemplatesNotifyFunctions
|
|||||||
void notify_dir_added(Info & i);
|
void notify_dir_added(Info & i);
|
||||||
void notify_to(Info & i);
|
void notify_to(Info & i);
|
||||||
void notify_mount_type_is_thread(Info & i);
|
void notify_mount_type_is_thread(Info & i);
|
||||||
|
void notify_mount_type_is_ticket(Info & i);
|
||||||
void notify_mount_type_is_cms(Info & i);
|
void notify_mount_type_is_cms(Info & i);
|
||||||
void notify_doc_base_url(Info & i);
|
void notify_doc_base_url(Info & i);
|
||||||
void notify_item_dir(Info & i);
|
void notify_item_dir(Info & i);
|
||||||
|
Reference in New Issue
Block a user