Thread sticky and locked handling. Form vars are now exposed
in all post forms. Editing a thread does not clear the isSticky and isLocked flags.
This commit is contained in:
parent
0fa1ec4901
commit
991ac55a01
8 changed files with 31 additions and 23 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
7.6.12
|
7.6.12
|
||||||
- fixed: During postback on a recurring transaction, the routine could error out instead of catching an error.
|
- fixed: During postback on a recurring transaction, the routine could error out instead of catching an error.
|
||||||
- fixed: Do not show the Edit entry in the More menu in the asset manager if the asset is locked.
|
- fixed: Do not show the Edit entry in the More menu in the asset manager if the asset is locked.
|
||||||
|
- fixed #9677: no output from form helper template variable sticky.form and stick.label
|
||||||
|
|
||||||
7.6.11
|
7.6.11
|
||||||
- fixed: Asset Manager can generate URLs that are too long
|
- fixed: Asset Manager can generate URLs that are too long
|
||||||
|
|
|
||||||
BIN
docs/upgrades/packages-7.6.12/default_post_form.wgpkg
Normal file
BIN
docs/upgrades/packages-7.6.12/default_post_form.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.6.12/default_submission_form.wgpkg
Normal file
BIN
docs/upgrades/packages-7.6.12/default_submission_form.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.6.12/faq_submission_form.wgpkg
Normal file
BIN
docs/upgrades/packages-7.6.12/faq_submission_form.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.6.12/job_submission_form.wgpkg
Normal file
BIN
docs/upgrades/packages-7.6.12/job_submission_form.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.6.12/link_list_submission_form.wgpkg
Normal file
BIN
docs/upgrades/packages-7.6.12/link_list_submission_form.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.6.12/request-tracker-template2.wgpkg
Normal file
BIN
docs/upgrades/packages-7.6.12/request-tracker-template2.wgpkg
Normal file
Binary file not shown.
|
|
@ -929,30 +929,32 @@ sub paste {
|
||||||
sub processPropertiesFromFormPost {
|
sub processPropertiesFromFormPost {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
$self->SUPER::processPropertiesFromFormPost;
|
$self->SUPER::processPropertiesFromFormPost;
|
||||||
my $i18n = WebGUI::International->new($self->session);
|
my $session = $self->session;
|
||||||
if ($self->session->form->process("assetId") eq "new") {
|
my $form = $session->form;
|
||||||
|
my $i18n = WebGUI::International->new($session);
|
||||||
|
if ($form->process("assetId") eq "new") {
|
||||||
my %data = (
|
my %data = (
|
||||||
ownerUserId => $self->session->user->userId,
|
ownerUserId => $session->user->userId,
|
||||||
username => $self->session->form->process("visitorName") || $self->session->user->profileField("alias") || $self->session->user->username,
|
username => $form->process("visitorName") || $session->user->profileField("alias") || $session->user->username,
|
||||||
);
|
);
|
||||||
$self->update(\%data);
|
$self->update(\%data);
|
||||||
if ($self->getThread->getParent->canEdit) {
|
|
||||||
$self->getThread->lock if ($self->session->form->process('lock'));
|
|
||||||
$self->getThread->stick if ($self->session->form->process("stick"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
# force the value to be empty so it gets updated properly by content
|
# force the value to be empty so it gets updated properly by content
|
||||||
$self->update({synopsis => ($self->session->form->process("synopsis") || "")});
|
$self->update({synopsis => ($form->process("synopsis") || "")});
|
||||||
if ($self->session->form->process("archive") && $self->getThread->getParent->canModerate) {
|
if ($form->process("archive") && $self->getThread->getParent->canModerate) {
|
||||||
$self->getThread->archive;
|
$self->getThread->archive;
|
||||||
} elsif ($self->getThread->get("status") eq "archived") {
|
} elsif ($self->getThread->get("status") eq "archived") {
|
||||||
$self->getThread->unarchive;
|
$self->getThread->unarchive;
|
||||||
}
|
}
|
||||||
if ($self->session->form->process("subscribe")) {
|
if ($form->process("subscribe")) {
|
||||||
$self->getThread->subscribe;
|
$self->getThread->subscribe;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$self->getThread->unsubscribe;
|
$self->getThread->unsubscribe;
|
||||||
|
}
|
||||||
|
if ($self->getThread->getParent->canEdit) {
|
||||||
|
$form->process('isLocked') ? $self->getThread->lock : $self->getThread->unlock;
|
||||||
|
$form->process('isSticky') ? $self->getThread->stick : $self->getThread->unstick;
|
||||||
}
|
}
|
||||||
delete $self->{_storageLocation};
|
delete $self->{_storageLocation};
|
||||||
$self->postProcess;
|
$self->postProcess;
|
||||||
|
|
@ -1229,14 +1231,16 @@ sub www_edit {
|
||||||
|
|
||||||
my (%var, $content, $title, $synopsis);
|
my (%var, $content, $title, $synopsis);
|
||||||
my $i18n = WebGUI::International->new($session);
|
my $i18n = WebGUI::International->new($session);
|
||||||
|
|
||||||
|
|
||||||
|
my $className = $form->process("class","className") || $self->get('className');
|
||||||
if ($func eq "add" || ($func eq "editSave" && $form->process("assetId") eq "new")) { # new post
|
if ($func eq "add" || ($func eq "editSave" && $form->process("assetId") eq "new")) { # new post
|
||||||
#Add Form Header for all new posts
|
|
||||||
my $className = $form->process("class","className");
|
|
||||||
#Post to the parent if this is a new request
|
#Post to the parent if this is a new request
|
||||||
my $action = $self->getParent->getUrl;
|
my $action = $self->getParent->getUrl;
|
||||||
#Post to self if there was an error Posting to a Thread (not a Collaboration)
|
#Post to self if there was an error Posting to a Thread (not a Collaboration)
|
||||||
$action = $self->getUrl if($func eq "editSave" && $className ne "WebGUI::Asset::Post::Thread");
|
$action = $self->getUrl if($func eq "editSave" && $className ne "WebGUI::Asset::Post::Thread");
|
||||||
|
|
||||||
|
#Add Form Header for all new posts
|
||||||
$var{'form.header'} = WebGUI::Form::formHeader($session,{
|
$var{'form.header'} = WebGUI::Form::formHeader($session,{
|
||||||
action=>$action
|
action=>$action
|
||||||
});
|
});
|
||||||
|
|
@ -1304,16 +1308,6 @@ sub www_edit {
|
||||||
return $privilege->insufficient() unless ($self->getThread->getParent->canPost);
|
return $privilege->insufficient() unless ($self->getThread->getParent->canPost);
|
||||||
$var{'isThread' } = 1;
|
$var{'isThread' } = 1;
|
||||||
$var{'isNewThread' } = 1;
|
$var{'isNewThread' } = 1;
|
||||||
if ($self->getThread->getParent->canEdit) {
|
|
||||||
$var{'sticky.form'} = WebGUI::Form::yesNo($session, {
|
|
||||||
name=>'stick',
|
|
||||||
value=>$form->process("stick")
|
|
||||||
});
|
|
||||||
$var{'lock.form' } = WebGUI::Form::yesNo($session, {
|
|
||||||
name=>'lock',
|
|
||||||
value=>$form->process('lock')
|
|
||||||
});
|
|
||||||
}
|
|
||||||
my $subscribe = $form->process("subscribe");
|
my $subscribe = $form->process("subscribe");
|
||||||
$var{'subscribe.form'} = WebGUI::Form::yesNo($session, {
|
$var{'subscribe.form'} = WebGUI::Form::yesNo($session, {
|
||||||
name=>"subscribe",
|
name=>"subscribe",
|
||||||
|
|
@ -1429,6 +1423,19 @@ sub www_edit {
|
||||||
value=>$content,
|
value=>$content,
|
||||||
richEditId=>$self->getThread->getParent->get("richEditor")
|
richEditId=>$self->getThread->getParent->get("richEditor")
|
||||||
});
|
});
|
||||||
|
##Edit variables just for Threads
|
||||||
|
$session->log->warn("className: $className");
|
||||||
|
$session->log->warn("canEdit parent: ". $self->getThread->getParent->canEdit);
|
||||||
|
if ($className eq 'WebGUI::Asset::Post::Thread' && $self->getThread->getParent->canEdit) {
|
||||||
|
$var{'sticky.form'} = WebGUI::Form::yesNo($session, {
|
||||||
|
name=>'isSticky',
|
||||||
|
value=>$form->process('isSticky') || $self->get('isSticky'),
|
||||||
|
});
|
||||||
|
$var{'lock.form' } = WebGUI::Form::yesNo($session, {
|
||||||
|
name=>'isLocked',
|
||||||
|
value=>$form->process('isLocked') || $self->get('isLocked'),
|
||||||
|
});
|
||||||
|
}
|
||||||
$var{'form.submit'} = WebGUI::Form::submit($session, {
|
$var{'form.submit'} = WebGUI::Form::submit($session, {
|
||||||
extras=>"onclick=\"this.value='".$i18n->get(452)."'; this.form.func.value='editSave';return true;\""
|
extras=>"onclick=\"this.value='".$i18n->get(452)."'; this.form.func.value='editSave';return true;\""
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue