Merge branch 'master' of git@github.com:plainblack/webgui
Conflicts: docs/upgrades/upgrade_7.8.0-7.8.1.pl
This commit is contained in:
commit
f26d9f4570
78 changed files with 521 additions and 226 deletions
|
|
@ -100,14 +100,16 @@ A reference to a WebGUI::Paginator object.
|
|||
=cut
|
||||
|
||||
sub appendPostListTemplateVars {
|
||||
my $self = shift;
|
||||
my $var = shift;
|
||||
my $p = shift;
|
||||
my $page = $p->getPageData;
|
||||
my $i = 0;
|
||||
my ($icon, $datetime) = $self->session->quick(qw(icon datetime));
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my $var = shift;
|
||||
my $p = shift;
|
||||
my $page = $p->getPageData;
|
||||
my $i = 0;
|
||||
my ($icon, $datetime) = $session->quick(qw(icon datetime));
|
||||
my $isVisitor = $session->user->isVisitor;
|
||||
foreach my $row (@$page) {
|
||||
my $post = WebGUI::Asset->new($self->session,$row->{assetId}, $row->{className}, $row->{revisionDate});
|
||||
my $post = WebGUI::Asset->new($session,$row->{assetId}, $row->{className}, $row->{revisionDate});
|
||||
$post->{_parent} = $self; # caching parent for efficiency
|
||||
my $controls = $icon->delete('func=delete',$post->get("url"),"Delete") . $icon->edit('func=edit',$post->get("url"));
|
||||
if ($self->get("sortBy") eq "lineage") {
|
||||
|
|
@ -132,6 +134,7 @@ sub appendPostListTemplateVars {
|
|||
"lastReply.title" => $lastPost->get("title"),
|
||||
"lastReply.user.isVisitor" => $lastPost->get("ownerUserId") eq "1",
|
||||
"lastReply.username" => $lastPost->get("username"),
|
||||
"lastReply.hideProfileUrl" => $lastPost->get("ownerUserId") eq "1" || $isVisitor,
|
||||
"lastReply.userProfile.url" => $lastPost->getPosterProfileUrl(),
|
||||
"lastReply.dateSubmitted.human" => $datetime->epochToHuman($lastPost->get("creationDate"),"%z"),
|
||||
"lastReply.timeSubmitted.human" => $datetime->epochToHuman($lastPost->get("creationDate"),"%Z"),
|
||||
|
|
@ -158,6 +161,7 @@ sub appendPostListTemplateVars {
|
|||
"dateUpdated.human" => $datetime->epochToHuman($post->get("revisionDate"),"%z"),
|
||||
"timeSubmitted.human" => $datetime->epochToHuman($post->get("creationDate"),"%Z"),
|
||||
"timeUpdated.human" => $datetime->epochToHuman($post->get("revisionDate"),"%Z"),
|
||||
"hideProfileUrl" => $post->get('ownerUserId') eq '1' || $isVisitor,
|
||||
"userProfile.url" => $post->getPosterProfileUrl,
|
||||
"user.isVisitor" => $post->get("ownerUserId") eq "1",
|
||||
"edit.url" => $post->getEditUrl,
|
||||
|
|
@ -175,7 +179,7 @@ sub appendPostListTemplateVars {
|
|||
if ($row->{className} =~ m/^WebGUI::Asset::Post::Thread/) {
|
||||
$postVars{'rating'} = $post->get('threadRating');
|
||||
}
|
||||
push(@{$var->{post_loop}}, \%postVars );
|
||||
push(@{$var->{post_loop}}, \%postVars );
|
||||
$i++;
|
||||
}
|
||||
$p->appendTemplateVars($var);
|
||||
|
|
@ -1222,10 +1226,10 @@ sub getViewTemplateVars {
|
|||
my %var;
|
||||
$var{'user.canPost'} = $self->canPost;
|
||||
$var{'user.canStartThread'} = $self->canStartThread;
|
||||
$var{"add.url"} = $self->getNewThreadUrl;
|
||||
$var{"rss.url"} = $self->getRssFeedUrl;
|
||||
$var{'user.isModerator'} = $self->canModerate;
|
||||
$var{'user.isVisitor'} = ($self->session->user->isVisitor);
|
||||
$var{"add.url"} = $self->getNewThreadUrl;
|
||||
$var{"rss.url"} = $self->getRssFeedUrl;
|
||||
$var{'user.isModerator'} = $self->canModerate;
|
||||
$var{'user.isVisitor'} = ($self->session->user->isVisitor);
|
||||
$var{'user.isSubscribed'} = $self->isSubscribed;
|
||||
$var{'sortby.title.url'} = $self->getSortByUrl("title");
|
||||
$var{'sortby.username.url'} = $self->getSortByUrl("username");
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ use WebGUI::Asset::Wobject;
|
|||
use WebGUI::Pluggable;
|
||||
use WebGUI::DateTime;
|
||||
use WebGUI::User;
|
||||
use WebGUI::Utility;
|
||||
use WebGUI::Group;
|
||||
use WebGUI::AssetCollateral::DataForm::Entry;
|
||||
use WebGUI::Form::SelectRichEditor;
|
||||
|
|
@ -225,7 +226,8 @@ an entry is being viewed, bypass caching altogether.
|
|||
|
||||
sub getContentLastModified {
|
||||
my $self = shift;
|
||||
if ($self->currentView eq 'list' || $self->session->form->process('entryId')) {
|
||||
my $hasCaptcha = isIn('Captcha', map { $_->{type} } map { $self->getFieldConfig($_) } @{ $self->getFieldOrder });
|
||||
if ($self->currentView eq 'list' || $self->session->form->process('entryId') || $hasCaptcha) {
|
||||
return time;
|
||||
}
|
||||
return $self->SUPER::getContentLastModified;
|
||||
|
|
@ -1597,7 +1599,7 @@ sub www_editFieldSave {
|
|||
$newSelf->createField($newName, \%field);
|
||||
}
|
||||
|
||||
WebGUI::VersionTag->autoCommitWorkingIfEnabled($self->session);
|
||||
WebGUI::VersionTag->autoCommitWorkingIfEnabled($session);
|
||||
my $freshSelf = $newSelf->cloneFromDb();
|
||||
if ($form->process("proceed") eq "editField") {
|
||||
return $freshSelf->www_editField('new');
|
||||
|
|
|
|||
|
|
@ -414,11 +414,11 @@ sub www_setStatus {
|
|||
$db->write("delete from InOutBoard_status where userId=? and assetId=?", [ $sessionUserId, $self->getId ]);
|
||||
$db->write(
|
||||
"insert into InOutBoard_status (assetId,userId,status,dateStamp,message) values (?,?,?,?,?)",
|
||||
[$self->getId, $sessionUserId, $status, $session->datetime->time(), $message ],
|
||||
[$self->getId, $sessionUserId, $status, time(), $message ],
|
||||
);
|
||||
$db->write(
|
||||
"insert into InOutBoard_statusLog (assetId,userId,createdBy,status,dateStamp,message) values (?,?,?,?,?,?)",
|
||||
[$self->getId, $sessionUserId, $session->user->userId, $status, $session->datetime->time(), $message ],
|
||||
[$self->getId, $sessionUserId, $session->user->userId, $status, time(), $message ],
|
||||
);
|
||||
}
|
||||
else {
|
||||
|
|
@ -452,7 +452,7 @@ sub www_viewReport {
|
|||
-name=>"doit",
|
||||
-value=>"1"
|
||||
);
|
||||
my $startDate = $self->session->datetime->addToDate($self->session->datetime->time(),0,0,-15);
|
||||
my $startDate = $self->session->datetime->addToDate(time(),0,0,-15);
|
||||
$startDate = $self->session->form->date("startDate") if ($self->session->form->process("doit"));
|
||||
$f->date(
|
||||
-name=>"startDate",
|
||||
|
|
|
|||
|
|
@ -380,7 +380,7 @@ sub getKeywordStaticURL {
|
|||
my $url = $self->getUrl;
|
||||
my @parts = split /\//, $url;
|
||||
my $lastPart = pop @parts;
|
||||
if (index $lastPart, '.' == -1) {
|
||||
if (index( $lastPart, '.' ) == -1) {
|
||||
return join '/', $self->getUrl, $self->getKeywordFilename($keyword);
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ use WebGUI::Form::Country;
|
|||
use WebGUI::VersionTag;
|
||||
use Text::CSV_XS;
|
||||
use Params::Validate qw(:all);
|
||||
use WebGUI::Macro;
|
||||
Params::Validate::validation_options( on_fail => sub { WebGUI::Error::InvalidParam->throw( error => shift ) } );
|
||||
|
||||
my $TAP_PARSER_MISSING = <<END_WARN;
|
||||
|
|
@ -1256,6 +1257,8 @@ sub www_loadSurvey {
|
|||
$editHtml = $self->processTemplate( $var, $self->get('answerEditTemplateId') );
|
||||
}
|
||||
|
||||
WebGUI::Macro::process($self->session, \$editHtml);
|
||||
|
||||
# Generate the list of valid goto targets
|
||||
my $gotoTargets = $self->surveyJSON->getGotoTargets;
|
||||
|
||||
|
|
|
|||
|
|
@ -266,7 +266,8 @@ sub getTemplateVariables {
|
|||
$item{author} = WebGUI::HTML::filter(scalar $object->author, 'javascript');
|
||||
$item{guid} = WebGUI::HTML::filter(scalar $object->guid, 'javascript');
|
||||
$item{link} = WebGUI::HTML::filter(scalar $object->link, 'javascript');
|
||||
$item{description} = WebGUI::HTML::filter(scalar($object->description), 'javascript');
|
||||
my $description = WebGUI::HTML::filter(scalar($object->description), 'javascript');
|
||||
$item{description} = defined $description ? $description : '';
|
||||
$item{descriptionFirst100words} = $item{description};
|
||||
$item{descriptionFirst100words} =~ s/(((\S+)\s+){100}).*/$1/s;
|
||||
$item{descriptionFirst75words} = $item{descriptionFirst100words};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue