bunch of fixes
This commit is contained in:
parent
02e687d04c
commit
156f48f465
10 changed files with 45 additions and 23 deletions
|
|
@ -665,12 +665,19 @@ sub processPropertiesFromFormPost {
|
|||
$self->setStatusApproved;
|
||||
}
|
||||
my $storage = $self->getStorageLocation;
|
||||
my $filename = $storage->addFileFromFormPost("file");
|
||||
my $filename;
|
||||
my $attachmentLimit = $self->getThread->getParent->get("attachmentsPerPost");
|
||||
$filename = $storage->addFileFromFormPost("file", $attachmentLimit) if $attachmentLimit;
|
||||
if (defined $filename) {
|
||||
$self->setSize($storage->getFileSize($filename));
|
||||
$storage->setPrivileges($self->get("ownerUserId"), $self->get("groupIdView"), $self->get("groupIdEdit"));
|
||||
foreach my $file (@{$storage->getFiles}) {
|
||||
$storage->generateThumbnail($file);
|
||||
if ($storage->isImage($file)) {
|
||||
$storage->generateThumbnail($file,$session{setting}{maxImageSize});
|
||||
$storage->deleteFile($file);
|
||||
$storage->renameFile('thumb-'.$file,$file);
|
||||
$storage->generateThumbnail($file);
|
||||
}
|
||||
}
|
||||
}
|
||||
$session{form}{proceed} = "redirectToParent";
|
||||
|
|
|
|||
|
|
@ -510,7 +510,8 @@ Subscribes the user to this thread.
|
|||
sub subscribe {
|
||||
my $self = shift;
|
||||
$self->createSubscriptionGroup;
|
||||
WebGUI::Grouping::addUsersToGroups([$session{user}{userId}],[$self->get("subscriptionGroupId")]);
|
||||
WebGUI::Cache->new("cspost_".$self->getId."_".$session{user}{userId}."_".$session{scratch}{discussionLayout}."_".$session{form}{pn})->delete;
|
||||
WebGUI::Grouping::addUsersToGroups([$session{user}{userId}],[$self->get("subscriptionGroupId")]);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -528,7 +529,7 @@ sub trash {
|
|||
if ($self->getParent->get("lastPostId") eq $self->getId) {
|
||||
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");
|
||||
$self->getParent->setLastPost($id,$date);
|
||||
$self->getParent->setLastPost('','') ? $self->getParent->setLastPost($id,$date) : $id;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -569,7 +570,8 @@ Negates the subscribe method.
|
|||
|
||||
sub unsubscribe {
|
||||
my $self = shift;
|
||||
WebGUI::Grouping::deleteUsersFromGroups([$session{user}{userId}],[$self->get("subscriptionGroupId")]);
|
||||
WebGUI::Cache->new("cspost_".$self->getId."_".$session{user}{userId}."_".$session{scratch}{discussionLayout}."_".$session{form}{pn})->delete;
|
||||
WebGUI::Grouping::deleteUsersFromGroups([$session{user}{userId}],[$self->get("subscriptionGroupId")]);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -212,6 +212,7 @@ sub getShortcut {
|
|||
}
|
||||
}
|
||||
$self->{_shortcut}{_properties}{templateId} = $self->get("overrideTemplateId") if ($self->get("overrideTemplate"));
|
||||
$self->{_shortcut}{_properties}{collaborationTemplateId} = $self->get("overrideTemplateId") if ($self->get("overrideTemplate"));
|
||||
$self->{_shortcut}{_properties}{title} = $self->get("title") if ($self->get("overrideTitle"));
|
||||
$self->{_shortcut}{_properties}{description} = $self->get("description") if ($self->get("overrideDescription"));
|
||||
$self->{_shortcut}{_properties}{title} = $self->get("displayTitle") if ($self->get("overrideDisplayTitle"));
|
||||
|
|
|
|||
|
|
@ -830,7 +830,7 @@ sub setLastPost {
|
|||
my $self = shift;
|
||||
my $id = shift;
|
||||
my $date = shift;
|
||||
$self->update(lastPostId=>$id, lastPostDate=>$date);
|
||||
$self->update({lastPostId=>$id, lastPostDate=>$date});
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -843,6 +843,7 @@ Subscribes a user to this collaboration system.
|
|||
|
||||
sub subscribe {
|
||||
my $self = shift;
|
||||
WebGUI::Cache->new("wobject_".$self->getId."_".$session{user}{userId})->delete;
|
||||
WebGUI::Grouping::addUsersToGroups([$session{user}{userId}],[$self->get("subscriptionGroupId")]);
|
||||
}
|
||||
|
||||
|
|
@ -856,6 +857,7 @@ Unsubscribes a user from this collaboration system
|
|||
|
||||
sub unsubscribe {
|
||||
my $self = shift;
|
||||
WebGUI::Cache->new("wobject_".$self->getId."_".$session{user}{userId})->delete;
|
||||
WebGUI::Grouping::deleteUsersFromGroups([$session{user}{userId}],[$self->get("subscriptionGroupId")]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ sub getEditForm {
|
|||
$sth->finish;
|
||||
unless(%indexName) {
|
||||
return "<p><b>" . WebGUI::International::get(2,"Asset_IndexedSearch") .
|
||||
"<p>" . WebGUI::International::get(3,"Asset_IndexedSearch") . "</b></p>";
|
||||
"<p>" . WebGUI::International::get(3,"Asset_IndexedSearch") . "</p></b></p>";
|
||||
}
|
||||
|
||||
# Index to use
|
||||
|
|
@ -381,10 +381,13 @@ sub view {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_edit {
|
||||
my $self = shift;
|
||||
return WebGUI::Privilege::insufficient() unless $self->canEdit;
|
||||
$self->getAdminConsole->setHelp("search add/edit");
|
||||
return $self->getAdminConsole->render($self->getEditForm->print,WebGUI::International::get("26","Asset_IndexedSearch"));
|
||||
my $self = shift;
|
||||
return WebGUI::Privilege::insufficient() unless $self->canEdit;
|
||||
$self->getAdminConsole->setHelp("search add/edit");
|
||||
my $form = $self->getEditForm;
|
||||
my $output = $form;
|
||||
$output = $form->print unless $form =~ /^<p><b/;
|
||||
return $self->getAdminConsole->render($output,WebGUI::International::get("26","Asset_IndexedSearch"));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -687,12 +687,12 @@ sub www_edit {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_editSave {
|
||||
return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit);
|
||||
$_[0]->SUPER::www_editSave();
|
||||
my $output = $_[0]->SUPER::www_editSave();
|
||||
if ($session{form}{proceed} eq "addQuestion") {
|
||||
$session{form}{qid} = "new";
|
||||
return $_[0]->www_editQuestion;
|
||||
}
|
||||
return "";
|
||||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -728,7 +728,7 @@ sub www_editAnswer {
|
|||
$question = WebGUI::SQL->buildHashRef("select Survey_questionId,question
|
||||
from Survey_question where Survey_id=".quote($self->get("Survey_id"))." order by sequenceNumber");
|
||||
$question = { ('-1' => WebGUI::International::get(82,'Asset_Survey'),%$question) };
|
||||
$f->select(
|
||||
$f->selectList(
|
||||
-name=>"gotoQuestion",
|
||||
-options=>$question,
|
||||
-value=>[$answer->{gotoQuestion}],
|
||||
|
|
@ -855,11 +855,11 @@ sub www_editQuestion {
|
|||
while (%data = $sth->hash) {
|
||||
$output .=
|
||||
deleteIcon('func=deleteAnswerConfirm&qid='.$question->{Survey_questionId}.'&aid='.$data{Survey_answerId},
|
||||
$self->getUrl,WebGUI::International::get(45,'Asset_Survey')).
|
||||
editIcon('func=editAnswer&qid='.$question->{Survey_questionId}.'&aid='.$data{Survey_answerId}, $self->getUrl).
|
||||
moveUpIcon('func=moveAnswerUp'.'&qid='.$question->{Survey_questionId}.'&aid='.$data{Survey_answerId}, $self->getUrl).
|
||||
moveDownIcon('func=moveAnswerDown&qid='.$question->{Survey_questionId}.'&aid='.$data{Survey_answerId}, $self->getUrl).
|
||||
' '.$data{answer}.'<br />';
|
||||
$self->get("url"),WebGUI::International::get(45,'Asset_Survey')).
|
||||
editIcon('func=editAnswer&qid='.$question->{Survey_questionId}.'&aid='.$data{Survey_answerId}, $self->get("url")).
|
||||
moveUpIcon('func=moveAnswerUp'.'&qid='.$question->{Survey_questionId}.'&aid='.$data{Survey_answerId}, $self->get("url")).
|
||||
moveDownIcon('func=moveAnswerDown&qid='.$question->{Survey_questionId}.'&aid='.$data{Survey_answerId}, $self->get("url")).
|
||||
' '.$data{answer}.'<br>';
|
||||
}
|
||||
$sth->finish;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue