Calendar and Event print templates plus other template fixes.
This commit is contained in:
parent
035a83d61e
commit
66f74183af
11 changed files with 1428 additions and 3 deletions
|
|
@ -24,7 +24,7 @@ use WebGUI::Form;
|
|||
|
||||
use base 'WebGUI::Asset';
|
||||
|
||||
use DateTime;
|
||||
use WebGUI::DateTime;
|
||||
|
||||
|
||||
|
||||
|
|
@ -1306,6 +1306,8 @@ sub isAllDay
|
|||
Prepares the view template to be used later. The template to be used is found
|
||||
from this asset's parent (Usually a Calendar).
|
||||
|
||||
If the "print" form parameter is set, will prepare the print template.
|
||||
|
||||
=cut
|
||||
|
||||
sub prepareView
|
||||
|
|
@ -1316,7 +1318,15 @@ sub prepareView
|
|||
|
||||
if ($parent)
|
||||
{
|
||||
$templateId = $parent->get("templateIdEvent")
|
||||
if ($self->session->form->param("print"))
|
||||
{
|
||||
$templateId = $parent->get("templateIdPrintEvent");
|
||||
$self->session->style->makePrintable(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$templateId = $parent->get("templateIdEvent");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -2048,6 +2058,16 @@ ENDJS
|
|||
|
||||
Shows the event based on the parent asset's style and Event Details template
|
||||
|
||||
=head3 URL Parameters
|
||||
|
||||
=over 8
|
||||
|
||||
=item print
|
||||
|
||||
If true, will show the printable version of the event
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
sub www_view {
|
||||
|
|
|
|||
|
|
@ -725,6 +725,8 @@ sub getLastEvent
|
|||
|
||||
Loads the template to be used by the view() method.
|
||||
|
||||
Determines which template to load based on the "type" and "print" URL
|
||||
parameters.
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -737,6 +739,14 @@ sub prepareView
|
|||
|| ucfirst $self->get("defaultView")
|
||||
|| "Month";
|
||||
|
||||
if ($self->session->form->param("print"))
|
||||
{
|
||||
$view = "Print".$view;
|
||||
$self->session->style->makePrintable(1);
|
||||
}
|
||||
|
||||
#$self->session->errorHandler->warn("Prepare view ".$view." with template ".$self->get("templateId".$view));
|
||||
|
||||
my $template = WebGUI::Asset::Template->new($self->session, $self->get("templateId".$view));
|
||||
$template->prepare;
|
||||
|
||||
|
|
@ -747,6 +757,7 @@ sub prepareView
|
|||
|
||||
|
||||
|
||||
|
||||
####################################################################
|
||||
|
||||
=head2 processPropertiesFromFormPost ( )
|
||||
|
|
@ -903,6 +914,7 @@ sub view
|
|||
$var->{"urlMonth"} = $self->getUrl("type=month;start=".$params->{start});
|
||||
$var->{"urlAdd"} = $self->getUrl("func=add;class=WebGUI::Asset::Event");
|
||||
$var->{"urlSearch"} = $self->getUrl("func=search");
|
||||
$var->{"urlPrint"} = $self->getUrl("type=".$params->{type}.";start=".$params->{start}.";print=1");
|
||||
|
||||
# Parameters
|
||||
$var->{"paramStart"} = $params->{start};
|
||||
|
|
@ -1683,6 +1695,36 @@ sub www_search
|
|||
|
||||
|
||||
|
||||
####################################################################
|
||||
|
||||
=head2 www_view ( )
|
||||
|
||||
Shows the normal view
|
||||
|
||||
=head3 URL Parameters
|
||||
|
||||
=over 8
|
||||
|
||||
=item type
|
||||
|
||||
What view of the calendar to show. One of "month, "week", or "day".
|
||||
|
||||
=item start
|
||||
|
||||
What time to start the calendar. Must be a full MySQL Date/Time string in the
|
||||
format 2006-12-17 14:00:00.
|
||||
|
||||
The calendar will truncate the start to show the entire month, week, or day,
|
||||
depending on the type.
|
||||
|
||||
=item print
|
||||
|
||||
If set to some true value (like "1"), will show the printable version of the
|
||||
page.
|
||||
|
||||
=back
|
||||
|
||||
|
||||
|
||||
|
||||
=head1 Templates
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue