1
# See bottom of file for license and copyright information
3
package Foswiki::UI::Changes;
12
require Foswiki::Time;
14
# Command handler for changes command
18
my $query = $session->{request};
19
my $webName = $session->{webName};
20
my $topic = $session->{topicName};
22
Foswiki::UI::checkWebExists( $session, $webName, $topic, 'find changes in' );
24
my $skin = $session->getSkin();
26
my $text = $session->templates->readTemplate( 'changes', $skin );
28
my ( $page, $eachChange, $after ) = split( /%REPEAT%/, $text );
30
my $showMinor = $query->param('minor');
34
. 'This page is showing major changes only. '
37
href => $query->url() . "/$webName?minor=1",
42
$comment = CGI::div( { class => 'foswikiHelp' }, $comment );
47
my $iterator = $session->{store}->eachChange( $webName, 0 );
49
while ( $iterator->hasNext() ) {
50
my $change = $iterator->next();
52
if ( !$showMinor && $change->{more} && $change->{more} =~ /minor/ );
53
next if $done{ $change->{topic} };
55
unless $session->{store}->topicExists( $webName, $change->{topic} );
57
my $summary = $session->renderer->summariseChanges(
58
$session->{user}, $webName,
59
$change->{topic}, $change->{revision}
61
my $thisChange = $eachChange;
62
$thisChange =~ s/%TOPICNAME%/$change->{topic}/go;
65
? $session->{users}->webDotWikiName( $change->{user} )
67
$thisChange =~ s/%AUTHOR%/$wikiuser/go;
68
my $time = Foswiki::Time::formatTime( $change->{time} );
69
$change->{revision} = 1 unless $change->{revision};
70
my $srev = 'r' . $change->{revision};
72
if ( $change->{revision} == 1 ) {
73
$srev = CGI::span( { class => 'foswikiNew' }, 'NEW' );
75
$thisChange =~ s/%TIME%/$time/g;
76
$thisChange =~ s/%REVISION%/$srev/go;
78
$session->renderer->getRenderedVersion( $thisChange, $webName,
80
$thisChange =~ s/%TEXTHEAD%/$summary/go;
83
catch Foswiki::AccessControlException with {
85
# ignore changes we can't see
87
$done{ $change->{topic} } = 1;
89
if ( $Foswiki::cfg{Log}{changes} ) {
92
$session->logEvent('changes', $webName, '' );
96
$page = $session->handleCommonTags( $page, $webName, $topic );
97
$page = $session->renderer->getRenderedVersion( $page, $webName, $topic );
99
$session->writeCompletePage($page);
104
# Module of Foswiki - The Free and Open Source Wiki, http://foswiki.org/
106
# Copyright (C) 2008-2009 Foswiki Contributors. Foswiki Contributors
107
# are listed in the AUTHORS file in the root of this distribution.
108
# NOTE: Please extend that file, not this notice.
110
# Additional copyrights apply to some or all of the code in this
113
# Copyright (C) 1999-2007 Peter Thoeny, peter@thoeny.org
114
# and TWiki Contributors. All Rights Reserved. TWiki Contributors
115
# are listed in the AUTHORS file in the root of this distribution.
116
# Based on parts of Ward Cunninghams original Wiki and JosWiki.
117
# Copyright (C) 1998 Markus Peter - SPiN GmbH (warpi@spin.de)
118
# Some changes by Dave Harris (drh@bhresearch.co.uk) incorporated
120
# This program is free software; you can redistribute it and/or
121
# modify it under the terms of the GNU General Public License
122
# as published by the Free Software Foundation; either version 2
123
# of the License, or (at your option) any later version. For
124
# more details read LICENSE in the root of this distribution.
126
# This program is distributed in the hope that it will be useful,
127
# but WITHOUT ANY WARRANTY; without even the implied warranty of
128
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
130
# As per the GPL, removal of this notice is prohibited.