Commit ce131d69 authored by floh1111's avatar floh1111

Renamed report class an variables

parent 0a5eb6f4
......@@ -2436,7 +2436,7 @@ lib/refererstats/refererlib.php -text
lib/registration/index.php -text
lib/registration/register_ajax.js -text
lib/registration/registrationlib.php -text
lib/reports.php -text
lib/reportslib.php -text
lib/rss/atom-style.css -text svneol=unset#application/octet-stream
lib/rss/index.php -text
lib/rss/opml.css -text
......
......@@ -6,6 +6,8 @@ if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
exit;
}
include_once('lib/reportslib.php');
class ArtLib extends TikiLib {
function ArtLib($db) {
$this->TikiLib($db);
......@@ -97,13 +99,12 @@ class ArtLib extends TikiLib {
$_SERVER["SERVER_NAME"] = $_SERVER["HTTP_HOST"];
}
include_once ('lib/reports.php');
//Reports added by Clemens John <clemens-john@gmx.de> May 19th 2009
//Pr�fen ob Reports versendet werden d�rfen
if ($prefs['feature_user_watches'] == 'y' && $prefs['feature_daily_report_watches'] == 'y') {
global $reportslib;
//Benutzer die Reports eingeschaltet haben holen
$report_users = $reports->getUsersForReport();
$report_users = $reportslib->getUsersForReport();
//Benutzer die Reports eingeschaltet haben in das Report-Array verschieben.
foreach ($nots as $key=>$not) {
......@@ -113,7 +114,7 @@ class ArtLib extends TikiLib {
}
}
//Daten in den Reportcache schaufeln
$reports->add_report_chache_entries($report_nots, 'article_deleted', array("articleId"=>$articleId, "articleTitle"=>$article_data['title'], "authorName"=>$article_data['authorName'], "user"=>$user));
$reportslib->add_report_chache_entries($report_nots, 'article_deleted', array("articleId"=>$articleId, "articleTitle"=>$article_data['title'], "authorName"=>$article_data['authorName'], "user"=>$user));
}
if (count($nots) || is_array($emails)) {
......@@ -330,14 +331,12 @@ class ArtLib extends TikiLib {
$_SERVER["SERVER_NAME"] = $_SERVER["HTTP_HOST"];
}
include_once ('lib/reports.php');
global $prefs;
global $prefs, $reportslib;
//Reports added by Clemens John <clemens-john@gmx.de> May 19th 2009
//Pr�fen ob Reports versendet werden d�rfen
if ($prefs['feature_user_watches'] == 'y' && $prefs['feature_daily_report_watches'] == 'y') {
//Benutzer die Reports eingeschaltet haben holen
$report_users = $reports->getUsersForReport();
$report_users = $reportslib->getUsersForReport();
//Benutzer die Reports eingeschaltet haben in das Report-Array verschieben.
foreach ($nots as $key=>$not) {
......@@ -347,7 +346,7 @@ class ArtLib extends TikiLib {
}
}
//Daten in den Reportcache schaufeln
$reports->add_report_chache_entries($report_nots, $event, array("articleId"=>$articleId, "articleTitle"=>$title, "authorName"=>$authorName, "user"=>$user));
$reportslib->add_report_chache_entries($report_nots, $event, array("articleId"=>$articleId, "articleTitle"=>$title, "authorName"=>$authorName, "user"=>$user));
}
if (count($nots) || is_array($emails)) {
......
......@@ -284,13 +284,13 @@ class BlogLib extends TikiLib {
$_SERVER["SERVER_NAME"] = $_SERVER["HTTP_HOST"];
}
include_once ('lib/reports.php');
include_once ('lib/reportslib.php');
//Reports added by Clemens John <clemens-john@gmx.de> May 19th 2009
//Pr�fen ob Reports versendet werden d�rfen
if ($prefs['feature_user_watches'] == 'y' && $prefs['feature_daily_report_watches'] == 'y') {
//Benutzer die Reports eingeschaltet haben holen
$report_users = $reports->getUsersForReport();
$report_users = $reportslib->getUsersForReport();
//Benutzer die Reports eingeschaltet haben in das Report-Array verschieben.
foreach ($nots as $key=>$not) {
......@@ -302,7 +302,7 @@ class BlogLib extends TikiLib {
//Daten in den Reportcache schaufeln
$query = "select `title` from `tiki_blogs` where `blogId`=?";
$blogTitle = $this->getOne($query, array((int)$blogId));
$reports->add_report_chache_entries($report_nots, 'blog_post', array("blogId"=>$blogId, "blogTitle"=>$blogTitle, "postId"=>$id, "user"=>$user));
$reportslib->add_report_chache_entries($report_nots, 'blog_post', array("blogId"=>$blogId, "blogTitle"=>$blogTitle, "postId"=>$id, "user"=>$user));
}
if (count($nots)) {
......
......@@ -909,13 +909,13 @@ class ImageGalsLib extends TikiLib {
$event = 'image_gallery_changed';
$nots = $this->get_event_watches($event, $galleryId);
include_once ('lib/reports.php');
include_once ('lib/reportslib.php');
//Reports added by Clemens John <clemens-john@gmx.de> May 19th 2009
//Pr�fen ob Reports versendet werden d�rfen
if ($prefs['feature_user_watches'] == 'y' && $prefs['feature_daily_report_watches'] == 'y') {
//Benutzer die Reports eingeschaltet haben holen
$report_users = $reports->getUsersForReport();
$report_users = $reportslib->getUsersForReport();
//Benutzer die Reports eingeschaltet haben in das Report-Array verschieben.
foreach ($nots as $key=>$not) {
......@@ -926,7 +926,7 @@ class ImageGalsLib extends TikiLib {
}
//Daten in den Reportcache schaufeln
$reports->add_report_chache_entries($report_nots, $event, array("imageId"=>$imageId, "imageName"=>$name, "fileName"=>$filename, "galleryId"=>$galleryId, "galleryName"=>$galleryName, "action"=>$action, "user"=>$user));
$reportslib->add_report_chache_entries($report_nots, $event, array("imageId"=>$imageId, "imageName"=>$name, "fileName"=>$filename, "galleryId"=>$galleryId, "galleryName"=>$galleryName, "action"=>$action, "user"=>$user));
}
include_once('lib/notifications/notificationemaillib.php');
......
......@@ -9,6 +9,8 @@
* \param $topicName name of the parent topic
*/
include_once ('lib/reportslib.php');
function sendForumEmailNotification($event, $object, $forum_info, $title, $data, $author, $topicName, $messageId='', $inReplyTo='', $threadId, $parentId, $contributions='', $postId='') {
global $tikilib, $prefs, $smarty, $userlib;
......@@ -102,13 +104,12 @@ function sendForumEmailNotification($event, $object, $forum_info, $title, $data,
$nots[] = $not;
}
include_once ('lib/reports.php');
//Reports added by Clemens John <clemens-john@gmx.de> May 19th 2009
//Prfen ob Reports versendet werden drfen
//Pr�fen ob Reports versendet werden d�rfen
if ($prefs['feature_user_watches'] == 'y' && $prefs['feature_daily_report_watches'] == 'y') {
global $reportslib;
//Benutzer die Reports eingeschaltet haben holen
$report_users = $reports->getUsersForReport();
$report_users = $reportslib->getUsersForReport();
//Benutzer die Reports eingeschaltet haben in das Report-Array verschieben.
foreach ($nots as $key=>$not) {
......@@ -118,7 +119,7 @@ function sendForumEmailNotification($event, $object, $forum_info, $title, $data,
}
}
//Daten in den Reportcache schaufeln
$reports->add_report_chache_entries($report_nots, $event, array("forumId"=>$forum_info['forumId'], "forumName"=>$forum_info['name'], "topicId"=>$threadId, "threadId"=>$postId, "threadName"=>$topicName, "user"=>$author));
$reportslib->add_report_chache_entries($report_nots, $event, array("forumId"=>$forum_info['forumId'], "forumName"=>$forum_info['name'], "topicId"=>$threadId, "threadId"=>$postId, "threadName"=>$topicName, "user"=>$author));
}
if (count($nots)) {
......@@ -230,14 +231,13 @@ function sendWikiEmailNotification($event, $pageName, $edit_user, $edit_comment,
}
if ($edit_user=='') $edit_user = tra('Anonymous');
include_once ('lib/reports.php');
//Reports added by Clemens John <clemens-john@gmx.de> May 19th 2009
//Prfen ob Reports versendet werden drfen
//Pr�fen ob Reports versendet werden d�rfen
if ($prefs['feature_user_watches'] == 'y' && $prefs['feature_daily_report_watches'] == 'y') {
global $reportslib;
//Benutzer die Reports eingeschaltet haben holen
$report_users = $reports->getUsersForReport();
$report_users = $reportslib->getUsersForReport();
//Benutzer die Reports eingeschaltet haben in das Report-Array verschieben.
foreach ($nots as $key=>$not) {
......@@ -248,7 +248,7 @@ function sendWikiEmailNotification($event, $pageName, $edit_user, $edit_comment,
}
//Daten in den Reportcache schaufeln
$reports->add_report_chache_entries($report_nots, $event, array("pageName"=>$pageName, "object"=>$pageName, "editUser"=>$edit_user, "editComment"=>$edit_comment, "oldVer"=>$oldver));
$reportslib->add_report_chache_entries($report_nots, $event, array("pageName"=>$pageName, "object"=>$pageName, "editUser"=>$edit_user, "editComment"=>$edit_comment, "oldVer"=>$oldver));
}
if (count($nots)) {
......@@ -385,13 +385,12 @@ function sendFileGalleryEmailNotification($event, $galleryId, $galleryName, $nam
}
}
include_once ('lib/reports.php');
//Reports added by Clemens John <clemens-john@gmx.de> May 19th 2009
//Prfen ob Reports versendet werden drfen
//Pr�fen ob Reports versendet werden d�rfen
if ($prefs['feature_user_watches'] == 'y' && $prefs['feature_daily_report_watches'] == 'y') {
global $reportslib;
//Benutzer die Reports eingeschaltet haben holen
$report_users = $reports->getUsersForReport();
$report_users = $reportslib->getUsersForReport();
//Benutzer die Reports eingeschaltet haben in das Report-Array verschieben.
foreach ($nots as $key=>$not) {
......@@ -402,7 +401,7 @@ function sendFileGalleryEmailNotification($event, $galleryId, $galleryName, $nam
}
//Daten in den Reportcache schaufeln
$reports->add_report_chache_entries($report_nots, $event, array("name"=>$name, "fileId"=>$fileId, "fileName"=>$filename, "galleryId"=>$galleryId, "galleryName"=>$galleryName, "action"=>$action, "user"=>$user));
$reportslib->add_report_chache_entries($report_nots, $event, array("name"=>$name, "fileId"=>$fileId, "fileName"=>$filename, "galleryId"=>$galleryId, "galleryName"=>$galleryName, "action"=>$action, "user"=>$user));
}
if (count($nots)) {
......@@ -484,13 +483,12 @@ function sendCategoryEmailNotification($values) {
}
}
include_once ('lib/reports.php');
//Reports added by Clemens John <clemens-john@gmx.de> May 19th 2009
//Prfen ob Reports versendet werden drfen
//Pr�fen ob Reports versendet werden d�rfen
if ($prefs['feature_user_watches'] == 'y' && $prefs['feature_daily_report_watches'] == 'y') {
global $reportslib;
//Benutzer die Reports eingeschaltet haben holen
$report_users = $reports->getUsersForReport();
$report_users = $reportslib->getUsersForReport();
//Benutzer die Reports eingeschaltet haben in das Report-Array verschieben.
foreach ($nots as $key=>$not) {
......@@ -502,7 +500,7 @@ function sendCategoryEmailNotification($values) {
//Daten in den Reportcache schaufeln
$values['user'] = $user;
$reports->add_report_chache_entries($report_nots, $event, $values);
$reportslib->add_report_chache_entries($report_nots, $event, $values);
}
if (count($nots)) {
......
This diff is collapsed.
Report for {$report_user}.<!--{$report_interval}-Report from {$report_date};-->
Last Report sent on {$report_last_report_date}.
Report for {$report_user}.<br><!--{$report_interval}-Report from {$report_date};-->
Last Report sent on {$report_last_report_date}.<br><br>
<!--Total changes: {$report_total_changes};-->
<u>Changes in detail:</u>
<u>Changes in detail:</u><br>
{$report_body}
{if $mail_contributions}{tr}Contribution{/tr}: {$mail_contributions}{/if}
\ No newline at end of file
......@@ -18,18 +18,18 @@ if ($prefs['feature_daily_report_watches'] != 'y') {
die;
}
include_once ('lib/reports.php');
include_once ('lib/reportslib.php');
//Enable User Report
if (isset($_POST['report_preferences']) && $_POST['use_daily_reports']=="true") {
$reports->add_user_report($user,$_POST['interval'],$_POST['view'],$_POST['type'], $_POST['always_email']);
$reportslib->add_user_report($user,$_POST['interval'],$_POST['view'],$_POST['type'], $_POST['always_email']);
header('Location: tiki-user_watches.php');
die;
}
//Enable User Report
if (isset($_POST['report_preferences']) && $_POST['use_daily_reports']!="true") {
$reports->delete_user_report($user);
$reportslib->delete_user_report($user);
header('Location: tiki-user_watches.php');
die;
}
......
......@@ -18,22 +18,24 @@ include_once ('lib/tikilib.php');
include_once ('lib/wiki/histlib.php');
include_once ('lib/imagegals/imagegallib.php');
include_once ('lib/imagegals/imagegallib.php');
include_once ('lib/reports.php');
include_once ('lib/reportslib.php');
foreach ($reports->getUsersForReport() as $key => $user) {
$report_preferences = $reports->get_report_preferences_by_user($user);
foreach ($reportslib->getUsersForReport() as $key => $user) {
$report_preferences = $reportslib->get_report_preferences_by_user($user);
$user_data = $userlib->get_user_info($user);
//Wenn keine Emailadresse gesetzt ist, mache nichts und leere den Cache
if (!empty($user_data['email'])) {
//Hole Cache
$report_cache = $reports->get_report_cache_entries_by_user($user, "time ASC");
$report_cache = $reportslib->get_report_cache_entries_by_user($user, "time ASC");
//Schicke Email wenn: Einträge vorhanden oder always_email = true
if ($report_cache OR (!$report_cache && $report_preferences['always_email']))
$reports->sendEmail($user_data, $report_preferences, $report_cache);
$reportslib->sendEmail($user_data, $report_preferences, $report_cache);
}
//Cache leeren
$reports->deleteUsersReportCache($user_data);
// $reportslib->deleteUsersReportCache($user_data);
//Last Report send setzen
$reportslib->updateLastSent($user_data);
}
......
......@@ -8,7 +8,7 @@
$section = 'mytiki';
include_once ('tiki-setup.php');
include_once ('lib/reports.php');
include_once ('lib/reportslib.php');
if ($prefs['feature_ajax'] == "y") {
require_once ('lib/ajax/ajaxlib.php');
......@@ -170,7 +170,7 @@ user_watches_ajax();
$smarty->assign("mootab",'y');
}
$report_preferences = $reports->get_report_preferences_by_user($user);
$report_preferences = $reportslib->get_report_preferences_by_user($user);
if ($report_preferences) {
$smarty->assign_by_ref('report_preferences', $report_preferences);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment