fixed some message log bugs and added more guid stuff

This commit is contained in:
JT Smith 2004-08-13 16:10:25 +00:00
parent 847e2dabd9
commit f5cdf6aafe
5 changed files with 19 additions and 12 deletions

View file

@ -45,6 +45,9 @@
- BugFix: [ 997885 ] Root move left bug.
- Changed 'lft' and 'rgt' database field names to 'nestedSetLeft' and 'nestedSetRight'. (Martin Kamerbeek)
- Added WebGUI::Session::getScratch().
- bugfix [ 996169 ] message log && uss not working
- bugfix [ 1000944 ] WebGUI::MessageLog::addInternationalizedEntry error
- bugfix [ 996170 ] mesage log logId not being passed
- Added template variables user.canPost and user.canView in forum_loop to MessageBoard / RFE[864134] (Leendert Bottelberghs)
- Made flat thread work like flat thread -> messages sorted by submission date / RFE[995982]. (Leendert Bottelberghs)

View file

@ -255,5 +255,5 @@ alter table users change referringAffiliate referringAffiliate char(22) not null
alter table page change lft nestedSetLeft int(11);
alter table page change rgt nestedSetRight int(11);
alter table page change id id char(22);
delete from incrementer where incrementerId in ("profileCategoryId","templateId","navigationId","passiveProfileLogId","metaData_fieldId","userId","collateralId","pageId","databaseLinkId", "DataForm_entryId", "DataForm_fieldId", "DataForm_tabId", "EventsCalendar_eventId", "EventsCalendar_recurringId", "FileManager_fileId", "forumId", "forumPostId", "forumThreadId", "groupId", "languageId", "Product_benefitId", "Product_featureId", "Product_specificationId", "replacementId", "Survey_answerId", "Survey_id", "Survey_questionId", "Survey_responseId", "USS_id", "USS_submissionId", "wobjectId");
delete from incrementer where incrementerId in ("messageLogId","profileCategoryId","templateId","navigationId","passiveProfileLogId","metaData_fieldId","userId","collateralId","pageId","databaseLinkId", "DataForm_entryId", "DataForm_fieldId", "DataForm_tabId", "EventsCalendar_eventId", "EventsCalendar_recurringId", "FileManager_fileId", "forumId", "forumPostId", "forumThreadId", "groupId", "languageId", "Product_benefitId", "Product_featureId", "Product_specificationId", "replacementId", "Survey_answerId", "Survey_id", "Survey_questionId", "Survey_responseId", "USS_id", "USS_submissionId", "wobjectId");

View file

@ -32,7 +32,7 @@ This package provides an interface to the internationalization system.
use WebGUI::International;
$string = WebGUI::International::get($internationalId,$namespace);
$hashRef = WebGUI::International::getLanguage($lang);
%languages = WebGUI::International::getLanguages();
$hashRef = WebGUI::International::getLanguages();
This package can also be used in object-oriented (OO) style.

View file

@ -18,6 +18,7 @@ package WebGUI::MessageLog;
use strict;
use Tie::CPHash;
use WebGUI::DateTime;
use WebGUI::Id;
use WebGUI::International;
use WebGUI::Macro;
use WebGUI::Mail;
@ -118,7 +119,7 @@ The addressee email address. Defaults to company email.
sub addEntry {
my ($u, @users, $messageLogId, $sth, $userId, $groupId, $subject, $message, $url, $status, $user, $from);
$messageLogId = getNextId("messageLogId");
$messageLogId = WebGUI::Id::generate();
$userId = $_[0];
$groupId = $_[1];
$subject = $_[2];
@ -127,14 +128,14 @@ sub addEntry {
$status = $_[5];
$from = $_[6];
if ($groupId ne "") {
@users = WebGUI::SQL->buildArray("select userId from groupings where groupId=$groupId");
@users = WebGUI::SQL->buildArray("select userId from groupings where groupId=".quote($groupId));
}
@users = ($userId,@users) if ($userId ne "" && !isIn($userId, @users));
foreach $user (@users) {
$u = WebGUI::User->new($user);
if ($u->userId ne "") {
WebGUI::SQL->write("insert into messageLog (messageLogId, userId, message, url, dateOfEntry,
subject, status) values ($messageLogId,".$u->userId.",
subject, status) values (".quote($messageLogId).",".quote($u->userId).",
".quote($message).",".quote($url).",".time().",".quote($subject).", ".quote($status).")");
if ($url ne "") {
$message .= "\n".WebGUI::URL::append($url,'mlog='.$messageLogId);
@ -186,17 +187,20 @@ Defaults to 'notice'. Can be 'pending', 'notice', or 'completed'.
sub addInternationalizedEntry {
my ($u, $userId, $url, $groupId, $internationalId, @users, $messageLogId,$sth, $user, %message, %subject, $message, $subject, $namespace, $status);
$messageLogId = getNextId("messageLogId");
$messageLogId = WebGUI::Id::generate();
$userId = $_[0];
$groupId = $_[1];
$url = $_[2];
$internationalId = $_[3];
$namespace = $_[4] || "WebGUI";
$status = $_[5] || 'notice';
%message = WebGUI::SQL->buildHash("select languageId,message from international where internationalId=$internationalId and namespace='$namespace'");
%subject = WebGUI::SQL->buildHash("select languageId,message from international where internationalId=523 and namespace='WebGUI'");
my $languages = WebGUI::International::getLanguages();
foreach my $language (keys $languages) {
$message{$language} = WebGUI::International::get($internationalId,$namespace,$language);
$subject{$language} = WebGUI::International::get(523,"WebGUI",$language);
}
if ($groupId ne "") {
@users = WebGUI::SQL->buildArray("select userId from groupings where groupId=$groupId");
@users = WebGUI::SQL->buildArray("select userId from groupings where groupId=".quote($groupId));
}
@users = ($userId,@users) if ($userId ne "" && !isIn($userId, @users));
foreach $user (@users) {
@ -206,7 +210,7 @@ sub addInternationalizedEntry {
$subject = $subject{$u->profileField("language")};
$message{$u->profileField("language")} = $message{1} if ($message{$u->profileField("language")} eq "");
$message = WebGUI::Macro::process($message{$u->profileField("language")});
WebGUI::SQL->write("insert into messageLog values ($messageLogId,".$u->userId.",
WebGUI::SQL->write("insert into messageLog values (".quote($messageLogId).",".quote($u->userId).",
".quote($message).",".quote($url).",".time().",".quote($message).",".quote($status).")");
if ($url ne "") {
$message .= "\n".WebGUI::URL::append($url,'mlog='.$messageLogId);
@ -233,7 +237,7 @@ The id of the message to complete.
=cut
sub completeEntry {
WebGUI::SQL->write("update messageLog set status='completed', dateOfEntry=".time()." where messageLogId='$_[0]'");
WebGUI::SQL->write("update messageLog set status='completed', dateOfEntry=".time()." where messageLogId=".quote($_[0]));
}

View file

@ -85,7 +85,7 @@ sub www_viewMessageLogMessage {
my $status = _status->{$data->{status}};
if ($data->{url} ne "" && $data->{status} eq 'pending'){
$status = '<a href="'.WebGUI::URL::append($data->{url},'mlog='.$data->{messageLogId}).'">'.$status.'</a>';
$vars->{'message.takeAction'} = '<a href="'.$data->{url}.'">'.WebGUI::International::get(554).'</a>'
$vars->{'message.takeAction'} = '<a href="'.WebGUI::URL::apppend($data->{url},'mlog='.$data->{messageLogId}).'">'.WebGUI::International::get(554).'</a>'
}
$vars->{'message.status'} = $status;