fix - makePrintable operation with other styleId

This commit is contained in:
Roy Johnson 2006-09-07 18:17:32 +00:00
parent a4c114e13b
commit aac1df8dfb
3 changed files with 21 additions and 5 deletions

View file

@ -46,6 +46,7 @@
and fixed a bug in sbin/fileUpload.pl wher it didn't handle images with
uppercased extensions properly (Martin Kamerbeek / Procolix)
- new: In the Project Management asset, tasks can now have multiple resources, which may be users or groups. Original single-resource data is migrated to the new schema by the 7.0.7 upgrade script.
- fix: makePrintable operation with other styleId
7.0.6
- fix: Error in DateTime.pm

View file

@ -12,7 +12,6 @@ package WebGUI::Operation::Style;
use strict;
use WebGUI::Paginator;
=head1 NAME
Package WebGUI::Operation::Style
@ -34,9 +33,8 @@ the printableStyleId is used instead of the normal styleId for the page.
sub www_makePrintable {
my $session = shift;
if ($session->form->process("styleId") ne "") {
$session->asset->{_properties}{printableStyleTemplateId} = $session->form->process("styleId");
}
my $styleId = $session->form->process("styleId");
$session->style->setPrintableStyleId($styleId) if $styleId;
$session->style->makePrintable("1");
return "";
}

View file

@ -153,7 +153,7 @@ sub process {
$var{'body.content'} = shift;
my $templateId = shift;
if ($self->{_makePrintable} && $self->session->asset) {
$templateId = $self->session->asset->get("printableStyleTemplateId");
$templateId = $self->{_printableStyleId} || $self->session->asset->get("printableStyleTemplateId");
my $currAsset = $self->session->asset;
until ($templateId) {
# some assets don't have this property. But at least one ancestor should....
@ -270,7 +270,24 @@ sub setLink {
$self->session->output->print($tag) if ($self->sent);
}
#-------------------------------------------------------------------
=head2 setPrintableStyleId ( params )
Overrides current printable style id defined in assets definition
=head3 params
scalar containing id of style to use
=cut
sub setPrintableStyleId {
my $self = shift;
my $styleId = shift;
$self->{_printableStyleId} = $styleId;
}
#-------------------------------------------------------------------