fix - makePrintable operation with other styleId
This commit is contained in:
parent
a4c114e13b
commit
aac1df8dfb
3 changed files with 21 additions and 5 deletions
|
|
@ -46,6 +46,7 @@
|
||||||
and fixed a bug in sbin/fileUpload.pl wher it didn't handle images with
|
and fixed a bug in sbin/fileUpload.pl wher it didn't handle images with
|
||||||
uppercased extensions properly (Martin Kamerbeek / Procolix)
|
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.
|
- 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
|
7.0.6
|
||||||
- fix: Error in DateTime.pm
|
- fix: Error in DateTime.pm
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ package WebGUI::Operation::Style;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use WebGUI::Paginator;
|
use WebGUI::Paginator;
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
Package WebGUI::Operation::Style
|
Package WebGUI::Operation::Style
|
||||||
|
|
@ -34,9 +33,8 @@ the printableStyleId is used instead of the normal styleId for the page.
|
||||||
|
|
||||||
sub www_makePrintable {
|
sub www_makePrintable {
|
||||||
my $session = shift;
|
my $session = shift;
|
||||||
if ($session->form->process("styleId") ne "") {
|
my $styleId = $session->form->process("styleId");
|
||||||
$session->asset->{_properties}{printableStyleTemplateId} = $session->form->process("styleId");
|
$session->style->setPrintableStyleId($styleId) if $styleId;
|
||||||
}
|
|
||||||
$session->style->makePrintable("1");
|
$session->style->makePrintable("1");
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,7 @@ sub process {
|
||||||
$var{'body.content'} = shift;
|
$var{'body.content'} = shift;
|
||||||
my $templateId = shift;
|
my $templateId = shift;
|
||||||
if ($self->{_makePrintable} && $self->session->asset) {
|
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;
|
my $currAsset = $self->session->asset;
|
||||||
until ($templateId) {
|
until ($templateId) {
|
||||||
# some assets don't have this property. But at least one ancestor should....
|
# 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);
|
$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;
|
||||||
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue