fix [ 1267326 ] LastPost varibale not updating correctly in Msg Board
This commit is contained in:
parent
3d1a735050
commit
3360e4c979
4 changed files with 141 additions and 51 deletions
|
|
@ -18,6 +18,7 @@
|
||||||
- fix [ 1265771 ] assets that were formerly packages are still on packageList
|
- fix [ 1265771 ] assets that were formerly packages are still on packageList
|
||||||
- fix [ 1177447 ] deployPackage does not retain content pos. (mwilson)
|
- fix [ 1177447 ] deployPackage does not retain content pos. (mwilson)
|
||||||
- fix [ 1256718 ] Assets disappear after changing page layout (mwilson)
|
- fix [ 1256718 ] Assets disappear after changing page layout (mwilson)
|
||||||
|
- fix [ 1267326 ] LastPost varibale not updating correctly in Msg Board
|
||||||
- fix [ 1262002 ] no "next Thread" or "previous Thread" links (mwilson)
|
- fix [ 1262002 ] no "next Thread" or "previous Thread" links (mwilson)
|
||||||
- fix [ 1252626 ] navigation relative to current url broken (mwilson)
|
- fix [ 1252626 ] navigation relative to current url broken (mwilson)
|
||||||
- fix [ 1261994 ] getLineageLength (mwilson)
|
- fix [ 1261994 ] getLineageLength (mwilson)
|
||||||
|
|
|
||||||
|
|
@ -1,55 +1,143 @@
|
||||||
my $toVersion = "6.7.2";
|
|
||||||
|
|
||||||
$|=1; #disable output buffering
|
|
||||||
|
|
||||||
use lib "../../lib";
|
use lib "../../lib";
|
||||||
use Getopt::Long;
|
|
||||||
use strict;
|
use strict;
|
||||||
|
use Getopt::Long;
|
||||||
use WebGUI::Session;
|
use WebGUI::Session;
|
||||||
use WebGUI::SQL;
|
use WebGUI::SQL;
|
||||||
use WebGUI::Asset;
|
use WebGUI::Asset;
|
||||||
|
|
||||||
|
my $toVersion = "6.7.2";
|
||||||
my $configFile;
|
my $configFile;
|
||||||
my $quiet;
|
my $quiet;
|
||||||
|
|
||||||
GetOptions(
|
start();
|
||||||
'configFile=s'=>\$configFile,
|
|
||||||
'quiet'=>\$quiet
|
|
||||||
);
|
|
||||||
|
|
||||||
WebGUI::Session::open("../..",$configFile);
|
fixTimeFields();
|
||||||
WebGUI::Session::refreshUserInfo(3);
|
|
||||||
|
|
||||||
WebGUI::SQL->write("insert into webguiVersion values (".quote($toVersion).",'upgrade',".time().")");
|
|
||||||
WebGUI::SQL->write("update DataForm_field set type=".quote('TimeField')." where type=".quote('time'));
|
|
||||||
WebGUI::SQL->write("update userProfileField set dataType=".quote('TimeField')." where dataType=".quote('time'));
|
|
||||||
fixSpelling();
|
fixSpelling();
|
||||||
fixCSTemplate();
|
fixCSTemplate();
|
||||||
|
speedUpAdminConsole();
|
||||||
|
|
||||||
WebGUI::Session::close();
|
finish();
|
||||||
|
|
||||||
|
|
||||||
|
#-------------------------------------------------
|
||||||
|
sub speedUpAdminConsole {
|
||||||
|
print "\tMaking admin console load faster.\n" unless ($quiet);
|
||||||
|
my $template = <<END;
|
||||||
|
^StyleSheet(^Extras;/adminConsole/adminConsole.css);
|
||||||
|
^JavaScript(^Extras;/adminConsole/adminConsole.js);
|
||||||
|
|
||||||
|
<div id="application_title">
|
||||||
|
<tmpl_var application.title>
|
||||||
|
</div>
|
||||||
|
<div id="console_title">
|
||||||
|
<tmpl_var console.title>
|
||||||
|
</div>
|
||||||
|
<div id="application_workarea">
|
||||||
|
<tmpl_var application.workArea>
|
||||||
|
</div>
|
||||||
|
<div id="console_workarea">
|
||||||
|
<div class="adminConsoleSpacer">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<tmpl_loop application_loop>
|
||||||
|
<tmpl_if canUse>
|
||||||
|
<div class="adminConsoleApplication">
|
||||||
|
<a href="<tmpl_var url>"><img src="<tmpl_var icon>" border="0" title="<tmpl_var title>" alt="<tmpl_var title>" /></a><br />
|
||||||
|
<a href="<tmpl_var url>"><tmpl_var title></a>
|
||||||
|
</div>
|
||||||
|
</tmpl_if>
|
||||||
|
</tmpl_loop>
|
||||||
|
<div class="adminConsoleSpacer">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="adminConsoleMenu">
|
||||||
|
<div id="adminConsoleMainMenu" class="adminConsoleMainMenu">
|
||||||
|
<div id="console_toggle_on">
|
||||||
|
<a href="#" onClick="toggleAdminConsole()"><tmpl_var toggle.on.label></a><br />
|
||||||
|
</div>
|
||||||
|
<div id="console_toggle_off">
|
||||||
|
<a href="#" onClick="toggleAdminConsole()"><tmpl_var toggle.off.label></a><br />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="adminConsoleApplicationSubmenu" class="adminConsoleApplicationSubmenu">
|
||||||
|
<tmpl_loop submenu_loop>
|
||||||
|
<a href="<tmpl_var url>" <tmpl_var extras>><tmpl_var label></a><br />
|
||||||
|
</tmpl_loop>
|
||||||
|
</div>
|
||||||
|
<div id="adminConsoleUtilityMenu" class="adminConsoleUtilityMenu">
|
||||||
|
<a href="<tmpl_var backtosite.url>"><tmpl_var backtosite.label></a><br />
|
||||||
|
^AdminToggle;<br />
|
||||||
|
^LoginToggle;<br />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="application_help">
|
||||||
|
<tmpl_if help.url>
|
||||||
|
<a href="<tmpl_var help.url>" target="_blank"><img src="^Extras;/adminConsole/small/help.gif" alt="?" border="0" /></a>
|
||||||
|
</tmpl_if>
|
||||||
|
</div>
|
||||||
|
<div id="application_icon">
|
||||||
|
<img src="<tmpl_var application.icon>" border="0" title="<tmpl_var application.title>" alt="<tmpl_var application.title>" />
|
||||||
|
</div>
|
||||||
|
<div class="adminConsoleTitleIconMedalian">
|
||||||
|
<img src="^Extras;/adminConsole/medalian.gif" border="0" alt="*" />
|
||||||
|
</div>
|
||||||
|
<div id="console_icon">
|
||||||
|
<img src="<tmpl_var console.icon>" border="0" title="<tmpl_var console.title>" alt="<tmpl_var console.title>" />
|
||||||
|
</div>
|
||||||
|
<script lang="JavaScript">
|
||||||
|
initAdminConsole(<tmpl_if application.title>true<tmpl_else>false</tmpl_if>,<tmpl_if submenu_loop>true<tmpl_else>false</tmpl_if>);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
END
|
||||||
|
my $asset = WebGUI::Asset->new("PBtmpl0000000000000001","WebGUI::Asset::Template");
|
||||||
|
$asset->addRevision({template=>$template})->commit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#-------------------------------------------------
|
||||||
|
sub fixTimeFields {
|
||||||
|
print "\tFixing time fields.\n" unless ($quiet);
|
||||||
|
WebGUI::SQL->write("update DataForm_field set type=".quote('TimeField')." where type=".quote('time'));
|
||||||
|
WebGUI::SQL->write("update userProfileField set dataType=".quote('TimeField')." where dataType=".quote('time'));
|
||||||
|
}
|
||||||
|
|
||||||
#-------------------------------------------------
|
#-------------------------------------------------
|
||||||
sub fixCSTemplate {
|
sub fixCSTemplate {
|
||||||
print "\tFixing CS Search template.\n" unless ($quiet);
|
print "\tFixing CS Search template.\n" unless ($quiet);
|
||||||
my $asset = WebGUI::Asset->newByDynamicClass("PBtmpl0000000000000031");
|
my $asset = WebGUI::Asset->new("PBtmpl0000000000000031","WebGUI::Asset::Template");
|
||||||
my $template = $asset->get("template");
|
my $template = $asset->get("template");
|
||||||
$template =~ s/<tmpl_var date>/<tmpl_var dateSubmitted.human>/ixsg;
|
$template =~ s/<tmpl_var date>/<tmpl_var dateSubmitted.human>/ixsg;
|
||||||
$template =~ s/<tmpl_var time>/<tmpl_var timeSubmitted.human>/ixsg;
|
$template =~ s/<tmpl_var time>/<tmpl_var timeSubmitted.human>/ixsg;
|
||||||
$asset->update({template=>$template});
|
$asset->addRevision({template=>$template})->commit;
|
||||||
$asset->commit;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------
|
#-------------------------------------------------
|
||||||
sub fixSpelling {
|
sub fixSpelling {
|
||||||
print "\tFixing a few spelling problems.\n" unless ($quiet);
|
print "\tFixing a few spelling problems.\n" unless ($quiet);
|
||||||
my $asset = WebGUI::Asset->newByDynamicClass("PBtmplCP00000000000001");
|
my $asset = WebGUI::Asset->new("PBtmplCP00000000000001","WebGUI::Asset::Template");
|
||||||
$asset->update({url=>"default_product_template"});
|
$asset->addRevision({url=>"default_product_template"})->commit;
|
||||||
$asset->commit;
|
$asset = WebGUI::Asset->new("PBtmpl0000000000000134","WebGUI::Asset::Template");
|
||||||
$asset = WebGUI::Asset->newByDynamicClass("PBtmpl0000000000000134");
|
|
||||||
my $template = $asset->get("template");
|
my $template = $asset->get("template");
|
||||||
$template =~ s/spesify/specify/ixsg;
|
$template =~ s/spesify/specify/ixsg;
|
||||||
$asset->update({template=>$template});
|
$asset->addRevision({template=>$template})->commit;
|
||||||
$asset->commit;
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------
|
||||||
|
sub start {
|
||||||
|
$|=1; #disable output buffering
|
||||||
|
GetOptions(
|
||||||
|
'configFile=s'=>\$configFile,
|
||||||
|
'quiet'=>\$quiet
|
||||||
|
);
|
||||||
|
WebGUI::Session::open("../..",$configFile);
|
||||||
|
WebGUI::Session::refreshUserInfo(3);
|
||||||
|
WebGUI::SQL->write("insert into webguiVersion values (".quote($toVersion).",'upgrade',".time().")");
|
||||||
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------
|
||||||
|
sub finish {
|
||||||
|
WebGUI::Session::close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -726,30 +726,6 @@ sub rate {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
|
||||||
|
|
||||||
=head2 setLastPost ( id, date )
|
|
||||||
|
|
||||||
Sets the last reply of this thread.
|
|
||||||
|
|
||||||
=head3 id
|
|
||||||
|
|
||||||
The assetId of the most recent post.
|
|
||||||
|
|
||||||
=head3 date
|
|
||||||
|
|
||||||
The date of the most recent post.
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
sub setLastPost {
|
|
||||||
my $self = shift;
|
|
||||||
my $id = shift;
|
|
||||||
my $date = shift;
|
|
||||||
$self->update(lastPostId=>$id, lastPostDate=>$date);
|
|
||||||
$self->getParent->setLastPost($id,$date);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
@ -853,7 +829,7 @@ sub trash {
|
||||||
$self->getThread->decrementReplies if ($self->isReply);
|
$self->getThread->decrementReplies if ($self->isReply);
|
||||||
if ($self->getThread->get("lastPostId") eq $self->getId) {
|
if ($self->getThread->get("lastPostId") eq $self->getId) {
|
||||||
my $threadLineage = $self->getThread->get("lineage");
|
my $threadLineage = $self->getThread->get("lineage");
|
||||||
my ($id, $date) = WebGUI::SQL->quickArray("select Post.assetId, Post.dateSubmitted from Post, asset where asset.lineage like ".quote($threadLineage.'%')." and Post.assetId<>".quote($self->getId)." and asset.assetId=Post.assetId order by Post.dateSubmitted desc");
|
my ($id, $date) = WebGUI::SQL->quickArray("select Post.assetId, Post.dateSubmitted from Post, asset where asset.lineage like ".quote($threadLineage.'%')." and Post.assetId<>".quote($self->getId)." and asset.assetId=Post.assetId and asset.state='published' order by Post.dateSubmitted desc");
|
||||||
$self->getThread->setLastPost($id,$date);
|
$self->getThread->setLastPost($id,$date);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -465,6 +465,31 @@ sub rate {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 setLastPost ( id, date )
|
||||||
|
|
||||||
|
Sets the last reply of this thread.
|
||||||
|
|
||||||
|
=head3 id
|
||||||
|
|
||||||
|
The assetId of the most recent post.
|
||||||
|
|
||||||
|
=head3 date
|
||||||
|
|
||||||
|
The date of the most recent post.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub setLastPost {
|
||||||
|
my $self = shift;
|
||||||
|
my $id = shift;
|
||||||
|
my $date = shift;
|
||||||
|
$self->update({lastPostId=>$id, lastPostDate=>$date});
|
||||||
|
$self->getParent->setLastPost($id,$date);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head setParent ( newParent )
|
=head setParent ( newParent )
|
||||||
|
|
@ -542,7 +567,7 @@ sub trash {
|
||||||
$self->getParent->decrementThreads;
|
$self->getParent->decrementThreads;
|
||||||
if ($self->getParent->get("lastPostId") eq $self->getId) {
|
if ($self->getParent->get("lastPostId") eq $self->getId) {
|
||||||
my $parentLineage = $self->getThread->get("lineage");
|
my $parentLineage = $self->getThread->get("lineage");
|
||||||
my ($id, $date) = WebGUI::SQL->quickArray("select Post.assetId, Post.dateSubmitted from Post, asset where asset.lineage like ".quote($parentLineage.'%')." and Post.assetId<>".quote($self->getId)." and Post.assetId=asset.assetId order by Post.dateSubmitted desc");
|
my ($id, $date) = WebGUI::SQL->quickArray("select Post.assetId, Post.dateSubmitted from Post, asset where asset.lineage like ".quote($parentLineage.'%')." and Post.assetId<>".quote($self->getId)." and Post.assetId=asset.assetId and asset.state='published' order by Post.dateSubmitted desc");
|
||||||
$self->getParent->setLastPost('','') ? $self->getParent->setLastPost($id,$date) : $id;
|
$self->getParent->setLastPost('','') ? $self->getParent->setLastPost($id,$date) : $id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue