diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 910672e32..47e0e1c79 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -6,6 +6,7 @@ - fixed #10361: Shortcuts duplicate extra header tags - fixed #10356: SQL report is cached too long - fixed #10313: extra head elements appear twice + - fixed missing edit story and delete story icons in the Story Manager. 7.7.8 - fixed: Basic Auth doesn't work if password contains colon (Arjan Widlak, diff --git a/docs/upgrades/packages-7.7.9/root_import_storymanager.wgpkg b/docs/upgrades/packages-7.7.9/root_import_storymanager.wgpkg new file mode 100644 index 000000000..a32213b80 Binary files /dev/null and b/docs/upgrades/packages-7.7.9/root_import_storymanager.wgpkg differ diff --git a/lib/WebGUI/Asset/Wobject/StoryArchive.pm b/lib/WebGUI/Asset/Wobject/StoryArchive.pm index 6ee016627..9bf1b14b5 100644 --- a/lib/WebGUI/Asset/Wobject/StoryArchive.pm +++ b/lib/WebGUI/Asset/Wobject/StoryArchive.pm @@ -481,7 +481,8 @@ sub viewTemplateVariables { my $query = $session->form->get('query'); my $exporting = $session->scratch->get('isExporting'); my $p; - my $var = $self->get(); + my $i18n = WebGUI::International->new($session); + my $var = $self->get(); if ($mode eq 'keyword') { $var->{mode} = 'keyword'; my $wordList = WebGUI::Keyword::string2list($keywords); @@ -524,9 +525,15 @@ sub viewTemplateVariables { ##Pagination variables aren't useful in export mode $p->appendTemplateVars($var); } + $var->{date_loop} = []; my $lastStoryDate = ''; - my $datePointer = undef; + my $datePointer = undef; + + my $icon = $session->icon; + my $userUiLevel = $session->user->profileField("uiLevel"); + my $uiLevels = $session->config->get('assetToolbarUiLevel'); + ##Only build objects for the assets that we need STORY: foreach my $storyId (@{ $storyIds }) { my $story = WebGUI::Asset->new($session, $storyId->{assetId}, $storyId->{className}, $storyId->{revisionDate}); @@ -541,11 +548,18 @@ sub viewTemplateVariables { $datePointer->{story_loop} = []; $lastStoryDate = $storyDate; } - push @{$datePointer->{story_loop}}, { + my $storyVars = { url => $story->getUrl, title => $story->getTitle, creationDate => $creationDate, + }; + if ($userUiLevel >= $uiLevels->{delete}) { + $storyVars->{deleteIcon} = $icon->delete('func=delete', $story->get('url'), $i18n->get(43)); } + if ($userUiLevel >= $uiLevels->{edit}) { + $storyVars->{editIcon} = $icon->edit('func=edit', $story->get('url')); + } + push @{$datePointer->{story_loop}}, $storyVars; } $var->{canPostStories} = $self->canPostStories; diff --git a/lib/WebGUI/Help/Asset_StoryArchive.pm b/lib/WebGUI/Help/Asset_StoryArchive.pm index ed3aa84e4..20eb49f4f 100644 --- a/lib/WebGUI/Help/Asset_StoryArchive.pm +++ b/lib/WebGUI/Help/Asset_StoryArchive.pm @@ -30,6 +30,8 @@ our $HELP = { { 'name' => 'url' }, { 'name' => 'title' }, { 'name' => 'creationDate' }, + { 'name' => 'deleteIcon' }, + { 'name' => 'editIcon' }, ], }, ] diff --git a/lib/WebGUI/i18n/English/Asset_StoryArchive.pm b/lib/WebGUI/i18n/English/Asset_StoryArchive.pm index 21531acfc..3a1fe006c 100644 --- a/lib/WebGUI/i18n/English/Asset_StoryArchive.pm +++ b/lib/WebGUI/i18n/English/Asset_StoryArchive.pm @@ -213,6 +213,18 @@ our $I18N = { lastUpdated => 0, }, + 'deleteIcon' => { + message => q|An icon to delete this story.|, + context => q|Template variable.|, + lastUpdated => 0, + }, + + 'editIcon' => { + message => q|An icon to edit this story.|, + context => q|Template variable.|, + lastUpdated => 0, + }, + 'add a story' => { message => q|Add a Story.|, context => q|label for the URL to add a story to the archive.|,