From bea0ae472a4bb57a496b26614db56ed95efa651a Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Mon, 18 Dec 2006 22:57:38 +0000 Subject: [PATCH] Two bug fixes, for Wiki History and initial drop down setting in the Group Search dialog. Documented the Wiki Page history template and i18n'ed the delete confirmation in the history interface. --- docs/changelog/7.x.x.txt | 2 ++ lib/WebGUI/Asset/WikiPage.pm | 15 +++++---- lib/WebGUI/Help/Asset_WikiPage.pm | 26 +++++++++++++++ lib/WebGUI/Operation/Group.pm | 2 +- lib/WebGUI/i18n/English/Asset_WikiPage.pm | 40 +++++++++++++++++++++++ 5 files changed, 77 insertions(+), 8 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index a96aca173..ebf6d15d3 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -9,6 +9,8 @@ method instead of finding the path manually. - fix: Avatar in Thread & Posts of CS - fix: CS Phishing Exploit. + - fix: Groups admin gui + - fix: Wiki does not show history correctly 7.3.1 - Fixed a problem with IE and resizable text areas that caused IE to crash diff --git a/lib/WebGUI/Asset/WikiPage.pm b/lib/WebGUI/Asset/WikiPage.pm index 614a8f411..ceaeac6a4 100644 --- a/lib/WebGUI/Asset/WikiPage.pm +++ b/lib/WebGUI/Asset/WikiPage.pm @@ -310,16 +310,17 @@ sub www_getHistory { return $self->session->privilege->insufficient unless $self->canEdit; my $var = {}; my ($icon, $date) = $self->session->quick(qw(icon datetime)); + my $i18n = WebGUI::International->new($self->session, 'Asset_WikPage'); foreach my $revision (@{$self->getRevisions}) { - my $user = WebGUI::User->new($self->session, $self->get("actionTakenBy")); + my $user = WebGUI::User->new($self->session, $revision->get("actionTakenBy")); push(@{$var->{pageHistoryEntries}}, { - toolbar => $icon->delete("func=purgeRevision;revisionDate=".$self->get("revisionDate"), $self->get("url"), "Delete this revision?") - .$icon->edit('func=edit;revision='.$self->get("revisionDate"), $self->get("url")) - .$icon->view('func=view;revision='.$self->get("revisionDate"), $self->get("url")), - date => $date->epochToHuman($self->get("revisionDate")), + toolbar => $icon->delete("func=purgeRevision;revisionDate=".$revision->get("revisionDate"), $revision->get("url"), $i18n->get("delete confirmation")); + .$icon->edit('func=edit;revision='.$revision->get("revisionDate"), $revision->get("url")) + .$icon->view('func=view;revision='.$revision->get("revisionDate"), $revision->get("url")), + date => $date->epochToHuman($revision->get("revisionDate")), username => $user->username, - actionTaken => $self->get("actionTaken"), - interval => join(" ", $date->secondsToInterval(time() - $self->get("revisionDate"))) + actionTaken => $revision->get("actionTaken"), + interval => join(" ", $date->secondsToInterval(time() - $revision->get("revisionDate"))) }); } return $self->processTemplate($var, $self->getWiki->get('pageHistoryTemplateId')); diff --git a/lib/WebGUI/Help/Asset_WikiPage.pm b/lib/WebGUI/Help/Asset_WikiPage.pm index a31f1c505..a45085950 100644 --- a/lib/WebGUI/Help/Asset_WikiPage.pm +++ b/lib/WebGUI/Help/Asset_WikiPage.pm @@ -119,6 +119,32 @@ our $HELP = { ], }, + 'history template' => { + title => 'history title', + body => 'history body', + isa => [ + ], + variables => [ + { + 'name' => 'history toolbar', + }, + { + 'name' => 'history date', + }, + { + 'name' => 'history username', + }, + { + 'name' => 'history actionTaken', + }, + { + 'name' => 'history interval', + }, + ], + related => [ + ], + }, + }; 1; diff --git a/lib/WebGUI/Operation/Group.pm b/lib/WebGUI/Operation/Group.pm index 181af2795..7f4937f8f 100644 --- a/lib/WebGUI/Operation/Group.pm +++ b/lib/WebGUI/Operation/Group.pm @@ -118,7 +118,7 @@ sub getGroupSearchForm { ); $f->selectBox( -name=>"modifier", - -value=>($session->scratch->get("groupSearchModifier") || $i18n->get("contains") ), + -value=>($session->scratch->get("groupSearchModifier") || "contains" ), -options=>{ startsWith=>$i18n->get("starts with"), contains=>$i18n->get("contains"), diff --git a/lib/WebGUI/i18n/English/Asset_WikiPage.pm b/lib/WebGUI/i18n/English/Asset_WikiPage.pm index bb744aaac..03bdc0cfc 100644 --- a/lib/WebGUI/i18n/English/Asset_WikiPage.pm +++ b/lib/WebGUI/i18n/English/Asset_WikiPage.pm @@ -182,6 +182,46 @@ our $I18N = lastUpdated => 1165812138, }, + 'history title' => { + message => q|Wiki Page, Show History Template|, + lastUpdated => 1166050472, + }, + + 'history body' => { + message => q|These variables are available for use in the template for displaying the history of edits and changes to a Wiki Page.|, + lastUpdated => 1165812138, + }, + + 'history toolbar' => { + message => q|A toolbar with icons to delete, edit, or view revisions of this page.|, + lastUpdated => 1165812138, + }, + + 'history date' => { + message => q|The date this revision of the page was committed.|, + lastUpdated => 1165812138, + }, + + 'history username' => { + message => q|The name of the user who committed this page.|, + lastUpdated => 1165812138, + }, + + 'history actionTaken' => { + message => q|The action that was taken in the revision, usually this will be "Edit".|, + lastUpdated => 1165812138, + }, + + 'history interval' => { + message => q|How long ago the page was committed.|, + lastUpdated => 1165812138, + }, + + 'delete confirmation' => { + message => q|Delete this revision?|, + lastUpdated => 1166484508, + }, + }; 1;