diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 45662bf82..a4b6cdb0a 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -6,6 +6,7 @@ - fixed #10209: Changing existing user profile field type doesn't change underlying database column type - fixed #10047: SQLReport Debug doesn't catch when bind variables are incorrect - fixed #10260: WebGUI::Asset::Wobject::Gallery.pm default search date misfunction + - fixed #10238: Edit Calendar Event not working when proxy cache disabled 7.7.4 - rfe: Extend DateTime for Week-Nrs (#9151) diff --git a/docs/gotcha.txt b/docs/gotcha.txt index 5cf14ad2f..da246e218 100644 --- a/docs/gotcha.txt +++ b/docs/gotcha.txt @@ -15,6 +15,15 @@ save you many hours of grief. the requirements for the new type. The most common place this problem would be noticed would be if a text field was changed to HTML field. + * The Event url template variable was being used incorrectly. This has + been fixed, but requires new template variables for viewing a list + of events, printing events and editing and deleting events. Please + check the online Help for the new template variables. + + Event templates using HTML::Template are automatically updated. If your + site uses a different parser for this template it will need to be manually + upgraded. + 7.7.4 -------------------------------------------------------------------- * WebGUI now requires XML::FeedPP version 0.40 or greater. diff --git a/docs/upgrades/upgrade_7.7.4-7.7.5.pl b/docs/upgrades/upgrade_7.7.4-7.7.5.pl index fd6ec5fe0..312cc4b2e 100644 --- a/docs/upgrades/upgrade_7.7.4-7.7.5.pl +++ b/docs/upgrades/upgrade_7.7.4-7.7.5.pl @@ -38,6 +38,8 @@ installStoryManagerTables($session); sm_upgradeConfigFiles($session); sm_updateDailyWorkflow($session); +correctEventTemplateVariables($session); + finish($session); # this line required @@ -140,6 +142,31 @@ sub sm_updateDailyWorkflow { print "DONE!\n" unless $quiet; } +sub correctEventTemplateVariables { + my ($session) = @_; + print "\tCorrect Event Template Variables for URL actions... " unless $quiet; + my $root = WebGUI::Asset->getRoot($session); + my $getATemplate = $root->getLineageIterator(['descendants'], { + returnObjects => 1, + includeOnlyClasses => ['WebGUI::Asset::Template'], + joinClass => 'WebGUI::Asset::Template', + whereClause => q!template.namespace = 'Calendar/Event' and template.parser='WebGUI::Asset::Template::HTMLTemplate'!, + }); + + TEMPLATE: while (my $templateAsset = $getATemplate->()) { + print("\t\t Correcting ". $templateAsset->getTitle. "\n") unless $quiet; + my $template = $templateAsset->get('template'); + $template =~ s{\?func=edit}{}isg; + $template =~ s{\?func=delete}{}isg; + $template =~ s{\?print=1}{}isg; + $template =~ s{\?type=list}{}isg; + $templateAsset->update({ + template => $template, + }); + } + print "DONE!\n" unless $quiet; +} + # -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- #---------------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Event.pm b/lib/WebGUI/Asset/Event.pm index 70d33a51c..f657eec02 100644 --- a/lib/WebGUI/Asset/Event.pm +++ b/lib/WebGUI/Asset/Event.pm @@ -1329,11 +1329,15 @@ sub getTemplateVars { # Make some friendly URLs my $urlStartParam = $dtStart->cloneToUserTimeZone->truncate(to => "day"); $var{ "url" } = $self->getUrl; + $var{ "urlEdit" } = $self->getUrl("func=edit"); + $var{ "urlPrint" } = $self->getUrl("print=1"); + $var{ "urlDelete" } = $self->getUrl("func=delete"); $var{ "urlDay" } = $self->getParent->getUrl("type=day;start=".$urlStartParam); $var{ "urlWeek" } = $self->getParent->getUrl("type=week;start=".$urlStartParam); $var{ "urlMonth" } = $self->getParent->getUrl("type=month;start=".$urlStartParam); - $var{ "urlParent" } = $self->getParent->getUrl; - $var{ "urlSearch" } = $self->getParent->getSearchUrl; + $var{ "urlList" } = $self->getParent->getUrl("type=list"); + $var{ "urlParent" } = $self->getParent->getUrl; + $var{ "urlSearch" } = $self->getParent->getSearchUrl; # Related links $var{ relatedLinks } = $self->getRelatedLinks; diff --git a/lib/WebGUI/Help/Asset_Event.pm b/lib/WebGUI/Help/Asset_Event.pm index 5c0c58b93..425b3dbc9 100644 --- a/lib/WebGUI/Help/Asset_Event.pm +++ b/lib/WebGUI/Help/Asset_Event.pm @@ -103,10 +103,14 @@ our $HELP = { { 'name' => 'dateSpan', }, { 'name' => 'url', }, { 'name' => 'urlDay', }, + { 'name' => 'urlList', }, { 'name' => 'urlWeek', }, { 'name' => 'urlMonth', }, { 'name' => 'urlParent', }, { 'name' => 'urlSearch', }, + { 'name' => 'urlEdit', }, + { 'name' => 'urlPrint', }, + { 'name' => 'urlDelete', }, { 'name' => 'image.url' }, { 'name' => 'image.thumbnail' }, { 'name' => 'attachment.url' }, diff --git a/lib/WebGUI/i18n/English/Asset_Event.pm b/lib/WebGUI/i18n/English/Asset_Event.pm index 65cbb60c5..17eb2b042 100644 --- a/lib/WebGUI/i18n/English/Asset_Event.pm +++ b/lib/WebGUI/i18n/English/Asset_Event.pm @@ -362,6 +362,11 @@ our $I18N = { lastUpdated => 1171043883, }, + 'urlList' => { + message => q|A URL to show Events as a list, rather than a calendar.|, + lastUpdated => 1240635548, + }, + 'urlWeek' => { message => q|A URL to show all Events on the same week in this Event's Calendar.|, lastUpdated => 1171043883, @@ -373,8 +378,8 @@ our $I18N = { }, 'urlParent' => { - message => q|A URL the Calendar that contains this Event.|, - lastUpdated => 1172693361, + message => q|A URL to the Calendar that contains this Event.|, + lastUpdated => 1240635921, }, 'urlSearch' => { @@ -382,6 +387,21 @@ our $I18N = { lastUpdated => 1172693363, }, + 'urlEdit' => { + message => q|A URL to edit this Event.|, + lastUpdated => 1240635940, + }, + + 'urlPrint' => { + message => q|A URL to render this Event with its template for printing.|, + lastUpdated => 1240635974, + }, + + 'urlDelete' => { + message => q|A URL to delete this Event.|, + lastUpdated => 1240635972, + }, + 'relatedLinks' => { message => q|This loop contains all links from this Event's set of related links.|, lastUpdated => 1171043883,